@telelogx/analytick-widget 1.0.1 → 1.0.2
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/analytick-widget.es.js +615 -618
- package/dist/analytick-widget.umd.js +1 -1
- package/package.json +1 -1
|
@@ -87,19 +87,19 @@ function $() {
|
|
|
87
87
|
}
|
|
88
88
|
function I(n2, l2, u2, t2, i2, r2, o2, e2, f2, c2, s2) {
|
|
89
89
|
var a2, h2, y2, w2, d2, g2, _2, m2 = t2 && t2.__k || v$1, b = l2.length;
|
|
90
|
-
for (f2 = P$1(u2, l2, m2, f2, b), a2 = 0; a2 < b; a2++) null != (y2 = u2.__k[a2]) && (h2 = -1 == y2.__i ? p$1 : m2[y2.__i] || p$1, y2.__i = a2, g2 = O(n2, y2, h2, i2, r2, o2, e2, f2, c2, s2), w2 = y2.__e, y2.ref && h2.ref != y2.ref && (h2.ref && B$2(h2.ref, null, y2), s2.push(y2.ref, y2.__c || w2, y2)), null == d2 && null != w2 && (d2 = w2), (_2 = !!(4 & y2.__u)) || h2.__k === y2.__k ? f2 = A$
|
|
90
|
+
for (f2 = P$1(u2, l2, m2, f2, b), a2 = 0; a2 < b; a2++) null != (y2 = u2.__k[a2]) && (h2 = -1 == y2.__i ? p$1 : m2[y2.__i] || p$1, y2.__i = a2, g2 = O(n2, y2, h2, i2, r2, o2, e2, f2, c2, s2), w2 = y2.__e, y2.ref && h2.ref != y2.ref && (h2.ref && B$2(h2.ref, null, y2), s2.push(y2.ref, y2.__c || w2, y2)), null == d2 && null != w2 && (d2 = w2), (_2 = !!(4 & y2.__u)) || h2.__k === y2.__k ? f2 = A$2(y2, f2, n2, _2) : "function" == typeof y2.type && void 0 !== g2 ? f2 = g2 : w2 && (f2 = w2.nextSibling), y2.__u &= -7);
|
|
91
91
|
return u2.__e = d2, f2;
|
|
92
92
|
}
|
|
93
93
|
function P$1(n2, l2, u2, t2, i2) {
|
|
94
94
|
var r2, o2, e2, f2, c2, s2 = u2.length, a2 = s2, h2 = 0;
|
|
95
95
|
for (n2.__k = new Array(i2), r2 = 0; r2 < i2; r2++) null != (o2 = l2[r2]) && "boolean" != typeof o2 && "function" != typeof o2 ? (f2 = r2 + h2, (o2 = n2.__k[r2] = "string" == typeof o2 || "number" == typeof o2 || "bigint" == typeof o2 || o2.constructor == String ? m$1(null, o2, null, null, null) : w$1(o2) ? m$1(k$1, { children: o2 }, null, null, null) : null == o2.constructor && o2.__b > 0 ? m$1(o2.type, o2.props, o2.key, o2.ref ? o2.ref : null, o2.__v) : o2).__ = n2, o2.__b = n2.__b + 1, e2 = null, -1 != (c2 = o2.__i = L(o2, u2, f2, a2)) && (a2--, (e2 = u2[c2]) && (e2.__u |= 2)), null == e2 || null == e2.__v ? (-1 == c2 && (i2 > s2 ? h2-- : i2 < s2 && h2++), "function" != typeof o2.type && (o2.__u |= 4)) : c2 != f2 && (c2 == f2 - 1 ? h2-- : c2 == f2 + 1 ? h2++ : (c2 > f2 ? h2-- : h2++, o2.__u |= 4))) : n2.__k[r2] = null;
|
|
96
|
-
if (a2) for (r2 = 0; r2 < s2; r2++) null != (e2 = u2[r2]) && 0 == (2 & e2.__u) && (e2.__e == t2 && (t2 = S(e2)), D$
|
|
96
|
+
if (a2) for (r2 = 0; r2 < s2; r2++) null != (e2 = u2[r2]) && 0 == (2 & e2.__u) && (e2.__e == t2 && (t2 = S(e2)), D$2(e2, e2));
|
|
97
97
|
return t2;
|
|
98
98
|
}
|
|
99
|
-
function A$
|
|
99
|
+
function A$2(n2, l2, u2, t2) {
|
|
100
100
|
var i2, r2;
|
|
101
101
|
if ("function" == typeof n2.type) {
|
|
102
|
-
for (i2 = n2.__k, r2 = 0; i2 && r2 < i2.length; r2++) i2[r2] && (i2[r2].__ = n2, l2 = A$
|
|
102
|
+
for (i2 = n2.__k, r2 = 0; i2 && r2 < i2.length; r2++) i2[r2] && (i2[r2].__ = n2, l2 = A$2(i2[r2], l2, u2, t2));
|
|
103
103
|
return l2;
|
|
104
104
|
}
|
|
105
105
|
n2.__e != l2 && (t2 && (l2 && n2.type && !l2.parentNode && (l2 = S(n2)), u2.insertBefore(n2.__e, l2 || null)), l2 = n2.__e);
|
|
@@ -247,7 +247,7 @@ function B$2(n2, u2, t2) {
|
|
|
247
247
|
l$1.__e(n3, t2);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
function D$
|
|
250
|
+
function D$2(n2, u2, t2) {
|
|
251
251
|
var i2, r2;
|
|
252
252
|
if (l$1.unmount && l$1.unmount(n2), (i2 = n2.ref) && (i2.current && i2.current != n2.__e || B$2(i2, null, u2)), null != (i2 = n2.__c)) {
|
|
253
253
|
if (i2.componentWillUnmount) try {
|
|
@@ -257,7 +257,7 @@ function D$1(n2, u2, t2) {
|
|
|
257
257
|
}
|
|
258
258
|
i2.base = i2.__P = null;
|
|
259
259
|
}
|
|
260
|
-
if (i2 = n2.__k) for (r2 = 0; r2 < i2.length; r2++) i2[r2] && D$
|
|
260
|
+
if (i2 = n2.__k) for (r2 = 0; r2 < i2.length; r2++) i2[r2] && D$2(i2[r2], u2, t2 || "function" != typeof n2.type);
|
|
261
261
|
t2 || g$1(n2.__e), n2.__c = n2.__ = n2.__e = void 0;
|
|
262
262
|
}
|
|
263
263
|
function E$1(n2, l2, u2) {
|
|
@@ -305,12 +305,316 @@ n = v$1.slice, l$1 = { __e: function(n2, l2, u2, t2) {
|
|
|
305
305
|
}, x$1.prototype.render = k$1, i$1 = [], o$1 = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, e$1 = function(n2, l2) {
|
|
306
306
|
return n2.__v.__b - l2.__v.__b;
|
|
307
307
|
}, $.__r = 0, f$2 = /(PointerCapture)$|Capture$/i, c$1 = 0, s$1 = F$1(false), a$1 = F$1(true), h$1 = 0;
|
|
308
|
-
var f$1 =
|
|
309
|
-
function
|
|
308
|
+
var t, r, u$1, i, o = 0, f$1 = [], c = l$1, e = c.__b, a = c.__r, v = c.diffed, l = c.__c, m = c.unmount, s = c.__;
|
|
309
|
+
function p(n2, t2) {
|
|
310
|
+
c.__h && c.__h(r, n2, o || t2), o = 0;
|
|
311
|
+
var u2 = r.__H || (r.__H = { __: [], __h: [] });
|
|
312
|
+
return n2 >= u2.__.length && u2.__.push({}), u2.__[n2];
|
|
313
|
+
}
|
|
314
|
+
function d(n2) {
|
|
315
|
+
return o = 1, h(D$1, n2);
|
|
316
|
+
}
|
|
317
|
+
function h(n2, u2, i2) {
|
|
318
|
+
var o2 = p(t++, 2);
|
|
319
|
+
if (o2.t = n2, !o2.__c && (o2.__ = [i2 ? i2(u2) : D$1(void 0, u2), function(n3) {
|
|
320
|
+
var t2 = o2.__N ? o2.__N[0] : o2.__[0], r2 = o2.t(t2, n3);
|
|
321
|
+
t2 !== r2 && (o2.__N = [r2, o2.__[1]], o2.__c.setState({}));
|
|
322
|
+
}], o2.__c = r, !r.__f)) {
|
|
323
|
+
var f2 = function(n3, t2, r2) {
|
|
324
|
+
if (!o2.__c.__H) return true;
|
|
325
|
+
var u3 = o2.__c.__H.__.filter(function(n4) {
|
|
326
|
+
return !!n4.__c;
|
|
327
|
+
});
|
|
328
|
+
if (u3.every(function(n4) {
|
|
329
|
+
return !n4.__N;
|
|
330
|
+
})) return !c2 || c2.call(this, n3, t2, r2);
|
|
331
|
+
var i3 = o2.__c.props !== n3;
|
|
332
|
+
return u3.forEach(function(n4) {
|
|
333
|
+
if (n4.__N) {
|
|
334
|
+
var t3 = n4.__[0];
|
|
335
|
+
n4.__ = n4.__N, n4.__N = void 0, t3 !== n4.__[0] && (i3 = true);
|
|
336
|
+
}
|
|
337
|
+
}), c2 && c2.call(this, n3, t2, r2) || i3;
|
|
338
|
+
};
|
|
339
|
+
r.__f = true;
|
|
340
|
+
var c2 = r.shouldComponentUpdate, e2 = r.componentWillUpdate;
|
|
341
|
+
r.componentWillUpdate = function(n3, t2, r2) {
|
|
342
|
+
if (this.__e) {
|
|
343
|
+
var u3 = c2;
|
|
344
|
+
c2 = void 0, f2(n3, t2, r2), c2 = u3;
|
|
345
|
+
}
|
|
346
|
+
e2 && e2.call(this, n3, t2, r2);
|
|
347
|
+
}, r.shouldComponentUpdate = f2;
|
|
348
|
+
}
|
|
349
|
+
return o2.__N || o2.__;
|
|
350
|
+
}
|
|
351
|
+
function y(n2, u2) {
|
|
352
|
+
var i2 = p(t++, 3);
|
|
353
|
+
!c.__s && C(i2.__H, u2) && (i2.__ = n2, i2.u = u2, r.__H.__h.push(i2));
|
|
354
|
+
}
|
|
355
|
+
function A$1(n2) {
|
|
356
|
+
return o = 5, T$1(function() {
|
|
357
|
+
return { current: n2 };
|
|
358
|
+
}, []);
|
|
359
|
+
}
|
|
360
|
+
function T$1(n2, r2) {
|
|
361
|
+
var u2 = p(t++, 7);
|
|
362
|
+
return C(u2.__H, r2) && (u2.__ = n2(), u2.__H = r2, u2.__h = n2), u2.__;
|
|
363
|
+
}
|
|
364
|
+
function q$1(n2, t2) {
|
|
365
|
+
return o = 8, T$1(function() {
|
|
366
|
+
return n2;
|
|
367
|
+
}, t2);
|
|
368
|
+
}
|
|
369
|
+
function x(n2) {
|
|
370
|
+
var u2 = r.context[n2.__c], i2 = p(t++, 9);
|
|
371
|
+
return i2.c = n2, u2 ? (null == i2.__ && (i2.__ = true, u2.sub(r)), u2.props.value) : n2.__;
|
|
372
|
+
}
|
|
373
|
+
function j$1() {
|
|
374
|
+
for (var n2; n2 = f$1.shift(); ) if (n2.__P && n2.__H) try {
|
|
375
|
+
n2.__H.__h.forEach(z), n2.__H.__h.forEach(B$1), n2.__H.__h = [];
|
|
376
|
+
} catch (t2) {
|
|
377
|
+
n2.__H.__h = [], c.__e(t2, n2.__v);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
c.__b = function(n2) {
|
|
381
|
+
r = null, e && e(n2);
|
|
382
|
+
}, c.__ = function(n2, t2) {
|
|
383
|
+
n2 && t2.__k && t2.__k.__m && (n2.__m = t2.__k.__m), s && s(n2, t2);
|
|
384
|
+
}, c.__r = function(n2) {
|
|
385
|
+
a && a(n2), t = 0;
|
|
386
|
+
var i2 = (r = n2.__c).__H;
|
|
387
|
+
i2 && (u$1 === r ? (i2.__h = [], r.__h = [], i2.__.forEach(function(n3) {
|
|
388
|
+
n3.__N && (n3.__ = n3.__N), n3.u = n3.__N = void 0;
|
|
389
|
+
})) : (i2.__h.forEach(z), i2.__h.forEach(B$1), i2.__h = [], t = 0)), u$1 = r;
|
|
390
|
+
}, c.diffed = function(n2) {
|
|
391
|
+
v && v(n2);
|
|
392
|
+
var t2 = n2.__c;
|
|
393
|
+
t2 && t2.__H && (t2.__H.__h.length && (1 !== f$1.push(t2) && i === c.requestAnimationFrame || ((i = c.requestAnimationFrame) || w)(j$1)), t2.__H.__.forEach(function(n3) {
|
|
394
|
+
n3.u && (n3.__H = n3.u), n3.u = void 0;
|
|
395
|
+
})), u$1 = r = null;
|
|
396
|
+
}, c.__c = function(n2, t2) {
|
|
397
|
+
t2.some(function(n3) {
|
|
398
|
+
try {
|
|
399
|
+
n3.__h.forEach(z), n3.__h = n3.__h.filter(function(n4) {
|
|
400
|
+
return !n4.__ || B$1(n4);
|
|
401
|
+
});
|
|
402
|
+
} catch (r2) {
|
|
403
|
+
t2.some(function(n4) {
|
|
404
|
+
n4.__h && (n4.__h = []);
|
|
405
|
+
}), t2 = [], c.__e(r2, n3.__v);
|
|
406
|
+
}
|
|
407
|
+
}), l && l(n2, t2);
|
|
408
|
+
}, c.unmount = function(n2) {
|
|
409
|
+
m && m(n2);
|
|
410
|
+
var t2, r2 = n2.__c;
|
|
411
|
+
r2 && r2.__H && (r2.__H.__.forEach(function(n3) {
|
|
412
|
+
try {
|
|
413
|
+
z(n3);
|
|
414
|
+
} catch (n4) {
|
|
415
|
+
t2 = n4;
|
|
416
|
+
}
|
|
417
|
+
}), r2.__H = void 0, t2 && c.__e(t2, r2.__v));
|
|
418
|
+
};
|
|
419
|
+
var k = "function" == typeof requestAnimationFrame;
|
|
420
|
+
function w(n2) {
|
|
421
|
+
var t2, r2 = function() {
|
|
422
|
+
clearTimeout(u2), k && cancelAnimationFrame(t2), setTimeout(n2);
|
|
423
|
+
}, u2 = setTimeout(r2, 35);
|
|
424
|
+
k && (t2 = requestAnimationFrame(r2));
|
|
425
|
+
}
|
|
426
|
+
function z(n2) {
|
|
427
|
+
var t2 = r, u2 = n2.__c;
|
|
428
|
+
"function" == typeof u2 && (n2.__c = void 0, u2()), r = t2;
|
|
429
|
+
}
|
|
430
|
+
function B$1(n2) {
|
|
431
|
+
var t2 = r;
|
|
432
|
+
n2.__c = n2.__(), r = t2;
|
|
433
|
+
}
|
|
434
|
+
function C(n2, t2) {
|
|
435
|
+
return !n2 || n2.length !== t2.length || t2.some(function(t3, r2) {
|
|
436
|
+
return t3 !== n2[r2];
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
function D$1(n2, t2) {
|
|
440
|
+
return "function" == typeof t2 ? t2(n2) : t2;
|
|
441
|
+
}
|
|
442
|
+
function g(n2, t2) {
|
|
443
|
+
for (var e2 in t2) n2[e2] = t2[e2];
|
|
444
|
+
return n2;
|
|
445
|
+
}
|
|
446
|
+
function E(n2, t2) {
|
|
447
|
+
for (var e2 in n2) if ("__source" !== e2 && !(e2 in t2)) return true;
|
|
448
|
+
for (var r2 in t2) if ("__source" !== r2 && n2[r2] !== t2[r2]) return true;
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
function N(n2, t2) {
|
|
452
|
+
this.props = n2, this.context = t2;
|
|
453
|
+
}
|
|
454
|
+
(N.prototype = new x$1()).isPureReactComponent = true, N.prototype.shouldComponentUpdate = function(n2, t2) {
|
|
455
|
+
return E(this.props, n2) || E(this.state, t2);
|
|
456
|
+
};
|
|
457
|
+
var T = l$1.__b;
|
|
458
|
+
l$1.__b = function(n2) {
|
|
459
|
+
n2.type && n2.type.__f && n2.ref && (n2.props.ref = n2.ref, n2.ref = null), T && T(n2);
|
|
460
|
+
};
|
|
461
|
+
var A = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.forward_ref") || 3911;
|
|
462
|
+
function D(n2) {
|
|
463
|
+
function t2(t3) {
|
|
464
|
+
var e2 = g({}, t3);
|
|
465
|
+
return delete e2.ref, n2(e2, t3.ref || null);
|
|
466
|
+
}
|
|
467
|
+
return t2.$$typeof = A, t2.render = n2, t2.prototype.isReactComponent = t2.__f = true, t2.displayName = "ForwardRef(" + (n2.displayName || n2.name) + ")", t2;
|
|
468
|
+
}
|
|
469
|
+
var F = l$1.__e;
|
|
470
|
+
l$1.__e = function(n2, t2, e2, r2) {
|
|
471
|
+
if (n2.then) {
|
|
472
|
+
for (var u2, o2 = t2; o2 = o2.__; ) if ((u2 = o2.__c) && u2.__c) return null == t2.__e && (t2.__e = e2.__e, t2.__k = e2.__k), u2.__c(n2, t2);
|
|
473
|
+
}
|
|
474
|
+
F(n2, t2, e2, r2);
|
|
475
|
+
};
|
|
476
|
+
var U = l$1.unmount;
|
|
477
|
+
function V(n2, t2, e2) {
|
|
478
|
+
return n2 && (n2.__c && n2.__c.__H && (n2.__c.__H.__.forEach(function(n3) {
|
|
479
|
+
"function" == typeof n3.__c && n3.__c();
|
|
480
|
+
}), n2.__c.__H = null), null != (n2 = g({}, n2)).__c && (n2.__c.__P === e2 && (n2.__c.__P = t2), n2.__c.__e = true, n2.__c = null), n2.__k = n2.__k && n2.__k.map(function(n3) {
|
|
481
|
+
return V(n3, t2, e2);
|
|
482
|
+
})), n2;
|
|
483
|
+
}
|
|
484
|
+
function W(n2, t2, e2) {
|
|
485
|
+
return n2 && e2 && (n2.__v = null, n2.__k = n2.__k && n2.__k.map(function(n3) {
|
|
486
|
+
return W(n3, t2, e2);
|
|
487
|
+
}), n2.__c && n2.__c.__P === t2 && (n2.__e && e2.appendChild(n2.__e), n2.__c.__e = true, n2.__c.__P = e2)), n2;
|
|
488
|
+
}
|
|
489
|
+
function P() {
|
|
490
|
+
this.__u = 0, this.o = null, this.__b = null;
|
|
491
|
+
}
|
|
492
|
+
function j(n2) {
|
|
493
|
+
var t2 = n2.__.__c;
|
|
494
|
+
return t2 && t2.__a && t2.__a(n2);
|
|
495
|
+
}
|
|
496
|
+
function B() {
|
|
497
|
+
this.i = null, this.l = null;
|
|
498
|
+
}
|
|
499
|
+
l$1.unmount = function(n2) {
|
|
500
|
+
var t2 = n2.__c;
|
|
501
|
+
t2 && t2.__R && t2.__R(), t2 && 32 & n2.__u && (n2.type = null), U && U(n2);
|
|
502
|
+
}, (P.prototype = new x$1()).__c = function(n2, t2) {
|
|
503
|
+
var e2 = t2.__c, r2 = this;
|
|
504
|
+
null == r2.o && (r2.o = []), r2.o.push(e2);
|
|
505
|
+
var u2 = j(r2.__v), o2 = false, i2 = function() {
|
|
506
|
+
o2 || (o2 = true, e2.__R = null, u2 ? u2(l2) : l2());
|
|
507
|
+
};
|
|
508
|
+
e2.__R = i2;
|
|
509
|
+
var l2 = function() {
|
|
510
|
+
if (!--r2.__u) {
|
|
511
|
+
if (r2.state.__a) {
|
|
512
|
+
var n3 = r2.state.__a;
|
|
513
|
+
r2.__v.__k[0] = W(n3, n3.__c.__P, n3.__c.__O);
|
|
514
|
+
}
|
|
515
|
+
var t3;
|
|
516
|
+
for (r2.setState({ __a: r2.__b = null }); t3 = r2.o.pop(); ) t3.forceUpdate();
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
r2.__u++ || 32 & t2.__u || r2.setState({ __a: r2.__b = r2.__v.__k[0] }), n2.then(i2, i2);
|
|
520
|
+
}, P.prototype.componentWillUnmount = function() {
|
|
521
|
+
this.o = [];
|
|
522
|
+
}, P.prototype.render = function(n2, e2) {
|
|
523
|
+
if (this.__b) {
|
|
524
|
+
if (this.__v.__k) {
|
|
525
|
+
var r2 = document.createElement("div"), o2 = this.__v.__k[0].__c;
|
|
526
|
+
this.__v.__k[0] = V(this.__b, r2, o2.__O = o2.__P);
|
|
527
|
+
}
|
|
528
|
+
this.__b = null;
|
|
529
|
+
}
|
|
530
|
+
var i2 = e2.__a && _(k$1, null, n2.fallback);
|
|
531
|
+
return i2 && (i2.__u &= -33), [_(k$1, null, e2.__a ? null : n2.children), i2];
|
|
532
|
+
};
|
|
533
|
+
var H = function(n2, t2, e2) {
|
|
534
|
+
if (++e2[1] === e2[0] && n2.l.delete(t2), n2.props.revealOrder && ("t" !== n2.props.revealOrder[0] || !n2.l.size)) for (e2 = n2.i; e2; ) {
|
|
535
|
+
for (; e2.length > 3; ) e2.pop()();
|
|
536
|
+
if (e2[1] < e2[0]) break;
|
|
537
|
+
n2.i = e2 = e2[2];
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
(B.prototype = new x$1()).__a = function(n2) {
|
|
541
|
+
var t2 = this, e2 = j(t2.__v), r2 = t2.l.get(n2);
|
|
542
|
+
return r2[0]++, function(u2) {
|
|
543
|
+
var o2 = function() {
|
|
544
|
+
t2.props.revealOrder ? (r2.push(u2), H(t2, n2, r2)) : u2();
|
|
545
|
+
};
|
|
546
|
+
e2 ? e2(o2) : o2();
|
|
547
|
+
};
|
|
548
|
+
}, B.prototype.render = function(n2) {
|
|
549
|
+
this.i = null, this.l = /* @__PURE__ */ new Map();
|
|
550
|
+
var t2 = H$1(n2.children);
|
|
551
|
+
n2.revealOrder && "b" === n2.revealOrder[0] && t2.reverse();
|
|
552
|
+
for (var e2 = t2.length; e2--; ) this.l.set(t2[e2], this.i = [1, 0, this.i]);
|
|
553
|
+
return n2.children;
|
|
554
|
+
}, B.prototype.componentDidUpdate = B.prototype.componentDidMount = function() {
|
|
555
|
+
var n2 = this;
|
|
556
|
+
this.l.forEach(function(t2, e2) {
|
|
557
|
+
H(n2, e2, t2);
|
|
558
|
+
});
|
|
559
|
+
};
|
|
560
|
+
var q = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, G = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, J = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, K = /[A-Z0-9]/g, Q = "undefined" != typeof document, X = function(n2) {
|
|
561
|
+
return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/ : /fil|che|ra/).test(n2);
|
|
562
|
+
};
|
|
563
|
+
x$1.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t2) {
|
|
564
|
+
Object.defineProperty(x$1.prototype, t2, { configurable: true, get: function() {
|
|
565
|
+
return this["UNSAFE_" + t2];
|
|
566
|
+
}, set: function(n2) {
|
|
567
|
+
Object.defineProperty(this, t2, { configurable: true, writable: true, value: n2 });
|
|
568
|
+
} });
|
|
569
|
+
});
|
|
570
|
+
var en = l$1.event;
|
|
571
|
+
function rn() {
|
|
572
|
+
}
|
|
573
|
+
function un() {
|
|
574
|
+
return this.cancelBubble;
|
|
575
|
+
}
|
|
576
|
+
function on() {
|
|
577
|
+
return this.defaultPrevented;
|
|
578
|
+
}
|
|
579
|
+
l$1.event = function(n2) {
|
|
580
|
+
return en && (n2 = en(n2)), n2.persist = rn, n2.isPropagationStopped = un, n2.isDefaultPrevented = on, n2.nativeEvent = n2;
|
|
581
|
+
};
|
|
582
|
+
var cn = { enumerable: false, configurable: true, get: function() {
|
|
583
|
+
return this.class;
|
|
584
|
+
} }, fn = l$1.vnode;
|
|
585
|
+
l$1.vnode = function(n2) {
|
|
586
|
+
"string" == typeof n2.type && (function(n3) {
|
|
587
|
+
var t2 = n3.props, e2 = n3.type, u2 = {}, o2 = -1 === e2.indexOf("-");
|
|
588
|
+
for (var i2 in t2) {
|
|
589
|
+
var l2 = t2[i2];
|
|
590
|
+
if (!("value" === i2 && "defaultValue" in t2 && null == l2 || Q && "children" === i2 && "noscript" === e2 || "class" === i2 || "className" === i2)) {
|
|
591
|
+
var c2 = i2.toLowerCase();
|
|
592
|
+
"defaultValue" === i2 && "value" in t2 && null == t2.value ? i2 = "value" : "download" === i2 && true === l2 ? l2 = "" : "translate" === c2 && "no" === l2 ? l2 = false : "o" === c2[0] && "n" === c2[1] ? "ondoubleclick" === c2 ? i2 = "ondblclick" : "onchange" !== c2 || "input" !== e2 && "textarea" !== e2 || X(t2.type) ? "onfocus" === c2 ? i2 = "onfocusin" : "onblur" === c2 ? i2 = "onfocusout" : J.test(i2) && (i2 = c2) : c2 = i2 = "oninput" : o2 && G.test(i2) ? i2 = i2.replace(K, "-$&").toLowerCase() : null === l2 && (l2 = void 0), "oninput" === c2 && u2[i2 = c2] && (i2 = "oninputCapture"), u2[i2] = l2;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
"select" == e2 && u2.multiple && Array.isArray(u2.value) && (u2.value = H$1(t2.children).forEach(function(n4) {
|
|
596
|
+
n4.props.selected = -1 != u2.value.indexOf(n4.props.value);
|
|
597
|
+
})), "select" == e2 && null != u2.defaultValue && (u2.value = H$1(t2.children).forEach(function(n4) {
|
|
598
|
+
n4.props.selected = u2.multiple ? -1 != u2.defaultValue.indexOf(n4.props.value) : u2.defaultValue == n4.props.value;
|
|
599
|
+
})), t2.class && !t2.className ? (u2.class = t2.class, Object.defineProperty(u2, "className", cn)) : (t2.className && !t2.class || t2.class && t2.className) && (u2.class = u2.className = t2.className), n3.props = u2;
|
|
600
|
+
})(n2), n2.$$typeof = q, fn && fn(n2);
|
|
601
|
+
};
|
|
602
|
+
var an = l$1.__r;
|
|
603
|
+
l$1.__r = function(n2) {
|
|
604
|
+
an && an(n2), n2.__c;
|
|
605
|
+
};
|
|
606
|
+
var sn = l$1.diffed;
|
|
607
|
+
l$1.diffed = function(n2) {
|
|
608
|
+
sn && sn(n2);
|
|
609
|
+
var t2 = n2.props, e2 = n2.__e;
|
|
610
|
+
null != e2 && "textarea" === n2.type && "value" in t2 && t2.value !== e2.value && (e2.value = null == t2.value ? "" : t2.value);
|
|
611
|
+
};
|
|
612
|
+
var f = 0;
|
|
613
|
+
function u(e2, t2, n2, o2, i2, u2) {
|
|
310
614
|
t2 || (t2 = {});
|
|
311
615
|
var a2, c2, p2 = t2;
|
|
312
616
|
if ("ref" in p2) for (c2 in p2 = {}, t2) "ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
|
|
313
|
-
var l2 = { type: e2, props: p2, key: n2, ref: a2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --f
|
|
617
|
+
var l2 = { type: e2, props: p2, key: n2, ref: a2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --f, __i: -1, __u: 0, __source: i2, __self: u2 };
|
|
314
618
|
if ("function" == typeof e2 && (a2 = e2.defaultProps)) for (c2 in a2) void 0 === p2[c2] && (p2[c2] = a2[c2]);
|
|
315
619
|
return l$1.vnode && l$1.vnode(l2), l2;
|
|
316
620
|
}
|
|
@@ -1558,176 +1862,42 @@ class Client {
|
|
|
1558
1862
|
*/
|
|
1559
1863
|
abort(transactionId) {
|
|
1560
1864
|
this._checkConnection();
|
|
1561
|
-
this._stompHandler.abort(transactionId);
|
|
1562
|
-
}
|
|
1563
|
-
/**
|
|
1564
|
-
* ACK a message. It is preferable to acknowledge a message by calling [ack]{@link IMessage#ack} directly
|
|
1565
|
-
* on the {@link IMessage} handled by a subscription callback:
|
|
1566
|
-
*
|
|
1567
|
-
* ```javascript
|
|
1568
|
-
* var callback = function (message) {
|
|
1569
|
-
* // process the message
|
|
1570
|
-
* // acknowledge it
|
|
1571
|
-
* message.ack();
|
|
1572
|
-
* };
|
|
1573
|
-
* client.subscribe(destination, callback, {'ack': 'client'});
|
|
1574
|
-
* ```
|
|
1575
|
-
*/
|
|
1576
|
-
ack(messageId, subscriptionId, headers = {}) {
|
|
1577
|
-
this._checkConnection();
|
|
1578
|
-
this._stompHandler.ack(messageId, subscriptionId, headers);
|
|
1579
|
-
}
|
|
1580
|
-
/**
|
|
1581
|
-
* NACK a message. It is preferable to acknowledge a message by calling [nack]{@link IMessage#nack} directly
|
|
1582
|
-
* on the {@link IMessage} handled by a subscription callback:
|
|
1583
|
-
*
|
|
1584
|
-
* ```javascript
|
|
1585
|
-
* var callback = function (message) {
|
|
1586
|
-
* // process the message
|
|
1587
|
-
* // an error occurs, nack it
|
|
1588
|
-
* message.nack();
|
|
1589
|
-
* };
|
|
1590
|
-
* client.subscribe(destination, callback, {'ack': 'client'});
|
|
1591
|
-
* ```
|
|
1592
|
-
*/
|
|
1593
|
-
nack(messageId, subscriptionId, headers = {}) {
|
|
1594
|
-
this._checkConnection();
|
|
1595
|
-
this._stompHandler.nack(messageId, subscriptionId, headers);
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
var t, r, u, i, o = 0, f = [], c = l$1, e = c.__b, a = c.__r, v = c.diffed, l = c.__c, m = c.unmount, s = c.__;
|
|
1599
|
-
function p(n2, t2) {
|
|
1600
|
-
c.__h && c.__h(r, n2, o || t2), o = 0;
|
|
1601
|
-
var u2 = r.__H || (r.__H = { __: [], __h: [] });
|
|
1602
|
-
return n2 >= u2.__.length && u2.__.push({}), u2.__[n2];
|
|
1603
|
-
}
|
|
1604
|
-
function d(n2) {
|
|
1605
|
-
return o = 1, h(D, n2);
|
|
1606
|
-
}
|
|
1607
|
-
function h(n2, u2, i2) {
|
|
1608
|
-
var o2 = p(t++, 2);
|
|
1609
|
-
if (o2.t = n2, !o2.__c && (o2.__ = [i2 ? i2(u2) : D(void 0, u2), function(n3) {
|
|
1610
|
-
var t2 = o2.__N ? o2.__N[0] : o2.__[0], r2 = o2.t(t2, n3);
|
|
1611
|
-
t2 !== r2 && (o2.__N = [r2, o2.__[1]], o2.__c.setState({}));
|
|
1612
|
-
}], o2.__c = r, !r.__f)) {
|
|
1613
|
-
var f2 = function(n3, t2, r2) {
|
|
1614
|
-
if (!o2.__c.__H) return true;
|
|
1615
|
-
var u3 = o2.__c.__H.__.filter(function(n4) {
|
|
1616
|
-
return !!n4.__c;
|
|
1617
|
-
});
|
|
1618
|
-
if (u3.every(function(n4) {
|
|
1619
|
-
return !n4.__N;
|
|
1620
|
-
})) return !c2 || c2.call(this, n3, t2, r2);
|
|
1621
|
-
var i3 = o2.__c.props !== n3;
|
|
1622
|
-
return u3.forEach(function(n4) {
|
|
1623
|
-
if (n4.__N) {
|
|
1624
|
-
var t3 = n4.__[0];
|
|
1625
|
-
n4.__ = n4.__N, n4.__N = void 0, t3 !== n4.__[0] && (i3 = true);
|
|
1626
|
-
}
|
|
1627
|
-
}), c2 && c2.call(this, n3, t2, r2) || i3;
|
|
1628
|
-
};
|
|
1629
|
-
r.__f = true;
|
|
1630
|
-
var c2 = r.shouldComponentUpdate, e2 = r.componentWillUpdate;
|
|
1631
|
-
r.componentWillUpdate = function(n3, t2, r2) {
|
|
1632
|
-
if (this.__e) {
|
|
1633
|
-
var u3 = c2;
|
|
1634
|
-
c2 = void 0, f2(n3, t2, r2), c2 = u3;
|
|
1635
|
-
}
|
|
1636
|
-
e2 && e2.call(this, n3, t2, r2);
|
|
1637
|
-
}, r.shouldComponentUpdate = f2;
|
|
1638
|
-
}
|
|
1639
|
-
return o2.__N || o2.__;
|
|
1640
|
-
}
|
|
1641
|
-
function y(n2, u2) {
|
|
1642
|
-
var i2 = p(t++, 3);
|
|
1643
|
-
!c.__s && C(i2.__H, u2) && (i2.__ = n2, i2.u = u2, r.__H.__h.push(i2));
|
|
1644
|
-
}
|
|
1645
|
-
function A(n2) {
|
|
1646
|
-
return o = 5, T$1(function() {
|
|
1647
|
-
return { current: n2 };
|
|
1648
|
-
}, []);
|
|
1649
|
-
}
|
|
1650
|
-
function T$1(n2, r2) {
|
|
1651
|
-
var u2 = p(t++, 7);
|
|
1652
|
-
return C(u2.__H, r2) && (u2.__ = n2(), u2.__H = r2, u2.__h = n2), u2.__;
|
|
1653
|
-
}
|
|
1654
|
-
function q$1(n2, t2) {
|
|
1655
|
-
return o = 8, T$1(function() {
|
|
1656
|
-
return n2;
|
|
1657
|
-
}, t2);
|
|
1658
|
-
}
|
|
1659
|
-
function x(n2) {
|
|
1660
|
-
var u2 = r.context[n2.__c], i2 = p(t++, 9);
|
|
1661
|
-
return i2.c = n2, u2 ? (null == i2.__ && (i2.__ = true, u2.sub(r)), u2.props.value) : n2.__;
|
|
1662
|
-
}
|
|
1663
|
-
function j$1() {
|
|
1664
|
-
for (var n2; n2 = f.shift(); ) if (n2.__P && n2.__H) try {
|
|
1665
|
-
n2.__H.__h.forEach(z), n2.__H.__h.forEach(B$1), n2.__H.__h = [];
|
|
1666
|
-
} catch (t2) {
|
|
1667
|
-
n2.__H.__h = [], c.__e(t2, n2.__v);
|
|
1865
|
+
this._stompHandler.abort(transactionId);
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* ACK a message. It is preferable to acknowledge a message by calling [ack]{@link IMessage#ack} directly
|
|
1869
|
+
* on the {@link IMessage} handled by a subscription callback:
|
|
1870
|
+
*
|
|
1871
|
+
* ```javascript
|
|
1872
|
+
* var callback = function (message) {
|
|
1873
|
+
* // process the message
|
|
1874
|
+
* // acknowledge it
|
|
1875
|
+
* message.ack();
|
|
1876
|
+
* };
|
|
1877
|
+
* client.subscribe(destination, callback, {'ack': 'client'});
|
|
1878
|
+
* ```
|
|
1879
|
+
*/
|
|
1880
|
+
ack(messageId, subscriptionId, headers = {}) {
|
|
1881
|
+
this._checkConnection();
|
|
1882
|
+
this._stompHandler.ack(messageId, subscriptionId, headers);
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* NACK a message. It is preferable to acknowledge a message by calling [nack]{@link IMessage#nack} directly
|
|
1886
|
+
* on the {@link IMessage} handled by a subscription callback:
|
|
1887
|
+
*
|
|
1888
|
+
* ```javascript
|
|
1889
|
+
* var callback = function (message) {
|
|
1890
|
+
* // process the message
|
|
1891
|
+
* // an error occurs, nack it
|
|
1892
|
+
* message.nack();
|
|
1893
|
+
* };
|
|
1894
|
+
* client.subscribe(destination, callback, {'ack': 'client'});
|
|
1895
|
+
* ```
|
|
1896
|
+
*/
|
|
1897
|
+
nack(messageId, subscriptionId, headers = {}) {
|
|
1898
|
+
this._checkConnection();
|
|
1899
|
+
this._stompHandler.nack(messageId, subscriptionId, headers);
|
|
1668
1900
|
}
|
|
1669
|
-
}
|
|
1670
|
-
c.__b = function(n2) {
|
|
1671
|
-
r = null, e && e(n2);
|
|
1672
|
-
}, c.__ = function(n2, t2) {
|
|
1673
|
-
n2 && t2.__k && t2.__k.__m && (n2.__m = t2.__k.__m), s && s(n2, t2);
|
|
1674
|
-
}, c.__r = function(n2) {
|
|
1675
|
-
a && a(n2), t = 0;
|
|
1676
|
-
var i2 = (r = n2.__c).__H;
|
|
1677
|
-
i2 && (u === r ? (i2.__h = [], r.__h = [], i2.__.forEach(function(n3) {
|
|
1678
|
-
n3.__N && (n3.__ = n3.__N), n3.u = n3.__N = void 0;
|
|
1679
|
-
})) : (i2.__h.forEach(z), i2.__h.forEach(B$1), i2.__h = [], t = 0)), u = r;
|
|
1680
|
-
}, c.diffed = function(n2) {
|
|
1681
|
-
v && v(n2);
|
|
1682
|
-
var t2 = n2.__c;
|
|
1683
|
-
t2 && t2.__H && (t2.__H.__h.length && (1 !== f.push(t2) && i === c.requestAnimationFrame || ((i = c.requestAnimationFrame) || w)(j$1)), t2.__H.__.forEach(function(n3) {
|
|
1684
|
-
n3.u && (n3.__H = n3.u), n3.u = void 0;
|
|
1685
|
-
})), u = r = null;
|
|
1686
|
-
}, c.__c = function(n2, t2) {
|
|
1687
|
-
t2.some(function(n3) {
|
|
1688
|
-
try {
|
|
1689
|
-
n3.__h.forEach(z), n3.__h = n3.__h.filter(function(n4) {
|
|
1690
|
-
return !n4.__ || B$1(n4);
|
|
1691
|
-
});
|
|
1692
|
-
} catch (r2) {
|
|
1693
|
-
t2.some(function(n4) {
|
|
1694
|
-
n4.__h && (n4.__h = []);
|
|
1695
|
-
}), t2 = [], c.__e(r2, n3.__v);
|
|
1696
|
-
}
|
|
1697
|
-
}), l && l(n2, t2);
|
|
1698
|
-
}, c.unmount = function(n2) {
|
|
1699
|
-
m && m(n2);
|
|
1700
|
-
var t2, r2 = n2.__c;
|
|
1701
|
-
r2 && r2.__H && (r2.__H.__.forEach(function(n3) {
|
|
1702
|
-
try {
|
|
1703
|
-
z(n3);
|
|
1704
|
-
} catch (n4) {
|
|
1705
|
-
t2 = n4;
|
|
1706
|
-
}
|
|
1707
|
-
}), r2.__H = void 0, t2 && c.__e(t2, r2.__v));
|
|
1708
|
-
};
|
|
1709
|
-
var k = "function" == typeof requestAnimationFrame;
|
|
1710
|
-
function w(n2) {
|
|
1711
|
-
var t2, r2 = function() {
|
|
1712
|
-
clearTimeout(u2), k && cancelAnimationFrame(t2), setTimeout(n2);
|
|
1713
|
-
}, u2 = setTimeout(r2, 35);
|
|
1714
|
-
k && (t2 = requestAnimationFrame(r2));
|
|
1715
|
-
}
|
|
1716
|
-
function z(n2) {
|
|
1717
|
-
var t2 = r, u2 = n2.__c;
|
|
1718
|
-
"function" == typeof u2 && (n2.__c = void 0, u2()), r = t2;
|
|
1719
|
-
}
|
|
1720
|
-
function B$1(n2) {
|
|
1721
|
-
var t2 = r;
|
|
1722
|
-
n2.__c = n2.__(), r = t2;
|
|
1723
|
-
}
|
|
1724
|
-
function C(n2, t2) {
|
|
1725
|
-
return !n2 || n2.length !== t2.length || t2.some(function(t3, r2) {
|
|
1726
|
-
return t3 !== n2[r2];
|
|
1727
|
-
});
|
|
1728
|
-
}
|
|
1729
|
-
function D(n2, t2) {
|
|
1730
|
-
return "function" == typeof t2 ? t2(n2) : t2;
|
|
1731
1901
|
}
|
|
1732
1902
|
const StompConnectionContext = Q$1(null);
|
|
1733
1903
|
const useStompConnectionContext = () => {
|
|
@@ -1739,15 +1909,15 @@ const useStompConnectionContext = () => {
|
|
|
1739
1909
|
};
|
|
1740
1910
|
const StompConnectionProvider = ({ children }) => {
|
|
1741
1911
|
const [connectionState, setConnectionState] = d("disconnected");
|
|
1742
|
-
const clientRef = A(null);
|
|
1743
|
-
const configRef = A(null);
|
|
1744
|
-
const userRef = A(null);
|
|
1745
|
-
const isConnectingRef = A(false);
|
|
1746
|
-
const connectionStateRef = A("disconnected");
|
|
1747
|
-
const subscriptionsRef = A(/* @__PURE__ */ new Map());
|
|
1748
|
-
const messageCallbacksRef = A(/* @__PURE__ */ new Set());
|
|
1749
|
-
const announcementCallbacksRef = A(/* @__PURE__ */ new Set());
|
|
1750
|
-
const tokenRefreshCallbacksRef = A(/* @__PURE__ */ new Set());
|
|
1912
|
+
const clientRef = A$1(null);
|
|
1913
|
+
const configRef = A$1(null);
|
|
1914
|
+
const userRef = A$1(null);
|
|
1915
|
+
const isConnectingRef = A$1(false);
|
|
1916
|
+
const connectionStateRef = A$1("disconnected");
|
|
1917
|
+
const subscriptionsRef = A$1(/* @__PURE__ */ new Map());
|
|
1918
|
+
const messageCallbacksRef = A$1(/* @__PURE__ */ new Set());
|
|
1919
|
+
const announcementCallbacksRef = A$1(/* @__PURE__ */ new Set());
|
|
1920
|
+
const tokenRefreshCallbacksRef = A$1(/* @__PURE__ */ new Set());
|
|
1751
1921
|
const updateConnectionState = q$1((state) => {
|
|
1752
1922
|
if (connectionStateRef.current !== state) {
|
|
1753
1923
|
console.log("STOMP Context: Connection state changed from", connectionStateRef.current, "to", state);
|
|
@@ -1989,11 +2159,11 @@ const StompConnectionProvider = ({ children }) => {
|
|
|
1989
2159
|
onAnnouncement,
|
|
1990
2160
|
onTokenRefresh
|
|
1991
2161
|
};
|
|
1992
|
-
return /* @__PURE__ */ u
|
|
2162
|
+
return /* @__PURE__ */ u(StompConnectionContext.Provider, { value: contextValue, children });
|
|
1993
2163
|
};
|
|
1994
2164
|
const WidgetContext = Q$1(null);
|
|
1995
2165
|
const WidgetProvider = ({ value, children }) => {
|
|
1996
|
-
return /* @__PURE__ */ u
|
|
2166
|
+
return /* @__PURE__ */ u(WidgetContext.Provider, { value, children });
|
|
1997
2167
|
};
|
|
1998
2168
|
const useWidgetContext = () => {
|
|
1999
2169
|
const context = x(WidgetContext);
|
|
@@ -4540,168 +4710,6 @@ class Browser {
|
|
|
4540
4710
|
}
|
|
4541
4711
|
}
|
|
4542
4712
|
Browser.type = "languageDetector";
|
|
4543
|
-
function g(n2, t2) {
|
|
4544
|
-
for (var e2 in t2) n2[e2] = t2[e2];
|
|
4545
|
-
return n2;
|
|
4546
|
-
}
|
|
4547
|
-
function E(n2, t2) {
|
|
4548
|
-
for (var e2 in n2) if ("__source" !== e2 && !(e2 in t2)) return true;
|
|
4549
|
-
for (var r2 in t2) if ("__source" !== r2 && n2[r2] !== t2[r2]) return true;
|
|
4550
|
-
return false;
|
|
4551
|
-
}
|
|
4552
|
-
function N(n2, t2) {
|
|
4553
|
-
this.props = n2, this.context = t2;
|
|
4554
|
-
}
|
|
4555
|
-
(N.prototype = new x$1()).isPureReactComponent = true, N.prototype.shouldComponentUpdate = function(n2, t2) {
|
|
4556
|
-
return E(this.props, n2) || E(this.state, t2);
|
|
4557
|
-
};
|
|
4558
|
-
var T = l$1.__b;
|
|
4559
|
-
l$1.__b = function(n2) {
|
|
4560
|
-
n2.type && n2.type.__f && n2.ref && (n2.props.ref = n2.ref, n2.ref = null), T && T(n2);
|
|
4561
|
-
};
|
|
4562
|
-
var F = l$1.__e;
|
|
4563
|
-
l$1.__e = function(n2, t2, e2, r2) {
|
|
4564
|
-
if (n2.then) {
|
|
4565
|
-
for (var u2, o2 = t2; o2 = o2.__; ) if ((u2 = o2.__c) && u2.__c) return null == t2.__e && (t2.__e = e2.__e, t2.__k = e2.__k), u2.__c(n2, t2);
|
|
4566
|
-
}
|
|
4567
|
-
F(n2, t2, e2, r2);
|
|
4568
|
-
};
|
|
4569
|
-
var U = l$1.unmount;
|
|
4570
|
-
function V(n2, t2, e2) {
|
|
4571
|
-
return n2 && (n2.__c && n2.__c.__H && (n2.__c.__H.__.forEach(function(n3) {
|
|
4572
|
-
"function" == typeof n3.__c && n3.__c();
|
|
4573
|
-
}), n2.__c.__H = null), null != (n2 = g({}, n2)).__c && (n2.__c.__P === e2 && (n2.__c.__P = t2), n2.__c.__e = true, n2.__c = null), n2.__k = n2.__k && n2.__k.map(function(n3) {
|
|
4574
|
-
return V(n3, t2, e2);
|
|
4575
|
-
})), n2;
|
|
4576
|
-
}
|
|
4577
|
-
function W(n2, t2, e2) {
|
|
4578
|
-
return n2 && e2 && (n2.__v = null, n2.__k = n2.__k && n2.__k.map(function(n3) {
|
|
4579
|
-
return W(n3, t2, e2);
|
|
4580
|
-
}), n2.__c && n2.__c.__P === t2 && (n2.__e && e2.appendChild(n2.__e), n2.__c.__e = true, n2.__c.__P = e2)), n2;
|
|
4581
|
-
}
|
|
4582
|
-
function P() {
|
|
4583
|
-
this.__u = 0, this.o = null, this.__b = null;
|
|
4584
|
-
}
|
|
4585
|
-
function j(n2) {
|
|
4586
|
-
var t2 = n2.__.__c;
|
|
4587
|
-
return t2 && t2.__a && t2.__a(n2);
|
|
4588
|
-
}
|
|
4589
|
-
function B() {
|
|
4590
|
-
this.i = null, this.l = null;
|
|
4591
|
-
}
|
|
4592
|
-
l$1.unmount = function(n2) {
|
|
4593
|
-
var t2 = n2.__c;
|
|
4594
|
-
t2 && t2.__R && t2.__R(), t2 && 32 & n2.__u && (n2.type = null), U && U(n2);
|
|
4595
|
-
}, (P.prototype = new x$1()).__c = function(n2, t2) {
|
|
4596
|
-
var e2 = t2.__c, r2 = this;
|
|
4597
|
-
null == r2.o && (r2.o = []), r2.o.push(e2);
|
|
4598
|
-
var u2 = j(r2.__v), o2 = false, i2 = function() {
|
|
4599
|
-
o2 || (o2 = true, e2.__R = null, u2 ? u2(l2) : l2());
|
|
4600
|
-
};
|
|
4601
|
-
e2.__R = i2;
|
|
4602
|
-
var l2 = function() {
|
|
4603
|
-
if (!--r2.__u) {
|
|
4604
|
-
if (r2.state.__a) {
|
|
4605
|
-
var n3 = r2.state.__a;
|
|
4606
|
-
r2.__v.__k[0] = W(n3, n3.__c.__P, n3.__c.__O);
|
|
4607
|
-
}
|
|
4608
|
-
var t3;
|
|
4609
|
-
for (r2.setState({ __a: r2.__b = null }); t3 = r2.o.pop(); ) t3.forceUpdate();
|
|
4610
|
-
}
|
|
4611
|
-
};
|
|
4612
|
-
r2.__u++ || 32 & t2.__u || r2.setState({ __a: r2.__b = r2.__v.__k[0] }), n2.then(i2, i2);
|
|
4613
|
-
}, P.prototype.componentWillUnmount = function() {
|
|
4614
|
-
this.o = [];
|
|
4615
|
-
}, P.prototype.render = function(n2, e2) {
|
|
4616
|
-
if (this.__b) {
|
|
4617
|
-
if (this.__v.__k) {
|
|
4618
|
-
var r2 = document.createElement("div"), o2 = this.__v.__k[0].__c;
|
|
4619
|
-
this.__v.__k[0] = V(this.__b, r2, o2.__O = o2.__P);
|
|
4620
|
-
}
|
|
4621
|
-
this.__b = null;
|
|
4622
|
-
}
|
|
4623
|
-
var i2 = e2.__a && _(k$1, null, n2.fallback);
|
|
4624
|
-
return i2 && (i2.__u &= -33), [_(k$1, null, e2.__a ? null : n2.children), i2];
|
|
4625
|
-
};
|
|
4626
|
-
var H = function(n2, t2, e2) {
|
|
4627
|
-
if (++e2[1] === e2[0] && n2.l.delete(t2), n2.props.revealOrder && ("t" !== n2.props.revealOrder[0] || !n2.l.size)) for (e2 = n2.i; e2; ) {
|
|
4628
|
-
for (; e2.length > 3; ) e2.pop()();
|
|
4629
|
-
if (e2[1] < e2[0]) break;
|
|
4630
|
-
n2.i = e2 = e2[2];
|
|
4631
|
-
}
|
|
4632
|
-
};
|
|
4633
|
-
(B.prototype = new x$1()).__a = function(n2) {
|
|
4634
|
-
var t2 = this, e2 = j(t2.__v), r2 = t2.l.get(n2);
|
|
4635
|
-
return r2[0]++, function(u2) {
|
|
4636
|
-
var o2 = function() {
|
|
4637
|
-
t2.props.revealOrder ? (r2.push(u2), H(t2, n2, r2)) : u2();
|
|
4638
|
-
};
|
|
4639
|
-
e2 ? e2(o2) : o2();
|
|
4640
|
-
};
|
|
4641
|
-
}, B.prototype.render = function(n2) {
|
|
4642
|
-
this.i = null, this.l = /* @__PURE__ */ new Map();
|
|
4643
|
-
var t2 = H$1(n2.children);
|
|
4644
|
-
n2.revealOrder && "b" === n2.revealOrder[0] && t2.reverse();
|
|
4645
|
-
for (var e2 = t2.length; e2--; ) this.l.set(t2[e2], this.i = [1, 0, this.i]);
|
|
4646
|
-
return n2.children;
|
|
4647
|
-
}, B.prototype.componentDidUpdate = B.prototype.componentDidMount = function() {
|
|
4648
|
-
var n2 = this;
|
|
4649
|
-
this.l.forEach(function(t2, e2) {
|
|
4650
|
-
H(n2, e2, t2);
|
|
4651
|
-
});
|
|
4652
|
-
};
|
|
4653
|
-
var q = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, G = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, J = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, K = /[A-Z0-9]/g, Q = "undefined" != typeof document, X = function(n2) {
|
|
4654
|
-
return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/ : /fil|che|ra/).test(n2);
|
|
4655
|
-
};
|
|
4656
|
-
x$1.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t2) {
|
|
4657
|
-
Object.defineProperty(x$1.prototype, t2, { configurable: true, get: function() {
|
|
4658
|
-
return this["UNSAFE_" + t2];
|
|
4659
|
-
}, set: function(n2) {
|
|
4660
|
-
Object.defineProperty(this, t2, { configurable: true, writable: true, value: n2 });
|
|
4661
|
-
} });
|
|
4662
|
-
});
|
|
4663
|
-
var en = l$1.event;
|
|
4664
|
-
function rn() {
|
|
4665
|
-
}
|
|
4666
|
-
function un() {
|
|
4667
|
-
return this.cancelBubble;
|
|
4668
|
-
}
|
|
4669
|
-
function on() {
|
|
4670
|
-
return this.defaultPrevented;
|
|
4671
|
-
}
|
|
4672
|
-
l$1.event = function(n2) {
|
|
4673
|
-
return en && (n2 = en(n2)), n2.persist = rn, n2.isPropagationStopped = un, n2.isDefaultPrevented = on, n2.nativeEvent = n2;
|
|
4674
|
-
};
|
|
4675
|
-
var cn = { enumerable: false, configurable: true, get: function() {
|
|
4676
|
-
return this.class;
|
|
4677
|
-
} }, fn = l$1.vnode;
|
|
4678
|
-
l$1.vnode = function(n2) {
|
|
4679
|
-
"string" == typeof n2.type && (function(n3) {
|
|
4680
|
-
var t2 = n3.props, e2 = n3.type, u2 = {}, o2 = -1 === e2.indexOf("-");
|
|
4681
|
-
for (var i2 in t2) {
|
|
4682
|
-
var l2 = t2[i2];
|
|
4683
|
-
if (!("value" === i2 && "defaultValue" in t2 && null == l2 || Q && "children" === i2 && "noscript" === e2 || "class" === i2 || "className" === i2)) {
|
|
4684
|
-
var c2 = i2.toLowerCase();
|
|
4685
|
-
"defaultValue" === i2 && "value" in t2 && null == t2.value ? i2 = "value" : "download" === i2 && true === l2 ? l2 = "" : "translate" === c2 && "no" === l2 ? l2 = false : "o" === c2[0] && "n" === c2[1] ? "ondoubleclick" === c2 ? i2 = "ondblclick" : "onchange" !== c2 || "input" !== e2 && "textarea" !== e2 || X(t2.type) ? "onfocus" === c2 ? i2 = "onfocusin" : "onblur" === c2 ? i2 = "onfocusout" : J.test(i2) && (i2 = c2) : c2 = i2 = "oninput" : o2 && G.test(i2) ? i2 = i2.replace(K, "-$&").toLowerCase() : null === l2 && (l2 = void 0), "oninput" === c2 && u2[i2 = c2] && (i2 = "oninputCapture"), u2[i2] = l2;
|
|
4686
|
-
}
|
|
4687
|
-
}
|
|
4688
|
-
"select" == e2 && u2.multiple && Array.isArray(u2.value) && (u2.value = H$1(t2.children).forEach(function(n4) {
|
|
4689
|
-
n4.props.selected = -1 != u2.value.indexOf(n4.props.value);
|
|
4690
|
-
})), "select" == e2 && null != u2.defaultValue && (u2.value = H$1(t2.children).forEach(function(n4) {
|
|
4691
|
-
n4.props.selected = u2.multiple ? -1 != u2.defaultValue.indexOf(n4.props.value) : u2.defaultValue == n4.props.value;
|
|
4692
|
-
})), t2.class && !t2.className ? (u2.class = t2.class, Object.defineProperty(u2, "className", cn)) : (t2.className && !t2.class || t2.class && t2.className) && (u2.class = u2.className = t2.className), n3.props = u2;
|
|
4693
|
-
})(n2), n2.$$typeof = q, fn && fn(n2);
|
|
4694
|
-
};
|
|
4695
|
-
var an = l$1.__r;
|
|
4696
|
-
l$1.__r = function(n2) {
|
|
4697
|
-
an && an(n2), n2.__c;
|
|
4698
|
-
};
|
|
4699
|
-
var sn = l$1.diffed;
|
|
4700
|
-
l$1.diffed = function(n2) {
|
|
4701
|
-
sn && sn(n2);
|
|
4702
|
-
var t2 = n2.props, e2 = n2.__e;
|
|
4703
|
-
null != e2 && "textarea" === n2.type && "value" in t2 && t2.value !== e2.value && (e2.value = null == t2.value ? "" : t2.value);
|
|
4704
|
-
};
|
|
4705
4713
|
const warn = (i18n, code, msg, rest) => {
|
|
4706
4714
|
var _a, _b, _c, _d;
|
|
4707
4715
|
const args = [msg, __spreadValues({
|
|
@@ -4829,7 +4837,7 @@ class ReportNamespaces {
|
|
|
4829
4837
|
}
|
|
4830
4838
|
}
|
|
4831
4839
|
const usePrevious = (value, ignore) => {
|
|
4832
|
-
const ref = A();
|
|
4840
|
+
const ref = A$1();
|
|
4833
4841
|
y(() => {
|
|
4834
4842
|
ref.current = value;
|
|
4835
4843
|
}, [value, ignore]);
|
|
@@ -4878,7 +4886,7 @@ const useTranslation = (ns, props = {}) => {
|
|
|
4878
4886
|
let joinedNS = namespaces.join();
|
|
4879
4887
|
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
4880
4888
|
const previousJoinedNS = usePrevious(joinedNS);
|
|
4881
|
-
const isMounted = A(true);
|
|
4889
|
+
const isMounted = A$1(true);
|
|
4882
4890
|
y(() => {
|
|
4883
4891
|
const {
|
|
4884
4892
|
bindI18n,
|
|
@@ -5884,8 +5892,8 @@ const useAPIService = (config) => {
|
|
|
5884
5892
|
const FallbackUI = ({ error, errorInfo, retryCount, maxRetries, onRetry, onReset, showDetails = false }) => {
|
|
5885
5893
|
const canRetry = retryCount < maxRetries;
|
|
5886
5894
|
const isMaxRetriesReached = retryCount >= maxRetries;
|
|
5887
|
-
return /* @__PURE__ */ u
|
|
5888
|
-
/* @__PURE__ */ u
|
|
5895
|
+
return /* @__PURE__ */ u("div", { className: "fixed bottom-5 right-5 bg-white border border-red-200 rounded-lg shadow-lg p-4 max-w-sm z-[1000]", children: /* @__PURE__ */ u("div", { className: "flex items-start", children: [
|
|
5896
|
+
/* @__PURE__ */ u("div", { className: "flex-shrink-0", children: /* @__PURE__ */ u("svg", { className: "h-5 w-5 text-red-400", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ u(
|
|
5889
5897
|
"path",
|
|
5890
5898
|
{
|
|
5891
5899
|
fillRule: "evenodd",
|
|
@@ -5893,30 +5901,30 @@ const FallbackUI = ({ error, errorInfo, retryCount, maxRetries, onRetry, onReset
|
|
|
5893
5901
|
clipRule: "evenodd"
|
|
5894
5902
|
}
|
|
5895
5903
|
) }) }),
|
|
5896
|
-
/* @__PURE__ */ u
|
|
5897
|
-
/* @__PURE__ */ u
|
|
5898
|
-
/* @__PURE__ */ u
|
|
5899
|
-
/* @__PURE__ */ u
|
|
5900
|
-
retryCount > 0 && /* @__PURE__ */ u
|
|
5904
|
+
/* @__PURE__ */ u("div", { className: "ml-3 flex-1", children: [
|
|
5905
|
+
/* @__PURE__ */ u("h3", { className: "text-sm font-medium text-red-800", children: isMaxRetriesReached ? "Widget Error" : "Temporary Error" }),
|
|
5906
|
+
/* @__PURE__ */ u("div", { className: "mt-2 text-sm text-red-700", children: [
|
|
5907
|
+
/* @__PURE__ */ u("p", { children: isMaxRetriesReached ? "The widget encountered an error and couldn't recover automatically." : "The widget encountered an error but will retry automatically." }),
|
|
5908
|
+
retryCount > 0 && /* @__PURE__ */ u("p", { className: "mt-1 text-xs text-red-600", children: [
|
|
5901
5909
|
"Retry attempt: ",
|
|
5902
5910
|
retryCount,
|
|
5903
5911
|
"/",
|
|
5904
5912
|
maxRetries
|
|
5905
5913
|
] })
|
|
5906
5914
|
] }),
|
|
5907
|
-
showDetails && error && /* @__PURE__ */ u
|
|
5908
|
-
/* @__PURE__ */ u
|
|
5909
|
-
/* @__PURE__ */ u
|
|
5910
|
-
/* @__PURE__ */ u
|
|
5911
|
-
/* @__PURE__ */ u
|
|
5912
|
-
(errorInfo == null ? void 0 : errorInfo.componentStack) && /* @__PURE__ */ u
|
|
5913
|
-
/* @__PURE__ */ u
|
|
5914
|
-
/* @__PURE__ */ u
|
|
5915
|
+
showDetails && error && /* @__PURE__ */ u("details", { className: "mt-2", children: [
|
|
5916
|
+
/* @__PURE__ */ u("summary", { className: "text-xs text-red-600 cursor-pointer hover:text-red-800", children: "Show technical details" }),
|
|
5917
|
+
/* @__PURE__ */ u("div", { className: "mt-1 text-xs text-red-600 font-mono bg-red-50 p-2 rounded border", children: [
|
|
5918
|
+
/* @__PURE__ */ u("p", { className: "font-semibold", children: "Error:" }),
|
|
5919
|
+
/* @__PURE__ */ u("p", { className: "mb-2", children: error.message }),
|
|
5920
|
+
(errorInfo == null ? void 0 : errorInfo.componentStack) && /* @__PURE__ */ u(k$1, { children: [
|
|
5921
|
+
/* @__PURE__ */ u("p", { className: "font-semibold", children: "Component Stack:" }),
|
|
5922
|
+
/* @__PURE__ */ u("pre", { className: "whitespace-pre-wrap text-xs", children: errorInfo.componentStack })
|
|
5915
5923
|
] })
|
|
5916
5924
|
] })
|
|
5917
5925
|
] }),
|
|
5918
|
-
/* @__PURE__ */ u
|
|
5919
|
-
canRetry && /* @__PURE__ */ u
|
|
5926
|
+
/* @__PURE__ */ u("div", { className: "mt-3 flex space-x-2", children: [
|
|
5927
|
+
canRetry && /* @__PURE__ */ u(
|
|
5920
5928
|
"button",
|
|
5921
5929
|
{
|
|
5922
5930
|
type: "button",
|
|
@@ -5925,7 +5933,7 @@ const FallbackUI = ({ error, errorInfo, retryCount, maxRetries, onRetry, onReset
|
|
|
5925
5933
|
children: "Retry Now"
|
|
5926
5934
|
}
|
|
5927
5935
|
),
|
|
5928
|
-
/* @__PURE__ */ u
|
|
5936
|
+
/* @__PURE__ */ u(
|
|
5929
5937
|
"button",
|
|
5930
5938
|
{
|
|
5931
5939
|
type: "button",
|
|
@@ -6014,7 +6022,7 @@ class WidgetErrorBoundary extends x$1 {
|
|
|
6014
6022
|
if (this.props.fallback) {
|
|
6015
6023
|
return this.props.fallback;
|
|
6016
6024
|
}
|
|
6017
|
-
return /* @__PURE__ */ u
|
|
6025
|
+
return /* @__PURE__ */ u(
|
|
6018
6026
|
FallbackUI,
|
|
6019
6027
|
{
|
|
6020
6028
|
error: this.state.error,
|
|
@@ -6162,8 +6170,8 @@ const handleUserValidationError = (error, storageService) => {
|
|
|
6162
6170
|
};
|
|
6163
6171
|
const usePersistence = ({ state, dispatch, storageService, orgId, widgetId }) => {
|
|
6164
6172
|
const storageKey = `analytick-widget-${orgId}-${widgetId}`;
|
|
6165
|
-
const stateRef = A(state);
|
|
6166
|
-
const dispatchRef = A(dispatch);
|
|
6173
|
+
const stateRef = A$1(state);
|
|
6174
|
+
const dispatchRef = A$1(dispatch);
|
|
6167
6175
|
stateRef.current = state;
|
|
6168
6176
|
dispatchRef.current = dispatch;
|
|
6169
6177
|
const loadPersistedState = q$1(() => __async(null, null, function* () {
|
|
@@ -6287,9 +6295,9 @@ const createPersistenceService = (orgId, widgetId) => {
|
|
|
6287
6295
|
return createLocalStorageService(config);
|
|
6288
6296
|
};
|
|
6289
6297
|
const ChatIcon = () => {
|
|
6290
|
-
return /* @__PURE__ */ u
|
|
6291
|
-
/* @__PURE__ */ u
|
|
6292
|
-
/* @__PURE__ */ u
|
|
6298
|
+
return /* @__PURE__ */ u("svg", { width: "29", height: "31", viewBox: "0 0 29 31", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "w-7 h-8", role: "img", "aria-label": "Chat", children: [
|
|
6299
|
+
/* @__PURE__ */ u("title", { children: "Chat" }),
|
|
6300
|
+
/* @__PURE__ */ u(
|
|
6293
6301
|
"path",
|
|
6294
6302
|
{
|
|
6295
6303
|
d: "M28.093 31C28.093 31 23.3641 29.2031 19.5382 27.7637H3.44856C1.54359 27.7637 0 26.182 0 24.232V3.53064C0 1.58163 1.54359 0 3.44856 0H24.6424C26.5474 0 28.092 1.58163 28.092 3.53064V21.36L28.093 21.359V31ZM23.9407 19.392C23.6104 18.9976 23.0288 18.9526 22.6444 19.2899C22.6143 19.3159 19.6192 21.8886 14.0445 21.8886C8.54082 21.8886 5.49968 19.334 5.44462 19.2879C5.05922 18.9516 4.48062 18.9986 4.15028 19.392C3.81894 19.7874 3.86499 20.381 4.25039 20.7204C4.39353 20.8445 7.80005 23.7715 14.0445 23.7715C20.2919 23.7715 23.6995 20.8445 23.8406 20.7204C24.226 20.381 24.2721 19.7874 23.9407 19.392Z",
|
|
@@ -6299,15 +6307,15 @@ const ChatIcon = () => {
|
|
|
6299
6307
|
] });
|
|
6300
6308
|
};
|
|
6301
6309
|
const CloseIcon = () => {
|
|
6302
|
-
return /* @__PURE__ */ u
|
|
6303
|
-
/* @__PURE__ */ u
|
|
6304
|
-
/* @__PURE__ */ u
|
|
6310
|
+
return /* @__PURE__ */ u("svg", { width: "16", height: "10", viewBox: "0 0 16 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-2.5", role: "img", "aria-label": "Close", children: [
|
|
6311
|
+
/* @__PURE__ */ u("title", { children: "Close" }),
|
|
6312
|
+
/* @__PURE__ */ u("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 1.79401L1.79401 0L8 6.20599L14.206 0L16 1.79401L8 9.79401L0 1.79401Z", fill: "white" })
|
|
6305
6313
|
] });
|
|
6306
6314
|
};
|
|
6307
6315
|
const NotificationBadge$1 = ({ count, isRTL }) => {
|
|
6308
6316
|
const positionClasses = isRTL ? "-top-1 -left-1" : "-top-1 -right-1";
|
|
6309
6317
|
const displayCount = count > 9 ? "9+" : count.toString();
|
|
6310
|
-
return /* @__PURE__ */ u
|
|
6318
|
+
return /* @__PURE__ */ u("output", { className: `absolute ${positionClasses} bg-red-500 text-white rounded-full w-5 h-5 text-xs flex items-center justify-center font-bold min-w-5`, "aria-label": `${count} unread messages`, children: displayCount });
|
|
6311
6319
|
};
|
|
6312
6320
|
const TriggerButton = () => {
|
|
6313
6321
|
const { state, dispatch } = useWidgetContext();
|
|
@@ -6334,7 +6342,7 @@ const TriggerButton = () => {
|
|
|
6334
6342
|
}
|
|
6335
6343
|
};
|
|
6336
6344
|
const positionClasses = getPositionClasses();
|
|
6337
|
-
return /* @__PURE__ */ u
|
|
6345
|
+
return /* @__PURE__ */ u(
|
|
6338
6346
|
"button",
|
|
6339
6347
|
{
|
|
6340
6348
|
type: "button",
|
|
@@ -6364,8 +6372,8 @@ const TriggerButton = () => {
|
|
|
6364
6372
|
},
|
|
6365
6373
|
"aria-label": state.isOpen ? "Close chat" : "Open chat",
|
|
6366
6374
|
children: [
|
|
6367
|
-
state.isOpen ? /* @__PURE__ */ u
|
|
6368
|
-
state.unreadCount > 0 && !state.isOpen && /* @__PURE__ */ u
|
|
6375
|
+
state.isOpen ? /* @__PURE__ */ u(CloseIcon, {}) : /* @__PURE__ */ u(ChatIcon, {}),
|
|
6376
|
+
state.unreadCount > 0 && !state.isOpen && /* @__PURE__ */ u(NotificationBadge$1, { count: state.unreadCount, isRTL })
|
|
6369
6377
|
]
|
|
6370
6378
|
}
|
|
6371
6379
|
);
|
|
@@ -6373,7 +6381,7 @@ const TriggerButton = () => {
|
|
|
6373
6381
|
const useChatMessaging = () => {
|
|
6374
6382
|
const { state, dispatch } = useWidgetContext();
|
|
6375
6383
|
const { sendMessage, isConnected } = useStompConnectionContext();
|
|
6376
|
-
const writingTimeoutRef = A(null);
|
|
6384
|
+
const writingTimeoutRef = A$1(null);
|
|
6377
6385
|
const handleSendMessage = q$1(
|
|
6378
6386
|
(messageContent) => __async(null, null, function* () {
|
|
6379
6387
|
if (!state.user || !state.widgetConfig || !state.channelId || !isConnected) {
|
|
@@ -6443,7 +6451,7 @@ const useChatMessaging = () => {
|
|
|
6443
6451
|
};
|
|
6444
6452
|
const MessageInput = ({ onSendMessage, disabled = false, placeholder, className = "", isWriting = false }) => {
|
|
6445
6453
|
const [message, setMessage] = d("");
|
|
6446
|
-
const textareaRef = A(null);
|
|
6454
|
+
const textareaRef = A$1(null);
|
|
6447
6455
|
const { t: t2, isRTL } = useWidgetTranslation();
|
|
6448
6456
|
const handleSubmit = (e2) => {
|
|
6449
6457
|
e2.preventDefault();
|
|
@@ -6463,8 +6471,8 @@ const MessageInput = ({ onSendMessage, disabled = false, placeholder, className
|
|
|
6463
6471
|
handleSubmit(e2);
|
|
6464
6472
|
}
|
|
6465
6473
|
};
|
|
6466
|
-
return /* @__PURE__ */ u
|
|
6467
|
-
/* @__PURE__ */ u
|
|
6474
|
+
return /* @__PURE__ */ u("div", { className: `border-t border-gray-200 p-4 max-sm:p-3 ${className}`, children: /* @__PURE__ */ u("form", { onSubmit: handleSubmit, className: "flex items-start gap-2 max-sm:gap-1.5", children: [
|
|
6475
|
+
/* @__PURE__ */ u("div", { className: "flex-1", children: /* @__PURE__ */ u(
|
|
6468
6476
|
"textarea",
|
|
6469
6477
|
{
|
|
6470
6478
|
ref: textareaRef,
|
|
@@ -6495,7 +6503,7 @@ const MessageInput = ({ onSendMessage, disabled = false, placeholder, className
|
|
|
6495
6503
|
}
|
|
6496
6504
|
}
|
|
6497
6505
|
) }),
|
|
6498
|
-
/* @__PURE__ */ u
|
|
6506
|
+
/* @__PURE__ */ u(
|
|
6499
6507
|
"button",
|
|
6500
6508
|
{
|
|
6501
6509
|
type: "submit",
|
|
@@ -6524,7 +6532,7 @@ const MessageInput = ({ onSendMessage, disabled = false, placeholder, className
|
|
|
6524
6532
|
}
|
|
6525
6533
|
},
|
|
6526
6534
|
"aria-label": t2("chat.input.send", "Send message"),
|
|
6527
|
-
children: /* @__PURE__ */ u
|
|
6535
|
+
children: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", className: `max-sm:w-5 max-sm:h-5 ${isRTL ? "rotate-180" : ""}`, "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z", fill: "currentColor" }) })
|
|
6528
6536
|
}
|
|
6529
6537
|
)
|
|
6530
6538
|
] }) });
|
|
@@ -6571,8 +6579,8 @@ const ButtonMessage = ({ content, className = "" }) => {
|
|
|
6571
6579
|
const onButtonClick = (buttonId, payload) => {
|
|
6572
6580
|
handleButtonClick(buttonId, payload);
|
|
6573
6581
|
};
|
|
6574
|
-
return /* @__PURE__ */ u
|
|
6575
|
-
content.text && /* @__PURE__ */ u
|
|
6582
|
+
return /* @__PURE__ */ u("div", { className: `button-message ${className}`, children: [
|
|
6583
|
+
content.text && /* @__PURE__ */ u(
|
|
6576
6584
|
"p",
|
|
6577
6585
|
{
|
|
6578
6586
|
className: "leading-relaxed mb-3",
|
|
@@ -6583,7 +6591,7 @@ const ButtonMessage = ({ content, className = "" }) => {
|
|
|
6583
6591
|
children: content.text
|
|
6584
6592
|
}
|
|
6585
6593
|
),
|
|
6586
|
-
/* @__PURE__ */ u
|
|
6594
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: content.buttons.map((button) => /* @__PURE__ */ u(
|
|
6587
6595
|
"button",
|
|
6588
6596
|
{
|
|
6589
6597
|
type: "button",
|
|
@@ -6624,8 +6632,8 @@ const DocumentMessage = ({ content, className = "" }) => {
|
|
|
6624
6632
|
const handleDownloadClick = () => {
|
|
6625
6633
|
handleDownload(content.url, content.filename);
|
|
6626
6634
|
};
|
|
6627
|
-
return /* @__PURE__ */ u
|
|
6628
|
-
/* @__PURE__ */ u
|
|
6635
|
+
return /* @__PURE__ */ u("div", { className: `document-message ${className}`, children: /* @__PURE__ */ u("div", { className: "bg-gray-50 border border-gray-200 rounded-lg p-4 max-w-sm", children: /* @__PURE__ */ u("div", { className: "flex items-center space-x-3", children: [
|
|
6636
|
+
/* @__PURE__ */ u("div", { className: "flex-shrink-0", children: /* @__PURE__ */ u("div", { className: "w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ u("svg", { className: "w-5 h-5 text-blue-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ u(
|
|
6629
6637
|
"path",
|
|
6630
6638
|
{
|
|
6631
6639
|
strokeLinecap: "round",
|
|
@@ -6634,8 +6642,8 @@ const DocumentMessage = ({ content, className = "" }) => {
|
|
|
6634
6642
|
d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
|
6635
6643
|
}
|
|
6636
6644
|
) }) }) }),
|
|
6637
|
-
/* @__PURE__ */ u
|
|
6638
|
-
/* @__PURE__ */ u
|
|
6645
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
|
|
6646
|
+
/* @__PURE__ */ u(
|
|
6639
6647
|
"p",
|
|
6640
6648
|
{
|
|
6641
6649
|
className: "font-medium text-gray-900 truncate",
|
|
@@ -6646,7 +6654,7 @@ const DocumentMessage = ({ content, className = "" }) => {
|
|
|
6646
6654
|
children: content.filename
|
|
6647
6655
|
}
|
|
6648
6656
|
),
|
|
6649
|
-
/* @__PURE__ */ u
|
|
6657
|
+
/* @__PURE__ */ u(
|
|
6650
6658
|
"div",
|
|
6651
6659
|
{
|
|
6652
6660
|
className: "flex items-center space-x-2 text-gray-500",
|
|
@@ -6655,14 +6663,14 @@ const DocumentMessage = ({ content, className = "" }) => {
|
|
|
6655
6663
|
fontSize: "calc(var(--widget-font-size, 14px) * 0.8)"
|
|
6656
6664
|
},
|
|
6657
6665
|
children: [
|
|
6658
|
-
/* @__PURE__ */ u
|
|
6659
|
-
/* @__PURE__ */ u
|
|
6660
|
-
/* @__PURE__ */ u
|
|
6666
|
+
/* @__PURE__ */ u("span", { children: getFileExtension(content.filename) }),
|
|
6667
|
+
/* @__PURE__ */ u("span", { children: "•" }),
|
|
6668
|
+
/* @__PURE__ */ u("span", { children: formatFileSize(content.size) })
|
|
6661
6669
|
]
|
|
6662
6670
|
}
|
|
6663
6671
|
)
|
|
6664
6672
|
] }),
|
|
6665
|
-
/* @__PURE__ */ u
|
|
6673
|
+
/* @__PURE__ */ u("button", { type: "button", onClick: handleDownloadClick, className: "flex-shrink-0 p-2 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors", title: "Download file", children: /* @__PURE__ */ u("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ u(
|
|
6666
6674
|
"path",
|
|
6667
6675
|
{
|
|
6668
6676
|
strokeLinecap: "round",
|
|
@@ -6687,9 +6695,9 @@ const ImageMessage = ({ content, className = "" }) => {
|
|
|
6687
6695
|
window.open(content.url, "_blank");
|
|
6688
6696
|
};
|
|
6689
6697
|
if (hasError) {
|
|
6690
|
-
return /* @__PURE__ */ u
|
|
6691
|
-
/* @__PURE__ */ u
|
|
6692
|
-
/* @__PURE__ */ u
|
|
6698
|
+
return /* @__PURE__ */ u("div", { className: `image-message ${className}`, children: [
|
|
6699
|
+
/* @__PURE__ */ u("div", { className: "bg-gray-100 border border-gray-200 rounded-lg p-4 text-center", children: /* @__PURE__ */ u("div", { className: "text-gray-500 text-sm", children: [
|
|
6700
|
+
/* @__PURE__ */ u("svg", { className: "w-8 h-8 mx-auto mb-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ u(
|
|
6693
6701
|
"path",
|
|
6694
6702
|
{
|
|
6695
6703
|
strokeLinecap: "round",
|
|
@@ -6698,15 +6706,15 @@ const ImageMessage = ({ content, className = "" }) => {
|
|
|
6698
6706
|
d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"
|
|
6699
6707
|
}
|
|
6700
6708
|
) }),
|
|
6701
|
-
/* @__PURE__ */ u
|
|
6709
|
+
/* @__PURE__ */ u("p", { children: "Image could not be loaded" })
|
|
6702
6710
|
] }) }),
|
|
6703
|
-
content.caption && /* @__PURE__ */ u
|
|
6711
|
+
content.caption && /* @__PURE__ */ u("p", { className: "text-sm text-gray-600 mt-2", children: content.caption })
|
|
6704
6712
|
] });
|
|
6705
6713
|
}
|
|
6706
|
-
return /* @__PURE__ */ u
|
|
6707
|
-
/* @__PURE__ */ u
|
|
6708
|
-
isLoading && /* @__PURE__ */ u
|
|
6709
|
-
/* @__PURE__ */ u
|
|
6714
|
+
return /* @__PURE__ */ u("div", { className: `image-message ${className}`, children: [
|
|
6715
|
+
/* @__PURE__ */ u("div", { className: "relative max-w-sm", children: [
|
|
6716
|
+
isLoading && /* @__PURE__ */ u("div", { className: "absolute inset-0 bg-gray-100 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ u("div", { className: "animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600" }) }),
|
|
6717
|
+
/* @__PURE__ */ u(
|
|
6710
6718
|
"button",
|
|
6711
6719
|
{
|
|
6712
6720
|
type: "button",
|
|
@@ -6714,11 +6722,11 @@ const ImageMessage = ({ content, className = "" }) => {
|
|
|
6714
6722
|
className: "w-full h-auto rounded-lg cursor-pointer hover:opacity-90 transition-opacity border-none bg-transparent p-0",
|
|
6715
6723
|
"aria-label": `Open image in new tab: ${content.caption || "Shared image"}`,
|
|
6716
6724
|
style: { display: isLoading ? "none" : "block" },
|
|
6717
|
-
children: /* @__PURE__ */ u
|
|
6725
|
+
children: /* @__PURE__ */ u("img", { src: content.url, alt: content.caption || "Shared image", className: "w-full h-auto rounded-lg", onLoad: handleImageLoad, onError: handleImageError })
|
|
6718
6726
|
}
|
|
6719
6727
|
)
|
|
6720
6728
|
] }),
|
|
6721
|
-
content.caption && /* @__PURE__ */ u
|
|
6729
|
+
content.caption && /* @__PURE__ */ u("p", { className: "text-sm text-gray-600 mt-2", children: content.caption })
|
|
6722
6730
|
] });
|
|
6723
6731
|
};
|
|
6724
6732
|
const SelectMessage = ({ content, className = "" }) => {
|
|
@@ -6728,8 +6736,8 @@ const SelectMessage = ({ content, className = "" }) => {
|
|
|
6728
6736
|
setSelectedOption(optionId);
|
|
6729
6737
|
handleSelectOption(optionId, title);
|
|
6730
6738
|
};
|
|
6731
|
-
return /* @__PURE__ */ u
|
|
6732
|
-
content.text && /* @__PURE__ */ u
|
|
6739
|
+
return /* @__PURE__ */ u("div", { className: `select-message ${className}`, children: [
|
|
6740
|
+
content.text && /* @__PURE__ */ u(
|
|
6733
6741
|
"p",
|
|
6734
6742
|
{
|
|
6735
6743
|
className: "leading-relaxed mb-3",
|
|
@@ -6740,7 +6748,7 @@ const SelectMessage = ({ content, className = "" }) => {
|
|
|
6740
6748
|
children: content.text
|
|
6741
6749
|
}
|
|
6742
6750
|
),
|
|
6743
|
-
/* @__PURE__ */ u
|
|
6751
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: content.options.map((option) => /* @__PURE__ */ u(
|
|
6744
6752
|
"button",
|
|
6745
6753
|
{
|
|
6746
6754
|
type: "button",
|
|
@@ -6751,17 +6759,17 @@ const SelectMessage = ({ content, className = "" }) => {
|
|
|
6751
6759
|
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
|
|
6752
6760
|
${selectedOption === option.id ? "bg-blue-50 border-blue-500 text-blue-700" : selectedOption !== null ? "bg-gray-50 border-gray-200 text-gray-400 cursor-not-allowed" : "bg-white border-gray-200 hover:bg-gray-50 hover:border-gray-300"}
|
|
6753
6761
|
`,
|
|
6754
|
-
children: /* @__PURE__ */ u
|
|
6755
|
-
/* @__PURE__ */ u
|
|
6756
|
-
/* @__PURE__ */ u
|
|
6757
|
-
option.description && /* @__PURE__ */ u
|
|
6762
|
+
children: /* @__PURE__ */ u("div", { className: "flex items-start justify-between", children: [
|
|
6763
|
+
/* @__PURE__ */ u("div", { className: "flex-1", children: [
|
|
6764
|
+
/* @__PURE__ */ u("p", { className: "text-sm font-medium", children: option.title }),
|
|
6765
|
+
option.description && /* @__PURE__ */ u("p", { className: "text-xs text-gray-500 mt-1", children: option.description })
|
|
6758
6766
|
] }),
|
|
6759
|
-
selectedOption === option.id && /* @__PURE__ */ u
|
|
6767
|
+
selectedOption === option.id && /* @__PURE__ */ u("div", { className: "flex-shrink-0 ml-2", children: /* @__PURE__ */ u("svg", { className: "w-4 h-4 text-blue-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) })
|
|
6760
6768
|
] })
|
|
6761
6769
|
},
|
|
6762
6770
|
option.id
|
|
6763
6771
|
)) }),
|
|
6764
|
-
selectedOption && /* @__PURE__ */ u
|
|
6772
|
+
selectedOption && /* @__PURE__ */ u("p", { className: "text-xs text-gray-500 mt-2", children: "Option selected. Your response has been sent." })
|
|
6765
6773
|
] });
|
|
6766
6774
|
};
|
|
6767
6775
|
const processBoldText = (line) => {
|
|
@@ -6850,7 +6858,7 @@ const TextMessage = ({ content, className = "" }) => {
|
|
|
6850
6858
|
const parsedElements = T$1(() => {
|
|
6851
6859
|
return parseSimpleMarkdown(content.body);
|
|
6852
6860
|
}, [content.body]);
|
|
6853
|
-
return /* @__PURE__ */ u
|
|
6861
|
+
return /* @__PURE__ */ u("div", { className: `text-message ${className}`, children: /* @__PURE__ */ u(
|
|
6854
6862
|
"div",
|
|
6855
6863
|
{
|
|
6856
6864
|
className: "leading-relaxed break-words",
|
|
@@ -6861,17 +6869,17 @@ const TextMessage = ({ content, className = "" }) => {
|
|
|
6861
6869
|
children: parsedElements.map((element) => {
|
|
6862
6870
|
switch (element.type) {
|
|
6863
6871
|
case "bold":
|
|
6864
|
-
return /* @__PURE__ */ u
|
|
6872
|
+
return /* @__PURE__ */ u("strong", { className: "font-semibold", style: { color: "inherit" }, children: element.content }, element.id);
|
|
6865
6873
|
case "italic":
|
|
6866
|
-
return /* @__PURE__ */ u
|
|
6874
|
+
return /* @__PURE__ */ u("em", { className: "italic", style: { color: "inherit" }, children: element.content }, element.id);
|
|
6867
6875
|
case "code":
|
|
6868
|
-
return /* @__PURE__ */ u
|
|
6876
|
+
return /* @__PURE__ */ u("code", { className: "bg-widget-gray-100 px-1 py-0.5 rounded text-xs", style: { color: "inherit" }, children: element.content }, element.id);
|
|
6869
6877
|
case "link":
|
|
6870
|
-
return /* @__PURE__ */ u
|
|
6878
|
+
return /* @__PURE__ */ u("a", { href: element.href, target: "_blank", rel: "noopener noreferrer", className: "text-widget-primary no-underline hover:underline", children: element.content }, element.id);
|
|
6871
6879
|
case "br":
|
|
6872
|
-
return /* @__PURE__ */ u
|
|
6880
|
+
return /* @__PURE__ */ u("br", {}, element.id);
|
|
6873
6881
|
default:
|
|
6874
|
-
return /* @__PURE__ */ u
|
|
6882
|
+
return /* @__PURE__ */ u("span", { style: { color: "inherit" }, children: element.content }, element.id);
|
|
6875
6883
|
}
|
|
6876
6884
|
})
|
|
6877
6885
|
}
|
|
@@ -6881,14 +6889,14 @@ const MessageStatusIndicator = ({ status }) => {
|
|
|
6881
6889
|
const getStatusIcon = () => {
|
|
6882
6890
|
switch (status) {
|
|
6883
6891
|
case "SENT":
|
|
6884
|
-
return /* @__PURE__ */ u
|
|
6885
|
-
/* @__PURE__ */ u
|
|
6886
|
-
/* @__PURE__ */ u
|
|
6892
|
+
return /* @__PURE__ */ u("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", className: "animate-spin", "aria-hidden": "true", children: [
|
|
6893
|
+
/* @__PURE__ */ u("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeDasharray: "31.416", strokeDashoffset: "31.416", className: "opacity-25" }),
|
|
6894
|
+
/* @__PURE__ */ u("path", { d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z", fill: "currentColor" })
|
|
6887
6895
|
] });
|
|
6888
6896
|
case "DELIVERED":
|
|
6889
|
-
return /* @__PURE__ */ u
|
|
6897
|
+
return /* @__PURE__ */ u("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z", fill: "currentColor" }) });
|
|
6890
6898
|
case "READ":
|
|
6891
|
-
return /* @__PURE__ */ u
|
|
6899
|
+
return /* @__PURE__ */ u("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z", fill: "currentColor" }) });
|
|
6892
6900
|
default:
|
|
6893
6901
|
return null;
|
|
6894
6902
|
}
|
|
@@ -6905,9 +6913,9 @@ const MessageStatusIndicator = ({ status }) => {
|
|
|
6905
6913
|
return "";
|
|
6906
6914
|
}
|
|
6907
6915
|
};
|
|
6908
|
-
return /* @__PURE__ */ u
|
|
6916
|
+
return /* @__PURE__ */ u("div", { className: "flex items-center gap-1 text-xs opacity-70", children: [
|
|
6909
6917
|
getStatusIcon(),
|
|
6910
|
-
/* @__PURE__ */ u
|
|
6918
|
+
/* @__PURE__ */ u("span", { className: "sr-only", children: getStatusText() })
|
|
6911
6919
|
] });
|
|
6912
6920
|
};
|
|
6913
6921
|
const MessageBubble = ({ message, isRTL }) => {
|
|
@@ -6916,27 +6924,27 @@ const MessageBubble = ({ message, isRTL }) => {
|
|
|
6916
6924
|
const renderMessageContent = () => {
|
|
6917
6925
|
switch (message.content.type) {
|
|
6918
6926
|
case "TEXT":
|
|
6919
|
-
return /* @__PURE__ */ u
|
|
6927
|
+
return /* @__PURE__ */ u(TextMessage, { content: message.content });
|
|
6920
6928
|
case "IMAGE":
|
|
6921
|
-
return /* @__PURE__ */ u
|
|
6929
|
+
return /* @__PURE__ */ u(ImageMessage, { content: message.content });
|
|
6922
6930
|
case "DOCUMENT":
|
|
6923
|
-
return /* @__PURE__ */ u
|
|
6931
|
+
return /* @__PURE__ */ u(DocumentMessage, { content: message.content });
|
|
6924
6932
|
case "BUTTON":
|
|
6925
|
-
return /* @__PURE__ */ u
|
|
6933
|
+
return /* @__PURE__ */ u(ButtonMessage, { content: message.content });
|
|
6926
6934
|
case "SELECT":
|
|
6927
|
-
return /* @__PURE__ */ u
|
|
6935
|
+
return /* @__PURE__ */ u(SelectMessage, { content: message.content });
|
|
6928
6936
|
case "ARTICLE":
|
|
6929
6937
|
case "CARDS":
|
|
6930
6938
|
case "FORM":
|
|
6931
|
-
return /* @__PURE__ */ u
|
|
6939
|
+
return /* @__PURE__ */ u("p", { className: "text-sm leading-relaxed italic text-gray-500", children: [
|
|
6932
6940
|
message.content.type,
|
|
6933
6941
|
" message (not yet implemented)"
|
|
6934
6942
|
] });
|
|
6935
6943
|
default:
|
|
6936
|
-
return /* @__PURE__ */ u
|
|
6944
|
+
return /* @__PURE__ */ u("p", { className: "text-sm leading-relaxed italic text-gray-500", children: "Unknown message type" });
|
|
6937
6945
|
}
|
|
6938
6946
|
};
|
|
6939
|
-
return /* @__PURE__ */ u
|
|
6947
|
+
return /* @__PURE__ */ u("div", { className: `flex items-center gap-2 ${shouldAlignRight ? isRTL ? "justify-start" : "justify-end" : isRTL ? "justify-end" : "justify-start"}`, children: /* @__PURE__ */ u(
|
|
6940
6948
|
"div",
|
|
6941
6949
|
{
|
|
6942
6950
|
className: `max-w-xs lg:max-w-sm px-4 py-2 rounded-lg ${isRTL ? shouldAlignRight ? "rounded-bl-sm" : "rounded-br-sm" : shouldAlignRight ? "rounded-br-sm" : "rounded-bl-sm"}`,
|
|
@@ -6946,7 +6954,7 @@ const MessageBubble = ({ message, isRTL }) => {
|
|
|
6946
6954
|
},
|
|
6947
6955
|
children: [
|
|
6948
6956
|
renderMessageContent(),
|
|
6949
|
-
shouldAlignRight && /* @__PURE__ */ u
|
|
6957
|
+
shouldAlignRight && /* @__PURE__ */ u("div", { className: `flex items-center gap-1 mt-1 ${isRTL ? "justify-start" : "justify-end"}`, children: /* @__PURE__ */ u(MessageStatusIndicator, { status: message.metadata.status }) })
|
|
6950
6958
|
]
|
|
6951
6959
|
}
|
|
6952
6960
|
) });
|
|
@@ -6954,7 +6962,7 @@ const MessageBubble = ({ message, isRTL }) => {
|
|
|
6954
6962
|
const MessageList = ({ messages, className = "" }) => {
|
|
6955
6963
|
const { isRTL } = useWidgetTranslation();
|
|
6956
6964
|
const { state } = useWidgetContext();
|
|
6957
|
-
const scrollRef = A(null);
|
|
6965
|
+
const scrollRef = A$1(null);
|
|
6958
6966
|
const getBackgroundColor = () => {
|
|
6959
6967
|
var _a, _b;
|
|
6960
6968
|
return ((_b = (_a = state.widgetConfig) == null ? void 0 : _a.uiConfigs) == null ? void 0 : _b.backgroundColor) || "#ffffff";
|
|
@@ -6964,7 +6972,7 @@ const MessageList = ({ messages, className = "" }) => {
|
|
|
6964
6972
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
6965
6973
|
}
|
|
6966
6974
|
}, [messages]);
|
|
6967
|
-
return /* @__PURE__ */ u
|
|
6975
|
+
return /* @__PURE__ */ u(
|
|
6968
6976
|
"div",
|
|
6969
6977
|
{
|
|
6970
6978
|
ref: scrollRef,
|
|
@@ -6975,19 +6983,19 @@ const MessageList = ({ messages, className = "" }) => {
|
|
|
6975
6983
|
style: {
|
|
6976
6984
|
backgroundColor: getBackgroundColor()
|
|
6977
6985
|
},
|
|
6978
|
-
children: messages.map((message) => /* @__PURE__ */ u
|
|
6986
|
+
children: messages.map((message) => /* @__PURE__ */ u(MessageBubble, { message, isRTL }, message.id))
|
|
6979
6987
|
}
|
|
6980
6988
|
);
|
|
6981
6989
|
};
|
|
6982
6990
|
const TypingIndicator = () => {
|
|
6983
6991
|
const { t: t2 } = useWidgetTranslation();
|
|
6984
|
-
return /* @__PURE__ */ u
|
|
6985
|
-
/* @__PURE__ */ u
|
|
6986
|
-
/* @__PURE__ */ u
|
|
6987
|
-
/* @__PURE__ */ u
|
|
6988
|
-
/* @__PURE__ */ u
|
|
6992
|
+
return /* @__PURE__ */ u("div", { className: "flex items-center gap-2 px-4 py-2 text-sm text-gray-500", children: [
|
|
6993
|
+
/* @__PURE__ */ u("div", { className: "flex gap-1", children: [
|
|
6994
|
+
/* @__PURE__ */ u("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
|
|
6995
|
+
/* @__PURE__ */ u("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
|
|
6996
|
+
/* @__PURE__ */ u("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
|
|
6989
6997
|
] }),
|
|
6990
|
-
/* @__PURE__ */ u
|
|
6998
|
+
/* @__PURE__ */ u("span", { children: t2("chat.writing", "Writing...") })
|
|
6991
6999
|
] });
|
|
6992
7000
|
};
|
|
6993
7001
|
const WindowHeader = ({ title, subtitle, onClose, className = "", logoUrl }) => {
|
|
@@ -6998,7 +7006,7 @@ const WindowHeader = ({ title, subtitle, onClose, className = "", logoUrl }) =>
|
|
|
6998
7006
|
yield changeLanguage(nextLang);
|
|
6999
7007
|
services == null ? void 0 : services.themeService.applyRTLLayout(nextLang.startsWith("ar"));
|
|
7000
7008
|
});
|
|
7001
|
-
return /* @__PURE__ */ u
|
|
7009
|
+
return /* @__PURE__ */ u(
|
|
7002
7010
|
"div",
|
|
7003
7011
|
{
|
|
7004
7012
|
className: `
|
|
@@ -7011,9 +7019,9 @@ const WindowHeader = ({ title, subtitle, onClose, className = "", logoUrl }) =>
|
|
|
7011
7019
|
borderBottomColor: "rgba(0, 0, 0, 0.1)"
|
|
7012
7020
|
},
|
|
7013
7021
|
children: [
|
|
7014
|
-
/* @__PURE__ */ u
|
|
7015
|
-
/* @__PURE__ */ u
|
|
7016
|
-
logoUrl ? /* @__PURE__ */ u
|
|
7022
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-3 max-sm:gap-2", children: [
|
|
7023
|
+
/* @__PURE__ */ u("div", { className: "w-8 h-8 max-sm:w-7 max-sm:h-7 bg-white rounded-full flex items-center justify-center overflow-hidden", children: [
|
|
7024
|
+
logoUrl ? /* @__PURE__ */ u(
|
|
7017
7025
|
"img",
|
|
7018
7026
|
{
|
|
7019
7027
|
src: logoUrl,
|
|
@@ -7026,15 +7034,15 @@ const WindowHeader = ({ title, subtitle, onClose, className = "", logoUrl }) =>
|
|
|
7026
7034
|
}
|
|
7027
7035
|
}
|
|
7028
7036
|
) : null,
|
|
7029
|
-
/* @__PURE__ */ u
|
|
7037
|
+
/* @__PURE__ */ u("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", className: `text-blue-600 max-sm:w-3.5 max-sm:h-3.5 ${logoUrl ? "hidden" : ""}`, "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z", fill: "currentColor" }) })
|
|
7030
7038
|
] }),
|
|
7031
|
-
/* @__PURE__ */ u
|
|
7032
|
-
title && /* @__PURE__ */ u
|
|
7033
|
-
subtitle && /* @__PURE__ */ u
|
|
7039
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col", children: [
|
|
7040
|
+
title && /* @__PURE__ */ u("h2", { className: "text-lg max-sm:text-base font-semibold leading-tight", style: { color: "var(--widget-text-color, #FFFFFF)" }, children: title }),
|
|
7041
|
+
subtitle && /* @__PURE__ */ u("p", { className: "text-sm max-sm:text-xs opacity-80 leading-tight", style: { color: "var(--widget-text-color, #FFFFFF)" }, children: subtitle })
|
|
7034
7042
|
] })
|
|
7035
7043
|
] }),
|
|
7036
|
-
/* @__PURE__ */ u
|
|
7037
|
-
/* @__PURE__ */ u
|
|
7044
|
+
/* @__PURE__ */ u("div", { className: `flex items-center ${isRTL ? "ml-2" : "mr-2"} gap-2`, children: [
|
|
7045
|
+
/* @__PURE__ */ u(
|
|
7038
7046
|
"button",
|
|
7039
7047
|
{
|
|
7040
7048
|
type: "button",
|
|
@@ -7046,7 +7054,7 @@ const WindowHeader = ({ title, subtitle, onClose, className = "", logoUrl }) =>
|
|
|
7046
7054
|
children: (currentLanguage == null ? void 0 : currentLanguage.startsWith("ar")) ? "EN" : "AR"
|
|
7047
7055
|
}
|
|
7048
7056
|
),
|
|
7049
|
-
onClose && /* @__PURE__ */ u
|
|
7057
|
+
onClose && /* @__PURE__ */ u(
|
|
7050
7058
|
"button",
|
|
7051
7059
|
{
|
|
7052
7060
|
type: "button",
|
|
@@ -7061,7 +7069,7 @@ const WindowHeader = ({ title, subtitle, onClose, className = "", logoUrl }) =>
|
|
|
7061
7069
|
touchAction: "manipulation"
|
|
7062
7070
|
},
|
|
7063
7071
|
"aria-label": "Close chat",
|
|
7064
|
-
children: /* @__PURE__ */ u
|
|
7072
|
+
children: /* @__PURE__ */ u("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", className: "text-white max-sm:w-4 max-sm:h-4", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M5 12h14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
7065
7073
|
}
|
|
7066
7074
|
)
|
|
7067
7075
|
] })
|
|
@@ -7135,7 +7143,7 @@ const ChatWindow = ({ className = "" }) => {
|
|
|
7135
7143
|
}
|
|
7136
7144
|
return void 0;
|
|
7137
7145
|
};
|
|
7138
|
-
return /* @__PURE__ */ u
|
|
7146
|
+
return /* @__PURE__ */ u(
|
|
7139
7147
|
"div",
|
|
7140
7148
|
{
|
|
7141
7149
|
className: `
|
|
@@ -7145,7 +7153,7 @@ const ChatWindow = ({ className = "" }) => {
|
|
|
7145
7153
|
`,
|
|
7146
7154
|
dir: isRTL ? "rtl" : "ltr",
|
|
7147
7155
|
children: [
|
|
7148
|
-
/* @__PURE__ */ u
|
|
7156
|
+
/* @__PURE__ */ u(
|
|
7149
7157
|
WindowHeader,
|
|
7150
7158
|
{
|
|
7151
7159
|
title: getHeaderTitle(),
|
|
@@ -7154,12 +7162,12 @@ const ChatWindow = ({ className = "" }) => {
|
|
|
7154
7162
|
logoUrl: getLogoUrl()
|
|
7155
7163
|
}
|
|
7156
7164
|
),
|
|
7157
|
-
/* @__PURE__ */ u
|
|
7158
|
-
/* @__PURE__ */ u
|
|
7159
|
-
/* @__PURE__ */ u
|
|
7160
|
-
state.isWriting && /* @__PURE__ */ u
|
|
7165
|
+
/* @__PURE__ */ u("div", { className: "flex-1 flex flex-col pb-[81px] max-sm:pb-[72px]", children: [
|
|
7166
|
+
/* @__PURE__ */ u("div", { className: "flex-1 overflow-hidden max-h-[475px] relative", children: [
|
|
7167
|
+
/* @__PURE__ */ u(MessageList, { messages: messagesWithGreeting, className: "h-full" }),
|
|
7168
|
+
state.isWriting && /* @__PURE__ */ u("div", { className: "absolute bottom-0 left-0 right-0 bg-white", children: /* @__PURE__ */ u(TypingIndicator, {}) })
|
|
7161
7169
|
] }),
|
|
7162
|
-
/* @__PURE__ */ u
|
|
7170
|
+
/* @__PURE__ */ u("div", { className: "absolute bottom-[69px] left-0 right-0 bg-white", children: /* @__PURE__ */ u(MessageInput, { onSendMessage: handleSendTextMessage, disabled: state.connectionState !== "connected", placeholder: getInputPlaceholder(), isWriting: state.isWriting }) })
|
|
7163
7171
|
] })
|
|
7164
7172
|
]
|
|
7165
7173
|
}
|
|
@@ -7174,15 +7182,15 @@ const FAQItem = ({ item, isExpanded = false, onToggle }) => {
|
|
|
7174
7182
|
const answer = isArabic ? item.answerInArabic || item.answer : item.answer;
|
|
7175
7183
|
const expanded = onToggle ? isExpanded : internalExpanded;
|
|
7176
7184
|
const handleToggle = onToggle || (() => setInternalExpanded(!internalExpanded));
|
|
7177
|
-
return /* @__PURE__ */ u
|
|
7178
|
-
/* @__PURE__ */ u
|
|
7179
|
-
/* @__PURE__ */ u
|
|
7180
|
-
/* @__PURE__ */ u
|
|
7181
|
-
/* @__PURE__ */ u
|
|
7182
|
-
/* @__PURE__ */ u
|
|
7185
|
+
return /* @__PURE__ */ u("div", { className: "border-b border-gray-100 last:border-b-0", children: [
|
|
7186
|
+
/* @__PURE__ */ u("button", { type: "button", onClick: handleToggle, className: `w-full p-4 text-left hover:bg-gray-50 transition-colors ${isRTL ? "text-right" : ""}`, "aria-expanded": expanded, children: /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-3", children: [
|
|
7187
|
+
/* @__PURE__ */ u("h3", { className: "text-sm font-medium text-gray-900 flex-1", children: question }),
|
|
7188
|
+
/* @__PURE__ */ u("div", { className: `flex-shrink-0 transition-transform duration-200 ${expanded ? "rotate-180" : ""}`, children: /* @__PURE__ */ u("svg", { className: "w-5 h-5 text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-label": expanded ? "Collapse" : "Expand", children: [
|
|
7189
|
+
/* @__PURE__ */ u("title", { children: expanded ? "Collapse" : "Expand" }),
|
|
7190
|
+
/* @__PURE__ */ u("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
|
|
7183
7191
|
] }) })
|
|
7184
7192
|
] }) }),
|
|
7185
|
-
expanded && /* @__PURE__ */ u
|
|
7193
|
+
expanded && /* @__PURE__ */ u("div", { className: `px-4 pb-4 ${isRTL ? "text-right" : ""}`, children: /* @__PURE__ */ u("div", { className: "text-sm text-gray-600 leading-relaxed", children: answer }) })
|
|
7186
7194
|
] });
|
|
7187
7195
|
};
|
|
7188
7196
|
const FAQList = ({ items, title, showAll = false, maxItems = 5, enableScrolling = true }) => {
|
|
@@ -7201,12 +7209,12 @@ const FAQList = ({ items, title, showAll = false, maxItems = 5, enableScrolling
|
|
|
7201
7209
|
setExpandedItems(newExpanded);
|
|
7202
7210
|
};
|
|
7203
7211
|
if (items.length === 0) {
|
|
7204
|
-
return /* @__PURE__ */ u
|
|
7212
|
+
return /* @__PURE__ */ u("div", { className: `text-center py-8 text-gray-500 ${isRTL ? "text-right" : ""}`, children: /* @__PURE__ */ u("p", { className: "text-sm", children: t2("faq.noItems", "No FAQ items available") }) });
|
|
7205
7213
|
}
|
|
7206
|
-
return /* @__PURE__ */ u
|
|
7207
|
-
title && /* @__PURE__ */ u
|
|
7208
|
-
/* @__PURE__ */ u
|
|
7209
|
-
hasMoreItems && !showAllItems && /* @__PURE__ */ u
|
|
7214
|
+
return /* @__PURE__ */ u("div", { className: `bg-white ${enableScrolling ? "h-full overflow-y-auto" : ""}`, children: [
|
|
7215
|
+
title && /* @__PURE__ */ u("div", { className: `px-4 py-3 border-b border-gray-200 ${isRTL ? "text-right" : ""}`, children: /* @__PURE__ */ u("h2", { className: "text-lg font-semibold text-gray-900", children: title }) }),
|
|
7216
|
+
/* @__PURE__ */ u("div", { className: "divide-y divide-gray-100", children: displayItems.map((item, index) => /* @__PURE__ */ u(FAQItem, { item, isExpanded: expandedItems.has(index), onToggle: () => toggleItem(index) }, `${item.question}-${index}`)) }),
|
|
7217
|
+
hasMoreItems && !showAllItems && /* @__PURE__ */ u("div", { className: "p-4 border-t border-gray-100", children: /* @__PURE__ */ u("button", { type: "button", onClick: () => setShowAllItems(true), className: "w-full py-2 px-4 text-sm font-medium text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-md transition-colors", children: [
|
|
7210
7218
|
t2("faq.showMore", "Show more FAQs"),
|
|
7211
7219
|
" (",
|
|
7212
7220
|
items.length - maxItems,
|
|
@@ -7232,8 +7240,8 @@ const FAQSearchInput = ({ value, onChange, onSearch, isLoading = false, placehol
|
|
|
7232
7240
|
onChange("");
|
|
7233
7241
|
onSearch("");
|
|
7234
7242
|
}, [onChange, onSearch]);
|
|
7235
|
-
return /* @__PURE__ */ u
|
|
7236
|
-
/* @__PURE__ */ u
|
|
7243
|
+
return /* @__PURE__ */ u("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ u("form", { onSubmit: handleSubmit, className: "relative", children: /* @__PURE__ */ u("div", { className: "relative", children: [
|
|
7244
|
+
/* @__PURE__ */ u(
|
|
7237
7245
|
"input",
|
|
7238
7246
|
{
|
|
7239
7247
|
type: "text",
|
|
@@ -7244,42 +7252,42 @@ const FAQSearchInput = ({ value, onChange, onSearch, isLoading = false, placehol
|
|
|
7244
7252
|
disabled: isLoading
|
|
7245
7253
|
}
|
|
7246
7254
|
),
|
|
7247
|
-
value && !isLoading && /* @__PURE__ */ u
|
|
7255
|
+
value && !isLoading && /* @__PURE__ */ u(
|
|
7248
7256
|
"button",
|
|
7249
7257
|
{
|
|
7250
7258
|
type: "button",
|
|
7251
7259
|
onClick: handleClear,
|
|
7252
7260
|
className: `absolute ${isRTL ? "left-8" : "right-8"} top-1/2 transform -translate-y-1/2 p-1 text-gray-400 hover:text-gray-600 transition-colors`,
|
|
7253
7261
|
"aria-label": t2("faq.search.clear", "Clear"),
|
|
7254
|
-
children: /* @__PURE__ */ u
|
|
7262
|
+
children: /* @__PURE__ */ u("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
7255
7263
|
}
|
|
7256
7264
|
),
|
|
7257
|
-
/* @__PURE__ */ u
|
|
7265
|
+
/* @__PURE__ */ u("div", { className: `absolute ${isRTL ? "left-3" : "right-3"} top-1/2 transform -translate-y-1/2 pointer-events-none`, children: isLoading ? /* @__PURE__ */ u("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" }) : /* @__PURE__ */ u("svg", { className: "w-4 h-4 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) })
|
|
7258
7266
|
] }) }) });
|
|
7259
7267
|
};
|
|
7260
7268
|
const FAQSearchResults = ({ results, isLoading, hasSearched }) => {
|
|
7261
7269
|
const { t: t2, isRTL } = useWidgetTranslation();
|
|
7262
7270
|
if (isLoading) {
|
|
7263
|
-
return /* @__PURE__ */ u
|
|
7264
|
-
/* @__PURE__ */ u
|
|
7265
|
-
/* @__PURE__ */ u
|
|
7271
|
+
return /* @__PURE__ */ u("div", { className: "flex-1 flex items-center justify-center p-8", children: /* @__PURE__ */ u("div", { className: "text-center", children: [
|
|
7272
|
+
/* @__PURE__ */ u("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto mb-4" }),
|
|
7273
|
+
/* @__PURE__ */ u("p", { className: "text-sm text-gray-500", children: t2("faq.search.searching", "Searching...") })
|
|
7266
7274
|
] }) });
|
|
7267
7275
|
}
|
|
7268
7276
|
if (!hasSearched) {
|
|
7269
|
-
return /* @__PURE__ */ u
|
|
7270
|
-
/* @__PURE__ */ u
|
|
7271
|
-
/* @__PURE__ */ u
|
|
7272
|
-
/* @__PURE__ */ u
|
|
7277
|
+
return /* @__PURE__ */ u("div", { className: `flex-1 flex items-center justify-center p-8 ${isRTL ? "text-right" : ""}`, children: /* @__PURE__ */ u("div", { className: "text-center text-gray-500", children: [
|
|
7278
|
+
/* @__PURE__ */ u("svg", { className: "w-16 h-16 mx-auto mb-4 text-gray-300", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-label": t2("faq.search.icon", "Search icon"), children: [
|
|
7279
|
+
/* @__PURE__ */ u("title", { children: t2("faq.search.icon", "Search icon") }),
|
|
7280
|
+
/* @__PURE__ */ u("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" })
|
|
7273
7281
|
] }),
|
|
7274
|
-
/* @__PURE__ */ u
|
|
7275
|
-
/* @__PURE__ */ u
|
|
7282
|
+
/* @__PURE__ */ u("h3", { className: "text-lg font-medium text-gray-900 mb-2", children: t2("faq.search.prompt.title", "Search FAQs") }),
|
|
7283
|
+
/* @__PURE__ */ u("p", { className: "text-sm", children: t2("faq.search.prompt.description", "Enter a question or keyword to find relevant FAQs") })
|
|
7276
7284
|
] }) });
|
|
7277
7285
|
}
|
|
7278
7286
|
if (results.length === 0) {
|
|
7279
|
-
return /* @__PURE__ */ u
|
|
7280
|
-
/* @__PURE__ */ u
|
|
7281
|
-
/* @__PURE__ */ u
|
|
7282
|
-
/* @__PURE__ */ u
|
|
7287
|
+
return /* @__PURE__ */ u("div", { className: `flex-1 flex items-center justify-center p-8 ${isRTL ? "text-right" : ""}`, children: /* @__PURE__ */ u("div", { className: "text-center text-gray-500", children: [
|
|
7288
|
+
/* @__PURE__ */ u("svg", { className: "w-16 h-16 mx-auto mb-4 text-gray-300", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-label": t2("faq.search.noResults.icon", "No results icon"), children: [
|
|
7289
|
+
/* @__PURE__ */ u("title", { children: t2("faq.search.noResults.icon", "No results icon") }),
|
|
7290
|
+
/* @__PURE__ */ u(
|
|
7283
7291
|
"path",
|
|
7284
7292
|
{
|
|
7285
7293
|
strokeLinecap: "round",
|
|
@@ -7289,13 +7297,13 @@ const FAQSearchResults = ({ results, isLoading, hasSearched }) => {
|
|
|
7289
7297
|
}
|
|
7290
7298
|
)
|
|
7291
7299
|
] }),
|
|
7292
|
-
/* @__PURE__ */ u
|
|
7293
|
-
/* @__PURE__ */ u
|
|
7300
|
+
/* @__PURE__ */ u("h3", { className: "text-lg font-medium text-gray-900 mb-2", children: t2("faq.search.noResults.title", "No results found") }),
|
|
7301
|
+
/* @__PURE__ */ u("p", { className: "text-sm", children: t2("faq.search.noResults.description", "No FAQs found. Try different keywords.") })
|
|
7294
7302
|
] }) });
|
|
7295
7303
|
}
|
|
7296
|
-
return /* @__PURE__ */ u
|
|
7297
|
-
/* @__PURE__ */ u
|
|
7298
|
-
/* @__PURE__ */ u
|
|
7304
|
+
return /* @__PURE__ */ u("div", { className: "flex-1 max-h-[475px] flex flex-col", children: [
|
|
7305
|
+
/* @__PURE__ */ u("div", { className: `p-4 border-b border-gray-100 flex-shrink-0 ${isRTL ? "text-right" : ""}`, children: /* @__PURE__ */ u("p", { className: "text-sm text-gray-600", children: results.length === 1 ? t2("faq.search.results.single", "1 result found") : t2("faq.search.results.multiple", "{count} results found").replace("{count}", results.length.toString()) }) }),
|
|
7306
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ u(FAQList, { items: results, showAll: true }) })
|
|
7299
7307
|
] });
|
|
7300
7308
|
};
|
|
7301
7309
|
const useFAQData = () => {
|
|
@@ -7369,7 +7377,7 @@ const FAQWindow = () => {
|
|
|
7369
7377
|
const [searchResults, setSearchResults] = d([]);
|
|
7370
7378
|
const [hasSearched, setHasSearched] = d(false);
|
|
7371
7379
|
const [isSearching, setIsSearching] = d(false);
|
|
7372
|
-
const searchTimeoutRef = A();
|
|
7380
|
+
const searchTimeoutRef = A$1();
|
|
7373
7381
|
const allFAQs = getAllFAQs();
|
|
7374
7382
|
const performSearch = q$1(
|
|
7375
7383
|
(query) => {
|
|
@@ -7409,30 +7417,30 @@ const FAQWindow = () => {
|
|
|
7409
7417
|
};
|
|
7410
7418
|
}, []);
|
|
7411
7419
|
if (isLoading) {
|
|
7412
|
-
return /* @__PURE__ */ u
|
|
7413
|
-
/* @__PURE__ */ u
|
|
7414
|
-
/* @__PURE__ */ u
|
|
7415
|
-
/* @__PURE__ */ u
|
|
7416
|
-
/* @__PURE__ */ u
|
|
7420
|
+
return /* @__PURE__ */ u("div", { className: `flex flex-col h-full bg-white ${isRTL ? "rtl" : ""}`, children: [
|
|
7421
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: /* @__PURE__ */ u("h2", { className: "text-lg font-semibold text-gray-900", children: t2("faq.title", "Frequently Asked Questions") }) }),
|
|
7422
|
+
/* @__PURE__ */ u("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ u("div", { className: "text-center", children: [
|
|
7423
|
+
/* @__PURE__ */ u("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto mb-4" }),
|
|
7424
|
+
/* @__PURE__ */ u("p", { className: "text-sm text-gray-500", children: t2("faq.loading", "Loading FAQs...") })
|
|
7417
7425
|
] }) })
|
|
7418
7426
|
] });
|
|
7419
7427
|
}
|
|
7420
7428
|
if (error) {
|
|
7421
|
-
return /* @__PURE__ */ u
|
|
7422
|
-
/* @__PURE__ */ u
|
|
7423
|
-
/* @__PURE__ */ u
|
|
7424
|
-
/* @__PURE__ */ u
|
|
7425
|
-
/* @__PURE__ */ u
|
|
7429
|
+
return /* @__PURE__ */ u("div", { className: `flex flex-col h-full bg-white ${isRTL ? "rtl" : ""}`, children: [
|
|
7430
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: /* @__PURE__ */ u("h2", { className: "text-lg font-semibold text-gray-900", children: t2("faq.title", "Frequently Asked Questions") }) }),
|
|
7431
|
+
/* @__PURE__ */ u("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ u("div", { className: `text-center p-4 ${isRTL ? "text-right" : ""}`, children: [
|
|
7432
|
+
/* @__PURE__ */ u("p", { className: "text-sm text-red-600 mb-2", children: t2("faq.error", "Failed to load FAQs") }),
|
|
7433
|
+
/* @__PURE__ */ u("p", { className: "text-xs text-gray-500", children: error })
|
|
7426
7434
|
] }) })
|
|
7427
7435
|
] });
|
|
7428
7436
|
}
|
|
7429
|
-
return /* @__PURE__ */ u
|
|
7430
|
-
/* @__PURE__ */ u
|
|
7431
|
-
/* @__PURE__ */ u
|
|
7432
|
-
/* @__PURE__ */ u
|
|
7437
|
+
return /* @__PURE__ */ u("div", { className: `flex flex-col h-full bg-white ${isRTL ? "rtl" : ""}`, children: [
|
|
7438
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: [
|
|
7439
|
+
/* @__PURE__ */ u("h2", { className: "text-lg font-semibold text-gray-900", children: t2("faq.title", "Frequently Asked Questions") }),
|
|
7440
|
+
/* @__PURE__ */ u("div", { className: "w-6 h-6 text-gray-400", children: /* @__PURE__ */ u("svg", { fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zM12 17.25h.007v.008H12v-.008z" }) }) })
|
|
7433
7441
|
] }),
|
|
7434
|
-
/* @__PURE__ */ u
|
|
7435
|
-
hasSearched ? /* @__PURE__ */ u
|
|
7442
|
+
/* @__PURE__ */ u(FAQSearchInput, { value: searchQuery, onChange: handleInputChange, onSearch: handleSearch, isLoading: isSearching, placeholder: t2("faq.search.placeholder", "Search FAQs...") }),
|
|
7443
|
+
hasSearched ? /* @__PURE__ */ u(FAQSearchResults, { results: searchResults, isLoading: isSearching, hasSearched, query: searchQuery }) : /* @__PURE__ */ u("div", { className: "flex-1 max-h-[475px]", children: /* @__PURE__ */ u(FAQList, { items: allFAQs, showAll: true }) })
|
|
7436
7444
|
] });
|
|
7437
7445
|
};
|
|
7438
7446
|
const OrganizationLogo = () => {
|
|
@@ -7445,28 +7453,28 @@ const OrganizationLogo = () => {
|
|
|
7445
7453
|
setLogoError(true);
|
|
7446
7454
|
};
|
|
7447
7455
|
if (logoError) {
|
|
7448
|
-
return /* @__PURE__ */ u
|
|
7456
|
+
return /* @__PURE__ */ u("div", { className: "w-8 h-8 max-sm:w-6 max-sm:h-6 bg-white rounded" });
|
|
7449
7457
|
}
|
|
7450
|
-
return /* @__PURE__ */ u
|
|
7458
|
+
return /* @__PURE__ */ u("img", { src: logoUrl, alt: "Organization logo", className: "w-8 h-8 max-sm:w-6 max-sm:h-6 rounded object-contain", onError: handleImageError });
|
|
7451
7459
|
};
|
|
7452
7460
|
const PopularFAQs = ({ maxItems = 3, onClick }) => {
|
|
7453
7461
|
const { t: t2, isRTL } = useWidgetTranslation();
|
|
7454
7462
|
const { getPopularFAQs, isLoading, error } = useFAQData();
|
|
7455
7463
|
const popularFAQs = getPopularFAQs(maxItems);
|
|
7456
7464
|
if (isLoading) {
|
|
7457
|
-
return /* @__PURE__ */ u
|
|
7458
|
-
/* @__PURE__ */ u
|
|
7459
|
-
/* @__PURE__ */ u
|
|
7460
|
-
/* @__PURE__ */ u
|
|
7461
|
-
/* @__PURE__ */ u
|
|
7465
|
+
return /* @__PURE__ */ u("div", { className: `bg-white/10 bg-gray-100 rounded-lg p-4 ${isRTL ? "text-right" : ""}`, children: /* @__PURE__ */ u("div", { className: "animate-pulse", children: [
|
|
7466
|
+
/* @__PURE__ */ u("div", { className: "h-4 bg-white/20 rounded mb-3" }),
|
|
7467
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
7468
|
+
/* @__PURE__ */ u("div", { className: "h-3 bg-white/20 rounded" }),
|
|
7469
|
+
/* @__PURE__ */ u("div", { className: "h-3 bg-white/20 rounded w-3/4" })
|
|
7462
7470
|
] })
|
|
7463
7471
|
] }) });
|
|
7464
7472
|
}
|
|
7465
7473
|
if (error || popularFAQs.length === 0) {
|
|
7466
7474
|
return null;
|
|
7467
7475
|
}
|
|
7468
|
-
return /* @__PURE__ */ u
|
|
7469
|
-
/* @__PURE__ */ u
|
|
7476
|
+
return /* @__PURE__ */ u("div", { className: "bg-white/10 bg-gray-100 rounded-lg", children: [
|
|
7477
|
+
/* @__PURE__ */ u(
|
|
7470
7478
|
"button",
|
|
7471
7479
|
{
|
|
7472
7480
|
type: "button",
|
|
@@ -7478,20 +7486,20 @@ const PopularFAQs = ({ maxItems = 3, onClick }) => {
|
|
|
7478
7486
|
"--tw-ring-color": "var(--widget-primary-color, #3C5BFF)"
|
|
7479
7487
|
},
|
|
7480
7488
|
children: [
|
|
7481
|
-
/* @__PURE__ */ u
|
|
7482
|
-
/* @__PURE__ */ u
|
|
7483
|
-
/* @__PURE__ */ u
|
|
7484
|
-
/* @__PURE__ */ u
|
|
7489
|
+
/* @__PURE__ */ u("h4", { className: "text-sm max-sm:text-sm font-semibold text-gray-900", children: t2("home.searchHelp", "Search for help") }),
|
|
7490
|
+
/* @__PURE__ */ u("div", { className: "w-4 h-4 max-sm:w-5 max-sm:h-5 flex-shrink-0", style: { color: "var(--widget-primary-color, #3C5BFF)" }, children: /* @__PURE__ */ u("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: [
|
|
7491
|
+
/* @__PURE__ */ u("circle", { cx: "7", cy: "7", r: "5" }),
|
|
7492
|
+
/* @__PURE__ */ u("path", { d: "M13 13l-3-3" })
|
|
7485
7493
|
] }) })
|
|
7486
7494
|
]
|
|
7487
7495
|
}
|
|
7488
7496
|
),
|
|
7489
|
-
/* @__PURE__ */ u
|
|
7497
|
+
/* @__PURE__ */ u("div", { className: "bg-white/5", children: /* @__PURE__ */ u(FAQList, { items: popularFAQs, maxItems, showAll: false, enableScrolling: false }) })
|
|
7490
7498
|
] });
|
|
7491
7499
|
};
|
|
7492
7500
|
const SendMessageButton = ({ onClick }) => {
|
|
7493
7501
|
const { t: t2 } = useWidgetTranslation();
|
|
7494
|
-
return /* @__PURE__ */ u
|
|
7502
|
+
return /* @__PURE__ */ u(
|
|
7495
7503
|
"button",
|
|
7496
7504
|
{
|
|
7497
7505
|
type: "button",
|
|
@@ -7503,26 +7511,26 @@ const SendMessageButton = ({ onClick }) => {
|
|
|
7503
7511
|
"--tw-ring-color": "var(--widget-primary-color, #3C5BFF)"
|
|
7504
7512
|
},
|
|
7505
7513
|
children: [
|
|
7506
|
-
/* @__PURE__ */ u
|
|
7507
|
-
/* @__PURE__ */ u
|
|
7508
|
-
/* @__PURE__ */ u
|
|
7514
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col items-start", children: [
|
|
7515
|
+
/* @__PURE__ */ u("h4", { className: "text-sm max-sm:text-sm font-semibold text-gray-900", children: t2("home.sendMessage", "Send us a message") }),
|
|
7516
|
+
/* @__PURE__ */ u("p", { className: "text-sm max-sm:text-xs text-gray-600 mt-1", children: t2("home.replyTime", "We typically reply within a day") })
|
|
7509
7517
|
] }),
|
|
7510
|
-
/* @__PURE__ */ u
|
|
7518
|
+
/* @__PURE__ */ u("div", { className: "w-4 h-4 max-sm:w-5 max-sm:h-5 flex-shrink-0", style: { color: "var(--widget-primary-color, #3C5BFF)" }, children: /* @__PURE__ */ u("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M6 3l6 5-6 5V3z" }) }) })
|
|
7511
7519
|
]
|
|
7512
7520
|
}
|
|
7513
7521
|
);
|
|
7514
7522
|
};
|
|
7515
7523
|
const QuickActionButtons = ({ onSendMessage, onSearchHelp }) => {
|
|
7516
|
-
return /* @__PURE__ */ u
|
|
7517
|
-
/* @__PURE__ */ u
|
|
7518
|
-
/* @__PURE__ */ u
|
|
7524
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col gap-3 p-4 max-sm:p-3 max-sm:gap-2", children: [
|
|
7525
|
+
/* @__PURE__ */ u(SendMessageButton, { onClick: onSendMessage }),
|
|
7526
|
+
/* @__PURE__ */ u(PopularFAQs, { maxItems: 3, onClick: onSearchHelp })
|
|
7519
7527
|
] });
|
|
7520
7528
|
};
|
|
7521
7529
|
const WelcomeMessage = () => {
|
|
7522
7530
|
const { t: t2 } = useWidgetTranslation();
|
|
7523
|
-
return /* @__PURE__ */ u
|
|
7524
|
-
/* @__PURE__ */ u
|
|
7525
|
-
/* @__PURE__ */ u
|
|
7531
|
+
return /* @__PURE__ */ u("div", { className: "text-white", children: [
|
|
7532
|
+
/* @__PURE__ */ u("h2", { className: "text-2xl max-sm:text-xl font-bold opacity-70 mb-1", children: t2("home.greeting", "Hello there") }),
|
|
7533
|
+
/* @__PURE__ */ u("h3", { className: "text-2xl max-sm:text-xl font-bold", children: t2("home.question", "How can we help?") })
|
|
7526
7534
|
] });
|
|
7527
7535
|
};
|
|
7528
7536
|
const HomeWindow = () => {
|
|
@@ -7534,8 +7542,8 @@ const HomeWindow = () => {
|
|
|
7534
7542
|
const handleSearchHelp = () => {
|
|
7535
7543
|
dispatch({ type: "SET_CURRENT_WINDOW", payload: "faq" });
|
|
7536
7544
|
};
|
|
7537
|
-
return /* @__PURE__ */ u
|
|
7538
|
-
/* @__PURE__ */ u
|
|
7545
|
+
return /* @__PURE__ */ u("div", { className: `flex flex-col h-full ${isRTL ? "rtl" : ""}`, children: [
|
|
7546
|
+
/* @__PURE__ */ u(
|
|
7539
7547
|
"div",
|
|
7540
7548
|
{
|
|
7541
7549
|
className: "absolute inset-0",
|
|
@@ -7544,30 +7552,30 @@ const HomeWindow = () => {
|
|
|
7544
7552
|
}
|
|
7545
7553
|
}
|
|
7546
7554
|
),
|
|
7547
|
-
/* @__PURE__ */ u
|
|
7548
|
-
/* @__PURE__ */ u
|
|
7549
|
-
/* @__PURE__ */ u
|
|
7550
|
-
/* @__PURE__ */ u
|
|
7555
|
+
/* @__PURE__ */ u("div", { className: "relative flex flex-col h-full overflow-y-auto overflow-x-hidden", children: [
|
|
7556
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col gap-6 p-5 max-sm:p-4 pt-5 max-sm:pt-4 flex-shrink-0", children: [
|
|
7557
|
+
/* @__PURE__ */ u("div", { className: "flex justify-between items-end", children: /* @__PURE__ */ u(OrganizationLogo, {}) }),
|
|
7558
|
+
/* @__PURE__ */ u(WelcomeMessage, {})
|
|
7551
7559
|
] }),
|
|
7552
|
-
/* @__PURE__ */ u
|
|
7560
|
+
/* @__PURE__ */ u("div", { className: "flex-1 min-h-0 bg-white", children: /* @__PURE__ */ u(QuickActionButtons, { onSendMessage: handleSendMessage, onSearchHelp: handleSearchHelp }) })
|
|
7553
7561
|
] })
|
|
7554
7562
|
] });
|
|
7555
7563
|
};
|
|
7556
7564
|
const HelpIcon = ({ isActive = false, className = "" }) => {
|
|
7557
7565
|
const strokeColor = isActive ? "var(--widget-secondary-color, #6B7280)" : "var(--widget-text-primary, #1A1A1A)";
|
|
7558
|
-
return /* @__PURE__ */ u
|
|
7559
|
-
/* @__PURE__ */ u
|
|
7560
|
-
/* @__PURE__ */ u
|
|
7561
|
-
/* @__PURE__ */ u
|
|
7562
|
-
/* @__PURE__ */ u
|
|
7566
|
+
return /* @__PURE__ */ u("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", className, role: "img", "aria-label": "Help", children: [
|
|
7567
|
+
/* @__PURE__ */ u("title", { children: "Help" }),
|
|
7568
|
+
/* @__PURE__ */ u("circle", { cx: "12", cy: "12", r: "9.25", stroke: strokeColor, strokeWidth: "1.7" }),
|
|
7569
|
+
/* @__PURE__ */ u("path", { d: "M9.66 9C9.66 7.34315 10.9932 6 12.66 6C14.3268 6 15.66 7.34315 15.66 9C15.66 10.6569 14.3268 12 12.66 12", stroke: strokeColor, strokeWidth: "1.7", strokeLinecap: "round" }),
|
|
7570
|
+
/* @__PURE__ */ u("circle", { cx: "12.66", cy: "16", r: "1.77", fill: strokeColor })
|
|
7563
7571
|
] });
|
|
7564
7572
|
};
|
|
7565
7573
|
const HomeIcon = ({ isActive = false, className = "" }) => {
|
|
7566
7574
|
const fillColor = isActive ? "var(--widget-secondary-color, #6B7280)" : "var(--widget-text-primary, #1A1A1A)";
|
|
7567
|
-
return /* @__PURE__ */ u
|
|
7568
|
-
/* @__PURE__ */ u
|
|
7569
|
-
/* @__PURE__ */ u
|
|
7570
|
-
/* @__PURE__ */ u
|
|
7575
|
+
return /* @__PURE__ */ u("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", className, role: "img", "aria-label": "Home", children: [
|
|
7576
|
+
/* @__PURE__ */ u("title", { children: "Home" }),
|
|
7577
|
+
/* @__PURE__ */ u("path", { d: "M2 12L12 2L22 12", stroke: fillColor, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
7578
|
+
/* @__PURE__ */ u(
|
|
7571
7579
|
"path",
|
|
7572
7580
|
{
|
|
7573
7581
|
d: "M3 21V9L12 2L21 9V21H15V16C15 15.4477 14.5523 15 14 15H10C9.44772 15 9 15.4477 9 16V21H3Z",
|
|
@@ -7582,9 +7590,9 @@ const HomeIcon = ({ isActive = false, className = "" }) => {
|
|
|
7582
7590
|
};
|
|
7583
7591
|
const MessagesIcon = ({ isActive = false, className = "" }) => {
|
|
7584
7592
|
const fillColor = isActive ? "var(--widget-secondary-color, #6B7280)" : "var(--widget-text-primary, #1A1A1A)";
|
|
7585
|
-
return /* @__PURE__ */ u
|
|
7586
|
-
/* @__PURE__ */ u
|
|
7587
|
-
/* @__PURE__ */ u
|
|
7593
|
+
return /* @__PURE__ */ u("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", className, role: "img", "aria-label": "Messages", children: [
|
|
7594
|
+
/* @__PURE__ */ u("title", { children: "Messages" }),
|
|
7595
|
+
/* @__PURE__ */ u(
|
|
7588
7596
|
"path",
|
|
7589
7597
|
{
|
|
7590
7598
|
d: "M21 15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H7L3 21V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15Z",
|
|
@@ -7595,13 +7603,13 @@ const MessagesIcon = ({ isActive = false, className = "" }) => {
|
|
|
7595
7603
|
strokeLinejoin: "round"
|
|
7596
7604
|
}
|
|
7597
7605
|
),
|
|
7598
|
-
isActive && /* @__PURE__ */ u
|
|
7606
|
+
isActive && /* @__PURE__ */ u("circle", { cx: "11.04", cy: "16", r: "1.77", fill: fillColor })
|
|
7599
7607
|
] });
|
|
7600
7608
|
};
|
|
7601
7609
|
const NotificationBadge = ({ count, className = "" }) => {
|
|
7602
7610
|
if (count <= 0) return null;
|
|
7603
7611
|
const displayCount = count > 99 ? "99+" : count.toString();
|
|
7604
|
-
return /* @__PURE__ */ u
|
|
7612
|
+
return /* @__PURE__ */ u(
|
|
7605
7613
|
"div",
|
|
7606
7614
|
{
|
|
7607
7615
|
className: `absolute -top-1 -right-1 bg-red-500 text-white text-xs font-medium rounded-full min-w-[18px] h-[18px] flex items-center justify-center px-1 ${className}`,
|
|
@@ -7642,7 +7650,7 @@ const Navigation = ({ className = "" }) => {
|
|
|
7642
7650
|
showBadge: false
|
|
7643
7651
|
}
|
|
7644
7652
|
];
|
|
7645
|
-
return /* @__PURE__ */ u
|
|
7653
|
+
return /* @__PURE__ */ u(
|
|
7646
7654
|
"nav",
|
|
7647
7655
|
{
|
|
7648
7656
|
className: `
|
|
@@ -7659,7 +7667,7 @@ const Navigation = ({ className = "" }) => {
|
|
|
7659
7667
|
children: navigationTabs.map((tab) => {
|
|
7660
7668
|
const isActive = state.currentWindow === tab.id;
|
|
7661
7669
|
const IconComponent = tab.icon;
|
|
7662
|
-
return /* @__PURE__ */ u
|
|
7670
|
+
return /* @__PURE__ */ u(
|
|
7663
7671
|
"button",
|
|
7664
7672
|
{
|
|
7665
7673
|
type: "button",
|
|
@@ -7682,11 +7690,11 @@ const Navigation = ({ className = "" }) => {
|
|
|
7682
7690
|
"aria-label": tab.label,
|
|
7683
7691
|
"aria-current": isActive ? "page" : void 0,
|
|
7684
7692
|
children: [
|
|
7685
|
-
/* @__PURE__ */ u
|
|
7686
|
-
/* @__PURE__ */ u
|
|
7687
|
-
tab.showBadge && state.unreadCount > 0 && /* @__PURE__ */ u
|
|
7693
|
+
/* @__PURE__ */ u("div", { className: "relative", children: [
|
|
7694
|
+
/* @__PURE__ */ u(IconComponent, { isActive, className: "w-6 h-6" }),
|
|
7695
|
+
tab.showBadge && state.unreadCount > 0 && /* @__PURE__ */ u(NotificationBadge, { count: state.unreadCount })
|
|
7688
7696
|
] }),
|
|
7689
|
-
/* @__PURE__ */ u
|
|
7697
|
+
/* @__PURE__ */ u(
|
|
7690
7698
|
"span",
|
|
7691
7699
|
{
|
|
7692
7700
|
className: "text-sm max-sm:text-xs font-medium leading-none",
|
|
@@ -7711,20 +7719,20 @@ const WidgetContent = () => {
|
|
|
7711
7719
|
const renderCurrentWindow = () => {
|
|
7712
7720
|
switch (state.currentWindow) {
|
|
7713
7721
|
case "home":
|
|
7714
|
-
return /* @__PURE__ */ u
|
|
7722
|
+
return /* @__PURE__ */ u(HomeWindow, {});
|
|
7715
7723
|
case "chat":
|
|
7716
|
-
return /* @__PURE__ */ u
|
|
7724
|
+
return /* @__PURE__ */ u(ChatWindow, {});
|
|
7717
7725
|
case "faq":
|
|
7718
|
-
return /* @__PURE__ */ u
|
|
7726
|
+
return /* @__PURE__ */ u(FAQWindow, {});
|
|
7719
7727
|
case "news":
|
|
7720
|
-
return /* @__PURE__ */ u
|
|
7728
|
+
return /* @__PURE__ */ u("div", { className: "flex-1 p-4", children: "News Window - Coming Soon" });
|
|
7721
7729
|
default:
|
|
7722
|
-
return /* @__PURE__ */ u
|
|
7730
|
+
return /* @__PURE__ */ u(HomeWindow, {});
|
|
7723
7731
|
}
|
|
7724
7732
|
};
|
|
7725
|
-
return /* @__PURE__ */ u
|
|
7726
|
-
/* @__PURE__ */ u
|
|
7727
|
-
/* @__PURE__ */ u
|
|
7733
|
+
return /* @__PURE__ */ u("div", { className: "flex-1 overflow-hidden relative flex flex-col", children: [
|
|
7734
|
+
/* @__PURE__ */ u("div", { className: "flex-1 overflow-hidden", children: renderCurrentWindow() }),
|
|
7735
|
+
/* @__PURE__ */ u(Navigation, {})
|
|
7728
7736
|
] });
|
|
7729
7737
|
};
|
|
7730
7738
|
const initialWidgetState = {
|
|
@@ -7902,10 +7910,10 @@ const WidgetManager = ({ config }) => {
|
|
|
7902
7910
|
initializeWidget();
|
|
7903
7911
|
}, []);
|
|
7904
7912
|
if (initError) {
|
|
7905
|
-
return /* @__PURE__ */ u
|
|
7906
|
-
/* @__PURE__ */ u
|
|
7907
|
-
/* @__PURE__ */ u
|
|
7908
|
-
/* @__PURE__ */ u
|
|
7913
|
+
return /* @__PURE__ */ u("div", { className: "fixed bottom-5 right-5 bg-red-50 border border-red-200 rounded-lg p-4 max-w-sm z-[1000]", children: /* @__PURE__ */ u("div", { className: "flex items-center", children: [
|
|
7914
|
+
/* @__PURE__ */ u("div", { className: "flex-shrink-0", children: /* @__PURE__ */ u("svg", { className: "h-5 w-5 text-red-400", viewBox: "0 0 20 20", fill: "currentColor", "aria-label": "Error icon", children: [
|
|
7915
|
+
/* @__PURE__ */ u("title", { children: "Error" }),
|
|
7916
|
+
/* @__PURE__ */ u(
|
|
7909
7917
|
"path",
|
|
7910
7918
|
{
|
|
7911
7919
|
fillRule: "evenodd",
|
|
@@ -7914,16 +7922,16 @@ const WidgetManager = ({ config }) => {
|
|
|
7914
7922
|
}
|
|
7915
7923
|
)
|
|
7916
7924
|
] }) }),
|
|
7917
|
-
/* @__PURE__ */ u
|
|
7918
|
-
/* @__PURE__ */ u
|
|
7919
|
-
/* @__PURE__ */ u
|
|
7925
|
+
/* @__PURE__ */ u("div", { className: "ml-3", children: [
|
|
7926
|
+
/* @__PURE__ */ u("h3", { className: "text-sm font-medium text-red-800", children: "Widget Error" }),
|
|
7927
|
+
/* @__PURE__ */ u("p", { className: "text-sm text-red-700 mt-1", children: initError })
|
|
7920
7928
|
] })
|
|
7921
7929
|
] }) });
|
|
7922
7930
|
}
|
|
7923
7931
|
if (!isInitialized) {
|
|
7924
|
-
return /* @__PURE__ */ u
|
|
7932
|
+
return /* @__PURE__ */ u("div", { className: "fixed bottom-5 right-5 w-14 h-14 rounded-full bg-gray-200 animate-pulse z-[1000]" });
|
|
7925
7933
|
}
|
|
7926
|
-
return /* @__PURE__ */ u
|
|
7934
|
+
return /* @__PURE__ */ u(
|
|
7927
7935
|
WidgetErrorBoundary,
|
|
7928
7936
|
{
|
|
7929
7937
|
maxRetries: 3,
|
|
@@ -7931,7 +7939,7 @@ const WidgetManager = ({ config }) => {
|
|
|
7931
7939
|
onError: (error, errorInfo) => {
|
|
7932
7940
|
console.error("Widget Error Boundary:", error, errorInfo);
|
|
7933
7941
|
},
|
|
7934
|
-
children: /* @__PURE__ */ u
|
|
7942
|
+
children: /* @__PURE__ */ u("div", { className: "font-widget text-widget-base leading-relaxed text-widget-text-primary", children: /* @__PURE__ */ u(
|
|
7935
7943
|
WidgetProvider,
|
|
7936
7944
|
{
|
|
7937
7945
|
value: {
|
|
@@ -7940,7 +7948,7 @@ const WidgetManager = ({ config }) => {
|
|
|
7940
7948
|
config,
|
|
7941
7949
|
services: { apiService, themeService, i18nService, persistenceService }
|
|
7942
7950
|
},
|
|
7943
|
-
children: /* @__PURE__ */ u
|
|
7951
|
+
children: /* @__PURE__ */ u(WidgetWithConnection, {})
|
|
7944
7952
|
}
|
|
7945
7953
|
) })
|
|
7946
7954
|
}
|
|
@@ -7949,7 +7957,7 @@ const WidgetManager = ({ config }) => {
|
|
|
7949
7957
|
const WidgetWithConnection = () => {
|
|
7950
7958
|
const { state, dispatch, config } = useWidgetContext();
|
|
7951
7959
|
const { initializeConnection, connectionState, onMessage, onTokenRefresh, refreshConnection } = useStompConnectionContext();
|
|
7952
|
-
const connectionInitializedRef = A(false);
|
|
7960
|
+
const connectionInitializedRef = A$1(false);
|
|
7953
7961
|
y(() => {
|
|
7954
7962
|
if (state.user && state.widgetConfig && config && !connectionInitializedRef.current) {
|
|
7955
7963
|
connectionInitializedRef.current = true;
|
|
@@ -8047,9 +8055,9 @@ const WidgetWithConnection = () => {
|
|
|
8047
8055
|
return `fixed bottom-20 right-5 ${width} ${height}`;
|
|
8048
8056
|
}
|
|
8049
8057
|
};
|
|
8050
|
-
return /* @__PURE__ */ u
|
|
8051
|
-
/* @__PURE__ */ u
|
|
8052
|
-
state.isOpen && /* @__PURE__ */ u
|
|
8058
|
+
return /* @__PURE__ */ u(k$1, { children: [
|
|
8059
|
+
/* @__PURE__ */ u(TriggerButton, {}),
|
|
8060
|
+
state.isOpen && /* @__PURE__ */ u(
|
|
8053
8061
|
"div",
|
|
8054
8062
|
{
|
|
8055
8063
|
className: `${getPositionClasses()} bg-white rounded-2xl shadow-xl border border-gray-200 z-[999] flex flex-col overflow-hidden
|
|
@@ -8058,7 +8066,7 @@ const WidgetWithConnection = () => {
|
|
|
8058
8066
|
max-sm:fixed max-sm:inset-4 max-sm:bottom-20 max-sm:w-auto max-sm:h-auto max-sm:max-h-[calc(100vh-8rem)] max-sm:rounded-xl
|
|
8059
8067
|
max-sm:landscape:inset-2 max-sm:landscape:bottom-16 max-sm:landscape:max-h-[calc(100vh-4rem)]
|
|
8060
8068
|
scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100`,
|
|
8061
|
-
children: /* @__PURE__ */ u
|
|
8069
|
+
children: /* @__PURE__ */ u(WidgetContent, {})
|
|
8062
8070
|
}
|
|
8063
8071
|
)
|
|
8064
8072
|
] });
|
|
@@ -8074,19 +8082,7 @@ let AnalytickWidget$1 = class AnalytickWidget extends HTMLElement {
|
|
|
8074
8082
|
this.shadowRoot = this.attachShadow({ mode: "closed" });
|
|
8075
8083
|
}
|
|
8076
8084
|
static get observedAttributes() {
|
|
8077
|
-
return [
|
|
8078
|
-
"org-id",
|
|
8079
|
-
"widget-id",
|
|
8080
|
-
"base-url",
|
|
8081
|
-
"primary-color",
|
|
8082
|
-
"secondary-color",
|
|
8083
|
-
"theme",
|
|
8084
|
-
"language",
|
|
8085
|
-
"position",
|
|
8086
|
-
"auto-open",
|
|
8087
|
-
"greeting-message",
|
|
8088
|
-
"rtl"
|
|
8089
|
-
];
|
|
8085
|
+
return ["org-id", "widget-id", "base-url", "primary-color", "secondary-color", "theme", "language", "position", "auto-open", "greeting-message", "rtl"];
|
|
8090
8086
|
}
|
|
8091
8087
|
// Getters and Setters for properties
|
|
8092
8088
|
get orgId() {
|
|
@@ -8237,7 +8233,7 @@ let AnalytickWidget$1 = class AnalytickWidget extends HTMLElement {
|
|
|
8237
8233
|
this.setupShadowDOM();
|
|
8238
8234
|
try {
|
|
8239
8235
|
G$1(
|
|
8240
|
-
/* @__PURE__ */ u
|
|
8236
|
+
/* @__PURE__ */ u(StompConnectionProvider, { children: /* @__PURE__ */ u(WidgetManager, { config: this.config }) }),
|
|
8241
8237
|
this.shadowRoot
|
|
8242
8238
|
);
|
|
8243
8239
|
this.isInitialized = true;
|
|
@@ -8373,7 +8369,7 @@ const init = (config) => {
|
|
|
8373
8369
|
return widget;
|
|
8374
8370
|
}
|
|
8375
8371
|
};
|
|
8376
|
-
const AnalytickWidget2 = (props) => {
|
|
8372
|
+
const AnalytickWidget2 = D((props, ref) => {
|
|
8377
8373
|
if (typeof window === "undefined") return null;
|
|
8378
8374
|
if (!customElements.get("analytick-widget")) {
|
|
8379
8375
|
customElements.define("analytick-widget", AnalytickWidget$1);
|
|
@@ -8389,9 +8385,10 @@ const AnalytickWidget2 = (props) => {
|
|
|
8389
8385
|
position: props.position,
|
|
8390
8386
|
"auto-open": props.autoOpen ? "" : void 0,
|
|
8391
8387
|
"greeting-message": props.greetingMessage,
|
|
8392
|
-
rtl: props.rtl ? "" : void 0
|
|
8388
|
+
rtl: props.rtl ? "" : void 0,
|
|
8389
|
+
ref: ref || null
|
|
8393
8390
|
});
|
|
8394
|
-
};
|
|
8391
|
+
});
|
|
8395
8392
|
if (typeof window !== "undefined" && !customElements.get("analytick-widget")) {
|
|
8396
8393
|
customElements.define("analytick-widget", AnalytickWidget$1);
|
|
8397
8394
|
}
|