@connorpham/live-chat-widget 13.0.0 → 15.0.0
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/cellcast-bot-widget.es.js +1032 -1054
- package/dist/cellcast-bot-widget.umd.js +16 -16
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var o0 = Object.defineProperty;
|
|
2
2
|
var d0 = (u, D, f) => D in u ? o0(u, D, { enumerable: !0, configurable: !0, writable: !0, value: f }) : u[D] = f;
|
|
3
3
|
var lD = (u, D, f) => d0(u, typeof D != "symbol" ? D + "" : D, f);
|
|
4
|
-
import sf, { createContext as zu, useRef as pu, useEffect as
|
|
4
|
+
import sf, { createContext as zu, useRef as pu, useEffect as J, useContext as Yu, useState as z, useCallback as qu, useMemo as C0 } from "react";
|
|
5
5
|
var dD = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6
6
|
function Ff(u) {
|
|
7
7
|
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
9
|
+
var WD = { exports: {} }, eD = {};
|
|
10
10
|
/*
|
|
11
11
|
object-assign
|
|
12
12
|
(c) Sindre Sorhus
|
|
@@ -100,51 +100,51 @@ function l0() {
|
|
|
100
100
|
D.NODE_ENV !== "production" && function() {
|
|
101
101
|
var f = sf, e = Xf(), t = 60103, n = 60106;
|
|
102
102
|
u.Fragment = 60107;
|
|
103
|
-
var r = 60108, s = 60114, F = 60109, o = 60110, d = 60112, c = 60113, l = 60120, j = 60115,
|
|
103
|
+
var r = 60108, s = 60114, F = 60109, o = 60110, d = 60112, c = 60113, l = 60120, j = 60115, y = 60116, C = 60121, T = 60122, N = 60117, B = 60129, $ = 60131;
|
|
104
104
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
105
|
-
var
|
|
106
|
-
t =
|
|
105
|
+
var _ = Symbol.for;
|
|
106
|
+
t = _("react.element"), n = _("react.portal"), u.Fragment = _("react.fragment"), r = _("react.strict_mode"), s = _("react.profiler"), F = _("react.provider"), o = _("react.context"), d = _("react.forward_ref"), c = _("react.suspense"), l = _("react.suspense_list"), j = _("react.memo"), y = _("react.lazy"), C = _("react.block"), T = _("react.server.block"), N = _("react.fundamental"), _("react.scope"), _("react.opaque.id"), B = _("react.debug_trace_mode"), _("react.offscreen"), $ = _("react.legacy_hidden");
|
|
107
107
|
}
|
|
108
|
-
var
|
|
109
|
-
function
|
|
108
|
+
var p = typeof Symbol == "function" && Symbol.iterator, R = "@@iterator";
|
|
109
|
+
function x(i) {
|
|
110
110
|
if (i === null || typeof i != "object")
|
|
111
111
|
return null;
|
|
112
|
-
var
|
|
113
|
-
return typeof
|
|
112
|
+
var b = p && i[p] || i[R];
|
|
113
|
+
return typeof b == "function" ? b : null;
|
|
114
114
|
}
|
|
115
|
-
var
|
|
116
|
-
function
|
|
115
|
+
var V = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
116
|
+
function m(i) {
|
|
117
117
|
{
|
|
118
|
-
for (var
|
|
119
|
-
w[
|
|
120
|
-
|
|
118
|
+
for (var b = arguments.length, w = new Array(b > 1 ? b - 1 : 0), L = 1; L < b; L++)
|
|
119
|
+
w[L - 1] = arguments[L];
|
|
120
|
+
A("error", i, w);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function A(i, b, w) {
|
|
124
124
|
{
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
var
|
|
128
|
-
return "" +
|
|
125
|
+
var L = V.ReactDebugCurrentFrame, X = L.getStackAddendum();
|
|
126
|
+
X !== "" && (b += "%s", w = w.concat([X]));
|
|
127
|
+
var K = w.map(function(Y) {
|
|
128
|
+
return "" + Y;
|
|
129
129
|
});
|
|
130
|
-
|
|
130
|
+
K.unshift("Warning: " + b), Function.prototype.apply.call(console[i], console, K);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
var
|
|
134
|
-
function
|
|
135
|
-
return !!(typeof i == "string" || typeof i == "function" || i === u.Fragment || i === s || i ===
|
|
133
|
+
var v = !1;
|
|
134
|
+
function hu(i) {
|
|
135
|
+
return !!(typeof i == "string" || typeof i == "function" || i === u.Fragment || i === s || i === B || i === r || i === c || i === l || i === $ || v || typeof i == "object" && i !== null && (i.$$typeof === y || i.$$typeof === j || i.$$typeof === F || i.$$typeof === o || i.$$typeof === d || i.$$typeof === N || i.$$typeof === C || i[0] === T));
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
var
|
|
139
|
-
return i.displayName || (
|
|
137
|
+
function fu(i, b, w) {
|
|
138
|
+
var L = b.displayName || b.name || "";
|
|
139
|
+
return i.displayName || (L !== "" ? w + "(" + L + ")" : w);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function S(i) {
|
|
142
142
|
return i.displayName || "Context";
|
|
143
143
|
}
|
|
144
144
|
function E(i) {
|
|
145
145
|
if (i == null)
|
|
146
146
|
return null;
|
|
147
|
-
if (typeof i.tag == "number" &&
|
|
147
|
+
if (typeof i.tag == "number" && m("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
|
148
148
|
return i.displayName || i.name || null;
|
|
149
149
|
if (typeof i == "string")
|
|
150
150
|
return i;
|
|
@@ -165,21 +165,21 @@ function l0() {
|
|
|
165
165
|
if (typeof i == "object")
|
|
166
166
|
switch (i.$$typeof) {
|
|
167
167
|
case o:
|
|
168
|
-
var
|
|
169
|
-
return
|
|
168
|
+
var b = i;
|
|
169
|
+
return S(b) + ".Consumer";
|
|
170
170
|
case F:
|
|
171
171
|
var w = i;
|
|
172
|
-
return
|
|
172
|
+
return S(w._context) + ".Provider";
|
|
173
173
|
case d:
|
|
174
|
-
return
|
|
174
|
+
return fu(i, i.render, "ForwardRef");
|
|
175
175
|
case j:
|
|
176
176
|
return E(i.type);
|
|
177
177
|
case C:
|
|
178
178
|
return E(i._render);
|
|
179
|
-
case
|
|
180
|
-
var
|
|
179
|
+
case y: {
|
|
180
|
+
var L = i, X = L._payload, K = L._init;
|
|
181
181
|
try {
|
|
182
|
-
return E(
|
|
182
|
+
return E(K(X));
|
|
183
183
|
} catch {
|
|
184
184
|
return null;
|
|
185
185
|
}
|
|
@@ -187,14 +187,14 @@ function l0() {
|
|
|
187
187
|
}
|
|
188
188
|
return null;
|
|
189
189
|
}
|
|
190
|
-
var h = 0,
|
|
190
|
+
var h = 0, k, g, I, P, M, U, G;
|
|
191
191
|
function q() {
|
|
192
192
|
}
|
|
193
193
|
q.__reactDisabledLog = !0;
|
|
194
|
-
function
|
|
194
|
+
function Z() {
|
|
195
195
|
{
|
|
196
196
|
if (h === 0) {
|
|
197
|
-
|
|
197
|
+
k = console.log, g = console.info, I = console.warn, P = console.error, M = console.group, U = console.groupCollapsed, G = console.groupEnd;
|
|
198
198
|
var i = {
|
|
199
199
|
configurable: !0,
|
|
200
200
|
enumerable: !0,
|
|
@@ -214,7 +214,7 @@ function l0() {
|
|
|
214
214
|
h++;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function tu() {
|
|
218
218
|
{
|
|
219
219
|
if (h--, h === 0) {
|
|
220
220
|
var i = {
|
|
@@ -224,133 +224,133 @@ function l0() {
|
|
|
224
224
|
};
|
|
225
225
|
Object.defineProperties(console, {
|
|
226
226
|
log: e({}, i, {
|
|
227
|
-
value:
|
|
227
|
+
value: k
|
|
228
228
|
}),
|
|
229
229
|
info: e({}, i, {
|
|
230
|
-
value:
|
|
230
|
+
value: g
|
|
231
231
|
}),
|
|
232
232
|
warn: e({}, i, {
|
|
233
233
|
value: I
|
|
234
234
|
}),
|
|
235
235
|
error: e({}, i, {
|
|
236
|
-
value:
|
|
236
|
+
value: P
|
|
237
237
|
}),
|
|
238
238
|
group: e({}, i, {
|
|
239
239
|
value: M
|
|
240
240
|
}),
|
|
241
241
|
groupCollapsed: e({}, i, {
|
|
242
|
-
value:
|
|
242
|
+
value: U
|
|
243
243
|
}),
|
|
244
244
|
groupEnd: e({}, i, {
|
|
245
|
-
value:
|
|
245
|
+
value: G
|
|
246
246
|
})
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
h < 0 &&
|
|
249
|
+
h < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
var
|
|
253
|
-
function gu(i,
|
|
252
|
+
var cu = V.ReactCurrentDispatcher, _u;
|
|
253
|
+
function gu(i, b, w) {
|
|
254
254
|
{
|
|
255
255
|
if (_u === void 0)
|
|
256
256
|
try {
|
|
257
257
|
throw Error();
|
|
258
|
-
} catch (
|
|
259
|
-
var
|
|
260
|
-
_u =
|
|
258
|
+
} catch (X) {
|
|
259
|
+
var L = X.stack.trim().match(/\n( *(at )?)/);
|
|
260
|
+
_u = L && L[1] || "";
|
|
261
261
|
}
|
|
262
262
|
return `
|
|
263
263
|
` + _u + i;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
var
|
|
266
|
+
var ru = !1, du;
|
|
267
267
|
{
|
|
268
268
|
var Iu = typeof WeakMap == "function" ? WeakMap : Map;
|
|
269
|
-
|
|
269
|
+
du = new Iu();
|
|
270
270
|
}
|
|
271
|
-
function Lu(i,
|
|
272
|
-
if (!i ||
|
|
271
|
+
function Lu(i, b) {
|
|
272
|
+
if (!i || ru)
|
|
273
273
|
return "";
|
|
274
274
|
{
|
|
275
|
-
var w =
|
|
275
|
+
var w = du.get(i);
|
|
276
276
|
if (w !== void 0)
|
|
277
277
|
return w;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
|
|
281
|
-
var
|
|
279
|
+
var L;
|
|
280
|
+
ru = !0;
|
|
281
|
+
var X = Error.prepareStackTrace;
|
|
282
282
|
Error.prepareStackTrace = void 0;
|
|
283
|
-
var
|
|
284
|
-
|
|
283
|
+
var K;
|
|
284
|
+
K = cu.current, cu.current = null, Z();
|
|
285
285
|
try {
|
|
286
|
-
if (
|
|
287
|
-
var
|
|
286
|
+
if (b) {
|
|
287
|
+
var Y = function() {
|
|
288
288
|
throw Error();
|
|
289
289
|
};
|
|
290
|
-
if (Object.defineProperty(
|
|
290
|
+
if (Object.defineProperty(Y.prototype, "props", {
|
|
291
291
|
set: function() {
|
|
292
292
|
throw Error();
|
|
293
293
|
}
|
|
294
294
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
295
295
|
try {
|
|
296
|
-
Reflect.construct(
|
|
296
|
+
Reflect.construct(Y, []);
|
|
297
297
|
} catch (Mu) {
|
|
298
|
-
|
|
298
|
+
L = Mu;
|
|
299
299
|
}
|
|
300
|
-
Reflect.construct(i, [],
|
|
300
|
+
Reflect.construct(i, [], Y);
|
|
301
301
|
} else {
|
|
302
302
|
try {
|
|
303
|
-
|
|
303
|
+
Y.call();
|
|
304
304
|
} catch (Mu) {
|
|
305
|
-
|
|
305
|
+
L = Mu;
|
|
306
306
|
}
|
|
307
|
-
i.call(
|
|
307
|
+
i.call(Y.prototype);
|
|
308
308
|
}
|
|
309
309
|
} else {
|
|
310
310
|
try {
|
|
311
311
|
throw Error();
|
|
312
312
|
} catch (Mu) {
|
|
313
|
-
|
|
313
|
+
L = Mu;
|
|
314
314
|
}
|
|
315
315
|
i();
|
|
316
316
|
}
|
|
317
317
|
} catch (Mu) {
|
|
318
|
-
if (Mu &&
|
|
318
|
+
if (Mu && L && typeof Mu.stack == "string") {
|
|
319
319
|
for (var H = Mu.stack.split(`
|
|
320
|
-
`), bu =
|
|
321
|
-
`),
|
|
322
|
-
|
|
323
|
-
for (;
|
|
324
|
-
if (H[
|
|
325
|
-
if (
|
|
320
|
+
`), bu = L.stack.split(`
|
|
321
|
+
`), nu = H.length - 1, su = bu.length - 1; nu >= 1 && su >= 0 && H[nu] !== bu[su]; )
|
|
322
|
+
su--;
|
|
323
|
+
for (; nu >= 1 && su >= 0; nu--, su--)
|
|
324
|
+
if (H[nu] !== bu[su]) {
|
|
325
|
+
if (nu !== 1 || su !== 1)
|
|
326
326
|
do
|
|
327
|
-
if (
|
|
327
|
+
if (nu--, su--, su < 0 || H[nu] !== bu[su]) {
|
|
328
328
|
var $u = `
|
|
329
|
-
` + H[
|
|
330
|
-
return typeof i == "function" &&
|
|
329
|
+
` + H[nu].replace(" at new ", " at ");
|
|
330
|
+
return typeof i == "function" && du.set(i, $u), $u;
|
|
331
331
|
}
|
|
332
|
-
while (
|
|
332
|
+
while (nu >= 1 && su >= 0);
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
} finally {
|
|
337
|
-
|
|
337
|
+
ru = !1, cu.current = K, tu(), Error.prepareStackTrace = X;
|
|
338
338
|
}
|
|
339
339
|
var fD = i ? i.displayName || i.name : "", Nf = fD ? gu(fD) : "";
|
|
340
|
-
return typeof i == "function" &&
|
|
340
|
+
return typeof i == "function" && du.set(i, Nf), Nf;
|
|
341
341
|
}
|
|
342
|
-
function O(i,
|
|
342
|
+
function O(i, b, w) {
|
|
343
343
|
return Lu(i, !1);
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
var
|
|
347
|
-
return !!(
|
|
345
|
+
function Du(i) {
|
|
346
|
+
var b = i.prototype;
|
|
347
|
+
return !!(b && b.isReactComponent);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function au(i, b, w) {
|
|
350
350
|
if (i == null)
|
|
351
351
|
return "";
|
|
352
352
|
if (typeof i == "function")
|
|
353
|
-
return Lu(i,
|
|
353
|
+
return Lu(i, Du(i));
|
|
354
354
|
if (typeof i == "string")
|
|
355
355
|
return gu(i);
|
|
356
356
|
switch (i) {
|
|
@@ -364,47 +364,47 @@ function l0() {
|
|
|
364
364
|
case d:
|
|
365
365
|
return O(i.render);
|
|
366
366
|
case j:
|
|
367
|
-
return
|
|
367
|
+
return au(i.type, b, w);
|
|
368
368
|
case C:
|
|
369
369
|
return O(i._render);
|
|
370
|
-
case
|
|
371
|
-
var
|
|
370
|
+
case y: {
|
|
371
|
+
var L = i, X = L._payload, K = L._init;
|
|
372
372
|
try {
|
|
373
|
-
return
|
|
373
|
+
return au(K(X), b, w);
|
|
374
374
|
} catch {
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
return "";
|
|
379
379
|
}
|
|
380
|
-
var
|
|
380
|
+
var lu = {}, mu = V.ReactDebugCurrentFrame;
|
|
381
381
|
function Vu(i) {
|
|
382
382
|
if (i) {
|
|
383
|
-
var
|
|
383
|
+
var b = i._owner, w = au(i.type, i._source, b ? b.type : null);
|
|
384
384
|
mu.setExtraStackFrame(w);
|
|
385
385
|
} else
|
|
386
386
|
mu.setExtraStackFrame(null);
|
|
387
387
|
}
|
|
388
|
-
function K1(i,
|
|
388
|
+
function K1(i, b, w, L, X) {
|
|
389
389
|
{
|
|
390
|
-
var
|
|
391
|
-
for (var
|
|
392
|
-
if (
|
|
390
|
+
var K = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
391
|
+
for (var Y in i)
|
|
392
|
+
if (K(i, Y)) {
|
|
393
393
|
var H = void 0;
|
|
394
394
|
try {
|
|
395
|
-
if (typeof i[
|
|
396
|
-
var bu = Error((
|
|
395
|
+
if (typeof i[Y] != "function") {
|
|
396
|
+
var bu = Error((L || "React class") + ": " + w + " type `" + Y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[Y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
397
397
|
throw bu.name = "Invariant Violation", bu;
|
|
398
398
|
}
|
|
399
|
-
H = i[
|
|
400
|
-
} catch (
|
|
401
|
-
H =
|
|
399
|
+
H = i[Y](b, Y, L, w, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
400
|
+
} catch (nu) {
|
|
401
|
+
H = nu;
|
|
402
402
|
}
|
|
403
|
-
H && !(H instanceof Error) && (Vu(
|
|
403
|
+
H && !(H instanceof Error) && (Vu(X), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", L || "React class", w, Y, typeof H), Vu(null)), H instanceof Error && !(H.message in lu) && (lu[H.message] = !0, Vu(X), m("Failed %s type: %s", w, H.message), Vu(null));
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
var yf =
|
|
407
|
+
var yf = V.ReactCurrentOwner, TD = Object.prototype.hasOwnProperty, J1 = {
|
|
408
408
|
key: !0,
|
|
409
409
|
ref: !0,
|
|
410
410
|
__self: !0,
|
|
@@ -412,27 +412,27 @@ function l0() {
|
|
|
412
412
|
}, vf, wf;
|
|
413
413
|
function G1(i) {
|
|
414
414
|
if (TD.call(i, "ref")) {
|
|
415
|
-
var
|
|
416
|
-
if (
|
|
415
|
+
var b = Object.getOwnPropertyDescriptor(i, "ref").get;
|
|
416
|
+
if (b && b.isReactWarning)
|
|
417
417
|
return !1;
|
|
418
418
|
}
|
|
419
419
|
return i.ref !== void 0;
|
|
420
420
|
}
|
|
421
421
|
function X1(i) {
|
|
422
422
|
if (TD.call(i, "key")) {
|
|
423
|
-
var
|
|
424
|
-
if (
|
|
423
|
+
var b = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
424
|
+
if (b && b.isReactWarning)
|
|
425
425
|
return !1;
|
|
426
426
|
}
|
|
427
427
|
return i.key !== void 0;
|
|
428
428
|
}
|
|
429
|
-
function Z1(i,
|
|
429
|
+
function Z1(i, b) {
|
|
430
430
|
typeof i.ref == "string" && yf.current;
|
|
431
431
|
}
|
|
432
|
-
function Q1(i,
|
|
432
|
+
function Q1(i, b) {
|
|
433
433
|
{
|
|
434
434
|
var w = function() {
|
|
435
|
-
vf || (vf = !0,
|
|
435
|
+
vf || (vf = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", b));
|
|
436
436
|
};
|
|
437
437
|
w.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
438
438
|
get: w,
|
|
@@ -440,10 +440,10 @@ function l0() {
|
|
|
440
440
|
});
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
function u0(i,
|
|
443
|
+
function u0(i, b) {
|
|
444
444
|
{
|
|
445
445
|
var w = function() {
|
|
446
|
-
wf || (wf = !0,
|
|
446
|
+
wf || (wf = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", b));
|
|
447
447
|
};
|
|
448
448
|
w.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
|
449
449
|
get: w,
|
|
@@ -451,17 +451,17 @@ function l0() {
|
|
|
451
451
|
});
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
var D0 = function(i,
|
|
454
|
+
var D0 = function(i, b, w, L, X, K, Y) {
|
|
455
455
|
var H = {
|
|
456
456
|
// This tag allows us to uniquely identify this as a React Element
|
|
457
457
|
$$typeof: t,
|
|
458
458
|
// Built-in properties that belong on the element
|
|
459
459
|
type: i,
|
|
460
|
-
key:
|
|
460
|
+
key: b,
|
|
461
461
|
ref: w,
|
|
462
|
-
props:
|
|
462
|
+
props: Y,
|
|
463
463
|
// Record the component responsible for creating this element.
|
|
464
|
-
_owner:
|
|
464
|
+
_owner: K
|
|
465
465
|
};
|
|
466
466
|
return H._store = {}, Object.defineProperty(H._store, "validated", {
|
|
467
467
|
configurable: !1,
|
|
@@ -472,36 +472,36 @@ function l0() {
|
|
|
472
472
|
configurable: !1,
|
|
473
473
|
enumerable: !1,
|
|
474
474
|
writable: !1,
|
|
475
|
-
value:
|
|
475
|
+
value: L
|
|
476
476
|
}), Object.defineProperty(H, "_source", {
|
|
477
477
|
configurable: !1,
|
|
478
478
|
enumerable: !1,
|
|
479
479
|
writable: !1,
|
|
480
|
-
value:
|
|
480
|
+
value: X
|
|
481
481
|
}), Object.freeze && (Object.freeze(H.props), Object.freeze(H)), H;
|
|
482
482
|
};
|
|
483
|
-
function f0(i,
|
|
483
|
+
function f0(i, b, w, L, X) {
|
|
484
484
|
{
|
|
485
|
-
var
|
|
486
|
-
w !== void 0 && (H = "" + w), X1(
|
|
487
|
-
for (
|
|
488
|
-
TD.call(
|
|
485
|
+
var K, Y = {}, H = null, bu = null;
|
|
486
|
+
w !== void 0 && (H = "" + w), X1(b) && (H = "" + b.key), G1(b) && (bu = b.ref, Z1(b, X));
|
|
487
|
+
for (K in b)
|
|
488
|
+
TD.call(b, K) && !J1.hasOwnProperty(K) && (Y[K] = b[K]);
|
|
489
489
|
if (i && i.defaultProps) {
|
|
490
|
-
var
|
|
491
|
-
for (
|
|
492
|
-
K
|
|
490
|
+
var nu = i.defaultProps;
|
|
491
|
+
for (K in nu)
|
|
492
|
+
Y[K] === void 0 && (Y[K] = nu[K]);
|
|
493
493
|
}
|
|
494
494
|
if (H || bu) {
|
|
495
|
-
var
|
|
496
|
-
H && Q1(
|
|
495
|
+
var su = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
|
496
|
+
H && Q1(Y, su), bu && u0(Y, su);
|
|
497
497
|
}
|
|
498
|
-
return D0(i, H, bu,
|
|
498
|
+
return D0(i, H, bu, X, L, yf.current, Y);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
var ND =
|
|
501
|
+
var ND = V.ReactCurrentOwner, Af = V.ReactDebugCurrentFrame;
|
|
502
502
|
function DD(i) {
|
|
503
503
|
if (i) {
|
|
504
|
-
var
|
|
504
|
+
var b = i._owner, w = au(i.type, i._source, b ? b.type : null);
|
|
505
505
|
Af.setExtraStackFrame(w);
|
|
506
506
|
} else
|
|
507
507
|
Af.setExtraStackFrame(null);
|
|
@@ -529,120 +529,120 @@ Check the render method of \`` + i + "`.";
|
|
|
529
529
|
var kf = {};
|
|
530
530
|
function t0(i) {
|
|
531
531
|
{
|
|
532
|
-
var
|
|
533
|
-
if (!
|
|
532
|
+
var b = xf();
|
|
533
|
+
if (!b) {
|
|
534
534
|
var w = typeof i == "string" ? i : i.displayName || i.name;
|
|
535
|
-
w && (
|
|
535
|
+
w && (b = `
|
|
536
536
|
|
|
537
537
|
Check the top-level render call using <` + w + ">.");
|
|
538
538
|
}
|
|
539
|
-
return
|
|
539
|
+
return b;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
function jf(i,
|
|
542
|
+
function jf(i, b) {
|
|
543
543
|
{
|
|
544
544
|
if (!i._store || i._store.validated || i.key != null)
|
|
545
545
|
return;
|
|
546
546
|
i._store.validated = !0;
|
|
547
|
-
var w = t0(
|
|
547
|
+
var w = t0(b);
|
|
548
548
|
if (kf[w])
|
|
549
549
|
return;
|
|
550
550
|
kf[w] = !0;
|
|
551
|
-
var
|
|
552
|
-
i && i._owner && i._owner !== ND.current && (
|
|
551
|
+
var L = "";
|
|
552
|
+
i && i._owner && i._owner !== ND.current && (L = " It was passed a child from " + E(i._owner.type) + "."), DD(i), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', w, L), DD(null);
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
function Sf(i,
|
|
555
|
+
function Sf(i, b) {
|
|
556
556
|
{
|
|
557
557
|
if (typeof i != "object")
|
|
558
558
|
return;
|
|
559
559
|
if (Array.isArray(i))
|
|
560
560
|
for (var w = 0; w < i.length; w++) {
|
|
561
|
-
var
|
|
562
|
-
RD(
|
|
561
|
+
var L = i[w];
|
|
562
|
+
RD(L) && jf(L, b);
|
|
563
563
|
}
|
|
564
564
|
else if (RD(i))
|
|
565
565
|
i._store && (i._store.validated = !0);
|
|
566
566
|
else if (i) {
|
|
567
|
-
var
|
|
568
|
-
if (typeof
|
|
569
|
-
for (var
|
|
570
|
-
RD(
|
|
567
|
+
var X = x(i);
|
|
568
|
+
if (typeof X == "function" && X !== i.entries)
|
|
569
|
+
for (var K = X.call(i), Y; !(Y = K.next()).done; )
|
|
570
|
+
RD(Y.value) && jf(Y.value, b);
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
function n0(i) {
|
|
575
575
|
{
|
|
576
|
-
var
|
|
577
|
-
if (
|
|
576
|
+
var b = i.type;
|
|
577
|
+
if (b == null || typeof b == "string")
|
|
578
578
|
return;
|
|
579
579
|
var w;
|
|
580
|
-
if (typeof
|
|
581
|
-
w =
|
|
582
|
-
else if (typeof
|
|
580
|
+
if (typeof b == "function")
|
|
581
|
+
w = b.propTypes;
|
|
582
|
+
else if (typeof b == "object" && (b.$$typeof === d || // Note: Memo only checks outer props here.
|
|
583
583
|
// Inner props are checked in the reconciler.
|
|
584
|
-
|
|
585
|
-
w =
|
|
584
|
+
b.$$typeof === j))
|
|
585
|
+
w = b.propTypes;
|
|
586
586
|
else
|
|
587
587
|
return;
|
|
588
588
|
if (w) {
|
|
589
|
-
var
|
|
590
|
-
K1(w, i.props, "prop",
|
|
591
|
-
} else if (
|
|
589
|
+
var L = E(b);
|
|
590
|
+
K1(w, i.props, "prop", L, i);
|
|
591
|
+
} else if (b.PropTypes !== void 0 && !OD) {
|
|
592
592
|
OD = !0;
|
|
593
|
-
var
|
|
594
|
-
|
|
593
|
+
var X = E(b);
|
|
594
|
+
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", X || "Unknown");
|
|
595
595
|
}
|
|
596
|
-
typeof
|
|
596
|
+
typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
function r0(i) {
|
|
600
600
|
{
|
|
601
|
-
for (var
|
|
602
|
-
var
|
|
603
|
-
if (
|
|
604
|
-
DD(i),
|
|
601
|
+
for (var b = Object.keys(i.props), w = 0; w < b.length; w++) {
|
|
602
|
+
var L = b[w];
|
|
603
|
+
if (L !== "children" && L !== "key") {
|
|
604
|
+
DD(i), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", L), DD(null);
|
|
605
605
|
break;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
i.ref !== null && (DD(i),
|
|
608
|
+
i.ref !== null && (DD(i), m("Invalid attribute `ref` supplied to `React.Fragment`."), DD(null));
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
function Tf(i,
|
|
611
|
+
function Tf(i, b, w, L, X, K) {
|
|
612
612
|
{
|
|
613
|
-
var
|
|
614
|
-
if (!
|
|
613
|
+
var Y = hu(i);
|
|
614
|
+
if (!Y) {
|
|
615
615
|
var H = "";
|
|
616
616
|
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (H += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
617
617
|
var bu = e0();
|
|
618
618
|
bu ? H += bu : H += xf();
|
|
619
|
-
var
|
|
620
|
-
i === null ?
|
|
619
|
+
var nu;
|
|
620
|
+
i === null ? nu = "null" : Array.isArray(i) ? nu = "array" : i !== void 0 && i.$$typeof === t ? (nu = "<" + (E(i.type) || "Unknown") + " />", H = " Did you accidentally export a JSX literal instead of a component?") : nu = typeof i, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", nu, H);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
if (
|
|
624
|
-
return
|
|
625
|
-
if (
|
|
626
|
-
var $u =
|
|
622
|
+
var su = f0(i, b, w, X, K);
|
|
623
|
+
if (su == null)
|
|
624
|
+
return su;
|
|
625
|
+
if (Y) {
|
|
626
|
+
var $u = b.children;
|
|
627
627
|
if ($u !== void 0)
|
|
628
|
-
if (
|
|
628
|
+
if (L)
|
|
629
629
|
if (Array.isArray($u)) {
|
|
630
630
|
for (var fD = 0; fD < $u.length; fD++)
|
|
631
631
|
Sf($u[fD], i);
|
|
632
632
|
Object.freeze && Object.freeze($u);
|
|
633
633
|
} else
|
|
634
|
-
|
|
634
|
+
m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
635
635
|
else
|
|
636
636
|
Sf($u, i);
|
|
637
637
|
}
|
|
638
|
-
return i === u.Fragment ? r0(
|
|
638
|
+
return i === u.Fragment ? r0(su) : n0(su), su;
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
function a0(i,
|
|
642
|
-
return Tf(i,
|
|
641
|
+
function a0(i, b, w) {
|
|
642
|
+
return Tf(i, b, w, !0);
|
|
643
643
|
}
|
|
644
|
-
function s0(i,
|
|
645
|
-
return Tf(i,
|
|
644
|
+
function s0(i, b, w) {
|
|
645
|
+
return Tf(i, b, w, !1);
|
|
646
646
|
}
|
|
647
647
|
var F0 = s0, i0 = a0;
|
|
648
648
|
u.jsx = F0, u.jsxs = i0;
|
|
@@ -650,8 +650,8 @@ Check the top-level render call using <` + w + ">.");
|
|
|
650
650
|
}(ID)), ID;
|
|
651
651
|
}
|
|
652
652
|
var E0 = {};
|
|
653
|
-
E0.NODE_ENV === "production" ?
|
|
654
|
-
var a =
|
|
653
|
+
E0.NODE_ENV === "production" ? WD.exports = c0() : WD.exports = l0();
|
|
654
|
+
var a = WD.exports;
|
|
655
655
|
const Zf = zu(void 0), Qf = ({
|
|
656
656
|
children: u,
|
|
657
657
|
channelName: D
|
|
@@ -659,7 +659,7 @@ const Zf = zu(void 0), Qf = ({
|
|
|
659
659
|
const f = pu(
|
|
660
660
|
new BroadcastChannel(D)
|
|
661
661
|
), e = pu({});
|
|
662
|
-
|
|
662
|
+
J(() => {
|
|
663
663
|
const r = ({ data: s }) => {
|
|
664
664
|
e.current[s.event].forEach((F) => F(s));
|
|
665
665
|
};
|
|
@@ -687,7 +687,7 @@ const Zf = zu(void 0), Qf = ({
|
|
|
687
687
|
}
|
|
688
688
|
);
|
|
689
689
|
}, h0 = () => {
|
|
690
|
-
const u =
|
|
690
|
+
const u = Yu(Zf);
|
|
691
691
|
if (!u)
|
|
692
692
|
throw new Error(
|
|
693
693
|
"useBroadcastChannel must be used within a BroadcastChannelProvider"
|
|
@@ -695,11 +695,11 @@ const Zf = zu(void 0), Qf = ({
|
|
|
695
695
|
return u;
|
|
696
696
|
}, b0 = (...u) => {
|
|
697
697
|
const { subscribe: D } = h0();
|
|
698
|
-
|
|
698
|
+
J(() => {
|
|
699
699
|
D(...u);
|
|
700
700
|
}, [D, ...u]);
|
|
701
701
|
};
|
|
702
|
-
var YD = /* @__PURE__ */ ((u) => (u.message = "message", u.delivery = "delivery", u.read = "read", u.typing = "typing", u.follow = "follow", u.echo = "echo", u.unknown = "", u))(YD || {}),
|
|
702
|
+
var YD = /* @__PURE__ */ ((u) => (u.message = "message", u.delivery = "delivery", u.read = "read", u.typing = "typing", u.follow = "follow", u.echo = "echo", u.unknown = "", u))(YD || {}), Q = /* @__PURE__ */ ((u) => (u.sent = "sent", u.received = "received", u))(Q || {}), u1 = /* @__PURE__ */ ((u) => (u.text = "text", u.location = "location", u))(u1 || {}), Au = /* @__PURE__ */ ((u) => (u.text = "text", u.quick_reply = "quick_reply", u.postback = "postback", u.location = "location", u.file = "file", u.notify = "notify", u))(Au || {}), KD = /* @__PURE__ */ ((u) => (u.text = "text", u.buttons = "buttons", u.quick_replies = "quick_replies", u.file = "file", u.list = "list", u.carousel = "carousel", u))(KD || {}), iD = /* @__PURE__ */ ((u) => (u[u.sent = 0] = "sent", u[u.sending = 1] = "sending", u[u.uploading = 2] = "uploading", u))(iD || {}), tD = /* @__PURE__ */ ((u) => (u[u.disconnected = 0] = "disconnected", u[u.wantToConnect = 1] = "wantToConnect", u[u.tryingToConnect = 2] = "tryingToConnect", u[u.connected = 3] = "connected", u))(tD || {}), aD = {};
|
|
703
703
|
const D1 = {
|
|
704
704
|
apiUrl: aD.REACT_APP_WIDGET_API_URL || "http://localhost:4000",
|
|
705
705
|
channel: aD.REACT_APP_WIDGET_CHANNEL || "console-channel",
|
|
@@ -714,7 +714,7 @@ const D1 = {
|
|
|
714
714
|
});
|
|
715
715
|
return /* @__PURE__ */ a.jsx(f1.Provider, { value: f.current, children: u });
|
|
716
716
|
}, Uu = () => {
|
|
717
|
-
const u =
|
|
717
|
+
const u = Yu(f1);
|
|
718
718
|
if (!u)
|
|
719
719
|
throw new Error("useConfig must be used within a ConfigProvider");
|
|
720
720
|
return u;
|
|
@@ -771,7 +771,7 @@ const D1 = {
|
|
|
771
771
|
), n1 = ({
|
|
772
772
|
children: u
|
|
773
773
|
}) => {
|
|
774
|
-
const f = Uu().language, e = (r) => r in If, [t, n] =
|
|
774
|
+
const f = Uu().language, e = (r) => r in If, [t, n] = z(
|
|
775
775
|
e(f) ? f : "en"
|
|
776
776
|
);
|
|
777
777
|
return /* @__PURE__ */ a.jsx(
|
|
@@ -782,7 +782,7 @@ const D1 = {
|
|
|
782
782
|
}
|
|
783
783
|
);
|
|
784
784
|
}, A0 = () => {
|
|
785
|
-
const u =
|
|
785
|
+
const u = Yu(t1);
|
|
786
786
|
if (!u)
|
|
787
787
|
throw new Error(
|
|
788
788
|
"useTranslationContext must be used within a TranslationProvider"
|
|
@@ -975,24 +975,24 @@ function L0(u, D) {
|
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
977
|
const o1 = 4;
|
|
978
|
-
function
|
|
978
|
+
function Fu(u) {
|
|
979
979
|
if (u) return $0(u);
|
|
980
980
|
}
|
|
981
981
|
function $0(u) {
|
|
982
|
-
for (var D in
|
|
983
|
-
u[D] =
|
|
982
|
+
for (var D in Fu.prototype)
|
|
983
|
+
u[D] = Fu.prototype[D];
|
|
984
984
|
return u;
|
|
985
985
|
}
|
|
986
|
-
|
|
986
|
+
Fu.prototype.on = Fu.prototype.addEventListener = function(u, D) {
|
|
987
987
|
return this._callbacks = this._callbacks || {}, (this._callbacks["$" + u] = this._callbacks["$" + u] || []).push(D), this;
|
|
988
988
|
};
|
|
989
|
-
|
|
989
|
+
Fu.prototype.once = function(u, D) {
|
|
990
990
|
function f() {
|
|
991
991
|
this.off(u, f), D.apply(this, arguments);
|
|
992
992
|
}
|
|
993
993
|
return f.fn = D, this.on(u, f), this;
|
|
994
994
|
};
|
|
995
|
-
|
|
995
|
+
Fu.prototype.off = Fu.prototype.removeListener = Fu.prototype.removeAllListeners = Fu.prototype.removeEventListener = function(u, D) {
|
|
996
996
|
if (this._callbacks = this._callbacks || {}, arguments.length == 0)
|
|
997
997
|
return this._callbacks = {}, this;
|
|
998
998
|
var f = this._callbacks["$" + u];
|
|
@@ -1006,7 +1006,7 @@ iu.prototype.off = iu.prototype.removeListener = iu.prototype.removeAllListeners
|
|
|
1006
1006
|
}
|
|
1007
1007
|
return f.length === 0 && delete this._callbacks["$" + u], this;
|
|
1008
1008
|
};
|
|
1009
|
-
|
|
1009
|
+
Fu.prototype.emit = function(u) {
|
|
1010
1010
|
this._callbacks = this._callbacks || {};
|
|
1011
1011
|
for (var D = new Array(arguments.length - 1), f = this._callbacks["$" + u], e = 1; e < arguments.length; e++)
|
|
1012
1012
|
D[e - 1] = arguments[e];
|
|
@@ -1017,11 +1017,11 @@ iu.prototype.emit = function(u) {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
return this;
|
|
1019
1019
|
};
|
|
1020
|
-
|
|
1021
|
-
|
|
1020
|
+
Fu.prototype.emitReserved = Fu.prototype.emit;
|
|
1021
|
+
Fu.prototype.listeners = function(u) {
|
|
1022
1022
|
return this._callbacks = this._callbacks || {}, this._callbacks["$" + u] || [];
|
|
1023
1023
|
};
|
|
1024
|
-
|
|
1024
|
+
Fu.prototype.hasListeners = function(u) {
|
|
1025
1025
|
return !!this.listeners(u).length;
|
|
1026
1026
|
};
|
|
1027
1027
|
const AD = typeof Promise == "function" && typeof Promise.resolve == "function" ? (D) => Promise.resolve().then(D) : (D, f) => f(D, 0), vu = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), M0 = "arraybuffer";
|
|
@@ -1034,9 +1034,9 @@ function xD(u, D) {
|
|
|
1034
1034
|
}
|
|
1035
1035
|
const U0 = 1.33;
|
|
1036
1036
|
function V0(u) {
|
|
1037
|
-
return typeof u == "string" ?
|
|
1037
|
+
return typeof u == "string" ? H0(u) : Math.ceil((u.byteLength || u.size) * U0);
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function H0(u) {
|
|
1040
1040
|
let D = 0, f = 0;
|
|
1041
1041
|
for (let e = 0, t = u.length; e < t; e++)
|
|
1042
1042
|
D = u.charCodeAt(e), D < 128 ? f += 1 : D < 2048 ? f += 2 : D < 55296 || D >= 57344 ? f += 3 : (e++, f += 4);
|
|
@@ -1045,7 +1045,7 @@ function W0(u) {
|
|
|
1045
1045
|
function C1() {
|
|
1046
1046
|
return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function W0(u) {
|
|
1049
1049
|
let D = "";
|
|
1050
1050
|
for (let f in u)
|
|
1051
1051
|
u.hasOwnProperty(f) && (D.length && (D += "&"), D += encodeURIComponent(f) + "=" + encodeURIComponent(u[f]));
|
|
@@ -1064,7 +1064,7 @@ class K0 extends Error {
|
|
|
1064
1064
|
super(D), this.description = f, this.context = e, this.type = "TransportError";
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
class Cf extends
|
|
1067
|
+
class Cf extends Fu {
|
|
1068
1068
|
/**
|
|
1069
1069
|
* Transport abstract constructor.
|
|
1070
1070
|
*
|
|
@@ -1158,7 +1158,7 @@ class Cf extends iu {
|
|
|
1158
1158
|
return this.opts.port && (this.opts.secure && +(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
|
|
1159
1159
|
}
|
|
1160
1160
|
_query(D) {
|
|
1161
|
-
const f =
|
|
1161
|
+
const f = W0(D);
|
|
1162
1162
|
return f.length ? "?" + f : "";
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
@@ -1304,7 +1304,7 @@ class Z0 extends J0 {
|
|
|
1304
1304
|
}), this.pollXhr = D;
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
|
-
class ju extends
|
|
1307
|
+
class ju extends Fu {
|
|
1308
1308
|
/**
|
|
1309
1309
|
* Request constructor
|
|
1310
1310
|
*
|
|
@@ -1600,7 +1600,7 @@ const XD = typeof addEventListener == "function" && typeof removeEventListener =
|
|
|
1600
1600
|
XD && addEventListener("offline", () => {
|
|
1601
1601
|
BD.forEach((u) => u());
|
|
1602
1602
|
}, !1);
|
|
1603
|
-
class Hu extends
|
|
1603
|
+
class Hu extends Fu {
|
|
1604
1604
|
/**
|
|
1605
1605
|
* Socket constructor.
|
|
1606
1606
|
*
|
|
@@ -2027,10 +2027,10 @@ const be = [
|
|
|
2027
2027
|
"removeListener"
|
|
2028
2028
|
// used by the Node.js EventEmitter
|
|
2029
2029
|
], pe = 5;
|
|
2030
|
-
var
|
|
2030
|
+
var W;
|
|
2031
2031
|
(function(u) {
|
|
2032
2032
|
u[u.CONNECT = 0] = "CONNECT", u[u.DISCONNECT = 1] = "DISCONNECT", u[u.EVENT = 2] = "EVENT", u[u.ACK = 3] = "ACK", u[u.CONNECT_ERROR = 4] = "CONNECT_ERROR", u[u.BINARY_EVENT = 5] = "BINARY_EVENT", u[u.BINARY_ACK = 6] = "BINARY_ACK";
|
|
2033
|
-
})(
|
|
2033
|
+
})(W || (W = {}));
|
|
2034
2034
|
class Be {
|
|
2035
2035
|
/**
|
|
2036
2036
|
* Encoder constructor
|
|
@@ -2047,8 +2047,8 @@ class Be {
|
|
|
2047
2047
|
* @param {Object} obj - packet object
|
|
2048
2048
|
*/
|
|
2049
2049
|
encode(D) {
|
|
2050
|
-
return (D.type ===
|
|
2051
|
-
type: D.type ===
|
|
2050
|
+
return (D.type === W.EVENT || D.type === W.ACK) && gD(D) ? this.encodeAsBinary({
|
|
2051
|
+
type: D.type === W.EVENT ? W.BINARY_EVENT : W.BINARY_ACK,
|
|
2052
2052
|
nsp: D.nsp,
|
|
2053
2053
|
data: D.data,
|
|
2054
2054
|
id: D.id
|
|
@@ -2059,7 +2059,7 @@ class Be {
|
|
|
2059
2059
|
*/
|
|
2060
2060
|
encodeAsString(D) {
|
|
2061
2061
|
let f = "" + D.type;
|
|
2062
|
-
return (D.type ===
|
|
2062
|
+
return (D.type === W.BINARY_EVENT || D.type === W.BINARY_ACK) && (f += D.attachments + "-"), D.nsp && D.nsp !== "/" && (f += D.nsp + ","), D.id != null && (f += D.id), D.data != null && (f += JSON.stringify(D.data, this.replacer)), f;
|
|
2063
2063
|
}
|
|
2064
2064
|
/**
|
|
2065
2065
|
* Encode packet as 'buffer sequence' by removing blobs, and
|
|
@@ -2074,7 +2074,7 @@ class Be {
|
|
|
2074
2074
|
function Uf(u) {
|
|
2075
2075
|
return Object.prototype.toString.call(u) === "[object Object]";
|
|
2076
2076
|
}
|
|
2077
|
-
class lf extends
|
|
2077
|
+
class lf extends Fu {
|
|
2078
2078
|
/**
|
|
2079
2079
|
* Decoder constructor
|
|
2080
2080
|
*
|
|
@@ -2094,8 +2094,8 @@ class lf extends iu {
|
|
|
2094
2094
|
if (this.reconstructor)
|
|
2095
2095
|
throw new Error("got plaintext data when reconstructing a packet");
|
|
2096
2096
|
f = this.decodeString(D);
|
|
2097
|
-
const e = f.type ===
|
|
2098
|
-
e || f.type ===
|
|
2097
|
+
const e = f.type === W.BINARY_EVENT;
|
|
2098
|
+
e || f.type === W.BINARY_ACK ? (f.type = e ? W.EVENT : W.ACK, this.reconstructor = new ge(f), f.attachments === 0 && super.emitReserved("decoded", f)) : super.emitReserved("decoded", f);
|
|
2099
2099
|
} else if (cf(D) || D.base64)
|
|
2100
2100
|
if (this.reconstructor)
|
|
2101
2101
|
f = this.reconstructor.takeBinaryData(D), f && (this.reconstructor = null, super.emitReserved("decoded", f));
|
|
@@ -2115,9 +2115,9 @@ class lf extends iu {
|
|
|
2115
2115
|
const e = {
|
|
2116
2116
|
type: Number(D.charAt(0))
|
|
2117
2117
|
};
|
|
2118
|
-
if (
|
|
2118
|
+
if (W[e.type] === void 0)
|
|
2119
2119
|
throw new Error("unknown packet type " + e.type);
|
|
2120
|
-
if (e.type ===
|
|
2120
|
+
if (e.type === W.BINARY_EVENT || e.type === W.BINARY_ACK) {
|
|
2121
2121
|
const n = f + 1;
|
|
2122
2122
|
for (; D.charAt(++f) !== "-" && f != D.length; )
|
|
2123
2123
|
;
|
|
@@ -2165,17 +2165,17 @@ class lf extends iu {
|
|
|
2165
2165
|
}
|
|
2166
2166
|
static isPayloadValid(D, f) {
|
|
2167
2167
|
switch (D) {
|
|
2168
|
-
case
|
|
2168
|
+
case W.CONNECT:
|
|
2169
2169
|
return Uf(f);
|
|
2170
|
-
case
|
|
2170
|
+
case W.DISCONNECT:
|
|
2171
2171
|
return f === void 0;
|
|
2172
|
-
case
|
|
2172
|
+
case W.CONNECT_ERROR:
|
|
2173
2173
|
return typeof f == "string" || Uf(f);
|
|
2174
|
-
case
|
|
2175
|
-
case
|
|
2174
|
+
case W.EVENT:
|
|
2175
|
+
case W.BINARY_EVENT:
|
|
2176
2176
|
return Array.isArray(f) && (typeof f[0] == "number" || typeof f[0] == "string" && be.indexOf(f[0]) === -1);
|
|
2177
|
-
case
|
|
2178
|
-
case
|
|
2177
|
+
case W.ACK:
|
|
2178
|
+
case W.BINARY_ACK:
|
|
2179
2179
|
return Array.isArray(f);
|
|
2180
2180
|
}
|
|
2181
2181
|
}
|
|
@@ -2217,7 +2217,7 @@ const me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2217
2217
|
Decoder: lf,
|
|
2218
2218
|
Encoder: Be,
|
|
2219
2219
|
get PacketType() {
|
|
2220
|
-
return
|
|
2220
|
+
return W;
|
|
2221
2221
|
},
|
|
2222
2222
|
protocol: pe
|
|
2223
2223
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -2235,7 +2235,7 @@ const _e = Object.freeze({
|
|
|
2235
2235
|
newListener: 1,
|
|
2236
2236
|
removeListener: 1
|
|
2237
2237
|
});
|
|
2238
|
-
class b1 extends
|
|
2238
|
+
class b1 extends Fu {
|
|
2239
2239
|
/**
|
|
2240
2240
|
* `Socket` constructor.
|
|
2241
2241
|
*/
|
|
@@ -2356,7 +2356,7 @@ class b1 extends iu {
|
|
|
2356
2356
|
if (f.unshift(D), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
|
|
2357
2357
|
return this._addToQueue(f), this;
|
|
2358
2358
|
const r = {
|
|
2359
|
-
type:
|
|
2359
|
+
type: W.EVENT,
|
|
2360
2360
|
data: f
|
|
2361
2361
|
};
|
|
2362
2362
|
if (r.options = {}, r.options.compress = this.flags.compress !== !1, typeof f[f.length - 1] == "function") {
|
|
@@ -2464,7 +2464,7 @@ class b1 extends iu {
|
|
|
2464
2464
|
*/
|
|
2465
2465
|
_sendConnectPacket(D) {
|
|
2466
2466
|
this.packet({
|
|
2467
|
-
type:
|
|
2467
|
+
type: W.CONNECT,
|
|
2468
2468
|
data: this._pid ? Object.assign({ pid: this._pid, offset: this._lastOffset }, D) : D
|
|
2469
2469
|
});
|
|
2470
2470
|
}
|
|
@@ -2510,21 +2510,21 @@ class b1 extends iu {
|
|
|
2510
2510
|
onpacket(D) {
|
|
2511
2511
|
if (D.nsp === this.nsp)
|
|
2512
2512
|
switch (D.type) {
|
|
2513
|
-
case
|
|
2513
|
+
case W.CONNECT:
|
|
2514
2514
|
D.data && D.data.sid ? this.onconnect(D.data.sid, D.data.pid) : this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));
|
|
2515
2515
|
break;
|
|
2516
|
-
case
|
|
2517
|
-
case
|
|
2516
|
+
case W.EVENT:
|
|
2517
|
+
case W.BINARY_EVENT:
|
|
2518
2518
|
this.onevent(D);
|
|
2519
2519
|
break;
|
|
2520
|
-
case
|
|
2521
|
-
case
|
|
2520
|
+
case W.ACK:
|
|
2521
|
+
case W.BINARY_ACK:
|
|
2522
2522
|
this.onack(D);
|
|
2523
2523
|
break;
|
|
2524
|
-
case
|
|
2524
|
+
case W.DISCONNECT:
|
|
2525
2525
|
this.ondisconnect();
|
|
2526
2526
|
break;
|
|
2527
|
-
case
|
|
2527
|
+
case W.CONNECT_ERROR:
|
|
2528
2528
|
this.destroy();
|
|
2529
2529
|
const e = new Error(D.data.message);
|
|
2530
2530
|
e.data = D.data.data, this.emitReserved("connect_error", e);
|
|
@@ -2559,7 +2559,7 @@ class b1 extends iu {
|
|
|
2559
2559
|
let e = !1;
|
|
2560
2560
|
return function(...t) {
|
|
2561
2561
|
e || (e = !0, f.packet({
|
|
2562
|
-
type:
|
|
2562
|
+
type: W.ACK,
|
|
2563
2563
|
id: D,
|
|
2564
2564
|
data: t
|
|
2565
2565
|
}));
|
|
@@ -2628,7 +2628,7 @@ class b1 extends iu {
|
|
|
2628
2628
|
* @return self
|
|
2629
2629
|
*/
|
|
2630
2630
|
disconnect() {
|
|
2631
|
-
return this.connected && this.packet({ type:
|
|
2631
|
+
return this.connected && this.packet({ type: W.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
|
|
2632
2632
|
}
|
|
2633
2633
|
/**
|
|
2634
2634
|
* Alias for {@link disconnect()}.
|
|
@@ -2850,7 +2850,7 @@ nD.prototype.setMax = function(u) {
|
|
|
2850
2850
|
nD.prototype.setJitter = function(u) {
|
|
2851
2851
|
this.jitter = u;
|
|
2852
2852
|
};
|
|
2853
|
-
class uf extends
|
|
2853
|
+
class uf extends Fu {
|
|
2854
2854
|
constructor(D, f) {
|
|
2855
2855
|
var e;
|
|
2856
2856
|
super(), this.nsps = {}, this.subs = [], D && typeof D == "object" && (f = D, D = void 0), f = f || {}, f.path = f.path || "/socket.io", this.opts = f, xD(this, f), this.reconnection(f.reconnection !== !1), this.reconnectionAttempts(f.reconnectionAttempts || 1 / 0), this.reconnectionDelay(f.reconnectionDelay || 1e3), this.reconnectionDelayMax(f.reconnectionDelayMax || 5e3), this.randomizationFactor((e = f.randomizationFactor) !== null && e !== void 0 ? e : 0.5), this.backoff = new nD({
|
|
@@ -3113,7 +3113,7 @@ function we(u, D) {
|
|
|
3113
3113
|
function Ae(u, D) {
|
|
3114
3114
|
localStorage.removeItem(Ef(u, D));
|
|
3115
3115
|
}
|
|
3116
|
-
const
|
|
3116
|
+
const uu = { setItem: ve, getItem: we, removeItem: Ae }, wD = class wD {
|
|
3117
3117
|
constructor(D, f, e) {
|
|
3118
3118
|
lD(this, "socket");
|
|
3119
3119
|
lD(this, "config");
|
|
@@ -3250,7 +3250,7 @@ lD(wD, "defaultConfig", {
|
|
|
3250
3250
|
let Df = wD, qD;
|
|
3251
3251
|
const xe = (u, D) => {
|
|
3252
3252
|
var e;
|
|
3253
|
-
const f = (e =
|
|
3253
|
+
const f = (e = uu.getItem("profileLiveChat")) == null ? void 0 : e.id;
|
|
3254
3254
|
return qD || (qD = new Df(
|
|
3255
3255
|
u.apiUrl,
|
|
3256
3256
|
{
|
|
@@ -3281,12 +3281,12 @@ const xe = (u, D) => {
|
|
|
3281
3281
|
})
|
|
3282
3282
|
);
|
|
3283
3283
|
return /* @__PURE__ */ a.jsx(p1.Provider, { value: { socket: f.current }, children: u.children });
|
|
3284
|
-
},
|
|
3285
|
-
const { socket: f } =
|
|
3286
|
-
|
|
3284
|
+
}, Wu = () => Yu(p1), ff = (u, D) => {
|
|
3285
|
+
const { socket: f } = Wu();
|
|
3286
|
+
J(() => (f.on(u, D), () => f.off(u, D)), [u, D, f]);
|
|
3287
3287
|
}, ke = () => {
|
|
3288
|
-
const { socket: u } =
|
|
3289
|
-
|
|
3288
|
+
const { socket: u } = Wu();
|
|
3289
|
+
J(() => (u.connect(), () => {
|
|
3290
3290
|
u.disconnect();
|
|
3291
3291
|
}), []);
|
|
3292
3292
|
}, _D = {
|
|
@@ -3321,7 +3321,7 @@ const xe = (u, D) => {
|
|
|
3321
3321
|
}, g1 = zu(_D), m1 = ({
|
|
3322
3322
|
children: u
|
|
3323
3323
|
}) => {
|
|
3324
|
-
const { t: D } = Ou(), f = Lf.getItem("settings"), [e, t] =
|
|
3324
|
+
const { t: D } = Ou(), f = Lf.getItem("settings"), [e, t] = z(
|
|
3325
3325
|
f || _D
|
|
3326
3326
|
), n = qu((r) => {
|
|
3327
3327
|
Lf.setItem("settings", r), t(r);
|
|
@@ -3348,36 +3348,36 @@ const xe = (u, D) => {
|
|
|
3348
3348
|
offline_mode: r.offline_mode
|
|
3349
3349
|
});
|
|
3350
3350
|
}), /* @__PURE__ */ a.jsx(g1.Provider, { value: e, children: u });
|
|
3351
|
-
}, Bu = () =>
|
|
3351
|
+
}, Bu = () => Yu(g1), _1 = zu(void 0), y1 = ({
|
|
3352
3352
|
onOpen: u,
|
|
3353
3353
|
onClose: D,
|
|
3354
3354
|
onScrollToTop: f,
|
|
3355
3355
|
defaultScreen: e = "prechat",
|
|
3356
3356
|
children: t
|
|
3357
3357
|
}) => {
|
|
3358
|
-
const [n, r] =
|
|
3358
|
+
const [n, r] = z(!0), [s, F] = z(!1), [o, d] = z(e), [c, l] = z(100), N = {
|
|
3359
3359
|
syncState: n,
|
|
3360
3360
|
isOpen: s,
|
|
3361
3361
|
screen: o,
|
|
3362
3362
|
scroll: c,
|
|
3363
|
-
setSyncState: (
|
|
3364
|
-
r(
|
|
3363
|
+
setSyncState: (B) => {
|
|
3364
|
+
r(B);
|
|
3365
3365
|
},
|
|
3366
|
-
setIsOpen: (
|
|
3367
|
-
F(
|
|
3366
|
+
setIsOpen: (B) => {
|
|
3367
|
+
F(B), n && (B ? u && u() : D && D());
|
|
3368
3368
|
},
|
|
3369
|
-
setScreen: (
|
|
3369
|
+
setScreen: (B) => {
|
|
3370
3370
|
d(
|
|
3371
|
-
["prechat", "postchat", "webview"].includes(
|
|
3371
|
+
["prechat", "postchat", "webview"].includes(B) ? B : "chat"
|
|
3372
3372
|
);
|
|
3373
3373
|
},
|
|
3374
|
-
setScroll: (
|
|
3375
|
-
l(
|
|
3374
|
+
setScroll: (B) => {
|
|
3375
|
+
l(B), f && n && B === 0 && f();
|
|
3376
3376
|
}
|
|
3377
3377
|
};
|
|
3378
|
-
return /* @__PURE__ */ a.jsx(_1.Provider, { value:
|
|
3378
|
+
return /* @__PURE__ */ a.jsx(_1.Provider, { value: N, children: t });
|
|
3379
3379
|
}, Nu = () => {
|
|
3380
|
-
const u =
|
|
3380
|
+
const u = Yu(_1);
|
|
3381
3381
|
if (u === void 0)
|
|
3382
3382
|
throw new Error("useWidget must be used within a WidgetProvider");
|
|
3383
3383
|
return u;
|
|
@@ -3449,100 +3449,100 @@ const xe = (u, D) => {
|
|
|
3449
3449
|
setIsOfflineMode: () => {
|
|
3450
3450
|
}
|
|
3451
3451
|
}, v1 = zu(yu), w1 = ({ wantToConnect: u, defaultConnectionState: D = 0, children: f }) => {
|
|
3452
|
-
const e = Uu(), t = Bu(), { screen: n, setScreen: r } = Nu(), { setScroll: s, syncState: F, isOpen: o } = Nu(), d =
|
|
3452
|
+
const e = Uu(), t = Bu(), { screen: n, setScreen: r } = Nu(), { setScroll: s, syncState: F, isOpen: o } = Nu(), d = Wu(), [c, l] = z(
|
|
3453
3453
|
yu.participants
|
|
3454
|
-
), [j,
|
|
3454
|
+
), [j, y] = z(
|
|
3455
3455
|
D
|
|
3456
|
-
), [C,
|
|
3456
|
+
), [C, T] = z([]), [N, B] = z(
|
|
3457
3457
|
yu.newMessagesCount
|
|
3458
|
-
), [
|
|
3458
|
+
), [$, _] = z(
|
|
3459
3459
|
yu.showTypingIndicator
|
|
3460
|
-
), [
|
|
3460
|
+
), [p, R] = z(
|
|
3461
3461
|
yu.suggestions
|
|
3462
|
-
), [
|
|
3462
|
+
), [x, V] = z(
|
|
3463
3463
|
yu.newIOMessage
|
|
3464
|
-
), [
|
|
3464
|
+
), [m, A] = z(yu.message), [v, hu] = z(yu.outgoingMessageState), [fu, S] = z(yu.payload), [E, h] = z(yu.file), [k, g] = z(yu.webviewUrl), [I, P] = z(
|
|
3465
3465
|
yu.isContactFormActive
|
|
3466
|
-
), [M,
|
|
3466
|
+
), [M, U] = z(
|
|
3467
3467
|
yu.isOfflineMode
|
|
3468
|
-
), { send:
|
|
3469
|
-
|
|
3470
|
-
},
|
|
3471
|
-
if (
|
|
3468
|
+
), { send: G } = Cu(), { t: q } = Ou(), Z = (O) => {
|
|
3469
|
+
y(O), O === tD.wantToConnect && u && u(), O === tD.connected && t.alwaysScrollToBottom && s(101);
|
|
3470
|
+
}, tu = t.offline_mode, cu = kD(tu), _u = (O) => {
|
|
3471
|
+
if (V(O), uu.setItem(
|
|
3472
3472
|
"isOffline",
|
|
3473
3473
|
(O == null ? void 0 : O.isOffline) || !1
|
|
3474
|
-
),
|
|
3474
|
+
), uu.setItem(
|
|
3475
3475
|
"submitedFormLateTime",
|
|
3476
3476
|
(O == null ? void 0 : O.submitedFormLateTime) || null
|
|
3477
3477
|
), O && "type" in O && O.type === "typing")
|
|
3478
|
-
return
|
|
3479
|
-
|
|
3480
|
-
...
|
|
3478
|
+
return $ === !0;
|
|
3479
|
+
_(!1), O && "mid" in O && !C.find((Du) => O.mid === Du.mid) && ("author" in O && (O.direction = O.author === "chatbot" ? Q.received : Q.sent, O.read = !0, O.delivery = !0), T((Du) => [
|
|
3480
|
+
...Du.filter((au) => au.mid !== O.mid),
|
|
3481
3481
|
O
|
|
3482
|
-
]), s(0), "direction" in O && O.direction ===
|
|
3482
|
+
]), s(0), "direction" in O && O.direction === Q.received && !O.isOffline && U(!1)), O && "data" in O && "quick_replies" in O.data ? R(
|
|
3483
3483
|
(O.data.quick_replies || []).map(
|
|
3484
|
-
(
|
|
3484
|
+
(Du) => ({
|
|
3485
3485
|
content_type: u1.text,
|
|
3486
|
-
text:
|
|
3487
|
-
payload:
|
|
3486
|
+
text: Du.title,
|
|
3487
|
+
payload: Du.payload
|
|
3488
3488
|
})
|
|
3489
3489
|
)
|
|
3490
|
-
) :
|
|
3491
|
-
}, { socket: gu } =
|
|
3490
|
+
) : R([]), o || B((Du) => Du + 1), t.alwaysScrollToBottom && s(101), hu(iD.sent);
|
|
3491
|
+
}, { socket: gu } = Wu(), ru = async ({
|
|
3492
3492
|
data: O
|
|
3493
3493
|
}) => {
|
|
3494
|
-
var
|
|
3495
|
-
|
|
3494
|
+
var au;
|
|
3495
|
+
hu(
|
|
3496
3496
|
O.type === "file" ? iD.uploading : iD.sending
|
|
3497
|
-
),
|
|
3498
|
-
const
|
|
3497
|
+
), A("");
|
|
3498
|
+
const Du = await d.socket.post(
|
|
3499
3499
|
`/webhook/${e.channel}/`,
|
|
3500
3500
|
{
|
|
3501
3501
|
data: {
|
|
3502
3502
|
...O,
|
|
3503
|
-
author: (O == null ? void 0 : O.author) ?? ((
|
|
3503
|
+
author: (O == null ? void 0 : O.author) ?? ((au = c[1]) == null ? void 0 : au.id)
|
|
3504
3504
|
}
|
|
3505
3505
|
}
|
|
3506
3506
|
);
|
|
3507
3507
|
console.log(
|
|
3508
3508
|
"🚀 ~ ChatProvider.tsx:351 ~ handleSend ~ sentMessage:",
|
|
3509
|
-
|
|
3509
|
+
Du
|
|
3510
3510
|
), console.log(
|
|
3511
3511
|
"=== CALLING handleNewIOMessage from handleSend (API Response) ==="
|
|
3512
3512
|
);
|
|
3513
|
-
},
|
|
3514
|
-
async (O,
|
|
3513
|
+
}, du = qu(
|
|
3514
|
+
async (O, Du) => {
|
|
3515
3515
|
try {
|
|
3516
|
-
|
|
3517
|
-
const
|
|
3516
|
+
y(2);
|
|
3517
|
+
const au = new URLSearchParams();
|
|
3518
3518
|
Object.entries({
|
|
3519
|
-
...O &&
|
|
3519
|
+
...O && Du ? { first_name: O, last_name: Du } : {},
|
|
3520
3520
|
_refresh: Date.now().toString()
|
|
3521
3521
|
// Force fresh data
|
|
3522
3522
|
}).forEach(([mu, Vu]) => {
|
|
3523
|
-
typeof Vu == "string" && Vu.trim() &&
|
|
3524
|
-
}),
|
|
3525
|
-
const { body:
|
|
3526
|
-
console.log("jump here 2"),
|
|
3523
|
+
typeof Vu == "string" && Vu.trim() && au.append(mu, Vu);
|
|
3524
|
+
}), au.append("owner_id", e.ownerId);
|
|
3525
|
+
const { body: lu } = await gu.get(`/webhook/${e.channel}/?${au.toString()}`);
|
|
3526
|
+
console.log("jump here 2"), uu.setItem("profileLiveChat", lu.profile), uu.setItem("isOffline", cu || !1), uu.setItem(
|
|
3527
3527
|
"submitedFormLateTime",
|
|
3528
|
-
|
|
3529
|
-
),
|
|
3530
|
-
|
|
3528
|
+
lu.profile.submitedFormLateTime || null
|
|
3529
|
+
), T(
|
|
3530
|
+
lu.messages.map((mu) => ({
|
|
3531
3531
|
...mu,
|
|
3532
|
-
direction: mu.author ===
|
|
3533
|
-
read: mu.direction ===
|
|
3534
|
-
delivery: mu.direction ===
|
|
3535
|
-
isOffline: mu.isOffline ||
|
|
3536
|
-
submitedFormLateTime: mu.submitedFormLateTime ||
|
|
3532
|
+
direction: mu.author === lu.profile.foreignId || mu.author === lu.profile.id ? Q.sent : Q.received,
|
|
3533
|
+
read: mu.direction === Q.sent || mu.read,
|
|
3534
|
+
delivery: mu.direction === Q.sent || mu.delivery,
|
|
3535
|
+
isOffline: mu.isOffline || lu.profile.isOffline,
|
|
3536
|
+
submitedFormLateTime: mu.submitedFormLateTime || lu.profile.submitedFormLateTime
|
|
3537
3537
|
}))
|
|
3538
3538
|
), l([
|
|
3539
3539
|
c[0],
|
|
3540
3540
|
{
|
|
3541
|
-
id:
|
|
3542
|
-
foreign_id:
|
|
3543
|
-
name: `${
|
|
3541
|
+
id: lu.profile.foreignId,
|
|
3542
|
+
foreign_id: lu.profile.foreignId,
|
|
3543
|
+
name: `${lu.profile.firstName} ${lu.profile.firstName}`
|
|
3544
3544
|
}
|
|
3545
|
-
]), C.length === 0 &&
|
|
3545
|
+
]), C.length === 0 && G({
|
|
3546
3546
|
event,
|
|
3547
3547
|
source: "get_started_button",
|
|
3548
3548
|
data: {
|
|
@@ -3551,18 +3551,18 @@ const xe = (u, D) => {
|
|
|
3551
3551
|
text: q("messages.get_started"),
|
|
3552
3552
|
payload: "GET_STARTED"
|
|
3553
3553
|
},
|
|
3554
|
-
author:
|
|
3554
|
+
author: lu.profile.foreignId
|
|
3555
3555
|
}
|
|
3556
|
-
}),
|
|
3557
|
-
} catch (
|
|
3558
|
-
console.error("Unable to subscribe user",
|
|
3556
|
+
}), y(3), r("chat");
|
|
3557
|
+
} catch (au) {
|
|
3558
|
+
console.error("Unable to subscribe user", au), r("prechat"), y(0);
|
|
3559
3559
|
}
|
|
3560
3560
|
},
|
|
3561
3561
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3562
3562
|
[
|
|
3563
3563
|
c,
|
|
3564
|
-
|
|
3565
|
-
|
|
3564
|
+
y,
|
|
3565
|
+
T,
|
|
3566
3566
|
l,
|
|
3567
3567
|
r,
|
|
3568
3568
|
d
|
|
@@ -3572,78 +3572,78 @@ const xe = (u, D) => {
|
|
|
3572
3572
|
console.log(
|
|
3573
3573
|
"=== CALLING handleNewIOMessage from useSubscribe (Socket Realtime) ==="
|
|
3574
3574
|
), _u(O);
|
|
3575
|
-
}), ff(YD.typing,
|
|
3575
|
+
}), ff(YD.typing, _);
|
|
3576
3576
|
const Iu = (O) => {
|
|
3577
|
-
O ? (
|
|
3577
|
+
O ? (g(O), r("webview")) : r("chat");
|
|
3578
3578
|
};
|
|
3579
|
-
|
|
3580
|
-
F && o &&
|
|
3581
|
-
}, [F, o]),
|
|
3579
|
+
J(() => {
|
|
3580
|
+
F && o && B(0);
|
|
3581
|
+
}, [F, o]), J(() => {
|
|
3582
3582
|
if (o && j === tD.connected) {
|
|
3583
3583
|
console.log("🔄 Widget opened - fetching fresh data");
|
|
3584
|
-
const O =
|
|
3584
|
+
const O = uu.getItem("profileLiveChat");
|
|
3585
3585
|
if (O) {
|
|
3586
|
-
const
|
|
3587
|
-
console.log("🔄 Widget opened - fetching fresh data",
|
|
3586
|
+
const Du = O;
|
|
3587
|
+
console.log("🔄 Widget opened - fetching fresh data", Du), du(Du.firstName, Du.lastName);
|
|
3588
3588
|
}
|
|
3589
|
-
!O && !
|
|
3589
|
+
!O && !cu && r("prechat");
|
|
3590
3590
|
}
|
|
3591
3591
|
}, [o]), b0("logout", () => {
|
|
3592
3592
|
d.socket.disconnect();
|
|
3593
|
-
}),
|
|
3594
|
-
n === "chat" && j === tD.connected &&
|
|
3593
|
+
}), J(() => {
|
|
3594
|
+
n === "chat" && j === tD.connected && du();
|
|
3595
3595
|
const O = () => {
|
|
3596
|
-
const
|
|
3597
|
-
if (
|
|
3598
|
-
const
|
|
3599
|
-
|
|
3596
|
+
const Du = uu.getItem("profileLiveChat");
|
|
3597
|
+
if (Du) {
|
|
3598
|
+
const au = Du;
|
|
3599
|
+
du(au.firstName, au.lastName);
|
|
3600
3600
|
}
|
|
3601
3601
|
};
|
|
3602
3602
|
return d.socket.io.on("reconnect", O), () => {
|
|
3603
3603
|
d.socket.io.off("reconnect", O);
|
|
3604
3604
|
};
|
|
3605
|
-
}, []),
|
|
3605
|
+
}, []), J(() => {
|
|
3606
3606
|
const O = [...c];
|
|
3607
3607
|
O[0].imageUrl = t.avatarUrl, l(O);
|
|
3608
3608
|
}, [t.avatarUrl]);
|
|
3609
3609
|
const Lu = {
|
|
3610
3610
|
participants: c,
|
|
3611
3611
|
setParticipants: l,
|
|
3612
|
-
outgoingMessageState:
|
|
3613
|
-
setOutgoingMessageState:
|
|
3612
|
+
outgoingMessageState: v,
|
|
3613
|
+
setOutgoingMessageState: hu,
|
|
3614
3614
|
connectionState: j,
|
|
3615
|
-
setConnectionState:
|
|
3616
|
-
messages: C.sort((O,
|
|
3617
|
-
const
|
|
3618
|
-
return +new Date(
|
|
3615
|
+
setConnectionState: Z,
|
|
3616
|
+
messages: C.sort((O, Du) => {
|
|
3617
|
+
const au = Date.parse(O.createdAt), lu = Date.parse(Du.createdAt);
|
|
3618
|
+
return +new Date(au) - +new Date(lu);
|
|
3619
3619
|
}),
|
|
3620
|
-
setMessages:
|
|
3621
|
-
newMessagesCount:
|
|
3622
|
-
setNewMessagesCount:
|
|
3623
|
-
newIOMessage:
|
|
3624
|
-
setNewIOMessage:
|
|
3625
|
-
send:
|
|
3626
|
-
showTypingIndicator: t.showTypingIndicator &&
|
|
3627
|
-
setShowTypingIndicator:
|
|
3628
|
-
suggestions:
|
|
3629
|
-
setSuggestions:
|
|
3630
|
-
webviewUrl:
|
|
3620
|
+
setMessages: T,
|
|
3621
|
+
newMessagesCount: N,
|
|
3622
|
+
setNewMessagesCount: B,
|
|
3623
|
+
newIOMessage: x,
|
|
3624
|
+
setNewIOMessage: V,
|
|
3625
|
+
send: ru,
|
|
3626
|
+
showTypingIndicator: t.showTypingIndicator && $,
|
|
3627
|
+
setShowTypingIndicator: _,
|
|
3628
|
+
suggestions: p,
|
|
3629
|
+
setSuggestions: R,
|
|
3630
|
+
webviewUrl: k,
|
|
3631
3631
|
setWebviewUrl: Iu,
|
|
3632
|
-
payload:
|
|
3633
|
-
setPayload:
|
|
3632
|
+
payload: fu,
|
|
3633
|
+
setPayload: S,
|
|
3634
3634
|
file: E,
|
|
3635
3635
|
setFile: h,
|
|
3636
|
-
message:
|
|
3637
|
-
setMessage:
|
|
3638
|
-
handleSubscription:
|
|
3636
|
+
message: m,
|
|
3637
|
+
setMessage: A,
|
|
3638
|
+
handleSubscription: du,
|
|
3639
3639
|
isContactFormActive: I,
|
|
3640
|
-
setIsContactFormActive:
|
|
3640
|
+
setIsContactFormActive: P,
|
|
3641
3641
|
isOfflineMode: M,
|
|
3642
|
-
setIsOfflineMode:
|
|
3642
|
+
setIsOfflineMode: U
|
|
3643
3643
|
};
|
|
3644
3644
|
return /* @__PURE__ */ a.jsx(v1.Provider, { value: Lu, children: f });
|
|
3645
|
-
},
|
|
3646
|
-
const u =
|
|
3645
|
+
}, Cu = () => {
|
|
3646
|
+
const u = Yu(v1);
|
|
3647
3647
|
if (!u)
|
|
3648
3648
|
throw new Error("useChat must be used within a ChatContext");
|
|
3649
3649
|
return u;
|
|
@@ -3976,8 +3976,8 @@ const xe = (u, D) => {
|
|
|
3976
3976
|
}
|
|
3977
3977
|
};
|
|
3978
3978
|
return /* @__PURE__ */ a.jsx(A1.Provider, { value: { colors: f() }, children: u });
|
|
3979
|
-
},
|
|
3980
|
-
const u =
|
|
3979
|
+
}, ou = () => {
|
|
3980
|
+
const u = Yu(A1);
|
|
3981
3981
|
if (!u)
|
|
3982
3982
|
throw new Error("useColors must be used within a ColorProvider");
|
|
3983
3983
|
return u;
|
|
@@ -4013,10 +4013,10 @@ const xe = (u, D) => {
|
|
|
4013
4013
|
onChatWithStaff: u,
|
|
4014
4014
|
onSendNoticeToStaff: D
|
|
4015
4015
|
}) => {
|
|
4016
|
-
const [f, e] =
|
|
4016
|
+
const [f, e] = z(!1), t = pu(null), { socket: n } = Wu();
|
|
4017
4017
|
Uu();
|
|
4018
|
-
const { send: r } =
|
|
4019
|
-
Ou(),
|
|
4018
|
+
const { send: r } = Cu();
|
|
4019
|
+
Ou(), J(() => {
|
|
4020
4020
|
const F = (o) => {
|
|
4021
4021
|
t.current && !t.current.contains(o.target) && e(!1);
|
|
4022
4022
|
};
|
|
@@ -4025,15 +4025,15 @@ const xe = (u, D) => {
|
|
|
4025
4025
|
};
|
|
4026
4026
|
}, []);
|
|
4027
4027
|
const s = async (F) => {
|
|
4028
|
-
F.preventDefault();
|
|
4028
|
+
F.preventDefault(), F.stopPropagation();
|
|
4029
4029
|
try {
|
|
4030
|
-
const o =
|
|
4030
|
+
const o = uu.getItem("profileLiveChat");
|
|
4031
4031
|
if (!o) {
|
|
4032
4032
|
console.error("No profile found in localStorage");
|
|
4033
4033
|
return;
|
|
4034
4034
|
}
|
|
4035
4035
|
r({
|
|
4036
|
-
event:
|
|
4036
|
+
event: F,
|
|
4037
4037
|
source: "staff-notice",
|
|
4038
4038
|
data: {
|
|
4039
4039
|
type: Au.notify,
|
|
@@ -4053,7 +4053,6 @@ const xe = (u, D) => {
|
|
|
4053
4053
|
{
|
|
4054
4054
|
className: "staff-menu-toggle",
|
|
4055
4055
|
onClick: () => e(!f),
|
|
4056
|
-
onMouseEnter: () => e(!0),
|
|
4057
4056
|
children: /* @__PURE__ */ a.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
4058
4057
|
/* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "6", r: "2" }),
|
|
4059
4058
|
/* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "12", r: "2" }),
|
|
@@ -4071,7 +4070,7 @@ const xe = (u, D) => {
|
|
|
4071
4070
|
) })
|
|
4072
4071
|
] });
|
|
4073
4072
|
}, $e = ({ children: u }) => {
|
|
4074
|
-
const D = Bu(), { colors: f } =
|
|
4073
|
+
const D = Bu(), { colors: f } = ou(), e = Nu();
|
|
4075
4074
|
return /* @__PURE__ */ a.jsxs(
|
|
4076
4075
|
"div",
|
|
4077
4076
|
{
|
|
@@ -4210,7 +4209,7 @@ const xe = (u, D) => {
|
|
|
4210
4209
|
]
|
|
4211
4210
|
}
|
|
4212
4211
|
), ze = () => {
|
|
4213
|
-
const { t: u } = Ou(), { connectionState: D, setConnectionState: f } =
|
|
4212
|
+
const { t: u } = Ou(), { connectionState: D, setConnectionState: f } = Cu(), { colors: e } = ou(), t = () => {
|
|
4214
4213
|
D === 0 && f(1);
|
|
4215
4214
|
}, n = D > 0;
|
|
4216
4215
|
return /* @__PURE__ */ a.jsx(
|
|
@@ -4245,238 +4244,238 @@ const xe = (u, D) => {
|
|
|
4245
4244
|
}
|
|
4246
4245
|
);
|
|
4247
4246
|
};
|
|
4248
|
-
var zD = { exports: {} },
|
|
4247
|
+
var zD = { exports: {} }, Hf;
|
|
4249
4248
|
function j1() {
|
|
4250
|
-
return
|
|
4249
|
+
return Hf || (Hf = 1, function(u, D) {
|
|
4251
4250
|
(function(f, e) {
|
|
4252
4251
|
u.exports = e();
|
|
4253
4252
|
})(dD, function() {
|
|
4254
|
-
var f = 1e3, e = 6e4, t = 36e5, n = "millisecond", r = "second", s = "minute", F = "hour", o = "day", d = "week", c = "month", l = "quarter", j = "year",
|
|
4255
|
-
var E = ["th", "st", "nd", "rd"], h =
|
|
4256
|
-
return "[" +
|
|
4257
|
-
} },
|
|
4258
|
-
var
|
|
4259
|
-
return !
|
|
4260
|
-
},
|
|
4261
|
-
var E = -
|
|
4262
|
-
return (E <= 0 ? "+" : "-") +
|
|
4263
|
-
}, m: function
|
|
4264
|
-
if (E.date() < h.date()) return -
|
|
4265
|
-
var
|
|
4266
|
-
return +(-(
|
|
4267
|
-
}, a: function(
|
|
4268
|
-
return
|
|
4269
|
-
}, p: function(
|
|
4270
|
-
return { M: c, y: j, w: d, d: o, D:
|
|
4271
|
-
}, u: function(
|
|
4272
|
-
return
|
|
4273
|
-
} },
|
|
4274
|
-
|
|
4275
|
-
var
|
|
4276
|
-
return
|
|
4277
|
-
},
|
|
4278
|
-
var
|
|
4279
|
-
if (!E) return
|
|
4253
|
+
var f = 1e3, e = 6e4, t = 36e5, n = "millisecond", r = "second", s = "minute", F = "hour", o = "day", d = "week", c = "month", l = "quarter", j = "year", y = "date", C = "Invalid Date", T = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, N = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, B = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(S) {
|
|
4254
|
+
var E = ["th", "st", "nd", "rd"], h = S % 100;
|
|
4255
|
+
return "[" + S + (E[(h - 20) % 10] || E[h] || E[0]) + "]";
|
|
4256
|
+
} }, $ = function(S, E, h) {
|
|
4257
|
+
var k = String(S);
|
|
4258
|
+
return !k || k.length >= E ? S : "" + Array(E + 1 - k.length).join(h) + S;
|
|
4259
|
+
}, _ = { s: $, z: function(S) {
|
|
4260
|
+
var E = -S.utcOffset(), h = Math.abs(E), k = Math.floor(h / 60), g = h % 60;
|
|
4261
|
+
return (E <= 0 ? "+" : "-") + $(k, 2, "0") + ":" + $(g, 2, "0");
|
|
4262
|
+
}, m: function S(E, h) {
|
|
4263
|
+
if (E.date() < h.date()) return -S(h, E);
|
|
4264
|
+
var k = 12 * (h.year() - E.year()) + (h.month() - E.month()), g = E.clone().add(k, c), I = h - g < 0, P = E.clone().add(k + (I ? -1 : 1), c);
|
|
4265
|
+
return +(-(k + (h - g) / (I ? g - P : P - g)) || 0);
|
|
4266
|
+
}, a: function(S) {
|
|
4267
|
+
return S < 0 ? Math.ceil(S) || 0 : Math.floor(S);
|
|
4268
|
+
}, p: function(S) {
|
|
4269
|
+
return { M: c, y: j, w: d, d: o, D: y, h: F, m: s, s: r, ms: n, Q: l }[S] || String(S || "").toLowerCase().replace(/s$/, "");
|
|
4270
|
+
}, u: function(S) {
|
|
4271
|
+
return S === void 0;
|
|
4272
|
+
} }, p = "en", R = {};
|
|
4273
|
+
R[p] = B;
|
|
4274
|
+
var x = "$isDayjsObject", V = function(S) {
|
|
4275
|
+
return S instanceof hu || !(!S || !S[x]);
|
|
4276
|
+
}, m = function S(E, h, k) {
|
|
4277
|
+
var g;
|
|
4278
|
+
if (!E) return p;
|
|
4280
4279
|
if (typeof E == "string") {
|
|
4281
4280
|
var I = E.toLowerCase();
|
|
4282
|
-
|
|
4283
|
-
var
|
|
4284
|
-
if (!
|
|
4281
|
+
R[I] && (g = I), h && (R[I] = h, g = I);
|
|
4282
|
+
var P = E.split("-");
|
|
4283
|
+
if (!g && P.length > 1) return S(P[0]);
|
|
4285
4284
|
} else {
|
|
4286
4285
|
var M = E.name;
|
|
4287
|
-
|
|
4286
|
+
R[M] = E, g = M;
|
|
4288
4287
|
}
|
|
4289
|
-
return !
|
|
4290
|
-
},
|
|
4291
|
-
if (
|
|
4288
|
+
return !k && g && (p = g), g || !k && p;
|
|
4289
|
+
}, A = function(S, E) {
|
|
4290
|
+
if (V(S)) return S.clone();
|
|
4292
4291
|
var h = typeof E == "object" ? E : {};
|
|
4293
|
-
return h.date =
|
|
4294
|
-
},
|
|
4295
|
-
|
|
4296
|
-
return
|
|
4292
|
+
return h.date = S, h.args = arguments, new hu(h);
|
|
4293
|
+
}, v = _;
|
|
4294
|
+
v.l = m, v.i = V, v.w = function(S, E) {
|
|
4295
|
+
return A(S, { locale: E.$L, utc: E.$u, x: E.$x, $offset: E.$offset });
|
|
4297
4296
|
};
|
|
4298
|
-
var
|
|
4299
|
-
function
|
|
4300
|
-
this.$L =
|
|
4297
|
+
var hu = function() {
|
|
4298
|
+
function S(h) {
|
|
4299
|
+
this.$L = m(h.locale, null, !0), this.parse(h), this.$x = this.$x || h.x || {}, this[x] = !0;
|
|
4301
4300
|
}
|
|
4302
|
-
var E =
|
|
4301
|
+
var E = S.prototype;
|
|
4303
4302
|
return E.parse = function(h) {
|
|
4304
|
-
this.$d = function(
|
|
4305
|
-
var
|
|
4306
|
-
if (
|
|
4307
|
-
if (
|
|
4308
|
-
if (
|
|
4309
|
-
if (typeof
|
|
4310
|
-
var
|
|
4311
|
-
if (
|
|
4312
|
-
var M =
|
|
4313
|
-
return I ? new Date(Date.UTC(
|
|
4303
|
+
this.$d = function(k) {
|
|
4304
|
+
var g = k.date, I = k.utc;
|
|
4305
|
+
if (g === null) return /* @__PURE__ */ new Date(NaN);
|
|
4306
|
+
if (v.u(g)) return /* @__PURE__ */ new Date();
|
|
4307
|
+
if (g instanceof Date) return new Date(g);
|
|
4308
|
+
if (typeof g == "string" && !/Z$/i.test(g)) {
|
|
4309
|
+
var P = g.match(T);
|
|
4310
|
+
if (P) {
|
|
4311
|
+
var M = P[2] - 1 || 0, U = (P[7] || "0").substring(0, 3);
|
|
4312
|
+
return I ? new Date(Date.UTC(P[1], M, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, U)) : new Date(P[1], M, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, U);
|
|
4314
4313
|
}
|
|
4315
4314
|
}
|
|
4316
|
-
return new Date(
|
|
4315
|
+
return new Date(g);
|
|
4317
4316
|
}(h), this.init();
|
|
4318
4317
|
}, E.init = function() {
|
|
4319
4318
|
var h = this.$d;
|
|
4320
4319
|
this.$y = h.getFullYear(), this.$M = h.getMonth(), this.$D = h.getDate(), this.$W = h.getDay(), this.$H = h.getHours(), this.$m = h.getMinutes(), this.$s = h.getSeconds(), this.$ms = h.getMilliseconds();
|
|
4321
4320
|
}, E.$utils = function() {
|
|
4322
|
-
return
|
|
4321
|
+
return v;
|
|
4323
4322
|
}, E.isValid = function() {
|
|
4324
4323
|
return this.$d.toString() !== C;
|
|
4325
|
-
}, E.isSame = function(h,
|
|
4326
|
-
var
|
|
4327
|
-
return this.startOf(
|
|
4328
|
-
}, E.isAfter = function(h,
|
|
4329
|
-
return
|
|
4330
|
-
}, E.isBefore = function(h,
|
|
4331
|
-
return this.endOf(
|
|
4332
|
-
}, E.$g = function(h,
|
|
4333
|
-
return
|
|
4324
|
+
}, E.isSame = function(h, k) {
|
|
4325
|
+
var g = A(h);
|
|
4326
|
+
return this.startOf(k) <= g && g <= this.endOf(k);
|
|
4327
|
+
}, E.isAfter = function(h, k) {
|
|
4328
|
+
return A(h) < this.startOf(k);
|
|
4329
|
+
}, E.isBefore = function(h, k) {
|
|
4330
|
+
return this.endOf(k) < A(h);
|
|
4331
|
+
}, E.$g = function(h, k, g) {
|
|
4332
|
+
return v.u(h) ? this[k] : this.set(g, h);
|
|
4334
4333
|
}, E.unix = function() {
|
|
4335
4334
|
return Math.floor(this.valueOf() / 1e3);
|
|
4336
4335
|
}, E.valueOf = function() {
|
|
4337
4336
|
return this.$d.getTime();
|
|
4338
|
-
}, E.startOf = function(h,
|
|
4339
|
-
var
|
|
4340
|
-
var
|
|
4341
|
-
return I ?
|
|
4342
|
-
},
|
|
4343
|
-
return
|
|
4344
|
-
},
|
|
4345
|
-
switch (
|
|
4337
|
+
}, E.startOf = function(h, k) {
|
|
4338
|
+
var g = this, I = !!v.u(k) || k, P = v.p(h), M = function(gu, ru) {
|
|
4339
|
+
var du = v.w(g.$u ? Date.UTC(g.$y, ru, gu) : new Date(g.$y, ru, gu), g);
|
|
4340
|
+
return I ? du : du.endOf(o);
|
|
4341
|
+
}, U = function(gu, ru) {
|
|
4342
|
+
return v.w(g.toDate()[gu].apply(g.toDate("s"), (I ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ru)), g);
|
|
4343
|
+
}, G = this.$W, q = this.$M, Z = this.$D, tu = "set" + (this.$u ? "UTC" : "");
|
|
4344
|
+
switch (P) {
|
|
4346
4345
|
case j:
|
|
4347
4346
|
return I ? M(1, 0) : M(31, 11);
|
|
4348
4347
|
case c:
|
|
4349
4348
|
return I ? M(1, q) : M(0, q + 1);
|
|
4350
4349
|
case d:
|
|
4351
|
-
var
|
|
4352
|
-
return M(I ?
|
|
4350
|
+
var cu = this.$locale().weekStart || 0, _u = (G < cu ? G + 7 : G) - cu;
|
|
4351
|
+
return M(I ? Z - _u : Z + (6 - _u), q);
|
|
4353
4352
|
case o:
|
|
4354
|
-
case
|
|
4355
|
-
return
|
|
4353
|
+
case y:
|
|
4354
|
+
return U(tu + "Hours", 0);
|
|
4356
4355
|
case F:
|
|
4357
|
-
return
|
|
4356
|
+
return U(tu + "Minutes", 1);
|
|
4358
4357
|
case s:
|
|
4359
|
-
return
|
|
4358
|
+
return U(tu + "Seconds", 2);
|
|
4360
4359
|
case r:
|
|
4361
|
-
return
|
|
4360
|
+
return U(tu + "Milliseconds", 3);
|
|
4362
4361
|
default:
|
|
4363
4362
|
return this.clone();
|
|
4364
4363
|
}
|
|
4365
4364
|
}, E.endOf = function(h) {
|
|
4366
4365
|
return this.startOf(h, !1);
|
|
4367
|
-
}, E.$set = function(h,
|
|
4368
|
-
var
|
|
4366
|
+
}, E.$set = function(h, k) {
|
|
4367
|
+
var g, I = v.p(h), P = "set" + (this.$u ? "UTC" : ""), M = (g = {}, g[o] = P + "Date", g[y] = P + "Date", g[c] = P + "Month", g[j] = P + "FullYear", g[F] = P + "Hours", g[s] = P + "Minutes", g[r] = P + "Seconds", g[n] = P + "Milliseconds", g)[I], U = I === o ? this.$D + (k - this.$W) : k;
|
|
4369
4368
|
if (I === c || I === j) {
|
|
4370
|
-
var
|
|
4371
|
-
|
|
4372
|
-
} else M && this.$d[M](
|
|
4369
|
+
var G = this.clone().set(y, 1);
|
|
4370
|
+
G.$d[M](U), G.init(), this.$d = G.set(y, Math.min(this.$D, G.daysInMonth())).$d;
|
|
4371
|
+
} else M && this.$d[M](U);
|
|
4373
4372
|
return this.init(), this;
|
|
4374
|
-
}, E.set = function(h,
|
|
4375
|
-
return this.clone().$set(h,
|
|
4373
|
+
}, E.set = function(h, k) {
|
|
4374
|
+
return this.clone().$set(h, k);
|
|
4376
4375
|
}, E.get = function(h) {
|
|
4377
|
-
return this[
|
|
4378
|
-
}, E.add = function(h,
|
|
4379
|
-
var
|
|
4376
|
+
return this[v.p(h)]();
|
|
4377
|
+
}, E.add = function(h, k) {
|
|
4378
|
+
var g, I = this;
|
|
4380
4379
|
h = Number(h);
|
|
4381
|
-
var
|
|
4382
|
-
var
|
|
4383
|
-
return
|
|
4380
|
+
var P = v.p(k), M = function(q) {
|
|
4381
|
+
var Z = A(I);
|
|
4382
|
+
return v.w(Z.date(Z.date() + Math.round(q * h)), I);
|
|
4384
4383
|
};
|
|
4385
|
-
if (
|
|
4386
|
-
if (
|
|
4387
|
-
if (
|
|
4388
|
-
if (
|
|
4389
|
-
var
|
|
4390
|
-
return
|
|
4391
|
-
}, E.subtract = function(h,
|
|
4392
|
-
return this.add(-1 * h,
|
|
4384
|
+
if (P === c) return this.set(c, this.$M + h);
|
|
4385
|
+
if (P === j) return this.set(j, this.$y + h);
|
|
4386
|
+
if (P === o) return M(1);
|
|
4387
|
+
if (P === d) return M(7);
|
|
4388
|
+
var U = (g = {}, g[s] = e, g[F] = t, g[r] = f, g)[P] || 1, G = this.$d.getTime() + h * U;
|
|
4389
|
+
return v.w(G, this);
|
|
4390
|
+
}, E.subtract = function(h, k) {
|
|
4391
|
+
return this.add(-1 * h, k);
|
|
4393
4392
|
}, E.format = function(h) {
|
|
4394
|
-
var
|
|
4395
|
-
if (!this.isValid()) return
|
|
4396
|
-
var I = h || "YYYY-MM-DDTHH:mm:ssZ",
|
|
4397
|
-
return
|
|
4398
|
-
}, _u = function(
|
|
4399
|
-
return
|
|
4400
|
-
}, gu =
|
|
4401
|
-
var Lu =
|
|
4393
|
+
var k = this, g = this.$locale();
|
|
4394
|
+
if (!this.isValid()) return g.invalidDate || C;
|
|
4395
|
+
var I = h || "YYYY-MM-DDTHH:mm:ssZ", P = v.z(this), M = this.$H, U = this.$m, G = this.$M, q = g.weekdays, Z = g.months, tu = g.meridiem, cu = function(ru, du, Iu, Lu) {
|
|
4396
|
+
return ru && (ru[du] || ru(k, I)) || Iu[du].slice(0, Lu);
|
|
4397
|
+
}, _u = function(ru) {
|
|
4398
|
+
return v.s(M % 12 || 12, ru, "0");
|
|
4399
|
+
}, gu = tu || function(ru, du, Iu) {
|
|
4400
|
+
var Lu = ru < 12 ? "AM" : "PM";
|
|
4402
4401
|
return Iu ? Lu.toLowerCase() : Lu;
|
|
4403
4402
|
};
|
|
4404
|
-
return I.replace(
|
|
4405
|
-
return
|
|
4403
|
+
return I.replace(N, function(ru, du) {
|
|
4404
|
+
return du || function(Iu) {
|
|
4406
4405
|
switch (Iu) {
|
|
4407
4406
|
case "YY":
|
|
4408
|
-
return String(
|
|
4407
|
+
return String(k.$y).slice(-2);
|
|
4409
4408
|
case "YYYY":
|
|
4410
|
-
return
|
|
4409
|
+
return v.s(k.$y, 4, "0");
|
|
4411
4410
|
case "M":
|
|
4412
|
-
return
|
|
4411
|
+
return G + 1;
|
|
4413
4412
|
case "MM":
|
|
4414
|
-
return
|
|
4413
|
+
return v.s(G + 1, 2, "0");
|
|
4415
4414
|
case "MMM":
|
|
4416
|
-
return
|
|
4415
|
+
return cu(g.monthsShort, G, Z, 3);
|
|
4417
4416
|
case "MMMM":
|
|
4418
|
-
return
|
|
4417
|
+
return cu(Z, G);
|
|
4419
4418
|
case "D":
|
|
4420
|
-
return
|
|
4419
|
+
return k.$D;
|
|
4421
4420
|
case "DD":
|
|
4422
|
-
return
|
|
4421
|
+
return v.s(k.$D, 2, "0");
|
|
4423
4422
|
case "d":
|
|
4424
|
-
return String(
|
|
4423
|
+
return String(k.$W);
|
|
4425
4424
|
case "dd":
|
|
4426
|
-
return
|
|
4425
|
+
return cu(g.weekdaysMin, k.$W, q, 2);
|
|
4427
4426
|
case "ddd":
|
|
4428
|
-
return
|
|
4427
|
+
return cu(g.weekdaysShort, k.$W, q, 3);
|
|
4429
4428
|
case "dddd":
|
|
4430
|
-
return q[
|
|
4429
|
+
return q[k.$W];
|
|
4431
4430
|
case "H":
|
|
4432
4431
|
return String(M);
|
|
4433
4432
|
case "HH":
|
|
4434
|
-
return
|
|
4433
|
+
return v.s(M, 2, "0");
|
|
4435
4434
|
case "h":
|
|
4436
4435
|
return _u(1);
|
|
4437
4436
|
case "hh":
|
|
4438
4437
|
return _u(2);
|
|
4439
4438
|
case "a":
|
|
4440
|
-
return gu(M,
|
|
4439
|
+
return gu(M, U, !0);
|
|
4441
4440
|
case "A":
|
|
4442
|
-
return gu(M,
|
|
4441
|
+
return gu(M, U, !1);
|
|
4443
4442
|
case "m":
|
|
4444
|
-
return String(
|
|
4443
|
+
return String(U);
|
|
4445
4444
|
case "mm":
|
|
4446
|
-
return
|
|
4445
|
+
return v.s(U, 2, "0");
|
|
4447
4446
|
case "s":
|
|
4448
|
-
return String(
|
|
4447
|
+
return String(k.$s);
|
|
4449
4448
|
case "ss":
|
|
4450
|
-
return
|
|
4449
|
+
return v.s(k.$s, 2, "0");
|
|
4451
4450
|
case "SSS":
|
|
4452
|
-
return
|
|
4451
|
+
return v.s(k.$ms, 3, "0");
|
|
4453
4452
|
case "Z":
|
|
4454
|
-
return
|
|
4453
|
+
return P;
|
|
4455
4454
|
}
|
|
4456
4455
|
return null;
|
|
4457
|
-
}(
|
|
4456
|
+
}(ru) || P.replace(":", "");
|
|
4458
4457
|
});
|
|
4459
4458
|
}, E.utcOffset = function() {
|
|
4460
4459
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
4461
|
-
}, E.diff = function(h,
|
|
4462
|
-
var I,
|
|
4463
|
-
return
|
|
4460
|
+
}, E.diff = function(h, k, g) {
|
|
4461
|
+
var I, P = this, M = v.p(k), U = A(h), G = (U.utcOffset() - this.utcOffset()) * e, q = this - U, Z = function() {
|
|
4462
|
+
return v.m(P, U);
|
|
4464
4463
|
};
|
|
4465
4464
|
switch (M) {
|
|
4466
4465
|
case j:
|
|
4467
|
-
I =
|
|
4466
|
+
I = Z() / 12;
|
|
4468
4467
|
break;
|
|
4469
4468
|
case c:
|
|
4470
|
-
I =
|
|
4469
|
+
I = Z();
|
|
4471
4470
|
break;
|
|
4472
4471
|
case l:
|
|
4473
|
-
I =
|
|
4472
|
+
I = Z() / 3;
|
|
4474
4473
|
break;
|
|
4475
4474
|
case d:
|
|
4476
|
-
I = (q -
|
|
4475
|
+
I = (q - G) / 6048e5;
|
|
4477
4476
|
break;
|
|
4478
4477
|
case o:
|
|
4479
|
-
I = (q -
|
|
4478
|
+
I = (q - G) / 864e5;
|
|
4480
4479
|
break;
|
|
4481
4480
|
case F:
|
|
4482
4481
|
I = q / t;
|
|
@@ -4490,17 +4489,17 @@ function j1() {
|
|
|
4490
4489
|
default:
|
|
4491
4490
|
I = q;
|
|
4492
4491
|
}
|
|
4493
|
-
return
|
|
4492
|
+
return g ? I : v.a(I);
|
|
4494
4493
|
}, E.daysInMonth = function() {
|
|
4495
4494
|
return this.endOf(c).$D;
|
|
4496
4495
|
}, E.$locale = function() {
|
|
4497
|
-
return
|
|
4498
|
-
}, E.locale = function(h,
|
|
4496
|
+
return R[this.$L];
|
|
4497
|
+
}, E.locale = function(h, k) {
|
|
4499
4498
|
if (!h) return this.$L;
|
|
4500
|
-
var
|
|
4501
|
-
return I && (
|
|
4499
|
+
var g = this.clone(), I = m(h, k, !0);
|
|
4500
|
+
return I && (g.$L = I), g;
|
|
4502
4501
|
}, E.clone = function() {
|
|
4503
|
-
return
|
|
4502
|
+
return v.w(this.$d, this);
|
|
4504
4503
|
}, E.toDate = function() {
|
|
4505
4504
|
return new Date(this.valueOf());
|
|
4506
4505
|
}, E.toJSON = function() {
|
|
@@ -4509,17 +4508,17 @@ function j1() {
|
|
|
4509
4508
|
return this.$d.toISOString();
|
|
4510
4509
|
}, E.toString = function() {
|
|
4511
4510
|
return this.$d.toUTCString();
|
|
4512
|
-
},
|
|
4513
|
-
}(),
|
|
4514
|
-
return
|
|
4515
|
-
|
|
4516
|
-
return this.$g(E,
|
|
4511
|
+
}, S;
|
|
4512
|
+
}(), fu = hu.prototype;
|
|
4513
|
+
return A.prototype = fu, [["$ms", n], ["$s", r], ["$m", s], ["$H", F], ["$W", o], ["$M", c], ["$y", j], ["$D", y]].forEach(function(S) {
|
|
4514
|
+
fu[S[1]] = function(E) {
|
|
4515
|
+
return this.$g(E, S[0], S[1]);
|
|
4517
4516
|
};
|
|
4518
|
-
}),
|
|
4519
|
-
return
|
|
4520
|
-
},
|
|
4521
|
-
return
|
|
4522
|
-
},
|
|
4517
|
+
}), A.extend = function(S, E) {
|
|
4518
|
+
return S.$i || (S(E, hu, A), S.$i = !0), A;
|
|
4519
|
+
}, A.locale = m, A.isDayjs = V, A.unix = function(S) {
|
|
4520
|
+
return A(1e3 * S);
|
|
4521
|
+
}, A.en = R[p], A.Ls = R, A.p = {}, A;
|
|
4523
4522
|
});
|
|
4524
4523
|
}(zD)), zD.exports;
|
|
4525
4524
|
}
|
|
@@ -4536,7 +4535,7 @@ var Ve = { exports: {} };
|
|
|
4536
4535
|
} };
|
|
4537
4536
|
});
|
|
4538
4537
|
})(Ve);
|
|
4539
|
-
var
|
|
4538
|
+
var He = { exports: {} };
|
|
4540
4539
|
(function(u, D) {
|
|
4541
4540
|
(function(f, e) {
|
|
4542
4541
|
u.exports = e(j1());
|
|
@@ -4549,7 +4548,7 @@ var We = { exports: {} };
|
|
|
4549
4548
|
} };
|
|
4550
4549
|
return t.default.locale(n, null, !0), n;
|
|
4551
4550
|
});
|
|
4552
|
-
})(
|
|
4551
|
+
})(He);
|
|
4553
4552
|
var T1 = { exports: {} };
|
|
4554
4553
|
(function(u, D) {
|
|
4555
4554
|
(function(f, e) {
|
|
@@ -4562,20 +4561,20 @@ var T1 = { exports: {} };
|
|
|
4562
4561
|
return n.fromToBase(o, d, c, l);
|
|
4563
4562
|
}
|
|
4564
4563
|
t.en.relativeTime = r, n.fromToBase = function(o, d, c, l, j) {
|
|
4565
|
-
for (var
|
|
4566
|
-
var
|
|
4567
|
-
|
|
4568
|
-
var
|
|
4569
|
-
if (
|
|
4570
|
-
|
|
4571
|
-
var
|
|
4572
|
-
j && (
|
|
4564
|
+
for (var y, C, T, N = c.$locale().relativeTime || r, B = f.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], $ = B.length, _ = 0; _ < $; _ += 1) {
|
|
4565
|
+
var p = B[_];
|
|
4566
|
+
p.d && (y = l ? t(o).diff(c, p.d, !0) : c.diff(o, p.d, !0));
|
|
4567
|
+
var R = (f.rounding || Math.round)(Math.abs(y));
|
|
4568
|
+
if (T = y > 0, R <= p.r || !p.r) {
|
|
4569
|
+
R <= 1 && _ > 0 && (p = B[_ - 1]);
|
|
4570
|
+
var x = N[p.l];
|
|
4571
|
+
j && (R = j("" + R)), C = typeof x == "string" ? x.replace("%d", R) : x(R, d, p.l, T);
|
|
4573
4572
|
break;
|
|
4574
4573
|
}
|
|
4575
4574
|
}
|
|
4576
4575
|
if (d) return C;
|
|
4577
|
-
var
|
|
4578
|
-
return typeof
|
|
4576
|
+
var V = T ? N.future : N.past;
|
|
4577
|
+
return typeof V == "function" ? V(C) : V.replace("%s", C);
|
|
4579
4578
|
}, n.to = function(o, d) {
|
|
4580
4579
|
return s(o, d, this, !0);
|
|
4581
4580
|
}, n.from = function(o, d) {
|
|
@@ -4592,8 +4591,8 @@ var T1 = { exports: {} };
|
|
|
4592
4591
|
};
|
|
4593
4592
|
});
|
|
4594
4593
|
})(T1);
|
|
4595
|
-
var
|
|
4596
|
-
const Ye = /* @__PURE__ */ Ff(
|
|
4594
|
+
var We = T1.exports;
|
|
4595
|
+
const Ye = /* @__PURE__ */ Ff(We), N1 = ({
|
|
4597
4596
|
width: u = "18",
|
|
4598
4597
|
height: D = "18",
|
|
4599
4598
|
...f
|
|
@@ -4659,7 +4658,7 @@ const Ye = /* @__PURE__ */ Ff(He), N1 = ({
|
|
|
4659
4658
|
] })
|
|
4660
4659
|
}
|
|
4661
4660
|
), vD = ({ message: u }) => {
|
|
4662
|
-
const { setPayload: D, send: f, setWebviewUrl: e } =
|
|
4661
|
+
const { setPayload: D, send: f, setWebviewUrl: e } = Cu(), t = Bu(), { colors: n } = ou(), r = (s, F) => {
|
|
4663
4662
|
F.type === "web_url" && F.url ? F.messenger_extensions ? e(F.url) : window.open(F.url, "_blank") : F.type === "postback" && (D({ text: F.title, payload: F.payload }), f({
|
|
4664
4663
|
event: s,
|
|
4665
4664
|
source: "post-back",
|
|
@@ -4719,7 +4718,7 @@ const Ye = /* @__PURE__ */ Ff(He), N1 = ({
|
|
|
4719
4718
|
] }) }), Ze = ({
|
|
4720
4719
|
messageCarousel: u
|
|
4721
4720
|
}) => {
|
|
4722
|
-
const { colors: D } =
|
|
4721
|
+
const { colors: D } = ou(), [f, e] = z(0), t = u.data.elements, n = () => {
|
|
4723
4722
|
e(
|
|
4724
4723
|
(o) => (o + t.length - 1) % t.length
|
|
4725
4724
|
);
|
|
@@ -4772,7 +4771,7 @@ const Ye = /* @__PURE__ */ Ff(He), N1 = ({
|
|
|
4772
4771
|
/* @__PURE__ */ a.jsx("path", { d: "M413.94 191.88h-78.77a50.17 50.17 0 01-50.11-50.11V63a15 15 0 0130 0v78.77a20.13 20.13 0 0020.11 20.11h78.77a15 15 0 010 30zM264.4 375a15 15 0 01-10.61-4.4l-54.45-54.44a15 15 0 1121.21-21.22l43.85 43.84 43.84-43.84a15 15 0 1121.21 21.22L275 370.55a15 15 0 01-10.6 4.45z" }),
|
|
4773
4772
|
/* @__PURE__ */ a.jsx("path", { d: "M264.4 365a15 15 0 01-15-15V231a15 15 0 0130 0v119a15 15 0 01-15 15z" })
|
|
4774
4773
|
] }) }), u3 = ({ message: u }) => {
|
|
4775
|
-
const { t: D } = Ou(), { colors: f } =
|
|
4774
|
+
const { t: D } = Ou(), { colors: f } = ou(), e = f[u.direction || Q.received];
|
|
4776
4775
|
if (!("type" in u.data))
|
|
4777
4776
|
throw new Error("Unable to detect type for file message");
|
|
4778
4777
|
if (u.data && u.data.type !== "image" && u.data.type !== "audio" && u.data.type !== "video" && u.data.type !== "file")
|
|
@@ -4823,19 +4822,19 @@ const Ye = /* @__PURE__ */ Ff(He), N1 = ({
|
|
|
4823
4822
|
);
|
|
4824
4823
|
}, D3 = ({ message: u }) => {
|
|
4825
4824
|
var o;
|
|
4826
|
-
const { colors: D } =
|
|
4827
|
-
if (
|
|
4825
|
+
const { colors: D } = ou(), f = Nu(), [e, t] = z(!1), n = pu(null);
|
|
4826
|
+
if (J(() => {
|
|
4828
4827
|
const d = new IntersectionObserver((c) => {
|
|
4829
4828
|
!e && c[0].intersectionRatio > 0 && t(!0);
|
|
4830
4829
|
});
|
|
4831
4830
|
return n.current && d.observe(n.current), () => {
|
|
4832
4831
|
n.current && d.unobserve(n.current);
|
|
4833
4832
|
};
|
|
4834
|
-
}, [e]),
|
|
4833
|
+
}, [e]), J(() => {
|
|
4835
4834
|
e && f && f.scroll > 85 && (f.scroll = 101);
|
|
4836
4835
|
}, [e, f]), !("coordinates" in u.data))
|
|
4837
4836
|
throw new Error("Unable to find coordinates");
|
|
4838
|
-
const r = ((o = u.data) == null ? void 0 : o.coordinates) || { lat: 0, lng: 0 }, s = `https://www.openstreetmap.org/export/embed.html?bbox=${r.lng - 0.1},${r.lat - 0.1},${r.lng + 0.1},${r.lat + 0.1}&layer=mapnik&marker=${r.lat},${r.lng}`, F = D[u.direction ||
|
|
4837
|
+
const r = ((o = u.data) == null ? void 0 : o.coordinates) || { lat: 0, lng: 0 }, s = `https://www.openstreetmap.org/export/embed.html?bbox=${r.lng - 0.1},${r.lat - 0.1},${r.lng + 0.1},${r.lat + 0.1}&layer=mapnik&marker=${r.lat},${r.lng}`, F = D[u.direction || Q.received];
|
|
4839
4838
|
return /* @__PURE__ */ a.jsx(
|
|
4840
4839
|
"div",
|
|
4841
4840
|
{
|
|
@@ -4860,13 +4859,13 @@ const Ye = /* @__PURE__ */ Ff(He), N1 = ({
|
|
|
4860
4859
|
}
|
|
4861
4860
|
);
|
|
4862
4861
|
}, f3 = ({ messageList: u }) => {
|
|
4863
|
-
const { colors: D } =
|
|
4862
|
+
const { colors: D } = ou(), f = (r) => {
|
|
4864
4863
|
let s = e(r, 50);
|
|
4865
4864
|
return s = t(r), s;
|
|
4866
4865
|
}, e = (r, s = 100) => r.length > s ? r.substr(0, s) + "..." : r, t = (r) => r.replace(/\n/g, "<br />");
|
|
4867
4866
|
if (!("elements" in u.data))
|
|
4868
4867
|
throw new Error("Unable to find elements");
|
|
4869
|
-
const n = D[u.direction ||
|
|
4868
|
+
const n = D[u.direction || Q.received];
|
|
4870
4869
|
return /* @__PURE__ */ a.jsxs(
|
|
4871
4870
|
"div",
|
|
4872
4871
|
{
|
|
@@ -4947,14 +4946,14 @@ function CD(u, D) {
|
|
|
4947
4946
|
}
|
|
4948
4947
|
u.prototype = D === null ? Object.create(D) : (f.prototype = D.prototype, new f());
|
|
4949
4948
|
}
|
|
4950
|
-
var
|
|
4951
|
-
return
|
|
4949
|
+
var iu = function() {
|
|
4950
|
+
return iu = Object.assign || function(D) {
|
|
4952
4951
|
for (var f, e = 1, t = arguments.length; e < t; e++) {
|
|
4953
4952
|
f = arguments[e];
|
|
4954
4953
|
for (var n in f) Object.prototype.hasOwnProperty.call(f, n) && (D[n] = f[n]);
|
|
4955
4954
|
}
|
|
4956
4955
|
return D;
|
|
4957
|
-
},
|
|
4956
|
+
}, iu.apply(this, arguments);
|
|
4958
4957
|
};
|
|
4959
4958
|
function e3(u, D) {
|
|
4960
4959
|
var f = typeof Symbol == "function" && u[Symbol.iterator];
|
|
@@ -4986,7 +4985,7 @@ function a3(u, D, f) {
|
|
|
4986
4985
|
var e;
|
|
4987
4986
|
return u.length > D && (f == null ? (f = "…", e = 3) : e = f.length, u = u.substring(0, D - e) + f), u;
|
|
4988
4987
|
}
|
|
4989
|
-
function
|
|
4988
|
+
function Ju(u, D) {
|
|
4990
4989
|
for (var f = u.length - 1; f >= 0; f--)
|
|
4991
4990
|
D(u[f]) === !0 && u.splice(f, 1);
|
|
4992
4991
|
}
|
|
@@ -5054,9 +5053,9 @@ function s3(u, D, f) {
|
|
|
5054
5053
|
var n = D - t, r = F3(u);
|
|
5055
5054
|
if (r.query) {
|
|
5056
5055
|
var s = r.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);
|
|
5057
|
-
s && (r.query = r.query.substr(0, s[1].length), u =
|
|
5056
|
+
s && (r.query = r.query.substr(0, s[1].length), u = Wf(r));
|
|
5058
5057
|
}
|
|
5059
|
-
if (u.length <= D || (r.host && (r.host = r.host.replace(/^www\./, ""), u =
|
|
5058
|
+
if (u.length <= D || (r.host && (r.host = r.host.replace(/^www\./, ""), u = Wf(r)), u.length <= D))
|
|
5060
5059
|
return u;
|
|
5061
5060
|
var F = "";
|
|
5062
5061
|
if (r.host && (F += r.host), F.length >= n)
|
|
@@ -5087,14 +5086,14 @@ function s3(u, D, f) {
|
|
|
5087
5086
|
}
|
|
5088
5087
|
if (F.length <= D)
|
|
5089
5088
|
return F;
|
|
5090
|
-
var
|
|
5091
|
-
return n > 0 && (
|
|
5089
|
+
var y = "";
|
|
5090
|
+
return n > 0 && (y = F.substr(-1 * Math.floor(n / 2))), (F.substr(0, Math.ceil(n / 2)) + f + y).substr(0, n + e);
|
|
5092
5091
|
}
|
|
5093
5092
|
function F3(u) {
|
|
5094
5093
|
var D = {}, f = u, e = f.match(/^([a-z]+):\/\//i);
|
|
5095
5094
|
return e && (D.scheme = e[1], f = f.slice(e[0].length)), e = f.match(/^(.*?)(?=(\?|#|\/|$))/i), e && (D.host = e[1], f = f.slice(e[0].length)), e = f.match(/^\/(.*?)(?=(\?|#|$))/i), e && (D.path = e[1], f = f.slice(e[0].length)), e = f.match(/^\?(.*?)(?=(#|$))/i), e && (D.query = e[1], f = f.slice(e[0].length)), e = f.match(/^#(.*?)$/i), e && (D.fragment = e[1]), D;
|
|
5096
5095
|
}
|
|
5097
|
-
function
|
|
5096
|
+
function Wf(u) {
|
|
5098
5097
|
var D = "";
|
|
5099
5098
|
return u.scheme && u.host && (D += u.scheme + "://"), u.host && (D += u.host), u.path && (D += "/" + u.path), u.query && (D += "?" + u.query), u.fragment && (D += "#" + u.fragment), D;
|
|
5100
5099
|
}
|
|
@@ -5174,7 +5173,7 @@ function C3(u) {
|
|
|
5174
5173
|
function rD(u) {
|
|
5175
5174
|
return u >= 65 && u <= 90 || u >= 97 && u <= 122;
|
|
5176
5175
|
}
|
|
5177
|
-
function
|
|
5176
|
+
function Eu(u) {
|
|
5178
5177
|
return u >= 48 && u <= 57;
|
|
5179
5178
|
}
|
|
5180
5179
|
function bf(u) {
|
|
@@ -5203,13 +5202,13 @@ function Yf(u) {
|
|
|
5203
5202
|
}
|
|
5204
5203
|
var h3 = /^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/, P1 = /https?:\/\//i, b3 = new RegExp("^" + P1.source, "i"), p3 = /^(javascript|vbscript):/i, B3 = /^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/, g3 = /^(?:\/\/)?([^/#?:]+)/, oD = rD;
|
|
5205
5204
|
function I1(u) {
|
|
5206
|
-
return rD(u) ||
|
|
5205
|
+
return rD(u) || Eu(u) || u === 43 || // '+'
|
|
5207
5206
|
u === 45 || // '-'
|
|
5208
5207
|
u === 46;
|
|
5209
5208
|
}
|
|
5210
|
-
var
|
|
5209
|
+
var Ku = Qu;
|
|
5211
5210
|
function pf(u) {
|
|
5212
|
-
return u === 95 ||
|
|
5211
|
+
return u === 95 || Ku(u);
|
|
5213
5212
|
}
|
|
5214
5213
|
function L1(u) {
|
|
5215
5214
|
return Qu(u) || l3(u) || R1(u);
|
|
@@ -5388,7 +5387,7 @@ function z1(u) {
|
|
|
5388
5387
|
return u === 45 || // '-'
|
|
5389
5388
|
u === 46 || // '.'
|
|
5390
5389
|
u === 95 || // '_'
|
|
5391
|
-
rD(u) ||
|
|
5390
|
+
rD(u) || Eu(u);
|
|
5392
5391
|
}
|
|
5393
5392
|
function z3(u, D) {
|
|
5394
5393
|
var f = q3[D];
|
|
@@ -5436,7 +5435,7 @@ var U3 = [
|
|
|
5436
5435
|
return e && f.push(e), f;
|
|
5437
5436
|
}, D;
|
|
5438
5437
|
}(cD)
|
|
5439
|
-
),
|
|
5438
|
+
), H3 = /[-. ()]/, W3 = /(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/, Y3 = /(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/, K3 = new RegExp("^".concat(W3.source, "|").concat(Y3.source, "$"));
|
|
5440
5439
|
function U1(u) {
|
|
5441
5440
|
return u === 45 || // '-'
|
|
5442
5441
|
u === 46 || // '.'
|
|
@@ -5447,7 +5446,7 @@ function mf(u) {
|
|
|
5447
5446
|
u === 59;
|
|
5448
5447
|
}
|
|
5449
5448
|
function J3(u) {
|
|
5450
|
-
var D = u.charAt(0) === "+" ||
|
|
5449
|
+
var D = u.charAt(0) === "+" || H3.test(u);
|
|
5451
5450
|
return D && K3.test(u);
|
|
5452
5451
|
}
|
|
5453
5452
|
var G3 = (
|
|
@@ -5644,7 +5643,7 @@ function Z3(u, D) {
|
|
|
5644
5643
|
}
|
|
5645
5644
|
for (var F = f.stateMachines.length - 1; F >= 0; F--)
|
|
5646
5645
|
f.stateMachines.forEach(function(o) {
|
|
5647
|
-
return
|
|
5646
|
+
return eu(f, o);
|
|
5648
5647
|
});
|
|
5649
5648
|
return f.matches;
|
|
5650
5649
|
}
|
|
@@ -5657,7 +5656,7 @@ function jD(u, D, f) {
|
|
|
5657
5656
|
/* State.HashtagHashChar */
|
|
5658
5657
|
));
|
|
5659
5658
|
else if (f === 64)
|
|
5660
|
-
u.addMachine(
|
|
5659
|
+
u.addMachine(H2(
|
|
5661
5660
|
e,
|
|
5662
5661
|
30
|
|
5663
5662
|
/* State.MentionAtChar */
|
|
@@ -5681,7 +5680,7 @@ function jD(u, D, f) {
|
|
|
5681
5680
|
/* State.PhoneNumberOpenParen */
|
|
5682
5681
|
));
|
|
5683
5682
|
else {
|
|
5684
|
-
if (
|
|
5683
|
+
if (Eu(f) && (u.addMachine(VD(
|
|
5685
5684
|
e,
|
|
5686
5685
|
38
|
|
5687
5686
|
/* State.PhoneNumberDigit */
|
|
@@ -5717,47 +5716,47 @@ function u2(u, D, f) {
|
|
|
5717
5716
|
}
|
|
5718
5717
|
function D2(u, D, f) {
|
|
5719
5718
|
var e = u.charIdx;
|
|
5720
|
-
f === 47 ? D.state = 3 : f === 46 ? u.removeMachine(D) :
|
|
5719
|
+
f === 47 ? D.state = 3 : f === 46 ? u.removeMachine(D) : Ku(f) ? (D.state = 5, oD(f) && u.addMachine(SD(
|
|
5721
5720
|
e,
|
|
5722
5721
|
0
|
|
5723
5722
|
/* State.SchemeChar */
|
|
5724
5723
|
))) : u.removeMachine(D);
|
|
5725
5724
|
}
|
|
5726
5725
|
function f2(u, D, f) {
|
|
5727
|
-
f === 47 ? D.state = 4 : L1(f) ? (D.state = 10, D.acceptStateReached = !0) :
|
|
5726
|
+
f === 47 ? D.state = 4 : L1(f) ? (D.state = 10, D.acceptStateReached = !0) : eu(u, D);
|
|
5728
5727
|
}
|
|
5729
5728
|
function e2(u, D, f, e) {
|
|
5730
|
-
e === 47 ? (D.state = 10, D.acceptStateReached = !0) :
|
|
5729
|
+
e === 47 ? (D.state = 10, D.acceptStateReached = !0) : Ku(e) ? (D.state = 5, D.acceptStateReached = !0) : u.removeMachine(D);
|
|
5731
5730
|
}
|
|
5732
5731
|
function t2(u, D, f) {
|
|
5733
5732
|
f === 47 ? D.state = 12 : u.removeMachine(D);
|
|
5734
5733
|
}
|
|
5735
5734
|
function n2(u, D, f) {
|
|
5736
|
-
|
|
5735
|
+
Ku(f) ? D.state = 5 : u.removeMachine(D);
|
|
5737
5736
|
}
|
|
5738
5737
|
function r2(u, D, f) {
|
|
5739
|
-
f === 46 ? D.state = 7 : f === 45 ? D.state = 6 : f === 58 ? D.state = 8 : Bf(f) ? D.state = 10 : pf(f) ||
|
|
5738
|
+
f === 46 ? D.state = 7 : f === 45 ? D.state = 6 : f === 58 ? D.state = 8 : Bf(f) ? D.state = 10 : pf(f) || eu(u, D);
|
|
5740
5739
|
}
|
|
5741
5740
|
function a2(u, D, f, e) {
|
|
5742
|
-
e === 45 || (e === 46 ?
|
|
5741
|
+
e === 45 || (e === 46 ? eu(u, D) : Ku(e) ? D.state = 5 : eu(u, D));
|
|
5743
5742
|
}
|
|
5744
5743
|
function s2(u, D, f, e) {
|
|
5745
|
-
e === 46 ?
|
|
5744
|
+
e === 46 ? eu(u, D) : Ku(e) ? (D.state = 5, D.acceptStateReached = !0) : eu(u, D);
|
|
5746
5745
|
}
|
|
5747
5746
|
function F2(u, D, f) {
|
|
5748
|
-
f === 46 ? D.state = 14 : f === 58 ? D.state = 8 :
|
|
5747
|
+
f === 46 ? D.state = 14 : f === 58 ? D.state = 8 : Eu(f) || (Bf(f) ? D.state = 10 : Qu(f) ? u.removeMachine(D) : eu(u, D));
|
|
5749
5748
|
}
|
|
5750
5749
|
function i2(u, D, f) {
|
|
5751
|
-
|
|
5750
|
+
Eu(f) ? (D.octetsEncountered++, D.octetsEncountered === 4 && (D.acceptStateReached = !0), D.state = 13) : eu(u, D);
|
|
5752
5751
|
}
|
|
5753
5752
|
function o2(u, D, f) {
|
|
5754
|
-
|
|
5753
|
+
Eu(f) ? D.state = 9 : eu(u, D);
|
|
5755
5754
|
}
|
|
5756
5755
|
function d2(u, D, f) {
|
|
5757
|
-
|
|
5756
|
+
Eu(f) || (Bf(f) ? D.state = 10 : eu(u, D));
|
|
5758
5757
|
}
|
|
5759
5758
|
function C2(u, D, f) {
|
|
5760
|
-
L1(f) ||
|
|
5759
|
+
L1(f) || eu(u, D);
|
|
5761
5760
|
}
|
|
5762
5761
|
function c2(u, D, f, e) {
|
|
5763
5762
|
f.toLowerCase() === "a" ? D.state = 16 : uD(u, D, e);
|
|
@@ -5787,65 +5786,65 @@ function g2(u, D, f) {
|
|
|
5787
5786
|
f === 46 || f === 64 ? u.removeMachine(D) : gf(f) ? D.state = 22 : u.removeMachine(D);
|
|
5788
5787
|
}
|
|
5789
5788
|
function m2(u, D, f) {
|
|
5790
|
-
|
|
5789
|
+
Ku(f) ? D.state = 25 : u.removeMachine(D);
|
|
5791
5790
|
}
|
|
5792
5791
|
function _2(u, D, f) {
|
|
5793
|
-
f === 46 ? D.state = 27 : f === 45 ? D.state = 26 : pf(f) ||
|
|
5792
|
+
f === 46 ? D.state = 27 : f === 45 ? D.state = 26 : pf(f) || eu(u, D);
|
|
5794
5793
|
}
|
|
5795
5794
|
function y2(u, D, f) {
|
|
5796
|
-
f === 45 || f === 46 ?
|
|
5795
|
+
f === 45 || f === 46 ? eu(u, D) : pf(f) ? D.state = 25 : eu(u, D);
|
|
5797
5796
|
}
|
|
5798
5797
|
function v2(u, D, f) {
|
|
5799
|
-
f === 46 || f === 45 ?
|
|
5798
|
+
f === 46 || f === 45 ? eu(u, D) : Ku(f) ? (D.state = 25, D.acceptStateReached = !0) : eu(u, D);
|
|
5800
5799
|
}
|
|
5801
5800
|
function w2(u, D, f) {
|
|
5802
5801
|
q1(f) ? (D.state = 29, D.acceptStateReached = !0) : u.removeMachine(D);
|
|
5803
5802
|
}
|
|
5804
5803
|
function A2(u, D, f) {
|
|
5805
|
-
q1(f) ||
|
|
5804
|
+
q1(f) || eu(u, D);
|
|
5806
5805
|
}
|
|
5807
5806
|
function x2(u, D, f) {
|
|
5808
5807
|
z1(f) ? (D.state = 31, D.acceptStateReached = !0) : u.removeMachine(D);
|
|
5809
5808
|
}
|
|
5810
5809
|
function k2(u, D, f) {
|
|
5811
|
-
z1(f) || (Qu(f) ? u.removeMachine(D) :
|
|
5810
|
+
z1(f) || (Qu(f) ? u.removeMachine(D) : eu(u, D));
|
|
5812
5811
|
}
|
|
5813
5812
|
function j2(u, D, f, e) {
|
|
5814
|
-
|
|
5813
|
+
Eu(e) ? D.state = 38 : (u.removeMachine(D), jD(u, f, e));
|
|
5815
5814
|
}
|
|
5816
5815
|
function S2(u, D, f, e) {
|
|
5817
|
-
|
|
5816
|
+
Eu(e) ? D.state = 33 : u.removeMachine(D), jD(u, f, e);
|
|
5818
5817
|
}
|
|
5819
5818
|
function T2(u, D, f) {
|
|
5820
|
-
|
|
5819
|
+
Eu(f) ? D.state = 34 : u.removeMachine(D);
|
|
5821
5820
|
}
|
|
5822
5821
|
function N2(u, D, f) {
|
|
5823
|
-
|
|
5822
|
+
Eu(f) ? D.state = 35 : u.removeMachine(D);
|
|
5824
5823
|
}
|
|
5825
5824
|
function O2(u, D, f) {
|
|
5826
5825
|
f === 41 ? D.state = 36 : u.removeMachine(D);
|
|
5827
5826
|
}
|
|
5828
5827
|
function R2(u, D, f, e) {
|
|
5829
|
-
|
|
5828
|
+
Eu(e) ? D.state = 38 : U1(e) ? D.state = 39 : u.removeMachine(D);
|
|
5830
5829
|
}
|
|
5831
5830
|
function P2(u, D, f, e) {
|
|
5832
5831
|
var t = u.charIdx;
|
|
5833
|
-
D.acceptStateReached = !0, mf(e) ? D.state = 40 : e === 35 ? D.state = 41 :
|
|
5832
|
+
D.acceptStateReached = !0, mf(e) ? D.state = 40 : e === 35 ? D.state = 41 : Eu(e) || (e === 40 ? D.state = 32 : U1(e) ? D.state = 39 : (eu(u, D), oD(e) && u.addMachine(SD(
|
|
5834
5833
|
t,
|
|
5835
5834
|
0
|
|
5836
5835
|
/* State.SchemeChar */
|
|
5837
5836
|
))));
|
|
5838
5837
|
}
|
|
5839
5838
|
function I2(u, D, f, e) {
|
|
5840
|
-
|
|
5839
|
+
Eu(e) ? D.state = 38 : e === 40 ? D.state = 32 : (eu(u, D), jD(u, f, e));
|
|
5841
5840
|
}
|
|
5842
5841
|
function L2(u, D, f) {
|
|
5843
|
-
mf(f) || (f === 35 ? D.state = 41 :
|
|
5842
|
+
mf(f) || (f === 35 ? D.state = 41 : Eu(f) ? D.state = 38 : eu(u, D));
|
|
5844
5843
|
}
|
|
5845
5844
|
function $2(u, D, f) {
|
|
5846
|
-
mf(f) ? D.state = 40 :
|
|
5845
|
+
mf(f) ? D.state = 40 : Eu(f) ? u.removeMachine(D) : eu(u, D);
|
|
5847
5846
|
}
|
|
5848
|
-
function
|
|
5847
|
+
function eu(u, D) {
|
|
5849
5848
|
var f = u.matches, e = u.text, t = u.charIdx, n = u.tagBuilder, r = u.stripPrefix, s = u.stripTrailingSlash, F = u.decodePercentEncoding, o = u.hashtagServiceName, d = u.mentionServiceName;
|
|
5850
5849
|
if (u.removeMachine(D), !!D.acceptStateReached) {
|
|
5851
5850
|
var c = D.startIdx, l = e.slice(D.startIdx, t);
|
|
@@ -5856,8 +5855,8 @@ function tu(u, D) {
|
|
|
5856
5855
|
return;
|
|
5857
5856
|
switch (D.matchType) {
|
|
5858
5857
|
case 0: {
|
|
5859
|
-
var
|
|
5860
|
-
if (
|
|
5858
|
+
var y = P1.exec(l);
|
|
5859
|
+
if (y && (c = c + y.index, l = l.slice(y.index)), !m3(l))
|
|
5861
5860
|
return;
|
|
5862
5861
|
break;
|
|
5863
5862
|
}
|
|
@@ -6023,7 +6022,7 @@ function V2(u, D) {
|
|
|
6023
6022
|
acceptStateReached: !1
|
|
6024
6023
|
};
|
|
6025
6024
|
}
|
|
6026
|
-
function
|
|
6025
|
+
function H2(u, D) {
|
|
6027
6026
|
return {
|
|
6028
6027
|
type: 3,
|
|
6029
6028
|
startIdx: u,
|
|
@@ -6050,7 +6049,7 @@ var Su = (
|
|
|
6050
6049
|
}
|
|
6051
6050
|
return u;
|
|
6052
6051
|
}()
|
|
6053
|
-
), _f = new Su(),
|
|
6052
|
+
), _f = new Su(), W2 = (
|
|
6054
6053
|
/** @class */
|
|
6055
6054
|
/* @__PURE__ */ function() {
|
|
6056
6055
|
function u(D, f) {
|
|
@@ -6060,7 +6059,7 @@ var Su = (
|
|
|
6060
6059
|
}()
|
|
6061
6060
|
);
|
|
6062
6061
|
function Y2(u, D) {
|
|
6063
|
-
for (var f = new
|
|
6062
|
+
for (var f = new W2(u, D), e = u.length; f.charIdx < e; ) {
|
|
6064
6063
|
var t = u.charAt(f.charIdx), n = u.charCodeAt(f.charIdx);
|
|
6065
6064
|
switch (f.state) {
|
|
6066
6065
|
case 0:
|
|
@@ -6137,10 +6136,10 @@ function K2(u, D) {
|
|
|
6137
6136
|
D === "<" && Ru(u);
|
|
6138
6137
|
}
|
|
6139
6138
|
function J2(u, D, f) {
|
|
6140
|
-
D === "!" ? u.state = 13 : D === "/" ? (u.state = 2, u.currentTag = new Su(
|
|
6139
|
+
D === "!" ? u.state = 13 : D === "/" ? (u.state = 2, u.currentTag = new Su(iu(iu({}, u.currentTag), { isClosing: !0 }))) : D === "<" ? Ru(u) : rD(f) ? (u.state = 3, u.currentTag = new Su(iu(iu({}, u.currentTag), { isOpening: !0 }))) : (u.state = 0, u.currentTag = _f);
|
|
6141
6140
|
}
|
|
6142
6141
|
function G2(u, D, f) {
|
|
6143
|
-
Zu(f) ? (u.currentTag = new Su(
|
|
6142
|
+
Zu(f) ? (u.currentTag = new Su(iu(iu({}, u.currentTag), { name: HD(u) })), u.state = 4) : D === "<" ? Ru(u) : D === "/" ? (u.currentTag = new Su(iu(iu({}, u.currentTag), { name: HD(u) })), u.state = 12) : D === ">" ? (u.currentTag = new Su(iu(iu({}, u.currentTag), { name: HD(u) })), Pu(u)) : !rD(f) && !Eu(f) && D !== ":" && xu(u);
|
|
6144
6143
|
}
|
|
6145
6144
|
function X2(u, D, f) {
|
|
6146
6145
|
D === ">" ? xu(u) : rD(f) ? u.state = 3 : xu(u);
|
|
@@ -6170,11 +6169,11 @@ function nt(u, D, f) {
|
|
|
6170
6169
|
Zu(f) ? u.state = 4 : D === "/" ? u.state = 12 : D === ">" ? Pu(u) : D === "<" ? Ru(u) : (u.state = 4, Et(u));
|
|
6171
6170
|
}
|
|
6172
6171
|
function rt(u, D) {
|
|
6173
|
-
D === ">" ? (u.currentTag = new Su(
|
|
6172
|
+
D === ">" ? (u.currentTag = new Su(iu(iu({}, u.currentTag), { isClosing: !0 })), Pu(u)) : xu(u);
|
|
6174
6173
|
}
|
|
6175
6174
|
function at(u) {
|
|
6176
6175
|
var D = u.html, f = u.charIdx;
|
|
6177
|
-
D.slice(f, f + 2) === "--" ? (u.charIdx++, u.currentTag = new Su(
|
|
6176
|
+
D.slice(f, f + 2) === "--" ? (u.charIdx++, u.currentTag = new Su(iu(iu({}, u.currentTag), { type: "comment" })), u.state = 14) : D.slice(f, f + 7).toUpperCase() === "DOCTYPE" ? (u.charIdx += 6, u.currentTag = new Su(iu(iu({}, u.currentTag), { type: "doctype" })), u.state = 20) : xu(u);
|
|
6178
6177
|
}
|
|
6179
6178
|
function st(u, D) {
|
|
6180
6179
|
D === "-" ? u.state = 15 : D === ">" ? xu(u) : u.state = 16;
|
|
@@ -6213,7 +6212,7 @@ function lt(u) {
|
|
|
6213
6212
|
var D = u.html.slice(u.currentDataIdx, u.charIdx);
|
|
6214
6213
|
u.callbacks.onText(D, u.currentDataIdx), u.currentDataIdx = u.charIdx + 1;
|
|
6215
6214
|
}
|
|
6216
|
-
function
|
|
6215
|
+
function HD(u) {
|
|
6217
6216
|
var D = u.currentTag.idx + (u.currentTag.isClosing ? 2 : 1);
|
|
6218
6217
|
return u.html.slice(D, u.charIdx).toLowerCase();
|
|
6219
6218
|
}
|
|
@@ -6286,19 +6285,19 @@ var ht = (
|
|
|
6286
6285
|
}
|
|
6287
6286
|
return D;
|
|
6288
6287
|
}, u.prototype.removeUnwantedMatches = function(D) {
|
|
6289
|
-
return this.hashtag ||
|
|
6288
|
+
return this.hashtag || Ju(D, function(f) {
|
|
6290
6289
|
return f.getType() === "hashtag";
|
|
6291
|
-
}), this.email ||
|
|
6290
|
+
}), this.email || Ju(D, function(f) {
|
|
6292
6291
|
return f.getType() === "email";
|
|
6293
|
-
}), this.phone ||
|
|
6292
|
+
}), this.phone || Ju(D, function(f) {
|
|
6294
6293
|
return f.getType() === "phone";
|
|
6295
|
-
}), this.mention ||
|
|
6294
|
+
}), this.mention || Ju(D, function(f) {
|
|
6296
6295
|
return f.getType() === "mention";
|
|
6297
|
-
}), this.urls.schemeMatches ||
|
|
6296
|
+
}), this.urls.schemeMatches || Ju(D, function(f) {
|
|
6298
6297
|
return f.getType() === "url" && f.getUrlMatchType() === "scheme";
|
|
6299
|
-
}), this.urls.tldMatches ||
|
|
6298
|
+
}), this.urls.tldMatches || Ju(D, function(f) {
|
|
6300
6299
|
return f.getType() === "url" && f.getUrlMatchType() === "tld";
|
|
6301
|
-
}), this.urls.ipV4Matches ||
|
|
6300
|
+
}), this.urls.ipV4Matches || Ju(D, function(f) {
|
|
6302
6301
|
return f.getType() === "url" && f.getUrlMatchType() === "ipV4";
|
|
6303
6302
|
}), D;
|
|
6304
6303
|
}, u.prototype.parseText = function(D, f) {
|
|
@@ -6356,12 +6355,12 @@ function pt(u) {
|
|
|
6356
6355
|
};
|
|
6357
6356
|
}
|
|
6358
6357
|
function Bt(u) {
|
|
6359
|
-
return typeof u == "number" ? { length: u, location: "end" } :
|
|
6358
|
+
return typeof u == "number" ? { length: u, location: "end" } : iu({ length: Number.POSITIVE_INFINITY, location: "end" }, u);
|
|
6360
6359
|
}
|
|
6361
6360
|
function gt(u, D) {
|
|
6362
6361
|
return u.getOffset() - D.getOffset();
|
|
6363
6362
|
}
|
|
6364
|
-
const
|
|
6363
|
+
const Gu = [
|
|
6365
6364
|
{ name: "Australia", countryCode: "+61", code: "AU", flag: "🇦🇺" },
|
|
6366
6365
|
{ name: "United States", countryCode: "+1", code: "US", flag: "🇺🇸" },
|
|
6367
6366
|
{ name: "New Zealand", countryCode: "+64", code: "NZ", flag: "🇳🇿" },
|
|
@@ -6423,90 +6422,90 @@ const V1 = ({
|
|
|
6423
6422
|
initialData: u,
|
|
6424
6423
|
loadFromDataUserSubs: D = !1
|
|
6425
6424
|
} = {}) => {
|
|
6426
|
-
const [f, e] =
|
|
6425
|
+
const [f, e] = z(
|
|
6427
6426
|
u || {}
|
|
6428
|
-
), [t, n] =
|
|
6429
|
-
let
|
|
6430
|
-
if (
|
|
6431
|
-
if (typeof
|
|
6432
|
-
const
|
|
6433
|
-
if (!
|
|
6427
|
+
), [t, n] = z({}), [r, s] = z({}), F = (C, T) => {
|
|
6428
|
+
let N = "";
|
|
6429
|
+
if (C.isRequired)
|
|
6430
|
+
if (typeof T == "string") {
|
|
6431
|
+
const B = T.trim();
|
|
6432
|
+
if (!B) return `${C.label} is required`;
|
|
6434
6433
|
if (C.key.toLowerCase().includes("phone") || C.label.toLowerCase().includes("phone")) {
|
|
6435
|
-
const
|
|
6436
|
-
if (
|
|
6434
|
+
const $ = B.replace(/\s+/g, ""), _ = Gu.find((R) => $.startsWith(R.countryCode)), p = $.replace(/^\+?\d+/, "");
|
|
6435
|
+
if (_ && p.length === 0)
|
|
6437
6436
|
return "";
|
|
6438
6437
|
}
|
|
6439
|
-
} else typeof
|
|
6440
|
-
if (
|
|
6441
|
-
return console.log(`[VALIDATE] ${C.key}=${
|
|
6438
|
+
} else typeof T == "boolean" ? T !== !0 && (N = `${C.label} is required`) : T || (N = `${C.label} is required`);
|
|
6439
|
+
if (N && t[C.key])
|
|
6440
|
+
return console.log(`[VALIDATE] ${C.key}=${T}, ERROR=${N}`), N;
|
|
6442
6441
|
if (C.key.toLowerCase().includes("email") || C.label.toLowerCase().includes("email")) {
|
|
6443
|
-
const
|
|
6444
|
-
|
|
6442
|
+
const B = String(T || "").trim();
|
|
6443
|
+
B && (/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(B) || (N = "Please enter a valid email address"));
|
|
6445
6444
|
}
|
|
6446
6445
|
if (C.key.toLowerCase().includes("phone") || C.label.toLowerCase().includes("phone")) {
|
|
6447
|
-
const
|
|
6448
|
-
if (!C.isRequired &&
|
|
6446
|
+
const B = String(T || ""), $ = B.replace(/[^0-9+]/g, ""), _ = Gu.find((x) => $.startsWith(x.countryCode)), p = (_ == null ? void 0 : _.code) || "AU", R = _ ? $.substring(_.countryCode.length) : $;
|
|
6447
|
+
if (!C.isRequired && _ && R === "")
|
|
6449
6448
|
return "";
|
|
6450
|
-
if (
|
|
6451
|
-
const
|
|
6452
|
-
number:
|
|
6453
|
-
region:
|
|
6449
|
+
if (B) {
|
|
6450
|
+
const x = xt({
|
|
6451
|
+
number: B,
|
|
6452
|
+
region: p,
|
|
6454
6453
|
validateDuplicate: !1,
|
|
6455
6454
|
contacts: /* @__PURE__ */ new Map()
|
|
6456
6455
|
});
|
|
6457
|
-
|
|
6456
|
+
x.isValid || (N = x.errorMessage || "Please enter a valid phone number");
|
|
6458
6457
|
}
|
|
6459
6458
|
}
|
|
6460
|
-
return
|
|
6459
|
+
return N;
|
|
6461
6460
|
};
|
|
6462
|
-
|
|
6461
|
+
J(() => {
|
|
6463
6462
|
if (D)
|
|
6464
6463
|
try {
|
|
6465
|
-
const C =
|
|
6464
|
+
const C = uu.getItem("dataUserSubs");
|
|
6466
6465
|
C && e(C);
|
|
6467
6466
|
} catch (C) {
|
|
6468
6467
|
console.error("Error loading dataUserSubs from localStorage:", C);
|
|
6469
6468
|
}
|
|
6470
6469
|
}, [D]);
|
|
6471
6470
|
const o = qu(
|
|
6472
|
-
(C,
|
|
6473
|
-
e((
|
|
6474
|
-
...
|
|
6475
|
-
[C]:
|
|
6476
|
-
})), s((
|
|
6471
|
+
(C, T) => {
|
|
6472
|
+
e((N) => ({
|
|
6473
|
+
...N,
|
|
6474
|
+
[C]: T
|
|
6475
|
+
})), s((N) => ({ ...N, [C]: "" }));
|
|
6477
6476
|
},
|
|
6478
6477
|
[]
|
|
6479
6478
|
), d = qu(
|
|
6480
6479
|
(C) => {
|
|
6481
|
-
n((
|
|
6482
|
-
const
|
|
6483
|
-
s((
|
|
6480
|
+
n((B) => ({ ...B, [C.key]: !0 }));
|
|
6481
|
+
const T = f[C.key], N = F(C, T);
|
|
6482
|
+
s((B) => ({ ...B, [C.key]: N }));
|
|
6484
6483
|
},
|
|
6485
6484
|
[f]
|
|
6486
6485
|
), c = (C) => {
|
|
6487
|
-
const
|
|
6486
|
+
const T = {
|
|
6488
6487
|
email: "email",
|
|
6489
6488
|
phone: "tel",
|
|
6490
6489
|
date: "date",
|
|
6491
6490
|
password: "password"
|
|
6492
|
-
},
|
|
6493
|
-
(
|
|
6491
|
+
}, N = Object.keys(T).find(
|
|
6492
|
+
(B) => C.toLowerCase().includes(B)
|
|
6494
6493
|
);
|
|
6495
|
-
return
|
|
6494
|
+
return N ? T[N] : "text";
|
|
6496
6495
|
}, l = qu(
|
|
6497
6496
|
(C) => {
|
|
6498
|
-
var
|
|
6497
|
+
var $;
|
|
6499
6498
|
if (!C.isDisplay) return null;
|
|
6500
|
-
const
|
|
6499
|
+
const T = f[C.key], N = c(C.key), B = !!r[C.key] && t[C.key];
|
|
6501
6500
|
if (C.key.includes("language") || C.key.includes("country"))
|
|
6502
6501
|
return /* @__PURE__ */ a.jsx(
|
|
6503
6502
|
"select",
|
|
6504
6503
|
{
|
|
6505
|
-
className: `user-subscription-form-input${
|
|
6506
|
-
value:
|
|
6507
|
-
onChange: (
|
|
6504
|
+
className: `user-subscription-form-input${B ? " error" : ""}`,
|
|
6505
|
+
value: T || "",
|
|
6506
|
+
onChange: (_) => o(C.key, _.target.value),
|
|
6508
6507
|
onBlur: () => d(C),
|
|
6509
|
-
"aria-invalid":
|
|
6508
|
+
"aria-invalid": B,
|
|
6510
6509
|
style: C.color ? { borderColor: C.color } : void 0,
|
|
6511
6510
|
children: /* @__PURE__ */ a.jsxs("option", { value: "", children: [
|
|
6512
6511
|
"Select ",
|
|
@@ -6522,24 +6521,24 @@ const V1 = ({
|
|
|
6522
6521
|
{
|
|
6523
6522
|
type: "checkbox",
|
|
6524
6523
|
id: C.key,
|
|
6525
|
-
checked:
|
|
6526
|
-
onChange: (
|
|
6527
|
-
"aria-invalid":
|
|
6524
|
+
checked: T || !1,
|
|
6525
|
+
onChange: (_) => o(C.key, _.target.checked),
|
|
6526
|
+
"aria-invalid": B
|
|
6528
6527
|
}
|
|
6529
6528
|
),
|
|
6530
6529
|
/* @__PURE__ */ a.jsx("label", { htmlFor: C.key, children: C.label })
|
|
6531
6530
|
] }, C.key);
|
|
6532
6531
|
if (C.key.toLowerCase().includes("phone")) {
|
|
6533
|
-
const
|
|
6534
|
-
const
|
|
6532
|
+
const _ = T || "", p = (($ = Gu.find((m) => _.startsWith(m.countryCode))) == null ? void 0 : $.countryCode) || "+61", R = _.replace(/^\+?\d+\s?/, "").trim(), x = (m) => {
|
|
6533
|
+
const A = m.replace(/[^0-9\s]/g, "").trim();
|
|
6535
6534
|
o(
|
|
6536
6535
|
C.key,
|
|
6537
|
-
|
|
6536
|
+
A ? `${p} ${A}` : `${p} `
|
|
6538
6537
|
);
|
|
6539
|
-
},
|
|
6538
|
+
}, V = (m) => {
|
|
6540
6539
|
o(
|
|
6541
6540
|
C.key,
|
|
6542
|
-
|
|
6541
|
+
R ? `${m} ${R}` : `${m} `
|
|
6543
6542
|
);
|
|
6544
6543
|
};
|
|
6545
6544
|
return /* @__PURE__ */ a.jsxs("div", { className: "user-subscription-form-field", children: [
|
|
@@ -6556,23 +6555,23 @@ const V1 = ({
|
|
|
6556
6555
|
/* @__PURE__ */ a.jsxs(
|
|
6557
6556
|
"select",
|
|
6558
6557
|
{
|
|
6559
|
-
className: `user-subscription-form-input${
|
|
6558
|
+
className: `user-subscription-form-input${B ? " error" : ""}`,
|
|
6560
6559
|
style: {
|
|
6561
6560
|
maxWidth: "100px"
|
|
6562
6561
|
},
|
|
6563
|
-
value:
|
|
6564
|
-
onChange: (
|
|
6562
|
+
value: p,
|
|
6563
|
+
onChange: (m) => V(m.target.value),
|
|
6565
6564
|
onBlur: () => d(C),
|
|
6566
|
-
"aria-invalid": !!
|
|
6565
|
+
"aria-invalid": !!B,
|
|
6567
6566
|
children: [
|
|
6568
6567
|
/* @__PURE__ */ a.jsx("option", { value: "", children: "+Code" }),
|
|
6569
|
-
|
|
6568
|
+
Gu.map((m) => /* @__PURE__ */ a.jsx(
|
|
6570
6569
|
"option",
|
|
6571
6570
|
{
|
|
6572
|
-
value:
|
|
6573
|
-
children: `${
|
|
6571
|
+
value: m.countryCode,
|
|
6572
|
+
children: `${m.flag} ${m.countryCode}`
|
|
6574
6573
|
},
|
|
6575
|
-
|
|
6574
|
+
m.code
|
|
6576
6575
|
))
|
|
6577
6576
|
]
|
|
6578
6577
|
}
|
|
@@ -6580,13 +6579,13 @@ const V1 = ({
|
|
|
6580
6579
|
/* @__PURE__ */ a.jsx(
|
|
6581
6580
|
"input",
|
|
6582
6581
|
{
|
|
6583
|
-
className: `user-subscription-form-input${
|
|
6582
|
+
className: `user-subscription-form-input${B ? " error" : ""}`,
|
|
6584
6583
|
type: "tel",
|
|
6585
|
-
value:
|
|
6586
|
-
onChange: (
|
|
6584
|
+
value: R,
|
|
6585
|
+
onChange: (m) => x(m.target.value),
|
|
6587
6586
|
onBlur: () => d(C),
|
|
6588
6587
|
placeholder: C.label,
|
|
6589
|
-
"aria-invalid": !!
|
|
6588
|
+
"aria-invalid": !!B,
|
|
6590
6589
|
style: {
|
|
6591
6590
|
...C.color ? { borderColor: C.color } : {},
|
|
6592
6591
|
flex: 1
|
|
@@ -6596,48 +6595,45 @@ const V1 = ({
|
|
|
6596
6595
|
]
|
|
6597
6596
|
}
|
|
6598
6597
|
),
|
|
6599
|
-
|
|
6598
|
+
B && /* @__PURE__ */ a.jsx("div", { className: "user-subscription-error", children: r[C.key] })
|
|
6600
6599
|
] }, C.key);
|
|
6601
6600
|
}
|
|
6602
6601
|
return /* @__PURE__ */ a.jsxs("div", { className: "user-subscription-form-field", children: [
|
|
6603
6602
|
/* @__PURE__ */ a.jsx(
|
|
6604
6603
|
"input",
|
|
6605
6604
|
{
|
|
6606
|
-
className: `user-subscription-form-input${
|
|
6607
|
-
type:
|
|
6608
|
-
value:
|
|
6609
|
-
onChange: (
|
|
6605
|
+
className: `user-subscription-form-input${B ? " error" : ""}`,
|
|
6606
|
+
type: N,
|
|
6607
|
+
value: T || "",
|
|
6608
|
+
onChange: (_) => o(C.key, _.target.value),
|
|
6610
6609
|
onBlur: () => d(C),
|
|
6611
6610
|
placeholder: C.label,
|
|
6612
|
-
"aria-invalid":
|
|
6611
|
+
"aria-invalid": B,
|
|
6613
6612
|
style: C.color ? { borderColor: C.color } : void 0
|
|
6614
6613
|
}
|
|
6615
6614
|
),
|
|
6616
|
-
|
|
6615
|
+
B && /* @__PURE__ */ a.jsx("div", { className: "user-subscription-error", children: r[C.key] })
|
|
6617
6616
|
] }, C.key);
|
|
6618
6617
|
},
|
|
6619
6618
|
[r, t, f, o, d]
|
|
6620
6619
|
), j = qu(
|
|
6621
6620
|
(C) => {
|
|
6622
|
-
var
|
|
6621
|
+
var $;
|
|
6623
6622
|
if (!C.isDisplay) return null;
|
|
6624
|
-
const
|
|
6623
|
+
const T = f[C.key], N = c(C.key), B = !!r[C.key] && t[C.key];
|
|
6625
6624
|
if (C.key.toLowerCase().includes("phone")) {
|
|
6626
|
-
const
|
|
6627
|
-
const
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
},
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
}
|
|
6638
|
-
const k = W.replace(/\s/g, "");
|
|
6639
|
-
return /^(\+61|0)[2-478]\d{8}$/.test(k);
|
|
6640
|
-
})(b)), J = !!(t[C.key] && _);
|
|
6625
|
+
const _ = T || "", p = (($ = Gu.find((m) => _.startsWith(m.countryCode))) == null ? void 0 : $.countryCode) || "+61", R = _.replace(/^\+?\d+\s?/, "").trim(), x = (m) => {
|
|
6626
|
+
const A = m.replace(/[^0-9\s]/g, "").trim();
|
|
6627
|
+
o(
|
|
6628
|
+
C.key,
|
|
6629
|
+
A ? `${p} ${A}` : `${p} `
|
|
6630
|
+
);
|
|
6631
|
+
}, V = (m) => {
|
|
6632
|
+
o(
|
|
6633
|
+
C.key,
|
|
6634
|
+
R ? `${m} ${R}` : `${m} `
|
|
6635
|
+
);
|
|
6636
|
+
};
|
|
6641
6637
|
return /* @__PURE__ */ a.jsxs("div", { className: "sc-message--contact-form-field", children: [
|
|
6642
6638
|
/* @__PURE__ */ a.jsx(
|
|
6643
6639
|
"label",
|
|
@@ -6657,18 +6653,19 @@ const V1 = ({
|
|
|
6657
6653
|
{
|
|
6658
6654
|
className: "sc-message--contact-form-input",
|
|
6659
6655
|
style: { maxWidth: "100px" },
|
|
6660
|
-
value:
|
|
6661
|
-
onChange: (
|
|
6662
|
-
|
|
6656
|
+
value: p,
|
|
6657
|
+
onChange: (m) => V(m.target.value),
|
|
6658
|
+
onBlur: () => d(C),
|
|
6659
|
+
"aria-invalid": B,
|
|
6663
6660
|
children: [
|
|
6664
6661
|
/* @__PURE__ */ a.jsx("option", { value: "", children: "+Code" }),
|
|
6665
|
-
|
|
6662
|
+
Gu.map((m) => /* @__PURE__ */ a.jsx(
|
|
6666
6663
|
"option",
|
|
6667
6664
|
{
|
|
6668
|
-
value:
|
|
6669
|
-
children: `${
|
|
6665
|
+
value: m.countryCode,
|
|
6666
|
+
children: `${m.flag} ${m.countryCode}`
|
|
6670
6667
|
},
|
|
6671
|
-
|
|
6668
|
+
m.code
|
|
6672
6669
|
))
|
|
6673
6670
|
]
|
|
6674
6671
|
}
|
|
@@ -6678,23 +6675,23 @@ const V1 = ({
|
|
|
6678
6675
|
{
|
|
6679
6676
|
id: `contact-${C.key}`,
|
|
6680
6677
|
type: "tel",
|
|
6681
|
-
value:
|
|
6682
|
-
onChange: (
|
|
6683
|
-
onBlur: () =>
|
|
6678
|
+
value: R,
|
|
6679
|
+
onChange: (m) => x(m.target.value),
|
|
6680
|
+
onBlur: () => d(C),
|
|
6684
6681
|
placeholder: "",
|
|
6685
|
-
className: `sc-message--contact-form-input ${
|
|
6686
|
-
"aria-invalid":
|
|
6682
|
+
className: `sc-message--contact-form-input ${B ? "error" : ""}`,
|
|
6683
|
+
"aria-invalid": B,
|
|
6687
6684
|
style: {
|
|
6688
6685
|
...C.color ? { borderColor: C.color } : {},
|
|
6689
6686
|
flex: 1,
|
|
6690
|
-
...
|
|
6687
|
+
...B ? { borderColor: "#ff4444" } : {}
|
|
6691
6688
|
}
|
|
6692
6689
|
}
|
|
6693
6690
|
)
|
|
6694
6691
|
]
|
|
6695
6692
|
}
|
|
6696
6693
|
),
|
|
6697
|
-
|
|
6694
|
+
B && /* @__PURE__ */ a.jsx(
|
|
6698
6695
|
"div",
|
|
6699
6696
|
{
|
|
6700
6697
|
style: {
|
|
@@ -6702,12 +6699,11 @@ const V1 = ({
|
|
|
6702
6699
|
fontSize: "0.75rem",
|
|
6703
6700
|
marginTop: "0.25rem"
|
|
6704
6701
|
},
|
|
6705
|
-
children:
|
|
6702
|
+
children: r[C.key]
|
|
6706
6703
|
}
|
|
6707
6704
|
)
|
|
6708
6705
|
] }, C.key);
|
|
6709
6706
|
}
|
|
6710
|
-
const g = C.isRequired && (!v || typeof v == "string" && v.trim() === ""), L = t[C.key] && g;
|
|
6711
6707
|
return /* @__PURE__ */ a.jsxs("div", { className: "sc-message--contact-form-field", children: [
|
|
6712
6708
|
/* @__PURE__ */ a.jsx(
|
|
6713
6709
|
"label",
|
|
@@ -6721,20 +6717,20 @@ const V1 = ({
|
|
|
6721
6717
|
"input",
|
|
6722
6718
|
{
|
|
6723
6719
|
id: `contact-${C.key}`,
|
|
6724
|
-
type:
|
|
6725
|
-
value:
|
|
6726
|
-
onChange: (
|
|
6727
|
-
onBlur: () =>
|
|
6720
|
+
type: N,
|
|
6721
|
+
value: T || "",
|
|
6722
|
+
onChange: (_) => o(C.key, _.target.value),
|
|
6723
|
+
onBlur: () => d(C),
|
|
6728
6724
|
placeholder: "",
|
|
6729
|
-
className: `sc-message--contact-form-input ${
|
|
6730
|
-
"aria-invalid":
|
|
6725
|
+
className: `sc-message--contact-form-input ${B ? "error" : ""}`,
|
|
6726
|
+
"aria-invalid": B,
|
|
6731
6727
|
style: {
|
|
6732
6728
|
...C.color ? { borderColor: C.color } : {},
|
|
6733
|
-
...
|
|
6729
|
+
...B ? { borderColor: "#ff4444" } : {}
|
|
6734
6730
|
}
|
|
6735
6731
|
}
|
|
6736
6732
|
),
|
|
6737
|
-
|
|
6733
|
+
B && /* @__PURE__ */ a.jsx(
|
|
6738
6734
|
"div",
|
|
6739
6735
|
{
|
|
6740
6736
|
style: {
|
|
@@ -6742,21 +6738,25 @@ const V1 = ({
|
|
|
6742
6738
|
fontSize: "0.75rem",
|
|
6743
6739
|
marginTop: "0.25rem"
|
|
6744
6740
|
},
|
|
6745
|
-
children: [
|
|
6746
|
-
C.label,
|
|
6747
|
-
" is required"
|
|
6748
|
-
]
|
|
6741
|
+
children: r[C.key]
|
|
6749
6742
|
}
|
|
6750
6743
|
)
|
|
6751
6744
|
] }, C.key);
|
|
6752
6745
|
},
|
|
6753
|
-
[
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6746
|
+
[
|
|
6747
|
+
f,
|
|
6748
|
+
c,
|
|
6749
|
+
t,
|
|
6750
|
+
r,
|
|
6751
|
+
o,
|
|
6752
|
+
d
|
|
6753
|
+
]
|
|
6754
|
+
), y = qu((C) => {
|
|
6755
|
+
const T = {};
|
|
6756
|
+
return C.filter((N) => N.isDisplay).forEach((N) => {
|
|
6757
|
+
const B = f[N.key];
|
|
6758
|
+
T[N.key] = F(N, B);
|
|
6759
|
+
}), s((N) => ({ ...N, ...T })), C.filter((N) => N.isDisplay && N.isRequired).every((N) => T[N.key] === "");
|
|
6760
6760
|
}, [f, F]);
|
|
6761
6761
|
return {
|
|
6762
6762
|
formData: f,
|
|
@@ -6769,7 +6769,7 @@ const V1 = ({
|
|
|
6769
6769
|
renderContactFormField: j,
|
|
6770
6770
|
getInputType: c,
|
|
6771
6771
|
errors: r,
|
|
6772
|
-
validateAll:
|
|
6772
|
+
validateAll: y
|
|
6773
6773
|
};
|
|
6774
6774
|
};
|
|
6775
6775
|
function kt(u) {
|
|
@@ -6777,7 +6777,7 @@ function kt(u) {
|
|
|
6777
6777
|
return Object.entries(u).forEach(([f, e]) => {
|
|
6778
6778
|
if (e) {
|
|
6779
6779
|
if (f.toLowerCase().includes("phone")) {
|
|
6780
|
-
const t = e.replace(/\s+/g, ""), n =
|
|
6780
|
+
const t = e.replace(/\s+/g, ""), n = Gu.find((r) => t.startsWith(r.countryCode));
|
|
6781
6781
|
if (n && t.slice(n.countryCode.length) === "")
|
|
6782
6782
|
return;
|
|
6783
6783
|
}
|
|
@@ -6789,108 +6789,108 @@ const jt = ({
|
|
|
6789
6789
|
onSubmit: u,
|
|
6790
6790
|
onFormStateChange: D
|
|
6791
6791
|
}) => {
|
|
6792
|
-
const { colors: f } =
|
|
6792
|
+
const { colors: f } = ou(), e = Uu(), t = Bu(), { socket: n } = Wu(), { setScreen: r } = Nu();
|
|
6793
6793
|
Ou();
|
|
6794
|
-
const { setIsOfflineMode: s, send: F, participants: o, setMessages: d, setParticipants: c, setConnectionState: l } =
|
|
6794
|
+
const { setIsOfflineMode: s, send: F, participants: o, setMessages: d, setParticipants: c, setConnectionState: l } = Cu(), { formData: j, renderContactFormField: y, errors: C, validateAll: T } = V1({
|
|
6795
6795
|
initialData: {},
|
|
6796
6796
|
loadFromDataUserSubs: !0
|
|
6797
|
-
}), [
|
|
6798
|
-
|
|
6799
|
-
D &&
|
|
6800
|
-
}, [
|
|
6801
|
-
const
|
|
6802
|
-
var
|
|
6803
|
-
if (
|
|
6804
|
-
|
|
6797
|
+
}), [N, B] = z(!1), [$, _] = z(!1);
|
|
6798
|
+
J(() => {
|
|
6799
|
+
D && !$ && D(!0), D && $ && D(!1);
|
|
6800
|
+
}, [$]);
|
|
6801
|
+
const p = async (x) => {
|
|
6802
|
+
var m;
|
|
6803
|
+
if (x.preventDefault(), !!T(t.formSettings)) {
|
|
6804
|
+
B(!0);
|
|
6805
6805
|
try {
|
|
6806
|
-
const
|
|
6806
|
+
const A = {};
|
|
6807
6807
|
t.formSettings.forEach((E) => {
|
|
6808
6808
|
var h;
|
|
6809
|
-
E.isDisplay && j[E.key] !== void 0 && (
|
|
6809
|
+
E.isDisplay && j[E.key] !== void 0 && (A[E.key] = ((h = j[E.key]) == null ? void 0 : h.toString().trim()) || "");
|
|
6810
6810
|
});
|
|
6811
|
-
const
|
|
6812
|
-
if (!
|
|
6811
|
+
const v = kt(A);
|
|
6812
|
+
if (!uu.getItem("profileLiveChat"))
|
|
6813
6813
|
try {
|
|
6814
6814
|
const E = new URLSearchParams();
|
|
6815
|
-
Object.entries(
|
|
6816
|
-
typeof
|
|
6815
|
+
Object.entries(v).forEach(([M, U]) => {
|
|
6816
|
+
typeof U == "string" && U && E.append(M, U);
|
|
6817
6817
|
}), E.append("owner_id", e.ownerId), E.append("contactLateTime", (/* @__PURE__ */ new Date()).toISOString());
|
|
6818
|
-
const { body: h } = await n.get(`/webhook/${e.channel}/?${E.toString()}`), { messages:
|
|
6819
|
-
|
|
6818
|
+
const { body: h } = await n.get(`/webhook/${e.channel}/?${E.toString()}`), { messages: k, profile: g } = h;
|
|
6819
|
+
uu.setItem("profileLiveChat", g), uu.setItem("isOffline", !1), uu.setItem(
|
|
6820
6820
|
"submitedFormLateTime",
|
|
6821
|
-
(
|
|
6822
|
-
),
|
|
6823
|
-
const
|
|
6824
|
-
M.direction =
|
|
6825
|
-
}), d(
|
|
6821
|
+
(g == null ? void 0 : g.submitedFormLateTime) || null
|
|
6822
|
+
), k.forEach((M) => {
|
|
6823
|
+
const U = M.author === g.foreignId || M.author === g.id ? Q.sent : Q.received;
|
|
6824
|
+
M.direction = U, M.direction === Q.sent && (M.read = !0, M.delivery = !1);
|
|
6825
|
+
}), d(k), c([
|
|
6826
6826
|
o[0],
|
|
6827
6827
|
{
|
|
6828
|
-
id:
|
|
6829
|
-
foreign_id:
|
|
6830
|
-
name: `${
|
|
6828
|
+
id: g.foreignId,
|
|
6829
|
+
foreign_id: g.foreignId,
|
|
6830
|
+
name: `${g.firstName} ${g.lastName}`
|
|
6831
6831
|
}
|
|
6832
|
-
]), l(3), r("chat"),
|
|
6833
|
-
const
|
|
6834
|
-
text: Object.entries(
|
|
6835
|
-
([M,
|
|
6832
|
+
]), l(3), r("chat"), _(!0);
|
|
6833
|
+
const P = {
|
|
6834
|
+
text: Object.entries(v).map(
|
|
6835
|
+
([M, U]) => `${M.charAt(0).toUpperCase() + M.slice(1)}: ${U}`
|
|
6836
6836
|
).join(`
|
|
6837
6837
|
`),
|
|
6838
6838
|
contactInfo: {
|
|
6839
|
-
...
|
|
6839
|
+
...v,
|
|
6840
6840
|
owner_id: e.ownerId
|
|
6841
6841
|
},
|
|
6842
6842
|
contactLateTime: /* @__PURE__ */ new Date()
|
|
6843
6843
|
};
|
|
6844
6844
|
F({
|
|
6845
|
-
event:
|
|
6845
|
+
event: x,
|
|
6846
6846
|
source: "contact-form",
|
|
6847
6847
|
data: {
|
|
6848
6848
|
type: Au.text,
|
|
6849
|
-
data:
|
|
6850
|
-
author:
|
|
6849
|
+
data: P,
|
|
6850
|
+
author: g.foreignId
|
|
6851
6851
|
}
|
|
6852
|
-
}), s(!0), u && u(
|
|
6852
|
+
}), s(!0), u && u(A.name, A.phone);
|
|
6853
6853
|
return;
|
|
6854
6854
|
} catch (E) {
|
|
6855
6855
|
console.error("Error in subscription flow:", E);
|
|
6856
6856
|
}
|
|
6857
|
-
const
|
|
6858
|
-
text: Object.entries(
|
|
6857
|
+
const S = {
|
|
6858
|
+
text: Object.entries(v).map(
|
|
6859
6859
|
([E, h]) => `${E.charAt(0).toUpperCase() + E.slice(1)}: ${h}`
|
|
6860
6860
|
).join(`
|
|
6861
6861
|
`),
|
|
6862
6862
|
contactInfo: {
|
|
6863
|
-
...
|
|
6863
|
+
...v,
|
|
6864
6864
|
owner_id: e.ownerId
|
|
6865
6865
|
},
|
|
6866
6866
|
contactLateTime: /* @__PURE__ */ new Date()
|
|
6867
6867
|
};
|
|
6868
6868
|
F({
|
|
6869
|
-
event:
|
|
6869
|
+
event: x,
|
|
6870
6870
|
source: "contact-form",
|
|
6871
6871
|
data: {
|
|
6872
6872
|
type: Au.text,
|
|
6873
|
-
data:
|
|
6874
|
-
author: (
|
|
6873
|
+
data: S,
|
|
6874
|
+
author: (m = o[1]) == null ? void 0 : m.id
|
|
6875
6875
|
}
|
|
6876
|
-
}),
|
|
6877
|
-
} catch (
|
|
6878
|
-
console.error("Error sending contact form to webhook:",
|
|
6876
|
+
}), _(!0), s(!0), u && u(A.name, A.phone);
|
|
6877
|
+
} catch (A) {
|
|
6878
|
+
console.error("Error sending contact form to webhook:", A);
|
|
6879
6879
|
} finally {
|
|
6880
|
-
|
|
6880
|
+
B(!1);
|
|
6881
6881
|
}
|
|
6882
6882
|
}
|
|
6883
|
-
},
|
|
6884
|
-
return
|
|
6883
|
+
}, R = f[Q.received];
|
|
6884
|
+
return $ ? null : /* @__PURE__ */ a.jsx(
|
|
6885
6885
|
"div",
|
|
6886
6886
|
{
|
|
6887
6887
|
className: "sc-message--contact-form",
|
|
6888
6888
|
style: {
|
|
6889
|
-
color:
|
|
6890
|
-
backgroundColor:
|
|
6889
|
+
color: R.text,
|
|
6890
|
+
backgroundColor: R.bg
|
|
6891
6891
|
},
|
|
6892
|
-
children: /* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-content", children: /* @__PURE__ */ a.jsxs("form", { onSubmit:
|
|
6893
|
-
t.formSettings.sort((
|
|
6892
|
+
children: /* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-content", children: /* @__PURE__ */ a.jsxs("form", { onSubmit: p, className: "sc-message--contact-form-form", noValidate: !0, children: [
|
|
6893
|
+
t.formSettings.sort((x, V) => x.order - V.order).map(y),
|
|
6894
6894
|
/* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-authorization", children: /* @__PURE__ */ a.jsx(
|
|
6895
6895
|
"a",
|
|
6896
6896
|
{
|
|
@@ -6911,7 +6911,7 @@ const jt = ({
|
|
|
6911
6911
|
color: f.header.text,
|
|
6912
6912
|
width: "40%"
|
|
6913
6913
|
},
|
|
6914
|
-
disabled:
|
|
6914
|
+
disabled: N || Object.values(C).some((x) => x !== ""),
|
|
6915
6915
|
children: "Send"
|
|
6916
6916
|
}
|
|
6917
6917
|
)
|
|
@@ -6922,12 +6922,12 @@ const jt = ({
|
|
|
6922
6922
|
message: u,
|
|
6923
6923
|
onFormSubmitted: D
|
|
6924
6924
|
}) => {
|
|
6925
|
-
const { colors: f } =
|
|
6926
|
-
|
|
6925
|
+
const { colors: f } = ou(), { setIsContactFormActive: e } = Cu(), t = pu(null);
|
|
6926
|
+
J(() => {
|
|
6927
6927
|
n();
|
|
6928
6928
|
}, [u]);
|
|
6929
6929
|
const n = () => {
|
|
6930
|
-
if (u.direction ===
|
|
6930
|
+
if (u.direction === Q.received && t.current) {
|
|
6931
6931
|
const F = t.current.innerText;
|
|
6932
6932
|
let o = ht.link(F, {
|
|
6933
6933
|
className: "chatLink",
|
|
@@ -6938,7 +6938,7 @@ const jt = ({
|
|
|
6938
6938
|
};
|
|
6939
6939
|
if (!("text" in u.data))
|
|
6940
6940
|
throw new Error("Unable to find text.");
|
|
6941
|
-
const r = f[u.direction ||
|
|
6941
|
+
const r = f[u.direction || Q.received];
|
|
6942
6942
|
return "isShowForm" in u.data && u.data.isShowForm ? /* @__PURE__ */ a.jsx(
|
|
6943
6943
|
jt,
|
|
6944
6944
|
{
|
|
@@ -6979,7 +6979,7 @@ const jt = ({
|
|
|
6979
6979
|
children: /* @__PURE__ */ a.jsx("path", { d: "M20 6L9 17l-5-5" })
|
|
6980
6980
|
}
|
|
6981
6981
|
), Tt = ({ message: u }) => {
|
|
6982
|
-
const { colors: D } =
|
|
6982
|
+
const { colors: D } = ou();
|
|
6983
6983
|
if (!("delivery" in u && "read" in u))
|
|
6984
6984
|
throw new Error("Unable to find delivery/read attributes");
|
|
6985
6985
|
return /* @__PURE__ */ a.jsxs("div", { className: "sc--status", style: { color: D.messageStatus.bg }, children: [
|
|
@@ -7012,7 +7012,7 @@ const jt = ({
|
|
|
7012
7012
|
};
|
|
7013
7013
|
S1.extend(Ye);
|
|
7014
7014
|
const Nt = ({ message: u, Avatar: D }) => {
|
|
7015
|
-
const { participants: f } =
|
|
7015
|
+
const { participants: f } = Cu(), { colors: e } = ou(), [t, n] = z(!1), [r, s] = z(!1), F = Bu(), o = u.data && "text" in u.data && "isShowForm" in u.data && u.data.isShowForm, d = f.find(
|
|
7016
7016
|
(j) => j.id === u.author
|
|
7017
7017
|
) || {
|
|
7018
7018
|
name: "Anon"
|
|
@@ -7066,7 +7066,7 @@ const Nt = ({ message: u, Avatar: D }) => {
|
|
|
7066
7066
|
] })
|
|
7067
7067
|
] }) });
|
|
7068
7068
|
}, Ot = () => {
|
|
7069
|
-
const { colors: u } =
|
|
7069
|
+
const { colors: u } = ou();
|
|
7070
7070
|
return /* @__PURE__ */ a.jsxs(
|
|
7071
7071
|
"div",
|
|
7072
7072
|
{
|
|
@@ -7086,14 +7086,14 @@ const Nt = ({ message: u, Avatar: D }) => {
|
|
|
7086
7086
|
Avatar: u,
|
|
7087
7087
|
phone: D
|
|
7088
7088
|
}) => {
|
|
7089
|
-
const { colors: f } =
|
|
7089
|
+
const { colors: f } = ou(), e = f[Q.received];
|
|
7090
7090
|
Bu();
|
|
7091
|
-
const { participants: t } =
|
|
7091
|
+
const { participants: t } = Cu(), n = t.find(
|
|
7092
7092
|
(r) => r.id === "chatbot"
|
|
7093
7093
|
) || {
|
|
7094
7094
|
name: "Bot"
|
|
7095
7095
|
};
|
|
7096
|
-
return /* @__PURE__ */ a.jsx("div", { className: `sc-message ${
|
|
7096
|
+
return /* @__PURE__ */ a.jsx("div", { className: `sc-message ${Q.received}`, children: /* @__PURE__ */ a.jsxs("div", { className: `sc-message--content ${Q.received}`, children: [
|
|
7097
7097
|
/* @__PURE__ */ a.jsx(
|
|
7098
7098
|
"div",
|
|
7099
7099
|
{
|
|
@@ -7131,37 +7131,37 @@ const Nt = ({ message: u, Avatar: D }) => {
|
|
|
7131
7131
|
) })
|
|
7132
7132
|
] }) });
|
|
7133
7133
|
}, Pt = ({ Avatar: u }) => {
|
|
7134
|
-
const { scroll: D, setScroll: f, isOpen: e } = Nu(), { messages: t, showTypingIndicator: n, setNewIOMessage: r, setMessages: s } =
|
|
7135
|
-
if (!("text" in
|
|
7136
|
-
const
|
|
7137
|
-
`).map((
|
|
7138
|
-
(
|
|
7134
|
+
const { scroll: D, setScroll: f, isOpen: e } = Nu(), { messages: t, showTypingIndicator: n, setNewIOMessage: r, setMessages: s } = Cu(), F = Bu(), { colors: o } = ou(), { formSettings: d } = Bu(), [c, l] = z(""), j = pu(""), y = F.offline_mode, C = kD(y), T = (p) => {
|
|
7135
|
+
if (!("text" in p.data)) return null;
|
|
7136
|
+
const R = p.data.text || "", x = (v) => v.toLowerCase().replace(/\s+/g, "").replace(/[^a-z0-9_]/g, ""), m = R.split(`
|
|
7137
|
+
`).map((v) => v.trim()).find(
|
|
7138
|
+
(v) => x(v.split(":")[0]) === "phone"
|
|
7139
7139
|
);
|
|
7140
|
-
if (!
|
|
7141
|
-
const [,
|
|
7142
|
-
return
|
|
7143
|
-
},
|
|
7144
|
-
if (!("text" in
|
|
7145
|
-
const
|
|
7146
|
-
`).map((
|
|
7147
|
-
|
|
7148
|
-
),
|
|
7149
|
-
(
|
|
7140
|
+
if (!m) return null;
|
|
7141
|
+
const [, A = ""] = m.split(":");
|
|
7142
|
+
return A.trim();
|
|
7143
|
+
}, N = (p) => {
|
|
7144
|
+
if (!("text" in p.data)) return !1;
|
|
7145
|
+
const R = p.data.text || "", x = (v) => v.toLowerCase().replace(/\s+/g, "").replace(/[^a-z0-9_]/g, ""), V = R.split(`
|
|
7146
|
+
`).map((v) => v.trim()), m = new Set(
|
|
7147
|
+
V.map((v) => v.split(":")[0] || "").map((v) => x(v))
|
|
7148
|
+
), A = d == null ? void 0 : d.filter(
|
|
7149
|
+
(v) => v.isDisplay && v.isRequired
|
|
7150
7150
|
);
|
|
7151
|
-
return
|
|
7152
|
-
(
|
|
7151
|
+
return A == null ? void 0 : A.every(
|
|
7152
|
+
(v) => m.has(x(v.label)) || m.has(x(v.key))
|
|
7153
7153
|
);
|
|
7154
|
-
},
|
|
7155
|
-
return
|
|
7156
|
-
const
|
|
7157
|
-
if (
|
|
7158
|
-
const
|
|
7159
|
-
100 *
|
|
7154
|
+
}, B = pu(null), [$, _] = z();
|
|
7155
|
+
return J(() => {
|
|
7156
|
+
const p = (R) => {
|
|
7157
|
+
if (B.current) {
|
|
7158
|
+
const x = Math.round(
|
|
7159
|
+
100 * B.current.scrollTop / (B.current.scrollHeight || 1)
|
|
7160
7160
|
);
|
|
7161
|
-
(Math.abs(
|
|
7162
|
-
|
|
7161
|
+
(Math.abs(x - R) > 1 || R === 100) && requestAnimationFrame(() => {
|
|
7162
|
+
B.current && B.current.scrollTo({
|
|
7163
7163
|
top: Math.round(
|
|
7164
|
-
|
|
7164
|
+
R * B.current.scrollHeight / 100
|
|
7165
7165
|
),
|
|
7166
7166
|
behavior: "instant",
|
|
7167
7167
|
left: 0
|
|
@@ -7170,19 +7170,19 @@ const Nt = ({ message: u, Avatar: D }) => {
|
|
|
7170
7170
|
}
|
|
7171
7171
|
};
|
|
7172
7172
|
e && setTimeout(() => {
|
|
7173
|
-
|
|
7173
|
+
p(D);
|
|
7174
7174
|
}, 100);
|
|
7175
|
-
}, [D, e]),
|
|
7176
|
-
const
|
|
7177
|
-
const
|
|
7178
|
-
(
|
|
7175
|
+
}, [D, e]), J(() => {
|
|
7176
|
+
const p = () => {
|
|
7177
|
+
const x = uu.getItem("profileLiveChat") || {}, V = uu.getItem("submitedFormLateTime") || x.submitedFormLateTime, m = t.some(
|
|
7178
|
+
(A) => A.data && "isShowForm" in A.data && A.data.isShowForm
|
|
7179
7179
|
);
|
|
7180
|
-
if (C && !
|
|
7181
|
-
const
|
|
7180
|
+
if (C && !V && !m) {
|
|
7181
|
+
const A = {
|
|
7182
7182
|
mid: `show-text-${Date.now()}`,
|
|
7183
7183
|
author: "system",
|
|
7184
7184
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7185
|
-
direction:
|
|
7185
|
+
direction: Q.received,
|
|
7186
7186
|
read: !0,
|
|
7187
7187
|
delivery: !0,
|
|
7188
7188
|
type: KD.text,
|
|
@@ -7194,11 +7194,11 @@ const Nt = ({ message: u, Avatar: D }) => {
|
|
|
7194
7194
|
handover: !1,
|
|
7195
7195
|
isOffline: !0,
|
|
7196
7196
|
submitedFormLateTime: null
|
|
7197
|
-
},
|
|
7197
|
+
}, v = {
|
|
7198
7198
|
mid: `show-form-${Date.now()}`,
|
|
7199
7199
|
author: "user",
|
|
7200
7200
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7201
|
-
direction:
|
|
7201
|
+
direction: Q.received,
|
|
7202
7202
|
read: !0,
|
|
7203
7203
|
delivery: !0,
|
|
7204
7204
|
type: KD.text,
|
|
@@ -7211,25 +7211,25 @@ const Nt = ({ message: u, Avatar: D }) => {
|
|
|
7211
7211
|
isOffline: !0,
|
|
7212
7212
|
submitedFormLateTime: null
|
|
7213
7213
|
};
|
|
7214
|
-
|
|
7214
|
+
x.id ? s([...t]) : s([...t, A, v]);
|
|
7215
7215
|
}
|
|
7216
7216
|
};
|
|
7217
|
-
|
|
7218
|
-
const
|
|
7219
|
-
(
|
|
7217
|
+
p();
|
|
7218
|
+
const R = (x) => {
|
|
7219
|
+
(x.key === "isOffline" || x.key === "submitedFormLateTime") && p();
|
|
7220
7220
|
};
|
|
7221
|
-
return window.addEventListener("storage",
|
|
7222
|
-
window.removeEventListener("storage",
|
|
7221
|
+
return window.addEventListener("storage", R), () => {
|
|
7222
|
+
window.removeEventListener("storage", R);
|
|
7223
7223
|
};
|
|
7224
|
-
}, [C]),
|
|
7224
|
+
}, [C]), J(() => {
|
|
7225
7225
|
r(t[t.length - 1]);
|
|
7226
|
-
}, []),
|
|
7227
|
-
const
|
|
7228
|
-
(
|
|
7229
|
-
for (let
|
|
7230
|
-
const
|
|
7231
|
-
if (
|
|
7232
|
-
j.current =
|
|
7226
|
+
}, []), J(() => {
|
|
7227
|
+
const p = t[t.length - 1];
|
|
7228
|
+
($ == null ? void 0 : $.mid) !== (p == null ? void 0 : p.mid) && (_(p), f(100));
|
|
7229
|
+
for (let R = t.length - 1; R >= 0; R--) {
|
|
7230
|
+
const x = T(t[R]);
|
|
7231
|
+
if (x && x !== j.current) {
|
|
7232
|
+
j.current = x, l(x);
|
|
7233
7233
|
break;
|
|
7234
7234
|
}
|
|
7235
7235
|
}
|
|
@@ -7237,13 +7237,13 @@ const Nt = ({ message: u, Avatar: D }) => {
|
|
|
7237
7237
|
"div",
|
|
7238
7238
|
{
|
|
7239
7239
|
className: "sc-message-list",
|
|
7240
|
-
ref:
|
|
7240
|
+
ref: B,
|
|
7241
7241
|
style: { backgroundColor: o.messageList.bg },
|
|
7242
7242
|
children: [
|
|
7243
|
-
t.map((
|
|
7244
|
-
/* @__PURE__ */ a.jsx(Nt, { message:
|
|
7245
|
-
|
|
7246
|
-
] },
|
|
7243
|
+
t.map((p) => /* @__PURE__ */ a.jsxs(sf.Fragment, { children: [
|
|
7244
|
+
/* @__PURE__ */ a.jsx(Nt, { message: p, Avatar: u }),
|
|
7245
|
+
N(p) && C && /* @__PURE__ */ a.jsx(Rt, { phone: c })
|
|
7246
|
+
] }, p.mid)),
|
|
7247
7247
|
n && /* @__PURE__ */ a.jsx(Ot, {})
|
|
7248
7248
|
]
|
|
7249
7249
|
}
|
|
@@ -7269,27 +7269,27 @@ var rf = { exports: {} };
|
|
|
7269
7269
|
}, t.prototype.replace_emoticons_with_colons = function(n) {
|
|
7270
7270
|
var r = this;
|
|
7271
7271
|
r.init_emoticons();
|
|
7272
|
-
var s = 0, F = [], o = n.replace(r.rx_emoticons, function(l, j,
|
|
7273
|
-
var
|
|
7272
|
+
var s = 0, F = [], o = n.replace(r.rx_emoticons, function(l, j, y, C) {
|
|
7273
|
+
var T = s;
|
|
7274
7274
|
s = C + l.length;
|
|
7275
|
-
var
|
|
7276
|
-
if ((
|
|
7277
|
-
var
|
|
7278
|
-
if (
|
|
7275
|
+
var N = y.indexOf("(") !== -1, B = y.indexOf(")") !== -1;
|
|
7276
|
+
if ((N || B) && F.indexOf(y) == -1 && F.push(y), B && !N) {
|
|
7277
|
+
var $ = n.substring(T, C);
|
|
7278
|
+
if ($.indexOf("(") !== -1 && $.indexOf(")") === -1) return l;
|
|
7279
7279
|
}
|
|
7280
7280
|
if (l === `
|
|
7281
7281
|
8)`) {
|
|
7282
|
-
var
|
|
7283
|
-
if (/\n?(6\)|7\))/.test(
|
|
7282
|
+
var _ = n.substring(0, C);
|
|
7283
|
+
if (/\n?(6\)|7\))/.test(_)) return l;
|
|
7284
7284
|
}
|
|
7285
|
-
var
|
|
7286
|
-
return
|
|
7285
|
+
var p = r.data[r.map.emoticons[y]][3][0];
|
|
7286
|
+
return p ? j + ":" + p + ":" : l;
|
|
7287
7287
|
});
|
|
7288
7288
|
if (F.length) {
|
|
7289
7289
|
var d = F.map(r.escape_rx), c = new RegExp("(\\(.+)(" + d.join("|") + ")(.+\\))", "g");
|
|
7290
|
-
o = o.replace(c, function(l, j,
|
|
7291
|
-
var
|
|
7292
|
-
return
|
|
7290
|
+
o = o.replace(c, function(l, j, y, C) {
|
|
7291
|
+
var T = r.data[r.map.emoticons[y]][3][0];
|
|
7292
|
+
return T ? j + ":" + T + ":" + C : l;
|
|
7293
7293
|
});
|
|
7294
7294
|
}
|
|
7295
7295
|
return o;
|
|
@@ -7351,17 +7351,17 @@ var rf = { exports: {} };
|
|
|
7351
7351
|
if (typeof F == "object" && (c = d.replacement(F.idx, F.actual, F.wrapper, void 0, !0), l = F.idx), s = s || "", d.colons_mode) return ":" + d.data[n][3][0] + ":" + c;
|
|
7352
7352
|
var j = r ? s + r + s : d.data[n][8] || s + d.data[n][3][0] + s;
|
|
7353
7353
|
if (d.text_mode) return j + c;
|
|
7354
|
-
var
|
|
7354
|
+
var y = d.find_image(n, l);
|
|
7355
7355
|
if (d.init_env(), d.replace_mode == "softbank" && d.allow_native && d.data[n][1]) return d.format_native(d.data[n][1] + c, !o);
|
|
7356
7356
|
if (d.replace_mode == "google" && d.allow_native && d.data[n][2]) return d.format_native(d.data[n][2] + c, !o);
|
|
7357
|
-
if (
|
|
7358
|
-
var C = d.include_title ? ' title="' + (r || d.data[n][3][0]) + '"' : "",
|
|
7359
|
-
if (d.data[n][7] && (
|
|
7360
|
-
if (d.use_sheet &&
|
|
7361
|
-
var
|
|
7362
|
-
return '<span class="emoji-outer emoji-sizer"><span class="emoji-inner" style="' +
|
|
7363
|
-
} else return d.use_css_imgs ? '<span class="emoji emoji-' + n + '"' + C + ' data-codepoints="' +
|
|
7364
|
-
return '<img src="' +
|
|
7357
|
+
if (y.is_var && (c = ""), d.replace_mode == "unified" && d.allow_native) return d.format_native(y.unified + c, !o);
|
|
7358
|
+
var C = d.include_title ? ' title="' + (r || d.data[n][3][0]) + '"' : "", T = d.include_text ? s + (r || d.data[n][3][0]) + s : "";
|
|
7359
|
+
if (d.data[n][7] && (y.path = d.data[n][7], y.px = null, y.py = null, y.is_var = !1), y.is_var && d.include_text && F && F.actual && F.wrapper && (T += F.wrapper + F.actual + F.wrapper), d.replace_mode == "css")
|
|
7360
|
+
if (d.use_sheet && y.px != null && y.py != null) {
|
|
7361
|
+
var N = 100 * y.px / (d.sheet_size - 1), B = 100 * y.py / (d.sheet_size - 1), $ = 100 * d.sheet_size, _ = "background: url(" + y.sheet + ");background-position:" + N + "% " + B + "%;background-size:" + $ + "% " + $ + "%";
|
|
7362
|
+
return '<span class="emoji-outer emoji-sizer"><span class="emoji-inner" style="' + _ + '"' + C + ' data-codepoints="' + y.full_idx + '">' + T + "</span></span>" + c;
|
|
7363
|
+
} else return d.use_css_imgs ? '<span class="emoji emoji-' + n + '"' + C + ' data-codepoints="' + y.full_idx + '">' + T + "</span>" + c : '<span class="emoji emoji-sizer" style="background-image:url(' + y.path + ')"' + C + ' data-codepoints="' + y.full_idx + '">' + T + "</span>" + c;
|
|
7364
|
+
return '<img src="' + y.path + '" class="emoji" data-codepoints="' + y.full_idx + '" ' + C + "/>" + c;
|
|
7365
7365
|
}, t.prototype.format_native = function(n, r) {
|
|
7366
7366
|
var s = this;
|
|
7367
7367
|
return s.wrap_native && r ? '<span class="emoji-native">' + n + "</span>" : n;
|
|
@@ -10496,7 +10496,7 @@ const Lt = /* @__PURE__ */ Ff(It), $t = [
|
|
|
10496
10496
|
}
|
|
10497
10497
|
], Mt = ({ onBlur: u, onSelect: D }) => {
|
|
10498
10498
|
const f = pu(new Lt()), e = pu(null);
|
|
10499
|
-
|
|
10499
|
+
J(() => {
|
|
10500
10500
|
const n = e.current;
|
|
10501
10501
|
n && (n.style.opacity = "0", window.requestAnimationFrame(() => {
|
|
10502
10502
|
n.style.transition = "opacity 350ms", n.style.opacity = "1";
|
|
@@ -10541,7 +10541,7 @@ const Lt = /* @__PURE__ */ Ff(It), $t = [
|
|
|
10541
10541
|
]
|
|
10542
10542
|
}
|
|
10543
10543
|
), zt = ({ inputRef: u, onInput: D }) => {
|
|
10544
|
-
const [f, e] =
|
|
10544
|
+
const [f, e] = z(!1), t = pu(null), n = () => {
|
|
10545
10545
|
e(!f);
|
|
10546
10546
|
}, r = (o) => {
|
|
10547
10547
|
(!o.relatedTarget || o.relatedTarget !== t.current) && n();
|
|
@@ -10616,7 +10616,7 @@ const Lt = /* @__PURE__ */ Ff(It), $t = [
|
|
|
10616
10616
|
"application/json",
|
|
10617
10617
|
"text/csv"
|
|
10618
10618
|
]
|
|
10619
|
-
},
|
|
10619
|
+
}, H1 = ({
|
|
10620
10620
|
x: u = "0",
|
|
10621
10621
|
y: D = "0",
|
|
10622
10622
|
className: f = "sc-user-input--file-icon",
|
|
@@ -10637,7 +10637,7 @@ const Lt = /* @__PURE__ */ Ff(It), $t = [
|
|
|
10637
10637
|
]
|
|
10638
10638
|
}
|
|
10639
10639
|
), Vt = () => {
|
|
10640
|
-
const { setFile: u } =
|
|
10640
|
+
const { setFile: u } = Cu(), D = (t) => {
|
|
10641
10641
|
t.target.value = "";
|
|
10642
10642
|
}, f = (t) => {
|
|
10643
10643
|
t.target.files && t.target.files[0] && u && u(t.target.files[0]);
|
|
@@ -10646,7 +10646,7 @@ const Lt = /* @__PURE__ */ Ff(It), $t = [
|
|
|
10646
10646
|
[]
|
|
10647
10647
|
);
|
|
10648
10648
|
return /* @__PURE__ */ a.jsx("div", { className: "sc-user-input--file-wrapper", children: /* @__PURE__ */ a.jsxs("button", { className: "sc-user-input--file-icon-wrapper", type: "button", children: [
|
|
10649
|
-
/* @__PURE__ */ a.jsx(
|
|
10649
|
+
/* @__PURE__ */ a.jsx(H1, {}),
|
|
10650
10650
|
/* @__PURE__ */ a.jsx(
|
|
10651
10651
|
"input",
|
|
10652
10652
|
{
|
|
@@ -10658,7 +10658,7 @@ const Lt = /* @__PURE__ */ Ff(It), $t = [
|
|
|
10658
10658
|
}
|
|
10659
10659
|
)
|
|
10660
10660
|
] }) });
|
|
10661
|
-
},
|
|
10661
|
+
}, Ht = ({
|
|
10662
10662
|
x: u = "0",
|
|
10663
10663
|
y: D = "0",
|
|
10664
10664
|
className: f = "sc-user-input--location-icon",
|
|
@@ -10677,8 +10677,8 @@ const Lt = /* @__PURE__ */ Ff(It), $t = [
|
|
|
10677
10677
|
...n,
|
|
10678
10678
|
children: /* @__PURE__ */ a.jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5" })
|
|
10679
10679
|
}
|
|
10680
|
-
),
|
|
10681
|
-
const { setPayload: u, send: D } =
|
|
10680
|
+
), Wt = () => {
|
|
10681
|
+
const { setPayload: u, send: D } = Cu(), f = Bu(), e = (t) => {
|
|
10682
10682
|
navigator.geolocation ? navigator.geolocation.getCurrentPosition(
|
|
10683
10683
|
(n) => {
|
|
10684
10684
|
u({
|
|
@@ -10711,13 +10711,13 @@ const Lt = /* @__PURE__ */ Ff(It), $t = [
|
|
|
10711
10711
|
onClick: e,
|
|
10712
10712
|
type: "button",
|
|
10713
10713
|
className: "sc-user-input--location-icon-wrapper",
|
|
10714
|
-
children: /* @__PURE__ */ a.jsx(
|
|
10714
|
+
children: /* @__PURE__ */ a.jsx(Ht, {})
|
|
10715
10715
|
}
|
|
10716
10716
|
) });
|
|
10717
10717
|
};
|
|
10718
10718
|
var af = /* @__PURE__ */ ((u) => (u.web_url = "web_url", u.postback = "postback", u.nested = "nested", u))(af || {});
|
|
10719
10719
|
const Yt = ({ item: u, onPostback: D }) => {
|
|
10720
|
-
const { colors: f } =
|
|
10720
|
+
const { colors: f } = ou(), e = () => {
|
|
10721
10721
|
switch (u.type) {
|
|
10722
10722
|
case "web_url":
|
|
10723
10723
|
window.open(u.url, "_blank");
|
|
@@ -10738,12 +10738,12 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
10738
10738
|
}
|
|
10739
10739
|
) });
|
|
10740
10740
|
}, Kt = () => {
|
|
10741
|
-
const u = Bu(), { send: D, setPayload: f } =
|
|
10741
|
+
const u = Bu(), { send: D, setPayload: f } = Cu(), [e, t] = z({
|
|
10742
10742
|
title: "Menu",
|
|
10743
10743
|
type: af.nested,
|
|
10744
10744
|
call_to_actions: (u == null ? void 0 : u.menu) || []
|
|
10745
10745
|
}), n = pu(null);
|
|
10746
|
-
|
|
10746
|
+
J(() => {
|
|
10747
10747
|
t({
|
|
10748
10748
|
title: "Menu",
|
|
10749
10749
|
type: af.nested,
|
|
@@ -10802,7 +10802,7 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
10802
10802
|
}
|
|
10803
10803
|
);
|
|
10804
10804
|
}, Xt = () => {
|
|
10805
|
-
const { setPayload: u, send: D, suggestions: f } =
|
|
10805
|
+
const { setPayload: u, send: D, suggestions: f } = Cu(), e = Bu(), { colors: t } = ou(), n = (r, s) => {
|
|
10806
10806
|
u(s), D({
|
|
10807
10807
|
event: r,
|
|
10808
10808
|
source: "quick-reply",
|
|
@@ -10830,8 +10830,8 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
10830
10830
|
}
|
|
10831
10831
|
);
|
|
10832
10832
|
}, Zt = () => {
|
|
10833
|
-
var
|
|
10834
|
-
const { maxUploadSize: u } = Uu(), { t: D } = Ou(), { colors: f } =
|
|
10833
|
+
var G;
|
|
10834
|
+
const { maxUploadSize: u } = Uu(), { t: D } = Ou(), { colors: f } = ou(), {
|
|
10835
10835
|
suggestions: e,
|
|
10836
10836
|
message: t,
|
|
10837
10837
|
setMessage: n,
|
|
@@ -10842,57 +10842,57 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
10842
10842
|
isContactFormActive: d,
|
|
10843
10843
|
isOfflineMode: c,
|
|
10844
10844
|
messages: l
|
|
10845
|
-
} =
|
|
10845
|
+
} = Cu(), {
|
|
10846
10846
|
menu: j,
|
|
10847
|
-
focusOnOpen:
|
|
10847
|
+
focusOnOpen: y,
|
|
10848
10848
|
autoFlush: C,
|
|
10849
|
-
allowedUploadTypes:
|
|
10850
|
-
showEmoji:
|
|
10851
|
-
showLocation:
|
|
10852
|
-
showFile:
|
|
10853
|
-
placeholder:
|
|
10854
|
-
} = Bu(),
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
}, [t,
|
|
10858
|
-
t === "" &&
|
|
10859
|
-
}, [t]),
|
|
10860
|
-
|
|
10849
|
+
allowedUploadTypes: T,
|
|
10850
|
+
showEmoji: N,
|
|
10851
|
+
showLocation: B,
|
|
10852
|
+
showFile: $,
|
|
10853
|
+
placeholder: _
|
|
10854
|
+
} = Bu(), p = pu(null), [R, x] = z(null), [V, m] = z(!1), [A, v] = z(!1), [hu, fu] = z(!1);
|
|
10855
|
+
J(() => {
|
|
10856
|
+
y && g();
|
|
10857
|
+
}, [t, y]), J(() => {
|
|
10858
|
+
t === "" && p.current && (p.current.innerHTML = "", p.current.innerText = "");
|
|
10859
|
+
}, [t]), J(() => {
|
|
10860
|
+
x(null);
|
|
10861
10861
|
}, [r]);
|
|
10862
|
-
const
|
|
10863
|
-
s(null),
|
|
10862
|
+
const S = () => {
|
|
10863
|
+
s(null), x(null);
|
|
10864
10864
|
}, E = () => {
|
|
10865
|
-
var
|
|
10866
|
-
if (
|
|
10865
|
+
var Z, tu;
|
|
10866
|
+
if (hu) {
|
|
10867
10867
|
console.log("handleInput called but isClearing is true, ignoring");
|
|
10868
10868
|
return;
|
|
10869
10869
|
}
|
|
10870
|
-
const q = ((
|
|
10870
|
+
const q = ((Z = p.current) == null ? void 0 : Z.innerText) || ((tu = p.current) == null ? void 0 : tu.textContent) || "";
|
|
10871
10871
|
n(q);
|
|
10872
|
-
}, h = (q,
|
|
10873
|
-
if (
|
|
10872
|
+
}, h = (q, Z = "send-button") => {
|
|
10873
|
+
if (A) {
|
|
10874
10874
|
console.log("Already sending, ignoring duplicate call");
|
|
10875
10875
|
return;
|
|
10876
10876
|
}
|
|
10877
10877
|
if (t) {
|
|
10878
|
-
|
|
10879
|
-
const
|
|
10878
|
+
v(!0);
|
|
10879
|
+
const tu = t;
|
|
10880
10880
|
F({
|
|
10881
10881
|
event: q,
|
|
10882
|
-
source:
|
|
10882
|
+
source: Z,
|
|
10883
10883
|
data: {
|
|
10884
10884
|
type: Au.text,
|
|
10885
|
-
data: { text:
|
|
10885
|
+
data: { text: tu }
|
|
10886
10886
|
}
|
|
10887
10887
|
}), C ? (console.log("autoFlush is true, clearing message state and input"), n(""), setTimeout(() => {
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
}, 1)) :
|
|
10891
|
-
}, 10)) : console.log("autoFlush is false, keeping message"), setTimeout(() =>
|
|
10888
|
+
fu(!0), p.current ? (p.current.innerHTML = "", p.current.innerText = "", p.current.textContent = "", p.current.innerHTML = " ", setTimeout(() => {
|
|
10889
|
+
p.current && (p.current.innerHTML = ""), fu(!1);
|
|
10890
|
+
}, 1)) : fu(!1);
|
|
10891
|
+
}, 10)) : console.log("autoFlush is false, keeping message"), setTimeout(() => v(!1), 1e3);
|
|
10892
10892
|
}
|
|
10893
|
-
r && (
|
|
10893
|
+
r && (x(null), T.includes(r.type) || !1 ? r.size > u ? x(D("messages.file_message.unsupported_file_size")) : (F({
|
|
10894
10894
|
event: q,
|
|
10895
|
-
source:
|
|
10895
|
+
source: Z,
|
|
10896
10896
|
data: {
|
|
10897
10897
|
type: Au.file,
|
|
10898
10898
|
data: {
|
|
@@ -10902,14 +10902,14 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
10902
10902
|
file: r
|
|
10903
10903
|
}
|
|
10904
10904
|
}
|
|
10905
|
-
}), C && s(null)) :
|
|
10906
|
-
},
|
|
10905
|
+
}), C && s(null)) : x(D("messages.file_message.unsupported_file_type")));
|
|
10906
|
+
}, k = (q) => {
|
|
10907
10907
|
q.key === "Enter" && !q.shiftKey && (q.preventDefault(), q.stopPropagation(), h(q, "enter-key"));
|
|
10908
|
-
},
|
|
10908
|
+
}, g = () => {
|
|
10909
10909
|
var q;
|
|
10910
|
-
(q =
|
|
10911
|
-
}, I = o === iD.uploading,
|
|
10912
|
-
return (M || !(
|
|
10910
|
+
(q = p.current) == null || q.focus();
|
|
10911
|
+
}, I = o === iD.uploading, P = uu.getItem("profileLiveChat") || {}, M = uu.getItem("isOffline") || (P == null ? void 0 : P.isOffline), U = ((G = P == null ? void 0 : P.channel) == null ? void 0 : G.name) === "console-channel";
|
|
10912
|
+
return (M || !(P != null && P.id)) && !U ? null : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
10913
10913
|
j.length > 0 && /* @__PURE__ */ a.jsx(Kt, {}),
|
|
10914
10914
|
/* @__PURE__ */ a.jsxs("div", { className: "sc-user-input-wrapper", children: [
|
|
10915
10915
|
e.length > 0 && /* @__PURE__ */ a.jsx(Xt, {}),
|
|
@@ -10923,24 +10923,24 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
10923
10923
|
},
|
|
10924
10924
|
children: [
|
|
10925
10925
|
/* @__PURE__ */ a.jsx(
|
|
10926
|
-
|
|
10926
|
+
H1,
|
|
10927
10927
|
{
|
|
10928
10928
|
width: "16px",
|
|
10929
10929
|
height: "16px",
|
|
10930
10930
|
className: "icon-file-message"
|
|
10931
10931
|
}
|
|
10932
10932
|
),
|
|
10933
|
-
|
|
10933
|
+
R && /* @__PURE__ */ a.jsx("span", { children: R }),
|
|
10934
10934
|
I && /* @__PURE__ */ a.jsx("span", { children: "Loading..." }),
|
|
10935
|
-
r && r.name && !
|
|
10936
|
-
/* @__PURE__ */ a.jsx("span", { className: "delete-file-message", onClick:
|
|
10935
|
+
r && r.name && !R && /* @__PURE__ */ a.jsx("span", { children: r.name.length > 23 ? `${r.name.substring(0, 23)}...` : r.name }),
|
|
10936
|
+
/* @__PURE__ */ a.jsx("span", { className: "delete-file-message", onClick: S, children: /* @__PURE__ */ a.jsx(hf, { height: "10" }) })
|
|
10937
10937
|
]
|
|
10938
10938
|
}
|
|
10939
10939
|
),
|
|
10940
10940
|
/* @__PURE__ */ a.jsxs(
|
|
10941
10941
|
"form",
|
|
10942
10942
|
{
|
|
10943
|
-
className: `sc-user-input ${
|
|
10943
|
+
className: `sc-user-input ${V ? "active" : ""}`,
|
|
10944
10944
|
style: { background: f.userInput.bg },
|
|
10945
10945
|
onSubmit: (q) => {
|
|
10946
10946
|
q.preventDefault(), t && h(q, "form-submit");
|
|
@@ -10951,17 +10951,17 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
10951
10951
|
{
|
|
10952
10952
|
role: "textbox",
|
|
10953
10953
|
tabIndex: 0,
|
|
10954
|
-
onFocus: () =>
|
|
10955
|
-
onBlur: () =>
|
|
10956
|
-
onKeyDown:
|
|
10954
|
+
onFocus: () => m(!0),
|
|
10955
|
+
onBlur: () => m(!1),
|
|
10956
|
+
onKeyDown: k,
|
|
10957
10957
|
onInput: E,
|
|
10958
10958
|
onPaste: async (q) => {
|
|
10959
|
-
var
|
|
10959
|
+
var cu;
|
|
10960
10960
|
q.preventDefault();
|
|
10961
|
-
const
|
|
10962
|
-
if (
|
|
10963
|
-
const _u = document.createTextNode(
|
|
10964
|
-
|
|
10961
|
+
const Z = await navigator.clipboard.readText(), tu = (cu = window.getSelection()) == null ? void 0 : cu.getRangeAt(0);
|
|
10962
|
+
if (tu && Z) {
|
|
10963
|
+
const _u = document.createTextNode(Z);
|
|
10964
|
+
tu.deleteContents(), tu.insertNode(_u), tu.collapse(!1);
|
|
10965
10965
|
}
|
|
10966
10966
|
E();
|
|
10967
10967
|
},
|
|
@@ -10969,16 +10969,16 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
10969
10969
|
suppressContentEditableWarning: !0,
|
|
10970
10970
|
spellCheck: !0,
|
|
10971
10971
|
"aria-autocomplete": "list",
|
|
10972
|
-
placeholder:
|
|
10972
|
+
placeholder: _,
|
|
10973
10973
|
className: "sc-user-input--text",
|
|
10974
|
-
ref:
|
|
10974
|
+
ref: p,
|
|
10975
10975
|
style: { color: f.userInput.text }
|
|
10976
10976
|
}
|
|
10977
10977
|
),
|
|
10978
10978
|
/* @__PURE__ */ a.jsxs("div", { className: "sc-user-input--buttons", children: [
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10979
|
+
N && /* @__PURE__ */ a.jsx("div", { className: "sc-user-input--button", children: /* @__PURE__ */ a.jsx(zt, { inputRef: p, onInput: E }) }),
|
|
10980
|
+
B && /* @__PURE__ */ a.jsx("div", { className: "sc-user-input--button", children: /* @__PURE__ */ a.jsx(Wt, {}) }),
|
|
10981
|
+
$ && /* @__PURE__ */ a.jsx("div", { className: "sc-user-input--button", children: /* @__PURE__ */ a.jsx(Vt, {}) }),
|
|
10982
10982
|
/* @__PURE__ */ a.jsx("div", { className: "sc-user-input--button", children: /* @__PURE__ */ a.jsx(
|
|
10983
10983
|
Gt,
|
|
10984
10984
|
{
|
|
@@ -11018,8 +11018,8 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
11018
11018
|
children: /* @__PURE__ */ a.jsx("path", { stroke: "#fff", strokeOpacity: "1", d: "M15 18L9 12 15 6" })
|
|
11019
11019
|
}
|
|
11020
11020
|
), u8 = () => {
|
|
11021
|
-
const { t: u } = Ou(), { colors: D } =
|
|
11022
|
-
|
|
11021
|
+
const { t: u } = Ou(), { colors: D } = ou(), { setWebviewUrl: f, webviewUrl: e } = Cu(), [t, n] = z(!1);
|
|
11022
|
+
J(() => {
|
|
11023
11023
|
n(!0);
|
|
11024
11024
|
}, []);
|
|
11025
11025
|
const r = () => {
|
|
@@ -11045,7 +11045,7 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
11045
11045
|
PreChat: f,
|
|
11046
11046
|
PostChat: e
|
|
11047
11047
|
}) => {
|
|
11048
|
-
const { connectionState: t } =
|
|
11048
|
+
const { connectionState: t } = Cu(), { screen: n, isOpen: r } = Nu();
|
|
11049
11049
|
return /* @__PURE__ */ a.jsxs("div", { className: `sc-chat-window ${r ? "opened" : "closed"}`, children: [
|
|
11050
11050
|
/* @__PURE__ */ a.jsx($e, { children: u && /* @__PURE__ */ a.jsx(u, {}) }),
|
|
11051
11051
|
n === "prechat" && f && /* @__PURE__ */ a.jsx(f, {}),
|
|
@@ -11055,7 +11055,7 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
11055
11055
|
["prechat", "postchat", "webview"].indexOf(n) === -1 && t === 3 && /* @__PURE__ */ a.jsx(Zt, {}),
|
|
11056
11056
|
n === "webview" && /* @__PURE__ */ a.jsx(u8, {})
|
|
11057
11057
|
] });
|
|
11058
|
-
},
|
|
11058
|
+
}, W1 = ({
|
|
11059
11059
|
CustomLauncher: u,
|
|
11060
11060
|
CustomHeader: D,
|
|
11061
11061
|
CustomAvatar: f,
|
|
@@ -11063,11 +11063,11 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
11063
11063
|
PostChat: t
|
|
11064
11064
|
}) => {
|
|
11065
11065
|
Ou();
|
|
11066
|
-
const n = Uu(), r =
|
|
11066
|
+
const n = Uu(), r = Cu(), s = Nu(), { socket: F } = Wu(), { setScreen: o } = Nu(), d = Bu(), c = d.offline_mode, l = kD(c), j = (C) => {
|
|
11067
11067
|
C.preventDefault(), s.setIsOpen(!s.isOpen);
|
|
11068
11068
|
};
|
|
11069
|
-
return ke(), new URLSearchParams().append("owner_id", n.ownerId),
|
|
11070
|
-
if (!l && !
|
|
11069
|
+
return ke(), new URLSearchParams().append("owner_id", n.ownerId), J(() => {
|
|
11070
|
+
if (!l && !uu.getItem("profileLiveChat")) {
|
|
11071
11071
|
o("prechat");
|
|
11072
11072
|
return;
|
|
11073
11073
|
}
|
|
@@ -11114,94 +11114,74 @@ const Yt = ({ item: u, onPostback: D }) => {
|
|
|
11114
11114
|
}
|
|
11115
11115
|
)
|
|
11116
11116
|
] });
|
|
11117
|
-
}
|
|
11118
|
-
function f8(u) {
|
|
11119
|
-
const D = {};
|
|
11120
|
-
return Object.entries(u).forEach(([f, e]) => {
|
|
11121
|
-
if (!(typeof e != "string" || !e)) {
|
|
11122
|
-
if (f.toLowerCase().includes("phone")) {
|
|
11123
|
-
const t = e.replace(/\s+/g, ""), n = Wu.find((r) => t.startsWith(r.countryCode));
|
|
11124
|
-
if (n && t.slice(n.countryCode.length) === "")
|
|
11125
|
-
return;
|
|
11126
|
-
}
|
|
11127
|
-
D[f] = e;
|
|
11128
|
-
}
|
|
11129
|
-
}), D;
|
|
11130
|
-
}
|
|
11131
|
-
const Y1 = ({
|
|
11117
|
+
}, Y1 = ({
|
|
11132
11118
|
onFormDataSubmit: u
|
|
11133
11119
|
}) => {
|
|
11134
|
-
const D = Uu(), { t: f } = Ou(), { colors: e } =
|
|
11120
|
+
const D = Uu(), { t: f } = Ou(), { colors: e } = ou(), { socket: t } = Wu(), n = Bu(), { setScreen: r } = Nu(), {
|
|
11135
11121
|
send: s,
|
|
11136
11122
|
setMessages: F,
|
|
11137
11123
|
setConnectionState: o,
|
|
11138
11124
|
participants: d,
|
|
11139
11125
|
setParticipants: c
|
|
11140
|
-
} =
|
|
11126
|
+
} = Cu(), { formData: l, setFormData: j, renderFormField: y, errors: C, validateAll: T } = V1({
|
|
11141
11127
|
loadFromDataUserSubs: !1,
|
|
11142
11128
|
initialData: {}
|
|
11143
|
-
}),
|
|
11129
|
+
}), N = n.offline_mode, B = kD(N);
|
|
11144
11130
|
console.log(
|
|
11145
11131
|
"🚀 ~ UserSubscription.tsx:72 ~ UserSubscription ~ isOffline:",
|
|
11146
|
-
|
|
11132
|
+
B
|
|
11147
11133
|
);
|
|
11148
|
-
const
|
|
11149
|
-
async (
|
|
11150
|
-
if (
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
name: `${J.firstName} ${J.firstName}`
|
|
11177
|
-
}
|
|
11178
|
-
]), o(3), r("chat"), Object.keys(z).length === 0)
|
|
11179
|
-
return;
|
|
11180
|
-
const W = Object.entries(z).map(
|
|
11181
|
-
([E, h]) => `${E.charAt(0).toUpperCase() + E.slice(1)}: ${h}`
|
|
11182
|
-
).join(`
|
|
11134
|
+
const $ = pu(!1), _ = qu(
|
|
11135
|
+
async (p) => {
|
|
11136
|
+
if (p == null || p.preventDefault(), p == null || p.stopPropagation(), !(!uu.getItem("profileLiveChat") && !T(n.formSettings))) {
|
|
11137
|
+
Object.keys(l).length > 0 && uu.setItem("dataUserSubs", l);
|
|
11138
|
+
try {
|
|
11139
|
+
o(2);
|
|
11140
|
+
const x = new URLSearchParams();
|
|
11141
|
+
Object.entries(l).forEach(([fu, S]) => {
|
|
11142
|
+
typeof S == "string" && S.trim() && x.append(fu, S);
|
|
11143
|
+
}), x.append("contactLateTime", (/* @__PURE__ */ new Date()).toISOString()), x.append("owner_id", D.ownerId);
|
|
11144
|
+
const { body: V } = await t.get(`/webhook/${D.channel}/?${x.toString()}`), { messages: m, profile: A } = V;
|
|
11145
|
+
console.log("jump here 1"), uu.setItem("profileLiveChat", A), uu.setItem("isOffline", B || !1), uu.setItem(
|
|
11146
|
+
"submitedFormLateTime",
|
|
11147
|
+
(A == null ? void 0 : A.submitedFormLateTime) || null
|
|
11148
|
+
), m.forEach((fu) => {
|
|
11149
|
+
const S = fu.author === A.foreignId || fu.author === A.id ? Q.sent : Q.received;
|
|
11150
|
+
fu.direction = S, fu.direction === Q.sent && (fu.read = !0, fu.delivery = !1);
|
|
11151
|
+
}), F(m), c([
|
|
11152
|
+
d[0],
|
|
11153
|
+
{
|
|
11154
|
+
id: A.foreignId,
|
|
11155
|
+
foreign_id: A.foreignId,
|
|
11156
|
+
name: `${A.firstName} ${A.firstName}`
|
|
11157
|
+
}
|
|
11158
|
+
]), o(3), r("chat");
|
|
11159
|
+
const v = Object.entries(l).map(
|
|
11160
|
+
([fu, S]) => `${fu.charAt(0).toUpperCase() + fu.slice(1)}: ${S}`
|
|
11161
|
+
).join(`
|
|
11183
11162
|
`);
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11163
|
+
if (!v || v.trim().length === 0)
|
|
11164
|
+
return;
|
|
11165
|
+
const hu = {
|
|
11166
|
+
text: v,
|
|
11167
|
+
contactInfo: {
|
|
11168
|
+
...l,
|
|
11169
|
+
owner_id: D.ownerId
|
|
11170
|
+
},
|
|
11171
|
+
contactLateTime: /* @__PURE__ */ new Date()
|
|
11172
|
+
};
|
|
11173
|
+
s({
|
|
11174
|
+
event: p,
|
|
11175
|
+
source: "contact-form",
|
|
11176
|
+
data: {
|
|
11177
|
+
type: Au.text,
|
|
11178
|
+
data: hu,
|
|
11179
|
+
author: A.foreignId
|
|
11180
|
+
}
|
|
11181
|
+
});
|
|
11182
|
+
} catch (x) {
|
|
11183
|
+
console.error("Unable to subscribe user", x), r("prechat"), o(0);
|
|
11184
|
+
}
|
|
11205
11185
|
}
|
|
11206
11186
|
},
|
|
11207
11187
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -11213,26 +11193,24 @@ const Y1 = ({
|
|
|
11213
11193
|
F,
|
|
11214
11194
|
c,
|
|
11215
11195
|
r,
|
|
11216
|
-
t
|
|
11217
|
-
v,
|
|
11218
|
-
n.formSettings
|
|
11196
|
+
t
|
|
11219
11197
|
]
|
|
11220
11198
|
);
|
|
11221
|
-
return
|
|
11222
|
-
if (
|
|
11223
|
-
|
|
11224
|
-
const
|
|
11225
|
-
if (
|
|
11226
|
-
const
|
|
11227
|
-
Object.entries(
|
|
11228
|
-
|
|
11229
|
-
}), j(
|
|
11199
|
+
return J(() => {
|
|
11200
|
+
if (!$.current) {
|
|
11201
|
+
$.current = !0;
|
|
11202
|
+
const p = uu.getItem("profileLiveChat");
|
|
11203
|
+
if (p) {
|
|
11204
|
+
const R = p, x = {};
|
|
11205
|
+
Object.entries(R).forEach(([V, m]) => {
|
|
11206
|
+
m && (x[V] = m);
|
|
11207
|
+
}), j(x), _();
|
|
11230
11208
|
}
|
|
11231
11209
|
}
|
|
11232
|
-
}, [
|
|
11210
|
+
}, [_, r, B]), /* @__PURE__ */ a.jsx("div", { className: "user-subscription-wrapper", children: /* @__PURE__ */ a.jsxs("form", { className: "user-subscription", onSubmit: _, noValidate: !0, children: [
|
|
11233
11211
|
/* @__PURE__ */ a.jsx("div", { className: "user-subscription-title", children: n == null ? void 0 : n.greetingMessage }),
|
|
11234
11212
|
/* @__PURE__ */ a.jsxs("div", { className: "user-subscription-form", children: [
|
|
11235
|
-
/* @__PURE__ */ a.jsx("div", { className: "user-subscription-inputs", children: n.formSettings.sort((
|
|
11213
|
+
/* @__PURE__ */ a.jsx("div", { className: "user-subscription-inputs", children: n.formSettings.sort((p, R) => p.order - R.order).map(y) }),
|
|
11236
11214
|
/* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-authorization", children: /* @__PURE__ */ a.jsx(
|
|
11237
11215
|
"a",
|
|
11238
11216
|
{
|
|
@@ -11252,16 +11230,16 @@ const Y1 = ({
|
|
|
11252
11230
|
color: e.header.text
|
|
11253
11231
|
},
|
|
11254
11232
|
className: "user-subscription-form-button-submit",
|
|
11255
|
-
disabled: Object.values(C).some((
|
|
11233
|
+
disabled: Object.values(C).some((p) => p !== ""),
|
|
11256
11234
|
children: f("user_subscription.get_started")
|
|
11257
11235
|
}
|
|
11258
11236
|
) })
|
|
11259
11237
|
] })
|
|
11260
11238
|
] }) });
|
|
11261
|
-
},
|
|
11239
|
+
}, f8 = zu({}), e8 = ({
|
|
11262
11240
|
children: u
|
|
11263
11241
|
}) => {
|
|
11264
|
-
const D = Uu(), [f, e] =
|
|
11242
|
+
const D = Uu(), [f, e] = z(!1), t = async () => {
|
|
11265
11243
|
try {
|
|
11266
11244
|
await fetch(`${D.apiUrl}/__getcookie`, {
|
|
11267
11245
|
credentials: "include"
|
|
@@ -11270,14 +11248,14 @@ const Y1 = ({
|
|
|
11270
11248
|
console.warn("Unable to get cookies ...");
|
|
11271
11249
|
}
|
|
11272
11250
|
};
|
|
11273
|
-
return
|
|
11251
|
+
return J(() => {
|
|
11274
11252
|
f || t();
|
|
11275
|
-
}, []), f ? /* @__PURE__ */ a.jsx(
|
|
11253
|
+
}, []), f ? /* @__PURE__ */ a.jsx(f8.Provider, { value: {}, children: u }) : null;
|
|
11276
11254
|
};
|
|
11277
|
-
function
|
|
11278
|
-
return /* @__PURE__ */ a.jsx(e1, { ...u, children: /* @__PURE__ */ a.jsx(n1, { children: /* @__PURE__ */ a.jsx(
|
|
11255
|
+
function a8(u) {
|
|
11256
|
+
return /* @__PURE__ */ a.jsx(e1, { ...u, children: /* @__PURE__ */ a.jsx(n1, { children: /* @__PURE__ */ a.jsx(e8, { children: /* @__PURE__ */ a.jsx(B1, { children: /* @__PURE__ */ a.jsx(m1, { children: /* @__PURE__ */ a.jsx(x1, { children: /* @__PURE__ */ a.jsx(y1, { children: /* @__PURE__ */ a.jsx(Qf, { channelName: "main-channel", children: /* @__PURE__ */ a.jsx(w1, { children: /* @__PURE__ */ a.jsx(W1, { PreChat: Y1 }) }) }) }) }) }) }) }) }) });
|
|
11279
11257
|
}
|
|
11280
|
-
function
|
|
11258
|
+
function s8({
|
|
11281
11259
|
CustomHeader: u,
|
|
11282
11260
|
CustomAvatar: D,
|
|
11283
11261
|
config: f
|
|
@@ -11287,7 +11265,7 @@ function F8({
|
|
|
11287
11265
|
{
|
|
11288
11266
|
defaultConnectionState: tD.connected,
|
|
11289
11267
|
children: /* @__PURE__ */ a.jsx(
|
|
11290
|
-
|
|
11268
|
+
W1,
|
|
11291
11269
|
{
|
|
11292
11270
|
CustomHeader: u,
|
|
11293
11271
|
CustomAvatar: D,
|
|
@@ -11298,7 +11276,7 @@ function F8({
|
|
|
11298
11276
|
) }) }) }) }) }) }) });
|
|
11299
11277
|
}
|
|
11300
11278
|
export {
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11279
|
+
a8 as ChatWidget,
|
|
11280
|
+
uu as LocalStorageScoped,
|
|
11281
|
+
s8 as UiChatWidget
|
|
11304
11282
|
};
|