@subiz/widget-v4 4.1.57 → 4.1.60

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.
Files changed (65) hide show
  1. package/app.js +3 -3
  2. package/compiled_src/call/call.js +2 -2
  3. package/compiled_src/chatbox/ChatButton.js +20 -5
  4. package/compiled_src/chatbox/DropdownSelect.js +2 -2
  5. package/compiled_src/chatbox/ImageAttachments.js +2 -2
  6. package/compiled_src/chatbox/MessageInput.js +2 -2
  7. package/compiled_src/chatbox/Order.js +2 -2
  8. package/compiled_src/chatbox/Rating.js +2 -2
  9. package/compiled_src/chatbox/Widget.js +2 -2
  10. package/compiled_src/contact/contact.js +2 -2
  11. package/compiled_src/lib.js +8 -2
  12. package/compiled_src/notif/notif.js +2 -3
  13. package/compiled_src/order/address_picker.js +2 -2
  14. package/compiled_src/order/order.js +2 -2
  15. package/compiled_src/popup/countdown.js +2 -2
  16. package/compiled_src/popup/popup.js +2 -2
  17. package/compiled_src/store/api.js +2 -2
  18. package/compiled_src/store/api_fake.js +2 -2
  19. package/compiled_src/store/store.js +12 -3
  20. package/compiled_src/util/common.js +8 -2
  21. package/dist/{841.js → 132.js} +644 -653
  22. package/dist/178.js +1 -1
  23. package/dist/18a02a9c54e.132.js +1 -0
  24. package/dist/18a02a9c54e.178.js +1 -0
  25. package/dist/18a02a9c54e.213.js +1 -0
  26. package/dist/18a02a9c54e.335.js +1 -0
  27. package/dist/{18c8aa8e71b.362.js → 18a02a9c54e.362.js} +1 -1
  28. package/dist/18a02a9c54e.441.js +1 -0
  29. package/dist/18a02a9c54e.605.js +1 -0
  30. package/dist/{18c8aa8e71b.782.js → 18a02a9c54e.782.js} +1 -1
  31. package/dist/18a02a9c54e.app.js +1 -0
  32. package/dist/{18c8aa8e71b.index.html → 18a02a9c54e.index.html} +4 -4
  33. package/dist/{18c8aa8e71b.library.html → 18a02a9c54e.library.html} +4 -4
  34. package/dist/18a02a9c54e.library.js +1 -0
  35. package/dist/{18c8aa8e71b.preview.html → 18a02a9c54e.preview.html} +1 -1
  36. package/dist/18a02a9c54e.preview.js +1 -0
  37. package/dist/18a02a9c54e.screenshoot.js +1 -0
  38. package/dist/18a02a9c54e.webview.js +1 -0
  39. package/dist/213.js +106 -122
  40. package/dist/335.js +27 -27
  41. package/dist/362.js +1 -1
  42. package/dist/441.js +2855 -0
  43. package/dist/605.js +52 -52
  44. package/dist/782.js +1 -1
  45. package/dist/HASH +1 -1
  46. package/dist/malicious-app.js +3 -9
  47. package/dist/screenshoot.html +1 -1
  48. package/dist/screenshoot.js +621 -486
  49. package/package.json +7 -7
  50. package/src/chatbox/ChatButton.js +20 -5
  51. package/src/lib.js +8 -0
  52. package/src/notif/notif.js +1 -1
  53. package/src/store/store.js +17 -9
  54. package/src/util/common.js +8 -2
  55. package/dist/18c8aa8e71b.178.js +0 -1
  56. package/dist/18c8aa8e71b.213.js +0 -1
  57. package/dist/18c8aa8e71b.335.js +0 -1
  58. package/dist/18c8aa8e71b.605.js +0 -1
  59. package/dist/18c8aa8e71b.841.js +0 -1
  60. package/dist/18c8aa8e71b.app.js +0 -1
  61. package/dist/18c8aa8e71b.library.js +0 -1
  62. package/dist/18c8aa8e71b.preview.js +0 -1
  63. package/dist/18c8aa8e71b.screenshoot.js +0 -1
  64. package/dist/18c8aa8e71b.webview.js +0 -1
  65. /package/dist/{18c8aa8e71b.678.js → 18a02a9c54e.678.js} +0 -0
