react-aichatbot-widget 1.4.4 → 1.4.5
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/README.md +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.js +430 -405
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as O, jsx as y, Fragment as Ee } from "react/jsx-runtime";
|
|
2
2
|
import { useState as L, useRef as Rt, useEffect as Ke } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Minus as Ct, MessageCircle as Xe, Send as Ye, Bot as Pe, Minimize2 as Tt, Maximize2 as Ot, X as At } from "lucide-react";
|
|
4
4
|
import { v4 as kt } from "uuid";
|
|
5
|
-
const Ft = ({
|
|
5
|
+
const Ft = ({ onMinimise: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
6
6
|
const o = r.position === "left", l = {
|
|
7
7
|
position: "fixed",
|
|
8
8
|
bottom: "32px",
|
|
@@ -26,17 +26,17 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
26
26
|
transform: "scale(1.10)",
|
|
27
27
|
boxShadow: "0 25px 35px -5px rgba(0,0,0,0.2)"
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ O(
|
|
30
30
|
"button",
|
|
31
31
|
{
|
|
32
32
|
onClick: e,
|
|
33
33
|
style: l,
|
|
34
34
|
onMouseEnter: (c) => Object.assign(c.currentTarget.style, p),
|
|
35
|
-
onMouseLeave: (c) => Object.keys(p).forEach((
|
|
35
|
+
onMouseLeave: (c) => Object.keys(p).forEach((u) => c.currentTarget.style[u] = l[u] || ""),
|
|
36
36
|
onFocus: (c) => Object.assign(c.currentTarget.style, p),
|
|
37
|
-
onBlur: (c) => Object.keys(p).forEach((
|
|
37
|
+
onBlur: (c) => Object.keys(p).forEach((u) => c.currentTarget.style[u] = l[u] || ""),
|
|
38
38
|
children: [
|
|
39
|
-
t ? /* @__PURE__ */ y(Ct, { size:
|
|
39
|
+
t ? /* @__PURE__ */ y(Ct, { size: 20, strokeWidth: 2.5 }) : /* @__PURE__ */ y(Xe, { size: 20, strokeWidth: 2.5 }),
|
|
40
40
|
!t && /* @__PURE__ */ y("span", { style: {
|
|
41
41
|
position: "absolute",
|
|
42
42
|
top: "-4px",
|
|
@@ -44,7 +44,6 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
44
44
|
width: "16px",
|
|
45
45
|
height: "16px",
|
|
46
46
|
backgroundColor: "#34d399",
|
|
47
|
-
// emerald-400
|
|
48
47
|
borderRadius: "50%",
|
|
49
48
|
border: "4px solid white",
|
|
50
49
|
animation: "pulse 2s infinite"
|
|
@@ -68,8 +67,8 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
68
67
|
}, Nt = ({ onSendMessage: e, isLoading: t, theme: n }) => {
|
|
69
68
|
const [r, o] = L(""), i = () => {
|
|
70
69
|
!r.trim() || t || (e(r.trim()), o(""));
|
|
71
|
-
}, s = (
|
|
72
|
-
|
|
70
|
+
}, s = (u) => {
|
|
71
|
+
u.key === "Enter" && !u.shiftKey && (u.preventDefault(), i());
|
|
73
72
|
}, l = {
|
|
74
73
|
padding: "16px",
|
|
75
74
|
borderTop: "1px solid rgba(255, 255, 255, 0.2)",
|
|
@@ -80,7 +79,7 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
80
79
|
display: "flex",
|
|
81
80
|
gap: "12px",
|
|
82
81
|
alignItems: "center"
|
|
83
|
-
},
|
|
82
|
+
}, d = {
|
|
84
83
|
flex: 1,
|
|
85
84
|
padding: "12px 16px",
|
|
86
85
|
background: n.inputBackgroundColor || n.backgroundColor,
|
|
@@ -110,22 +109,22 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
110
109
|
transition: "all 0.2s ease",
|
|
111
110
|
minWidth: "48px"
|
|
112
111
|
};
|
|
113
|
-
return /* @__PURE__ */ y("div", { style: l, children: /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ y("div", { style: l, children: /* @__PURE__ */ O("div", { style: p, children: [
|
|
114
113
|
/* @__PURE__ */ y(
|
|
115
114
|
"input",
|
|
116
115
|
{
|
|
117
116
|
type: "text",
|
|
118
117
|
placeholder: "Type a message...",
|
|
119
118
|
value: r,
|
|
120
|
-
onChange: (
|
|
119
|
+
onChange: (u) => o(u.target.value),
|
|
121
120
|
onKeyDown: s,
|
|
122
121
|
disabled: t,
|
|
123
|
-
style:
|
|
124
|
-
onFocus: (
|
|
125
|
-
|
|
122
|
+
style: d,
|
|
123
|
+
onFocus: (u) => {
|
|
124
|
+
u.target.style.boxShadow = "0 0 0 3px rgba(100, 150, 255, 0.3)", u.target.style.borderColor = "#60a5fa";
|
|
126
125
|
},
|
|
127
|
-
onBlur: (
|
|
128
|
-
|
|
126
|
+
onBlur: (u) => {
|
|
127
|
+
u.target.style.boxShadow = "none", u.target.style.borderColor = n.fontColor;
|
|
129
128
|
}
|
|
130
129
|
}
|
|
131
130
|
),
|
|
@@ -136,11 +135,11 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
136
135
|
disabled: t || !r.trim(),
|
|
137
136
|
style: c,
|
|
138
137
|
"aria-label": "Send message",
|
|
139
|
-
onMouseEnter: (
|
|
140
|
-
!t && r.trim() && (
|
|
138
|
+
onMouseEnter: (u) => {
|
|
139
|
+
!t && r.trim() && (u.currentTarget.style.transform = "translateY(-2px)", u.currentTarget.style.boxShadow = "0 8px 16px rgba(0,0,0,0.15)");
|
|
141
140
|
},
|
|
142
|
-
onMouseLeave: (
|
|
143
|
-
|
|
141
|
+
onMouseLeave: (u) => {
|
|
142
|
+
u.currentTarget.style.transform = "translateY(0)", u.currentTarget.style.boxShadow = "none";
|
|
144
143
|
},
|
|
145
144
|
children: /* @__PURE__ */ y(Ye, { size: 18 })
|
|
146
145
|
}
|
|
@@ -150,10 +149,19 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
150
149
|
const r = Rt(null), o = () => {
|
|
151
150
|
r.current?.scrollIntoView({ behavior: "smooth" });
|
|
152
151
|
};
|
|
152
|
+
function i(u) {
|
|
153
|
+
return new Date(u).toLocaleString("en-AU", {
|
|
154
|
+
day: "numeric",
|
|
155
|
+
month: "short",
|
|
156
|
+
year: "numeric",
|
|
157
|
+
hour: "2-digit",
|
|
158
|
+
minute: "2-digit"
|
|
159
|
+
});
|
|
160
|
+
}
|
|
153
161
|
Ke(() => {
|
|
154
162
|
o();
|
|
155
163
|
}, [e, t]);
|
|
156
|
-
const
|
|
164
|
+
const s = {
|
|
157
165
|
flex: 1,
|
|
158
166
|
overflowY: "auto",
|
|
159
167
|
padding: "20px",
|
|
@@ -163,32 +171,32 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
163
171
|
display: "flex",
|
|
164
172
|
flexDirection: "column",
|
|
165
173
|
gap: "16px"
|
|
166
|
-
},
|
|
174
|
+
}, l = (u) => ({
|
|
167
175
|
display: "flex",
|
|
168
|
-
justifyContent:
|
|
176
|
+
justifyContent: u === "user" ? "flex-end" : "flex-start",
|
|
169
177
|
width: "100%"
|
|
170
|
-
}),
|
|
178
|
+
}), p = {
|
|
171
179
|
display: "flex",
|
|
172
180
|
flexDirection: "column",
|
|
173
181
|
maxWidth: "80%"
|
|
174
|
-
},
|
|
182
|
+
}, d = (u) => ({
|
|
175
183
|
padding: "12px 16px",
|
|
176
184
|
borderRadius: "16px",
|
|
177
185
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
|
|
178
186
|
border: "1px solid #e4e4e7",
|
|
179
187
|
fontSize: "14px",
|
|
180
188
|
lineHeight: "1.5",
|
|
181
|
-
background:
|
|
189
|
+
background: u === "user" ? n.primaryColor : n.backgroundColor,
|
|
182
190
|
color: n.fontColor,
|
|
183
191
|
wordWrap: "break-word"
|
|
184
|
-
}),
|
|
185
|
-
...
|
|
192
|
+
}), c = {
|
|
193
|
+
...d("bot"),
|
|
186
194
|
animation: "fadeIn 0.3s ease-in-out, pulse 1.5s ease-in-out infinite",
|
|
187
195
|
animationDelay: "0s, 0.3s"
|
|
188
196
|
};
|
|
189
|
-
return /* @__PURE__ */
|
|
190
|
-
e.map((
|
|
191
|
-
|
|
197
|
+
return /* @__PURE__ */ O("div", { style: s, children: [
|
|
198
|
+
e.map((u, g) => /* @__PURE__ */ y("div", { style: l(u.type), children: /* @__PURE__ */ O("div", { style: p, children: [
|
|
199
|
+
u.type === "bot" && /* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: "4px", justifyContent: "flex-start", marginLeft: "4px", marginBottom: "2px" }, children: [
|
|
192
200
|
/* @__PURE__ */ y(Pe, { size: 14, color: n.fontColor }),
|
|
193
201
|
/* @__PURE__ */ y(
|
|
194
202
|
"span",
|
|
@@ -198,11 +206,11 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
198
206
|
opacity: 0.55,
|
|
199
207
|
color: n.fontColor
|
|
200
208
|
},
|
|
201
|
-
children:
|
|
209
|
+
children: i(u.response_timestamp)
|
|
202
210
|
}
|
|
203
211
|
)
|
|
204
212
|
] }),
|
|
205
|
-
|
|
213
|
+
u.type === "user" && /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: "4px", justifyContent: "flex-end", marginRight: "4px", marginBottom: "2px" }, children: /* @__PURE__ */ y(
|
|
206
214
|
"span",
|
|
207
215
|
{
|
|
208
216
|
style: {
|
|
@@ -213,10 +221,10 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
213
221
|
children: "You"
|
|
214
222
|
}
|
|
215
223
|
) }),
|
|
216
|
-
/* @__PURE__ */ y("div", { style:
|
|
217
|
-
] }) },
|
|
218
|
-
t && /* @__PURE__ */ y("div", { style:
|
|
219
|
-
typingBubbleStyle:
|
|
224
|
+
/* @__PURE__ */ y("div", { style: d(u.type), children: u.text })
|
|
225
|
+
] }) }, g)),
|
|
226
|
+
t && /* @__PURE__ */ y("div", { style: l("bot"), children: /* @__PURE__ */ O("div", { style: {
|
|
227
|
+
typingBubbleStyle: c,
|
|
220
228
|
display: "flex",
|
|
221
229
|
alignItems: "center",
|
|
222
230
|
gap: "8px"
|
|
@@ -249,7 +257,7 @@ const Lt = de("string"), P = de("function"), et = de("number"), ee = (e) => e !=
|
|
|
249
257
|
return !1;
|
|
250
258
|
const t = Re(e);
|
|
251
259
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Qe in e) && !(ce in e);
|
|
252
|
-
},
|
|
260
|
+
}, Dt = (e) => {
|
|
253
261
|
if (!ee(e) || Z(e))
|
|
254
262
|
return !1;
|
|
255
263
|
try {
|
|
@@ -257,11 +265,11 @@ const Lt = de("string"), P = de("function"), et = de("number"), ee = (e) => e !=
|
|
|
257
265
|
} catch {
|
|
258
266
|
return !1;
|
|
259
267
|
}
|
|
260
|
-
},
|
|
268
|
+
}, jt = B("Date"), It = B("File"), vt = B("Blob"), Mt = B("FileList"), zt = (e) => ee(e) && P(e.pipe), qt = (e) => {
|
|
261
269
|
let t;
|
|
262
270
|
return e && (typeof FormData == "function" && e instanceof FormData || P(e.append) && ((t = ue(e)) === "formdata" || // detect form-data instance
|
|
263
271
|
t === "object" && P(e.toString) && e.toString() === "[object FormData]"));
|
|
264
|
-
},
|
|
272
|
+
}, Ht = B("URLSearchParams"), [$t, Wt, Jt, Vt] = ["ReadableStream", "Request", "Response", "Headers"].map(B), Kt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
265
273
|
function te(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
266
274
|
if (e === null || typeof e > "u")
|
|
267
275
|
return;
|
|
@@ -289,7 +297,7 @@ function tt(e, t) {
|
|
|
289
297
|
return o;
|
|
290
298
|
return null;
|
|
291
299
|
}
|
|
292
|
-
const
|
|
300
|
+
const q = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, nt = (e) => !V(e) && e !== q;
|
|
293
301
|
function ge() {
|
|
294
302
|
const { caseless: e, skipUndefined: t } = nt(this) && this || {}, n = {}, r = (o, i) => {
|
|
295
303
|
const s = e && tt(n, i) || i;
|
|
@@ -398,39 +406,39 @@ const pn = (e) => {
|
|
|
398
406
|
return r;
|
|
399
407
|
};
|
|
400
408
|
return n(e, 0);
|
|
401
|
-
}, hn = B("AsyncFunction"), mn = (e) => e && (ee(e) || P(e)) && P(e.then) && P(e.catch), ot = ((e, t) => e ? setImmediate : t ? ((n, r) => (
|
|
402
|
-
o ===
|
|
409
|
+
}, hn = B("AsyncFunction"), mn = (e) => e && (ee(e) || P(e)) && P(e.then) && P(e.catch), ot = ((e, t) => e ? setImmediate : t ? ((n, r) => (q.addEventListener("message", ({ source: o, data: i }) => {
|
|
410
|
+
o === q && i === n && r.length && r.shift()();
|
|
403
411
|
}, !1), (o) => {
|
|
404
|
-
r.push(o),
|
|
412
|
+
r.push(o), q.postMessage(n, "*");
|
|
405
413
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
406
414
|
typeof setImmediate == "function",
|
|
407
|
-
P(
|
|
408
|
-
), yn = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
415
|
+
P(q.postMessage)
|
|
416
|
+
), yn = typeof queueMicrotask < "u" ? queueMicrotask.bind(q) : typeof process < "u" && process.nextTick || ot, bn = (e) => e != null && P(e[ce]), a = {
|
|
409
417
|
isArray: K,
|
|
410
418
|
isArrayBuffer: Ze,
|
|
411
419
|
isBuffer: Z,
|
|
412
|
-
isFormData:
|
|
420
|
+
isFormData: qt,
|
|
413
421
|
isArrayBufferView: Ut,
|
|
414
422
|
isString: Lt,
|
|
415
423
|
isNumber: et,
|
|
416
424
|
isBoolean: Bt,
|
|
417
425
|
isObject: ee,
|
|
418
426
|
isPlainObject: se,
|
|
419
|
-
isEmptyObject:
|
|
427
|
+
isEmptyObject: Dt,
|
|
420
428
|
isReadableStream: $t,
|
|
421
429
|
isRequest: Wt,
|
|
422
430
|
isResponse: Jt,
|
|
423
431
|
isHeaders: Vt,
|
|
424
432
|
isUndefined: V,
|
|
425
|
-
isDate:
|
|
433
|
+
isDate: jt,
|
|
426
434
|
isFile: It,
|
|
427
435
|
isBlob: vt,
|
|
428
436
|
isRegExp: an,
|
|
429
437
|
isFunction: P,
|
|
430
|
-
isStream:
|
|
431
|
-
isURLSearchParams:
|
|
438
|
+
isStream: zt,
|
|
439
|
+
isURLSearchParams: Ht,
|
|
432
440
|
isTypedArray: tn,
|
|
433
|
-
isFileList:
|
|
441
|
+
isFileList: Mt,
|
|
434
442
|
forEach: te,
|
|
435
443
|
merge: ge,
|
|
436
444
|
extend: Xt,
|
|
@@ -455,7 +463,7 @@ const pn = (e) => {
|
|
|
455
463
|
noop: un,
|
|
456
464
|
toFiniteNumber: dn,
|
|
457
465
|
findKey: tt,
|
|
458
|
-
global:
|
|
466
|
+
global: q,
|
|
459
467
|
isContextDefined: nt,
|
|
460
468
|
isSpecCompliantForm: fn,
|
|
461
469
|
toJSONObject: pn,
|
|
@@ -513,7 +521,7 @@ b.from = (e, t, n, r, o, i) => {
|
|
|
513
521
|
const s = Object.create(st);
|
|
514
522
|
a.toFlatObject(e, s, function(c) {
|
|
515
523
|
return c !== Error.prototype;
|
|
516
|
-
}, (
|
|
524
|
+
}, (d) => d !== "isAxiosError");
|
|
517
525
|
const l = e && e.message ? e.message : "Error", p = t == null && e ? e.code : t;
|
|
518
526
|
return b.call(s, l, p, n, r, o), e && s.cause == null && Object.defineProperty(s, "cause", { value: e, configurable: !0 }), s.name = e && e.name || "Error", i && Object.assign(s, i), s;
|
|
519
527
|
};
|
|
@@ -548,50 +556,50 @@ function fe(e, t, n) {
|
|
|
548
556
|
const r = n.metaTokens, o = n.visitor || c, i = n.dots, s = n.indexes, p = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
549
557
|
if (!a.isFunction(o))
|
|
550
558
|
throw new TypeError("visitor must be a function");
|
|
551
|
-
function
|
|
552
|
-
if (
|
|
553
|
-
if (a.isDate(
|
|
554
|
-
return
|
|
555
|
-
if (a.isBoolean(
|
|
556
|
-
return
|
|
557
|
-
if (!p && a.isBlob(
|
|
559
|
+
function d(f) {
|
|
560
|
+
if (f === null) return "";
|
|
561
|
+
if (a.isDate(f))
|
|
562
|
+
return f.toISOString();
|
|
563
|
+
if (a.isBoolean(f))
|
|
564
|
+
return f.toString();
|
|
565
|
+
if (!p && a.isBlob(f))
|
|
558
566
|
throw new b("Blob is not supported. Use a Buffer instead.");
|
|
559
|
-
return a.isArrayBuffer(
|
|
567
|
+
return a.isArrayBuffer(f) || a.isTypedArray(f) ? p && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
560
568
|
}
|
|
561
|
-
function c(
|
|
562
|
-
let w =
|
|
563
|
-
if (
|
|
569
|
+
function c(f, m, h) {
|
|
570
|
+
let w = f;
|
|
571
|
+
if (f && !h && typeof f == "object") {
|
|
564
572
|
if (a.endsWith(m, "{}"))
|
|
565
|
-
m = r ? m : m.slice(0, -2),
|
|
566
|
-
else if (a.isArray(
|
|
567
|
-
return m = at(m), w.forEach(function(
|
|
568
|
-
!(a.isUndefined(
|
|
573
|
+
m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
574
|
+
else if (a.isArray(f) && xn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (w = a.toArray(f)))
|
|
575
|
+
return m = at(m), w.forEach(function(x, T) {
|
|
576
|
+
!(a.isUndefined(x) || x === null) && t.append(
|
|
569
577
|
// eslint-disable-next-line no-nested-ternary
|
|
570
|
-
s === !0 ? Ue([m],
|
|
571
|
-
|
|
578
|
+
s === !0 ? Ue([m], T, i) : s === null ? m : m + "[]",
|
|
579
|
+
d(x)
|
|
572
580
|
);
|
|
573
581
|
}), !1;
|
|
574
582
|
}
|
|
575
|
-
return xe(
|
|
583
|
+
return xe(f) ? !0 : (t.append(Ue(h, m, i), d(f)), !1);
|
|
576
584
|
}
|
|
577
|
-
const
|
|
585
|
+
const u = [], g = Object.assign(wn, {
|
|
578
586
|
defaultVisitor: c,
|
|
579
|
-
convertValue:
|
|
587
|
+
convertValue: d,
|
|
580
588
|
isVisitable: xe
|
|
581
589
|
});
|
|
582
|
-
function R(
|
|
583
|
-
if (!a.isUndefined(
|
|
584
|
-
if (
|
|
590
|
+
function R(f, m) {
|
|
591
|
+
if (!a.isUndefined(f)) {
|
|
592
|
+
if (u.indexOf(f) !== -1)
|
|
585
593
|
throw Error("Circular reference detected in " + m.join("."));
|
|
586
|
-
|
|
594
|
+
u.push(f), a.forEach(f, function(w, C) {
|
|
587
595
|
(!(a.isUndefined(w) || w === null) && o.call(
|
|
588
596
|
t,
|
|
589
597
|
w,
|
|
590
|
-
a.isString(
|
|
598
|
+
a.isString(C) ? C.trim() : C,
|
|
591
599
|
m,
|
|
592
600
|
g
|
|
593
|
-
)) === !0 && R(w, m ? m.concat(
|
|
594
|
-
}),
|
|
601
|
+
)) === !0 && R(w, m ? m.concat(C) : [C]);
|
|
602
|
+
}), u.pop();
|
|
595
603
|
}
|
|
596
604
|
}
|
|
597
605
|
if (!a.isObject(e))
|
|
@@ -719,14 +727,14 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", kn
|
|
|
719
727
|
hasStandardBrowserWebWorkerEnv: An,
|
|
720
728
|
navigator: we,
|
|
721
729
|
origin: kn
|
|
722
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
730
|
+
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
723
731
|
...Fn,
|
|
724
732
|
...Tn
|
|
725
733
|
};
|
|
726
734
|
function Nn(e, t) {
|
|
727
|
-
return fe(e, new
|
|
735
|
+
return fe(e, new N.classes.URLSearchParams(), {
|
|
728
736
|
visitor: function(n, r, o, i) {
|
|
729
|
-
return
|
|
737
|
+
return N.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
730
738
|
},
|
|
731
739
|
...t
|
|
732
740
|
});
|
|
@@ -821,8 +829,8 @@ const ne = {
|
|
|
821
829
|
maxContentLength: -1,
|
|
822
830
|
maxBodyLength: -1,
|
|
823
831
|
env: {
|
|
824
|
-
FormData:
|
|
825
|
-
Blob:
|
|
832
|
+
FormData: N.classes.FormData,
|
|
833
|
+
Blob: N.classes.Blob
|
|
826
834
|
},
|
|
827
835
|
validateStatus: function(t) {
|
|
828
836
|
return t >= 200 && t < 300;
|
|
@@ -862,21 +870,21 @@ const Ln = a.toObjectSet([
|
|
|
862
870
|
`).forEach(function(s) {
|
|
863
871
|
o = s.indexOf(":"), n = s.substring(0, o).trim().toLowerCase(), r = s.substring(o + 1).trim(), !(!n || t[n] && Ln[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
864
872
|
}), t;
|
|
865
|
-
},
|
|
873
|
+
}, De = Symbol("internals");
|
|
866
874
|
function Q(e) {
|
|
867
875
|
return e && String(e).trim().toLowerCase();
|
|
868
876
|
}
|
|
869
877
|
function ie(e) {
|
|
870
878
|
return e === !1 || e == null ? e : a.isArray(e) ? e.map(ie) : String(e);
|
|
871
879
|
}
|
|
872
|
-
function
|
|
880
|
+
function Dn(e) {
|
|
873
881
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
874
882
|
let r;
|
|
875
883
|
for (; r = n.exec(e); )
|
|
876
884
|
t[r[1]] = r[2];
|
|
877
885
|
return t;
|
|
878
886
|
}
|
|
879
|
-
const
|
|
887
|
+
const jn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
880
888
|
function me(e, t, n, r, o) {
|
|
881
889
|
if (a.isFunction(r))
|
|
882
890
|
return r.call(this, t, n);
|
|
@@ -907,24 +915,24 @@ let _ = class {
|
|
|
907
915
|
}
|
|
908
916
|
set(t, n, r) {
|
|
909
917
|
const o = this;
|
|
910
|
-
function i(l, p,
|
|
918
|
+
function i(l, p, d) {
|
|
911
919
|
const c = Q(p);
|
|
912
920
|
if (!c)
|
|
913
921
|
throw new Error("header name must be a non-empty string");
|
|
914
|
-
const
|
|
915
|
-
(!
|
|
922
|
+
const u = a.findKey(o, c);
|
|
923
|
+
(!u || o[u] === void 0 || d === !0 || d === void 0 && o[u] !== !1) && (o[u || p] = ie(l));
|
|
916
924
|
}
|
|
917
|
-
const s = (l, p) => a.forEach(l, (
|
|
925
|
+
const s = (l, p) => a.forEach(l, (d, c) => i(d, c, p));
|
|
918
926
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
919
927
|
s(t, n);
|
|
920
|
-
else if (a.isString(t) && (t = t.trim()) && !
|
|
928
|
+
else if (a.isString(t) && (t = t.trim()) && !jn(t))
|
|
921
929
|
s(Bn(t), n);
|
|
922
930
|
else if (a.isObject(t) && a.isIterable(t)) {
|
|
923
|
-
let l = {}, p,
|
|
931
|
+
let l = {}, p, d;
|
|
924
932
|
for (const c of t) {
|
|
925
933
|
if (!a.isArray(c))
|
|
926
934
|
throw TypeError("Object iterator must return a key-value pair");
|
|
927
|
-
l[
|
|
935
|
+
l[d = c[0]] = (p = l[d]) ? a.isArray(p) ? [...p, c[1]] : [p, c[1]] : c[1];
|
|
928
936
|
}
|
|
929
937
|
s(l, n);
|
|
930
938
|
} else
|
|
@@ -939,7 +947,7 @@ let _ = class {
|
|
|
939
947
|
if (!n)
|
|
940
948
|
return o;
|
|
941
949
|
if (n === !0)
|
|
942
|
-
return
|
|
950
|
+
return Dn(o);
|
|
943
951
|
if (a.isFunction(n))
|
|
944
952
|
return n.call(this, o, r);
|
|
945
953
|
if (a.isRegExp(n))
|
|
@@ -1017,7 +1025,7 @@ let _ = class {
|
|
|
1017
1025
|
return n.forEach((o) => r.set(o)), r;
|
|
1018
1026
|
}
|
|
1019
1027
|
static accessor(t) {
|
|
1020
|
-
const r = (this[
|
|
1028
|
+
const r = (this[De] = this[De] = {
|
|
1021
1029
|
accessors: {}
|
|
1022
1030
|
}).accessors, o = this.prototype;
|
|
1023
1031
|
function i(s) {
|
|
@@ -1064,68 +1072,68 @@ function pt(e, t, n) {
|
|
|
1064
1072
|
n
|
|
1065
1073
|
));
|
|
1066
1074
|
}
|
|
1067
|
-
function
|
|
1075
|
+
function Mn(e) {
|
|
1068
1076
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
1069
1077
|
return t && t[1] || "";
|
|
1070
1078
|
}
|
|
1071
|
-
function
|
|
1079
|
+
function zn(e, t) {
|
|
1072
1080
|
e = e || 10;
|
|
1073
1081
|
const n = new Array(e), r = new Array(e);
|
|
1074
1082
|
let o = 0, i = 0, s;
|
|
1075
1083
|
return t = t !== void 0 ? t : 1e3, function(p) {
|
|
1076
|
-
const
|
|
1077
|
-
s || (s =
|
|
1078
|
-
let
|
|
1079
|
-
for (;
|
|
1080
|
-
g += n[
|
|
1081
|
-
if (o = (o + 1) % e, o === i && (i = (i + 1) % e),
|
|
1084
|
+
const d = Date.now(), c = r[i];
|
|
1085
|
+
s || (s = d), n[o] = p, r[o] = d;
|
|
1086
|
+
let u = i, g = 0;
|
|
1087
|
+
for (; u !== o; )
|
|
1088
|
+
g += n[u++], u = u % e;
|
|
1089
|
+
if (o = (o + 1) % e, o === i && (i = (i + 1) % e), d - s < t)
|
|
1082
1090
|
return;
|
|
1083
|
-
const R = c &&
|
|
1091
|
+
const R = c && d - c;
|
|
1084
1092
|
return R ? Math.round(g * 1e3 / R) : void 0;
|
|
1085
1093
|
};
|
|
1086
1094
|
}
|
|
1087
|
-
function
|
|
1095
|
+
function qn(e, t) {
|
|
1088
1096
|
let n = 0, r = 1e3 / t, o, i;
|
|
1089
|
-
const s = (
|
|
1090
|
-
n = c, o = null, i && (clearTimeout(i), i = null), e(...
|
|
1097
|
+
const s = (d, c = Date.now()) => {
|
|
1098
|
+
n = c, o = null, i && (clearTimeout(i), i = null), e(...d);
|
|
1091
1099
|
};
|
|
1092
|
-
return [(...
|
|
1093
|
-
const c = Date.now(),
|
|
1094
|
-
|
|
1100
|
+
return [(...d) => {
|
|
1101
|
+
const c = Date.now(), u = c - n;
|
|
1102
|
+
u >= r ? s(d, c) : (o = d, i || (i = setTimeout(() => {
|
|
1095
1103
|
i = null, s(o);
|
|
1096
|
-
}, r -
|
|
1104
|
+
}, r - u)));
|
|
1097
1105
|
}, () => o && s(o)];
|
|
1098
1106
|
}
|
|
1099
1107
|
const le = (e, t, n = 3) => {
|
|
1100
1108
|
let r = 0;
|
|
1101
|
-
const o =
|
|
1102
|
-
return
|
|
1103
|
-
const s = i.loaded, l = i.lengthComputable ? i.total : void 0, p = s - r,
|
|
1109
|
+
const o = zn(50, 250);
|
|
1110
|
+
return qn((i) => {
|
|
1111
|
+
const s = i.loaded, l = i.lengthComputable ? i.total : void 0, p = s - r, d = o(p), c = s <= l;
|
|
1104
1112
|
r = s;
|
|
1105
|
-
const
|
|
1113
|
+
const u = {
|
|
1106
1114
|
loaded: s,
|
|
1107
1115
|
total: l,
|
|
1108
1116
|
progress: l ? s / l : void 0,
|
|
1109
1117
|
bytes: p,
|
|
1110
|
-
rate:
|
|
1111
|
-
estimated:
|
|
1118
|
+
rate: d || void 0,
|
|
1119
|
+
estimated: d && l && c ? (l - s) / d : void 0,
|
|
1112
1120
|
event: i,
|
|
1113
1121
|
lengthComputable: l != null,
|
|
1114
1122
|
[t ? "download" : "upload"]: !0
|
|
1115
1123
|
};
|
|
1116
|
-
e(
|
|
1124
|
+
e(u);
|
|
1117
1125
|
}, n);
|
|
1118
|
-
},
|
|
1126
|
+
}, je = (e, t) => {
|
|
1119
1127
|
const n = e != null;
|
|
1120
1128
|
return [(r) => t[0]({
|
|
1121
1129
|
lengthComputable: n,
|
|
1122
1130
|
total: e,
|
|
1123
1131
|
loaded: r
|
|
1124
1132
|
}), t[1]];
|
|
1125
|
-
}, Ie = (e) => (...t) => a.asap(() => e(...t)),
|
|
1126
|
-
new URL(
|
|
1127
|
-
|
|
1128
|
-
) : () => !0, $n =
|
|
1133
|
+
}, Ie = (e) => (...t) => a.asap(() => e(...t)), Hn = N.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, N.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1134
|
+
new URL(N.origin),
|
|
1135
|
+
N.navigator && /(msie|trident)/i.test(N.navigator.userAgent)
|
|
1136
|
+
) : () => !0, $n = N.hasStandardBrowserEnv ? (
|
|
1129
1137
|
// Standard browser envs support document.cookie
|
|
1130
1138
|
{
|
|
1131
1139
|
write(e, t, n, r, o, i, s) {
|
|
@@ -1168,30 +1176,30 @@ const ve = (e) => e instanceof _ ? { ...e } : e;
|
|
|
1168
1176
|
function $(e, t) {
|
|
1169
1177
|
t = t || {};
|
|
1170
1178
|
const n = {};
|
|
1171
|
-
function r(
|
|
1172
|
-
return a.isPlainObject(
|
|
1179
|
+
function r(d, c, u, g) {
|
|
1180
|
+
return a.isPlainObject(d) && a.isPlainObject(c) ? a.merge.call({ caseless: g }, d, c) : a.isPlainObject(c) ? a.merge({}, c) : a.isArray(c) ? c.slice() : c;
|
|
1173
1181
|
}
|
|
1174
|
-
function o(
|
|
1182
|
+
function o(d, c, u, g) {
|
|
1175
1183
|
if (a.isUndefined(c)) {
|
|
1176
|
-
if (!a.isUndefined(
|
|
1177
|
-
return r(void 0,
|
|
1178
|
-
} else return r(
|
|
1184
|
+
if (!a.isUndefined(d))
|
|
1185
|
+
return r(void 0, d, u, g);
|
|
1186
|
+
} else return r(d, c, u, g);
|
|
1179
1187
|
}
|
|
1180
|
-
function i(
|
|
1188
|
+
function i(d, c) {
|
|
1181
1189
|
if (!a.isUndefined(c))
|
|
1182
1190
|
return r(void 0, c);
|
|
1183
1191
|
}
|
|
1184
|
-
function s(
|
|
1192
|
+
function s(d, c) {
|
|
1185
1193
|
if (a.isUndefined(c)) {
|
|
1186
|
-
if (!a.isUndefined(
|
|
1187
|
-
return r(void 0,
|
|
1194
|
+
if (!a.isUndefined(d))
|
|
1195
|
+
return r(void 0, d);
|
|
1188
1196
|
} else return r(void 0, c);
|
|
1189
1197
|
}
|
|
1190
|
-
function l(
|
|
1191
|
-
if (
|
|
1192
|
-
return r(
|
|
1193
|
-
if (
|
|
1194
|
-
return r(void 0,
|
|
1198
|
+
function l(d, c, u) {
|
|
1199
|
+
if (u in t)
|
|
1200
|
+
return r(d, c);
|
|
1201
|
+
if (u in e)
|
|
1202
|
+
return r(void 0, d);
|
|
1195
1203
|
}
|
|
1196
1204
|
const p = {
|
|
1197
1205
|
url: i,
|
|
@@ -1222,11 +1230,11 @@ function $(e, t) {
|
|
|
1222
1230
|
socketPath: s,
|
|
1223
1231
|
responseEncoding: s,
|
|
1224
1232
|
validateStatus: l,
|
|
1225
|
-
headers: (
|
|
1233
|
+
headers: (d, c, u) => o(ve(d), ve(c), u, !0)
|
|
1226
1234
|
};
|
|
1227
1235
|
return a.forEach(Object.keys({ ...e, ...t }), function(c) {
|
|
1228
|
-
const
|
|
1229
|
-
a.isUndefined(g) &&
|
|
1236
|
+
const u = p[c] || o, g = u(e[c], t[c], c);
|
|
1237
|
+
a.isUndefined(g) && u !== l || (n[c] = g);
|
|
1230
1238
|
}), n;
|
|
1231
1239
|
}
|
|
1232
1240
|
const mt = (e) => {
|
|
@@ -1236,16 +1244,16 @@ const mt = (e) => {
|
|
|
1236
1244
|
"Authorization",
|
|
1237
1245
|
"Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
|
|
1238
1246
|
), a.isFormData(n)) {
|
|
1239
|
-
if (
|
|
1247
|
+
if (N.hasStandardBrowserEnv || N.hasStandardBrowserWebWorkerEnv)
|
|
1240
1248
|
s.setContentType(void 0);
|
|
1241
1249
|
else if (a.isFunction(n.getHeaders)) {
|
|
1242
|
-
const p = n.getHeaders(),
|
|
1243
|
-
Object.entries(p).forEach(([c,
|
|
1244
|
-
|
|
1250
|
+
const p = n.getHeaders(), d = ["content-type", "content-length"];
|
|
1251
|
+
Object.entries(p).forEach(([c, u]) => {
|
|
1252
|
+
d.includes(c.toLowerCase()) && s.set(c, u);
|
|
1245
1253
|
});
|
|
1246
1254
|
}
|
|
1247
1255
|
}
|
|
1248
|
-
if (
|
|
1256
|
+
if (N.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Hn(t.url))) {
|
|
1249
1257
|
const p = o && i && $n.read(i);
|
|
1250
1258
|
p && s.set(o, p);
|
|
1251
1259
|
}
|
|
@@ -1255,55 +1263,55 @@ const mt = (e) => {
|
|
|
1255
1263
|
const o = mt(e);
|
|
1256
1264
|
let i = o.data;
|
|
1257
1265
|
const s = _.from(o.headers).normalize();
|
|
1258
|
-
let { responseType: l, onUploadProgress: p, onDownloadProgress:
|
|
1266
|
+
let { responseType: l, onUploadProgress: p, onDownloadProgress: d } = o, c, u, g, R, f;
|
|
1259
1267
|
function m() {
|
|
1260
|
-
R && R(),
|
|
1268
|
+
R && R(), f && f(), o.cancelToken && o.cancelToken.unsubscribe(c), o.signal && o.signal.removeEventListener("abort", c);
|
|
1261
1269
|
}
|
|
1262
1270
|
let h = new XMLHttpRequest();
|
|
1263
1271
|
h.open(o.method.toUpperCase(), o.url, !0), h.timeout = o.timeout;
|
|
1264
1272
|
function w() {
|
|
1265
1273
|
if (!h)
|
|
1266
1274
|
return;
|
|
1267
|
-
const
|
|
1275
|
+
const x = _.from(
|
|
1268
1276
|
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1269
|
-
),
|
|
1277
|
+
), F = {
|
|
1270
1278
|
data: !l || l === "text" || l === "json" ? h.responseText : h.response,
|
|
1271
1279
|
status: h.status,
|
|
1272
1280
|
statusText: h.statusText,
|
|
1273
|
-
headers:
|
|
1281
|
+
headers: x,
|
|
1274
1282
|
config: e,
|
|
1275
1283
|
request: h
|
|
1276
1284
|
};
|
|
1277
|
-
pt(function(
|
|
1278
|
-
n(
|
|
1279
|
-
}, function(
|
|
1280
|
-
r(
|
|
1281
|
-
},
|
|
1285
|
+
pt(function(S) {
|
|
1286
|
+
n(S), m();
|
|
1287
|
+
}, function(S) {
|
|
1288
|
+
r(S), m();
|
|
1289
|
+
}, F), h = null;
|
|
1282
1290
|
}
|
|
1283
1291
|
"onloadend" in h ? h.onloadend = w : h.onreadystatechange = function() {
|
|
1284
1292
|
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(w);
|
|
1285
1293
|
}, h.onabort = function() {
|
|
1286
1294
|
h && (r(new b("Request aborted", b.ECONNABORTED, e, h)), h = null);
|
|
1287
|
-
}, h.onerror = function(
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1295
|
+
}, h.onerror = function(T) {
|
|
1296
|
+
const F = T && T.message ? T.message : "Network Error", E = new b(F, b.ERR_NETWORK, e, h);
|
|
1297
|
+
E.event = T || null, r(E), h = null;
|
|
1290
1298
|
}, h.ontimeout = function() {
|
|
1291
|
-
let
|
|
1292
|
-
const
|
|
1293
|
-
o.timeoutErrorMessage && (
|
|
1294
|
-
|
|
1295
|
-
|
|
1299
|
+
let T = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1300
|
+
const F = o.transitional || ut;
|
|
1301
|
+
o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new b(
|
|
1302
|
+
T,
|
|
1303
|
+
F.clarifyTimeoutError ? b.ETIMEDOUT : b.ECONNABORTED,
|
|
1296
1304
|
e,
|
|
1297
1305
|
h
|
|
1298
1306
|
)), h = null;
|
|
1299
|
-
}, i === void 0 && s.setContentType(null), "setRequestHeader" in h && a.forEach(s.toJSON(), function(
|
|
1300
|
-
h.setRequestHeader(
|
|
1301
|
-
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), l && l !== "json" && (h.responseType = o.responseType),
|
|
1302
|
-
h && (r(!
|
|
1307
|
+
}, i === void 0 && s.setContentType(null), "setRequestHeader" in h && a.forEach(s.toJSON(), function(T, F) {
|
|
1308
|
+
h.setRequestHeader(F, T);
|
|
1309
|
+
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), l && l !== "json" && (h.responseType = o.responseType), d && ([g, f] = le(d, !0), h.addEventListener("progress", g)), p && h.upload && ([u, R] = le(p), h.upload.addEventListener("progress", u), h.upload.addEventListener("loadend", R)), (o.cancelToken || o.signal) && (c = (x) => {
|
|
1310
|
+
h && (r(!x || x.type ? new X(null, e, h) : x), h.abort(), h = null);
|
|
1303
1311
|
}, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
|
|
1304
|
-
const
|
|
1305
|
-
if (
|
|
1306
|
-
r(new b("Unsupported protocol " +
|
|
1312
|
+
const C = Mn(o.url);
|
|
1313
|
+
if (C && N.protocols.indexOf(C) === -1) {
|
|
1314
|
+
r(new b("Unsupported protocol " + C + ":", b.ERR_BAD_REQUEST, e));
|
|
1307
1315
|
return;
|
|
1308
1316
|
}
|
|
1309
1317
|
h.send(i || null);
|
|
@@ -1312,10 +1320,10 @@ const mt = (e) => {
|
|
|
1312
1320
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1313
1321
|
if (t || n) {
|
|
1314
1322
|
let r = new AbortController(), o;
|
|
1315
|
-
const i = function(
|
|
1323
|
+
const i = function(d) {
|
|
1316
1324
|
if (!o) {
|
|
1317
1325
|
o = !0, l();
|
|
1318
|
-
const c =
|
|
1326
|
+
const c = d instanceof Error ? d : this.reason;
|
|
1319
1327
|
r.abort(c instanceof b ? c : new X(c instanceof Error ? c.message : c));
|
|
1320
1328
|
}
|
|
1321
1329
|
};
|
|
@@ -1323,11 +1331,11 @@ const mt = (e) => {
|
|
|
1323
1331
|
s = null, i(new b(`timeout ${t} of ms exceeded`, b.ETIMEDOUT));
|
|
1324
1332
|
}, t);
|
|
1325
1333
|
const l = () => {
|
|
1326
|
-
e && (s && clearTimeout(s), s = null, e.forEach((
|
|
1327
|
-
|
|
1334
|
+
e && (s && clearTimeout(s), s = null, e.forEach((d) => {
|
|
1335
|
+
d.unsubscribe ? d.unsubscribe(i) : d.removeEventListener("abort", i);
|
|
1328
1336
|
}), e = null);
|
|
1329
1337
|
};
|
|
1330
|
-
e.forEach((
|
|
1338
|
+
e.forEach((d) => d.addEventListener("abort", i));
|
|
1331
1339
|
const { signal: p } = r;
|
|
1332
1340
|
return p.unsubscribe = () => a.asap(l), p;
|
|
1333
1341
|
}
|
|
@@ -1359,7 +1367,7 @@ const mt = (e) => {
|
|
|
1359
1367
|
} finally {
|
|
1360
1368
|
await t.cancel();
|
|
1361
1369
|
}
|
|
1362
|
-
},
|
|
1370
|
+
}, Me = (e, t, n, r) => {
|
|
1363
1371
|
const o = Gn(e, t);
|
|
1364
1372
|
let i = 0, s, l = (p) => {
|
|
1365
1373
|
s || (s = !0, r && r(p));
|
|
@@ -1367,19 +1375,19 @@ const mt = (e) => {
|
|
|
1367
1375
|
return new ReadableStream({
|
|
1368
1376
|
async pull(p) {
|
|
1369
1377
|
try {
|
|
1370
|
-
const { done:
|
|
1371
|
-
if (
|
|
1378
|
+
const { done: d, value: c } = await o.next();
|
|
1379
|
+
if (d) {
|
|
1372
1380
|
l(), p.close();
|
|
1373
1381
|
return;
|
|
1374
1382
|
}
|
|
1375
|
-
let
|
|
1383
|
+
let u = c.byteLength;
|
|
1376
1384
|
if (n) {
|
|
1377
|
-
let g = i +=
|
|
1385
|
+
let g = i += u;
|
|
1378
1386
|
n(g);
|
|
1379
1387
|
}
|
|
1380
1388
|
p.enqueue(new Uint8Array(c));
|
|
1381
|
-
} catch (
|
|
1382
|
-
throw l(
|
|
1389
|
+
} catch (d) {
|
|
1390
|
+
throw l(d), d;
|
|
1383
1391
|
}
|
|
1384
1392
|
},
|
|
1385
1393
|
cancel(p) {
|
|
@@ -1388,12 +1396,12 @@ const mt = (e) => {
|
|
|
1388
1396
|
}, {
|
|
1389
1397
|
highWaterMark: 2
|
|
1390
1398
|
});
|
|
1391
|
-
},
|
|
1399
|
+
}, ze = 64 * 1024, { isFunction: oe } = a, Zn = (({ Request: e, Response: t }) => ({
|
|
1392
1400
|
Request: e,
|
|
1393
1401
|
Response: t
|
|
1394
1402
|
}))(a.global), {
|
|
1395
|
-
ReadableStream:
|
|
1396
|
-
TextEncoder:
|
|
1403
|
+
ReadableStream: qe,
|
|
1404
|
+
TextEncoder: He
|
|
1397
1405
|
} = a.global, $e = (e, ...t) => {
|
|
1398
1406
|
try {
|
|
1399
1407
|
return !!e(...t);
|
|
@@ -1407,129 +1415,129 @@ const mt = (e) => {
|
|
|
1407
1415
|
const { fetch: t, Request: n, Response: r } = e, o = t ? oe(t) : typeof fetch == "function", i = oe(n), s = oe(r);
|
|
1408
1416
|
if (!o)
|
|
1409
1417
|
return !1;
|
|
1410
|
-
const l = o && oe(
|
|
1411
|
-
let
|
|
1412
|
-
const m = new n(
|
|
1413
|
-
body: new
|
|
1418
|
+
const l = o && oe(qe), p = o && (typeof He == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new He()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), d = i && l && $e(() => {
|
|
1419
|
+
let f = !1;
|
|
1420
|
+
const m = new n(N.origin, {
|
|
1421
|
+
body: new qe(),
|
|
1414
1422
|
method: "POST",
|
|
1415
1423
|
get duplex() {
|
|
1416
|
-
return
|
|
1424
|
+
return f = !0, "half";
|
|
1417
1425
|
}
|
|
1418
1426
|
}).headers.has("Content-Type");
|
|
1419
|
-
return
|
|
1420
|
-
}), c = s && l && $e(() => a.isReadableStream(new r("").body)),
|
|
1421
|
-
stream: c && ((
|
|
1427
|
+
return f && !m;
|
|
1428
|
+
}), c = s && l && $e(() => a.isReadableStream(new r("").body)), u = {
|
|
1429
|
+
stream: c && ((f) => f.body)
|
|
1422
1430
|
};
|
|
1423
|
-
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1424
|
-
!f
|
|
1425
|
-
let w = m && m[
|
|
1431
|
+
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1432
|
+
!u[f] && (u[f] = (m, h) => {
|
|
1433
|
+
let w = m && m[f];
|
|
1426
1434
|
if (w)
|
|
1427
1435
|
return w.call(m);
|
|
1428
|
-
throw new b(`Response type '${
|
|
1436
|
+
throw new b(`Response type '${f}' is not supported`, b.ERR_NOT_SUPPORT, h);
|
|
1429
1437
|
});
|
|
1430
1438
|
});
|
|
1431
|
-
const g = async (
|
|
1432
|
-
if (
|
|
1439
|
+
const g = async (f) => {
|
|
1440
|
+
if (f == null)
|
|
1433
1441
|
return 0;
|
|
1434
|
-
if (a.isBlob(
|
|
1435
|
-
return
|
|
1436
|
-
if (a.isSpecCompliantForm(
|
|
1437
|
-
return (await new n(
|
|
1442
|
+
if (a.isBlob(f))
|
|
1443
|
+
return f.size;
|
|
1444
|
+
if (a.isSpecCompliantForm(f))
|
|
1445
|
+
return (await new n(N.origin, {
|
|
1438
1446
|
method: "POST",
|
|
1439
|
-
body:
|
|
1447
|
+
body: f
|
|
1440
1448
|
}).arrayBuffer()).byteLength;
|
|
1441
|
-
if (a.isArrayBufferView(
|
|
1442
|
-
return
|
|
1443
|
-
if (a.isURLSearchParams(
|
|
1444
|
-
return (await p(
|
|
1445
|
-
}, R = async (
|
|
1446
|
-
const h = a.toFiniteNumber(
|
|
1449
|
+
if (a.isArrayBufferView(f) || a.isArrayBuffer(f))
|
|
1450
|
+
return f.byteLength;
|
|
1451
|
+
if (a.isURLSearchParams(f) && (f = f + ""), a.isString(f))
|
|
1452
|
+
return (await p(f)).byteLength;
|
|
1453
|
+
}, R = async (f, m) => {
|
|
1454
|
+
const h = a.toFiniteNumber(f.getContentLength());
|
|
1447
1455
|
return h ?? g(m);
|
|
1448
1456
|
};
|
|
1449
|
-
return async (
|
|
1457
|
+
return async (f) => {
|
|
1450
1458
|
let {
|
|
1451
1459
|
url: m,
|
|
1452
1460
|
method: h,
|
|
1453
1461
|
data: w,
|
|
1454
|
-
signal:
|
|
1455
|
-
cancelToken:
|
|
1456
|
-
timeout:
|
|
1457
|
-
onDownloadProgress:
|
|
1458
|
-
onUploadProgress:
|
|
1459
|
-
responseType:
|
|
1462
|
+
signal: C,
|
|
1463
|
+
cancelToken: x,
|
|
1464
|
+
timeout: T,
|
|
1465
|
+
onDownloadProgress: F,
|
|
1466
|
+
onUploadProgress: E,
|
|
1467
|
+
responseType: S,
|
|
1460
1468
|
headers: Y,
|
|
1461
1469
|
withCredentials: W = "same-origin",
|
|
1462
|
-
fetchOptions:
|
|
1463
|
-
} = mt(
|
|
1464
|
-
|
|
1465
|
-
let I = Xn([
|
|
1466
|
-
const
|
|
1470
|
+
fetchOptions: k
|
|
1471
|
+
} = mt(f), U = t || fetch;
|
|
1472
|
+
S = S ? (S + "").toLowerCase() : "text";
|
|
1473
|
+
let I = Xn([C, x && x.toAbortSignal()], T), G = null;
|
|
1474
|
+
const z = I && I.unsubscribe && (() => {
|
|
1467
1475
|
I.unsubscribe();
|
|
1468
1476
|
});
|
|
1469
1477
|
let Ae;
|
|
1470
1478
|
try {
|
|
1471
|
-
if (
|
|
1472
|
-
let
|
|
1479
|
+
if (E && d && h !== "get" && h !== "head" && (Ae = await R(Y, w)) !== 0) {
|
|
1480
|
+
let M = new n(m, {
|
|
1473
1481
|
method: "POST",
|
|
1474
1482
|
body: w,
|
|
1475
1483
|
duplex: "half"
|
|
1476
1484
|
}), J;
|
|
1477
|
-
if (a.isFormData(w) && (J =
|
|
1478
|
-
const [he, re] =
|
|
1485
|
+
if (a.isFormData(w) && (J = M.headers.get("content-type")) && Y.setContentType(J), M.body) {
|
|
1486
|
+
const [he, re] = je(
|
|
1479
1487
|
Ae,
|
|
1480
|
-
le(Ie(
|
|
1488
|
+
le(Ie(E))
|
|
1481
1489
|
);
|
|
1482
|
-
w =
|
|
1490
|
+
w = Me(M.body, ze, he, re);
|
|
1483
1491
|
}
|
|
1484
1492
|
}
|
|
1485
1493
|
a.isString(W) || (W = W ? "include" : "omit");
|
|
1486
|
-
const
|
|
1487
|
-
...
|
|
1494
|
+
const D = i && "credentials" in n.prototype, ke = {
|
|
1495
|
+
...k,
|
|
1488
1496
|
signal: I,
|
|
1489
1497
|
method: h.toUpperCase(),
|
|
1490
1498
|
headers: Y.normalize().toJSON(),
|
|
1491
1499
|
body: w,
|
|
1492
1500
|
duplex: "half",
|
|
1493
|
-
credentials:
|
|
1501
|
+
credentials: D ? W : void 0
|
|
1494
1502
|
};
|
|
1495
1503
|
G = i && new n(m, ke);
|
|
1496
|
-
let v = await (i ? U(G,
|
|
1497
|
-
const Fe = c && (
|
|
1498
|
-
if (c && (
|
|
1499
|
-
const
|
|
1504
|
+
let v = await (i ? U(G, k) : U(m, ke));
|
|
1505
|
+
const Fe = c && (S === "stream" || S === "response");
|
|
1506
|
+
if (c && (F || Fe && z)) {
|
|
1507
|
+
const M = {};
|
|
1500
1508
|
["status", "statusText", "headers"].forEach((Ne) => {
|
|
1501
|
-
|
|
1509
|
+
M[Ne] = v[Ne];
|
|
1502
1510
|
});
|
|
1503
|
-
const J = a.toFiniteNumber(v.headers.get("content-length")), [he, re] =
|
|
1511
|
+
const J = a.toFiniteNumber(v.headers.get("content-length")), [he, re] = F && je(
|
|
1504
1512
|
J,
|
|
1505
|
-
le(Ie(
|
|
1513
|
+
le(Ie(F), !0)
|
|
1506
1514
|
) || [];
|
|
1507
1515
|
v = new r(
|
|
1508
|
-
|
|
1509
|
-
re && re(),
|
|
1516
|
+
Me(v.body, ze, he, () => {
|
|
1517
|
+
re && re(), z && z();
|
|
1510
1518
|
}),
|
|
1511
|
-
|
|
1519
|
+
M
|
|
1512
1520
|
);
|
|
1513
1521
|
}
|
|
1514
|
-
|
|
1515
|
-
let Et = await
|
|
1516
|
-
return !Fe &&
|
|
1517
|
-
pt(
|
|
1522
|
+
S = S || "text";
|
|
1523
|
+
let Et = await u[a.findKey(u, S) || "text"](v, f);
|
|
1524
|
+
return !Fe && z && z(), await new Promise((M, J) => {
|
|
1525
|
+
pt(M, J, {
|
|
1518
1526
|
data: Et,
|
|
1519
1527
|
headers: _.from(v.headers),
|
|
1520
1528
|
status: v.status,
|
|
1521
1529
|
statusText: v.statusText,
|
|
1522
|
-
config:
|
|
1530
|
+
config: f,
|
|
1523
1531
|
request: G
|
|
1524
1532
|
});
|
|
1525
1533
|
});
|
|
1526
|
-
} catch (
|
|
1527
|
-
throw
|
|
1528
|
-
new b("Network Error", b.ERR_NETWORK,
|
|
1534
|
+
} catch (D) {
|
|
1535
|
+
throw z && z(), D && D.name === "TypeError" && /Load failed|fetch/i.test(D.message) ? Object.assign(
|
|
1536
|
+
new b("Network Error", b.ERR_NETWORK, f, G),
|
|
1529
1537
|
{
|
|
1530
|
-
cause:
|
|
1538
|
+
cause: D.cause || D
|
|
1531
1539
|
}
|
|
1532
|
-
) : b.from(
|
|
1540
|
+
) : b.from(D, D && D.code, f, G);
|
|
1533
1541
|
}
|
|
1534
1542
|
};
|
|
1535
1543
|
}, tr = /* @__PURE__ */ new Map(), yt = (e) => {
|
|
@@ -1539,10 +1547,10 @@ const mt = (e) => {
|
|
|
1539
1547
|
o,
|
|
1540
1548
|
n
|
|
1541
1549
|
];
|
|
1542
|
-
let s = i.length, l = s, p,
|
|
1550
|
+
let s = i.length, l = s, p, d, c = tr;
|
|
1543
1551
|
for (; l--; )
|
|
1544
|
-
p = i[l],
|
|
1545
|
-
return
|
|
1552
|
+
p = i[l], d = c.get(p), d === void 0 && c.set(p, d = l ? /* @__PURE__ */ new Map() : er(t)), c = d;
|
|
1553
|
+
return d;
|
|
1546
1554
|
};
|
|
1547
1555
|
yt();
|
|
1548
1556
|
const Oe = {
|
|
@@ -1578,7 +1586,7 @@ function rr(e, t) {
|
|
|
1578
1586
|
}
|
|
1579
1587
|
if (!o) {
|
|
1580
1588
|
const s = Object.entries(i).map(
|
|
1581
|
-
([p,
|
|
1589
|
+
([p, d]) => `adapter ${p} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1582
1590
|
);
|
|
1583
1591
|
let l = n ? s.length > 1 ? `since :
|
|
1584
1592
|
` + s.map(We).join(`
|
|
@@ -1672,8 +1680,8 @@ function or(e, t, n) {
|
|
|
1672
1680
|
const ae = {
|
|
1673
1681
|
assertOptions: or,
|
|
1674
1682
|
validators: pe
|
|
1675
|
-
},
|
|
1676
|
-
let
|
|
1683
|
+
}, j = ae.validators;
|
|
1684
|
+
let H = class {
|
|
1677
1685
|
constructor(t) {
|
|
1678
1686
|
this.defaults = t || {}, this.interceptors = {
|
|
1679
1687
|
request: new Be(),
|
|
@@ -1709,17 +1717,17 @@ let q = class {
|
|
|
1709
1717
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = $(this.defaults, n);
|
|
1710
1718
|
const { transitional: r, paramsSerializer: o, headers: i } = n;
|
|
1711
1719
|
r !== void 0 && ae.assertOptions(r, {
|
|
1712
|
-
silentJSONParsing:
|
|
1713
|
-
forcedJSONParsing:
|
|
1714
|
-
clarifyTimeoutError:
|
|
1720
|
+
silentJSONParsing: j.transitional(j.boolean),
|
|
1721
|
+
forcedJSONParsing: j.transitional(j.boolean),
|
|
1722
|
+
clarifyTimeoutError: j.transitional(j.boolean)
|
|
1715
1723
|
}, !1), o != null && (a.isFunction(o) ? n.paramsSerializer = {
|
|
1716
1724
|
serialize: o
|
|
1717
1725
|
} : ae.assertOptions(o, {
|
|
1718
|
-
encode:
|
|
1719
|
-
serialize:
|
|
1726
|
+
encode: j.function,
|
|
1727
|
+
serialize: j.function
|
|
1720
1728
|
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ae.assertOptions(n, {
|
|
1721
|
-
baseUrl:
|
|
1722
|
-
withXsrfToken:
|
|
1729
|
+
baseUrl: j.spelling("baseURL"),
|
|
1730
|
+
withXsrfToken: j.spelling("withXSRFToken")
|
|
1723
1731
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1724
1732
|
let s = i && a.merge(
|
|
1725
1733
|
i.common,
|
|
@@ -1727,8 +1735,8 @@ let q = class {
|
|
|
1727
1735
|
);
|
|
1728
1736
|
i && a.forEach(
|
|
1729
1737
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1730
|
-
(
|
|
1731
|
-
delete i[
|
|
1738
|
+
(f) => {
|
|
1739
|
+
delete i[f];
|
|
1732
1740
|
}
|
|
1733
1741
|
), n.headers = _.concat(s, i);
|
|
1734
1742
|
const l = [];
|
|
@@ -1736,23 +1744,23 @@ let q = class {
|
|
|
1736
1744
|
this.interceptors.request.forEach(function(m) {
|
|
1737
1745
|
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (p = p && m.synchronous, l.unshift(m.fulfilled, m.rejected));
|
|
1738
1746
|
});
|
|
1739
|
-
const
|
|
1747
|
+
const d = [];
|
|
1740
1748
|
this.interceptors.response.forEach(function(m) {
|
|
1741
|
-
|
|
1749
|
+
d.push(m.fulfilled, m.rejected);
|
|
1742
1750
|
});
|
|
1743
|
-
let c,
|
|
1751
|
+
let c, u = 0, g;
|
|
1744
1752
|
if (!p) {
|
|
1745
|
-
const
|
|
1746
|
-
for (
|
|
1747
|
-
c = c.then(
|
|
1753
|
+
const f = [Je.bind(this), void 0];
|
|
1754
|
+
for (f.unshift(...l), f.push(...d), g = f.length, c = Promise.resolve(n); u < g; )
|
|
1755
|
+
c = c.then(f[u++], f[u++]);
|
|
1748
1756
|
return c;
|
|
1749
1757
|
}
|
|
1750
1758
|
g = l.length;
|
|
1751
1759
|
let R = n;
|
|
1752
|
-
for (;
|
|
1753
|
-
const
|
|
1760
|
+
for (; u < g; ) {
|
|
1761
|
+
const f = l[u++], m = l[u++];
|
|
1754
1762
|
try {
|
|
1755
|
-
R =
|
|
1763
|
+
R = f(R);
|
|
1756
1764
|
} catch (h) {
|
|
1757
1765
|
m.call(this, h);
|
|
1758
1766
|
break;
|
|
@@ -1760,11 +1768,11 @@ let q = class {
|
|
|
1760
1768
|
}
|
|
1761
1769
|
try {
|
|
1762
1770
|
c = Je.call(this, R);
|
|
1763
|
-
} catch (
|
|
1764
|
-
return Promise.reject(
|
|
1771
|
+
} catch (f) {
|
|
1772
|
+
return Promise.reject(f);
|
|
1765
1773
|
}
|
|
1766
|
-
for (
|
|
1767
|
-
c = c.then(u
|
|
1774
|
+
for (u = 0, g = d.length; u < g; )
|
|
1775
|
+
c = c.then(d[u++], d[u++]);
|
|
1768
1776
|
return c;
|
|
1769
1777
|
}
|
|
1770
1778
|
getUri(t) {
|
|
@@ -1774,7 +1782,7 @@ let q = class {
|
|
|
1774
1782
|
}
|
|
1775
1783
|
};
|
|
1776
1784
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1777
|
-
|
|
1785
|
+
H.prototype[t] = function(n, r) {
|
|
1778
1786
|
return this.request($(r || {}, {
|
|
1779
1787
|
method: t,
|
|
1780
1788
|
url: n,
|
|
@@ -1795,7 +1803,7 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1795
1803
|
}));
|
|
1796
1804
|
};
|
|
1797
1805
|
}
|
|
1798
|
-
|
|
1806
|
+
H.prototype[t] = n(), H.prototype[t + "Form"] = n(!0);
|
|
1799
1807
|
});
|
|
1800
1808
|
let sr = class xt {
|
|
1801
1809
|
constructor(t) {
|
|
@@ -1953,31 +1961,31 @@ Object.entries(Se).forEach(([e, t]) => {
|
|
|
1953
1961
|
Se[t] = e;
|
|
1954
1962
|
});
|
|
1955
1963
|
function wt(e) {
|
|
1956
|
-
const t = new
|
|
1957
|
-
return a.extend(n,
|
|
1964
|
+
const t = new H(e), n = Ge(H.prototype.request, t);
|
|
1965
|
+
return a.extend(n, H.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
1958
1966
|
return wt($(e, o));
|
|
1959
1967
|
}, n;
|
|
1960
1968
|
}
|
|
1961
|
-
const
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1969
|
+
const A = wt(ne);
|
|
1970
|
+
A.Axios = H;
|
|
1971
|
+
A.CanceledError = X;
|
|
1972
|
+
A.CancelToken = sr;
|
|
1973
|
+
A.isCancel = ft;
|
|
1974
|
+
A.VERSION = gt;
|
|
1975
|
+
A.toFormData = fe;
|
|
1976
|
+
A.AxiosError = b;
|
|
1977
|
+
A.Cancel = A.CanceledError;
|
|
1978
|
+
A.all = function(t) {
|
|
1971
1979
|
return Promise.all(t);
|
|
1972
1980
|
};
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
+
A.spread = ir;
|
|
1982
|
+
A.isAxiosError = ar;
|
|
1983
|
+
A.mergeConfig = $;
|
|
1984
|
+
A.AxiosHeaders = _;
|
|
1985
|
+
A.formToJSON = (e) => dt(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1986
|
+
A.getAdapter = bt.getAdapter;
|
|
1987
|
+
A.HttpStatusCode = Se;
|
|
1988
|
+
A.default = A;
|
|
1981
1989
|
const {
|
|
1982
1990
|
Axios: yr,
|
|
1983
1991
|
AxiosError: br,
|
|
@@ -1995,7 +2003,7 @@ const {
|
|
|
1995
2003
|
formToJSON: Fr,
|
|
1996
2004
|
getAdapter: Nr,
|
|
1997
2005
|
mergeConfig: Pr
|
|
1998
|
-
} =
|
|
2006
|
+
} = A, St = async (e, t, n, r, o, i) => {
|
|
1999
2007
|
const s = {
|
|
2000
2008
|
chatInput: e,
|
|
2001
2009
|
sessionId: t,
|
|
@@ -2006,7 +2014,7 @@ const {
|
|
|
2006
2014
|
}
|
|
2007
2015
|
};
|
|
2008
2016
|
try {
|
|
2009
|
-
return (await
|
|
2017
|
+
return (await A.post(
|
|
2010
2018
|
r,
|
|
2011
2019
|
s,
|
|
2012
2020
|
{
|
|
@@ -2019,55 +2027,54 @@ const {
|
|
|
2019
2027
|
throw console.error("Error communicating with chat API:", l), l;
|
|
2020
2028
|
}
|
|
2021
2029
|
}, lr = ({ handleMessageFromForm: e, theme: t, chatBotData: n }) => {
|
|
2022
|
-
const [r, o] = L(""), [i, s] = L(""), [l, p] = L(""), [
|
|
2023
|
-
if (
|
|
2024
|
-
|
|
2030
|
+
const [r, o] = L(""), [i, s] = L(""), [l, p] = L(""), [d, c] = L(""), [u, g] = L(!1), R = async (E) => {
|
|
2031
|
+
if (E.preventDefault(), g(!0), c(""), !r.trim() || !i.trim()) {
|
|
2032
|
+
c("Name and email are required"), g(!1);
|
|
2025
2033
|
return;
|
|
2026
2034
|
}
|
|
2027
|
-
const k = `Hi, I am ${r} and my email is ${i}`;
|
|
2028
2035
|
try {
|
|
2029
|
-
const
|
|
2030
|
-
|
|
2036
|
+
const S = await St(
|
|
2037
|
+
l,
|
|
2031
2038
|
n.sessionId,
|
|
2032
2039
|
n.pineconeNamespace,
|
|
2033
2040
|
n.url,
|
|
2034
2041
|
r,
|
|
2035
2042
|
i
|
|
2036
|
-
)
|
|
2043
|
+
);
|
|
2037
2044
|
e([
|
|
2038
|
-
{ type: "user", text:
|
|
2039
|
-
{ type: "bot", text:
|
|
2045
|
+
{ type: "user", text: l },
|
|
2046
|
+
{ type: "bot", text: S.response, response_timestamp: S.response_timestamp }
|
|
2040
2047
|
]);
|
|
2041
|
-
} catch (
|
|
2042
|
-
console.log("error sending user details",
|
|
2048
|
+
} catch (S) {
|
|
2049
|
+
console.log("error sending user details", S), c("Failed to submit. Please try again.");
|
|
2043
2050
|
} finally {
|
|
2044
|
-
|
|
2051
|
+
g(!1);
|
|
2045
2052
|
}
|
|
2046
|
-
o(""), s("");
|
|
2047
|
-
},
|
|
2053
|
+
o(""), s(""), p("");
|
|
2054
|
+
}, f = {
|
|
2048
2055
|
padding: "20px",
|
|
2049
2056
|
flexShrink: 0,
|
|
2050
2057
|
background: t.backgroundColor,
|
|
2051
2058
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
2052
|
-
},
|
|
2059
|
+
}, m = {
|
|
2053
2060
|
display: "flex",
|
|
2054
2061
|
flexDirection: "column",
|
|
2055
2062
|
gap: "24px"
|
|
2056
|
-
},
|
|
2063
|
+
}, h = {
|
|
2057
2064
|
fontSize: "14px",
|
|
2058
2065
|
fontWeight: "500",
|
|
2059
2066
|
color: t.fontColor,
|
|
2060
2067
|
margin: 0,
|
|
2061
2068
|
lineHeight: "1.4"
|
|
2062
|
-
},
|
|
2069
|
+
}, w = {
|
|
2063
2070
|
display: "flex",
|
|
2064
2071
|
flexDirection: "column",
|
|
2065
2072
|
gap: "20px"
|
|
2066
|
-
},
|
|
2073
|
+
}, C = {
|
|
2067
2074
|
fontSize: "14px",
|
|
2068
2075
|
color: t.fontColor,
|
|
2069
2076
|
fontWeight: "500"
|
|
2070
|
-
},
|
|
2077
|
+
}, x = {
|
|
2071
2078
|
width: "100%",
|
|
2072
2079
|
padding: "12px 16px",
|
|
2073
2080
|
background: t.backgroundColor,
|
|
@@ -2077,7 +2084,7 @@ const {
|
|
|
2077
2084
|
fontSize: "15px",
|
|
2078
2085
|
outline: "none",
|
|
2079
2086
|
boxSizing: "border-box"
|
|
2080
|
-
},
|
|
2087
|
+
}, T = {
|
|
2081
2088
|
padding: "12px 20px",
|
|
2082
2089
|
borderRadius: "12px",
|
|
2083
2090
|
fontWeight: "600",
|
|
@@ -2091,11 +2098,10 @@ const {
|
|
|
2091
2098
|
alignItems: "center",
|
|
2092
2099
|
justifyContent: "center",
|
|
2093
2100
|
gap: "8px",
|
|
2094
|
-
marginTop: "80px",
|
|
2095
2101
|
transition: "all 0.2s ease"
|
|
2096
2102
|
};
|
|
2097
|
-
return /* @__PURE__ */ y("div", { style:
|
|
2098
|
-
|
|
2103
|
+
return /* @__PURE__ */ y("div", { style: f, children: /* @__PURE__ */ O("form", { onSubmit: R, style: m, children: [
|
|
2104
|
+
d && /* @__PURE__ */ y("div", { style: {
|
|
2099
2105
|
backgroundColor: "#fee2e2",
|
|
2100
2106
|
color: "#713f12",
|
|
2101
2107
|
padding: "8px 12px",
|
|
@@ -2103,37 +2109,56 @@ const {
|
|
|
2103
2109
|
fontSize: "13px",
|
|
2104
2110
|
textAlign: "center",
|
|
2105
2111
|
fontWeight: "500"
|
|
2106
|
-
}, role: "alert", children:
|
|
2107
|
-
/* @__PURE__ */ y("p", { style:
|
|
2108
|
-
/* @__PURE__ */
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */ y("label", { style:
|
|
2112
|
+
}, role: "alert", children: d }),
|
|
2113
|
+
/* @__PURE__ */ y("p", { style: h, children: n.welcomeText }),
|
|
2114
|
+
/* @__PURE__ */ O("div", { style: w, children: [
|
|
2115
|
+
/* @__PURE__ */ O("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2116
|
+
/* @__PURE__ */ y("label", { style: C, children: "Full Name" }),
|
|
2111
2117
|
/* @__PURE__ */ y(
|
|
2112
2118
|
"input",
|
|
2113
2119
|
{
|
|
2114
2120
|
type: "text",
|
|
2115
2121
|
placeholder: "Enter your full name",
|
|
2116
2122
|
value: r,
|
|
2117
|
-
onChange: (
|
|
2118
|
-
o(
|
|
2123
|
+
onChange: (E) => {
|
|
2124
|
+
o(E.target.value), c("");
|
|
2119
2125
|
},
|
|
2120
|
-
style:
|
|
2126
|
+
style: x,
|
|
2121
2127
|
required: !0
|
|
2122
2128
|
}
|
|
2123
2129
|
)
|
|
2124
2130
|
] }),
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */ y("label", { style:
|
|
2131
|
+
/* @__PURE__ */ O("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2132
|
+
/* @__PURE__ */ y("label", { style: C, children: "Email Address" }),
|
|
2127
2133
|
/* @__PURE__ */ y(
|
|
2128
2134
|
"input",
|
|
2129
2135
|
{
|
|
2130
2136
|
type: "email",
|
|
2131
2137
|
placeholder: "Enter your email",
|
|
2132
2138
|
value: i,
|
|
2133
|
-
onChange: (
|
|
2134
|
-
s(
|
|
2139
|
+
onChange: (E) => {
|
|
2140
|
+
s(E.target.value), c("");
|
|
2141
|
+
},
|
|
2142
|
+
style: x,
|
|
2143
|
+
required: !0
|
|
2144
|
+
}
|
|
2145
|
+
)
|
|
2146
|
+
] }),
|
|
2147
|
+
/* @__PURE__ */ O("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2148
|
+
/* @__PURE__ */ y("label", { style: C, children: "Message" }),
|
|
2149
|
+
/* @__PURE__ */ y(
|
|
2150
|
+
"textarea",
|
|
2151
|
+
{
|
|
2152
|
+
placeholder: "Enter your message",
|
|
2153
|
+
value: l,
|
|
2154
|
+
onChange: (E) => {
|
|
2155
|
+
p(E.target.value), c("");
|
|
2156
|
+
},
|
|
2157
|
+
style: {
|
|
2158
|
+
...x,
|
|
2159
|
+
minHeight: "60px",
|
|
2160
|
+
resize: "vertical"
|
|
2135
2161
|
},
|
|
2136
|
-
style: w,
|
|
2137
2162
|
required: !0
|
|
2138
2163
|
}
|
|
2139
2164
|
)
|
|
@@ -2144,28 +2169,28 @@ const {
|
|
|
2144
2169
|
{
|
|
2145
2170
|
type: "submit",
|
|
2146
2171
|
disabled: !r.trim() || !i.trim() || u,
|
|
2147
|
-
style:
|
|
2148
|
-
onMouseEnter: (
|
|
2149
|
-
r.trim() && i.trim() && !u && (
|
|
2172
|
+
style: T,
|
|
2173
|
+
onMouseEnter: (E) => {
|
|
2174
|
+
r.trim() && i.trim() && !u && (E.currentTarget.style.transform = "translateY(-2px)", E.currentTarget.style.boxShadow = "0 10px 20px rgba(0,0,0,0.15)");
|
|
2150
2175
|
},
|
|
2151
|
-
onMouseLeave: (
|
|
2152
|
-
|
|
2176
|
+
onMouseLeave: (E) => {
|
|
2177
|
+
E.currentTarget.style.transform = "translateY(0)", E.currentTarget.style.boxShadow = "none";
|
|
2153
2178
|
},
|
|
2154
|
-
children: u ? "Submitting..." : /* @__PURE__ */
|
|
2179
|
+
children: u ? "Submitting..." : /* @__PURE__ */ O(Ee, { children: [
|
|
2155
2180
|
/* @__PURE__ */ y(Ye, { size: 18 }),
|
|
2156
2181
|
"Submit"
|
|
2157
2182
|
] })
|
|
2158
2183
|
}
|
|
2159
2184
|
)
|
|
2160
2185
|
] }) });
|
|
2161
|
-
}, cr = ({
|
|
2162
|
-
const [r, o] = L([]), [i, s] = L(!1), [l, p] = L(!1), [
|
|
2186
|
+
}, cr = ({ onClose: e, theme: t, chatBotData: n }) => {
|
|
2187
|
+
const [r, o] = L([]), [i, s] = L(!1), [l, p] = L(!1), [d, c] = L(!1), g = {
|
|
2163
2188
|
position: "fixed",
|
|
2164
2189
|
bottom: "112px",
|
|
2165
2190
|
[n.position === "left" ? "left" : "right"]: "32px",
|
|
2166
2191
|
zIndex: 50,
|
|
2167
|
-
width:
|
|
2168
|
-
height:
|
|
2192
|
+
width: d ? "684px" : "384px",
|
|
2193
|
+
height: d ? "620px" : "520px",
|
|
2169
2194
|
background: `${t.backgroundColor}cc`,
|
|
2170
2195
|
backdropFilter: "blur(16px)",
|
|
2171
2196
|
WebkitBackdropFilter: "blur(16px)",
|
|
@@ -2185,7 +2210,7 @@ const {
|
|
|
2185
2210
|
alignItems: "center",
|
|
2186
2211
|
justifyContent: "space-between",
|
|
2187
2212
|
boxShadow: "0 4px 6px -1px rgba(0,0,0,0.1)"
|
|
2188
|
-
},
|
|
2213
|
+
}, f = {
|
|
2189
2214
|
position: "relative"
|
|
2190
2215
|
}, m = {
|
|
2191
2216
|
width: "44px",
|
|
@@ -2209,38 +2234,38 @@ const {
|
|
|
2209
2234
|
fontWeight: "600",
|
|
2210
2235
|
margin: 0,
|
|
2211
2236
|
lineHeight: "1.2"
|
|
2212
|
-
},
|
|
2237
|
+
}, C = {
|
|
2213
2238
|
fontSize: "12px",
|
|
2214
2239
|
opacity: 0.9,
|
|
2215
2240
|
margin: 0,
|
|
2216
2241
|
lineHeight: "1.3"
|
|
2217
|
-
},
|
|
2242
|
+
}, x = {
|
|
2218
2243
|
padding: "8px",
|
|
2219
2244
|
borderRadius: "50%",
|
|
2220
2245
|
background: "transparent",
|
|
2221
2246
|
border: "none",
|
|
2222
2247
|
cursor: "pointer",
|
|
2223
2248
|
transition: "background 0.2s"
|
|
2224
|
-
},
|
|
2249
|
+
}, T = {
|
|
2225
2250
|
padding: "12px 20px",
|
|
2226
2251
|
borderTop: "1px solid rgba(255,255,255,0.2)",
|
|
2227
2252
|
background: t.backgroundColor,
|
|
2228
2253
|
textAlign: "center"
|
|
2229
|
-
},
|
|
2254
|
+
}, F = {
|
|
2230
2255
|
fontSize: "11px",
|
|
2231
2256
|
color: t.fontColor,
|
|
2232
2257
|
letterSpacing: "0.5px"
|
|
2233
|
-
},
|
|
2258
|
+
}, E = {
|
|
2234
2259
|
fontWeight: "600"
|
|
2235
|
-
},
|
|
2236
|
-
|
|
2237
|
-
}, Y = (
|
|
2238
|
-
o(
|
|
2239
|
-
}, W = async (
|
|
2240
|
-
s(!0), o((U) => [...U, { type: "user", text:
|
|
2260
|
+
}, S = (k, U) => {
|
|
2261
|
+
k.currentTarget.style.background = U ? "rgba(255,255,255,0.2)" : "transparent";
|
|
2262
|
+
}, Y = (k) => {
|
|
2263
|
+
o(k), p(!0);
|
|
2264
|
+
}, W = async (k) => {
|
|
2265
|
+
s(!0), o((U) => [...U, { type: "user", text: k }]);
|
|
2241
2266
|
try {
|
|
2242
2267
|
const U = await St(
|
|
2243
|
-
|
|
2268
|
+
k,
|
|
2244
2269
|
n.sessionId,
|
|
2245
2270
|
n.pineconeNamespace,
|
|
2246
2271
|
n.url
|
|
@@ -2255,44 +2280,44 @@ const {
|
|
|
2255
2280
|
s(!1);
|
|
2256
2281
|
}
|
|
2257
2282
|
};
|
|
2258
|
-
return /* @__PURE__ */
|
|
2259
|
-
/* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2283
|
+
return /* @__PURE__ */ O("div", { style: g, children: [
|
|
2284
|
+
/* @__PURE__ */ O("div", { style: R, children: [
|
|
2285
|
+
/* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
2286
|
+
/* @__PURE__ */ O("div", { style: f, children: [
|
|
2262
2287
|
/* @__PURE__ */ y("div", { style: m, children: /* @__PURE__ */ y(Xe, { size: 22 }) }),
|
|
2263
2288
|
/* @__PURE__ */ y("span", { style: h })
|
|
2264
2289
|
] }),
|
|
2265
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ O("div", { children: [
|
|
2266
2291
|
/* @__PURE__ */ y("h3", { style: w, children: n.name }),
|
|
2267
|
-
/* @__PURE__ */ y("p", { style:
|
|
2292
|
+
/* @__PURE__ */ y("p", { style: C, children: n.subTitle })
|
|
2268
2293
|
] })
|
|
2269
2294
|
] }),
|
|
2270
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "left" }, children: [
|
|
2271
2296
|
/* @__PURE__ */ y(
|
|
2272
2297
|
"button",
|
|
2273
2298
|
{
|
|
2274
|
-
onClick: () => c((
|
|
2299
|
+
onClick: () => c((k) => !k),
|
|
2275
2300
|
"aria-label": "expand chat",
|
|
2276
|
-
style:
|
|
2277
|
-
onMouseEnter: (
|
|
2278
|
-
onMouseLeave: (
|
|
2279
|
-
children:
|
|
2301
|
+
style: x,
|
|
2302
|
+
onMouseEnter: (k) => S(k, !0),
|
|
2303
|
+
onMouseLeave: (k) => S(k, !1),
|
|
2304
|
+
children: d ? /* @__PURE__ */ y(Tt, { size: 20 }) : /* @__PURE__ */ y(Ot, { size: 20 })
|
|
2280
2305
|
}
|
|
2281
2306
|
),
|
|
2282
2307
|
/* @__PURE__ */ y(
|
|
2283
2308
|
"button",
|
|
2284
2309
|
{
|
|
2285
2310
|
onClick: e,
|
|
2286
|
-
"aria-label": "
|
|
2287
|
-
style:
|
|
2288
|
-
onMouseEnter: (
|
|
2289
|
-
onMouseLeave: (
|
|
2311
|
+
"aria-label": "close chat",
|
|
2312
|
+
style: x,
|
|
2313
|
+
onMouseEnter: (k) => S(k, !0),
|
|
2314
|
+
onMouseLeave: (k) => S(k, !1),
|
|
2290
2315
|
children: /* @__PURE__ */ y(At, { size: 20 })
|
|
2291
2316
|
}
|
|
2292
2317
|
)
|
|
2293
2318
|
] })
|
|
2294
2319
|
] }),
|
|
2295
|
-
l ? /* @__PURE__ */
|
|
2320
|
+
l ? /* @__PURE__ */ O(Ee, { children: [
|
|
2296
2321
|
/* @__PURE__ */ y(Pt, { messages: r, isLoading: i, theme: t }),
|
|
2297
2322
|
/* @__PURE__ */ y(Nt, { onSendMessage: W, isLoading: i, theme: t, messages: r })
|
|
2298
2323
|
] }) : /* @__PURE__ */ y(
|
|
@@ -2303,10 +2328,10 @@ const {
|
|
|
2303
2328
|
chatBotData: n
|
|
2304
2329
|
}
|
|
2305
2330
|
),
|
|
2306
|
-
/* @__PURE__ */ y("div", { style:
|
|
2331
|
+
/* @__PURE__ */ y("div", { style: T, children: /* @__PURE__ */ O("p", { style: F, children: [
|
|
2307
2332
|
"powered by",
|
|
2308
2333
|
" ",
|
|
2309
|
-
/* @__PURE__ */ y("span", { style:
|
|
2334
|
+
/* @__PURE__ */ y("span", { style: E, children: "clone67.com" })
|
|
2310
2335
|
] }) })
|
|
2311
2336
|
] });
|
|
2312
2337
|
}, _r = ({
|
|
@@ -2319,14 +2344,14 @@ const {
|
|
|
2319
2344
|
placeholderColor: s = "#9ca3af",
|
|
2320
2345
|
position: l = "right",
|
|
2321
2346
|
name: p = "Assistant",
|
|
2322
|
-
subTitle:
|
|
2347
|
+
subTitle: d = "Typically replies instantly",
|
|
2323
2348
|
welcomeText: c = "Hi! How can I help you today?"
|
|
2324
2349
|
}) => {
|
|
2325
|
-
const [
|
|
2350
|
+
const [u, g] = L(!1), [R, f] = L("");
|
|
2326
2351
|
Ke(() => {
|
|
2327
|
-
|
|
2352
|
+
f(kt());
|
|
2328
2353
|
}, []);
|
|
2329
|
-
const m = () => g((
|
|
2354
|
+
const m = () => g((S) => !S), h = () => g((S) => !S), w = {
|
|
2330
2355
|
primaryColor: n,
|
|
2331
2356
|
secondaryColor: r,
|
|
2332
2357
|
backgroundColor: o,
|
|
@@ -2334,44 +2359,44 @@ const {
|
|
|
2334
2359
|
placeholderColor: s,
|
|
2335
2360
|
inputBackgroundColor: o
|
|
2336
2361
|
// fallback if not provided
|
|
2337
|
-
},
|
|
2362
|
+
}, C = {
|
|
2338
2363
|
name: p,
|
|
2339
|
-
subTitle:
|
|
2364
|
+
subTitle: d,
|
|
2340
2365
|
welcomeText: c,
|
|
2341
2366
|
url: t,
|
|
2342
2367
|
pineconeNamespace: e,
|
|
2343
2368
|
position: l,
|
|
2344
2369
|
sessionId: R
|
|
2345
|
-
},
|
|
2370
|
+
}, x = l === "left", T = "32px", F = {
|
|
2346
2371
|
position: "fixed",
|
|
2347
2372
|
bottom: "104px",
|
|
2348
2373
|
// 8 + 64 + some margin
|
|
2349
|
-
[
|
|
2374
|
+
[x ? "left" : "right"]: T,
|
|
2350
2375
|
zIndex: 9999,
|
|
2351
2376
|
pointerEvents: "auto"
|
|
2352
|
-
},
|
|
2377
|
+
}, E = {
|
|
2353
2378
|
position: "fixed",
|
|
2354
2379
|
bottom: "32px",
|
|
2355
|
-
[
|
|
2380
|
+
[x ? "left" : "right"]: T,
|
|
2356
2381
|
zIndex: 1e4,
|
|
2357
2382
|
pointerEvents: "auto"
|
|
2358
2383
|
};
|
|
2359
|
-
return /* @__PURE__ */
|
|
2360
|
-
|
|
2384
|
+
return /* @__PURE__ */ O(Ee, { children: [
|
|
2385
|
+
u && /* @__PURE__ */ y("div", { style: F, children: /* @__PURE__ */ y(
|
|
2361
2386
|
cr,
|
|
2362
2387
|
{
|
|
2363
|
-
|
|
2388
|
+
onClose: m,
|
|
2364
2389
|
theme: w,
|
|
2365
|
-
chatBotData:
|
|
2390
|
+
chatBotData: C
|
|
2366
2391
|
}
|
|
2367
2392
|
) }),
|
|
2368
|
-
/* @__PURE__ */ y("div", { style:
|
|
2393
|
+
/* @__PURE__ */ y("div", { style: E, children: /* @__PURE__ */ y(
|
|
2369
2394
|
Ft,
|
|
2370
2395
|
{
|
|
2371
|
-
|
|
2372
|
-
isOpen:
|
|
2396
|
+
onMinimise: h,
|
|
2397
|
+
isOpen: u,
|
|
2373
2398
|
theme: w,
|
|
2374
|
-
chatBotData:
|
|
2399
|
+
chatBotData: C
|
|
2375
2400
|
}
|
|
2376
2401
|
) })
|
|
2377
2402
|
] });
|