tybotflow-widget 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +185 -182
- package/dist/index.umd.js +15 -15
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -94,11 +94,11 @@ function rM() {
|
|
|
94
94
|
if (X !== J) {
|
|
95
95
|
j[0] = X;
|
|
96
96
|
e: for (var se = 0, S = j.length, H = S >>> 1; se < H; ) {
|
|
97
|
-
var ee = 2 * (se + 1) - 1, D = j[ee], le = ee + 1,
|
|
97
|
+
var ee = 2 * (se + 1) - 1, D = j[ee], le = ee + 1, be = j[le];
|
|
98
98
|
if (0 > o(D, X))
|
|
99
|
-
le < S && 0 > o(
|
|
100
|
-
else if (le < S && 0 > o(
|
|
101
|
-
j[se] =
|
|
99
|
+
le < S && 0 > o(be, D) ? (j[se] = be, j[le] = X, se = le) : (j[se] = D, j[ee] = X, se = ee);
|
|
100
|
+
else if (le < S && 0 > o(be, X))
|
|
101
|
+
j[se] = be, j[le] = X, se = le;
|
|
102
102
|
else break e;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -346,13 +346,13 @@ function iM() {
|
|
|
346
346
|
var C = N.prototype = new x();
|
|
347
347
|
C.constructor = N, v(C, w.prototype), C.isPureReactComponent = !0;
|
|
348
348
|
var M = Array.isArray, O = { H: null, A: null, T: null, S: null, V: null }, R = Object.prototype.hasOwnProperty;
|
|
349
|
-
function F(S, H, ee, D, le,
|
|
350
|
-
return ee =
|
|
349
|
+
function F(S, H, ee, D, le, be) {
|
|
350
|
+
return ee = be.ref, {
|
|
351
351
|
$$typeof: e,
|
|
352
352
|
type: S,
|
|
353
353
|
key: H,
|
|
354
354
|
ref: ee !== void 0 ? ee : null,
|
|
355
|
-
props:
|
|
355
|
+
props: be
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
function U(S, H) {
|
|
@@ -404,12 +404,12 @@ function iM() {
|
|
|
404
404
|
throw S;
|
|
405
405
|
}
|
|
406
406
|
function Z(S, H, ee, D, le) {
|
|
407
|
-
var
|
|
408
|
-
(
|
|
407
|
+
var be = typeof S;
|
|
408
|
+
(be === "undefined" || be === "boolean") && (S = null);
|
|
409
409
|
var de = !1;
|
|
410
410
|
if (S === null) de = !0;
|
|
411
411
|
else
|
|
412
|
-
switch (
|
|
412
|
+
switch (be) {
|
|
413
413
|
case "bigint":
|
|
414
414
|
case "string":
|
|
415
415
|
case "number":
|
|
@@ -445,23 +445,23 @@ function iM() {
|
|
|
445
445
|
var Te = D === "" ? "." : D + ":";
|
|
446
446
|
if (M(S))
|
|
447
447
|
for (var Se = 0; Se < S.length; Se++)
|
|
448
|
-
D = S[Se],
|
|
448
|
+
D = S[Se], be = Te + W(D, Se), de += Z(
|
|
449
449
|
D,
|
|
450
450
|
H,
|
|
451
451
|
ee,
|
|
452
|
-
|
|
452
|
+
be,
|
|
453
453
|
le
|
|
454
454
|
);
|
|
455
455
|
else if (Se = y(S), typeof Se == "function")
|
|
456
456
|
for (S = Se.call(S), Se = 0; !(D = S.next()).done; )
|
|
457
|
-
D = D.value,
|
|
457
|
+
D = D.value, be = Te + W(D, Se++), de += Z(
|
|
458
458
|
D,
|
|
459
459
|
H,
|
|
460
460
|
ee,
|
|
461
|
-
|
|
461
|
+
be,
|
|
462
462
|
le
|
|
463
463
|
);
|
|
464
|
-
else if (
|
|
464
|
+
else if (be === "object") {
|
|
465
465
|
if (typeof S.then == "function")
|
|
466
466
|
return Z(
|
|
467
467
|
Y(S),
|
|
@@ -479,8 +479,8 @@ function iM() {
|
|
|
479
479
|
function j(S, H, ee) {
|
|
480
480
|
if (S == null) return S;
|
|
481
481
|
var D = [], le = 0;
|
|
482
|
-
return Z(S, D, "", "", function(
|
|
483
|
-
return H.call(ee,
|
|
482
|
+
return Z(S, D, "", "", function(be) {
|
|
483
|
+
return H.call(ee, be, le++);
|
|
484
484
|
}), D;
|
|
485
485
|
}
|
|
486
486
|
function J(S) {
|
|
@@ -558,9 +558,9 @@ function iM() {
|
|
|
558
558
|
throw Error(
|
|
559
559
|
"The argument must be a React element, but you passed " + S + "."
|
|
560
560
|
);
|
|
561
|
-
var D = v({}, S.props), le = S.key,
|
|
561
|
+
var D = v({}, S.props), le = S.key, be = void 0;
|
|
562
562
|
if (H != null)
|
|
563
|
-
for (de in H.ref !== void 0 && (
|
|
563
|
+
for (de in H.ref !== void 0 && (be = void 0), H.key !== void 0 && (le = "" + H.key), H)
|
|
564
564
|
!R.call(H, de) || de === "key" || de === "__self" || de === "__source" || de === "ref" && H.ref === void 0 || (D[de] = H[de]);
|
|
565
565
|
var de = arguments.length - 2;
|
|
566
566
|
if (de === 1) D.children = ee;
|
|
@@ -569,7 +569,7 @@ function iM() {
|
|
|
569
569
|
Te[Se] = arguments[Se + 2];
|
|
570
570
|
D.children = Te;
|
|
571
571
|
}
|
|
572
|
-
return F(S.type, le, void 0, void 0,
|
|
572
|
+
return F(S.type, le, void 0, void 0, be, D);
|
|
573
573
|
}, Fe.createContext = function(S) {
|
|
574
574
|
return S = {
|
|
575
575
|
$$typeof: u,
|
|
@@ -583,9 +583,9 @@ function iM() {
|
|
|
583
583
|
_context: S
|
|
584
584
|
}, S;
|
|
585
585
|
}, Fe.createElement = function(S, H, ee) {
|
|
586
|
-
var D, le = {},
|
|
586
|
+
var D, le = {}, be = null;
|
|
587
587
|
if (H != null)
|
|
588
|
-
for (D in H.key !== void 0 && (
|
|
588
|
+
for (D in H.key !== void 0 && (be = "" + H.key), H)
|
|
589
589
|
R.call(H, D) && D !== "key" && D !== "__self" && D !== "__source" && (le[D] = H[D]);
|
|
590
590
|
var de = arguments.length - 2;
|
|
591
591
|
if (de === 1) le.children = ee;
|
|
@@ -597,7 +597,7 @@ function iM() {
|
|
|
597
597
|
if (S && S.defaultProps)
|
|
598
598
|
for (D in de = S.defaultProps, de)
|
|
599
599
|
le[D] === void 0 && (le[D] = de[D]);
|
|
600
|
-
return F(S,
|
|
600
|
+
return F(S, be, void 0, void 0, null, le);
|
|
601
601
|
}, Fe.createRef = function() {
|
|
602
602
|
return { current: null };
|
|
603
603
|
}, Fe.forwardRef = function(S) {
|
|
@@ -620,8 +620,8 @@ function iM() {
|
|
|
620
620
|
try {
|
|
621
621
|
var D = S(), le = O.S;
|
|
622
622
|
le !== null && le(ee, D), typeof D == "object" && D !== null && typeof D.then == "function" && D.then(se, X);
|
|
623
|
-
} catch (
|
|
624
|
-
X(
|
|
623
|
+
} catch (be) {
|
|
624
|
+
X(be);
|
|
625
625
|
} finally {
|
|
626
626
|
O.T = H;
|
|
627
627
|
}
|
|
@@ -1010,9 +1010,9 @@ function lM() {
|
|
|
1010
1010
|
function D(r, i) {
|
|
1011
1011
|
S++, se[S] = r.current, r.current = i;
|
|
1012
1012
|
}
|
|
1013
|
-
var le = H(null),
|
|
1013
|
+
var le = H(null), be = H(null), de = H(null), Te = H(null);
|
|
1014
1014
|
function Se(r, i) {
|
|
1015
|
-
switch (D(de, i), D(
|
|
1015
|
+
switch (D(de, i), D(be, r), D(le, null), i.nodeType) {
|
|
1016
1016
|
case 9:
|
|
1017
1017
|
case 11:
|
|
1018
1018
|
r = (r = i.documentElement) && (r = r.namespaceURI) ? Gw(r) : 0;
|
|
@@ -1035,15 +1035,15 @@ function lM() {
|
|
|
1035
1035
|
ee(le), D(le, r);
|
|
1036
1036
|
}
|
|
1037
1037
|
function Qe() {
|
|
1038
|
-
ee(le), ee(
|
|
1038
|
+
ee(le), ee(be), ee(de);
|
|
1039
1039
|
}
|
|
1040
1040
|
function $e(r) {
|
|
1041
1041
|
r.memoizedState !== null && D(Te, r);
|
|
1042
1042
|
var i = le.current, s = _w(i, r.type);
|
|
1043
|
-
i !== s && (D(
|
|
1043
|
+
i !== s && (D(be, r), D(le, s));
|
|
1044
1044
|
}
|
|
1045
1045
|
function ft(r) {
|
|
1046
|
-
|
|
1046
|
+
be.current === r && (ee(le), ee(be)), Te.current === r && (ee(Te), Qo._currentValue = X);
|
|
1047
1047
|
}
|
|
1048
1048
|
var Gt = Object.prototype.hasOwnProperty, Mt = e.unstable_scheduleCallback, Je = e.unstable_cancelCallback, ge = e.unstable_shouldYield, Ee = e.unstable_requestPaint, Le = e.unstable_now, Ue = e.unstable_getCurrentPriorityLevel, Oe = e.unstable_ImmediatePriority, Ie = e.unstable_UserBlockingPriority, et = e.unstable_NormalPriority, Ye = e.unstable_LowPriority, ze = e.unstable_IdlePriority, De = e.log, Pe = e.unstable_setDisableYieldValue, ne = null, ie = null;
|
|
1049
1049
|
function he(r) {
|
|
@@ -1765,10 +1765,10 @@ Error generating stack: ` + s.message + `
|
|
|
1765
1765
|
return ic.test("" + r) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : r;
|
|
1766
1766
|
}
|
|
1767
1767
|
var ae = null;
|
|
1768
|
-
function
|
|
1768
|
+
function me(r) {
|
|
1769
1769
|
return r = r.target || r.srcElement || window, r.correspondingUseElement && (r = r.correspondingUseElement), r.nodeType === 3 ? r.parentNode : r;
|
|
1770
1770
|
}
|
|
1771
|
-
var
|
|
1771
|
+
var we = null, Ce = null;
|
|
1772
1772
|
function Et(r) {
|
|
1773
1773
|
var i = xn(r);
|
|
1774
1774
|
if (i && (r = i.stateNode)) {
|
|
@@ -1827,7 +1827,7 @@ Error generating stack: ` + s.message + `
|
|
|
1827
1827
|
var c = r(i);
|
|
1828
1828
|
return c;
|
|
1829
1829
|
} finally {
|
|
1830
|
-
if (bt = !1, (
|
|
1830
|
+
if (bt = !1, (we !== null || Ce !== null) && (kl(), we && (i = we, r = Ce, Ce = we = null, Et(i), r)))
|
|
1831
1831
|
for (i = 0; i < r.length; i++) Et(r[i]);
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
@@ -2153,7 +2153,7 @@ Error generating stack: ` + s.message + `
|
|
|
2153
2153
|
return i === "input" ? !!kD[r.type] : i === "textarea";
|
|
2154
2154
|
}
|
|
2155
2155
|
function av(r, i, s, c) {
|
|
2156
|
-
|
|
2156
|
+
we ? Ce ? Ce.push(c) : Ce = [c] : we = c, i = Fl(i, "onChange"), 0 < i.length && (s = new Xs(
|
|
2157
2157
|
"onChange",
|
|
2158
2158
|
"change",
|
|
2159
2159
|
null,
|
|
@@ -2195,7 +2195,7 @@ Error generating stack: ` + s.message + `
|
|
|
2195
2195
|
i,
|
|
2196
2196
|
go,
|
|
2197
2197
|
r,
|
|
2198
|
-
|
|
2198
|
+
me(r)
|
|
2199
2199
|
), dn(OD, i);
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
@@ -4204,70 +4204,70 @@ Error generating stack: ` + s.message + `
|
|
|
4204
4204
|
return null;
|
|
4205
4205
|
}
|
|
4206
4206
|
function ke(V, G, K, ue) {
|
|
4207
|
-
for (var ve = null, He = null,
|
|
4208
|
-
|
|
4207
|
+
for (var ve = null, He = null, Ae = G, Ne = G = 0, qt = null; Ae !== null && Ne < K.length; Ne++) {
|
|
4208
|
+
Ae.index > Ne ? (qt = Ae, Ae = null) : qt = Ae.sibling;
|
|
4209
4209
|
var Ke = $(
|
|
4210
4210
|
V,
|
|
4211
|
-
|
|
4211
|
+
Ae,
|
|
4212
4212
|
K[Ne],
|
|
4213
4213
|
ue
|
|
4214
4214
|
);
|
|
4215
4215
|
if (Ke === null) {
|
|
4216
|
-
|
|
4216
|
+
Ae === null && (Ae = qt);
|
|
4217
4217
|
break;
|
|
4218
4218
|
}
|
|
4219
|
-
r &&
|
|
4219
|
+
r && Ae && Ke.alternate === null && i(V, Ae), G = b(Ke, G, Ne), He === null ? ve = Ke : He.sibling = Ke, He = Ke, Ae = qt;
|
|
4220
4220
|
}
|
|
4221
4221
|
if (Ne === K.length)
|
|
4222
|
-
return s(V,
|
|
4223
|
-
if (
|
|
4222
|
+
return s(V, Ae), Ze && Ua(V, Ne), ve;
|
|
4223
|
+
if (Ae === null) {
|
|
4224
4224
|
for (; Ne < K.length; Ne++)
|
|
4225
|
-
|
|
4226
|
-
|
|
4225
|
+
Ae = ce(V, K[Ne], ue), Ae !== null && (G = b(
|
|
4226
|
+
Ae,
|
|
4227
4227
|
G,
|
|
4228
4228
|
Ne
|
|
4229
|
-
), He === null ? ve =
|
|
4229
|
+
), He === null ? ve = Ae : He.sibling = Ae, He = Ae);
|
|
4230
4230
|
return Ze && Ua(V, Ne), ve;
|
|
4231
4231
|
}
|
|
4232
|
-
for (
|
|
4232
|
+
for (Ae = c(Ae); Ne < K.length; Ne++)
|
|
4233
4233
|
qt = te(
|
|
4234
|
-
|
|
4234
|
+
Ae,
|
|
4235
4235
|
V,
|
|
4236
4236
|
Ne,
|
|
4237
4237
|
K[Ne],
|
|
4238
4238
|
ue
|
|
4239
|
-
), qt !== null && (r && qt.alternate !== null &&
|
|
4239
|
+
), qt !== null && (r && qt.alternate !== null && Ae.delete(
|
|
4240
4240
|
qt.key === null ? Ne : qt.key
|
|
4241
4241
|
), G = b(
|
|
4242
4242
|
qt,
|
|
4243
4243
|
G,
|
|
4244
4244
|
Ne
|
|
4245
4245
|
), He === null ? ve = qt : He.sibling = qt, He = qt);
|
|
4246
|
-
return r &&
|
|
4246
|
+
return r && Ae.forEach(function(ma) {
|
|
4247
4247
|
return i(V, ma);
|
|
4248
4248
|
}), Ze && Ua(V, Ne), ve;
|
|
4249
4249
|
}
|
|
4250
4250
|
function Re(V, G, K, ue) {
|
|
4251
4251
|
if (K == null) throw Error(a(151));
|
|
4252
|
-
for (var ve = null, He = null,
|
|
4253
|
-
|
|
4254
|
-
var ma = $(V,
|
|
4252
|
+
for (var ve = null, He = null, Ae = G, Ne = G = 0, qt = null, Ke = K.next(); Ae !== null && !Ke.done; Ne++, Ke = K.next()) {
|
|
4253
|
+
Ae.index > Ne ? (qt = Ae, Ae = null) : qt = Ae.sibling;
|
|
4254
|
+
var ma = $(V, Ae, Ke.value, ue);
|
|
4255
4255
|
if (ma === null) {
|
|
4256
|
-
|
|
4256
|
+
Ae === null && (Ae = qt);
|
|
4257
4257
|
break;
|
|
4258
4258
|
}
|
|
4259
|
-
r &&
|
|
4259
|
+
r && Ae && ma.alternate === null && i(V, Ae), G = b(ma, G, Ne), He === null ? ve = ma : He.sibling = ma, He = ma, Ae = qt;
|
|
4260
4260
|
}
|
|
4261
4261
|
if (Ke.done)
|
|
4262
|
-
return s(V,
|
|
4263
|
-
if (
|
|
4262
|
+
return s(V, Ae), Ze && Ua(V, Ne), ve;
|
|
4263
|
+
if (Ae === null) {
|
|
4264
4264
|
for (; !Ke.done; Ne++, Ke = K.next())
|
|
4265
4265
|
Ke = ce(V, Ke.value, ue), Ke !== null && (G = b(Ke, G, Ne), He === null ? ve = Ke : He.sibling = Ke, He = Ke);
|
|
4266
4266
|
return Ze && Ua(V, Ne), ve;
|
|
4267
4267
|
}
|
|
4268
|
-
for (
|
|
4269
|
-
Ke = te(
|
|
4270
|
-
return r &&
|
|
4268
|
+
for (Ae = c(Ae); !Ke.done; Ne++, Ke = K.next())
|
|
4269
|
+
Ke = te(Ae, V, Ne, Ke.value, ue), Ke !== null && (r && Ke.alternate !== null && Ae.delete(Ke.key === null ? Ne : Ke.key), G = b(Ke, G, Ne), He === null ? ve = Ke : He.sibling = Ke, He = Ke);
|
|
4270
|
+
return r && Ae.forEach(function(eM) {
|
|
4271
4271
|
return i(V, eM);
|
|
4272
4272
|
}), Ze && Ua(V, Ne), ve;
|
|
4273
4273
|
}
|
|
@@ -4388,9 +4388,9 @@ Error generating stack: ` + s.message + `
|
|
|
4388
4388
|
ue
|
|
4389
4389
|
);
|
|
4390
4390
|
return Ni = null, ve;
|
|
4391
|
-
} catch (
|
|
4392
|
-
if (
|
|
4393
|
-
var He = Nn(29,
|
|
4391
|
+
} catch (Ae) {
|
|
4392
|
+
if (Ae === To || Ae === ol) throw Ae;
|
|
4393
|
+
var He = Nn(29, Ae, null, V.mode);
|
|
4394
4394
|
return He.lanes = ue, He.return = V, He;
|
|
4395
4395
|
} finally {
|
|
4396
4396
|
}
|
|
@@ -8047,7 +8047,7 @@ Error generating stack: ` + s.message + `
|
|
|
8047
8047
|
c = c.return;
|
|
8048
8048
|
}
|
|
8049
8049
|
dn(function() {
|
|
8050
|
-
var Q = b, oe =
|
|
8050
|
+
var Q = b, oe = me(s), ce = [];
|
|
8051
8051
|
e: {
|
|
8052
8052
|
var $ = vv.get(r);
|
|
8053
8053
|
if ($ !== void 0) {
|
|
@@ -8243,7 +8243,7 @@ Error generating stack: ` + s.message + `
|
|
|
8243
8243
|
case "keyup":
|
|
8244
8244
|
hv(ce, s, oe);
|
|
8245
8245
|
}
|
|
8246
|
-
var
|
|
8246
|
+
var Ae;
|
|
8247
8247
|
if (cc)
|
|
8248
8248
|
e: {
|
|
8249
8249
|
switch (r) {
|
|
@@ -8261,13 +8261,13 @@ Error generating stack: ` + s.message + `
|
|
|
8261
8261
|
}
|
|
8262
8262
|
else
|
|
8263
8263
|
fi ? tv(r, s) && (Ne = "onCompositionEnd") : r === "keydown" && s.keyCode === 229 && (Ne = "onCompositionStart");
|
|
8264
|
-
Ne && (JE && s.locale !== "ko" && (fi || Ne !== "onCompositionStart" ? Ne === "onCompositionEnd" && fi && (
|
|
8264
|
+
Ne && (JE && s.locale !== "ko" && (fi || Ne !== "onCompositionStart" ? Ne === "onCompositionEnd" && fi && (Ae = WE()) : (Bn = oe, uo = "value" in Bn ? Bn.value : Bn.textContent, fi = !0)), He = Fl(Q, Ne), 0 < He.length && (Ne = new QE(
|
|
8265
8265
|
Ne,
|
|
8266
8266
|
r,
|
|
8267
8267
|
null,
|
|
8268
8268
|
s,
|
|
8269
8269
|
oe
|
|
8270
|
-
), ce.push({ event: Ne, listeners: He }),
|
|
8270
|
+
), ce.push({ event: Ne, listeners: He }), Ae ? Ne.data = Ae : (Ae = nv(s), Ae !== null && (Ne.data = Ae)))), (Ae = RD ? ND(r, s) : CD(r, s)) && (Ne = Fl(Q, "onBeforeInput"), 0 < Ne.length && (He = new QE(
|
|
8271
8271
|
"onBeforeInput",
|
|
8272
8272
|
"beforeinput",
|
|
8273
8273
|
null,
|
|
@@ -8276,7 +8276,7 @@ Error generating stack: ` + s.message + `
|
|
|
8276
8276
|
), ce.push({
|
|
8277
8277
|
event: He,
|
|
8278
8278
|
listeners: Ne
|
|
8279
|
-
}), He.data =
|
|
8279
|
+
}), He.data = Ae)), yL(
|
|
8280
8280
|
ce,
|
|
8281
8281
|
r,
|
|
8282
8282
|
Q,
|
|
@@ -9824,7 +9824,7 @@ Error generating stack: ` + s.message + `
|
|
|
9824
9824
|
}
|
|
9825
9825
|
}
|
|
9826
9826
|
function Zd(r) {
|
|
9827
|
-
return r =
|
|
9827
|
+
return r = me(r), Jd(r);
|
|
9828
9828
|
}
|
|
9829
9829
|
var _l = null;
|
|
9830
9830
|
function Jd(r) {
|
|
@@ -14991,8 +14991,8 @@ function IB(e, t, n) {
|
|
|
14991
14991
|
}
|
|
14992
14992
|
function w(D) {
|
|
14993
14993
|
if (D === null || D === 47 || D === 62 || lt(D)) {
|
|
14994
|
-
const le = D === 47,
|
|
14995
|
-
return !le && !l && tT.includes(
|
|
14994
|
+
const le = D === 47, be = u.toLowerCase();
|
|
14995
|
+
return !le && !l && tT.includes(be) ? (o = 1, a.interrupt ? t(D) : W(D)) : RB.includes(u.toLowerCase()) ? (o = 6, le ? (e.consume(D), x) : a.interrupt ? t(D) : W(D)) : (o = 7, a.interrupt && !a.parser.lazy[a.now().line] ? n(D) : l ? N(D) : C(D));
|
|
14996
14996
|
}
|
|
14997
14997
|
return D === 45 || tn(D) ? (e.consume(D), u += String.fromCharCode(D), w) : n(D);
|
|
14998
14998
|
}
|
|
@@ -15827,21 +15827,21 @@ function wU(e, t, n) {
|
|
|
15827
15827
|
function D(de) {
|
|
15828
15828
|
return Te;
|
|
15829
15829
|
function Te(Se) {
|
|
15830
|
-
return S = P(), se = de, de.partial || (p.currentConstruct = de), de.name && p.parser.constructs.disable.null.includes(de.name) ?
|
|
15830
|
+
return S = P(), se = de, de.partial || (p.currentConstruct = de), de.name && p.parser.constructs.disable.null.includes(de.name) ? be() : de.tokenize.call(
|
|
15831
15831
|
// If we do have fields, create an object w/ `context` as its
|
|
15832
15832
|
// prototype.
|
|
15833
15833
|
// This allows a “live binding”, which is needed for `interrupt`.
|
|
15834
15834
|
W ? Object.assign(Object.create(p), W) : p,
|
|
15835
15835
|
f,
|
|
15836
15836
|
le,
|
|
15837
|
-
|
|
15837
|
+
be
|
|
15838
15838
|
)(Se);
|
|
15839
15839
|
}
|
|
15840
15840
|
}
|
|
15841
15841
|
function le(de) {
|
|
15842
15842
|
return q(se, S), Z;
|
|
15843
15843
|
}
|
|
15844
|
-
function
|
|
15844
|
+
function be(de) {
|
|
15845
15845
|
return S.restore(), ++X < J.length ? D(J[X]) : j;
|
|
15846
15846
|
}
|
|
15847
15847
|
}
|
|
@@ -16052,8 +16052,8 @@ function DU(e) {
|
|
|
16052
16052
|
autolinkProtocol: Se,
|
|
16053
16053
|
blockQuote: f(),
|
|
16054
16054
|
characterEscapeValue: B,
|
|
16055
|
-
characterReferenceMarkerHexadecimal:
|
|
16056
|
-
characterReferenceMarkerNumeric:
|
|
16055
|
+
characterReferenceMarkerHexadecimal: be,
|
|
16056
|
+
characterReferenceMarkerNumeric: be,
|
|
16057
16057
|
characterReferenceValue: de,
|
|
16058
16058
|
characterReference: Te,
|
|
16059
16059
|
codeFenced: f(w),
|
|
@@ -16378,7 +16378,7 @@ function DU(e) {
|
|
|
16378
16378
|
const ie = this.resume(), he = this.stack[this.stack.length - 1];
|
|
16379
16379
|
he.label = ie, he.identifier = rr(this.sliceSerialize(ne)).toLowerCase(), this.data.referenceType = "full";
|
|
16380
16380
|
}
|
|
16381
|
-
function
|
|
16381
|
+
function be(ne) {
|
|
16382
16382
|
this.data.characterReferenceType = ne.type;
|
|
16383
16383
|
}
|
|
16384
16384
|
function de(ne) {
|
|
@@ -22678,7 +22678,7 @@ const iI = (e, t, n, a, o) => {
|
|
|
22678
22678
|
offset: de.value
|
|
22679
22679
|
});
|
|
22680
22680
|
return await E(H, de, Te.offset), Te;
|
|
22681
|
-
})),
|
|
22681
|
+
})), be = a(H, {
|
|
22682
22682
|
channelCount: 1,
|
|
22683
22683
|
channelCountMode: "explicit",
|
|
22684
22684
|
channelInterpretation: "speakers",
|
|
@@ -22687,11 +22687,11 @@ const iI = (e, t, n, a, o) => {
|
|
|
22687
22687
|
for (let de = 0; de < x.numberOfInputs; de += 1) {
|
|
22688
22688
|
ee[de].connect(D[de]);
|
|
22689
22689
|
for (let Te = 0; Te < x.channelCount; Te += 1)
|
|
22690
|
-
D[de].connect(
|
|
22690
|
+
D[de].connect(be, Te, de * x.channelCount + Te);
|
|
22691
22691
|
}
|
|
22692
22692
|
for (const [de, Te] of le.entries())
|
|
22693
|
-
Te.connect(
|
|
22694
|
-
return
|
|
22693
|
+
Te.connect(be, 0, J + de), Te.start(0);
|
|
22694
|
+
return be.connect(H.destination), await Promise.all(ee.map((de) => v(R, H, de))), A(H);
|
|
22695
22695
|
})(), F, x, q, N, p);
|
|
22696
22696
|
}
|
|
22697
22697
|
const W = await M, _ = n(F, {
|
|
@@ -23419,7 +23419,7 @@ const iI = (e, t, n, a, o) => {
|
|
|
23419
23419
|
}), A.prototype.port = O.port1;
|
|
23420
23420
|
let H = null;
|
|
23421
23421
|
YH(E, X, A, w).then((ge) => H = ge);
|
|
23422
|
-
const D = xu(w.numberOfInputs, w.channelCount), le = xu(w.numberOfOutputs, x),
|
|
23422
|
+
const D = xu(w.numberOfInputs, w.channelCount), le = xu(w.numberOfOutputs, x), be = A.parameterDescriptors === void 0 ? [] : A.parameterDescriptors.reduce((ge, { name: Ee }) => ({ ...ge, [Ee]: new Float32Array(128) }), {});
|
|
23423
23423
|
let de = !0;
|
|
23424
23424
|
const Te = () => {
|
|
23425
23425
|
w.numberOfOutputs > 0 && q.disconnect(W);
|
|
@@ -23438,7 +23438,7 @@ const iI = (e, t, n, a, o) => {
|
|
|
23438
23438
|
for (let Ie = 0; Ie < w.channelCount; Ie += 1)
|
|
23439
23439
|
Tu(ge, D[Oe], Ie, Ie, Ue);
|
|
23440
23440
|
A.parameterDescriptors !== void 0 && A.parameterDescriptors.forEach(({ name: Oe }, Ie) => {
|
|
23441
|
-
Tu(ge,
|
|
23441
|
+
Tu(ge, be, Oe, N + Ie, Ue);
|
|
23442
23442
|
});
|
|
23443
23443
|
for (let Oe = 0; Oe < w.numberOfInputs; Oe += 1)
|
|
23444
23444
|
for (let Ie = 0; Ie < x[Oe]; Ie += 1)
|
|
@@ -23450,7 +23450,7 @@ const iI = (e, t, n, a, o) => {
|
|
|
23450
23450
|
const De = Se.get(Ye);
|
|
23451
23451
|
return De === void 0 ? [] : (et.every((Pe) => Pe.every((ne) => ne === 0)) && (De === 1 ? Se.delete(Ye) : Se.set(Ye, De - 1)), et);
|
|
23452
23452
|
});
|
|
23453
|
-
de = h(E.currentTime + Ue / E.sampleRate, E.sampleRate, () => H.process(Oe, le,
|
|
23453
|
+
de = h(E.currentTime + Ue / E.sampleRate, E.sampleRate, () => H.process(Oe, le, be));
|
|
23454
23454
|
for (let et = 0, Ye = 0; et < w.numberOfOutputs; et += 1) {
|
|
23455
23455
|
for (let ze = 0; ze < x[et]; ze += 1)
|
|
23456
23456
|
iI(Ee, le[et], ze, Ye + ze, Ue);
|
|
@@ -24255,7 +24255,7 @@ function D_() {
|
|
|
24255
24255
|
return null;
|
|
24256
24256
|
} : x, C = p.onStart, M = C === void 0 ? function() {
|
|
24257
24257
|
return null;
|
|
24258
|
-
} : C, O = p.blobPropertyBag, R = p.screen, F = R === void 0 ? !1 : R, U = p.mediaRecorderOptions, P = U === void 0 ? void 0 : U, B = p.customMediaStream, q = B === void 0 ? null : B, W = p.stopStreamsOnStop, _ = W === void 0 ? !0 : W, Y = p.askPermissionOnMount, Z = Y === void 0 ? !1 : Y, j = (0, o.useRef)(null), J = (0, o.useRef)([]), X = (0, o.useRef)(null), se = (0, o.useState)("idle"), S = se[0], H = se[1], ee = (0, o.useState)(!1), D = ee[0], le = ee[1],
|
|
24258
|
+
} : C, O = p.blobPropertyBag, R = p.screen, F = R === void 0 ? !1 : R, U = p.mediaRecorderOptions, P = U === void 0 ? void 0 : U, B = p.customMediaStream, q = B === void 0 ? null : B, W = p.stopStreamsOnStop, _ = W === void 0 ? !0 : W, Y = p.askPermissionOnMount, Z = Y === void 0 ? !1 : Y, j = (0, o.useRef)(null), J = (0, o.useRef)([]), X = (0, o.useRef)(null), se = (0, o.useState)("idle"), S = se[0], H = se[1], ee = (0, o.useState)(!1), D = ee[0], le = ee[1], be = (0, o.useState)(void 0), de = be[0], Te = be[1], Se = (0, o.useState)("NONE"), Qe = Se[0], $e = Se[1], ft = (0, o.useState)(!1), Gt = ft[0], Mt = ft[1];
|
|
24259
24259
|
(0, o.useEffect)(function() {
|
|
24260
24260
|
if (!Gt) {
|
|
24261
24261
|
var ze = function() {
|
|
@@ -24831,16 +24831,16 @@ function rV(e, t) {
|
|
|
24831
24831
|
}, m.style), !se)
|
|
24832
24832
|
return /* @__PURE__ */ yn.createElement(Y, le, H, /* @__PURE__ */ yn.createElement(j, m, X));
|
|
24833
24833
|
(F === void 0 && W || P) && (F = !0), W = W || tV;
|
|
24834
|
-
var
|
|
24834
|
+
var be = [{
|
|
24835
24835
|
type: "text",
|
|
24836
24836
|
value: X
|
|
24837
24837
|
}], de = nV({
|
|
24838
24838
|
astGenerator: se,
|
|
24839
24839
|
language: o,
|
|
24840
24840
|
code: X,
|
|
24841
|
-
defaultCodeValue:
|
|
24841
|
+
defaultCodeValue: be
|
|
24842
24842
|
});
|
|
24843
|
-
de.language === null && (de.value =
|
|
24843
|
+
de.language === null && (de.value = be);
|
|
24844
24844
|
var Te = de.value.length;
|
|
24845
24845
|
Te === 1 && de.value[0].type === "text" && (Te = de.value[0].value.split(`
|
|
24846
24846
|
`).length);
|
|
@@ -25837,17 +25837,17 @@ function xY() {
|
|
|
25837
25837
|
var q = 1, W = 2, _ = 3, Y = 4, Z = 5, j = 6, J = 7, X = {};
|
|
25838
25838
|
X[q] = "Named character references must be terminated by a semicolon", X[W] = "Numeric character references must be terminated by a semicolon", X[_] = "Named character references cannot be empty", X[Y] = "Numeric character references cannot be empty", X[Z] = "Named character references must be known", X[j] = "Numeric character references cannot be disallowed", X[J] = "Numeric character references cannot be outside the permissible Unicode range";
|
|
25839
25839
|
function se(D, le) {
|
|
25840
|
-
var
|
|
25840
|
+
var be = {}, de, Te;
|
|
25841
25841
|
le || (le = {});
|
|
25842
25842
|
for (Te in p)
|
|
25843
|
-
de = le[Te],
|
|
25844
|
-
return (
|
|
25843
|
+
de = le[Te], be[Te] = de ?? p[Te];
|
|
25844
|
+
return (be.position.indent || be.position.start) && (be.indent = be.position.indent || [], be.position = be.position.start), S(D, be);
|
|
25845
25845
|
}
|
|
25846
25846
|
function S(D, le) {
|
|
25847
|
-
var
|
|
25848
|
-
for (typeof
|
|
25847
|
+
var be = le.additional, de = le.nonTerminated, Te = le.text, Se = le.reference, Qe = le.warning, $e = le.textContext, ft = le.referenceContext, Gt = le.warningContext, Mt = le.position, Je = le.indent || [], ge = D.length, Ee = 0, Le = -1, Ue = Mt.column || 1, Oe = Mt.line || 1, Ie = "", et = [], Ye, ze, De, Pe, ne, ie, he, ye, je, mt, wt, At, Tt, rt, ut, xt, Ft, _t, ht;
|
|
25848
|
+
for (typeof be == "string" && (be = be.charCodeAt(0)), xt = Yn(), ye = Qe ? An : f, Ee--, ge++; ++Ee < ge; )
|
|
25849
25849
|
if (ne === m && (Ue = Je[Le] || 1), ne = D.charCodeAt(Ee), ne === v) {
|
|
25850
|
-
if (he = D.charCodeAt(Ee + 1), he === h || he === m || he === y || he === E || he === v || he === w || he !== he ||
|
|
25850
|
+
if (he = D.charCodeAt(Ee + 1), he === h || he === m || he === y || he === E || he === v || he === w || he !== he || be && he === be) {
|
|
25851
25851
|
Ie += d(ne), Ue++;
|
|
25852
25852
|
continue;
|
|
25853
25853
|
}
|
|
@@ -26529,8 +26529,8 @@ function RY() {
|
|
|
26529
26529
|
X = X.next, le += X.value.length;
|
|
26530
26530
|
if (le -= X.value.length, se = le, X.value instanceof f)
|
|
26531
26531
|
continue;
|
|
26532
|
-
for (var
|
|
26533
|
-
H++, le +=
|
|
26532
|
+
for (var be = X; be !== C.tail && (le < D || typeof be.value == "string"); be = be.next)
|
|
26533
|
+
H++, le += be.value.length;
|
|
26534
26534
|
H--, S = N.slice(se, le), ee.index -= se;
|
|
26535
26535
|
} else if (ee = p(J, 0, S, _), !ee)
|
|
26536
26536
|
continue;
|
|
@@ -48393,23 +48393,23 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48393
48393
|
});
|
|
48394
48394
|
})();
|
|
48395
48395
|
}, [e.bot?.botId, e?.token]);
|
|
48396
|
-
const h = u?.mainColor || "#59168b", m = u?.secondaryColor || "#6366f1", y = u?.thirdColor || "#0f172b", E = u?.headerFirstColor || "#6e11b0", v = u?.headerSecondColor || "#372aac", A = u?.inputBackgroundColor || "#1f2937", w = u?.inputTextColor || "#fff", x = u?.roundness || 24, N = u?.chatRoundness || 16, C = (u?.minPanelWidth || 434) > window.innerWidth ? window.innerWidth : u?.minPanelWidth || 434, M = (u?.maxPanelWidth || window.innerWidth) > window.innerWidth ? window.innerWidth : u?.maxPanelWidth || window.innerWidth, O = u?.chatMaxWidth || 88, R = u?.toggleBtnBorderTopLeftRadius || 12, F = u?.toggleBtnBorderTopRightRadius || 0, U = u?.toggleBtnBorderBottomLeftRadius || 12, P = u?.toggleBtnBorderBottomRightRadius || 0, B = u?.menuBackgroundColor || "#1f2937", q = u?.menuTextColor || "#e5e7eb", W = u?.menuHoverBackgroundColor || "#374151", _ = u?.agentChatResponseColor || "#e5e7eb", Y = u?.agentChatResponseBgColor || "#1f2937", Z = u?.agentIconBgColor || "#59168b", j = u?.agentIconColor || "#fff", J = u?.userChatMessagesColor || "#fff", X = u?.userChatMessagesBgColor || "#7a1ebe", se = u?.userIconBgColor || "#7a1ebe", S = u?.userIconColor || "#fff", H = u?.ButtonColor || "#fff", ee = u?.ButtonsBgColor || "#59168b", D = u?.fontSize || 13, le = u?.toggleBtnPosition || "bottom-right",
|
|
48396
|
+
const h = u?.mainColor || "#59168b", m = u?.secondaryColor || "#6366f1", y = u?.thirdColor || "#0f172b", E = u?.headerFirstColor || "#6e11b0", v = u?.headerSecondColor || "#372aac", A = u?.inputBackgroundColor || "#1f2937", w = u?.inputTextColor || "#fff", x = u?.roundness || 24, N = u?.chatRoundness || 16, C = (u?.minPanelWidth || 434) > window.innerWidth ? window.innerWidth : u?.minPanelWidth || 434, M = (u?.maxPanelWidth || window.innerWidth) > window.innerWidth ? window.innerWidth : u?.maxPanelWidth || window.innerWidth, O = u?.chatMaxWidth || 88, R = u?.toggleBtnBorderTopLeftRadius || 12, F = u?.toggleBtnBorderTopRightRadius || 0, U = u?.toggleBtnBorderBottomLeftRadius || 12, P = u?.toggleBtnBorderBottomRightRadius || 0, B = u?.menuBackgroundColor || "#1f2937", q = u?.menuTextColor || "#e5e7eb", W = u?.menuHoverBackgroundColor || "#374151", _ = u?.agentChatResponseColor || "#e5e7eb", Y = u?.agentChatResponseBgColor || "#1f2937", Z = u?.agentIconBgColor || "#59168b", j = u?.agentIconColor || "#fff", J = u?.userChatMessagesColor || "#fff", X = u?.userChatMessagesBgColor || "#7a1ebe", se = u?.userIconBgColor || "#7a1ebe", S = u?.userIconColor || "#fff", H = u?.ButtonColor || "#fff", ee = u?.ButtonsBgColor || "#59168b", D = u?.fontSize || 13, le = u?.toggleBtnPosition || "bottom-right", be = u?.autoOpenPanel ?? !0, Te = (() => {
|
|
48397
48397
|
const L = u?.firstMessageKeyword;
|
|
48398
48398
|
if (Array.isArray(L)) {
|
|
48399
|
-
const ae = window.location.href,
|
|
48400
|
-
if (
|
|
48401
|
-
const
|
|
48402
|
-
return
|
|
48399
|
+
const ae = window.location.href, me = L.find((Ce) => Ce.url && Ce.url === ae);
|
|
48400
|
+
if (me) return me.message;
|
|
48401
|
+
const we = L.find((Ce) => !Ce.url || Ce.url === "");
|
|
48402
|
+
return we ? we.message : L[0]?.message || "hi";
|
|
48403
48403
|
}
|
|
48404
48404
|
return L || "hi";
|
|
48405
48405
|
})(), [Se, Qe] = pe.useState(C), $e = pe.useRef(!1), ft = pe.useRef(0), Gt = pe.useRef(C), Mt = (L) => {
|
|
48406
48406
|
$e.current = !0, ft.current = L.clientX, Gt.current = Se, document.body.style.cursor = "ew-resize";
|
|
48407
48407
|
};
|
|
48408
48408
|
pe.useEffect(() => {
|
|
48409
|
-
const L = (
|
|
48409
|
+
const L = (me) => {
|
|
48410
48410
|
if (!$e.current) return;
|
|
48411
|
-
const
|
|
48412
|
-
let Ce = Gt.current +
|
|
48411
|
+
const we = ft.current - me.clientX;
|
|
48412
|
+
let Ce = Gt.current + we;
|
|
48413
48413
|
Ce = Math.max(C, Math.min(M, Ce)), Qe(Ce);
|
|
48414
48414
|
}, ae = () => {
|
|
48415
48415
|
$e.current && ($e.current = !1, document.body.style.cursor = "");
|
|
@@ -48425,8 +48425,8 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48425
48425
|
ht.current = !1, An("00:00"), Tn.current = 0;
|
|
48426
48426
|
return;
|
|
48427
48427
|
}
|
|
48428
|
-
wt((
|
|
48429
|
-
...
|
|
48428
|
+
wt((me) => [
|
|
48429
|
+
...me,
|
|
48430
48430
|
{
|
|
48431
48431
|
id: Date.now().toString() + Math.random().toString(36).substring(2, 9),
|
|
48432
48432
|
file: ae,
|
|
@@ -48438,20 +48438,23 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48438
48438
|
]), An("00:00"), Tn.current = 0;
|
|
48439
48439
|
}
|
|
48440
48440
|
}), ui = u?.icon || e?.bot.avatar_url || EW, Na = u?.title || e?.bot.name || "Tybot webchat", [zr, jr] = pe.useState(() => {
|
|
48441
|
+
const L = localStorage.getItem("phone_client");
|
|
48442
|
+
if (e.bot?.botId === "rockskin" && L)
|
|
48443
|
+
return L;
|
|
48441
48444
|
if (!u?.botNeedsAuth) {
|
|
48442
|
-
let
|
|
48443
|
-
if (!
|
|
48444
|
-
const
|
|
48445
|
-
window.crypto.getRandomValues(
|
|
48445
|
+
let ae = localStorage.getItem("conversationId");
|
|
48446
|
+
if (!ae) {
|
|
48447
|
+
const me = new Uint8Array(16);
|
|
48448
|
+
window.crypto.getRandomValues(me), ae = Array.from(me).map((we) => we.toString(16).padStart(2, "0")).join("");
|
|
48446
48449
|
}
|
|
48447
|
-
return localStorage.setItem("conversationId",
|
|
48450
|
+
return localStorage.setItem("conversationId", ae), ae;
|
|
48448
48451
|
}
|
|
48449
48452
|
}), [Fn, qr] = pe.useState(() => u?.botNeedsAuth ? !!localStorage.getItem("conversationId") : !0), [xn, Ca] = pe.useState(""), [Xn, Ot] = pe.useState(""), [ka, Ps] = pe.useState(""), Vt = pe.useRef(!1), ln = Pr.reduce((L, ae) => ae.seen ? L : L + (ae.sender === "agent" ? ae.nMessage || 1 : 0), 0), ro = () => {
|
|
48450
48453
|
sr((L) => L.map((ae) => ({ ...ae, seen: !0 })));
|
|
48451
48454
|
};
|
|
48452
48455
|
pe.useEffect(() => {
|
|
48453
48456
|
let L;
|
|
48454
|
-
return !localStorage.getItem("webChatOpen") && u &&
|
|
48457
|
+
return !localStorage.getItem("webChatOpen") && u && be && (L = setTimeout(() => {
|
|
48455
48458
|
ge(!0), Vt.current = !0, ro(), localStorage.setItem("webChatOpen", "true");
|
|
48456
48459
|
}, 3200)), () => clearTimeout(L);
|
|
48457
48460
|
}, [u]), pe.useEffect(() => {
|
|
@@ -48459,33 +48462,33 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48459
48462
|
if (!L || !(() => {
|
|
48460
48463
|
if (!L.urls || L.urls.length === 0)
|
|
48461
48464
|
return !0;
|
|
48462
|
-
const
|
|
48465
|
+
const we = window.location.origin, Ce = window.location.href;
|
|
48463
48466
|
return L.urls.some((Et) => {
|
|
48464
48467
|
if (!Et || Et.trim() === "") return !0;
|
|
48465
48468
|
try {
|
|
48466
|
-
return
|
|
48469
|
+
return we.includes(Et) || Ce.includes(Et) || Et.includes(we);
|
|
48467
48470
|
} catch {
|
|
48468
48471
|
return console.warn("Invalid URL in widgetLoadBehavior:", Et), !1;
|
|
48469
48472
|
}
|
|
48470
48473
|
});
|
|
48471
48474
|
})())
|
|
48472
48475
|
return;
|
|
48473
|
-
let
|
|
48476
|
+
let me;
|
|
48474
48477
|
if (L.behavior === "after seconds")
|
|
48475
|
-
|
|
48478
|
+
me = setTimeout(() => {
|
|
48476
48479
|
Oe(!0);
|
|
48477
48480
|
}, L.value * 1e3);
|
|
48478
48481
|
else if (L.behavior === "after scroll") {
|
|
48479
|
-
const
|
|
48482
|
+
const we = () => {
|
|
48480
48483
|
const Ce = window.pageYOffset || document.documentElement.scrollTop, Et = document.documentElement.scrollHeight - document.documentElement.clientHeight;
|
|
48481
|
-
Ce / Et * 100 >= L.value && (Oe(!0), window.removeEventListener("scroll",
|
|
48484
|
+
Ce / Et * 100 >= L.value && (Oe(!0), window.removeEventListener("scroll", we));
|
|
48482
48485
|
};
|
|
48483
|
-
return window.addEventListener("scroll",
|
|
48484
|
-
window.removeEventListener("scroll",
|
|
48486
|
+
return window.addEventListener("scroll", we), () => {
|
|
48487
|
+
window.removeEventListener("scroll", we);
|
|
48485
48488
|
};
|
|
48486
48489
|
}
|
|
48487
48490
|
return () => {
|
|
48488
|
-
|
|
48491
|
+
me && clearTimeout(me);
|
|
48489
48492
|
};
|
|
48490
48493
|
}, [u?.widgetLoadBehavior]), pe.useEffect(() => {
|
|
48491
48494
|
Je && Oe(!1);
|
|
@@ -48494,7 +48497,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48494
48497
|
if (e.bot) {
|
|
48495
48498
|
je(!0);
|
|
48496
48499
|
try {
|
|
48497
|
-
const ae = await so(Te, e.bot?.botId, [], null, L),
|
|
48500
|
+
const ae = await so(Te, e.bot?.botId, [], null, L), me = {
|
|
48498
48501
|
id: Date.now().toString() + Math.random().toString(36).substring(2, 9),
|
|
48499
48502
|
sender: "agent",
|
|
48500
48503
|
content: ae,
|
|
@@ -48502,7 +48505,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48502
48505
|
seen: Vt.current,
|
|
48503
48506
|
nMessage: 1
|
|
48504
48507
|
};
|
|
48505
|
-
sr([
|
|
48508
|
+
sr([me]);
|
|
48506
48509
|
} catch (ae) {
|
|
48507
48510
|
console.error("Error sending message:", ae);
|
|
48508
48511
|
} finally {
|
|
@@ -48511,7 +48514,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48511
48514
|
}
|
|
48512
48515
|
};
|
|
48513
48516
|
pe.useEffect(() => {
|
|
48514
|
-
Fn && e?.bot && Pr.length === 0 && u &&
|
|
48517
|
+
Fn && e?.bot && Pr.length === 0 && u && be && (ao(), localStorage.getItem("webChatAuth") && JSON.parse(localStorage.getItem("webChatAuth")) && u?.botNeedsAuth && zr && (xn || ka || Xn) && (setTimeout(() => {
|
|
48515
48518
|
Hs(zr);
|
|
48516
48519
|
}, 2e3), localStorage.setItem("webChatAuth", "true")));
|
|
48517
48520
|
}, [Fn, e?.bot, zr, u]), pe.useEffect(() => (gt === "recording" ? Qt.current || (Qt.current = setInterval(() => {
|
|
@@ -48540,22 +48543,22 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48540
48543
|
const ae = L.type.toLowerCase();
|
|
48541
48544
|
return ae.startsWith("image/") ? "image" : ae.startsWith("video/") ? "video" : ae.startsWith("audio/") ? "audio" : "document";
|
|
48542
48545
|
}, Kn = pe.useCallback((L, ae) => {
|
|
48543
|
-
const
|
|
48544
|
-
Array.from(L).forEach((
|
|
48545
|
-
if (
|
|
48546
|
-
alert(`File ${
|
|
48546
|
+
const me = [];
|
|
48547
|
+
Array.from(L).forEach((we) => {
|
|
48548
|
+
if (we.size > 10 * 1024 * 1024) {
|
|
48549
|
+
alert(`File ${we.name} is too large. Maximum size is 10MB.`);
|
|
48547
48550
|
return;
|
|
48548
48551
|
}
|
|
48549
48552
|
const Ce = {
|
|
48550
48553
|
id: Date.now().toString() + Math.random().toString(36).substring(2, 9),
|
|
48551
|
-
file:
|
|
48552
|
-
type: nc(
|
|
48553
|
-
url: URL.createObjectURL(
|
|
48554
|
-
name:
|
|
48555
|
-
size:
|
|
48554
|
+
file: we,
|
|
48555
|
+
type: nc(we),
|
|
48556
|
+
url: URL.createObjectURL(we),
|
|
48557
|
+
name: we.name,
|
|
48558
|
+
size: we.size
|
|
48556
48559
|
};
|
|
48557
|
-
|
|
48558
|
-
}), wt((
|
|
48560
|
+
me.push(Ce);
|
|
48561
|
+
}), wt((we) => [...we, ...me]), ae && ae.current && (ae.current.value = "");
|
|
48559
48562
|
}, []), ci = pe.useCallback(
|
|
48560
48563
|
(L) => {
|
|
48561
48564
|
L.preventDefault(), rt.current = 0, Tt(!1);
|
|
@@ -48571,23 +48574,23 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48571
48574
|
L.preventDefault(), rt.current -= 1, rt.current <= 0 && Tt(!1);
|
|
48572
48575
|
}, []), Hr = pe.useCallback((L) => {
|
|
48573
48576
|
wt((ae) => {
|
|
48574
|
-
const
|
|
48575
|
-
return
|
|
48577
|
+
const me = ae.find((we) => we.id === L);
|
|
48578
|
+
return me && URL.revokeObjectURL(me.url), ae.filter((we) => we.id !== L);
|
|
48576
48579
|
});
|
|
48577
48580
|
}, []), oo = (L) => {
|
|
48578
48581
|
if (L === 0) return "0 Bytes";
|
|
48579
|
-
const ae = 1024,
|
|
48580
|
-
return Number.parseFloat((L / Math.pow(ae,
|
|
48582
|
+
const ae = 1024, me = ["Bytes", "KB", "MB", "GB"], we = Math.floor(Math.log(L) / Math.log(ae));
|
|
48583
|
+
return Number.parseFloat((L / Math.pow(ae, we)).toFixed(2)) + " " + me[we];
|
|
48581
48584
|
}, Zn = async (L = ie, ae) => {
|
|
48582
48585
|
if (L.trim() || mt.length !== 0) {
|
|
48583
|
-
const
|
|
48586
|
+
const we = {
|
|
48584
48587
|
id: Date.now().toString() + Math.random().toString(36).substring(2, 9),
|
|
48585
48588
|
sender: "user",
|
|
48586
48589
|
content: L,
|
|
48587
48590
|
attachments: [...mt],
|
|
48588
48591
|
timestamp: /* @__PURE__ */ new Date()
|
|
48589
48592
|
};
|
|
48590
|
-
if (sr((Ce) => [...Ce,
|
|
48593
|
+
if (sr((Ce) => [...Ce, we]), he(""), wt([]), je(!0), e?.bot)
|
|
48591
48594
|
try {
|
|
48592
48595
|
try {
|
|
48593
48596
|
const Ce = await so(L, e?.bot.botId, mt, ae || void 0), Et = {
|
|
@@ -48651,10 +48654,10 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48651
48654
|
l.current?.click();
|
|
48652
48655
|
break;
|
|
48653
48656
|
}
|
|
48654
|
-
}, so = async (L, ae,
|
|
48655
|
-
if (
|
|
48657
|
+
}, so = async (L, ae, me = [], we, Ce) => {
|
|
48658
|
+
if (me.length > 0) {
|
|
48656
48659
|
const bt = new FormData();
|
|
48657
|
-
bt.append("type", "image"), bt.append("file",
|
|
48660
|
+
bt.append("type", "image"), bt.append("file", me[0].file), bt.append("botId", ae), bt.append("conversation_id", zr ?? ""), bt.append("host", window.location.origin);
|
|
48658
48661
|
const { data: dn } = await St.post(e?.API_URL || Z1, bt, {
|
|
48659
48662
|
headers: {
|
|
48660
48663
|
Authorization: `Bearer ${e?.token}`,
|
|
@@ -48671,7 +48674,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48671
48674
|
conversation_id: zr,
|
|
48672
48675
|
isintern: !!e.token,
|
|
48673
48676
|
host: window.location.origin
|
|
48674
|
-
},
|
|
48677
|
+
}, we && (bt = { ...bt, payload: we, messageText: L });
|
|
48675
48678
|
const { data: dn } = await St.post(e?.API_URL || Z1, bt, {
|
|
48676
48679
|
headers: {
|
|
48677
48680
|
Authorization: `Bearer ${e?.token}`,
|
|
@@ -48697,7 +48700,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48697
48700
|
Gr(!1);
|
|
48698
48701
|
return;
|
|
48699
48702
|
}
|
|
48700
|
-
ge((ae) => !ae), Vt.current = !Je, Je || ro(),
|
|
48703
|
+
ge((ae) => !ae), Vt.current = !Je, Je || ro(), be || ao();
|
|
48701
48704
|
};
|
|
48702
48705
|
pe.useEffect(() => {
|
|
48703
48706
|
const L = (Ce) => {
|
|
@@ -48713,20 +48716,20 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48713
48716
|
(bt > 5 || dn > 5) && Gr(!0);
|
|
48714
48717
|
const Jn = Et.clientX - De.x, pn = Et.clientY - De.y, Kr = 67, vr = window.innerWidth - document.body.clientWidth, Bn = Math.max(0, Math.min(window.innerWidth - Kr - vr, Jn)), uo = Math.max(0, Math.min(window.innerHeight - Kr, pn));
|
|
48715
48718
|
et({ x: Bn, y: uo });
|
|
48716
|
-
},
|
|
48719
|
+
}, me = () => {
|
|
48717
48720
|
Ye && (ze(!1), document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
48718
|
-
},
|
|
48721
|
+
}, we = () => {
|
|
48719
48722
|
Ye && ze(!1);
|
|
48720
48723
|
};
|
|
48721
|
-
return Ye && (document.addEventListener("mousemove", L), document.addEventListener("touchmove", ae, { passive: !1 }), document.addEventListener("mouseup",
|
|
48722
|
-
document.removeEventListener("mousemove", L), document.removeEventListener("touchmove", ae), document.removeEventListener("mouseup",
|
|
48724
|
+
return Ye && (document.addEventListener("mousemove", L), document.addEventListener("touchmove", ae, { passive: !1 }), document.addEventListener("mouseup", me), document.addEventListener("touchend", we)), () => {
|
|
48725
|
+
document.removeEventListener("mousemove", L), document.removeEventListener("touchmove", ae), document.removeEventListener("mouseup", me), document.removeEventListener("touchend", we);
|
|
48723
48726
|
};
|
|
48724
48727
|
}, [Ye, De, Ie]), pe.useEffect(() => {
|
|
48725
48728
|
const L = () => {
|
|
48726
|
-
const
|
|
48729
|
+
const me = window.innerWidth - 67, we = window.innerHeight - 67;
|
|
48727
48730
|
et((Ce) => ({
|
|
48728
|
-
x: Math.max(0, Math.min(
|
|
48729
|
-
y: Math.max(0, Math.min(
|
|
48731
|
+
x: Math.max(0, Math.min(me, Ce.x)),
|
|
48732
|
+
y: Math.max(0, Math.min(we, Ce.y))
|
|
48730
48733
|
}));
|
|
48731
48734
|
};
|
|
48732
48735
|
return window.addEventListener("resize", L), () => window.removeEventListener("resize", L);
|
|
@@ -48819,12 +48822,12 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48819
48822
|
) }),
|
|
48820
48823
|
p: ({ children: L }) => {
|
|
48821
48824
|
let ae;
|
|
48822
|
-
return typeof L == "string" && Vr(L) || typeof L == "object" && !Array.isArray(L) && L?.props?.children && rn(L?.props?.children) || typeof L == "object" && Array.isArray(L) && L.some((
|
|
48823
|
-
(
|
|
48825
|
+
return typeof L == "string" && Vr(L) || typeof L == "object" && !Array.isArray(L) && L?.props?.children && rn(L?.props?.children) || typeof L == "object" && Array.isArray(L) && L.some((me) => Vr(me)) ? ae = "rtl" : ae = "ltr", /* @__PURE__ */ k.jsx("div", { className: "leading-relaxed", dir: typeof L == "string" || !Array.isArray(L) ? ae : "", children: Array.isArray(L) ? L.map(
|
|
48826
|
+
(me, we) => typeof me == "string" && !new RegExp("^(?:\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F|\\s)+$", "u").test(me) ? /* @__PURE__ */ k.jsx("p", { dir: Vr(me) ? "rtl" : "ltr", children: /* @__PURE__ */ k.jsx(
|
|
48824
48827
|
Ht,
|
|
48825
48828
|
{
|
|
48826
48829
|
sequence: [
|
|
48827
|
-
|
|
48830
|
+
me,
|
|
48828
48831
|
0,
|
|
48829
48832
|
() => {
|
|
48830
48833
|
t.current && (t.current.scrollTop = t.current.scrollHeight);
|
|
@@ -48833,13 +48836,13 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48833
48836
|
cursor: !1,
|
|
48834
48837
|
speed: 90
|
|
48835
48838
|
}
|
|
48836
|
-
) },
|
|
48839
|
+
) }, we) : me.type !== "br" ? me : null
|
|
48837
48840
|
) : /* @__PURE__ */ k.jsx(k.Fragment, { children: L }) });
|
|
48838
48841
|
},
|
|
48839
48842
|
ul: ({ children: L }) => /* @__PURE__ */ k.jsx("ul", { className: "list-disc list-inside ml-4 my-2", style: { color: _ }, dir: Vr(L) ? "rtl" : "ltr", children: L }),
|
|
48840
48843
|
ol: ({ children: L }) => {
|
|
48841
48844
|
let ae = !1;
|
|
48842
|
-
return L.filter((
|
|
48845
|
+
return L.filter((me) => typeof me != "string").every((me) => Vr(me?.props?.children)) ? ae = !0 : ae = !1, /* @__PURE__ */ k.jsx("ol", { className: "list-decimal list-inside ml-4 my-2", style: { color: _ }, dir: ae ? "rtl" : "ltr", children: typeof L == "string" ? /* @__PURE__ */ k.jsx(
|
|
48843
48846
|
Ht,
|
|
48844
48847
|
{
|
|
48845
48848
|
sequence: [
|
|
@@ -48896,13 +48899,13 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48896
48899
|
speed: 92
|
|
48897
48900
|
}
|
|
48898
48901
|
) : L }),
|
|
48899
|
-
code({ node: L, className: ae, children:
|
|
48902
|
+
code({ node: L, className: ae, children: me, ...we }) {
|
|
48900
48903
|
const Ce = /language-(\w+)/.exec(ae || "");
|
|
48901
|
-
return Ce ? /* @__PURE__ */ k.jsx(KI, { ...
|
|
48904
|
+
return Ce ? /* @__PURE__ */ k.jsx(KI, { ...we, PreTag: "div", children: String(me).replace(/\n$/, ""), language: Ce[1], style: yW, customStyle: { scrollbarWidth: "thin" } }) : /* @__PURE__ */ k.jsx("code", { className: "px-1 rounded font-mono inline", style: { backgroundColor: A, color: _ }, ...we, children: typeof me == "string" ? /* @__PURE__ */ k.jsx(
|
|
48902
48905
|
Ht,
|
|
48903
48906
|
{
|
|
48904
48907
|
sequence: [
|
|
48905
|
-
|
|
48908
|
+
me,
|
|
48906
48909
|
0,
|
|
48907
48910
|
() => {
|
|
48908
48911
|
t.current && (t.current.scrollTop = t.current.scrollHeight);
|
|
@@ -48911,7 +48914,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48911
48914
|
cursor: !1,
|
|
48912
48915
|
speed: 92
|
|
48913
48916
|
}
|
|
48914
|
-
) :
|
|
48917
|
+
) : me });
|
|
48915
48918
|
},
|
|
48916
48919
|
table: ({ children: L }) => /* @__PURE__ */ k.jsx("table", { className: "min-w-full my-2", style: { border: `1px solid ${_}`, color: Y, backgroundColor: _ }, children: L }),
|
|
48917
48920
|
thead: ({ children: L }) => /* @__PURE__ */ k.jsx("thead", { children: L }),
|
|
@@ -48966,7 +48969,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48966
48969
|
);
|
|
48967
48970
|
pe.useEffect(() => {
|
|
48968
48971
|
const L = (ae) => {
|
|
48969
|
-
ut && ae.target instanceof Element && !ae.composedPath().some((
|
|
48972
|
+
ut && ae.target instanceof Element && !ae.composedPath().some((me) => me?.id === "upload-button-toggle" || me?.id === "document-button" || me?.id === "image-button" || me?.id === "video-button" || me?.id === "audio-button") && xt(!1);
|
|
48970
48973
|
};
|
|
48971
48974
|
return document.addEventListener("mousedown", L), () => {
|
|
48972
48975
|
document.removeEventListener("mousedown", L);
|
|
@@ -48995,7 +48998,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
48995
48998
|
return /* @__PURE__ */ k.jsxs(k.Fragment, { children: [
|
|
48996
48999
|
/* @__PURE__ */ k.jsx(ls, { remarkPlugins: [us], components: Er, children: L.text?.replace(/\n/g, `
|
|
48997
49000
|
`) || "" }),
|
|
48998
|
-
/* @__PURE__ */ k.jsx("div", { className: "flex flex-wrap", dir: rn(L.text || "") ? "rtl" : "ltr", children: L.choices?.map((ae,
|
|
49001
|
+
/* @__PURE__ */ k.jsx("div", { className: "flex flex-wrap", dir: rn(L.text || "") ? "rtl" : "ltr", children: L.choices?.map((ae, me) => /* @__PURE__ */ k.jsx(
|
|
48999
49002
|
"button",
|
|
49000
49003
|
{
|
|
49001
49004
|
className: "mb-1 mr-1 px-4 py-1 hover:scale-105 transition-all duration-100",
|
|
@@ -49024,7 +49027,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
49024
49027
|
}
|
|
49025
49028
|
)
|
|
49026
49029
|
},
|
|
49027
|
-
|
|
49030
|
+
me
|
|
49028
49031
|
)) })
|
|
49029
49032
|
] });
|
|
49030
49033
|
case "image":
|
|
@@ -49094,8 +49097,8 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
49094
49097
|
{
|
|
49095
49098
|
products: L.products || [],
|
|
49096
49099
|
onValidate: (ae) => {
|
|
49097
|
-
const
|
|
49098
|
-
Zn("Vente ",
|
|
49100
|
+
const me = JSON.stringify(ae);
|
|
49101
|
+
Zn("Vente ", me);
|
|
49099
49102
|
},
|
|
49100
49103
|
agentChatResponseColor: _,
|
|
49101
49104
|
agentChatResponseBgColor: Y,
|
|
@@ -49123,39 +49126,39 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
49123
49126
|
}, Hs = async (L) => {
|
|
49124
49127
|
if (!Fn) return;
|
|
49125
49128
|
const ae = await qs(L);
|
|
49126
|
-
let
|
|
49127
|
-
xn && (
|
|
49129
|
+
let me;
|
|
49130
|
+
xn && (me = {
|
|
49128
49131
|
last_name: xn.split(" ")[1] || xn.split(" ")[0] || `web_user_${L}`,
|
|
49129
49132
|
first_name: xn.split(" ")[0] || `web_user_${L}`
|
|
49130
|
-
}), Xn && (
|
|
49131
|
-
...
|
|
49133
|
+
}), Xn && (me = {
|
|
49134
|
+
...me,
|
|
49132
49135
|
phone: Xn
|
|
49133
|
-
}), ka && (
|
|
49134
|
-
...
|
|
49136
|
+
}), ka && (me = {
|
|
49137
|
+
...me,
|
|
49135
49138
|
email: ka
|
|
49136
49139
|
});
|
|
49137
|
-
const
|
|
49140
|
+
const we = await fetch(`${Q1}/endusers/${ae}`, {
|
|
49138
49141
|
headers: {
|
|
49139
49142
|
Authorization: `Bearer ${e?.token}`,
|
|
49140
49143
|
"Content-Type": "application/json"
|
|
49141
49144
|
},
|
|
49142
49145
|
method: "PUT",
|
|
49143
|
-
body: JSON.stringify(
|
|
49146
|
+
body: JSON.stringify(me)
|
|
49144
49147
|
});
|
|
49145
|
-
if (!
|
|
49146
|
-
throw new Error(`HTTP error! status: ${
|
|
49147
|
-
return await
|
|
49148
|
+
if (!we.ok)
|
|
49149
|
+
throw new Error(`HTTP error! status: ${we.status}`);
|
|
49150
|
+
return await we.json();
|
|
49148
49151
|
}, Wr = async (L) => {
|
|
49149
49152
|
L.preventDefault();
|
|
49150
49153
|
const ae = new Uint8Array(16);
|
|
49151
49154
|
window.crypto.getRandomValues(ae);
|
|
49152
|
-
const
|
|
49153
|
-
jr(
|
|
49155
|
+
const me = Array.from(ae).map((we) => we.toString(16).padStart(2, "0")).join("");
|
|
49156
|
+
jr(me), localStorage.setItem("conversationId", me), localStorage.setItem("webChatAuth", "true"), qr(!0);
|
|
49154
49157
|
}, [ac, Xr] = pe.useState(!1), Gs = async () => {
|
|
49155
49158
|
sr([]);
|
|
49156
49159
|
const L = new Uint8Array(16);
|
|
49157
49160
|
window.crypto.getRandomValues(L);
|
|
49158
|
-
const ae = Array.from(L).map((
|
|
49161
|
+
const ae = Array.from(L).map((me) => me.toString(16).padStart(2, "0")).join("");
|
|
49159
49162
|
return jr(ae), localStorage.setItem("conversationId", ae), ae;
|
|
49160
49163
|
}, lo = `linear-gradient(to bottom right, ${y}, ${h}, ${y})`, _s = `linear-gradient(to right, ${h}, ${m})`, ic = `linear-gradient(to right, ${E}, ${v})`;
|
|
49161
49164
|
return f || !u ? null : /* @__PURE__ */ k.jsxs(k.Fragment, { children: [
|
|
@@ -49379,7 +49382,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
49379
49382
|
children: /* @__PURE__ */ k.jsx(ls, { remarkPlugins: [us], components: Er, children: typeof L.content == "string" ? L.content.replace(/\n/g, `
|
|
49380
49383
|
`) : "" })
|
|
49381
49384
|
}
|
|
49382
|
-
) : typeof L.content == "object" ? L.content.map((ae,
|
|
49385
|
+
) : typeof L.content == "object" ? L.content.map((ae, me) => /* @__PURE__ */ k.jsx(
|
|
49383
49386
|
"div",
|
|
49384
49387
|
{
|
|
49385
49388
|
className: "mb-1 px-4 py-2 backdrop-blur-sm break-words w-fit",
|
|
@@ -49393,7 +49396,7 @@ const BW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
49393
49396
|
},
|
|
49394
49397
|
children: Yr(ae)
|
|
49395
49398
|
},
|
|
49396
|
-
|
|
49399
|
+
me
|
|
49397
49400
|
)) : typeof L.content == "string" && L.content ? /* @__PURE__ */ k.jsx(
|
|
49398
49401
|
"div",
|
|
49399
49402
|
{
|