@@ -366,7 +366,7 @@ module.exports = function (maxBatch, maxDelay, handler) {
366
366
 
367
367
  this.push = function (payload, priority) {
368
368
  return new Promise(function (resolve) {
369
- myBuffers.push({payload: payload, priority: priority, created: Date.now(), rs: resolve})
369
+ myBuffers.push({ payload: payload, priority: priority, created: Date.now(), rs: resolve })
370
370
  myFlush()
371
371
  })
372
372
  }
@@ -380,7 +380,7 @@ module.exports = function (maxBatch, maxDelay, handler) {
380
380
  /***/ 3538:
381
381
  /***/ ((module) => {
382
382
 
383
- function map(collection, predicate) {
383
+ function map (collection, predicate) {
384
384
  if (!collection) return []
385
385
  if (!predicate) {
386
386
  predicate = function (a) {
@@ -408,7 +408,7 @@ function map(collection, predicate) {
408
408
  return out
409
409
  }
410
410
 
411
- module.exports = {map: map}
411
+ module.exports = { map: map }
412
412
 
413
413
 
414
414
  /***/ }),
@@ -435,7 +435,7 @@ module.exports = {
435
435
  /***/ ((module) => {
436
436
 
437
437
  // loop keep calling promise sequenctially until the promise resolve a false value
438
- module.exports = function loop(promise) {
438
+ module.exports = function loop (promise) {
439
439
  var out = promise()
440
440
  if (!out || !out.then) {
441
441
  var saveout = out
@@ -459,7 +459,7 @@ module.exports = function loop(promise) {
459
459
 
460
460
  var co = __webpack_require__(3538)
461
461
 
462
- module.exports = function (collections, func, limit) {
462
+ module.exports = function(collections, func, limit) {
463
463
  if (typeof func === 'number') {
464
464
  // backword compatible
465
465
  let tmp = limit
@@ -467,12 +467,12 @@ module.exports = function (collections, func, limit) {
467
467
  func = tmp
468
468
  }
469
469
 
470
- if (!func) func = function () {}
470
+ if (!func) func = function() {}
471
471
  if (typeof limit !== 'number' || limit <= 0) limit = 1
472
472
 
473
473
  // prepare input map
474
474
  var ins = {} // inputs
475
- co.map(collections, function (i, k) {
475
+ co.map(collections, function(i, k) {
476
476
  ins[k] = i
477
477
  })
478
478
 
@@ -481,14 +481,14 @@ module.exports = function (collections, func, limit) {
481
481
  if (Object.keys(ins).length < limit) limit = Object.keys(ins).length
482
482
 
483
483
  var outs = {} // outputs
484
- return new Promise(function (resolve) {
484
+ return new Promise(function(resolve) {
485
485
  let total = Object.keys(ins).length
486
486
 
487
- var doJob = function () {
487
+ var doJob = function() {
488
488
  var keys = Object.keys(ins)
489
489
  if (keys.length === 0) return
490
490
 
491
- var key = keys.shift()
491
+ var key = keys.pop()
492
492
  var value = ins[key]
493
493
  delete ins[key]
494
494
 
@@ -497,7 +497,7 @@ module.exports = function (collections, func, limit) {
497
497
  // we treat the out put as a promise
498
498
  if (!pro || !pro.then) pro = Promise.resolve(pro)
499
499
 
500
- pro.then(function (ret) {
500
+ pro.then(function(ret) {
501
501
  outs[key] = ret
502
502
  if (Object.keys(outs).length === total) return resolve(co.map(outs))
503
503
  doJob()
@@ -516,7 +516,7 @@ module.exports = function (collections, func, limit) {
516
516
 
517
517
  // sleep won't resolve after a given milliseconds
518
518
  // e.g: await sleep(100)
519
- module.exports = function sleep(ms) {
519
+ module.exports = function sleep (ms) {
520
520
  return new Promise(function (res) {
521
521
  setTimeout(res, ms)
522
522
  })
@@ -525,90 +525,10 @@ module.exports = function sleep(ms) {
525
525
 
526
526
  /***/ }),
527
527
 
528
- /***/ 2611:
529
- /***/ ((module) => {
530
-
531
- function dofetch(method, url, body, cb) {
532
- let headers = {}
533
- if (body) headers['content-type'] = 'text/plain'
534
- fetch(url, {method: method, headers: headers, body: body})
535
- .then((res) => res.text().then((text) => cb && cb(text, res.status)))
536
- .catch((err) => cb && cb(err, -1))
537
- }
538
-
539
- // xhrsend sends an HTTP request
540
- var xhrsend = function (method, url, body, cb) {
541
- if (typeof XMLHttpRequest === 'undefined') return dofetch(method, url, body, cb)
542
- var request = new XMLHttpRequest()
543
- request.onreadystatechange = function (e) {
544
- if (request.readyState !== 4) return
545
- cb && cb(request.responseText, request.status)
546
- cb = undefined // dont call cb anymore
547
- }
548
-
549
- request.onerror = function () {
550
- cb && cb(request.responseText, -1) // network error
551
- cb = undefined // dont call cb anymore
552
- }
553
-
554
- request.open(method, url)
555
- if (body) request.setRequestHeader('content-type', 'text/plain')
556
- request.send(body)
557
- }
558
-
559
- // JSON.parse without exeption
560
- // return undefined when parsing invalid JSON string
561
- function parseJSON(str) {
562
- try {
563
- return JSON.parse(str)
564
- } catch (e) {}
565
- }
566
-
567
- function Pubsub() {
568
- // holds all subscriptions for all topics
569
- // example {
570
- // topic1: [cb1, cb2],
571
- // topic2: [cb3, cb4],
572
- // }
573
- var listeners = {}
574
-
575
- // emit notifies any callback functions that previously
576
- // subscribed to the topic (by the on function)
577
- this.emit = function (topic) {
578
- // skip the first item in arguments, which is the topic
579
- var args = []
580
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i])
581
-
582
- var cbs = listeners[topic]
583
- if (!cbs) return
584
- for (var i = 0; i < cbs.length; i++) cbs[i].apply(undefined, args)
585
- }
586
-
587
- // register a callback function for a topic
588
- // when something is sent to the topic (by the emit function),
589
- // the callback function will be called
590
- this.on = function (topic, cb) {
591
- if (!listeners[topic]) listeners[topic] = []
592
- listeners[topic].push(cb)
593
- }
594
- }
595
-
596
- function randomString(len, base) {
597
- var str = ''
598
- if (!len || len < 1) len = 10
599
- var asciiKey
600
- for (var i = 0; i < len; i++) {
601
- if (base) {
602
- str += base[Math.floor(Math.random() * base.length)]
603
- } else {
604
- asciiKey = Math.floor(Math.random() * 25 + 97)
605
- str += String.fromCharCode(asciiKey)
606
- }
607
- }
608
- return str
609
- }
528
+ /***/ 8454:
529
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
610
530
 
611
- module.exports = {xhrsend, parseJSON, Pubsub, randomString}
531
+ module.exports = __webpack_require__(608)
612
532
 
613
533
 
614
534
  /***/ }),
@@ -617,7 +537,6 @@ module.exports = {xhrsend, parseJSON, Pubsub, randomString}
617
537
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
618
538
 
619
539
  var flow = __webpack_require__(3165)
620
- var {xhrsend, parseJSON, Pubsub} = __webpack_require__(2611)
621
540
 
622
541
  // Conn represents a realtime connection between an user and the realtime
623
542
  // server (https://rt-0.subiz.com)
@@ -831,6 +750,74 @@ function Realtime(apiUrls, credential, callAPI) {
831
750
  reconnect()
832
751
  }
833
752
 
753
+ var dofetch = function (method, url, body, cb) {
754
+ let headers = {}
755
+ if (body) headers['content-type'] = 'text/plain'
756
+ fetch(url, {
757
+ method: method,
758
+ headers: headers,
759
+ body: body,
760
+ })
761
+ .then((res) => res.text().then((text) => cb && cb(text, res.status)))
762
+ .catch((err) => cb && cb(err, -1))
763
+ }
764
+ // xhrsend sends an HTTP request
765
+ var xhrsend = function (method, url, body, cb) {
766
+ if (typeof XMLHttpRequest === 'undefined') return dofetch(method, url, body, cb)
767
+ var request = new XMLHttpRequest()
768
+ request.onreadystatechange = function (e) {
769
+ if (request.readyState !== 4) return
770
+ cb && cb(request.responseText, request.status)
771
+ cb = undefined // dont call cb anymore
772
+ }
773
+
774
+ request.onerror = function () {
775
+ cb && cb(request.responseText, -1) // network error
776
+ cb = undefined // dont call cb anymore
777
+ }
778
+
779
+ request.open(method, url)
780
+ if (body) request.setRequestHeader('content-type', 'text/plain')
781
+ request.send(body)
782
+ }
783
+
784
+ // JSON.parse without exeption
785
+ // return undefined when parsing invalid JSON string
786
+ function parseJSON(str) {
787
+ try {
788
+ return JSON.parse(str)
789
+ } catch (e) {}
790
+ }
791
+
792
+ function Pubsub() {
793
+ // holds all subscriptions for all topics
794
+ // example {
795
+ // topic1: [cb1, cb2],
796
+ // topic2: [cb3, cb4],
797
+ // }
798
+ var listeners = {}
799
+
800
+ // emit notifies any callback functions that previously
801
+ // subscribed to the topic (by the on function)
802
+ this.emit = function (topic) {
803
+ // skip the first item in arguments, which is the topic
804
+ var args = []
805
+ for (var i = 1; i < arguments.length; i++) args.push(arguments[i])
806
+
807
+ var cbs = listeners[topic]
808
+ if (!cbs) return
809
+ for (var i = 0; i < cbs.length; i++) cbs[i].apply(undefined, args)
810
+ }
811
+
812
+ // register a callback function for a topic
813
+ // when something is sent to the topic (by the emit function),
814
+ // the callback function will be called
815
+ this.on = function (topic, cb) {
816
+ if (!listeners[topic]) listeners[topic] = []
817
+ listeners[topic].push(cb)
818
+ }
819
+ }
820
+
834
821
  // calcNextBackoff returns number of seconds we must wait
835
822
  // before sending a next request
836
823
  // the results is determind based on exponential backoff algorithm
@@ -875,7 +862,7 @@ module.exports = Realtime
875
862
 
876
863
  "use strict";
877
864
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
878
- /* harmony export */ Z: () => (/* binding */ Chain)
865
+ /* harmony export */ "Z": () => (/* binding */ Chain)
879
866
  /* harmony export */ });
880
867
  const ChainMaxSize = 50;
881
868
  class Chain {
@@ -947,7 +934,9 @@ class Chain {
947
934
  });
948
935
  return out;
949
936
  }
950
- async fetchMore(chain, limit = 20, api) {
937
+ async fetchMore(chain) {
938
+ let limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
939
+ let api = arguments.length > 2 ? arguments[2] : undefined;
951
940
  if (this.dead) return {
952
941
  error: 'dead'
953
942
  };
@@ -1105,7 +1094,7 @@ function orderBy(a, k, d) {
1105
1094
 
1106
1095
  "use strict";
1107
1096
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1108
- /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
1097
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
1109
1098
  /* harmony export */ });
1110
1099
  var localStorageMemory = {};
1111
1100
  var cache = {};
@@ -1140,7 +1129,7 @@ localStorageMemory.clear = function () {
1140
1129
 
1141
1130
  "use strict";
1142
1131
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1143
- /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
1132
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
1144
1133
  /* harmony export */ });
1145
1134
  let KvMaxSize = 500;
1146
1135
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (class {
@@ -1229,7 +1218,7 @@ let KvMaxSize = 500;
1229
1218
 
1230
1219
  "use strict";
1231
1220
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1232
- /* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
1221
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
1233
1222
  /* harmony export */ });
1234
1223
  let memlocalStorage = (__webpack_require__(9489)/* ["default"] */ .Z);
1235
1224
  let requestIdleCallback = window.requestIdleCallback || (cb => cb());
@@ -1297,11 +1286,11 @@ function toString(obj) {
1297
1286
 
1298
1287
  "use strict";
1299
1288
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1300
- /* harmony export */ Kd: () => (/* binding */ getLocale),
1301
- /* harmony export */ Rs: () => (/* binding */ langMessages),
1302
- /* harmony export */ WW: () => (/* binding */ downloadLanguage),
1303
- /* harmony export */ u$: () => (/* binding */ Clickaway),
1304
- /* harmony export */ up: () => (/* binding */ Com)
1289
+ /* harmony export */ "Kd": () => (/* binding */ getLocale),
1290
+ /* harmony export */ "Rs": () => (/* binding */ langMessages),
1291
+ /* harmony export */ "WW": () => (/* binding */ downloadLanguage),
1292
+ /* harmony export */ "u$": () => (/* binding */ Clickaway),
1293
+ /* harmony export */ "up": () => (/* binding */ Com)
1305
1294
  /* harmony export */ });
1306
1295
  /* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6400);
1307
1296
  /* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4494);
@@ -1311,7 +1300,7 @@ class Com extends preact__WEBPACK_IMPORTED_MODULE_0__/* .Component */ .wA {
1311
1300
  constructor(props) {
1312
1301
  super(props);
1313
1302
  this._isMounted = true;
1314
- _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.setTimeout(() => {
1303
+ _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"].setTimeout */ .Z.setTimeout(() => {
1315
1304
  if (this.componentWillUnmount) {
1316
1305
  let old = this.componentWillUnmount.bind(this);
1317
1306
  this.componentWillUnmount = () => {
@@ -1350,9 +1339,9 @@ class Clickaway extends Com {
1350
1339
  }
1351
1340
  const getLocale = (plugin, loc) => {
1352
1341
  if (!loc) loc = '';
1353
- let found = _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.find(plugin.locales, l => l.toLowerCase().trim() === loc.toLowerCase().trim());
1342
+ let found = _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"].find */ .Z.find(plugin.locales, l => l.toLowerCase().trim() === loc.toLowerCase().trim());
1354
1343
  if (found) return found;
1355
- found = _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.find(plugin.locales, l => {
1344
+ found = _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"].find */ .Z.find(plugin.locales, l => {
1356
1345
  l = l.replace('-', '_').split('_')[0].trim().toLowerCase();
1357
1346
  let compareloc = loc.replace('-', '_').split('_')[0].trim().toLowerCase();
1358
1347
  return l == compareloc;
@@ -1363,7 +1352,7 @@ const getLocale = (plugin, loc) => {
1363
1352
  let langMessages = {};
1364
1353
  let downloadLock = false;
1365
1354
  function downloadLanguage(store, locale, force) {
1366
- if (downloadLock) return new Promise(resolve => _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.setTimeout(() => downloadLanguage(store, locale, force).then(resolve), 100));
1355
+ if (downloadLock) return new Promise(resolve => _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"].setTimeout */ .Z.setTimeout(() => downloadLanguage(store, locale, force).then(resolve), 100));
1367
1356
  downloadLock = true;
1368
1357
  let messages;
1369
1358
  if (locale === 'debug' || langMessages[locale] && !force) {
@@ -1372,7 +1361,7 @@ function downloadLanguage(store, locale, force) {
1372
1361
  }
1373
1362
  return store.getLocaleContent(locale).then(res => {
1374
1363
  downloadLock = false;
1375
- messages = _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.get(res, 'body.messages', []);
1364
+ messages = _util_index_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"].get */ .Z.get(res, 'body.messages', []);
1376
1365
  langMessages[locale] = messages;
1377
1366
  });
1378
1367
  }
@@ -1385,73 +1374,73 @@ function downloadLanguage(store, locale, force) {
1385
1374
  "use strict";
1386
1375
  __webpack_require__.r(__webpack_exports__);
1387
1376
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1388
- /* harmony export */ DEFVAL: () => (/* binding */ DEFVAL),
1389
- /* harmony export */ DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL: () => (/* binding */ DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL),
1390
- /* harmony export */ Date: () => (/* binding */ Date),
1391
- /* harmony export */ XMLHttpRequest: () => (/* binding */ XMLHttpRequest),
1392
- /* harmony export */ agentsOfConvo: () => (/* binding */ agentsOfConvo),
1393
- /* harmony export */ checkRunConditions: () => (/* binding */ checkRunConditions),
1394
- /* harmony export */ clearInterval: () => (/* binding */ clearInterval),
1395
- /* harmony export */ clearTimeout: () => (/* binding */ clearTimeout),
1396
- /* harmony export */ cloneDeep: () => (/* binding */ cloneDeep),
1397
- /* harmony export */ convoOfEv: () => (/* binding */ convoOfEv),
1398
- /* harmony export */ convoToEv: () => (/* binding */ convoToEv),
1399
- /* harmony export */ detectLang: () => (/* binding */ detectLang),
1400
- /* harmony export */ diffDay: () => (/* binding */ diffDay),
1401
- /* harmony export */ diffYear: () => (/* binding */ diffYear),
1402
- /* harmony export */ each: () => (/* binding */ each),
1403
- /* harmony export */ filter: () => (/* binding */ filter),
1404
- /* harmony export */ find: () => (/* binding */ find),
1405
- /* harmony export */ formatCurrency: () => (/* binding */ formatCurrency),
1406
- /* harmony export */ getAgentDisplayName: () => (/* binding */ getAgentDisplayName),
1407
- /* harmony export */ getDayName: () => (/* binding */ getDayName),
1408
- /* harmony export */ getMs: () => (/* binding */ getMs),
1409
- /* harmony export */ getMsgField: () => (/* binding */ getMsgField),
1410
- /* harmony export */ getUrlParameter: () => (/* binding */ getUrlParameter),
1411
- /* harmony export */ getUserAttr: () => (/* binding */ getUserAttr),
1412
- /* harmony export */ includes: () => (/* binding */ includes),
1413
- /* harmony export */ isConvoSeen: () => (/* binding */ isConvoSeen),
1414
- /* harmony export */ isEmail: () => (/* binding */ isEmail),
1415
- /* harmony export */ isNumber: () => (/* binding */ isNumber),
1416
- /* harmony export */ isPhone: () => (/* binding */ isPhone),
1417
- /* harmony export */ isURL: () => (/* binding */ isURL),
1418
- /* harmony export */ isUserBanned: () => (/* binding */ isUserBanned),
1419
- /* harmony export */ js2css: () => (/* binding */ js2css),
1420
- /* harmony export */ last: () => (/* binding */ last),
1421
- /* harmony export */ map: () => (/* binding */ map),
1422
- /* harmony export */ merge: () => (/* binding */ merge),
1423
- /* harmony export */ noop: () => (/* binding */ noop),
1424
- /* harmony export */ norm: () => (/* binding */ norm),
1425
- /* harmony export */ offsetToMin: () => (/* binding */ offsetToMin),
1426
- /* harmony export */ orderBy: () => (/* binding */ orderBy),
1427
- /* harmony export */ orderByF: () => (/* binding */ orderByF),
1428
- /* harmony export */ parseJSON: () => (/* binding */ parseJSON),
1429
- /* harmony export */ preloadImg: () => (/* binding */ preloadImg),
1430
- /* harmony export */ preloadWebfonts: () => (/* binding */ preloadWebfonts),
1431
- /* harmony export */ randomString: () => (/* binding */ randomString),
1432
- /* harmony export */ replaceAll: () => (/* binding */ replaceAll),
1433
- /* harmony export */ replaceCssVariable: () => (/* binding */ replaceCssVariable),
1434
- /* harmony export */ replaceCssVariablePlugin: () => (/* binding */ replaceCssVariablePlugin),
1435
- /* harmony export */ requestAnimationFrame: () => (/* binding */ requestAnimationFrame),
1436
- /* harmony export */ sameDay: () => (/* binding */ sameDay),
1437
- /* harmony export */ scrollIntoViewIfNeeded: () => (/* binding */ scrollIntoViewIfNeeded),
1438
- /* harmony export */ setCss: () => (/* binding */ setCss),
1439
- /* harmony export */ setInterval: () => (/* binding */ setInterval),
1440
- /* harmony export */ setMsgField: () => (/* binding */ setMsgField),
1441
- /* harmony export */ setTimeout: () => (/* binding */ setTimeout),
1442
- /* harmony export */ setUserAttr: () => (/* binding */ setUserAttr),
1443
- /* harmony export */ shortTime: () => (/* binding */ shortTime),
1444
- /* harmony export */ size: () => (/* binding */ size),
1445
- /* harmony export */ sleep: () => (/* binding */ sleep),
1446
- /* harmony export */ startsWith: () => (/* binding */ startsWith),
1447
- /* harmony export */ stringify: () => (/* binding */ stringify),
1448
- /* harmony export */ throttle: () => (/* binding */ throttle),
1449
- /* harmony export */ tokenize: () => (/* binding */ tokenize),
1450
- /* harmony export */ trim: () => (/* binding */ trim),
1451
- /* harmony export */ trimStart: () => (/* binding */ trimStart),
1452
- /* harmony export */ unicodeToAscii: () => (/* binding */ unicodeToAscii),
1453
- /* harmony export */ unixSec: () => (/* binding */ unixSec),
1454
- /* harmony export */ usersOfConvo: () => (/* binding */ usersOfConvo)
1377
+ /* harmony export */ "DEFVAL": () => (/* binding */ DEFVAL),
1378
+ /* harmony export */ "DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL": () => (/* binding */ DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL),
1379
+ /* harmony export */ "Date": () => (/* binding */ Date),
1380
+ /* harmony export */ "XMLHttpRequest": () => (/* binding */ XMLHttpRequest),
1381
+ /* harmony export */ "agentsOfConvo": () => (/* binding */ agentsOfConvo),
1382
+ /* harmony export */ "checkRunConditions": () => (/* binding */ checkRunConditions),
1383
+ /* harmony export */ "clearInterval": () => (/* binding */ clearInterval),
1384
+ /* harmony export */ "clearTimeout": () => (/* binding */ clearTimeout),
1385
+ /* harmony export */ "cloneDeep": () => (/* binding */ cloneDeep),
1386
+ /* harmony export */ "convoOfEv": () => (/* binding */ convoOfEv),
1387
+ /* harmony export */ "convoToEv": () => (/* binding */ convoToEv),
1388
+ /* harmony export */ "detectLang": () => (/* binding */ detectLang),
1389
+ /* harmony export */ "diffDay": () => (/* binding */ diffDay),
1390
+ /* harmony export */ "diffYear": () => (/* binding */ diffYear),
1391
+ /* harmony export */ "each": () => (/* binding */ each),
1392
+ /* harmony export */ "filter": () => (/* binding */ filter),
1393
+ /* harmony export */ "find": () => (/* binding */ find),
1394
+ /* harmony export */ "formatCurrency": () => (/* binding */ formatCurrency),
1395
+ /* harmony export */ "getAgentDisplayName": () => (/* binding */ getAgentDisplayName),
1396
+ /* harmony export */ "getDayName": () => (/* binding */ getDayName),
1397
+ /* harmony export */ "getMs": () => (/* binding */ getMs),
1398
+ /* harmony export */ "getMsgField": () => (/* binding */ getMsgField),
1399
+ /* harmony export */ "getUrlParameter": () => (/* binding */ getUrlParameter),
1400
+ /* harmony export */ "getUserAttr": () => (/* binding */ getUserAttr),
1401
+ /* harmony export */ "includes": () => (/* binding */ includes),
1402
+ /* harmony export */ "isConvoSeen": () => (/* binding */ isConvoSeen),
1403
+ /* harmony export */ "isEmail": () => (/* binding */ isEmail),
1404
+ /* harmony export */ "isNumber": () => (/* binding */ isNumber),
1405
+ /* harmony export */ "isPhone": () => (/* binding */ isPhone),
1406
+ /* harmony export */ "isURL": () => (/* binding */ isURL),
1407
+ /* harmony export */ "isUserBanned": () => (/* binding */ isUserBanned),
1408
+ /* harmony export */ "js2css": () => (/* binding */ js2css),
1409
+ /* harmony export */ "last": () => (/* binding */ last),
1410
+ /* harmony export */ "map": () => (/* binding */ map),
1411
+ /* harmony export */ "merge": () => (/* binding */ merge),
1412
+ /* harmony export */ "noop": () => (/* binding */ noop),
1413
+ /* harmony export */ "norm": () => (/* binding */ norm),
1414
+ /* harmony export */ "offsetToMin": () => (/* binding */ offsetToMin),
1415
+ /* harmony export */ "orderBy": () => (/* binding */ orderBy),
1416
+ /* harmony export */ "orderByF": () => (/* binding */ orderByF),
1417
+ /* harmony export */ "parseJSON": () => (/* binding */ parseJSON),
1418
+ /* harmony export */ "preloadImg": () => (/* binding */ preloadImg),
1419
+ /* harmony export */ "preloadWebfonts": () => (/* binding */ preloadWebfonts),
1420
+ /* harmony export */ "randomString": () => (/* binding */ randomString),
1421
+ /* harmony export */ "replaceAll": () => (/* binding */ replaceAll),
1422
+ /* harmony export */ "replaceCssVariable": () => (/* binding */ replaceCssVariable),
1423
+ /* harmony export */ "replaceCssVariablePlugin": () => (/* binding */ replaceCssVariablePlugin),
1424
+ /* harmony export */ "requestAnimationFrame": () => (/* binding */ requestAnimationFrame),
1425
+ /* harmony export */ "sameDay": () => (/* binding */ sameDay),
1426
+ /* harmony export */ "scrollIntoViewIfNeeded": () => (/* binding */ scrollIntoViewIfNeeded),
1427
+ /* harmony export */ "setCss": () => (/* binding */ setCss),
1428
+ /* harmony export */ "setInterval": () => (/* binding */ setInterval),
1429
+ /* harmony export */ "setMsgField": () => (/* binding */ setMsgField),
1430
+ /* harmony export */ "setTimeout": () => (/* binding */ setTimeout),
1431
+ /* harmony export */ "setUserAttr": () => (/* binding */ setUserAttr),
1432
+ /* harmony export */ "shortTime": () => (/* binding */ shortTime),
1433
+ /* harmony export */ "size": () => (/* binding */ size),
1434
+ /* harmony export */ "sleep": () => (/* binding */ sleep),
1435
+ /* harmony export */ "startsWith": () => (/* binding */ startsWith),
1436
+ /* harmony export */ "stringify": () => (/* binding */ stringify),
1437
+ /* harmony export */ "throttle": () => (/* binding */ throttle),
1438
+ /* harmony export */ "tokenize": () => (/* binding */ tokenize),
1439
+ /* harmony export */ "trim": () => (/* binding */ trim),
1440
+ /* harmony export */ "trimStart": () => (/* binding */ trimStart),
1441
+ /* harmony export */ "unicodeToAscii": () => (/* binding */ unicodeToAscii),
1442
+ /* harmony export */ "unixSec": () => (/* binding */ unixSec),
1443
+ /* harmony export */ "usersOfConvo": () => (/* binding */ usersOfConvo)
1455
1444
  /* harmony export */ });
1456
1445
  var op = __webpack_require__(6877);
1457
1446
  function parseJSON(str) {
@@ -1538,7 +1527,10 @@ function getMsgField(ev, fieldName) {
1538
1527
  function isObject(item) {
1539
1528
  return item && typeof item === 'object' && !Array.isArray(item);
1540
1529
  }
1541
- function merge(target, ...sources) {
1530
+ function merge(target) {
1531
+ for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1532
+ sources[_key - 1] = arguments[_key];
1533
+ }
1542
1534
  if (!sources.length) return target;
1543
1535
  const source = sources.shift();
1544
1536
  if (isObject(target) && isObject(source)) {
@@ -1766,7 +1758,7 @@ function setUserAttr(user, attr) {
1766
1758
  if (!user) return;
1767
1759
  if (!op.get(attr, 'key')) return;
1768
1760
  user.attributes = user.attributes || [];
1769
- var index = findIndex(user.attributes, a => a && a.key === attr.key);
1761
+ var index = findIndex(user.attributes, a => a.key === attr.key);
1770
1762
  if (index === -1) {
1771
1763
  user.attributes.push(attr);
1772
1764
  return;
@@ -2101,9 +2093,9 @@ function checkRunConditions(freq, conds, lastrun, store) {
2101
2093
  break;
2102
2094
  case 'user_is_a_contact':
2103
2095
  let attributes = op.get(store.matchUser(), 'attributes', []);
2104
- let emailAttr = find(attributes, att => att.key === 'emails' && attr.text && att.key === 'related_email' && attr.text);
2105
- let phoneAttr = find(attributes, att => att.key === 'phones' && attr.text && att.key === 'related_phone' && attr.text);
2106
- let hasContact = emailAttr || phoneAttr;
2096
+ let emailAttr = find(attributes, att => att.key === 'emails') || {};
2097
+ let phoneAttr = find(attributes, att => att.key === 'phones') || {};
2098
+ let hasContact = emailAttr.text || phoneAttr.text;
2107
2099
  if (cond.user_is_a_contact) {
2108
2100
  if (!hasContact) return false;
2109
2101
  }
@@ -2181,12 +2173,12 @@ function checkRunConditions(freq, conds, lastrun, store) {
2181
2173
  });
2182
2174
  if (!found) return false;
2183
2175
  }
2184
- if (size(cond.minutes_of_day) > 0 && size(cond.minutes_of_day) % 2 === 0) {
2176
+ if (size(cond.minute_of_days) > 0 && size(cond.minute_of_days) % 2 === 0) {
2185
2177
  var now = new Date();
2186
2178
  var minuteofday = now.getMinutes() + now.getHours() * 60;
2187
2179
  let found = false;
2188
- for (var i = 1; i < cond.minutes_of_day.length; i += 2) {
2189
- if (cond.minutes_of_day[i] <= minuteofday && minuteofday <= cond.minutes_of_day[i + 1]) {
2180
+ for (var i = 0; i < cond.minute_of_days.length; i += 2) {
2181
+ if (cond.minute_of_days[i] <= minuteofday && minuteofday <= cond.minute_of_days[i + 1]) {
2190
2182
  found = true;
2191
2183
  break;
2192
2184
  }
@@ -2336,7 +2328,8 @@ function getUrlParameter() {
2336
2328
  return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
2337
2329
  }
2338
2330
  var sleep = ms => new Promise(res => setTimeout(res, ms));
2339
- function formatCurrency(val, currency = 'VND') {
2331
+ function formatCurrency(val) {
2332
+ let currency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'VND';
2340
2333
  let currencyObj = ALL_CURRENCIES.find(cur => cur.code === currency) || {
2341
2334
  name: 'Dong',
2342
2335
  code: 'VND',
@@ -2404,468 +2397,648 @@ function scrollIntoViewIfNeeded($ele) {
2404
2397
  }
2405
2398
  }
2406
2399
  const ALL_CURRENCIES = [{
2400
+ name: 'Afghani',
2407
2401
  code: 'AFN',
2408
2402
  symbol: '؋'
2409
2403
  }, {
2404
+ name: 'Euro',
2410
2405
  code: 'EUR',
2411
2406
  symbol: '€'
2412
2407
  }, {
2408
+ name: 'Lek',
2413
2409
  code: 'ALL',
2414
2410
  symbol: 'Lek'
2415
2411
  }, {
2412
+ name: 'Algerian Dinar',
2416
2413
  code: 'DZD'
2417
2414
  }, {
2415
+ name: 'US Dollar',
2418
2416
  code: 'USD',
2419
2417
  symbol: '$'
2420
2418
  }, {
2419
+ name: 'Kwanza',
2421
2420
  code: 'AOA'
2422
2421
  }, {
2422
+ name: 'East Caribbean Dollar',
2423
2423
  code: 'XCD',
2424
2424
  symbol: '$'
2425
2425
  }, {
2426
+ name: 'Argentine Peso',
2426
2427
  code: 'ARS',
2427
2428
  symbol: '$'
2428
2429
  }, {
2430
+ name: 'Armenian Dram',
2429
2431
  code: 'AMD'
2430
2432
  }, {
2433
+ name: 'Aruban Florin',
2431
2434
  code: 'AWG',
2432
2435
  symbol: 'ƒ'
2433
2436
  }, {
2437
+ name: 'Australian Dollar',
2434
2438
  code: 'AUD',
2435
2439
  symbol: '$'
2436
2440
  }, {
2441
+ name: 'Azerbaijan Manat',
2437
2442
  code: 'AZN',
2438
2443
  symbol: '₼'
2439
2444
  }, {
2445
+ name: 'Bahamian Dollar',
2440
2446
  code: 'BSD',
2441
2447
  symbol: '$'
2442
2448
  }, {
2449
+ name: 'Bahraini Dinar',
2443
2450
  code: 'BHD'
2444
2451
  }, {
2452
+ name: 'Taka',
2445
2453
  code: 'BDT'
2446
2454
  }, {
2455
+ name: 'Barbados Dollar',
2447
2456
  code: 'BBD',
2448
2457
  symbol: '$'
2449
2458
  }, {
2459
+ name: 'Belarusian Ruble',
2450
2460
  code: 'BYN',
2451
2461
  symbol: 'Br'
2452
2462
  }, {
2463
+ name: 'Belize Dollar',
2453
2464
  code: 'BZD',
2454
2465
  symbol: 'BZ$'
2455
2466
  }, {
2467
+ name: 'CFA Franc BCEAO',
2456
2468
  code: 'XOF'
2457
2469
  }, {
2470
+ name: 'Bermudian Dollar',
2458
2471
  code: 'BMD',
2459
2472
  symbol: '$'
2460
2473
  }, {
2474
+ name: 'Indian Rupee',
2461
2475
  code: 'INR',
2462
2476
  symbol: '₹'
2463
2477
  }, {
2478
+ name: 'Ngultrum',
2464
2479
  code: 'BTN'
2465
2480
  }, {
2481
+ name: 'Boliviano',
2466
2482
  code: 'BOB',
2467
2483
  symbol: '$b'
2468
2484
  }, {
2485
+ name: 'Mvdol',
2469
2486
  code: 'BOV'
2470
2487
  }, {
2488
+ name: 'Convertible Mark',
2471
2489
  code: 'BAM',
2472
2490
  symbol: 'KM'
2473
2491
  }, {
2492
+ name: 'Pula',
2474
2493
  code: 'BWP',
2475
2494
  symbol: 'P'
2476
2495
  }, {
2496
+ name: 'Norwegian Krone',
2477
2497
  code: 'NOK',
2478
2498
  symbol: 'kr'
2479
2499
  }, {
2500
+ name: 'Brazilian Real',
2480
2501
  code: 'BRL',
2481
2502
  symbol: 'R$'
2482
2503
  }, {
2504
+ name: 'Brunei Dollar',
2483
2505
  code: 'BND',
2484
2506
  symbol: '$'
2485
2507
  }, {
2508
+ name: 'Bulgarian Lev',
2486
2509
  code: 'BGN',
2487
2510
  symbol: 'лв'
2488
2511
  }, {
2512
+ name: 'Burundi Franc',
2489
2513
  code: 'BIF'
2490
2514
  }, {
2515
+ name: 'Cabo Verde Escudo',
2491
2516
  code: 'CVE'
2492
2517
  }, {
2518
+ name: 'Riel',
2493
2519
  code: 'KHR',
2494
2520
  symbol: '៛'
2495
2521
  }, {
2522
+ name: 'CFA Franc BEAC',
2496
2523
  code: 'XAF'
2497
2524
  }, {
2525
+ name: 'Canadian Dollar',
2498
2526
  code: 'CAD',
2499
2527
  symbol: '$'
2500
2528
  }, {
2529
+ name: 'Cayman Islands Dollar',
2501
2530
  code: 'KYD',
2502
2531
  symbol: '$'
2503
2532
  }, {
2533
+ name: 'Chilean Peso',
2504
2534
  code: 'CLP',
2505
2535
  symbol: '$'
2506
2536
  }, {
2537
+ name: 'Unidad de Fomento',
2507
2538
  code: 'CLF'
2508
2539
  }, {
2540
+ name: 'Yuan Renminbi',
2509
2541
  code: 'CNY',
2510
2542
  symbol: '¥'
2511
2543
  }, {
2544
+ name: 'Colombian Peso',
2512
2545
  code: 'COP',
2513
2546
  symbol: '$'
2514
2547
  }, {
2548
+ name: 'Unidad de Valor Real',
2515
2549
  code: 'COU'
2516
2550
  }, {
2551
+ name: 'Comorian Franc ',
2517
2552
  code: 'KMF'
2518
2553
  }, {
2554
+ name: 'Congolese Franc',
2519
2555
  code: 'CDF'
2520
2556
  }, {
2557
+ name: 'New Zealand Dollar',
2521
2558
  code: 'NZD',
2522
2559
  symbol: '$'
2523
2560
  }, {
2561
+ name: 'Costa Rican Colon',
2524
2562
  code: 'CRC',
2525
2563
  symbol: '₡'
2526
2564
  }, {
2565
+ name: 'Kuna',
2527
2566
  code: 'HRK',
2528
2567
  symbol: 'kn'
2529
2568
  }, {
2569
+ name: 'Cuban Peso',
2530
2570
  code: 'CUP',
2531
2571
  symbol: '₱'
2532
2572
  }, {
2573
+ name: 'Peso Convertible',
2533
2574
  code: 'CUC'
2534
2575
  }, {
2576
+ name: 'Netherlands Antillean Guilder',
2535
2577
  code: 'ANG',
2536
2578
  symbol: 'ƒ'
2537
2579
  }, {
2580
+ name: 'Czech Koruna',
2538
2581
  code: 'CZK',
2539
2582
  symbol: 'Kč'
2540
2583
  }, {
2584
+ name: 'Danish Krone',
2541
2585
  code: 'DKK',
2542
2586
  symbol: 'kr'
2543
2587
  }, {
2588
+ name: 'Djibouti Franc',
2544
2589
  code: 'DJF'
2545
2590
  }, {
2591
+ name: 'Dominican Peso',
2546
2592
  code: 'DOP',
2547
2593
  symbol: 'RD$'
2548
2594
  }, {
2595
+ name: 'Egyptian Pound',
2549
2596
  code: 'EGP',
2550
2597
  symbol: '£'
2551
2598
  }, {
2599
+ name: 'El Salvador Colon',
2552
2600
  code: 'SVC',
2553
2601
  symbol: '$'
2554
2602
  }, {
2603
+ name: 'Nakfa',
2555
2604
  code: 'ERN'
2556
2605
  }, {
2606
+ name: 'Lilangeni',
2557
2607
  code: 'SZL'
2558
2608
  }, {
2609
+ name: 'Ethiopian Birr',
2559
2610
  code: 'ETB'
2560
2611
  }, {
2612
+ name: 'Falkland Islands Pound',
2561
2613
  code: 'FKP',
2562
2614
  symbol: '£'
2563
2615
  }, {
2616
+ name: 'Fiji Dollar',
2564
2617
  code: 'FJD',
2565
2618
  symbol: '$'
2566
2619
  }, {
2620
+ name: 'CFP Franc',
2567
2621
  code: 'XPF'
2568
2622
  }, {
2623
+ name: 'Dalasi',
2569
2624
  code: 'GMD'
2570
2625
  }, {
2626
+ name: 'Lari',
2571
2627
  code: 'GEL'
2572
2628
  }, {
2629
+ name: 'Ghana Cedi',
2573
2630
  code: 'GHS',
2574
2631
  symbol: '¢'
2575
2632
  }, {
2633
+ name: 'Gibraltar Pound',
2576
2634
  code: 'GIP',
2577
2635
  symbol: '£'
2578
2636
  }, {
2637
+ name: 'Quetzal',
2579
2638
  code: 'GTQ',
2580
2639
  symbol: 'Q'
2581
2640
  }, {
2641
+ name: 'Pound Sterling',
2582
2642
  code: 'GBP',
2583
2643
  symbol: '£'
2584
2644
  }, {
2645
+ name: 'Guinean Franc',
2585
2646
  code: 'GNF'
2586
2647
  }, {
2648
+ name: 'Guyana Dollar',
2587
2649
  code: 'GYD',
2588
2650
  symbol: '$'
2589
2651
  }, {
2652
+ name: 'Gourde',
2590
2653
  code: 'HTG'
2591
2654
  }, {
2655
+ name: 'Lempira',
2592
2656
  code: 'HNL',
2593
2657
  symbol: 'L'
2594
2658
  }, {
2659
+ name: 'Hong Kong Dollar',
2595
2660
  code: 'HKD',
2596
2661
  symbol: '$'
2597
2662
  }, {
2663
+ name: 'Forint',
2598
2664
  code: 'HUF',
2599
2665
  symbol: 'Ft'
2600
2666
  }, {
2667
+ name: 'Iceland Krona',
2601
2668
  code: 'ISK',
2602
2669
  symbol: 'kr'
2603
2670
  }, {
2671
+ name: 'Rupiah',
2604
2672
  code: 'IDR',
2605
2673
  symbol: 'Rp'
2606
2674
  }, {
2675
+ name: 'SDR (Special Drawing Right)',
2607
2676
  code: 'XDR'
2608
2677
  }, {
2678
+ name: 'Iranian Rial',
2609
2679
  code: 'IRR',
2610
2680
  symbol: '﷼'
2611
2681
  }, {
2682
+ name: 'Iraqi Dinar',
2612
2683
  code: 'IQD'
2613
2684
  }, {
2685
+ name: 'New Israeli Sheqel',
2614
2686
  code: 'ILS',
2615
2687
  symbol: '₪'
2616
2688
  }, {
2689
+ name: 'Jamaican Dollar',
2617
2690
  code: 'JMD',
2618
2691
  symbol: 'J$'
2619
2692
  }, {
2693
+ name: 'Yen',
2620
2694
  code: 'JPY',
2621
2695
  symbol: '¥'
2622
2696
  }, {
2697
+ name: 'Jordanian Dinar',
2623
2698
  code: 'JOD'
2624
2699
  }, {
2700
+ name: 'Tenge',
2625
2701
  code: 'KZT',
2626
2702
  symbol: 'лв'
2627
2703
  }, {
2704
+ name: 'Kenyan Shilling',
2628
2705
  code: 'KES'
2629
2706
  }, {
2707
+ name: 'North Korean Won',
2630
2708
  code: 'KPW',
2631
2709
  symbol: '₩'
2632
2710
  }, {
2711
+ name: 'Won',
2633
2712
  code: 'KRW',
2634
2713
  symbol: '₩'
2635
2714
  }, {
2715
+ name: 'Kuwaiti Dinar',
2636
2716
  code: 'KWD'
2637
2717
  }, {
2718
+ name: 'Som',
2638
2719
  code: 'KGS',
2639
2720
  symbol: 'лв'
2640
2721
  }, {
2722
+ name: 'Lao Kip',
2641
2723
  code: 'LAK',
2642
2724
  symbol: '₭'
2643
2725
  }, {
2726
+ name: 'Lebanese Pound',
2644
2727
  code: 'LBP',
2645
2728
  symbol: '£'
2646
2729
  }, {
2730
+ name: 'Loti',
2647
2731
  code: 'LSL'
2648
2732
  }, {
2733
+ name: 'Rand',
2649
2734
  code: 'ZAR',
2650
2735
  symbol: 'R'
2651
2736
  }, {
2737
+ name: 'Liberian Dollar',
2652
2738
  code: 'LRD',
2653
2739
  symbol: '$'
2654
2740
  }, {
2741
+ name: 'Libyan Dinar',
2655
2742
  code: 'LYD'
2656
2743
  }, {
2744
+ name: 'Swiss Franc',
2657
2745
  code: 'CHF',
2658
2746
  symbol: 'CHF'
2659
2747
  }, {
2748
+ name: 'Pataca',
2660
2749
  code: 'MOP'
2661
2750
  }, {
2751
+ name: 'Denar',
2662
2752
  code: 'MKD',
2663
2753
  symbol: 'ден'
2664
2754
  }, {
2755
+ name: 'Malagasy Ariary',
2665
2756
  code: 'MGA'
2666
2757
  }, {
2758
+ name: 'Malawi Kwacha',
2667
2759
  code: 'MWK'
2668
2760
  }, {
2761
+ name: 'Malaysian Ringgit',
2669
2762
  code: 'MYR',
2670
2763
  symbol: 'RM'
2671
2764
  }, {
2765
+ name: 'Rufiyaa',
2672
2766
  code: 'MVR'
2673
2767
  }, {
2768
+ name: 'Ouguiya',
2674
2769
  code: 'MRU'
2675
2770
  }, {
2771
+ name: 'Mauritius Rupee',
2676
2772
  code: 'MUR',
2677
2773
  symbol: '₨'
2678
2774
  }, {
2775
+ name: 'ADB Unit of Account',
2679
2776
  code: 'XUA'
2680
2777
  }, {
2778
+ name: 'Mexican Peso',
2681
2779
  code: 'MXN',
2682
2780
  symbol: '$'
2683
2781
  }, {
2782
+ name: 'Mexican Unidad de Inversion (UDI)',
2684
2783
  code: 'MXV'
2685
2784
  }, {
2785
+ name: 'Moldovan Leu',
2686
2786
  code: 'MDL'
2687
2787
  }, {
2788
+ name: 'Tugrik',
2688
2789
  code: 'MNT',
2689
2790
  symbol: '₮'
2690
2791
  }, {
2792
+ name: 'Moroccan Dirham',
2691
2793
  code: 'MAD'
2692
2794
  }, {
2795
+ name: 'Mozambique Metical',
2693
2796
  code: 'MZN',
2694
2797
  symbol: 'MT'
2695
2798
  }, {
2799
+ name: 'Kyat',
2696
2800
  code: 'MMK'
2697
2801
  }, {
2802
+ name: 'Namibia Dollar',
2698
2803
  code: 'NAD',
2699
2804
  symbol: '$'
2700
2805
  }, {
2806
+ name: 'Nepalese Rupee',
2701
2807
  code: 'NPR',
2702
2808
  symbol: '₨'
2703
2809
  }, {
2810
+ name: 'Cordoba Oro',
2704
2811
  code: 'NIO',
2705
2812
  symbol: 'C$'
2706
2813
  }, {
2814
+ name: 'Naira',
2707
2815
  code: 'NGN',
2708
2816
  symbol: '₦'
2709
2817
  }, {
2818
+ name: 'Rial Omani',
2710
2819
  code: 'OMR',
2711
2820
  symbol: '﷼'
2712
2821
  }, {
2822
+ name: 'Pakistan Rupee',
2713
2823
  code: 'PKR',
2714
2824
  symbol: '₨'
2715
2825
  }, {
2826
+ name: 'Balboa',
2716
2827
  code: 'PAB',
2717
2828
  symbol: 'B/.'
2718
2829
  }, {
2830
+ name: 'Kina',
2719
2831
  code: 'PGK'
2720
2832
  }, {
2833
+ name: 'Guarani',
2721
2834
  code: 'PYG',
2722
2835
  symbol: 'Gs'
2723
2836
  }, {
2837
+ name: 'Sol',
2724
2838
  code: 'PEN',
2725
2839
  symbol: 'S/.'
2726
2840
  }, {
2841
+ name: 'Philippine Peso',
2727
2842
  code: 'PHP',
2728
2843
  symbol: '₱'
2729
2844
  }, {
2845
+ name: 'Zloty',
2730
2846
  code: 'PLN',
2731
2847
  symbol: 'zł'
2732
2848
  }, {
2849
+ name: 'Qatari Rial',
2733
2850
  code: 'QAR',
2734
2851
  symbol: '﷼'
2735
2852
  }, {
2853
+ name: 'Romanian Leu',
2736
2854
  code: 'RON',
2737
2855
  symbol: 'lei'
2738
2856
  }, {
2857
+ name: 'Russian Ruble',
2739
2858
  code: 'RUB',
2740
2859
  symbol: '₽'
2741
2860
  }, {
2861
+ name: 'Rwanda Franc',
2742
2862
  code: 'RWF'
2743
2863
  }, {
2864
+ name: 'Saint Helena Pound',
2744
2865
  code: 'SHP',
2745
2866
  symbol: '£'
2746
2867
  }, {
2868
+ name: 'Tala',
2747
2869
  code: 'WST'
2748
2870
  }, {
2871
+ name: 'Dobra',
2749
2872
  code: 'STN'
2750
2873
  }, {
2874
+ name: 'Saudi Riyal',
2751
2875
  code: 'SAR',
2752
2876
  symbol: '﷼'
2753
2877
  }, {
2878
+ name: 'Serbian Dinar',
2754
2879
  code: 'RSD',
2755
2880
  symbol: 'Дин.'
2756
2881
  }, {
2882
+ name: 'Seychelles Rupee',
2757
2883
  code: 'SCR',
2758
2884
  symbol: '₨'
2759
2885
  }, {
2886
+ name: 'Leone',
2760
2887
  code: 'SLL'
2761
2888
  }, {
2889
+ name: 'Singapore Dollar',
2762
2890
  code: 'SGD',
2763
2891
  symbol: '$'
2764
2892
  }, {
2893
+ name: 'Sucre',
2765
2894
  code: 'XSU'
2766
2895
  }, {
2896
+ name: 'Solomon Islands Dollar',
2767
2897
  code: 'SBD',
2768
2898
  symbol: '$'
2769
2899
  }, {
2900
+ name: 'Somali Shilling',
2770
2901
  code: 'SOS',
2771
2902
  symbol: 'S'
2772
2903
  }, {
2904
+ name: 'South Sudanese Pound',
2773
2905
  code: 'SSP'
2774
2906
  }, {
2907
+ name: 'Sri Lanka Rupee',
2775
2908
  code: 'LKR',
2776
2909
  symbol: '₨'
2777
2910
  }, {
2911
+ name: 'Sudanese Pound',
2778
2912
  code: 'SDG'
2779
2913
  }, {
2914
+ name: 'Surinam Dollar',
2780
2915
  code: 'SRD',
2781
2916
  symbol: '$'
2782
2917
  }, {
2918
+ name: 'Swedish Krona',
2783
2919
  code: 'SEK',
2784
2920
  symbol: 'kr'
2785
2921
  }, {
2922
+ name: 'WIR Euro',
2786
2923
  code: 'CHE'
2787
2924
  }, {
2925
+ name: 'WIR Franc',
2788
2926
  code: 'CHW'
2789
2927
  }, {
2928
+ name: 'Syrian Pound',
2790
2929
  code: 'SYP',
2791
2930
  symbol: '£'
2792
2931
  }, {
2932
+ name: 'New Taiwan Dollar',
2793
2933
  code: 'TWD',
2794
2934
  symbol: 'NT$'
2795
2935
  }, {
2936
+ name: 'Somoni',
2796
2937
  code: 'TJS'
2797
2938
  }, {
2939
+ name: 'Tanzanian Shilling',
2798
2940
  code: 'TZS'
2799
2941
  }, {
2942
+ name: 'Baht',
2800
2943
  code: 'THB',
2801
2944
  symbol: '฿'
2802
2945
  }, {
2946
+ name: 'Pa’anga',
2803
2947
  code: 'TOP'
2804
2948
  }, {
2949
+ name: 'Trinidad and Tobago Dollar',
2805
2950
  code: 'TTD',
2806
2951
  symbol: 'TT$'
2807
2952
  }, {
2953
+ name: 'Tunisian Dinar',
2808
2954
  code: 'TND'
2809
2955
  }, {
2956
+ name: 'Turkish Lira',
2810
2957
  code: 'TRY',
2811
2958
  symbol: '₺'
2812
2959
  }, {
2960
+ name: 'Turkmenistan New Manat',
2813
2961
  code: 'TMT'
2814
2962
  }, {
2963
+ name: 'Uganda Shilling',
2815
2964
  code: 'UGX'
2816
2965
  }, {
2966
+ name: 'Hryvnia',
2817
2967
  code: 'UAH',
2818
2968
  symbol: '₴'
2819
2969
  }, {
2970
+ name: 'UAE Dirham',
2820
2971
  code: 'AED',
2821
2972
  symbol: ' د.إ'
2822
2973
  }, {
2974
+ name: 'US Dollar (Next day)',
2823
2975
  code: 'USN'
2824
2976
  }, {
2977
+ name: 'Peso Uruguayo',
2825
2978
  code: 'UYU',
2826
2979
  symbol: '$U'
2827
2980
  }, {
2981
+ name: 'Uruguay Peso en Unidades Indexadas (UI)',
2828
2982
  code: 'UYI'
2829
2983
  }, {
2984
+ name: 'Unidad Previsional',
2830
2985
  code: 'UYW'
2831
2986
  }, {
2987
+ name: 'Uzbekistan Sum',
2832
2988
  code: 'UZS',
2833
2989
  symbol: 'лв'
2834
2990
  }, {
2991
+ name: 'Vatu',
2835
2992
  code: 'VUV'
2836
2993
  }, {
2994
+ name: 'Bolívar Soberano',
2837
2995
  code: 'VES'
2838
2996
  }, {
2997
+ name: 'Bolívar Soberano',
2839
2998
  code: 'VED'
2840
2999
  }, {
3000
+ name: 'Dong',
2841
3001
  code: 'VND',
2842
3002
  symbol: '₫'
2843
3003
  }, {
3004
+ name: 'Yemeni Rial',
2844
3005
  code: 'YER',
2845
3006
  symbol: '﷼'
2846
3007
  }, {
3008
+ name: 'Zambian Kwacha',
2847
3009
  code: 'ZMW'
2848
3010
  }, {
3011
+ name: 'Zimbabwe Dollar',
2849
3012
  code: 'ZWL'
2850
3013
  }, {
3014
+ name: 'Bond Markets Unit European Composite Unit (EURCO)',
2851
3015
  code: 'XBA'
2852
3016
  }, {
3017
+ name: 'Bond Markets Unit European Monetary Unit (E.M.U.-6)',
2853
3018
  code: 'XBB'
2854
3019
  }, {
3020
+ name: 'Bond Markets Unit European Unit of Account 9 (E.U.A.-9)',
2855
3021
  code: 'XBC'
2856
3022
  }, {
3023
+ name: 'Bond Markets Unit European Unit of Account 17 (E.U.A.-17)',
2857
3024
  code: 'XBD'
2858
3025
  }, {
3026
+ name: 'Codes specifically reserved for testing purposes',
2859
3027
  code: 'XTS'
2860
3028
  }, {
3029
+ name: 'The codes assigned for transactions where no currency is involved',
2861
3030
  code: 'XXX'
2862
3031
  }, {
3032
+ name: 'Gold',
2863
3033
  code: 'XAU'
2864
3034
  }, {
3035
+ name: 'Palladium',
2865
3036
  code: 'XPD'
2866
3037
  }, {
3038
+ name: 'Platinum',
2867
3039
  code: 'XPT'
2868
3040
  }, {
3041
+ name: 'Silver',
2869
3042
  code: 'XAG'
2870
3043
  }];
2871
3044
 
@@ -2876,7 +3049,7 @@ const ALL_CURRENCIES = [{
2876
3049
 
2877
3050
  "use strict";
2878
3051
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2879
- /* harmony export */ Z: () => (/* binding */ Gate)
3052
+ /* harmony export */ "Z": () => (/* binding */ Gate)
2880
3053
  /* harmony export */ });
2881
3054
  class Gate {
2882
3055
  constructor(isOpen) {
@@ -2919,41 +3092,41 @@ class Gate {
2919
3092
 
2920
3093
  // EXPORTS
2921
3094
  __webpack_require__.d(__webpack_exports__, {
2922
- Z: () => (/* binding */ util)
3095
+ "Z": () => (/* binding */ util)
2923
3096
  });
2924
3097
 
2925
3098
  // NAMESPACE OBJECT: ./src/util/extractor.js
2926
3099
  var extractor_namespaceObject = {};
2927
3100
  __webpack_require__.r(extractor_namespaceObject);
2928
3101
  __webpack_require__.d(extractor_namespaceObject, {
2929
- extract: () => (extract),
2930
- extractEmails: () => (extractEmails),
2931
- extractEmojis: () => (extractEmojis),
2932
- extractLinks: () => (extractLinks),
2933
- extractPhones: () => (extractPhones),
2934
- extractText: () => (extractText),
2935
- pipeExtracts: () => (pipeExtracts)
3102
+ "extract": () => (extract),
3103
+ "extractEmails": () => (extractEmails),
3104
+ "extractEmojis": () => (extractEmojis),
3105
+ "extractLinks": () => (extractLinks),
3106
+ "extractPhones": () => (extractPhones),
3107
+ "extractText": () => (extractText),
3108
+ "pipeExtracts": () => (pipeExtracts)
2936
3109
  });
2937
3110
 
2938
3111
  // NAMESPACE OBJECT: ./src/util/campaign.js
2939
3112
  var campaign_namespaceObject = {};
2940
3113
  __webpack_require__.r(campaign_namespaceObject);
2941
3114
  __webpack_require__.d(campaign_namespaceObject, {
2942
- trackAreaClicked: () => (trackAreaClicked),
2943
- trackExitIntent: () => (trackExitIntent),
2944
- trackInactivity: () => (trackInactivity),
2945
- trackScrollingPercentage: () => (trackScrollingPercentage),
2946
- trackTimeOnPage: () => (trackTimeOnPage)
3115
+ "trackAreaClicked": () => (trackAreaClicked),
3116
+ "trackExitIntent": () => (trackExitIntent),
3117
+ "trackInactivity": () => (trackInactivity),
3118
+ "trackScrollingPercentage": () => (trackScrollingPercentage),
3119
+ "trackTimeOnPage": () => (trackTimeOnPage)
2947
3120
  });
2948
3121
 
2949
3122
  // NAMESPACE OBJECT: ./src/util/order.js
2950
3123
  var order_namespaceObject = {};
2951
3124
  __webpack_require__.r(order_namespaceObject);
2952
3125
  __webpack_require__.d(order_namespaceObject, {
2953
- calcOrderTotal: () => (calcOrderTotal),
2954
- displayOrderShippingAddress: () => (displayOrderShippingAddress),
2955
- getOrderDisplayName: () => (getOrderDisplayName),
2956
- getProductPropName: () => (getProductPropName)
3126
+ "calcOrderTotal": () => (calcOrderTotal),
3127
+ "displayOrderShippingAddress": () => (displayOrderShippingAddress),
3128
+ "getOrderDisplayName": () => (getOrderDisplayName),
3129
+ "getProductPropName": () => (getProductPropName)
2957
3130
  });
2958
3131
 
2959
3132
  // EXTERNAL MODULE: ./src/util/common.js
@@ -3113,7 +3286,9 @@ function trackAreaClicked(selector, cb) {
3113
3286
  on('click', selector, cb);
3114
3287
  });
3115
3288
  }
3116
- function trackInactivity(seconds = 0, cb) {
3289
+ function trackInactivity() {
3290
+ let seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
3291
+ let cb = arguments.length > 1 ? arguments[1] : undefined;
3117
3292
  let events = ['scroll', 'keyup', 'keydown', 'mousemove', 'mousewheel', 'mouseenter', 'mouseover', 'mousedown', 'touchstart', 'touchmove', 'touchenter'];
3118
3293
  let inactiveSeconds = 0;
3119
3294
  let resetTime = () => {
@@ -3136,7 +3311,9 @@ let timeOnPage = 0;
3136
3311
  campaign_common.setInterval(() => {
3137
3312
  timeOnPage += 5;
3138
3313
  }, 5000);
3139
- function trackTimeOnPage(seconds = 0, cb) {
3314
+ function trackTimeOnPage() {
3315
+ let seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
3316
+ let cb = arguments.length > 1 ? arguments[1] : undefined;
3140
3317
  if (seconds < 1) {
3141
3318
  return campaign_common.setTimeout(function () {
3142
3319
  cb(seconds);
@@ -3172,7 +3349,8 @@ op.map = order_common.map;
3172
3349
  op.each = order_common.each;
3173
3350
  op.size = order_common.size;
3174
3351
  op.find = order_common.find;
3175
- function getProductPropName(product, seperator = ' - ') {
3352
+ function getProductPropName(product) {
3353
+ let seperator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' - ';
3176
3354
  let options = op.get(product, 'options', []);
3177
3355
  let props = op.get(product, 'props', []);
3178
3356
  let multiPropsOptions = op.filter(options, option => op.size(option.values) > 1);
@@ -3183,7 +3361,8 @@ function getProductPropName(product, seperator = ' - ') {
3183
3361
  });
3184
3362
  return names.join(seperator);
3185
3363
  }
3186
- function getOrderDisplayName(order = {}) {
3364
+ function getOrderDisplayName() {
3365
+ let order = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3187
3366
  return order.number || order.id || '';
3188
3367
  }
3189
3368
  function displayOrderShippingAddress(order, isShorten) {
@@ -3293,7 +3472,7 @@ sb = Object.assign(sb, order_namespaceObject);
3293
3472
 
3294
3473
  "use strict";
3295
3474
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3296
- /* harmony export */ Z: () => (/* binding */ Mutex)
3475
+ /* harmony export */ "Z": () => (/* binding */ Mutex)
3297
3476
  /* harmony export */ });
3298
3477
  class Mutex {
3299
3478
  constructor() {
@@ -3328,8 +3507,8 @@ class Mutex {
3328
3507
  "use strict";
3329
3508
  __webpack_require__.r(__webpack_exports__);
3330
3509
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3331
- /* harmony export */ get: () => (/* binding */ get),
3332
- /* harmony export */ set: () => (/* binding */ set)
3510
+ /* harmony export */ "get": () => (/* binding */ get),
3511
+ /* harmony export */ "set": () => (/* binding */ set)
3333
3512
  /* harmony export */ });
3334
3513
  var toStr = Object.prototype.toString;
3335
3514
  var isArray = Array.isArray || function (obj) {
@@ -3387,7 +3566,7 @@ function set(obj, path, value) {
3387
3566
 
3388
3567
  "use strict";
3389
3568
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3390
- /* harmony export */ Z: () => (/* binding */ Pubsub)
3569
+ /* harmony export */ "Z": () => (/* binding */ Pubsub)
3391
3570
  /* harmony export */ });
3392
3571
  var {
3393
3572
  filter,
@@ -3399,9 +3578,12 @@ class Pubsub {
3399
3578
  }
3400
3579
  publish(topic, payload, payload2, payload3) {
3401
3580
  this.listeners[topic] = filter(this.listeners[topic], sub => sub.obj._isMounted);
3402
- map(this.listeners[topic], ({
3403
- cb
3404
- }) => cb(payload, payload2, payload3));
3581
+ map(this.listeners[topic], _ref => {
3582
+ let {
3583
+ cb
3584
+ } = _ref;
3585
+ return cb(payload, payload2, payload3);
3586
+ });
3405
3587
  }
3406
3588
  on2(obj, topic, cb) {
3407
3589
  if (!this.listeners[topic]) this.listeners[topic] = [];
@@ -3606,14 +3788,14 @@ class Pubsub {
3606
3788
 
3607
3789
  "use strict";
3608
3790
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3609
- /* harmony export */ HY: () => (/* binding */ g),
3610
- /* harmony export */ Vf: () => (/* binding */ _),
3611
- /* harmony export */ h: () => (/* binding */ y),
3612
- /* harmony export */ sY: () => (/* binding */ q),
3613
- /* harmony export */ wA: () => (/* binding */ b)
3791
+ /* harmony export */ "HY": () => (/* binding */ p),
3792
+ /* harmony export */ "Vf": () => (/* binding */ y),
3793
+ /* harmony export */ "h": () => (/* binding */ h),
3794
+ /* harmony export */ "sY": () => (/* binding */ P),
3795
+ /* harmony export */ "wA": () => (/* binding */ d)
3614
3796
  /* harmony export */ });
3615
3797
  /* unused harmony exports cloneElement, createContext, createElement, hydrate, isValidElement, options, toChildArray */
3616
- var n,l,u,t,i,o,r,f,e,c={},s=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h=Array.isArray;function v(n,l){for(var u in l)n[u]=l[u];return n}function p(n){var l=n.parentNode;l&&l.removeChild(n)}function y(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d(l,f,i,o,null)}function d(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function _(){return{current:null}}function g(n){return n.children}function b(n,l){this.props=n,this.context=l}function m(n,l){if(null==l)return n.__?m(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?m(n):null}function k(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k(n)}}function w(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!x.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(x)}function x(){var n,u,t,o,r,e,c,s,a;for(i.sort(f);n=i.shift();)n.__d&&(u=i.length,o=void 0,e=(r=(t=n).__v).__e,s=[],a=[],(c=t.__P)&&((o=v({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),L(c,o,r,t.__n,void 0!==c.ownerSVGElement,32&r.__u?[e]:null,s,null==e?m(r):e,!!(32&r.__u),a),o.__.__k[o.__i]=o,M(s,o,a),o.__e!=e&&k(o)),i.length>u&&i.sort(f));x.__r=0}function C(n,l,u,t,i,o,r,f,e,a,h){var v,p,y,d,_,g=t&&t.__k||s,b=l.length;for(u.__d=e,P(u,l,g),e=u.__d,v=0;v<b;v++)null!=(y=u.__k[v])&&"boolean"!=typeof y&&"function"!=typeof y&&(p=-1===y.__i?c:g[y.__i]||c,y.__i=v,L(n,y,p,i,o,r,f,e,a,h),d=y.__e,y.ref&&p.ref!=y.ref&&(p.ref&&z(p.ref,null,y),h.push(y.ref,y.__c||d,y)),null==_&&null!=d&&(_=d),65536&y.__u||p.__k===y.__k?e=S(y,e,n):"function"==typeof y.type&&void 0!==y.__d?e=y.__d:d&&(e=d.nextSibling),y.__d=void 0,y.__u&=-196609);u.__d=e,u.__e=_}function P(n,l,u){var t,i,o,r,f,e=l.length,c=u.length,s=c,a=0;for(n.__k=[],t=0;t<e;t++)null!=(i=n.__k[t]=null==(i=l[t])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?d(null,i,null,null,i):h(i)?d(g,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?d(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,f=H(i,u,r=t+a,s),i.__i=f,o=null,-1!==f&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f===r+1?a++:f>r?s>e-r?a+=f-r:a--:a=f<r&&f==r-1?f-r:0,f!==t+a&&(i.__u|=65536))):(o=u[t])&&null==o.key&&o.__e&&(o.__e==n.__d&&(n.__d=m(o)),N(o,o,!1),u[t]=null,s--);if(s)for(t=0;t<c;t++)null!=(o=u[t])&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=m(o)),N(o,o))}function S(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=S(t[i],l,u));return l}return n.__e!=l&&(u.insertBefore(n.__e,l||null),l=n.__e),l&&l.nextSibling}function $(n,l){return l=l||[],null==n||"boolean"==typeof n||(h(n)?n.some(function(n){$(n,l)}):l.push(n)),l}function H(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f<l.length){if((e=l[f])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return f;f++}}return-1}function I(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a.test(l)?u:u+"px"}function T(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||I(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||I(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?D:A,o)):n.removeEventListener(l,o?D:A,o);else{if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u))}}function A(n){var u=this.l[n.type+!1];if(n.t){if(n.t<=u.u)return}else n.t=Date.now();return u(l.event?l.event(n):n)}function D(n){return this.l[n.type+!0](l.event?l.event(n):n)}function L(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,m,k,w,x,P,S,$,H,I,T,A=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[e=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof A)try{if(w=u.props,x=(a=A.contextType)&&i[a.__c],P=a?x?x.props.value:a.__:i,t.__c?k=(p=u.__c=t.__c).__=p.__E:("prototype"in A&&A.prototype.render?u.__c=p=new A(w,P):(u.__c=p=new b(w,P),p.constructor=A,p.render=O),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=P,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=A.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,A.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==A.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==A.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,P),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,P)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u)}),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,P),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,m)})}if(p.context=P,p.props=w,p.__P=n,p.__e=!1,$=l.__r,H=0,"prototype"in A&&A.prototype.render){for(p.state=p.__s,p.__d=!1,$&&$(u),a=p.render(p.props,p.state,p.context),I=0;I<p._sb.length;I++)p.__h.push(p._sb[I]);p._sb=[]}else do{p.__d=!1,$&&$(u),a=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++H<25);p.state=p.__s,null!=p.getChildContext&&(i=v(v({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(d,_)),C(n,h(T=null!=a&&a.type===g&&null==a.key?a.props.children:a)?T:[T],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__u&=-161,p.__h.length&&f.push(p),k&&(p.__E=p.__=null)}catch(n){u.__v=null,c||null!=r?(u.__e=e,u.__u|=c?160:32,r[r.indexOf(e)]=null):(u.__e=t.__e,u.__k=t.__k),l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=j(t.__e,u,t,i,o,r,f,c,s);(a=l.diffed)&&a(u)}function M(n,u,t){u.__d=void 0;for(var i=0;i<t.length;i++)z(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function j(l,u,t,i,o,r,f,e,s){var a,v,y,d,_,g,b,k=t.props,w=u.props,x=u.type;if("svg"===x&&(o=!0),null!=r)for(a=0;a<r.length;a++)if((_=r[a])&&"setAttribute"in _==!!x&&(x?_.localName===x:3===_.nodeType)){l=_,r[a]=null;break}if(null==l){if(null===x)return document.createTextNode(w);l=o?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,w.is&&w),r=null,e=!1}if(null===x)k===w||e&&l.data===w||(l.data=w);else{if(r=r&&n.call(l.childNodes),k=t.props||c,!e&&null!=r)for(k={},a=0;a<l.attributes.length;a++)k[(_=l.attributes[a]).name]=_.value;for(a in k)_=k[a],"children"==a||("dangerouslySetInnerHTML"==a?y=_:"key"===a||a in w||T(l,a,null,_,o));for(a in w)_=w[a],"children"==a?d=_:"dangerouslySetInnerHTML"==a?v=_:"value"==a?g=_:"checked"==a?b=_:"key"===a||e&&"function"!=typeof _||k[a]===_||T(l,a,_,k[a],o);if(v)e||y&&(v.__html===y.__html||v.__html===l.innerHTML)||(l.innerHTML=v.__html),u.__k=[];else if(y&&(l.innerHTML=""),C(l,h(d)?d:[d],u,t,i,o&&"foreignObject"!==x,r,f,r?r[0]:t.__k&&m(t,0),e,s),null!=r)for(a=r.length;a--;)null!=r[a]&&p(r[a]);e||(a="value",void 0!==g&&(g!==l[a]||"progress"===x&&!g||"option"===x&&g!==k[a])&&T(l,a,g,k[a],!1),a="checked",void 0!==b&&b!==l[a]&&T(l,a,b,k[a],!1))}return l}function z(n,u,t){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,t)}}function N(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||z(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&N(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p(n.__e),n.__=n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function q(u,t,i){var o,r,f,e;l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],L(t,u=(!o&&i||t).__k=y(g,null,[u]),r||c,c,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),M(f,u,e)}function B(n,l){q(n,l,B)}function E(l,u,t){var i,o,r,f,e=v({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),d(l.type,e,i||l.key,o||l.ref,null)}function F(n,l){var u={__c:l="__cC"+e++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,w(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=s.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},b.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof n&&(n=n(v({},u),this.props)),n&&v(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w(this))},b.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w(this))},b.prototype.render=g,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0,e=0;
3798
+ var n,l,u,i,t,o,r,f={},e=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a(n){var l=n.parentNode;l&&l.removeChild(n)}function h(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v(l,f,t,o,null)}function v(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function y(){return{current:null}}function p(n){return n.children}function d(n,l){this.props=n,this.context=l}function _(n,l){if(null==l)return n.__?_(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?_(n):null}function k(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k(n)}}function b(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||setTimeout)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s({},t)).__v=t.__v+1,j(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_(t):o,t.__h),z(u,t),t.__e!=o&&k(t)))})}function w(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v(null,k,null,null,k):Array.isArray(k)?v(p,{children:k},null,null,null):k.__b>0?v(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null}j(n,k,d=d||f,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m(k,s,n):s=A(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_(d))}for(u.__e=g,h=C;h--;)null!=x[h]&&N(x[h],x[h]);if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h])}function m(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m(i,l,u):A(u,i,i,t,i.__e,l));return l}function x(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){x(n,l)}):l.push(n)),l}function A(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=1)if(f==t)break n;n.insertBefore(t,o),r=o}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i)}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c.test(l)?u:u+"px"}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&-1==l.indexOf("-")?n.removeAttribute(l):n.setAttribute(l,u))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function T(n){this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H,I,T=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l.__b)&&a(u);try{n:if("function"==typeof T){if(g=u.props,m=(a=T.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in T&&T.prototype.render?u.__c=h=new T(g,x):(u.__c=h=new d(g,x),h.constructor=T,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=T.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s({},h.__s)),s(h.__s,T.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==T.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==T.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){for(h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k)})}if(h.context=x,h.props=g,h.__v=u,h.__P=n,C=l.__r,$=0,"prototype"in T&&T.prototype.render){for(h.state=h.__s,h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[]}else do{h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++$<25);h.state=h.__s,null!=h.getChildContext&&(t=s(s({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),I=null!=a&&a.type===p&&null==a.key?a.props.children:a,w(n,Array.isArray(I)?I:[I],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l.diffed)&&a(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),h=(y=i.props||f).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""))}if(C(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1))}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null,n.__c=void 0}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,i||"function"!=typeof n.type);i||null==n.__e||a(n.__e),n.__=n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l.__&&l.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j(i,u=(!o&&t||i).__k=h(p,null,[u]),r||f,f,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z(e,u)}function S(n,l){P(n,l,S)}function q(l,u,i){var t,o,r,f=s({},l.props);for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),v(l.type,f,t||l.key,o||l.ref,null)}function B(n,l){var u={__c:l="__cC"+r++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(b)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=e.slice,l={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},d.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s({},this.state),"function"==typeof n&&(n=n(s({},u),this.props)),n&&s(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),b(this))},d.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b(this))},d.prototype.render=p,t=[],g.__r=0,r=0;
3617
3799
  //# sourceMappingURL=preact.module.js.map
3618
3800
 
3619
3801
 
@@ -3725,7 +3907,6 @@ var n,l,u,t,i,o,r,f,e,c={},s=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine
3725
3907
  /******/ script.setAttribute("nonce", __webpack_require__.nc);
3726
3908
  /******/ }
3727
3909
  /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
3728
- /******/
3729
3910
  /******/ script.src = url;
3730
3911
  /******/ }
3731
3912
  /******/ inProgress[url] = [done];
@@ -3738,7 +3919,7 @@ var n,l,u,t,i,o,r,f,e,c={},s=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine
3738
3919
  /******/ script.parentNode && script.parentNode.removeChild(script);
3739
3920
  /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
3740
3921
  /******/ if(prev) return prev(event);
3741
- /******/ }
3922
+ /******/ };
3742
3923
  /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
3743
3924
  /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
3744
3925
  /******/ script.onload = onScriptComplete.bind(null, script.onload);
@@ -3807,7 +3988,7 @@ var n,l,u,t,i,o,r,f,e,c={},s=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine
3807
3988
  /******/ }
3808
3989
  /******/ };
3809
3990
  /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
3810
- /******/ }
3991
+ /******/ } else installedChunks[chunkId] = 0;
3811
3992
  /******/ }
3812
3993
  /******/ }
3813
3994
  /******/ };
@@ -3873,14 +4054,14 @@ var lsdb = (__webpack_require__(6929)/* ["default"] */ .Z);
3873
4054
  });
3874
4055
  ;// CONCATENATED MODULE: ./src/store/api.js
3875
4056
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3876
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3877
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4057
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4058
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3878
4059
 
3879
4060
  const ajax = __webpack_require__(7460);
3880
- ajax.env.XMLHttpRequest = util/* default */.Z.XMLHttpRequest;
4061
+ ajax.env.XMLHttpRequest = util/* default.XMLHttpRequest */.Z.XMLHttpRequest;
3881
4062
  function jsonifyTextPlain(param, done) {
3882
4063
  let req = param.request;
3883
- if (req.content_type === 'text/plain' && req.body !== undefined) req.body = util/* default */.Z.stringify(req.body);
4064
+ if (req.content_type === 'text/plain' && req.body !== undefined) req.body = util/* default.stringify */.Z.stringify(req.body);
3884
4065
  done(true);
3885
4066
  }
3886
4067
  /* harmony default export */ const api = (class {
@@ -3890,12 +4071,14 @@ function jsonifyTextPlain(param, done) {
3890
4071
  _defineProperty(this, "ajax", ajax);
3891
4072
  _defineProperty(this, "start", extraData => {
3892
4073
  let data = {
4074
+ starter_id: this.uid,
4075
+ starter_type: 'user',
3893
4076
  touchpoint: {
3894
4077
  channel: 'subiz',
3895
4078
  source: 'web'
3896
4079
  }
3897
4080
  };
3898
- util/* default */.Z.each(extraData, (v, k) => {
4081
+ util/* default.each */.Z.each(extraData, (v, k) => {
3899
4082
  data[k] = v;
3900
4083
  });
3901
4084
  return this.apireq.post(`/accounts/${this.accid}/conversations`, data);
@@ -3919,7 +4102,7 @@ function jsonifyTextPlain(param, done) {
3919
4102
  viewing_product_sku: sku,
3920
4103
  viewing_product_source_id: source_id,
3921
4104
  viewing_product_id: productid,
3922
- pinged: util/* default */.Z.Date.now(),
4105
+ pinged: util/* default.Date.now */.Z.Date.now(),
3923
4106
  is_focused: false
3924
4107
  }
3925
4108
  }
@@ -3958,7 +4141,7 @@ function jsonifyTextPlain(param, done) {
3958
4141
  error
3959
4142
  };
3960
4143
  return {
3961
- url: body.url
4144
+ url: this.FileURL + body.url
3962
4145
  };
3963
4146
  });
3964
4147
  _defineProperty(this, "time", _ => ajax.setBaseUrl(this.ApiURL).withCredentials(true).setParser('json').get('/time'));
@@ -3979,7 +4162,7 @@ function jsonifyTextPlain(param, done) {
3979
4162
  _defineProperty(this, "suggest_address", keyword => this.apireq.setQuery({
3980
4163
  keyword: keyword
3981
4164
  }).get(`/accounts/${this.accid}/addresses`));
3982
- this.refreshLock = new util/* default */.Z.Mutex();
4165
+ this.refreshLock = new util/* default.Mutex */.Z.Mutex();
3983
4166
  this.FileURL = FileURL;
3984
4167
  this.ApiURL = ApiURL;
3985
4168
  this.apireq = ajax.setBaseUrl(ApiURL).withCredentials(true).addQuery('v', '6').setContentType('text/plain').beforeHook(jsonifyTextPlain).setParser('json').beforeHook((param, done) => {
@@ -4010,16 +4193,15 @@ function jsonifyTextPlain(param, done) {
4010
4193
  let outuser;
4011
4194
  for (let i = 0; true; i++) {
4012
4195
  outuser = await ajax.setBaseUrl(this.ApiURL).withCredentials(true).addQuery('v', '6').addQuery('x-user-ref', this.ref).setParser('json').get(`/accounts/${this.accid}/users/${this.ref}`);
4013
- if (outuser.error && util/* default */.Z.get(outuser, 'body.code', '').indexOf('locked_account') != -1) break;
4014
- if (!util/* default */.Z.get(outuser, 'body.id')) {
4015
- let sleeptime = Math.min(2000 + i * 400, 60000);
4016
- await util/* default */.Z.sleep(sleeptime);
4196
+ if (!util/* default.get */.Z.get(outuser, 'body.id')) {
4197
+ let sleeptime = Math.min(2000 + i * 200, 60000);
4198
+ await util/* default.sleep */.Z.sleep(sleeptime);
4017
4199
  continue;
4018
4200
  }
4019
4201
  break;
4020
4202
  }
4021
4203
  if (outuser.error) {
4022
- if (util/* default */.Z.get(outuser.body.code)) return {
4204
+ if (util/* default.get */.Z.get(outuser.body.code)) return {
4023
4205
  error: outuser.body.code
4024
4206
  };
4025
4207
  return outuser;
@@ -4032,7 +4214,7 @@ function jsonifyTextPlain(param, done) {
4032
4214
  this.tokensession = this.tokensession || 0;
4033
4215
  this.tokensession++;
4034
4216
  let tokensession = this.tokensession;
4035
- if (!this.accid || !util/* default */.Z.startsWith(this.accid, 'ac')) return {
4217
+ if (!this.accid || !util/* default.startsWith */.Z.startsWith(this.accid, 'ac')) return {
4036
4218
  error: 'invalid_account_id'
4037
4219
  };
4038
4220
  if (!this.profile_id) return {
@@ -4048,13 +4230,13 @@ function jsonifyTextPlain(param, done) {
4048
4230
  this.refreshLock.unlock();
4049
4231
  return;
4050
4232
  }
4051
- let age = (util/* default */.Z.Date.now() - (this.last_token_at || 0)) / 1000;
4233
+ let age = (util/* default.Date.now */.Z.Date.now() - (this.last_token_at || 0)) / 1000;
4052
4234
  if (!force && this.last_token && age < 1800) {
4053
4235
  this.refreshLock.unlock();
4054
4236
  return this.last_token;
4055
4237
  }
4056
4238
  if (!force && this.last_token && age < 3000) {
4057
- if (this.token_generator) util/* default */.Z.setTimeout(async () => {
4239
+ if (this.token_generator) util/* default.setTimeout */.Z.setTimeout(async () => {
4058
4240
  let token, err;
4059
4241
  try {
4060
4242
  token = await tokenGenerator(profile_id);
@@ -4066,7 +4248,7 @@ function jsonifyTextPlain(param, done) {
4066
4248
  return;
4067
4249
  }
4068
4250
  if (err) this.last_token = 'error';else this.last_token = token;
4069
- this.last_token_at = util/* default */.Z.Date.now();
4251
+ this.last_token_at = util/* default.Date.now */.Z.Date.now();
4070
4252
  this.refreshLock.unlock();
4071
4253
  });
4072
4254
  return this.last_token;
@@ -4083,7 +4265,7 @@ function jsonifyTextPlain(param, done) {
4083
4265
  return;
4084
4266
  }
4085
4267
  if (err) this.last_token = 'error';else this.last_token = token;
4086
- this.last_token_at = util/* default */.Z.Date.now();
4268
+ this.last_token_at = util/* default.Date.now */.Z.Date.now();
4087
4269
  this.refreshLock.unlock();
4088
4270
  return this.last_token;
4089
4271
  };
@@ -4092,15 +4274,15 @@ function jsonifyTextPlain(param, done) {
4092
4274
  await this.token_generator(true);
4093
4275
  if (tokensession != this.tokensession) break;
4094
4276
  outuser = await ajax.setBaseUrl(this.ApiURL).withCredentials(true).addQuery('v', '6').addQuery('x-access-token', this.last_token).setParser('json').get(`/accounts/${this.accid}/users/${profile_id}`);
4095
- if (!util/* default */.Z.get(outuser, 'body.id')) {
4277
+ if (!util/* default.get */.Z.get(outuser, 'body.id')) {
4096
4278
  let sleeptime = Math.min(2000 + i * 100, 120000);
4097
- await util/* default */.Z.sleep(sleeptime);
4279
+ await util/* default.sleep */.Z.sleep(sleeptime);
4098
4280
  continue;
4099
4281
  }
4100
4282
  break;
4101
4283
  }
4102
4284
  if (outuser.error) {
4103
- if (util/* default */.Z.get(outuser.body.code)) return {
4285
+ if (util/* default.get */.Z.get(outuser.body.code)) return {
4104
4286
  error: outuser.body.code
4105
4287
  };
4106
4288
  return outuser;
@@ -4143,15 +4325,15 @@ function jsonifyTextPlain(param, done) {
4143
4325
  });
4144
4326
  ;// CONCATENATED MODULE: ./src/store/api_fake.js
4145
4327
  function api_fake_defineProperty(obj, key, value) { key = api_fake_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4146
- function api_fake_toPropertyKey(t) { var i = api_fake_toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
4147
- function api_fake_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4328
+ function api_fake_toPropertyKey(arg) { var key = api_fake_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4329
+ function api_fake_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4148
4330
 
4149
4331
  const api_fake_ajax = __webpack_require__(7460);
4150
4332
  api_fake_ajax.env.XMLHttpRequest = window.XMLHttpRequest;
4151
4333
  const findAnswer = challenge => challenge.answer;
4152
4334
  function api_fake_jsonifyTextPlain(param, done) {
4153
4335
  let req = param.request;
4154
- if (req.content_type === 'text/plain' && req.body !== undefined) req.body = util/* default */.Z.stringify(req.body);
4336
+ if (req.content_type === 'text/plain' && req.body !== undefined) req.body = util/* default.stringify */.Z.stringify(req.body);
4155
4337
  done(true);
4156
4338
  }
4157
4339
  const OK200 = Promise.resolve({
@@ -4197,7 +4379,7 @@ const OK200 = Promise.resolve({
4197
4379
  api_fake_defineProperty(this, "getChallenge", accid => OK200);
4198
4380
  api_fake_defineProperty(this, "time", _ => Promise.resolve({
4199
4381
  code: 200,
4200
- body: new util/* default */.Z.Date().toISOString()
4382
+ body: new util/* default.Date */.Z.Date().toISOString()
4201
4383
  }));
4202
4384
  api_fake_defineProperty(this, "updateUser", data => OK200);
4203
4385
  api_fake_defineProperty(this, "getUser", _ => Promise.resolve({
@@ -4556,21 +4738,21 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
4556
4738
  });
4557
4739
  ;// CONCATENATED MODULE: ./src/store/store.js
4558
4740
  function store_defineProperty(obj, key, value) { key = store_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4559
- function store_toPropertyKey(t) { var i = store_toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
4560
- function store_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4741
+ function store_toPropertyKey(arg) { var key = store_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4742
+ function store_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4561
4743
 
4562
4744
  var flow = __webpack_require__(3165);
4563
4745
 
4564
4746
 
4565
4747
 
4566
4748
 
4567
- var Realtime = __webpack_require__(608);
4749
+ var Realtime = __webpack_require__(8454);
4568
4750
  var cookie = __webpack_require__(9554);
4569
4751
  cookie.defaults.path = '/';
4570
4752
  cookie.expiresMultiplier = 60 * 60 * 24;
4571
4753
  cookie.defaults.expires = 3650;
4572
4754
  const MAX_CONVO = 20;
4573
- const page_loaded = util/* default */.Z.Date.now();
4755
+ const page_loaded = util/* default.Date.now */.Z.Date.now();
4574
4756
  class Store {
4575
4757
  constructor(ApiURL, FileURL, RealtimeURL, inmem, fakeapi) {
4576
4758
  store_defineProperty(this, "inmem", false);
@@ -4588,14 +4770,14 @@ class Store {
4588
4770
  let user = this.matchUser();
4589
4771
  let allconvos = this.matchConvo('*');
4590
4772
  let unreadcount = 0;
4591
- util/* default */.Z.map(allconvos, convo => {
4592
- if (!util/* default */.Z.isConvoSeen(convo, user.id)) unreadcount++;
4773
+ util/* default.map */.Z.map(allconvos, convo => {
4774
+ if (!util/* default.isConvoSeen */.Z.isConvoSeen(convo, user.id)) unreadcount++;
4593
4775
  });
4594
4776
  return unreadcount;
4595
4777
  });
4596
4778
  store_defineProperty(this, "matchPlugin", () => {
4597
- if (util/* default */.Z.size(this.forcePlugins) > 0) return util/* default */.Z.cloneDeep(this.forcePlugins);
4598
- return util/* default */.Z.cloneDeep(this.cache.match('plugin')) || {};
4779
+ if (util/* default.size */.Z.size(this.forcePlugins) > 0) return util/* default.cloneDeep */.Z.cloneDeep(this.forcePlugins);
4780
+ return util/* default.cloneDeep */.Z.cloneDeep(this.cache.match('plugin')) || {};
4599
4781
  });
4600
4782
  store_defineProperty(this, "device", {});
4601
4783
  store_defineProperty(this, "browserVisibility", 'visible');
@@ -4608,13 +4790,12 @@ class Store {
4608
4790
  if (!id) return;
4609
4791
  if (id === '*') {
4610
4792
  this._touchAcc();
4611
- return util/* default */.Z.filter(this.cache.all(), (value, k) => k.startsWith('convo_'));
4793
+ return util/* default.filter */.Z.filter(this.cache.all(), (value, k) => k.startsWith('convo_'));
4612
4794
  }
4613
4795
  if (!this.isInsync(id)) this.fetchConvo(id);
4614
4796
  return this.cache.match('convo_' + id);
4615
4797
  });
4616
4798
  store_defineProperty(this, "fetchConvo", async cid => {
4617
- if (this._die) return dieErr;
4618
4799
  await this.readyGate.entry();
4619
4800
  await this.reconnectGate.entry(undefined, true);
4620
4801
  if (this.isInsync(cid)) return this.reconnectGate.open();
@@ -4632,7 +4813,7 @@ class Store {
4632
4813
  store_defineProperty(this, "listEvents", id => {
4633
4814
  if (!id || id === '*' || typeof id !== 'string') return;
4634
4815
  if (!this.isInsync('events' + id)) {
4635
- util/* default */.Z.setTimeout(async () => {
4816
+ util/* default.setTimeout */.Z.setTimeout(async () => {
4636
4817
  await this.readyGate.entry();
4637
4818
  await this.reconnectGate.entry(undefined, true);
4638
4819
  if (this.isInsync('events' + id)) return this.reconnectGate.open();
@@ -4655,10 +4836,10 @@ class Store {
4655
4836
  });
4656
4837
  store_defineProperty(this, "matchLocation", () => this.cache.match('location') || {});
4657
4838
  store_defineProperty(this, "matchBot", () => this.cache.match('bot') || {});
4658
- store_defineProperty(this, "readyGate", new util/* default */.Z.Gate());
4659
- store_defineProperty(this, "convoGate", new util/* default */.Z.Gate(true));
4660
- store_defineProperty(this, "reconnectGate", new util/* default */.Z.Gate(true));
4661
- store_defineProperty(this, "wsGate", new util/* default */.Z.Gate(true));
4839
+ store_defineProperty(this, "readyGate", new util/* default.Gate */.Z.Gate());
4840
+ store_defineProperty(this, "convoGate", new util/* default.Gate */.Z.Gate(true));
4841
+ store_defineProperty(this, "reconnectGate", new util/* default.Gate */.Z.Gate(true));
4842
+ store_defineProperty(this, "wsGate", new util/* default.Gate */.Z.Gate(true));
4662
4843
  store_defineProperty(this, "matchLastview", () => {
4663
4844
  let lastView = this.kv.match('lastview') || {};
4664
4845
  let user = this.cache.match('user') || {};
@@ -4669,11 +4850,10 @@ class Store {
4669
4850
  store_defineProperty(this, "matchIsOpen", () => !!this.kv.match('isopen'));
4670
4851
  store_defineProperty(this, "matchHasManuallyClosed", () => !!this.kv.match('hasManuallyClosed'));
4671
4852
  store_defineProperty(this, "matchClosePreviewAt", () => this.kv.match('close_preview_at') || 0);
4672
- store_defineProperty(this, "sendPresence", util/* default */.Z.throttle(async () => {
4673
- if (this._die) return dieErr;
4853
+ store_defineProperty(this, "sendPresence", util/* default.throttle */.Z.throttle(async () => {
4674
4854
  await this.readyGate.entry();
4675
- if (!util/* default */.Z.get(this.cache.match('user'), 'id')) return;
4676
- if (util/* default */.Z.isUserBanned(this.cache.match('user'))) return;
4855
+ if (!util/* default.get */.Z.get(this.cache.match('user'), 'id')) return;
4856
+ if (util/* default.isUserBanned */.Z.isUserBanned(this.cache.match('user'))) return;
4677
4857
  let hasfocus = this.browserVisibility === 'visible' && document.hasFocus();
4678
4858
  if (!hasfocus) {
4679
4859
  this.api.sendLostFocus(this.device, this._currentViewingProduct.id, this._currentViewingProduct.source_id, this._currentViewingProduct.sku);
@@ -4683,10 +4863,10 @@ class Store {
4683
4863
  }, 1000, {
4684
4864
  leading: false
4685
4865
  }));
4686
- store_defineProperty(this, "now", () => util/* default */.Z.Date.now() + this.timeDiff);
4866
+ store_defineProperty(this, "now", () => util/* default.Date.now */.Z.Date.now() + this.timeDiff);
4687
4867
  store_defineProperty(this, "seenQueue", []);
4688
4868
  store_defineProperty(this, "matchTrafficSource", () => this.kv.match('traffic_source'));
4689
- store_defineProperty(this, "_typing", util/* default */.Z.throttle(convoid => this.api.sendTyping(convoid), 3000, {
4869
+ store_defineProperty(this, "_typing", util/* default.throttle */.Z.throttle(convoid => this.api.sendTyping(convoid), 3000, {
4690
4870
  trailing: false
4691
4871
  }));
4692
4872
  store_defineProperty(this, "onConvoEvent", (o, cb) => this.pubsub.on2(o, 'events', cb));
@@ -4705,7 +4885,7 @@ class Store {
4705
4885
  sendEventToThirdParty('SUBIZ Chat', 'Opened', 'Subiz Windows');
4706
4886
  }
4707
4887
  });
4708
- store_defineProperty(this, "closePreview", () => this.kv.put('close_preview_at', new util/* default */.Z.Date().getTime()));
4888
+ store_defineProperty(this, "closePreview", () => this.kv.put('close_preview_at', new util/* default.Date */.Z.Date().getTime()));
4709
4889
  store_defineProperty(this, "setLastview", (view, opts) => {
4710
4890
  let user = this.cache.match('user') || {};
4711
4891
  if (!user.id) return;
@@ -4717,7 +4897,6 @@ class Store {
4717
4897
  });
4718
4898
  store_defineProperty(this, "timeDiff", 0);
4719
4899
  this.g_sync = {};
4720
- this._die = false;
4721
4900
  this.forceDevice = null;
4722
4901
  this.forcePlugins = {};
4723
4902
  this.forceAcc = {};
@@ -4739,38 +4918,31 @@ class Store {
4739
4918
  this.cookie = inmemCookie;
4740
4919
  }
4741
4920
  cleanLocalStorage();
4742
- this.pubsub = new util/* default */.Z.Pubsub();
4921
+ this.pubsub = new util/* default.Pubsub */.Z.Pubsub();
4743
4922
  this.kv = new storage.kv(new storage.lsdb('sbz2023', this.inmem), 'kv');
4744
4923
  this.cache = new storage.kv(new storage.lsdb('sbz2023', true), 'kv');
4745
4924
  this.chain = new storage.chain(new storage.lsdb('cbz2023', true), 'ch');
4746
4925
  this.getLocaleContent = this.api.getLocaleContent;
4747
4926
  this.g_haveSentSeenM = {};
4748
- window.addEventListener('blur', this.sendPresence);
4749
- window.addEventListener('focus', this.sendPresence);
4750
- this._presenceInterval1 = util/* default */.Z.setInterval(() => {
4751
- if (this._die) return util/* default */.Z.clearInterval(this._presenceInterval1);
4752
- if (this.browserVisibility === 'visible' && document.hasFocus()) this.sendPresence();
4753
- }, 20000);
4754
- this._presenceInterval2 = util/* default */.Z.setInterval(() => {
4755
- if (this._die) return util/* default */.Z.clearInterval(this._presenceInterval2);
4756
- if (this.browserVisibility !== 'visible' || document.hasFocus()) this.sendPresence();
4757
- }, 60000);
4927
+ window.addEventListener('blur', () => this.sendPresence());
4928
+ window.addEventListener('focus', () => this.sendPresence());
4929
+ util/* default.setInterval */.Z.setInterval(() => this.browserVisibility === 'visible' && document.hasFocus() && this.sendPresence(), 20000);
4930
+ util/* default.setInterval */.Z.setInterval(() => (this.browserVisibility !== 'visible' || document.hasFocus()) && this.sendPresence(), 60000);
4758
4931
  onVisibilityChange(val => {
4759
- if (this._die) return;
4760
4932
  this.browserVisibility = val;
4761
4933
  this.sendPresence();
4762
4934
  });
4763
4935
  this.loopTime();
4764
4936
  this.device = this.getDeviceInfo();
4765
- const _gaInterval = util/* default */.Z.setInterval(() => {
4937
+ const _gaInterval = util/* default.setInterval */.Z.setInterval(() => {
4766
4938
  let user = this.cache.match('user') || {};
4767
4939
  if (!user.id) return;
4768
4940
  var dev = this.getDeviceInfo();
4769
4941
  if (!dev.ga_tracking_ids || !dev.ga_client_id) return;
4770
- util/* default */.Z.clearInterval(_gaInterval);
4942
+ util/* default.clearInterval */.Z.clearInterval(_gaInterval);
4771
4943
  this.device = dev;
4772
4944
  let ga_client_id = dev.ga_client_id;
4773
- if (ga_client_id !== util/* default */.Z.getUserAttr(user, 'ga_client_id', 'text')) {
4945
+ if (ga_client_id !== util/* default.getUserAttr */.Z.getUserAttr(user, 'ga_client_id', 'text')) {
4774
4946
  this.setUser({
4775
4947
  attributes: [{
4776
4948
  type: 'text',
@@ -4791,10 +4963,10 @@ class Store {
4791
4963
  if (p.sku) this._currentViewingProduct.sku = (p.sku + '').trim();
4792
4964
  }
4793
4965
  getLinkedProduct() {
4794
- return util/* default */.Z.cloneDeep(this._currentViewingProduct);
4966
+ return util/* default.cloneDeep */.Z.cloneDeep(this._currentViewingProduct);
4795
4967
  }
4796
4968
  isInsync(key) {
4797
- return util/* default */.Z.Date.now() - (this.g_sync[key] || 0) < 600000;
4969
+ return util/* default.Date.now */.Z.Date.now() - (this.g_sync[key] || 0) < 600000;
4798
4970
  }
4799
4971
  async fetchShippingAddresses() {
4800
4972
  let out = await this.api.fetchShippingAddresses();
@@ -4811,7 +4983,7 @@ class Store {
4811
4983
  return this.api.createShippingAddress(addr);
4812
4984
  }
4813
4985
  async overrideAcc(acc) {
4814
- this.forceAcc = util/* default */.Z.cloneDeep(acc);
4986
+ this.forceAcc = util/* default.cloneDeep */.Z.cloneDeep(acc);
4815
4987
  await this.readyGate.entry();
4816
4988
  this.disconnect('account');
4817
4989
  this.reconnect();
@@ -4821,7 +4993,7 @@ class Store {
4821
4993
  await this.readyGate.entry();
4822
4994
  this.disconnect('account');
4823
4995
  await this.reconnect();
4824
- util/* default */.Z.setTimeout(this.pubsub.publish('resetCSS'), 10);
4996
+ util/* default.setTimeout */.Z.setTimeout(this.pubsub.publish('resetCSS'), 10);
4825
4997
  }
4826
4998
  getDeviceInfo() {
4827
4999
  let device = {
@@ -4864,10 +5036,9 @@ class Store {
4864
5036
  return page_loaded;
4865
5037
  }
4866
5038
  overridePlugin(plugins) {
4867
- if (this._die) return dieErr;
4868
5039
  if (!Array.isArray(plugins)) throw 'plugins must be be an array';
4869
5040
  let pluginM = {};
4870
- util/* default */.Z.map(plugins, function (plugin) {
5041
+ util/* default.map */.Z.map(plugins, function (plugin) {
4871
5042
  pluginM[plugin.id] = plugin;
4872
5043
  });
4873
5044
  this.forcePlugins = pluginM;
@@ -4875,7 +5046,7 @@ class Store {
4875
5046
  this.pubsub.publish('resetCSS');
4876
5047
  }
4877
5048
  markSync(key) {
4878
- this.g_sync[key] = util/* default */.Z.Date.now();
5049
+ this.g_sync[key] = util/* default.Date.now */.Z.Date.now();
4879
5050
  }
4880
5051
  async _touchAcc() {
4881
5052
  if (this.isInsync('account')) return;
@@ -4899,18 +5070,20 @@ class Store {
4899
5070
  if (mask) {
4900
5071
  let parts = mask.split('@');
4901
5072
  if (parts[0] != accid) {
4902
- userRef = util/* default */.Z.randomString(40);
5073
+ userRef = util/* default.randomString */.Z.randomString(40);
4903
5074
  this.new_visitor = true;
4904
5075
  }
4905
5076
  this.new_visitor = false;
4906
5077
  this.cookie.set('__sbmask', mask);
4907
5078
  } else {
4908
- userRef = util/* default */.Z.randomString(40);
5079
+ userRef = util/* default.randomString */.Z.randomString(40);
4909
5080
  this.new_visitor = true;
4910
5081
  }
4911
5082
  }
4912
5083
  }
4913
- if (this.cookie.get('__sbref', userRef) != userRef) cleanMyLocalStorage();
5084
+ if (this.cookie.get('__sbref', userRef) != userRef) {
5085
+ cleanMyLocalStorage();
5086
+ }
4914
5087
  this.api.setAuth({
4915
5088
  accid: accid
4916
5089
  });
@@ -4920,7 +5093,7 @@ class Store {
4920
5093
  mask: mask,
4921
5094
  ref: userRef
4922
5095
  });
4923
- if (user.error) return console.error(user);
5096
+ if (user.error) return;
4924
5097
  if (this.realtime) this.realtime.stop();
4925
5098
  if (this.fake) this.realtime = new realtime_fake();else this.realtime = new Realtime(this.RealtimeURL, {
4926
5099
  account_id: accid,
@@ -4936,7 +5109,6 @@ class Store {
4936
5109
  return user;
4937
5110
  }
4938
5111
  async login(accid, user_id, tokenGenerator) {
4939
- if (this._die) return dieErr;
4940
5112
  let user = await this.api.setAuth({
4941
5113
  accid: accid,
4942
5114
  profile_id: user_id,
@@ -4967,23 +5139,22 @@ class Store {
4967
5139
  }
4968
5140
  seenLoop() {
4969
5141
  this.seenQueue = [];
4970
- util/* default */.Z.clearInterval(this._seenInterval);
4971
- this._seenInterval = util/* default */.Z.setInterval(() => {
4972
- if (this._die) return util/* default */.Z.clearInterval(this._seenInterval);
5142
+ util/* default.clearInterval */.Z.clearInterval(this._seenInterval);
5143
+ this._seenInterval = util/* default.setInterval */.Z.setInterval(() => {
4973
5144
  this.seenQueue = [...new Set(this.seenQueue)];
4974
5145
  let user = this.cache.match('user') || {};
4975
- util/* default */.Z.map(this.seenQueue, id => {
5146
+ util/* default.map */.Z.map(this.seenQueue, id => {
4976
5147
  var events = this.listEvents(id);
4977
5148
  if (!events) return;
4978
- if (util/* default */.Z.size(events) === 0) return;
4979
- events = util/* default */.Z.filter(events, ev => ev.type === 'message_sent');
4980
- var lastmsgsent = events[util/* default */.Z.size(events) - 1];
5149
+ if (util/* default.size */.Z.size(events) === 0) return;
5150
+ events = util/* default.filter */.Z.filter(events, ev => ev.type === 'message_sent');
5151
+ var lastmsgsent = events[util/* default.size */.Z.size(events) - 1];
4981
5152
  if (!lastmsgsent) return;
4982
5153
  if (this.g_haveSentSeenM[lastmsgsent.id]) return;
4983
- if (lastmsgsent.id === util/* default */.Z.getMsgField(lastmsgsent, 'idempotency')) return;
5154
+ if (lastmsgsent.id === util/* default.getMsgField */.Z.getMsgField(lastmsgsent, 'idempotency')) return;
4984
5155
  this.api.markAsSeen(id, lastmsgsent.id);
4985
5156
  let convo = this.cache.match('convo_' + id) || {};
4986
- let mem = util/* default */.Z.find(convo.members, m => m.id === user.id);
5157
+ let mem = util/* default.find */.Z.find(convo.members, m => m.id === user.id);
4987
5158
  if (mem) mem.seen_at = Date.now();
4988
5159
  this._setConvo(convo);
4989
5160
  this.g_haveSentSeenM[lastmsgsent.id] = true;
@@ -5003,7 +5174,7 @@ class Store {
5003
5174
  if (this.isInsync('account')) return this.reconnectGate.open();
5004
5175
  this.markSync('account');
5005
5176
  let outs = await Promise.all([this.api.getUser(), this.api.getAccountSetting(), this.api.getIsOnline()]);
5006
- let error = util/* default */.Z.find(outs, out => out.error);
5177
+ let error = util/* default.find */.Z.find(outs, out => out.error);
5007
5178
  if (error) return console.error(error);
5008
5179
  let set = Object.assign(outs[1].body, outs[2].body);
5009
5180
  set.user = outs[0].body;
@@ -5012,13 +5183,13 @@ class Store {
5012
5183
  error = convob.error;
5013
5184
  let body = convob.body;
5014
5185
  if (!error) {
5015
- let convos = util/* default */.Z.get(body, 'conversations', []);
5016
- util/* default */.Z.map(this.cache.all(), (value, k) => {
5186
+ let convos = util/* default.get */.Z.get(body, 'conversations', []);
5187
+ util/* default.map */.Z.map(this.cache.all(), (value, k) => {
5017
5188
  if (k.startsWith('convo_')) {
5018
- if (this.now() - util/* default */.Z.getMs(util/* default */.Z.get(value, 'actived')) > 1209600000) this.cache.del(k);
5189
+ if (this.now() - util/* default.getMs */.Z.getMs(util/* default.get */.Z.get(value, 'actived')) > 1209600000) this.cache.del(k);
5019
5190
  }
5020
5191
  });
5021
- util/* default */.Z.map(convos, convo => this._setConvo(convo));
5192
+ util/* default.map */.Z.map(convos, convo => this._setConvo(convo));
5022
5193
  }
5023
5194
  return this.reconnectGate.open();
5024
5195
  }
@@ -5037,13 +5208,13 @@ class Store {
5037
5208
  }
5038
5209
  }
5039
5210
  _setUser(user) {
5040
- user = util/* default */.Z.cloneDeep(user);
5211
+ user = util/* default.cloneDeep */.Z.cloneDeep(user);
5041
5212
  let olduser = this.cache.match('user') || {};
5042
5213
  var accid = olduser.account_id || user.account_id;
5043
5214
  var id = olduser.id || user.id;
5044
- util/* default */.Z.each(user.attributes, newattr => {
5215
+ util/* default.each */.Z.each(user.attributes, newattr => {
5045
5216
  if (!newattr) return;
5046
- olduser.attributes = util/* default */.Z.filter(olduser.attributes, oldattr => {
5217
+ olduser.attributes = util/* default.filter */.Z.filter(olduser.attributes, oldattr => {
5047
5218
  if (!oldattr) return false;
5048
5219
  return oldattr.key !== newattr.key;
5049
5220
  });
@@ -5061,7 +5232,7 @@ class Store {
5061
5232
  return this._setSetting(setting);
5062
5233
  }
5063
5234
  async _setSetting(setting) {
5064
- setting = util/* default */.Z.cloneDeep(setting) || {};
5235
+ setting = util/* default.cloneDeep */.Z.cloneDeep(setting) || {};
5065
5236
  setting.account = Object.assign({}, setting.account, this.forceAcc);
5066
5237
  if (!setting.account.logo_url) {
5067
5238
  setting.account.logo_url = 'https://file-subiz.com/fiqpezhkmeyesdscyetk-default_logo.jpg';
@@ -5077,39 +5248,39 @@ class Store {
5077
5248
  this.cache.put('account', setting.account);
5078
5249
  delete setting.account;
5079
5250
  }
5080
- let location = util/* default */.Z.get(setting, 'location', []);
5251
+ let location = util/* default.get */.Z.get(setting, 'location', []);
5081
5252
  this.cache.put('location', location);
5082
- let bots = util/* default */.Z.get(setting, 'bots', []);
5253
+ let bots = util/* default.get */.Z.get(setting, 'bots', []);
5083
5254
  let botM = {};
5084
- util/* default */.Z.map(bots, bot => {
5255
+ util/* default.map */.Z.map(bots, bot => {
5085
5256
  botM[bot.id] = bot;
5086
5257
  });
5087
5258
  this.cache.put('bot', botM);
5088
- let plugins = util/* default */.Z.get(setting, 'plugins', []);
5259
+ let plugins = util/* default.get */.Z.get(setting, 'plugins', []);
5089
5260
  let pluginM = {};
5090
- util/* default */.Z.map(plugins, plugin => {
5261
+ util/* default.map */.Z.map(plugins, plugin => {
5091
5262
  if (plugin.type === 'chatbox') {
5092
- plugin = util/* default */.Z.merge(plugin, this.forceChatbox);
5263
+ plugin = util/* default.merge */.Z.merge(plugin, this.forceChatbox);
5093
5264
  }
5094
5265
  pluginM[plugin.id] = plugin;
5095
5266
  });
5096
5267
  this.cache.put('plugin', pluginM);
5097
- var agents = util/* default */.Z.get(setting, 'agents', []);
5098
- if (util/* default */.Z.size(agents) > 0) {
5268
+ var agents = util/* default.get */.Z.get(setting, 'agents', []);
5269
+ if (util/* default.size */.Z.size(agents) > 0) {
5099
5270
  let agentM = {};
5100
5271
  this.api.setAgentId(agents[0].id);
5101
- util/* default */.Z.map(agents, agent => {
5272
+ util/* default.map */.Z.map(agents, agent => {
5102
5273
  agentM[agent.id] = agent;
5103
5274
  });
5104
5275
  this.cache.put('agent', agentM);
5105
5276
  }
5106
- let pms = util/* default */.Z.get(setting, 'payment_methods', []);
5277
+ let pms = util/* default.get */.Z.get(setting, 'payment_methods', []);
5107
5278
  this.cache.put('payment_methods', pms);
5108
5279
  this.pubsub.publish('account');
5109
5280
  }
5110
5281
  async track() {
5111
5282
  let out = await this.api.sendContentView(this.device, location.href, document.title, this._currentViewingProduct.id, this._currentViewingProduct.source_id, this._currentViewingProduct.sku);
5112
- let traffic_source = util/* default */.Z.get(out, 'body.by.device.source', '');
5283
+ let traffic_source = util/* default.get */.Z.get(out, 'body.by.device.source', '');
5113
5284
  if (traffic_source) this.kv.put('traffic_source', traffic_source);
5114
5285
  }
5115
5286
  async onWs(ev) {
@@ -5119,18 +5290,17 @@ class Store {
5119
5290
  this.wsGate.open();
5120
5291
  }
5121
5292
  async _onWs(ev) {
5122
- if (this._die) return;
5123
5293
  if (!ev || !ev.type) return;
5124
- ev.created = util/* default */.Z.getMs(ev.created);
5294
+ ev.created = util/* default.getMs */.Z.getMs(ev.created);
5125
5295
  if (ev.type === 'user_info_updated') {
5126
- let user = util/* default */.Z.cloneDeep(this.cache.match('user'));
5127
- let attrs = util/* default */.Z.get(ev, 'data.user.attributes') || [];
5128
- util/* default */.Z.map(attrs, attr => util/* default */.Z.setUserAttr(user, attr));
5296
+ let user = util/* default.cloneDeep */.Z.cloneDeep(this.cache.match('user'));
5297
+ let attrs = util/* default.get */.Z.get(ev, 'data.user.attributes') || [];
5298
+ util/* default.map */.Z.map(attrs, attr => util/* default.setUserAttr */.Z.setUserAttr(user, attr));
5129
5299
  this._setUser(user);
5130
5300
  return;
5131
5301
  }
5132
5302
  let user = this.cache.match('user') || {};
5133
- let cid = util/* default */.Z.convoOfEv(ev);
5303
+ let cid = util/* default.convoOfEv */.Z.convoOfEv(ev);
5134
5304
  let convo;
5135
5305
  let alreadyFetched = false;
5136
5306
  if (cid) {
@@ -5147,12 +5317,12 @@ class Store {
5147
5317
  }
5148
5318
  }
5149
5319
  if (!convo) return;
5150
- let channel = util/* default */.Z.get(ev, 'touchpoint.channel', '');
5320
+ let channel = util/* default.get */.Z.get(ev, 'touchpoint.channel', '');
5151
5321
  if (channel && channel != 'subiz') return;
5152
5322
  this.pubsub.publish('events', ev);
5153
5323
  if (ev.type === 'conversation_joined') {
5154
- let members = util/* default */.Z.get(ev, 'data.conversation.members', []);
5155
- let me = util/* default */.Z.find(members, m => m.id === this.cache.match('user').id);
5324
+ let members = util/* default.get */.Z.get(ev, 'data.conversation.members', []);
5325
+ let me = util/* default.find */.Z.find(members, m => m.id === this.cache.match('user').id);
5156
5326
  if (me) {
5157
5327
  await this.chain.reload(cid, (type, anchor, limit) => this.listmessageapi(type, anchor, limit));
5158
5328
  this.markSync('events' + cid);
@@ -5169,13 +5339,13 @@ class Store {
5169
5339
  }
5170
5340
  }
5171
5341
  if (ev.type === 'message_sent') {
5172
- if (util/* default */.Z.get(ev, 'by.id') !== user.id) {
5342
+ if (util/* default.get */.Z.get(ev, 'by.id') !== user.id) {
5173
5343
  this.api.markAsReceived(cid, ev.id);
5174
5344
  }
5175
5345
  }
5176
- if (util/* default */.Z.startsWith(ev.type, 'message_') || util/* default */.Z.startsWith(ev.type, 'conversation_')) {
5346
+ if (util/* default.startsWith */.Z.startsWith(ev.type, 'message_') || util/* default.startsWith */.Z.startsWith(ev.type, 'conversation_')) {
5177
5347
  this.restConvoEvent(ev);
5178
- if (ev.type === 'message_sent' && util/* default */.Z.get(ev, 'by.id') !== user.id) {
5348
+ if (ev.type === 'message_sent' && util/* default.get */.Z.get(ev, 'by.id') !== user.id) {
5179
5349
  sendEventToThirdParty('SUBIZ Chat', 'Received', 'User');
5180
5350
  }
5181
5351
  return;
@@ -5183,36 +5353,36 @@ class Store {
5183
5353
  }
5184
5354
  async restConvoEvent(ev) {
5185
5355
  let user = this.cache.match('user');
5186
- let cid = util/* default */.Z.convoOfEv(ev);
5356
+ let cid = util/* default.convoOfEv */.Z.convoOfEv(ev);
5187
5357
  let convo = this.cache.match('convo_' + cid) || {};
5188
5358
  if (ev.type === 'conversation_state_updated') {
5189
- if (!util/* default */.Z.get(convo, 'id')) {
5359
+ if (!util/* default.get */.Z.get(convo, 'id')) {
5190
5360
  let {
5191
5361
  body: convo,
5192
5362
  error
5193
5363
  } = await this.api.getConversation(cid);
5194
5364
  if (error) return;
5195
5365
  }
5196
- convo = Object.assign(convo, util/* default */.Z.get(ev, 'data.conversation'));
5366
+ convo = Object.assign(convo, util/* default.get */.Z.get(ev, 'data.conversation'));
5197
5367
  }
5198
5368
  if (ev.type === 'message_pong') {
5199
- var msgid = util/* default */.Z.get(ev, 'data.message.id');
5369
+ var msgid = util/* default.get */.Z.get(ev, 'data.message.id');
5200
5370
  var oldev = this.chain.match(cid, msgid);
5201
- if (!util/* default */.Z.get(oldev, 'data.message')) return;
5202
- var pongs = util/* default */.Z.get(oldev, 'data.message.pongs', []);
5203
- pongs = pongs.concat(util/* default */.Z.get(ev, 'data.message.pongs', []));
5371
+ if (!util/* default.get */.Z.get(oldev, 'data.message')) return;
5372
+ var pongs = util/* default.get */.Z.get(oldev, 'data.message.pongs', []);
5373
+ pongs = pongs.concat(util/* default.get */.Z.get(ev, 'data.message.pongs', []));
5204
5374
  oldev.data.message.pongs = pongs;
5205
- util/* default */.Z.map(pongs, pong => {
5375
+ util/* default.map */.Z.map(pongs, pong => {
5206
5376
  if (pong.member_id == user.id && pong.type === 'seen') {
5207
- let mem = util/* default */.Z.find(convo.members, mem => mem.id === user.id);
5377
+ let mem = util/* default.find */.Z.find(convo.members, mem => mem.id === user.id);
5208
5378
  if (mem) mem.seen_at = pong.created;
5209
5379
  }
5210
5380
  });
5211
- this.chain.put(cid, oldev.id, util/* default */.Z.getMs(oldev.created), oldev);
5381
+ this.chain.put(cid, oldev.id, util/* default.getMs */.Z.getMs(oldev.created), oldev);
5212
5382
  }
5213
5383
  if (ev.type === 'message_sent') {
5214
- let idemkey = util/* default */.Z.getMsgField(ev, 'idempotency');
5215
- let found = util/* default */.Z.find(this.listEvents(cid), oldev => oldev.id === idemkey);
5384
+ let idemkey = util/* default.getMsgField */.Z.getMsgField(ev, 'idempotency');
5385
+ let found = util/* default.find */.Z.find(this.listEvents(cid), oldev => oldev.id === idemkey);
5216
5386
  if (found) {
5217
5387
  this.chain.del(cid, found.id);
5218
5388
  ev.created = found.created;
@@ -5220,7 +5390,7 @@ class Store {
5220
5390
  convo.last_message_sent = ev;
5221
5391
  }
5222
5392
  if (ev.type !== 'message_pong' && ev.type !== 'conversation_typing') {
5223
- this.chain.put(cid, ev.id, util/* default */.Z.getMs(ev.created), ev);
5393
+ this.chain.put(cid, ev.id, util/* default.getMs */.Z.getMs(ev.created), ev);
5224
5394
  }
5225
5395
  this._setConvo(convo);
5226
5396
  this.pubsub.publish('account');
@@ -5228,31 +5398,31 @@ class Store {
5228
5398
  handleFormSubmit(convoKey, ev) {
5229
5399
  if (ev.type !== 'message_sent') return;
5230
5400
  let formSubmits = [];
5231
- let attachments = util/* default */.Z.get(ev, 'data.message.attachments') || [];
5232
- util/* default */.Z.each(attachments, att => {
5401
+ let attachments = util/* default.get */.Z.get(ev, 'data.message.attachments') || [];
5402
+ util/* default.each */.Z.each(attachments, att => {
5233
5403
  if (!att) return;
5234
5404
  if (att.type !== 'form_submit') return;
5235
5405
  formSubmits.push(att.form_submit);
5236
5406
  });
5237
- util/* default */.Z.each(formSubmits, submit => {
5238
- let formev = util/* default */.Z.get(this.convoEventM, convoKey + '.' + submit.form_message_id);
5407
+ util/* default.each */.Z.each(formSubmits, submit => {
5408
+ let formev = util/* default.get */.Z.get(this.convoEventM, convoKey + '.' + submit.form_message_id);
5239
5409
  if (!formev) return;
5240
- let forms = util/* default */.Z.filter(util/* default */.Z.get(formev, 'data.message.attachments'), att => {
5410
+ let forms = util/* default.filter */.Z.filter(util/* default.get */.Z.get(formev, 'data.message.attachments'), att => {
5241
5411
  if (!att) return false;
5242
5412
  if (att.type !== 'form' && att.type !== 'ask_info_form') return false;
5243
5413
  return true;
5244
5414
  });
5245
- util/* default */.Z.each(forms, form => {
5415
+ util/* default.each */.Z.each(forms, form => {
5246
5416
  form = form.form;
5247
- util/* default */.Z.each(form.fields, formfield => {
5248
- util/* default */.Z.each(submit.fields, submitfield => {
5417
+ util/* default.each */.Z.each(form.fields, formfield => {
5418
+ util/* default.each */.Z.each(submit.fields, submitfield => {
5249
5419
  if (formfield.name !== submitfield.name) return;
5250
5420
  if (formfield.default_answer) return;
5251
5421
  formfield.default_answer = submitfield.value;
5252
5422
  });
5253
5423
  });
5254
5424
  });
5255
- if (util/* default */.Z.size(forms) > 0) this.pubsub.publish('state.convoEventM', this.convoEventM, convoKey);
5425
+ if (util/* default.size */.Z.size(forms) > 0) this.pubsub.publish('state.convoEventM', this.convoEventM, convoKey);
5256
5426
  });
5257
5427
  }
5258
5428
  typing(cid) {
@@ -5287,7 +5457,7 @@ class Store {
5287
5457
  }
5288
5458
  async sendConvoEvent(cid, type, data) {
5289
5459
  await this.readyGate.entry();
5290
- var idempotency = util/* default */.Z.randomString(36);
5460
+ var idempotency = util/* default.randomString */.Z.randomString(36);
5291
5461
  let user = this.cache.match('user') || {};
5292
5462
  var event = {
5293
5463
  id: idempotency,
@@ -5300,24 +5470,17 @@ class Store {
5300
5470
  type,
5301
5471
  created: this.now()
5302
5472
  };
5303
- util/* default */.Z.convoToEv(cid, event);
5473
+ util/* default.convoToEv */.Z.convoToEv(cid, event);
5304
5474
  let files = [];
5305
5475
  if (type === 'message_sent') {
5306
- util/* default */.Z.setMsgField(event, 'idempotency', idempotency);
5476
+ util/* default.setMsgField */.Z.setMsgField(event, 'idempotency', idempotency);
5307
5477
  event.data.message.conversation_id = cid;
5308
5478
  await flow.map(event.data.message.attachments, 2, async (att, i) => {
5309
5479
  if (att.type !== 'file') return;
5310
5480
  if (!att._file) return;
5311
5481
  files.push(att);
5312
5482
  if (ImageTypes.includes(att._file.type)) {
5313
- let {
5314
- width,
5315
- height,
5316
- url
5317
- } = await loadImage(att._file);
5318
- att.url = url;
5319
- att.width = width;
5320
- att.height = height;
5483
+ att.url = await loadImage(att._file);
5321
5484
  }
5322
5485
  });
5323
5486
  }
@@ -5329,7 +5492,7 @@ class Store {
5329
5492
  url,
5330
5493
  error
5331
5494
  } = await this.api.uploadToS3(att._file);
5332
- if (util/* default */.Z.get(body, 'code') == 'invalid_field_size') {
5495
+ if (util/* default.get */.Z.get(body, 'code') == 'invalid_field_size') {
5333
5496
  event._error_message = 'cannot_send_too_big_file';
5334
5497
  }
5335
5498
  event._error = error;
@@ -5357,23 +5520,23 @@ class Store {
5357
5520
  first_interaction: 1
5358
5521
  });
5359
5522
  }
5360
- this.kv.put('last_msg_sent', util/* default */.Z.Date.now());
5523
+ this.kv.put('last_msg_sent', util/* default.Date.now */.Z.Date.now());
5361
5524
  return ret;
5362
5525
  }
5363
5526
  _setConvo(convo) {
5364
5527
  let count = 0;
5365
5528
  let user = this.cache.match('user');
5366
- let channel = util/* default */.Z.get(convo, 'touchpoint.channel', '');
5529
+ let channel = util/* default.get */.Z.get(convo, 'touchpoint.channel', '');
5367
5530
  if (channel && channel != 'subiz') return;
5368
5531
  let allconvo = {};
5369
- util/* default */.Z.map(this.cache.all(), (value, key) => {
5532
+ util/* default.map */.Z.map(this.cache.all(), (value, key) => {
5370
5533
  if (key.startsWith('convo_')) {
5371
5534
  allconvo[key] = value;
5372
5535
  }
5373
5536
  });
5374
- if (util/* default */.Z.size(allconvo) > MAX_CONVO - 2) {
5375
- allconvo = util/* default */.Z.orderBy(util/* default */.Z.map(allconvo), 'created', 'desc');
5376
- for (var i = MAX_CONVO - 2; i < util/* default */.Z.size(allconvo); i++) {
5537
+ if (util/* default.size */.Z.size(allconvo) > MAX_CONVO - 2) {
5538
+ allconvo = util/* default.orderBy */.Z.orderBy(util/* default.map */.Z.map(allconvo), 'created', 'desc');
5539
+ for (var i = MAX_CONVO - 2; i < util/* default.size */.Z.size(allconvo); i++) {
5377
5540
  let convo = allconvo[i];
5378
5541
  this.cache.del('convo_' + convo.id);
5379
5542
  }
@@ -5429,7 +5592,7 @@ class Store {
5429
5592
  account_id: user.account_id,
5430
5593
  web_plugin_id: id,
5431
5594
  campaign_id: id,
5432
- user_id: util/* default */.Z.get(user, 'id'),
5595
+ user_id: util/* default.get */.Z.get(user, 'id'),
5433
5596
  url: window.location.href,
5434
5597
  device: this.device,
5435
5598
  submission,
@@ -5448,9 +5611,9 @@ class Store {
5448
5611
  error
5449
5612
  } = await this.api.listMessages(convoid, -limit, anchor);
5450
5613
  if (error || code !== 200) return [[], anchor, error];
5451
- anchor = util/* default */.Z.get(util/* default */.Z.last(events), 'id');
5452
- events = util/* default */.Z.map(events, event => {
5453
- event.created = util/* default */.Z.getMs(event.created);
5614
+ anchor = util/* default.get */.Z.get(util/* default.last */.Z.last(events), 'id');
5615
+ events = util/* default.map */.Z.map(events, event => {
5616
+ event.created = util/* default.getMs */.Z.getMs(event.created);
5454
5617
  return {
5455
5618
  id: event.id,
5456
5619
  index: event.created,
@@ -5461,8 +5624,8 @@ class Store {
5461
5624
  for (let i = 0; i < events.length; i++) {
5462
5625
  let ev = events[i].value;
5463
5626
  if (ev.type !== 'message_sent') continue;
5464
- if (util/* default */.Z.get(ev, 'by.id') === user.id) continue;
5465
- let pongbyme = util/* default */.Z.find(util/* default */.Z.get(ev, 'data.message.pongs'), p => p.member_id === user.id);
5627
+ if (util/* default.get */.Z.get(ev, 'by.id') === user.id) continue;
5628
+ let pongbyme = util/* default.find */.Z.find(util/* default.get */.Z.get(ev, 'data.message.pongs'), p => p.member_id === user.id);
5466
5629
  if (pongbyme) break;
5467
5630
  this.api.markAsReceived(convoid, ev.id);
5468
5631
  break;
@@ -5470,26 +5633,25 @@ class Store {
5470
5633
  return [events, anchor];
5471
5634
  }
5472
5635
  async loopTime() {
5473
- if (this._die) return;
5474
- let startms = util/* default */.Z.Date.now();
5475
- if (!util/* default */.Z.get(this.cache.match('user'), 'id')) return util/* default */.Z.setTimeout(() => this.loopTime(), 240000);
5636
+ let startms = util/* default.Date.now */.Z.Date.now();
5637
+ if (!util/* default.get */.Z.get(this.cache.match('user'), 'id')) return util/* default.setTimeout */.Z.setTimeout(() => this.loopTime(), 240000);
5476
5638
  let {
5477
5639
  body: t,
5478
5640
  error
5479
5641
  } = await this.api.time();
5480
- if (error) return util/* default */.Z.setTimeout(() => this.loopTime(), 30000);
5481
- var latences = Math.abs(util/* default */.Z.Date.now() - startms) / 2;
5482
- var serverMs = new util/* default */.Z.Date(t).getTime() + latences;
5483
- var localMs = util/* default */.Z.Date.now();
5642
+ if (error) return util/* default.setTimeout */.Z.setTimeout(() => this.loopTime(), 30000);
5643
+ var latences = Math.abs(util/* default.Date.now */.Z.Date.now() - startms) / 2;
5644
+ var serverMs = new util/* default.Date */.Z.Date(t).getTime() + latences;
5645
+ var localMs = util/* default.Date.now */.Z.Date.now();
5484
5646
  this.timeDiff = Math.floor(serverMs - localMs);
5485
- util/* default */.Z.setTimeout(() => this.loopTime(), 240000);
5647
+ util/* default.setTimeout */.Z.setTimeout(() => this.loopTime(), 240000);
5486
5648
  }
5487
5649
  replaceFileUrl(src) {
5488
5650
  if (!src) return '';
5489
- if (util/* default */.Z.startsWith(src, '/')) return src;
5490
- if (util/* default */.Z.startsWith(src, 'data:')) return src;
5491
- if (!util/* default */.Z.startsWith(src, 'http://') && !util/* default */.Z.startsWith(src, 'https://') && !util/* default */.Z.startsWith(src, '//')) {
5492
- src = util/* default */.Z.trim(this.FileURL, '/') + '/' + util/* default */.Z.trimStart(src, '/');
5651
+ if (util/* default.startsWith */.Z.startsWith(src, '/')) return src;
5652
+ if (util/* default.startsWith */.Z.startsWith(src, 'data:')) return src;
5653
+ if (!util/* default.startsWith */.Z.startsWith(src, 'http://') && !util/* default.startsWith */.Z.startsWith(src, 'https://') && !util/* default.startsWith */.Z.startsWith(src, '//')) {
5654
+ src = util/* default.trim */.Z.trim(this.FileURL, '/') + '/' + util/* default.trimStart */.Z.trimStart(src, '/');
5493
5655
  }
5494
5656
  src = src.replace('https://file-subiz.com/', this.FileURL);
5495
5657
  src = src.replace('http://file-subiz.com/', this.FileURL);
@@ -5506,7 +5668,7 @@ class Store {
5506
5668
  return src;
5507
5669
  }
5508
5670
  clearBrowserData() {
5509
- util/* default */.Z.each(this.cookie.all(), (v, k) => {
5671
+ util/* default.each */.Z.each(this.cookie.all(), (v, k) => {
5510
5672
  if ((k || '').startsWith('__sb')) this.cookie.remove(k);
5511
5673
  });
5512
5674
  this.kv.destroy();
@@ -5516,29 +5678,16 @@ class Store {
5516
5678
  }
5517
5679
  destroy() {
5518
5680
  this._die = true;
5519
- if (this.kv) this.kv.destroy();
5520
- if (this.chain) this.chain.destroy();
5521
- util/* default */.Z.clearInterval(this._seenInterval);
5681
+ this.clearBrowserData();
5522
5682
  if (this.realtime) this.realtime.stop();
5523
5683
  this.readyGate.close();
5524
- window.removeEventListener('blur', this.sendPresence);
5525
- window.removeEventListener('focus', this.sendPresence);
5526
5684
  }
5527
5685
  }
5528
5686
  function loadImage(file) {
5529
5687
  return new Promise(rs => {
5530
5688
  var reader = new window.FileReader();
5531
5689
  reader.onload = e => {
5532
- let src = e.target.result;
5533
- let img = new Image();
5534
- img.onload = () => {
5535
- rs({
5536
- url: src,
5537
- width: img.width,
5538
- height: img.height
5539
- });
5540
- };
5541
- img.src = src;
5690
+ rs(e.target.result);
5542
5691
  };
5543
5692
  reader.readAsDataURL(file);
5544
5693
  });
@@ -5649,7 +5798,7 @@ let cleanLocalStorage = () => {
5649
5798
  } catch (e) {
5650
5799
  return;
5651
5800
  }
5652
- util/* default */.Z.setTimeout(() => {
5801
+ util/* default.setTimeout */.Z.setTimeout(() => {
5653
5802
  for (var key in localStorage) {
5654
5803
  if (key && (key.startsWith('cbz2020') || key.startsWith('sbz2020'))) {
5655
5804
  localStorage.removeItem(key);
@@ -5663,7 +5812,7 @@ let cleanMyLocalStorage = () => {
5663
5812
  } catch (e) {
5664
5813
  return;
5665
5814
  }
5666
- util/* default */.Z.setTimeout(() => {
5815
+ util/* default.setTimeout */.Z.setTimeout(() => {
5667
5816
  for (var key in localStorage) {
5668
5817
  if (key && (key.startsWith('cbz2020') || key.startsWith('sbz2020') || key.startsWith('sbz2022') || key.startsWith('sbz2023'))) {
5669
5818
  localStorage.removeItem(key);
@@ -5681,8 +5830,8 @@ function dofetch(method, url, body, cb) {
5681
5830
  }).then(res => res.text().then(text => cb && cb(text, res.status))).catch(err => cb && cb(err, -1));
5682
5831
  }
5683
5832
  var xhrsend = function (method, url, body, cb) {
5684
- if (typeof util/* default */.Z.XMLHttpRequest === 'undefined') return dofetch(method, url, body, cb);
5685
- var request = new util/* default */.Z.XMLHttpRequest();
5833
+ if (typeof util/* default.XMLHttpRequest */.Z.XMLHttpRequest === 'undefined') return dofetch(method, url, body, cb);
5834
+ var request = new util/* default.XMLHttpRequest */.Z.XMLHttpRequest();
5686
5835
  request.onreadystatechange = function (e) {
5687
5836
  if (request.readyState !== 4) return;
5688
5837
  cb && cb(request.responseText, request.status);
@@ -5696,7 +5845,6 @@ var xhrsend = function (method, url, body, cb) {
5696
5845
  if (body) request.setRequestHeader('content-type', 'text/plain');
5697
5846
  request.send(body);
5698
5847
  };
5699
- const dieErr = new Error('sdk unloaded');
5700
5848
  // EXTERNAL MODULE: ./src/common.js
5701
5849
  var common = __webpack_require__(2493);
5702
5850
  // EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
@@ -5705,7 +5853,7 @@ var preact_module = __webpack_require__(6400);
5705
5853
 
5706
5854
 
5707
5855
 
5708
- const LoadChatbox = () => __webpack_require__.e(/* import() */ 841).then(__webpack_require__.bind(__webpack_require__, 8841));
5856
+ const LoadChatbox = () => __webpack_require__.e(/* import() */ 132).then(__webpack_require__.bind(__webpack_require__, 8132));
5709
5857
  const LoadContact = () => __webpack_require__.e(/* import() */ 335).then(__webpack_require__.bind(__webpack_require__, 2335));
5710
5858
  const LoadPopup = () => __webpack_require__.e(/* import() */ 213).then(__webpack_require__.bind(__webpack_require__, 8213));
5711
5859
  const LoadNotif = () => __webpack_require__.e(/* import() */ 605).then(__webpack_require__.bind(__webpack_require__, 9605));
@@ -5713,12 +5861,9 @@ function Plugin(plugin, store, $container, lib) {
5713
5861
  if (!$container) throw '$div must is a valid html node';
5714
5862
  var $div = document.createElement('div');
5715
5863
  $div.id = plugin.id;
5716
- let acc = store.matchAccount();
5717
- $div.setAttribute('sbz-plugin-type', plugin.type);
5718
- $div.setAttribute('sbz-plugin-account-id', acc.id);
5719
5864
  $container.appendChild($div);
5720
- let _locale = common/* getLocale */.Kd(plugin, util/* default */.Z.detectLang());
5721
- var domGate = new util/* default */.Z.Gate();
5865
+ let _locale = common/* getLocale */.Kd(plugin, util/* default.detectLang */.Z.detectLang());
5866
+ var domGate = new util/* default.Gate */.Z.Gate();
5722
5867
  var pageIndex = 0;
5723
5868
  var highlight;
5724
5869
  var state = 'hold';
@@ -5731,13 +5876,13 @@ function Plugin(plugin, store, $container, lib) {
5731
5876
  let lastrun = store.matchLastPluginRun(plugin.id);
5732
5877
  if (plugin.type === 'chatbox' || plugin.type === 'notification') lastrun = undefined;
5733
5878
  if (!plugin.enabled) return;
5734
- let match = util/* default */.Z.checkRunConditions(plugin.initiative_frequency, plugin.conditions, lastrun, store);
5879
+ let match = util/* default.checkRunConditions */.Z.checkRunConditions(plugin.initiative_frequency, plugin.conditions, lastrun, store);
5735
5880
  if (!match) return;
5736
5881
  state = 'running';
5737
5882
  await _this.update(plugin);
5738
5883
  };
5739
5884
  this.forceRunPopup = async () => {
5740
- if (util/* default */.Z.get(_ref, 'current')) {
5885
+ if (util/* default.get */.Z.get(_ref, 'current')) {
5741
5886
  _ref.current.openPopup();
5742
5887
  } else {
5743
5888
  _render();
@@ -5824,10 +5969,11 @@ function Plugin(plugin, store, $container, lib) {
5824
5969
  };
5825
5970
  let t = key => {
5826
5971
  if (_locale === 'debug') return `{{${key}}}`;
5827
- let messages = util/* default */.Z.get(common/* langMessages */.Rs, _locale, []);
5828
- let message = util/* default */.Z.find(messages, message => message.key === key);
5829
- return util/* default */.Z.get(message, 'message', key);
5972
+ let messages = util/* default.get */.Z.get(common/* langMessages */.Rs, _locale, []);
5973
+ let message = util/* default.find */.Z.find(messages, message => message.key === key);
5974
+ return util/* default.get */.Z.get(message, 'message', key);
5830
5975
  };
5976
+ let acc = store.matchAccount();
5831
5977
  t.i18n = i18nText => {
5832
5978
  if (!i18nText) return '';
5833
5979
  let fallbackLocale = plugin.locale || acc.locale || 'vi-VN';
@@ -5851,29 +5997,29 @@ function Plugin(plugin, store, $container, lib) {
5851
5997
  return _locale;
5852
5998
  };
5853
5999
  let images = {};
5854
- util/* default */.Z.map(util/* default */.Z.get(plugin, 'popup.pages'), page => {
6000
+ util/* default.map */.Z.map(util/* default.get */.Z.get(plugin, 'popup.pages'), page => {
5855
6001
  if (!page) return;
5856
- util/* default */.Z.map(page.components, com => {
6002
+ util/* default.map */.Z.map(page.components, com => {
5857
6003
  if (com.type === 'image' && com.image && com.image.url && com.image.url.startsWith('http')) {
5858
6004
  images[com.image.url] = true;
5859
6005
  }
5860
6006
  });
5861
6007
  });
5862
- if (util/* default */.Z.size(images) >= 0) util/* default */.Z.map(images, (_, image) => util/* default */.Z.preloadImg(image));
5863
- let triggers = util/* default */.Z.get(plugin, 'triggers') || [{
6008
+ if (util/* default.size */.Z.size(images) >= 0) util/* default.map */.Z.map(images, (_, image) => util/* default.preloadImg */.Z.preloadImg(image));
6009
+ let triggers = util/* default.get */.Z.get(plugin, 'triggers') || [{
5864
6010
  type: 'after_pageview',
5865
6011
  after_pageview_sec: 0,
5866
6012
  disabled: false
5867
6013
  }];
5868
- for (var i = 0; i < util/* default */.Z.size(triggers); i++) {
6014
+ for (var i = 0; i < util/* default.size */.Z.size(triggers); i++) {
5869
6015
  var tr = triggers[i];
5870
6016
  if (!tr) continue;
5871
6017
  if (tr.disabled) continue;
5872
- if (tr.type === 'exit_intent') util/* default */.Z.trackExitIntent(run);
5873
- if (tr.type === 'area_clicked') util/* default */.Z.trackAreaClicked(tr.area_clicked_css_selector, run);
5874
- if (tr.type === 'scrolling_percentage') util/* default */.Z.trackScrollingPercentage(tr.scrolling_percentage, run);
5875
- if (tr.type === 'inactivity_duration') util/* default */.Z.trackInactivity(tr.inactivity_sec, run);
5876
- if (tr.type === 'after_pageview') util/* default */.Z.trackTimeOnPage(tr.after_pageview_sec, run);
6018
+ if (tr.type === 'exit_intent') util/* default.trackExitIntent */.Z.trackExitIntent(run);
6019
+ if (tr.type === 'area_clicked') util/* default.trackAreaClicked */.Z.trackAreaClicked(tr.area_clicked_css_selector, run);
6020
+ if (tr.type === 'scrolling_percentage') util/* default.trackScrollingPercentage */.Z.trackScrollingPercentage(tr.scrolling_percentage, run);
6021
+ if (tr.type === 'inactivity_duration') util/* default.trackInactivity */.Z.trackInactivity(tr.inactivity_sec, run);
6022
+ if (tr.type === 'after_pageview') util/* default.trackTimeOnPage */.Z.trackTimeOnPage(tr.after_pageview_sec, run);
5877
6023
  }
5878
6024
  this.update(plugin);
5879
6025
  common/* downloadLanguage */.WW(store, _locale).then(() => {
@@ -5901,7 +6047,7 @@ class PluginMgr {
5901
6047
  if (this._destroy) return;
5902
6048
  let pluginM = this.lib.store.matchPlugin();
5903
6049
  let foundchatbox = false;
5904
- util/* default */.Z.each(pluginM, conf => {
6050
+ util/* default.each */.Z.each(pluginM, conf => {
5905
6051
  if (conf.type === 'chatbox') {
5906
6052
  if (foundchatbox) return;
5907
6053
  foundchatbox = true;
@@ -5912,7 +6058,7 @@ class PluginMgr {
5912
6058
  }
5913
6059
  this.pluginM[conf.id].update(conf);
5914
6060
  });
5915
- util/* default */.Z.each(this.pluginM, (conf, id) => {
6061
+ util/* default.each */.Z.each(this.pluginM, (conf, id) => {
5916
6062
  if (pluginM[id]) return;
5917
6063
  this.pluginM[id].destroy();
5918
6064
  delete this.pluginM[id];
@@ -5920,7 +6066,7 @@ class PluginMgr {
5920
6066
  });
5921
6067
  let pluginM = this.lib.store.matchPlugin();
5922
6068
  let foundchatbox = false;
5923
- util/* default */.Z.each(pluginM, conf => {
6069
+ util/* default.each */.Z.each(pluginM, conf => {
5924
6070
  if (conf.type === 'chatbox') {
5925
6071
  if (foundchatbox) return;
5926
6072
  foundchatbox = true;
@@ -5930,12 +6076,12 @@ class PluginMgr {
5930
6076
  }
5931
6077
  findChatbox() {
5932
6078
  var pluginM = this.lib.store.matchPlugin();
5933
- let chatboxs = util/* default */.Z.filter(this.pluginM, (plugin, id) => pluginM[id].type === 'chatbox');
5934
- if (util/* default */.Z.size(chatboxs) === 0) {
6079
+ let chatboxs = util/* default.filter */.Z.filter(this.pluginM, (plugin, id) => pluginM[id].type === 'chatbox');
6080
+ if (util/* default.size */.Z.size(chatboxs) === 0) {
5935
6081
  console.error('no chatbox found.');
5936
6082
  return;
5937
6083
  }
5938
- let chatbox = util/* default */.Z.find(chatboxs, chatbox => chatbox.getState() === 'running');
6084
+ let chatbox = util/* default.find */.Z.find(chatboxs, chatbox => chatbox.getState() === 'running');
5939
6085
  if (!chatbox) {
5940
6086
  chatbox = chatboxs[0];
5941
6087
  }
@@ -5991,8 +6137,9 @@ class PluginMgr {
5991
6137
  chatbox.setLocale(locale);
5992
6138
  }
5993
6139
  destroy() {
5994
- util/* default */.Z.map(this.pluginM, (conf, id) => {
5995
- conf.destroy();
6140
+ util/* default.map */.Z.map(this.pluginM, (conf, id) => {
6141
+ if (this.pluginM[id]) return;
6142
+ this.pluginM[id].destroy();
5996
6143
  delete this.pluginM[id];
5997
6144
  });
5998
6145
  this._destroy = true;
@@ -6000,8 +6147,8 @@ class PluginMgr {
6000
6147
  }
6001
6148
  ;// CONCATENATED MODULE: ./src/lib.js
6002
6149
  function lib_defineProperty(obj, key, value) { key = lib_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6003
- function lib_toPropertyKey(t) { var i = lib_toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
6004
- function lib_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6150
+ function lib_toPropertyKey(arg) { var key = lib_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
6151
+ function lib_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6005
6152
 
6006
6153
 
6007
6154
 
@@ -6009,25 +6156,25 @@ var $link = document.createElement('link');
6009
6156
  $link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap';
6010
6157
  $link.rel = 'stylesheet';
6011
6158
  document.head.append($link);
6012
- util/* default */.Z.preloadWebfonts(['Inter'], [400, 500, 600]);
6159
+ util/* default.preloadWebfonts */.Z.preloadWebfonts(['Inter'], [400, 500, 600]);
6013
6160
  class Widget {
6014
6161
  constructor(ApiURL, FileURL, RealtimeURL, inmem, fake) {
6015
6162
  lib_defineProperty(this, "version", () => '4.5');
6016
6163
  lib_defineProperty(this, "setSetting", setting => this.store.setSetting({
6017
6164
  account_setting: setting
6018
6165
  }));
6019
- lib_defineProperty(this, "getUser", () => util/* default */.Z.parseJSON(util/* default */.Z.stringify(this.store.matchUser())));
6166
+ lib_defineProperty(this, "getUser", () => util/* default.parseJSON */.Z.parseJSON(util/* default.stringify */.Z.stringify(this.store.matchUser())));
6020
6167
  lib_defineProperty(this, "setViewingProduct", p => this.store.linkProduct(p));
6021
6168
  lib_defineProperty(this, "getViewingProduct", () => this.store.getLinkedProduct());
6022
6169
  lib_defineProperty(this, "track", () => this.store.track());
6023
6170
  this.impressionTokens = {};
6024
- this.domGate = new util/* default */.Z.Gate();
6171
+ this.domGate = new util/* default.Gate */.Z.Gate();
6025
6172
  this.store = new Store(ApiURL, FileURL, RealtimeURL, inmem, fake);
6026
6173
  window.sbz_store = this.store;
6027
6174
  this.subs = [];
6028
6175
  this.store.onConvoEvent({
6029
6176
  _isMounted: true
6030
- }, ev => util/* default */.Z.map(this.subs, sub => sub(ev)));
6177
+ }, ev => util/* default.map */.Z.map(this.subs, sub => sub(ev)));
6031
6178
  }
6032
6179
  async waitReady(cb) {
6033
6180
  await this.store.readyGate.entry();
@@ -6038,10 +6185,10 @@ class Widget {
6038
6185
  let user = await this.store.login(accid, user_id, tokenGenerator);
6039
6186
  if (!$container) $container = document.body;
6040
6187
  this.pluginMgr = new PluginMgr(this, $container);
6041
- let clean = util/* default */.Z.setInterval(() => {
6188
+ let clean = util/* default.setInterval */.Z.setInterval(() => {
6042
6189
  if ($container && $container.isConnected) return;
6043
6190
  this.pluginMgr.destroy();
6044
- util/* default */.Z.clearInterval(clean);
6191
+ util/* default.clearInterval */.Z.clearInterval(clean);
6045
6192
  }, 1000);
6046
6193
  this.domGate.open();
6047
6194
  return user;
@@ -6054,32 +6201,24 @@ class Widget {
6054
6201
  let accid = param.account_id;
6055
6202
  let ref = param.ref;
6056
6203
  let user = await this.store.init(accid, undefined, ref);
6057
- util/* default */.Z.setTimeout(() => window.postMessage({
6058
- type: 'widget_loaded',
6059
- account_id: accid
6060
- }, '*'), 0);
6061
6204
  if (!$container) $container = document.body || document;
6062
6205
  this.pluginMgr = new PluginMgr(this, $container);
6063
- let clean = util/* default */.Z.setInterval(() => {
6206
+ let clean = util/* default.setInterval */.Z.setInterval(() => {
6064
6207
  if ($container && $container.isConnected) return;
6065
6208
  this.pluginMgr.destroy();
6066
- util/* default */.Z.clearInterval(clean);
6209
+ util/* default.clearInterval */.Z.clearInterval(clean);
6067
6210
  }, 1000);
6068
6211
  this.domGate.open();
6069
6212
  return user;
6070
6213
  }
6071
6214
  async setAccount(id, $container, mask, cb) {
6072
6215
  let outmask = await this.store.init(id, mask);
6073
- util/* default */.Z.setTimeout(() => window.postMessage({
6074
- type: 'widget_loaded',
6075
- account_id: id
6076
- }, '*'), 0);
6077
6216
  if (!$container) $container = document.body || document;
6078
6217
  this.pluginMgr = new PluginMgr(this, $container);
6079
- let clean = util/* default */.Z.setInterval(() => {
6218
+ let clean = util/* default.setInterval */.Z.setInterval(() => {
6080
6219
  if ($container && $container.isConnected) return;
6081
6220
  this.pluginMgr.destroy();
6082
- util/* default */.Z.clearInterval(clean);
6221
+ util/* default.clearInterval */.Z.clearInterval(clean);
6083
6222
  }, 1000);
6084
6223
  this.domGate.open();
6085
6224
  cb && cb(outmask);
@@ -6093,12 +6232,12 @@ class Widget {
6093
6232
  attributes
6094
6233
  });
6095
6234
  var user = this.store.matchUser();
6096
- return util/* default */.Z.cloneDeep(user.attributes);
6235
+ return util/* default.cloneDeep */.Z.cloneDeep(user.attributes);
6097
6236
  }
6098
6237
  async getUserAttributes() {
6099
6238
  await this.store.readyGate.entry();
6100
6239
  var user = this.store.matchUser();
6101
- return util/* default */.Z.cloneDeep(util/* default */.Z.get(user, 'attributes', []));
6240
+ return util/* default.cloneDeep */.Z.cloneDeep(util/* default.get */.Z.get(user, 'attributes', []));
6102
6241
  }
6103
6242
  async getWidgetCurrentView() {
6104
6243
  await this.domGate.entry();
@@ -6129,40 +6268,40 @@ class Widget {
6129
6268
  });
6130
6269
  }
6131
6270
  async viewForm(formid) {
6132
- if (!formid || !util/* default */.Z.startsWith(formid, 'cp')) return;
6271
+ if (!formid || !util/* default.startsWith */.Z.startsWith(formid, 'cp')) return;
6133
6272
  let impressiontoken = this.impressionTokens[formid];
6134
6273
  if (impressiontoken) return impressiontoken;
6135
6274
  let {
6136
6275
  body: impression
6137
6276
  } = await this.store.sendImpression(formid);
6138
- impressiontoken = util/* default */.Z.get(impression, 'impression_token') || '';
6277
+ impressiontoken = util/* default.get */.Z.get(impression, 'impression_token') || '';
6139
6278
  this.impressionTokens[formid] = impressiontoken;
6140
6279
  return impressiontoken;
6141
6280
  }
6142
6281
  async submitForm(formid, values) {
6143
- if (!formid || !util/* default */.Z.startsWith(formid, 'cp')) return;
6144
- let storeuser = util/* default */.Z.cloneDeep(this.store.matchUser());
6282
+ if (!formid || !util/* default.startsWith */.Z.startsWith(formid, 'cp')) return;
6283
+ let storeuser = util/* default.cloneDeep */.Z.cloneDeep(this.store.matchUser());
6145
6284
  let user = {
6146
6285
  id: storeuser.id,
6147
6286
  account_id: storeuser.account_id
6148
6287
  };
6149
6288
  let is_lead = false;
6150
- values = util/* default */.Z.map(values, val => {
6289
+ values = util/* default.map */.Z.map(values, val => {
6151
6290
  let key = val.key;
6152
6291
  if (key === 'email') key = 'emails';
6153
6292
  if (key === 'phone') key = 'phones';
6154
6293
  is_lead = is_lead || key == 'emails' || key == 'phones';
6155
- util/* default */.Z.setUserAttr(user, {
6294
+ util/* default.setUserAttr */.Z.setUserAttr(user, {
6156
6295
  key: key,
6157
6296
  [val.type || 'text']: val.value
6158
6297
  });
6159
6298
  return {
6160
6299
  key: key,
6161
6300
  type: val.type || 'text',
6162
- value: util/* default */.Z.stringify(val.value)
6301
+ value: util/* default.stringify */.Z.stringify(val.value)
6163
6302
  };
6164
6303
  });
6165
- if (is_lead) util/* default */.Z.setUserAttr(user, {
6304
+ if (is_lead) util/* default.setUserAttr */.Z.setUserAttr(user, {
6166
6305
  key: 'lead_source',
6167
6306
  text: 'plugin.' + formid
6168
6307
  });
@@ -6207,10 +6346,6 @@ class Widget {
6207
6346
  _overrideDeviceType(type) {
6208
6347
  this.store.overrideDeviceType(type);
6209
6348
  }
6210
- unload() {
6211
- if (this.pluginMgr) this.pluginMgr.destroy();
6212
- this.store.destroy();
6213
- }
6214
6349
  _overridePlugin(plugins) {
6215
6350
  this.store.overridePlugin(plugins);
6216
6351
  }
@@ -6224,14 +6359,14 @@ class Widget {
6224
6359
  this.pluginMgr.forceRunPopup(pluginid);
6225
6360
  }
6226
6361
  unEvent(cb) {
6227
- this.subs = util/* default */.Z.filter(this.subs, sub => sub !== cb);
6362
+ this.subs = util/* default.filter */.Z.filter(this.subs, sub => sub !== cb);
6228
6363
  }
6229
6364
  async countUnreadMessages() {
6230
6365
  await this.domGate.entry();
6231
6366
  return this.store.matchUnread();
6232
6367
  }
6233
6368
  onEvent(cb) {
6234
- this.subs = util/* default */.Z.filter(this.subs, sub => sub !== cb);
6369
+ this.subs = util/* default.filter */.Z.filter(this.subs, sub => sub !== cb);
6235
6370
  this.subs.push(cb);
6236
6371
  }
6237
6372
  overrideAccount(acc) {
@@ -6239,7 +6374,7 @@ class Widget {
6239
6374
  }
6240
6375
  async overrideChatbox(chatbox) {
6241
6376
  await this.store.overrideChatbox(chatbox);
6242
- if (util/* default */.Z.get(chatbox, 'chatbox.greeting.greeting')) {
6377
+ if (util/* default.get */.Z.get(chatbox, 'chatbox.greeting.greeting')) {
6243
6378
  this.pluginMgr.showCurrentGreeting();
6244
6379
  }
6245
6380
  }