@bigbinary/neeto-commons-frontend 2.0.38 → 2.0.40

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.
@@ -7,20 +7,21 @@ var neetoui = require('@bigbinary/neetoui');
7
7
  var i18next = require('i18next');
8
8
  var ramda = require('ramda');
9
9
  var reactI18next = require('react-i18next');
10
+ var pure$1 = require('@bigbinary/neeto-commons-frontend/pure');
10
11
  var neetoIcons = require('@bigbinary/neeto-icons');
11
12
  var layouts = require('@bigbinary/neetoui/layouts');
12
13
  var formik$1 = require('@bigbinary/neetoui/formik');
13
14
  var formik = require('formik');
14
15
  var yup = require('yup');
15
- var require$$0$2 = require('util');
16
- var dayjs = require('dayjs');
17
- var relativeTime = require('dayjs/plugin/relativeTime');
18
- var updateLocale = require('dayjs/plugin/updateLocale');
16
+ var utils = require('@bigbinary/neeto-commons-frontend/utils');
19
17
  var reactQuery = require('react-query');
20
18
  var axios$1 = require('axios');
21
19
  var react = require('@honeybadger-io/react');
22
20
  var managers = require('@bigbinary/neetoui/managers');
23
21
  var reactRouterDom = require('react-router-dom');
22
+ var dayjs = require('dayjs');
23
+ var relativeTime = require('dayjs/plugin/relativeTime');
24
+ var updateLocale = require('dayjs/plugin/updateLocale');
24
25
  var customParseFormat = require('dayjs/plugin/customParseFormat');
25
26
  var timezone = require('dayjs/plugin/timezone');
26
27
  var utc = require('dayjs/plugin/utc');
@@ -68,11 +69,10 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
68
69
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
69
70
  var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
70
71
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
71
- var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
72
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios$1);
72
73
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
73
74
  var relativeTime__default = /*#__PURE__*/_interopDefaultLegacy(relativeTime);
74
75
  var updateLocale__default = /*#__PURE__*/_interopDefaultLegacy(updateLocale);
75
- var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios$1);
76
76
  var customParseFormat__default = /*#__PURE__*/_interopDefaultLegacy(customParseFormat);
77
77
  var timezone__default = /*#__PURE__*/_interopDefaultLegacy(timezone);
78
78
  var utc__default = /*#__PURE__*/_interopDefaultLegacy(utc);
@@ -1553,6 +1553,28 @@ function _extends$4() {
1553
1553
  return _extends$4.apply(this, arguments);
1554
1554
  }
1555
1555
 
1556
+ var getStorageValue = function getStorageValue(key, defaultValue) {
1557
+ if (key in localStorage) return JSON.parse(localStorage.getItem(key));
1558
+ return defaultValue;
1559
+ };
1560
+ var useLocalStorage = function useLocalStorage(key, defaultValue) {
1561
+ var _useState = React.useState(function () {
1562
+ return getStorageValue(key, defaultValue);
1563
+ }),
1564
+ _useState2 = _slicedToArray(_useState, 2),
1565
+ storedValue = _useState2[0],
1566
+ setStoredValue = _useState2[1];
1567
+ var setValue = function setValue(value) {
1568
+ if (ramda.isNil(value)) {
1569
+ localStorage.removeItem(key);
1570
+ } else {
1571
+ localStorage.setItem(key, JSON.stringify(value));
1572
+ }
1573
+ setStoredValue(value);
1574
+ };
1575
+ return [storedValue, setValue];
1576
+ };
1577
+
1556
1578
  function _typeof$1(obj) {
1557
1579
  "@babel/helpers - typeof";
1558
1580
 
@@ -1578,33 +1600,13 @@ var nullSafe = function nullSafe(func) {
1578
1600
  })
1579
1601
  );
1580
1602
  };
1581
- var noop$2 = function noop() {};
1582
1603
  var toLabelAndValue = function toLabelAndValue(string) {
1583
1604
  return {
1584
1605
  label: string,
1585
1606
  value: string
1586
1607
  };
1587
1608
  };
1588
- var isNotEmpty = /*#__PURE__*/ramda.complement(ramda.isEmpty);
1589
1609
  var isNotPresent = /*#__PURE__*/ramda.either(ramda.isNil, ramda.isEmpty);
1590
- var isPresent = /*#__PURE__*/ramda.complement(isNotPresent);
1591
-
1592
- var slugify = function slugify(string) {
1593
- return string.toString().toLowerCase().replace(/\s+/g, "-") // Replace spaces with -
1594
- .replace(/&/g, "-and-") // Replace & with 'and'
1595
- .replace(/[^\w-]+/g, "") // Remove all non-word characters
1596
- .replace(/--+/g, "-") // Replace multiple - with single -
1597
- .replace(/^-+/, "") // Trim - from start of text
1598
- .replace(/-+$/, "");
1599
- }; // Trim - from end of text
1600
- var snakeToCamelCase = function snakeToCamelCase(string) {
1601
- return string.replace(/(_\w)/g, function (letter) {
1602
- return letter[1].toUpperCase();
1603
- });
1604
- };
1605
- var capitalize = function capitalize(string) {
1606
- return string.charAt(0).toUpperCase() + string.slice(1);
1607
- };
1608
1610
 
1609
1611
  var matchesImpl = function matchesImpl(pattern, object) {
1610
1612
  var __parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : object;
@@ -1619,32 +1621,6 @@ var matchesImpl = function matchesImpl(pattern, object) {
1619
1621
  return matchesImpl(value, object[key], __parent);
1620
1622
  });
1621
1623
  };
1622
- var transformObjectDeep = function transformObjectDeep(object, keyValueTransformer) {
1623
- var objectPreProcessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
1624
- if (objectPreProcessor && typeof objectPreProcessor === "function") {
1625
- object = objectPreProcessor(object);
1626
- }
1627
- if (Array.isArray(object)) {
1628
- return object.map(function (obj) {
1629
- return transformObjectDeep(obj, keyValueTransformer, objectPreProcessor);
1630
- });
1631
- } else if (object === null || _typeof$1(object) !== "object") {
1632
- return object;
1633
- }
1634
- return Object.fromEntries(Object.entries(object).map(function (_ref3) {
1635
- var _ref4 = _slicedToArray(_ref3, 2),
1636
- key = _ref4[0],
1637
- value = _ref4[1];
1638
- return keyValueTransformer(key, transformObjectDeep(value, keyValueTransformer, objectPreProcessor));
1639
- }));
1640
- };
1641
- var preprocessForSerialization = function preprocessForSerialization(object) {
1642
- return transformObjectDeep(object, function (key, value) {
1643
- return [key, value];
1644
- }, function (object) {
1645
- return typeof (object === null || object === void 0 ? void 0 : object.toJSON) === "function" ? object.toJSON() : object;
1646
- });
1647
- };
1648
1624
  var matches = /*#__PURE__*/ramda.curry(function (pattern, object) {
1649
1625
  return matchesImpl(pattern, object);
1650
1626
  });
@@ -1696,31 +1672,6 @@ function _defineProperty(obj, key, value) {
1696
1672
  var removeBy = /*#__PURE__*/ramda.curry(function (pattern, array) {
1697
1673
  return array.filter(ramda.complement(matches(pattern)));
1698
1674
  });
1699
- var findIndexBy = /*#__PURE__*/ramda.curry(function (pattern, array) {
1700
- return array.findIndex(matches(pattern));
1701
- });
1702
-
1703
- var getStorageValue = function getStorageValue(key, defaultValue) {
1704
- var saved = localStorage.getItem(key);
1705
- return JSON.parse(saved) || defaultValue;
1706
- };
1707
- var useLocalStorage = function useLocalStorage(key, defaultValue) {
1708
- var _useState = React.useState(function () {
1709
- return getStorageValue(key, defaultValue);
1710
- }),
1711
- _useState2 = _slicedToArray(_useState, 2),
1712
- storedValue = _useState2[0],
1713
- setStoredValue = _useState2[1];
1714
- var setValue = function setValue(value) {
1715
- if (ramda.isNil(value)) {
1716
- localStorage.removeItem(key);
1717
- } else {
1718
- localStorage.setItem(key, JSON.stringify(value));
1719
- }
1720
- setStoredValue(value);
1721
- };
1722
- return [storedValue, setValue];
1723
- };
1724
1675
 
1725
1676
  var removeFixedColumns = function removeFixedColumns(fixedColumns, columnData) {
1726
1677
  return removeBy({
@@ -1778,7 +1729,7 @@ var Columns = function Columns(_ref) {
1778
1729
  return setSearchTerm(value);
1779
1730
  };
1780
1731
  React.useEffect(function () {
1781
- onChange(removeBy({
1732
+ onChange(pure$1.removeBy({
1782
1733
  dataIndex: ramda.includes(ramda.__, hiddenColumns)
1783
1734
  }, columnData));
1784
1735
  }, [columnData, hiddenColumns]);
@@ -1799,7 +1750,7 @@ var Columns = function Columns(_ref) {
1799
1750
  type: "search",
1800
1751
  value: searchTerm,
1801
1752
  onChange: handleSearch
1802
- }, searchProps)), isNotEmpty(filteredColumns) ? filteredColumns.map(function (_ref4) {
1753
+ }, searchProps)), pure$1.isNotEmpty(filteredColumns) ? filteredColumns.map(function (_ref4) {
1803
1754
  var dataIndex = _ref4.dataIndex,
1804
1755
  key = _ref4.key,
1805
1756
  title = _ref4.title;
@@ -3344,2835 +3295,426 @@ var mousetrap = {exports: {}};
3344
3295
  * of binding an empty function
3345
3296
  *
3346
3297
  * the keycombo+action has to be exactly the same as
3347
- * it was defined in the bind method
3348
- *
3349
- * @param {string|Array} keys
3350
- * @param {string} action
3351
- * @returns void
3352
- */
3353
- Mousetrap.prototype.unbind = function(keys, action) {
3354
- var self = this;
3355
- return self.bind.call(self, keys, function() {}, action);
3356
- };
3357
-
3358
- /**
3359
- * triggers an event that has already been bound
3360
- *
3361
- * @param {string} keys
3362
- * @param {string=} action
3363
- * @returns void
3364
- */
3365
- Mousetrap.prototype.trigger = function(keys, action) {
3366
- var self = this;
3367
- if (self._directMap[keys + ':' + action]) {
3368
- self._directMap[keys + ':' + action]({}, keys);
3369
- }
3370
- return self;
3371
- };
3372
-
3373
- /**
3374
- * resets the library back to its initial state. this is useful
3375
- * if you want to clear out the current keyboard shortcuts and bind
3376
- * new ones - for example if you switch to another page
3377
- *
3378
- * @returns void
3379
- */
3380
- Mousetrap.prototype.reset = function() {
3381
- var self = this;
3382
- self._callbacks = {};
3383
- self._directMap = {};
3384
- return self;
3385
- };
3386
-
3387
- /**
3388
- * should we stop this event before firing off callbacks
3389
- *
3390
- * @param {Event} e
3391
- * @param {Element} element
3392
- * @return {boolean}
3393
- */
3394
- Mousetrap.prototype.stopCallback = function(e, element) {
3395
- var self = this;
3396
-
3397
- // if the element has the class "mousetrap" then no need to stop
3398
- if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
3399
- return false;
3400
- }
3401
-
3402
- if (_belongsTo(element, self.target)) {
3403
- return false;
3404
- }
3405
-
3406
- // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
3407
- // not the initial event target in the shadow tree. Note that not all events cross the
3408
- // shadow boundary.
3409
- // For shadow trees with `mode: 'open'`, the initial event target is the first element in
3410
- // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
3411
- // target cannot be obtained.
3412
- if ('composedPath' in e && typeof e.composedPath === 'function') {
3413
- // For open shadow trees, update `element` so that the following check works.
3414
- var initialEventTarget = e.composedPath()[0];
3415
- if (initialEventTarget !== e.target) {
3416
- element = initialEventTarget;
3417
- }
3418
- }
3419
-
3420
- // stop for input, select, and textarea
3421
- return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
3422
- };
3423
-
3424
- /**
3425
- * exposes _handleKey publicly so it can be overwritten by extensions
3426
- */
3427
- Mousetrap.prototype.handleKey = function() {
3428
- var self = this;
3429
- return self._handleKey.apply(self, arguments);
3430
- };
3431
-
3432
- /**
3433
- * allow custom key mappings
3434
- */
3435
- Mousetrap.addKeycodes = function(object) {
3436
- for (var key in object) {
3437
- if (object.hasOwnProperty(key)) {
3438
- _MAP[key] = object[key];
3439
- }
3440
- }
3441
- _REVERSE_MAP = null;
3442
- };
3443
-
3444
- /**
3445
- * Init the global mousetrap functions
3446
- *
3447
- * This method is needed to allow the global mousetrap functions to work
3448
- * now that mousetrap is a constructor function.
3449
- */
3450
- Mousetrap.init = function() {
3451
- var documentMousetrap = Mousetrap(document);
3452
- for (var method in documentMousetrap) {
3453
- if (method.charAt(0) !== '_') {
3454
- Mousetrap[method] = (function(method) {
3455
- return function() {
3456
- return documentMousetrap[method].apply(documentMousetrap, arguments);
3457
- };
3458
- } (method));
3459
- }
3460
- }
3461
- };
3462
-
3463
- Mousetrap.init();
3464
-
3465
- // expose mousetrap to the global object
3466
- window.Mousetrap = Mousetrap;
3467
-
3468
- // expose as a common js module
3469
- if (module.exports) {
3470
- module.exports = Mousetrap;
3471
- }
3472
-
3473
- // expose mousetrap as an AMD module
3474
- if (typeof undefined$1 === 'function' && undefined$1.amd) {
3475
- undefined$1(function() {
3476
- return Mousetrap;
3477
- });
3478
- }
3479
- }) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
3480
- } (mousetrap));
3481
-
3482
- var Mousetrap$1 = mousetrap.exports;
3483
-
3484
- /**
3485
- * adds a bindGlobal method to Mousetrap that allows you to
3486
- * bind specific keyboard shortcuts that will still work
3487
- * inside a text input field
3488
- *
3489
- * usage:
3490
- * Mousetrap.bindGlobal('ctrl+s', _saveChanges);
3491
- */
3492
- /* global Mousetrap:true */
3493
- (function(Mousetrap) {
3494
- var _globalCallbacks = {};
3495
- var _originalStopCallback = Mousetrap.prototype.stopCallback;
3496
-
3497
- Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
3498
- var self = this;
3499
-
3500
- if (self.paused) {
3501
- return true;
3502
- }
3503
-
3504
- if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
3505
- return false;
3506
- }
3507
-
3508
- return _originalStopCallback.call(self, e, element, combo);
3509
- };
3510
-
3511
- Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
3512
- var self = this;
3513
- self.bind(keys, callback, action);
3514
-
3515
- if (keys instanceof Array) {
3516
- for (var i = 0; i < keys.length; i++) {
3517
- _globalCallbacks[keys[i]] = true;
3518
- }
3519
- return;
3520
- }
3521
-
3522
- _globalCallbacks[keys] = true;
3523
- };
3524
-
3525
- Mousetrap.prototype.unbindGlobal = function(keys, action) {
3526
- var self = this;
3527
- self.unbind(keys, action);
3528
-
3529
- if (keys instanceof Array) {
3530
- for (var i = 0; i < keys.length; i++) {
3531
- _globalCallbacks[keys[i]] = false;
3532
- }
3533
- return;
3534
- }
3535
-
3536
- _globalCallbacks[keys] = false;
3537
- };
3538
-
3539
- Mousetrap.init();
3540
- }) (Mousetrap);
3541
-
3542
- var MAC_TO_WINDOWS_KEYS_MAP = {
3543
- option: "alt",
3544
- command: "ctrl",
3545
- "return": "enter",
3546
- "delete": "backspace"
3547
- };
3548
- var OS = {
3549
- mac: "OS X",
3550
- windows: "Windows"
3551
- };
3552
-
3553
- var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
3554
- var _platformInfo$os, _platformInfo$os$fami;
3555
- var platformInfo = platform.parse(navigator.userAgent);
3556
- var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
3557
- if (isOSX) return hotkey;
3558
- var hotkeyForWindows = hotkey;
3559
- ramda.toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
3560
- var _ref2 = _slicedToArray(_ref, 2),
3561
- macKey = _ref2[0],
3562
- windowsKey = _ref2[1];
3563
- hotkeyForWindows = hotkeyForWindows.replaceAll(macKey, windowsKey);
3564
- });
3565
- return hotkeyForWindows;
3566
- };
3567
-
3568
- var MODES$1 = {
3569
- "default": "default",
3570
- global: "global",
3571
- scoped: "scoped"
3572
- };
3573
- var DEFAULT_CONFIG = {
3574
- mode: MODES$1["default"],
3575
- unbindOnUnmount: true
3576
- };
3577
-
3578
- var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
3579
- var ref = React.useRef(null);
3580
- var convertedHotkey = convertHotkeyToUsersPlatform(hotkey);
3581
- var config = ramda.mergeLeft(userConfig, DEFAULT_CONFIG);
3582
- React.useEffect(function () {
3583
- bindHotKey({
3584
- mode: config.mode,
3585
- hotkey: convertedHotkey,
3586
- handler: handler,
3587
- ref: ref
3588
- });
3589
- return function () {
3590
- config.unbindOnUnmount && unBindHotKey(config.mode, convertedHotkey);
3591
- };
3592
- }, [handler, config.mode, convertedHotkey, config]);
3593
- return config.mode === MODES$1.scoped ? ref : null;
3594
- };
3595
- var bindHotKey = function bindHotKey(_ref) {
3596
- var mode = _ref.mode,
3597
- hotkey = _ref.hotkey,
3598
- handler = _ref.handler,
3599
- ref = _ref.ref;
3600
- switch (mode) {
3601
- case MODES$1.global:
3602
- Mousetrap$1.bindGlobal(hotkey, handler);
3603
- break;
3604
- case MODES$1.scoped:
3605
- Mousetrap$1(ref.current).bind(hotkey, handler);
3606
- break;
3607
- default:
3608
- Mousetrap$1.bind(hotkey, handler);
3609
- }
3610
- };
3611
- var unBindHotKey = function unBindHotKey(mode, hotkey) {
3612
- return mode === MODES$1.global ? Mousetrap$1.unbindGlobal(hotkey) : Mousetrap$1.unbind(hotkey);
3613
- };
3614
-
3615
- var useForceUpdate = function useForceUpdate() {
3616
- // eslint-disable-next-line react/hook-use-state
3617
- var _useState = React.useState(0),
3618
- _useState2 = _slicedToArray(_useState, 2),
3619
- setValue = _useState2[1];
3620
- return function () {
3621
- return setValue(function (value) {
3622
- return value + 1;
3623
- });
3624
- };
3625
- };
3626
-
3627
- var useIsElementVisibleInDom = function useIsElementVisibleInDom(target) {
3628
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
3629
- var _useState = React.useState(false),
3630
- _useState2 = _slicedToArray(_useState, 2),
3631
- isIntersecting = _useState2[0],
3632
- setIsIntersecting = _useState2[1];
3633
- var forceUpdate = useForceUpdate();
3634
- React.useEffect(function () {
3635
- if (!target) return forceUpdate();
3636
- var observer = new IntersectionObserver(function (_ref) {
3637
- var _ref2 = _slicedToArray(_ref, 1),
3638
- entry = _ref2[0];
3639
- return setIsIntersecting(entry.isIntersecting);
3640
- }, options);
3641
- observer.observe(target);
3642
- return function () {
3643
- return observer.unobserve(target);
3644
- };
3645
- }, [target, options]);
3646
- return isIntersecting;
3647
- };
3648
-
3649
- var useOnClickOutside = function useOnClickOutside(ref, handler) {
3650
- React.useEffect(function () {
3651
- var listener = function listener(event) {
3652
- // Do nothing if clicking ref's element or descendent elements
3653
- if (!ref.current || ref.current.contains(event.target)) {
3654
- return;
3655
- }
3656
- handler(event);
3657
- };
3658
- document.addEventListener("mousedown", listener);
3659
- document.addEventListener("touchstart", listener);
3660
- return function () {
3661
- document.removeEventListener("mousedown", listener);
3662
- document.removeEventListener("touchstart", listener);
3663
- };
3664
- }, [handler]);
3665
- };
3666
-
3667
- var usePrevious = function usePrevious(value) {
3668
- var ref = React.useRef(value);
3669
- React.useEffect(function () {
3670
- ref.current = value;
3671
- }, [value]);
3672
- return ref.current;
3673
- };
3674
-
3675
- var useUpdateEffect = function useUpdateEffect(callback) {
3676
- var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3677
- var isInitialMount = React.useRef(true);
3678
- React.useEffect(function () {
3679
- if (isInitialMount.current) {
3680
- isInitialMount.current = false;
3681
- return;
3682
- }
3683
- callback();
3684
- }, dependencies);
3685
- };
3686
-
3687
- var DEFAULT_STALE_TIME = 60 * 60 * 1000;
3688
- var DOMAIN_QUERY_KEY = "custom-domain";
3689
- var ENTITY_COUNT = {
3690
- singular: 1,
3691
- plural: 2
3692
- };
3693
-
3694
- var HOSTNAME_REGEX = /^(?!-)[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+/;
3695
- var INITIAL_VALUES$1 = {
3696
- hostname: ""
3697
- };
3698
- var CUSTOM_DOMAIN_VALIDATION_SCHEMA = yup__namespace.object().shape({
3699
- hostname: yup__namespace.string().required(i18next.t("neetoCommons.customDomain.formikValidation.required")).matches(HOSTNAME_REGEX, i18next.t("neetoCommons.customDomain.formikValidation.valid"))
3700
- });
3701
-
3702
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
3703
- try {
3704
- var info = gen[key](arg);
3705
- var value = info.value;
3706
- } catch (error) {
3707
- reject(error);
3708
- return;
3709
- }
3710
- if (info.done) {
3711
- resolve(value);
3712
- } else {
3713
- Promise.resolve(value).then(_next, _throw);
3714
- }
3715
- }
3716
- function _asyncToGenerator(fn) {
3717
- return function () {
3718
- var self = this,
3719
- args = arguments;
3720
- return new Promise(function (resolve, reject) {
3721
- var gen = fn.apply(self, args);
3722
- function _next(value) {
3723
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
3724
- }
3725
- function _throw(err) {
3726
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
3727
- }
3728
- _next(undefined);
3729
- });
3730
- };
3731
- }
3732
-
3733
- var regeneratorRuntime$1 = {exports: {}};
3734
-
3735
- var _typeof = {exports: {}};
3736
-
3737
- (function (module) {
3738
- function _typeof(obj) {
3739
- "@babel/helpers - typeof";
3740
-
3741
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
3742
- return typeof obj;
3743
- } : function (obj) {
3744
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
3745
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
3746
- }
3747
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
3748
- } (_typeof));
3749
-
3750
- (function (module) {
3751
- var _typeof$1 = _typeof.exports["default"];
3752
- function _regeneratorRuntime() {
3753
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
3754
- return exports;
3755
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
3756
- var exports = {},
3757
- Op = Object.prototype,
3758
- hasOwn = Op.hasOwnProperty,
3759
- defineProperty = Object.defineProperty || function (obj, key, desc) {
3760
- obj[key] = desc.value;
3761
- },
3762
- $Symbol = "function" == typeof Symbol ? Symbol : {},
3763
- iteratorSymbol = $Symbol.iterator || "@@iterator",
3764
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
3765
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
3766
- function define(obj, key, value) {
3767
- return Object.defineProperty(obj, key, {
3768
- value: value,
3769
- enumerable: !0,
3770
- configurable: !0,
3771
- writable: !0
3772
- }), obj[key];
3773
- }
3774
- try {
3775
- define({}, "");
3776
- } catch (err) {
3777
- define = function define(obj, key, value) {
3778
- return obj[key] = value;
3779
- };
3780
- }
3781
- function wrap(innerFn, outerFn, self, tryLocsList) {
3782
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
3783
- generator = Object.create(protoGenerator.prototype),
3784
- context = new Context(tryLocsList || []);
3785
- return defineProperty(generator, "_invoke", {
3786
- value: makeInvokeMethod(innerFn, self, context)
3787
- }), generator;
3788
- }
3789
- function tryCatch(fn, obj, arg) {
3790
- try {
3791
- return {
3792
- type: "normal",
3793
- arg: fn.call(obj, arg)
3794
- };
3795
- } catch (err) {
3796
- return {
3797
- type: "throw",
3798
- arg: err
3799
- };
3800
- }
3801
- }
3802
- exports.wrap = wrap;
3803
- var ContinueSentinel = {};
3804
- function Generator() {}
3805
- function GeneratorFunction() {}
3806
- function GeneratorFunctionPrototype() {}
3807
- var IteratorPrototype = {};
3808
- define(IteratorPrototype, iteratorSymbol, function () {
3809
- return this;
3810
- });
3811
- var getProto = Object.getPrototypeOf,
3812
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
3813
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
3814
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
3815
- function defineIteratorMethods(prototype) {
3816
- ["next", "throw", "return"].forEach(function (method) {
3817
- define(prototype, method, function (arg) {
3818
- return this._invoke(method, arg);
3819
- });
3820
- });
3821
- }
3822
- function AsyncIterator(generator, PromiseImpl) {
3823
- function invoke(method, arg, resolve, reject) {
3824
- var record = tryCatch(generator[method], generator, arg);
3825
- if ("throw" !== record.type) {
3826
- var result = record.arg,
3827
- value = result.value;
3828
- return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
3829
- invoke("next", value, resolve, reject);
3830
- }, function (err) {
3831
- invoke("throw", err, resolve, reject);
3832
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
3833
- result.value = unwrapped, resolve(result);
3834
- }, function (error) {
3835
- return invoke("throw", error, resolve, reject);
3836
- });
3837
- }
3838
- reject(record.arg);
3839
- }
3840
- var previousPromise;
3841
- defineProperty(this, "_invoke", {
3842
- value: function value(method, arg) {
3843
- function callInvokeWithMethodAndArg() {
3844
- return new PromiseImpl(function (resolve, reject) {
3845
- invoke(method, arg, resolve, reject);
3846
- });
3847
- }
3848
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
3849
- }
3850
- });
3851
- }
3852
- function makeInvokeMethod(innerFn, self, context) {
3853
- var state = "suspendedStart";
3854
- return function (method, arg) {
3855
- if ("executing" === state) throw new Error("Generator is already running");
3856
- if ("completed" === state) {
3857
- if ("throw" === method) throw arg;
3858
- return doneResult();
3859
- }
3860
- for (context.method = method, context.arg = arg;;) {
3861
- var delegate = context.delegate;
3862
- if (delegate) {
3863
- var delegateResult = maybeInvokeDelegate(delegate, context);
3864
- if (delegateResult) {
3865
- if (delegateResult === ContinueSentinel) continue;
3866
- return delegateResult;
3867
- }
3868
- }
3869
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
3870
- if ("suspendedStart" === state) throw state = "completed", context.arg;
3871
- context.dispatchException(context.arg);
3872
- } else "return" === context.method && context.abrupt("return", context.arg);
3873
- state = "executing";
3874
- var record = tryCatch(innerFn, self, context);
3875
- if ("normal" === record.type) {
3876
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
3877
- return {
3878
- value: record.arg,
3879
- done: context.done
3880
- };
3881
- }
3882
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
3883
- }
3884
- };
3885
- }
3886
- function maybeInvokeDelegate(delegate, context) {
3887
- var methodName = context.method,
3888
- method = delegate.iterator[methodName];
3889
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
3890
- var record = tryCatch(method, delegate.iterator, context.arg);
3891
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
3892
- var info = record.arg;
3893
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
3894
- }
3895
- function pushTryEntry(locs) {
3896
- var entry = {
3897
- tryLoc: locs[0]
3898
- };
3899
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
3900
- }
3901
- function resetTryEntry(entry) {
3902
- var record = entry.completion || {};
3903
- record.type = "normal", delete record.arg, entry.completion = record;
3904
- }
3905
- function Context(tryLocsList) {
3906
- this.tryEntries = [{
3907
- tryLoc: "root"
3908
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
3909
- }
3910
- function values(iterable) {
3911
- if (iterable) {
3912
- var iteratorMethod = iterable[iteratorSymbol];
3913
- if (iteratorMethod) return iteratorMethod.call(iterable);
3914
- if ("function" == typeof iterable.next) return iterable;
3915
- if (!isNaN(iterable.length)) {
3916
- var i = -1,
3917
- next = function next() {
3918
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
3919
- return next.value = undefined, next.done = !0, next;
3920
- };
3921
- return next.next = next;
3922
- }
3923
- }
3924
- return {
3925
- next: doneResult
3926
- };
3927
- }
3928
- function doneResult() {
3929
- return {
3930
- value: undefined,
3931
- done: !0
3932
- };
3933
- }
3934
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
3935
- value: GeneratorFunctionPrototype,
3936
- configurable: !0
3937
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
3938
- value: GeneratorFunction,
3939
- configurable: !0
3940
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
3941
- var ctor = "function" == typeof genFun && genFun.constructor;
3942
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
3943
- }, exports.mark = function (genFun) {
3944
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
3945
- }, exports.awrap = function (arg) {
3946
- return {
3947
- __await: arg
3948
- };
3949
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
3950
- return this;
3951
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
3952
- void 0 === PromiseImpl && (PromiseImpl = Promise);
3953
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
3954
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
3955
- return result.done ? result.value : iter.next();
3956
- });
3957
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
3958
- return this;
3959
- }), define(Gp, "toString", function () {
3960
- return "[object Generator]";
3961
- }), exports.keys = function (val) {
3962
- var object = Object(val),
3963
- keys = [];
3964
- for (var key in object) keys.push(key);
3965
- return keys.reverse(), function next() {
3966
- for (; keys.length;) {
3967
- var key = keys.pop();
3968
- if (key in object) return next.value = key, next.done = !1, next;
3969
- }
3970
- return next.done = !0, next;
3971
- };
3972
- }, exports.values = values, Context.prototype = {
3973
- constructor: Context,
3974
- reset: function reset(skipTempReset) {
3975
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
3976
- },
3977
- stop: function stop() {
3978
- this.done = !0;
3979
- var rootRecord = this.tryEntries[0].completion;
3980
- if ("throw" === rootRecord.type) throw rootRecord.arg;
3981
- return this.rval;
3982
- },
3983
- dispatchException: function dispatchException(exception) {
3984
- if (this.done) throw exception;
3985
- var context = this;
3986
- function handle(loc, caught) {
3987
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
3988
- }
3989
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3990
- var entry = this.tryEntries[i],
3991
- record = entry.completion;
3992
- if ("root" === entry.tryLoc) return handle("end");
3993
- if (entry.tryLoc <= this.prev) {
3994
- var hasCatch = hasOwn.call(entry, "catchLoc"),
3995
- hasFinally = hasOwn.call(entry, "finallyLoc");
3996
- if (hasCatch && hasFinally) {
3997
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
3998
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
3999
- } else if (hasCatch) {
4000
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
4001
- } else {
4002
- if (!hasFinally) throw new Error("try statement without catch or finally");
4003
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
4004
- }
4005
- }
4006
- }
4007
- },
4008
- abrupt: function abrupt(type, arg) {
4009
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4010
- var entry = this.tryEntries[i];
4011
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
4012
- var finallyEntry = entry;
4013
- break;
4014
- }
4015
- }
4016
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
4017
- var record = finallyEntry ? finallyEntry.completion : {};
4018
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
4019
- },
4020
- complete: function complete(record, afterLoc) {
4021
- if ("throw" === record.type) throw record.arg;
4022
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
4023
- },
4024
- finish: function finish(finallyLoc) {
4025
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4026
- var entry = this.tryEntries[i];
4027
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
4028
- }
4029
- },
4030
- "catch": function _catch(tryLoc) {
4031
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4032
- var entry = this.tryEntries[i];
4033
- if (entry.tryLoc === tryLoc) {
4034
- var record = entry.completion;
4035
- if ("throw" === record.type) {
4036
- var thrown = record.arg;
4037
- resetTryEntry(entry);
4038
- }
4039
- return thrown;
4040
- }
4041
- }
4042
- throw new Error("illegal catch attempt");
4043
- },
4044
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
4045
- return this.delegate = {
4046
- iterator: values(iterable),
4047
- resultName: resultName,
4048
- nextLoc: nextLoc
4049
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
4050
- }
4051
- }, exports;
4052
- }
4053
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
4054
- } (regeneratorRuntime$1));
4055
-
4056
- // TODO(Babel 8): Remove this file.
4057
-
4058
- var runtime = regeneratorRuntime$1.exports();
4059
- var regenerator = runtime;
4060
-
4061
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
4062
- try {
4063
- regeneratorRuntime = runtime;
4064
- } catch (accidentalStrictMode) {
4065
- if (typeof globalThis === "object") {
4066
- globalThis.regeneratorRuntime = runtime;
4067
- } else {
4068
- Function("r", "regeneratorRuntime = r")(runtime);
4069
- }
4070
- }
4071
-
4072
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
4073
- var shams = function hasSymbols() {
4074
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
4075
- if (typeof Symbol.iterator === 'symbol') { return true; }
4076
-
4077
- var obj = {};
4078
- var sym = Symbol('test');
4079
- var symObj = Object(sym);
4080
- if (typeof sym === 'string') { return false; }
4081
-
4082
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
4083
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
4084
-
4085
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
4086
- // if (sym instanceof Symbol) { return false; }
4087
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
4088
- // if (!(symObj instanceof Symbol)) { return false; }
4089
-
4090
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
4091
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
4092
-
4093
- var symVal = 42;
4094
- obj[sym] = symVal;
4095
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
4096
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
4097
-
4098
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
4099
-
4100
- var syms = Object.getOwnPropertySymbols(obj);
4101
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
4102
-
4103
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
4104
-
4105
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
4106
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
4107
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
4108
- }
4109
-
4110
- return true;
4111
- };
4112
-
4113
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
4114
- var hasSymbolSham = shams;
4115
-
4116
- var hasSymbols$1 = function hasNativeSymbols() {
4117
- if (typeof origSymbol !== 'function') { return false; }
4118
- if (typeof Symbol !== 'function') { return false; }
4119
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
4120
- if (typeof Symbol('bar') !== 'symbol') { return false; }
4121
-
4122
- return hasSymbolSham();
4123
- };
4124
-
4125
- /* eslint no-invalid-this: 1 */
4126
-
4127
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
4128
- var slice = Array.prototype.slice;
4129
- var toStr$1 = Object.prototype.toString;
4130
- var funcType = '[object Function]';
4131
-
4132
- var implementation$1 = function bind(that) {
4133
- var target = this;
4134
- if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
4135
- throw new TypeError(ERROR_MESSAGE + target);
4136
- }
4137
- var args = slice.call(arguments, 1);
4138
-
4139
- var bound;
4140
- var binder = function () {
4141
- if (this instanceof bound) {
4142
- var result = target.apply(
4143
- this,
4144
- args.concat(slice.call(arguments))
4145
- );
4146
- if (Object(result) === result) {
4147
- return result;
4148
- }
4149
- return this;
4150
- } else {
4151
- return target.apply(
4152
- that,
4153
- args.concat(slice.call(arguments))
4154
- );
4155
- }
4156
- };
4157
-
4158
- var boundLength = Math.max(0, target.length - args.length);
4159
- var boundArgs = [];
4160
- for (var i = 0; i < boundLength; i++) {
4161
- boundArgs.push('$' + i);
4162
- }
4163
-
4164
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
4165
-
4166
- if (target.prototype) {
4167
- var Empty = function Empty() {};
4168
- Empty.prototype = target.prototype;
4169
- bound.prototype = new Empty();
4170
- Empty.prototype = null;
4171
- }
4172
-
4173
- return bound;
4174
- };
4175
-
4176
- var implementation = implementation$1;
4177
-
4178
- var functionBind = Function.prototype.bind || implementation;
4179
-
4180
- var bind$1 = functionBind;
4181
-
4182
- var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
4183
-
4184
- var undefined$1;
4185
-
4186
- var $SyntaxError = SyntaxError;
4187
- var $Function = Function;
4188
- var $TypeError$1 = TypeError;
4189
-
4190
- // eslint-disable-next-line consistent-return
4191
- var getEvalledConstructor = function (expressionSyntax) {
4192
- try {
4193
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
4194
- } catch (e) {}
4195
- };
4196
-
4197
- var $gOPD = Object.getOwnPropertyDescriptor;
4198
- if ($gOPD) {
4199
- try {
4200
- $gOPD({}, '');
4201
- } catch (e) {
4202
- $gOPD = null; // this is IE 8, which has a broken gOPD
4203
- }
4204
- }
4205
-
4206
- var throwTypeError = function () {
4207
- throw new $TypeError$1();
4208
- };
4209
- var ThrowTypeError = $gOPD
4210
- ? (function () {
4211
- try {
4212
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
4213
- arguments.callee; // IE 8 does not throw here
4214
- return throwTypeError;
4215
- } catch (calleeThrows) {
4216
- try {
4217
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
4218
- return $gOPD(arguments, 'callee').get;
4219
- } catch (gOPDthrows) {
4220
- return throwTypeError;
4221
- }
4222
- }
4223
- }())
4224
- : throwTypeError;
4225
-
4226
- var hasSymbols = hasSymbols$1();
4227
-
4228
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
4229
-
4230
- var needsEval = {};
4231
-
4232
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
4233
-
4234
- var INTRINSICS = {
4235
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
4236
- '%Array%': Array,
4237
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
4238
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
4239
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
4240
- '%AsyncFunction%': needsEval,
4241
- '%AsyncGenerator%': needsEval,
4242
- '%AsyncGeneratorFunction%': needsEval,
4243
- '%AsyncIteratorPrototype%': needsEval,
4244
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
4245
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
4246
- '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
4247
- '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
4248
- '%Boolean%': Boolean,
4249
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
4250
- '%Date%': Date,
4251
- '%decodeURI%': decodeURI,
4252
- '%decodeURIComponent%': decodeURIComponent,
4253
- '%encodeURI%': encodeURI,
4254
- '%encodeURIComponent%': encodeURIComponent,
4255
- '%Error%': Error,
4256
- '%eval%': eval, // eslint-disable-line no-eval
4257
- '%EvalError%': EvalError,
4258
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
4259
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
4260
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
4261
- '%Function%': $Function,
4262
- '%GeneratorFunction%': needsEval,
4263
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
4264
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
4265
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
4266
- '%isFinite%': isFinite,
4267
- '%isNaN%': isNaN,
4268
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
4269
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
4270
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
4271
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
4272
- '%Math%': Math,
4273
- '%Number%': Number,
4274
- '%Object%': Object,
4275
- '%parseFloat%': parseFloat,
4276
- '%parseInt%': parseInt,
4277
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
4278
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
4279
- '%RangeError%': RangeError,
4280
- '%ReferenceError%': ReferenceError,
4281
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
4282
- '%RegExp%': RegExp,
4283
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
4284
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
4285
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
4286
- '%String%': String,
4287
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
4288
- '%Symbol%': hasSymbols ? Symbol : undefined$1,
4289
- '%SyntaxError%': $SyntaxError,
4290
- '%ThrowTypeError%': ThrowTypeError,
4291
- '%TypedArray%': TypedArray,
4292
- '%TypeError%': $TypeError$1,
4293
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
4294
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
4295
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
4296
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
4297
- '%URIError%': URIError,
4298
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
4299
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
4300
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
4301
- };
4302
-
4303
- try {
4304
- null.error; // eslint-disable-line no-unused-expressions
4305
- } catch (e) {
4306
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
4307
- var errorProto = getProto(getProto(e));
4308
- INTRINSICS['%Error.prototype%'] = errorProto;
4309
- }
4310
-
4311
- var doEval = function doEval(name) {
4312
- var value;
4313
- if (name === '%AsyncFunction%') {
4314
- value = getEvalledConstructor('async function () {}');
4315
- } else if (name === '%GeneratorFunction%') {
4316
- value = getEvalledConstructor('function* () {}');
4317
- } else if (name === '%AsyncGeneratorFunction%') {
4318
- value = getEvalledConstructor('async function* () {}');
4319
- } else if (name === '%AsyncGenerator%') {
4320
- var fn = doEval('%AsyncGeneratorFunction%');
4321
- if (fn) {
4322
- value = fn.prototype;
4323
- }
4324
- } else if (name === '%AsyncIteratorPrototype%') {
4325
- var gen = doEval('%AsyncGenerator%');
4326
- if (gen) {
4327
- value = getProto(gen.prototype);
4328
- }
4329
- }
4330
-
4331
- INTRINSICS[name] = value;
4332
-
4333
- return value;
4334
- };
4335
-
4336
- var LEGACY_ALIASES = {
4337
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
4338
- '%ArrayPrototype%': ['Array', 'prototype'],
4339
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
4340
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
4341
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
4342
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
4343
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
4344
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
4345
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
4346
- '%BooleanPrototype%': ['Boolean', 'prototype'],
4347
- '%DataViewPrototype%': ['DataView', 'prototype'],
4348
- '%DatePrototype%': ['Date', 'prototype'],
4349
- '%ErrorPrototype%': ['Error', 'prototype'],
4350
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
4351
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
4352
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
4353
- '%FunctionPrototype%': ['Function', 'prototype'],
4354
- '%Generator%': ['GeneratorFunction', 'prototype'],
4355
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
4356
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
4357
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
4358
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
4359
- '%JSONParse%': ['JSON', 'parse'],
4360
- '%JSONStringify%': ['JSON', 'stringify'],
4361
- '%MapPrototype%': ['Map', 'prototype'],
4362
- '%NumberPrototype%': ['Number', 'prototype'],
4363
- '%ObjectPrototype%': ['Object', 'prototype'],
4364
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
4365
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
4366
- '%PromisePrototype%': ['Promise', 'prototype'],
4367
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
4368
- '%Promise_all%': ['Promise', 'all'],
4369
- '%Promise_reject%': ['Promise', 'reject'],
4370
- '%Promise_resolve%': ['Promise', 'resolve'],
4371
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
4372
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
4373
- '%RegExpPrototype%': ['RegExp', 'prototype'],
4374
- '%SetPrototype%': ['Set', 'prototype'],
4375
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
4376
- '%StringPrototype%': ['String', 'prototype'],
4377
- '%SymbolPrototype%': ['Symbol', 'prototype'],
4378
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
4379
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
4380
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
4381
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
4382
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
4383
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
4384
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
4385
- '%URIErrorPrototype%': ['URIError', 'prototype'],
4386
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
4387
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
4388
- };
4389
-
4390
- var bind = functionBind;
4391
- var hasOwn$1 = src;
4392
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
4393
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
4394
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
4395
- var $strSlice = bind.call(Function.call, String.prototype.slice);
4396
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
4397
-
4398
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
4399
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
4400
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
4401
- var stringToPath = function stringToPath(string) {
4402
- var first = $strSlice(string, 0, 1);
4403
- var last = $strSlice(string, -1);
4404
- if (first === '%' && last !== '%') {
4405
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
4406
- } else if (last === '%' && first !== '%') {
4407
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
4408
- }
4409
- var result = [];
4410
- $replace$1(string, rePropName, function (match, number, quote, subString) {
4411
- result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
4412
- });
4413
- return result;
4414
- };
4415
- /* end adaptation */
4416
-
4417
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
4418
- var intrinsicName = name;
4419
- var alias;
4420
- if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
4421
- alias = LEGACY_ALIASES[intrinsicName];
4422
- intrinsicName = '%' + alias[0] + '%';
4423
- }
4424
-
4425
- if (hasOwn$1(INTRINSICS, intrinsicName)) {
4426
- var value = INTRINSICS[intrinsicName];
4427
- if (value === needsEval) {
4428
- value = doEval(intrinsicName);
4429
- }
4430
- if (typeof value === 'undefined' && !allowMissing) {
4431
- throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
4432
- }
4433
-
4434
- return {
4435
- alias: alias,
4436
- name: intrinsicName,
4437
- value: value
4438
- };
4439
- }
4440
-
4441
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
4442
- };
4443
-
4444
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
4445
- if (typeof name !== 'string' || name.length === 0) {
4446
- throw new $TypeError$1('intrinsic name must be a non-empty string');
4447
- }
4448
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
4449
- throw new $TypeError$1('"allowMissing" argument must be a boolean');
4450
- }
4451
-
4452
- if ($exec(/^%?[^%]*%?$/, name) === null) {
4453
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
4454
- }
4455
- var parts = stringToPath(name);
4456
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
4457
-
4458
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
4459
- var intrinsicRealName = intrinsic.name;
4460
- var value = intrinsic.value;
4461
- var skipFurtherCaching = false;
4462
-
4463
- var alias = intrinsic.alias;
4464
- if (alias) {
4465
- intrinsicBaseName = alias[0];
4466
- $spliceApply(parts, $concat$1([0, 1], alias));
4467
- }
4468
-
4469
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
4470
- var part = parts[i];
4471
- var first = $strSlice(part, 0, 1);
4472
- var last = $strSlice(part, -1);
4473
- if (
4474
- (
4475
- (first === '"' || first === "'" || first === '`')
4476
- || (last === '"' || last === "'" || last === '`')
4477
- )
4478
- && first !== last
4479
- ) {
4480
- throw new $SyntaxError('property names with quotes must have matching quotes');
4481
- }
4482
- if (part === 'constructor' || !isOwn) {
4483
- skipFurtherCaching = true;
4484
- }
4485
-
4486
- intrinsicBaseName += '.' + part;
4487
- intrinsicRealName = '%' + intrinsicBaseName + '%';
4488
-
4489
- if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
4490
- value = INTRINSICS[intrinsicRealName];
4491
- } else if (value != null) {
4492
- if (!(part in value)) {
4493
- if (!allowMissing) {
4494
- throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
4495
- }
4496
- return void undefined$1;
4497
- }
4498
- if ($gOPD && (i + 1) >= parts.length) {
4499
- var desc = $gOPD(value, part);
4500
- isOwn = !!desc;
4501
-
4502
- // By convention, when a data property is converted to an accessor
4503
- // property to emulate a data property that does not suffer from
4504
- // the override mistake, that accessor's getter is marked with
4505
- // an `originalValue` property. Here, when we detect this, we
4506
- // uphold the illusion by pretending to see that original data
4507
- // property, i.e., returning the value rather than the getter
4508
- // itself.
4509
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
4510
- value = desc.get;
4511
- } else {
4512
- value = value[part];
4513
- }
4514
- } else {
4515
- isOwn = hasOwn$1(value, part);
4516
- value = value[part];
4517
- }
4518
-
4519
- if (isOwn && !skipFurtherCaching) {
4520
- INTRINSICS[intrinsicRealName] = value;
4521
- }
4522
- }
4523
- }
4524
- return value;
4525
- };
4526
-
4527
- var callBind$1 = {exports: {}};
4528
-
4529
- (function (module) {
4530
-
4531
- var bind = functionBind;
4532
- var GetIntrinsic = getIntrinsic;
4533
-
4534
- var $apply = GetIntrinsic('%Function.prototype.apply%');
4535
- var $call = GetIntrinsic('%Function.prototype.call%');
4536
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
4537
-
4538
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
4539
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
4540
- var $max = GetIntrinsic('%Math.max%');
4541
-
4542
- if ($defineProperty) {
4543
- try {
4544
- $defineProperty({}, 'a', { value: 1 });
4545
- } catch (e) {
4546
- // IE 8 has a broken defineProperty
4547
- $defineProperty = null;
4548
- }
4549
- }
4550
-
4551
- module.exports = function callBind(originalFunction) {
4552
- var func = $reflectApply(bind, $call, arguments);
4553
- if ($gOPD && $defineProperty) {
4554
- var desc = $gOPD(func, 'length');
4555
- if (desc.configurable) {
4556
- // original length, plus the receiver, minus any additional arguments (after the receiver)
4557
- $defineProperty(
4558
- func,
4559
- 'length',
4560
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
4561
- );
4562
- }
4563
- }
4564
- return func;
4565
- };
4566
-
4567
- var applyBind = function applyBind() {
4568
- return $reflectApply(bind, $apply, arguments);
4569
- };
4570
-
4571
- if ($defineProperty) {
4572
- $defineProperty(module.exports, 'apply', { value: applyBind });
4573
- } else {
4574
- module.exports.apply = applyBind;
4575
- }
4576
- } (callBind$1));
4577
-
4578
- var GetIntrinsic$1 = getIntrinsic;
4579
-
4580
- var callBind = callBind$1.exports;
4581
-
4582
- var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
4583
-
4584
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
4585
- var intrinsic = GetIntrinsic$1(name, !!allowMissing);
4586
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
4587
- return callBind(intrinsic);
4588
- }
4589
- return intrinsic;
4590
- };
4591
-
4592
- var util_inspect = require$$0__default["default"].inspect;
4593
-
4594
- var hasMap = typeof Map === 'function' && Map.prototype;
4595
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
4596
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
4597
- var mapForEach = hasMap && Map.prototype.forEach;
4598
- var hasSet = typeof Set === 'function' && Set.prototype;
4599
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
4600
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
4601
- var setForEach = hasSet && Set.prototype.forEach;
4602
- var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
4603
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
4604
- var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
4605
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
4606
- var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
4607
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
4608
- var booleanValueOf = Boolean.prototype.valueOf;
4609
- var objectToString = Object.prototype.toString;
4610
- var functionToString = Function.prototype.toString;
4611
- var $match = String.prototype.match;
4612
- var $slice = String.prototype.slice;
4613
- var $replace = String.prototype.replace;
4614
- var $toUpperCase = String.prototype.toUpperCase;
4615
- var $toLowerCase = String.prototype.toLowerCase;
4616
- var $test = RegExp.prototype.test;
4617
- var $concat = Array.prototype.concat;
4618
- var $join = Array.prototype.join;
4619
- var $arrSlice = Array.prototype.slice;
4620
- var $floor = Math.floor;
4621
- var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
4622
- var gOPS = Object.getOwnPropertySymbols;
4623
- var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
4624
- var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
4625
- // ie, `has-tostringtag/shams
4626
- var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
4627
- ? Symbol.toStringTag
4628
- : null;
4629
- var isEnumerable = Object.prototype.propertyIsEnumerable;
4630
-
4631
- var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
4632
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
4633
- ? function (O) {
4634
- return O.__proto__; // eslint-disable-line no-proto
4635
- }
4636
- : null
4637
- );
4638
-
4639
- function addNumericSeparator(num, str) {
4640
- if (
4641
- num === Infinity
4642
- || num === -Infinity
4643
- || num !== num
4644
- || (num && num > -1000 && num < 1000)
4645
- || $test.call(/e/, str)
4646
- ) {
4647
- return str;
4648
- }
4649
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
4650
- if (typeof num === 'number') {
4651
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
4652
- if (int !== num) {
4653
- var intStr = String(int);
4654
- var dec = $slice.call(str, intStr.length + 1);
4655
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
4656
- }
4657
- }
4658
- return $replace.call(str, sepRegex, '$&_');
4659
- }
4660
-
4661
- var utilInspect = util_inspect;
4662
- var inspectCustom = utilInspect.custom;
4663
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
4664
-
4665
- var objectInspect = function inspect_(obj, options, depth, seen) {
4666
- var opts = options || {};
4667
-
4668
- if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
4669
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
4670
- }
4671
- if (
4672
- has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
4673
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
4674
- : opts.maxStringLength !== null
4675
- )
4676
- ) {
4677
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
4678
- }
4679
- var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
4680
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
4681
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
4682
- }
4683
-
4684
- if (
4685
- has$3(opts, 'indent')
4686
- && opts.indent !== null
4687
- && opts.indent !== '\t'
4688
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
4689
- ) {
4690
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
4691
- }
4692
- if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
4693
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
4694
- }
4695
- var numericSeparator = opts.numericSeparator;
4696
-
4697
- if (typeof obj === 'undefined') {
4698
- return 'undefined';
4699
- }
4700
- if (obj === null) {
4701
- return 'null';
4702
- }
4703
- if (typeof obj === 'boolean') {
4704
- return obj ? 'true' : 'false';
4705
- }
4706
-
4707
- if (typeof obj === 'string') {
4708
- return inspectString(obj, opts);
4709
- }
4710
- if (typeof obj === 'number') {
4711
- if (obj === 0) {
4712
- return Infinity / obj > 0 ? '0' : '-0';
4713
- }
4714
- var str = String(obj);
4715
- return numericSeparator ? addNumericSeparator(obj, str) : str;
4716
- }
4717
- if (typeof obj === 'bigint') {
4718
- var bigIntStr = String(obj) + 'n';
4719
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
4720
- }
4721
-
4722
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
4723
- if (typeof depth === 'undefined') { depth = 0; }
4724
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
4725
- return isArray$3(obj) ? '[Array]' : '[Object]';
4726
- }
4727
-
4728
- var indent = getIndent(opts, depth);
4729
-
4730
- if (typeof seen === 'undefined') {
4731
- seen = [];
4732
- } else if (indexOf(seen, obj) >= 0) {
4733
- return '[Circular]';
4734
- }
4735
-
4736
- function inspect(value, from, noIndent) {
4737
- if (from) {
4738
- seen = $arrSlice.call(seen);
4739
- seen.push(from);
4740
- }
4741
- if (noIndent) {
4742
- var newOpts = {
4743
- depth: opts.depth
4744
- };
4745
- if (has$3(opts, 'quoteStyle')) {
4746
- newOpts.quoteStyle = opts.quoteStyle;
4747
- }
4748
- return inspect_(value, newOpts, depth + 1, seen);
4749
- }
4750
- return inspect_(value, opts, depth + 1, seen);
4751
- }
4752
-
4753
- if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
4754
- var name = nameOf(obj);
4755
- var keys = arrObjKeys(obj, inspect);
4756
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
4757
- }
4758
- if (isSymbol(obj)) {
4759
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4760
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
4761
- }
4762
- if (isElement(obj)) {
4763
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
4764
- var attrs = obj.attributes || [];
4765
- for (var i = 0; i < attrs.length; i++) {
4766
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
4767
- }
4768
- s += '>';
4769
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
4770
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
4771
- return s;
4772
- }
4773
- if (isArray$3(obj)) {
4774
- if (obj.length === 0) { return '[]'; }
4775
- var xs = arrObjKeys(obj, inspect);
4776
- if (indent && !singleLineValues(xs)) {
4777
- return '[' + indentedJoin(xs, indent) + ']';
4778
- }
4779
- return '[ ' + $join.call(xs, ', ') + ' ]';
4780
- }
4781
- if (isError(obj)) {
4782
- var parts = arrObjKeys(obj, inspect);
4783
- if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
4784
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
4785
- }
4786
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
4787
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
4788
- }
4789
- if (typeof obj === 'object' && customInspect) {
4790
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
4791
- return utilInspect(obj, { depth: maxDepth - depth });
4792
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
4793
- return obj.inspect();
4794
- }
4795
- }
4796
- if (isMap(obj)) {
4797
- var mapParts = [];
4798
- if (mapForEach) {
4799
- mapForEach.call(obj, function (value, key) {
4800
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
4801
- });
4802
- }
4803
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
4804
- }
4805
- if (isSet(obj)) {
4806
- var setParts = [];
4807
- if (setForEach) {
4808
- setForEach.call(obj, function (value) {
4809
- setParts.push(inspect(value, obj));
4810
- });
4811
- }
4812
- return collectionOf('Set', setSize.call(obj), setParts, indent);
4813
- }
4814
- if (isWeakMap(obj)) {
4815
- return weakCollectionOf('WeakMap');
4816
- }
4817
- if (isWeakSet(obj)) {
4818
- return weakCollectionOf('WeakSet');
4819
- }
4820
- if (isWeakRef(obj)) {
4821
- return weakCollectionOf('WeakRef');
4822
- }
4823
- if (isNumber(obj)) {
4824
- return markBoxed(inspect(Number(obj)));
4825
- }
4826
- if (isBigInt(obj)) {
4827
- return markBoxed(inspect(bigIntValueOf.call(obj)));
4828
- }
4829
- if (isBoolean(obj)) {
4830
- return markBoxed(booleanValueOf.call(obj));
4831
- }
4832
- if (isString(obj)) {
4833
- return markBoxed(inspect(String(obj)));
4834
- }
4835
- if (!isDate(obj) && !isRegExp$1(obj)) {
4836
- var ys = arrObjKeys(obj, inspect);
4837
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
4838
- var protoTag = obj instanceof Object ? '' : 'null prototype';
4839
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
4840
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
4841
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
4842
- if (ys.length === 0) { return tag + '{}'; }
4843
- if (indent) {
4844
- return tag + '{' + indentedJoin(ys, indent) + '}';
4845
- }
4846
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
4847
- }
4848
- return String(obj);
4849
- };
4850
-
4851
- function wrapQuotes(s, defaultStyle, opts) {
4852
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
4853
- return quoteChar + s + quoteChar;
4854
- }
4855
-
4856
- function quote(s) {
4857
- return $replace.call(String(s), /"/g, '&quot;');
4858
- }
4859
-
4860
- function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4861
- function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4862
- function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4863
- function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4864
- function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4865
- function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4866
- function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4867
-
4868
- // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
4869
- function isSymbol(obj) {
4870
- if (hasShammedSymbols) {
4871
- return obj && typeof obj === 'object' && obj instanceof Symbol;
4872
- }
4873
- if (typeof obj === 'symbol') {
4874
- return true;
4875
- }
4876
- if (!obj || typeof obj !== 'object' || !symToString) {
4877
- return false;
4878
- }
4879
- try {
4880
- symToString.call(obj);
4881
- return true;
4882
- } catch (e) {}
4883
- return false;
4884
- }
4885
-
4886
- function isBigInt(obj) {
4887
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
4888
- return false;
4889
- }
4890
- try {
4891
- bigIntValueOf.call(obj);
4892
- return true;
4893
- } catch (e) {}
4894
- return false;
4895
- }
4896
-
4897
- var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
4898
- function has$3(obj, key) {
4899
- return hasOwn.call(obj, key);
4900
- }
4901
-
4902
- function toStr(obj) {
4903
- return objectToString.call(obj);
4904
- }
4905
-
4906
- function nameOf(f) {
4907
- if (f.name) { return f.name; }
4908
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
4909
- if (m) { return m[1]; }
4910
- return null;
4911
- }
4912
-
4913
- function indexOf(xs, x) {
4914
- if (xs.indexOf) { return xs.indexOf(x); }
4915
- for (var i = 0, l = xs.length; i < l; i++) {
4916
- if (xs[i] === x) { return i; }
4917
- }
4918
- return -1;
4919
- }
4920
-
4921
- function isMap(x) {
4922
- if (!mapSize || !x || typeof x !== 'object') {
4923
- return false;
4924
- }
4925
- try {
4926
- mapSize.call(x);
4927
- try {
4928
- setSize.call(x);
4929
- } catch (s) {
4930
- return true;
4931
- }
4932
- return x instanceof Map; // core-js workaround, pre-v2.5.0
4933
- } catch (e) {}
4934
- return false;
4935
- }
4936
-
4937
- function isWeakMap(x) {
4938
- if (!weakMapHas || !x || typeof x !== 'object') {
4939
- return false;
4940
- }
4941
- try {
4942
- weakMapHas.call(x, weakMapHas);
4943
- try {
4944
- weakSetHas.call(x, weakSetHas);
4945
- } catch (s) {
4946
- return true;
4947
- }
4948
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
4949
- } catch (e) {}
4950
- return false;
4951
- }
4952
-
4953
- function isWeakRef(x) {
4954
- if (!weakRefDeref || !x || typeof x !== 'object') {
4955
- return false;
4956
- }
4957
- try {
4958
- weakRefDeref.call(x);
4959
- return true;
4960
- } catch (e) {}
4961
- return false;
4962
- }
4963
-
4964
- function isSet(x) {
4965
- if (!setSize || !x || typeof x !== 'object') {
4966
- return false;
4967
- }
4968
- try {
4969
- setSize.call(x);
4970
- try {
4971
- mapSize.call(x);
4972
- } catch (m) {
4973
- return true;
4974
- }
4975
- return x instanceof Set; // core-js workaround, pre-v2.5.0
4976
- } catch (e) {}
4977
- return false;
4978
- }
4979
-
4980
- function isWeakSet(x) {
4981
- if (!weakSetHas || !x || typeof x !== 'object') {
4982
- return false;
4983
- }
4984
- try {
4985
- weakSetHas.call(x, weakSetHas);
4986
- try {
4987
- weakMapHas.call(x, weakMapHas);
4988
- } catch (s) {
4989
- return true;
4990
- }
4991
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
4992
- } catch (e) {}
4993
- return false;
4994
- }
4995
-
4996
- function isElement(x) {
4997
- if (!x || typeof x !== 'object') { return false; }
4998
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
4999
- return true;
5000
- }
5001
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
5002
- }
5003
-
5004
- function inspectString(str, opts) {
5005
- if (str.length > opts.maxStringLength) {
5006
- var remaining = str.length - opts.maxStringLength;
5007
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
5008
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
5009
- }
5010
- // eslint-disable-next-line no-control-regex
5011
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
5012
- return wrapQuotes(s, 'single', opts);
5013
- }
5014
-
5015
- function lowbyte(c) {
5016
- var n = c.charCodeAt(0);
5017
- var x = {
5018
- 8: 'b',
5019
- 9: 't',
5020
- 10: 'n',
5021
- 12: 'f',
5022
- 13: 'r'
5023
- }[n];
5024
- if (x) { return '\\' + x; }
5025
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
5026
- }
5027
-
5028
- function markBoxed(str) {
5029
- return 'Object(' + str + ')';
5030
- }
5031
-
5032
- function weakCollectionOf(type) {
5033
- return type + ' { ? }';
5034
- }
5035
-
5036
- function collectionOf(type, size, entries, indent) {
5037
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
5038
- return type + ' (' + size + ') {' + joinedEntries + '}';
5039
- }
5040
-
5041
- function singleLineValues(xs) {
5042
- for (var i = 0; i < xs.length; i++) {
5043
- if (indexOf(xs[i], '\n') >= 0) {
5044
- return false;
5045
- }
5046
- }
5047
- return true;
5048
- }
5049
-
5050
- function getIndent(opts, depth) {
5051
- var baseIndent;
5052
- if (opts.indent === '\t') {
5053
- baseIndent = '\t';
5054
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
5055
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
5056
- } else {
5057
- return null;
5058
- }
5059
- return {
5060
- base: baseIndent,
5061
- prev: $join.call(Array(depth + 1), baseIndent)
5062
- };
5063
- }
5064
-
5065
- function indentedJoin(xs, indent) {
5066
- if (xs.length === 0) { return ''; }
5067
- var lineJoiner = '\n' + indent.prev + indent.base;
5068
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
5069
- }
5070
-
5071
- function arrObjKeys(obj, inspect) {
5072
- var isArr = isArray$3(obj);
5073
- var xs = [];
5074
- if (isArr) {
5075
- xs.length = obj.length;
5076
- for (var i = 0; i < obj.length; i++) {
5077
- xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
5078
- }
5079
- }
5080
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
5081
- var symMap;
5082
- if (hasShammedSymbols) {
5083
- symMap = {};
5084
- for (var k = 0; k < syms.length; k++) {
5085
- symMap['$' + syms[k]] = syms[k];
5086
- }
5087
- }
5088
-
5089
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
5090
- if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
5091
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
5092
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
5093
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
5094
- continue; // eslint-disable-line no-restricted-syntax, no-continue
5095
- } else if ($test.call(/[^\w$]/, key)) {
5096
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
5097
- } else {
5098
- xs.push(key + ': ' + inspect(obj[key], obj));
5099
- }
5100
- }
5101
- if (typeof gOPS === 'function') {
5102
- for (var j = 0; j < syms.length; j++) {
5103
- if (isEnumerable.call(obj, syms[j])) {
5104
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
5105
- }
5106
- }
5107
- }
5108
- return xs;
5109
- }
5110
-
5111
- var GetIntrinsic = getIntrinsic;
5112
- var callBound = callBound$1;
5113
- var inspect = objectInspect;
5114
-
5115
- var $TypeError = GetIntrinsic('%TypeError%');
5116
- var $WeakMap = GetIntrinsic('%WeakMap%', true);
5117
- var $Map = GetIntrinsic('%Map%', true);
5118
-
5119
- var $weakMapGet = callBound('WeakMap.prototype.get', true);
5120
- var $weakMapSet = callBound('WeakMap.prototype.set', true);
5121
- var $weakMapHas = callBound('WeakMap.prototype.has', true);
5122
- var $mapGet = callBound('Map.prototype.get', true);
5123
- var $mapSet = callBound('Map.prototype.set', true);
5124
- var $mapHas = callBound('Map.prototype.has', true);
5125
-
5126
- /*
5127
- * This function traverses the list returning the node corresponding to the
5128
- * given key.
5129
- *
5130
- * That node is also moved to the head of the list, so that if it's accessed
5131
- * again we don't need to traverse the whole list. By doing so, all the recently
5132
- * used nodes can be accessed relatively quickly.
5133
- */
5134
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
5135
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
5136
- if (curr.key === key) {
5137
- prev.next = curr.next;
5138
- curr.next = list.next;
5139
- list.next = curr; // eslint-disable-line no-param-reassign
5140
- return curr;
5141
- }
5142
- }
5143
- };
5144
-
5145
- var listGet = function (objects, key) {
5146
- var node = listGetNode(objects, key);
5147
- return node && node.value;
5148
- };
5149
- var listSet = function (objects, key, value) {
5150
- var node = listGetNode(objects, key);
5151
- if (node) {
5152
- node.value = value;
5153
- } else {
5154
- // Prepend the new node to the beginning of the list
5155
- objects.next = { // eslint-disable-line no-param-reassign
5156
- key: key,
5157
- next: objects.next,
5158
- value: value
5159
- };
5160
- }
5161
- };
5162
- var listHas = function (objects, key) {
5163
- return !!listGetNode(objects, key);
5164
- };
5165
-
5166
- var sideChannel = function getSideChannel() {
5167
- var $wm;
5168
- var $m;
5169
- var $o;
5170
- var channel = {
5171
- assert: function (key) {
5172
- if (!channel.has(key)) {
5173
- throw new $TypeError('Side channel does not contain ' + inspect(key));
5174
- }
5175
- },
5176
- get: function (key) { // eslint-disable-line consistent-return
5177
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
5178
- if ($wm) {
5179
- return $weakMapGet($wm, key);
5180
- }
5181
- } else if ($Map) {
5182
- if ($m) {
5183
- return $mapGet($m, key);
5184
- }
5185
- } else {
5186
- if ($o) { // eslint-disable-line no-lonely-if
5187
- return listGet($o, key);
5188
- }
5189
- }
5190
- },
5191
- has: function (key) {
5192
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
5193
- if ($wm) {
5194
- return $weakMapHas($wm, key);
5195
- }
5196
- } else if ($Map) {
5197
- if ($m) {
5198
- return $mapHas($m, key);
5199
- }
5200
- } else {
5201
- if ($o) { // eslint-disable-line no-lonely-if
5202
- return listHas($o, key);
5203
- }
5204
- }
5205
- return false;
5206
- },
5207
- set: function (key, value) {
5208
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
5209
- if (!$wm) {
5210
- $wm = new $WeakMap();
5211
- }
5212
- $weakMapSet($wm, key, value);
5213
- } else if ($Map) {
5214
- if (!$m) {
5215
- $m = new $Map();
5216
- }
5217
- $mapSet($m, key, value);
5218
- } else {
5219
- if (!$o) {
5220
- /*
5221
- * Initialize the linked list as an empty node, so that we don't have
5222
- * to special-case handling of the first node: we can always refer to
5223
- * it as (previous node).next, instead of something like (list).head
5224
- */
5225
- $o = { key: {}, next: null };
5226
- }
5227
- listSet($o, key, value);
5228
- }
5229
- }
5230
- };
5231
- return channel;
5232
- };
5233
-
5234
- var replace = String.prototype.replace;
5235
- var percentTwenties = /%20/g;
5236
-
5237
- var Format = {
5238
- RFC1738: 'RFC1738',
5239
- RFC3986: 'RFC3986'
5240
- };
5241
-
5242
- var formats$3 = {
5243
- 'default': Format.RFC3986,
5244
- formatters: {
5245
- RFC1738: function (value) {
5246
- return replace.call(value, percentTwenties, '+');
5247
- },
5248
- RFC3986: function (value) {
5249
- return String(value);
5250
- }
5251
- },
5252
- RFC1738: Format.RFC1738,
5253
- RFC3986: Format.RFC3986
5254
- };
5255
-
5256
- var formats$2 = formats$3;
5257
-
5258
- var has$2 = Object.prototype.hasOwnProperty;
5259
- var isArray$2 = Array.isArray;
5260
-
5261
- var hexTable = (function () {
5262
- var array = [];
5263
- for (var i = 0; i < 256; ++i) {
5264
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
5265
- }
5266
-
5267
- return array;
5268
- }());
5269
-
5270
- var compactQueue = function compactQueue(queue) {
5271
- while (queue.length > 1) {
5272
- var item = queue.pop();
5273
- var obj = item.obj[item.prop];
5274
-
5275
- if (isArray$2(obj)) {
5276
- var compacted = [];
5277
-
5278
- for (var j = 0; j < obj.length; ++j) {
5279
- if (typeof obj[j] !== 'undefined') {
5280
- compacted.push(obj[j]);
5281
- }
5282
- }
5283
-
5284
- item.obj[item.prop] = compacted;
5285
- }
5286
- }
5287
- };
5288
-
5289
- var arrayToObject = function arrayToObject(source, options) {
5290
- var obj = options && options.plainObjects ? Object.create(null) : {};
5291
- for (var i = 0; i < source.length; ++i) {
5292
- if (typeof source[i] !== 'undefined') {
5293
- obj[i] = source[i];
5294
- }
5295
- }
5296
-
5297
- return obj;
5298
- };
5299
-
5300
- var merge$2 = function merge(target, source, options) {
5301
- /* eslint no-param-reassign: 0 */
5302
- if (!source) {
5303
- return target;
5304
- }
5305
-
5306
- if (typeof source !== 'object') {
5307
- if (isArray$2(target)) {
5308
- target.push(source);
5309
- } else if (target && typeof target === 'object') {
5310
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
5311
- target[source] = true;
5312
- }
5313
- } else {
5314
- return [target, source];
5315
- }
5316
-
5317
- return target;
5318
- }
5319
-
5320
- if (!target || typeof target !== 'object') {
5321
- return [target].concat(source);
5322
- }
5323
-
5324
- var mergeTarget = target;
5325
- if (isArray$2(target) && !isArray$2(source)) {
5326
- mergeTarget = arrayToObject(target, options);
5327
- }
5328
-
5329
- if (isArray$2(target) && isArray$2(source)) {
5330
- source.forEach(function (item, i) {
5331
- if (has$2.call(target, i)) {
5332
- var targetItem = target[i];
5333
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
5334
- target[i] = merge(targetItem, item, options);
5335
- } else {
5336
- target.push(item);
5337
- }
5338
- } else {
5339
- target[i] = item;
5340
- }
5341
- });
5342
- return target;
5343
- }
5344
-
5345
- return Object.keys(source).reduce(function (acc, key) {
5346
- var value = source[key];
5347
-
5348
- if (has$2.call(acc, key)) {
5349
- acc[key] = merge(acc[key], value, options);
5350
- } else {
5351
- acc[key] = value;
5352
- }
5353
- return acc;
5354
- }, mergeTarget);
5355
- };
5356
-
5357
- var assign = function assignSingleSource(target, source) {
5358
- return Object.keys(source).reduce(function (acc, key) {
5359
- acc[key] = source[key];
5360
- return acc;
5361
- }, target);
5362
- };
5363
-
5364
- var decode$1 = function (str, decoder, charset) {
5365
- var strWithoutPlus = str.replace(/\+/g, ' ');
5366
- if (charset === 'iso-8859-1') {
5367
- // unescape never throws, no try...catch needed:
5368
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
5369
- }
5370
- // utf-8
5371
- try {
5372
- return decodeURIComponent(strWithoutPlus);
5373
- } catch (e) {
5374
- return strWithoutPlus;
5375
- }
5376
- };
5377
-
5378
- var encode$1 = function encode(str, defaultEncoder, charset, kind, format) {
5379
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
5380
- // It has been adapted here for stricter adherence to RFC 3986
5381
- if (str.length === 0) {
5382
- return str;
5383
- }
5384
-
5385
- var string = str;
5386
- if (typeof str === 'symbol') {
5387
- string = Symbol.prototype.toString.call(str);
5388
- } else if (typeof str !== 'string') {
5389
- string = String(str);
5390
- }
5391
-
5392
- if (charset === 'iso-8859-1') {
5393
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
5394
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
5395
- });
5396
- }
5397
-
5398
- var out = '';
5399
- for (var i = 0; i < string.length; ++i) {
5400
- var c = string.charCodeAt(i);
5401
-
5402
- if (
5403
- c === 0x2D // -
5404
- || c === 0x2E // .
5405
- || c === 0x5F // _
5406
- || c === 0x7E // ~
5407
- || (c >= 0x30 && c <= 0x39) // 0-9
5408
- || (c >= 0x41 && c <= 0x5A) // a-z
5409
- || (c >= 0x61 && c <= 0x7A) // A-Z
5410
- || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
5411
- ) {
5412
- out += string.charAt(i);
5413
- continue;
5414
- }
5415
-
5416
- if (c < 0x80) {
5417
- out = out + hexTable[c];
5418
- continue;
5419
- }
5420
-
5421
- if (c < 0x800) {
5422
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
5423
- continue;
5424
- }
5425
-
5426
- if (c < 0xD800 || c >= 0xE000) {
5427
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
5428
- continue;
5429
- }
5430
-
5431
- i += 1;
5432
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
5433
- /* eslint operator-linebreak: [2, "before"] */
5434
- out += hexTable[0xF0 | (c >> 18)]
5435
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
5436
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
5437
- + hexTable[0x80 | (c & 0x3F)];
5438
- }
5439
-
5440
- return out;
5441
- };
5442
-
5443
- var compact = function compact(value) {
5444
- var queue = [{ obj: { o: value }, prop: 'o' }];
5445
- var refs = [];
5446
-
5447
- for (var i = 0; i < queue.length; ++i) {
5448
- var item = queue[i];
5449
- var obj = item.obj[item.prop];
5450
-
5451
- var keys = Object.keys(obj);
5452
- for (var j = 0; j < keys.length; ++j) {
5453
- var key = keys[j];
5454
- var val = obj[key];
5455
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
5456
- queue.push({ obj: obj, prop: key });
5457
- refs.push(val);
5458
- }
5459
- }
5460
- }
5461
-
5462
- compactQueue(queue);
5463
-
5464
- return value;
5465
- };
5466
-
5467
- var isRegExp = function isRegExp(obj) {
5468
- return Object.prototype.toString.call(obj) === '[object RegExp]';
5469
- };
5470
-
5471
- var isBuffer = function isBuffer(obj) {
5472
- if (!obj || typeof obj !== 'object') {
5473
- return false;
5474
- }
5475
-
5476
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
5477
- };
5478
-
5479
- var combine = function combine(a, b) {
5480
- return [].concat(a, b);
5481
- };
5482
-
5483
- var maybeMap = function maybeMap(val, fn) {
5484
- if (isArray$2(val)) {
5485
- var mapped = [];
5486
- for (var i = 0; i < val.length; i += 1) {
5487
- mapped.push(fn(val[i]));
5488
- }
5489
- return mapped;
5490
- }
5491
- return fn(val);
5492
- };
5493
-
5494
- var utils$2 = {
5495
- arrayToObject: arrayToObject,
5496
- assign: assign,
5497
- combine: combine,
5498
- compact: compact,
5499
- decode: decode$1,
5500
- encode: encode$1,
5501
- isBuffer: isBuffer,
5502
- isRegExp: isRegExp,
5503
- maybeMap: maybeMap,
5504
- merge: merge$2
5505
- };
5506
-
5507
- var getSideChannel = sideChannel;
5508
- var utils$1 = utils$2;
5509
- var formats$1 = formats$3;
5510
- var has$1 = Object.prototype.hasOwnProperty;
5511
-
5512
- var arrayPrefixGenerators = {
5513
- brackets: function brackets(prefix) {
5514
- return prefix + '[]';
5515
- },
5516
- comma: 'comma',
5517
- indices: function indices(prefix, key) {
5518
- return prefix + '[' + key + ']';
5519
- },
5520
- repeat: function repeat(prefix) {
5521
- return prefix;
5522
- }
5523
- };
5524
-
5525
- var isArray$1 = Array.isArray;
5526
- var split = String.prototype.split;
5527
- var push = Array.prototype.push;
5528
- var pushToArray = function (arr, valueOrArray) {
5529
- push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
5530
- };
5531
-
5532
- var toISO = Date.prototype.toISOString;
5533
-
5534
- var defaultFormat = formats$1['default'];
5535
- var defaults$2 = {
5536
- addQueryPrefix: false,
5537
- allowDots: false,
5538
- charset: 'utf-8',
5539
- charsetSentinel: false,
5540
- delimiter: '&',
5541
- encode: true,
5542
- encoder: utils$1.encode,
5543
- encodeValuesOnly: false,
5544
- format: defaultFormat,
5545
- formatter: formats$1.formatters[defaultFormat],
5546
- // deprecated
5547
- indices: false,
5548
- serializeDate: function serializeDate(date) {
5549
- return toISO.call(date);
5550
- },
5551
- skipNulls: false,
5552
- strictNullHandling: false
5553
- };
5554
-
5555
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
5556
- return typeof v === 'string'
5557
- || typeof v === 'number'
5558
- || typeof v === 'boolean'
5559
- || typeof v === 'symbol'
5560
- || typeof v === 'bigint';
5561
- };
5562
-
5563
- var sentinel = {};
5564
-
5565
- var stringify$4 = function stringify(
5566
- object,
5567
- prefix,
5568
- generateArrayPrefix,
5569
- commaRoundTrip,
5570
- strictNullHandling,
5571
- skipNulls,
5572
- encoder,
5573
- filter,
5574
- sort,
5575
- allowDots,
5576
- serializeDate,
5577
- format,
5578
- formatter,
5579
- encodeValuesOnly,
5580
- charset,
5581
- sideChannel
5582
- ) {
5583
- var obj = object;
5584
-
5585
- var tmpSc = sideChannel;
5586
- var step = 0;
5587
- var findFlag = false;
5588
- while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
5589
- // Where object last appeared in the ref tree
5590
- var pos = tmpSc.get(object);
5591
- step += 1;
5592
- if (typeof pos !== 'undefined') {
5593
- if (pos === step) {
5594
- throw new RangeError('Cyclic object value');
5595
- } else {
5596
- findFlag = true; // Break while
5597
- }
5598
- }
5599
- if (typeof tmpSc.get(sentinel) === 'undefined') {
5600
- step = 0;
5601
- }
5602
- }
5603
-
5604
- if (typeof filter === 'function') {
5605
- obj = filter(prefix, obj);
5606
- } else if (obj instanceof Date) {
5607
- obj = serializeDate(obj);
5608
- } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5609
- obj = utils$1.maybeMap(obj, function (value) {
5610
- if (value instanceof Date) {
5611
- return serializeDate(value);
5612
- }
5613
- return value;
5614
- });
5615
- }
5616
-
5617
- if (obj === null) {
5618
- if (strictNullHandling) {
5619
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$2.encoder, charset, 'key', format) : prefix;
5620
- }
5621
-
5622
- obj = '';
5623
- }
5624
-
5625
- if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
5626
- if (encoder) {
5627
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$2.encoder, charset, 'key', format);
5628
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
5629
- var valuesArray = split.call(String(obj), ',');
5630
- var valuesJoined = '';
5631
- for (var i = 0; i < valuesArray.length; ++i) {
5632
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$2.encoder, charset, 'value', format));
5633
- }
5634
- return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
5635
- }
5636
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$2.encoder, charset, 'value', format))];
5637
- }
5638
- return [formatter(prefix) + '=' + formatter(String(obj))];
5639
- }
5640
-
5641
- var values = [];
5642
-
5643
- if (typeof obj === 'undefined') {
5644
- return values;
5645
- }
5646
-
5647
- var objKeys;
5648
- if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5649
- // we need to join elements in
5650
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
5651
- } else if (isArray$1(filter)) {
5652
- objKeys = filter;
5653
- } else {
5654
- var keys = Object.keys(obj);
5655
- objKeys = sort ? keys.sort(sort) : keys;
5656
- }
5657
-
5658
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
5659
-
5660
- for (var j = 0; j < objKeys.length; ++j) {
5661
- var key = objKeys[j];
5662
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
5663
-
5664
- if (skipNulls && value === null) {
5665
- continue;
5666
- }
5667
-
5668
- var keyPrefix = isArray$1(obj)
5669
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
5670
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
5671
-
5672
- sideChannel.set(object, step);
5673
- var valueSideChannel = getSideChannel();
5674
- valueSideChannel.set(sentinel, sideChannel);
5675
- pushToArray(values, stringify(
5676
- value,
5677
- keyPrefix,
5678
- generateArrayPrefix,
5679
- commaRoundTrip,
5680
- strictNullHandling,
5681
- skipNulls,
5682
- encoder,
5683
- filter,
5684
- sort,
5685
- allowDots,
5686
- serializeDate,
5687
- format,
5688
- formatter,
5689
- encodeValuesOnly,
5690
- charset,
5691
- valueSideChannel
5692
- ));
5693
- }
5694
-
5695
- return values;
5696
- };
5697
-
5698
- var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
5699
- if (!opts) {
5700
- return defaults$2;
5701
- }
5702
-
5703
- if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
5704
- throw new TypeError('Encoder has to be a function.');
5705
- }
3298
+ * it was defined in the bind method
3299
+ *
3300
+ * @param {string|Array} keys
3301
+ * @param {string} action
3302
+ * @returns void
3303
+ */
3304
+ Mousetrap.prototype.unbind = function(keys, action) {
3305
+ var self = this;
3306
+ return self.bind.call(self, keys, function() {}, action);
3307
+ };
5706
3308
 
5707
- var charset = opts.charset || defaults$2.charset;
5708
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5709
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5710
- }
3309
+ /**
3310
+ * triggers an event that has already been bound
3311
+ *
3312
+ * @param {string} keys
3313
+ * @param {string=} action
3314
+ * @returns void
3315
+ */
3316
+ Mousetrap.prototype.trigger = function(keys, action) {
3317
+ var self = this;
3318
+ if (self._directMap[keys + ':' + action]) {
3319
+ self._directMap[keys + ':' + action]({}, keys);
3320
+ }
3321
+ return self;
3322
+ };
5711
3323
 
5712
- var format = formats$1['default'];
5713
- if (typeof opts.format !== 'undefined') {
5714
- if (!has$1.call(formats$1.formatters, opts.format)) {
5715
- throw new TypeError('Unknown format option provided.');
5716
- }
5717
- format = opts.format;
5718
- }
5719
- var formatter = formats$1.formatters[format];
3324
+ /**
3325
+ * resets the library back to its initial state. this is useful
3326
+ * if you want to clear out the current keyboard shortcuts and bind
3327
+ * new ones - for example if you switch to another page
3328
+ *
3329
+ * @returns void
3330
+ */
3331
+ Mousetrap.prototype.reset = function() {
3332
+ var self = this;
3333
+ self._callbacks = {};
3334
+ self._directMap = {};
3335
+ return self;
3336
+ };
5720
3337
 
5721
- var filter = defaults$2.filter;
5722
- if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
5723
- filter = opts.filter;
5724
- }
3338
+ /**
3339
+ * should we stop this event before firing off callbacks
3340
+ *
3341
+ * @param {Event} e
3342
+ * @param {Element} element
3343
+ * @return {boolean}
3344
+ */
3345
+ Mousetrap.prototype.stopCallback = function(e, element) {
3346
+ var self = this;
5725
3347
 
5726
- return {
5727
- addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$2.addQueryPrefix,
5728
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$2.allowDots : !!opts.allowDots,
5729
- charset: charset,
5730
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$2.charsetSentinel,
5731
- delimiter: typeof opts.delimiter === 'undefined' ? defaults$2.delimiter : opts.delimiter,
5732
- encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$2.encode,
5733
- encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$2.encoder,
5734
- encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$2.encodeValuesOnly,
5735
- filter: filter,
5736
- format: format,
5737
- formatter: formatter,
5738
- serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$2.serializeDate,
5739
- skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$2.skipNulls,
5740
- sort: typeof opts.sort === 'function' ? opts.sort : null,
5741
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$2.strictNullHandling
5742
- };
5743
- };
3348
+ // if the element has the class "mousetrap" then no need to stop
3349
+ if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
3350
+ return false;
3351
+ }
5744
3352
 
5745
- var stringify_1 = function (object, opts) {
5746
- var obj = object;
5747
- var options = normalizeStringifyOptions(opts);
3353
+ if (_belongsTo(element, self.target)) {
3354
+ return false;
3355
+ }
5748
3356
 
5749
- var objKeys;
5750
- var filter;
3357
+ // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
3358
+ // not the initial event target in the shadow tree. Note that not all events cross the
3359
+ // shadow boundary.
3360
+ // For shadow trees with `mode: 'open'`, the initial event target is the first element in
3361
+ // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
3362
+ // target cannot be obtained.
3363
+ if ('composedPath' in e && typeof e.composedPath === 'function') {
3364
+ // For open shadow trees, update `element` so that the following check works.
3365
+ var initialEventTarget = e.composedPath()[0];
3366
+ if (initialEventTarget !== e.target) {
3367
+ element = initialEventTarget;
3368
+ }
3369
+ }
5751
3370
 
5752
- if (typeof options.filter === 'function') {
5753
- filter = options.filter;
5754
- obj = filter('', obj);
5755
- } else if (isArray$1(options.filter)) {
5756
- filter = options.filter;
5757
- objKeys = filter;
5758
- }
3371
+ // stop for input, select, and textarea
3372
+ return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
3373
+ };
5759
3374
 
5760
- var keys = [];
3375
+ /**
3376
+ * exposes _handleKey publicly so it can be overwritten by extensions
3377
+ */
3378
+ Mousetrap.prototype.handleKey = function() {
3379
+ var self = this;
3380
+ return self._handleKey.apply(self, arguments);
3381
+ };
5761
3382
 
5762
- if (typeof obj !== 'object' || obj === null) {
5763
- return '';
5764
- }
3383
+ /**
3384
+ * allow custom key mappings
3385
+ */
3386
+ Mousetrap.addKeycodes = function(object) {
3387
+ for (var key in object) {
3388
+ if (object.hasOwnProperty(key)) {
3389
+ _MAP[key] = object[key];
3390
+ }
3391
+ }
3392
+ _REVERSE_MAP = null;
3393
+ };
5765
3394
 
5766
- var arrayFormat;
5767
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
5768
- arrayFormat = opts.arrayFormat;
5769
- } else if (opts && 'indices' in opts) {
5770
- arrayFormat = opts.indices ? 'indices' : 'repeat';
5771
- } else {
5772
- arrayFormat = 'indices';
5773
- }
3395
+ /**
3396
+ * Init the global mousetrap functions
3397
+ *
3398
+ * This method is needed to allow the global mousetrap functions to work
3399
+ * now that mousetrap is a constructor function.
3400
+ */
3401
+ Mousetrap.init = function() {
3402
+ var documentMousetrap = Mousetrap(document);
3403
+ for (var method in documentMousetrap) {
3404
+ if (method.charAt(0) !== '_') {
3405
+ Mousetrap[method] = (function(method) {
3406
+ return function() {
3407
+ return documentMousetrap[method].apply(documentMousetrap, arguments);
3408
+ };
3409
+ } (method));
3410
+ }
3411
+ }
3412
+ };
5774
3413
 
5775
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
5776
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
5777
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
5778
- }
5779
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
3414
+ Mousetrap.init();
5780
3415
 
5781
- if (!objKeys) {
5782
- objKeys = Object.keys(obj);
5783
- }
3416
+ // expose mousetrap to the global object
3417
+ window.Mousetrap = Mousetrap;
5784
3418
 
5785
- if (options.sort) {
5786
- objKeys.sort(options.sort);
5787
- }
3419
+ // expose as a common js module
3420
+ if (module.exports) {
3421
+ module.exports = Mousetrap;
3422
+ }
5788
3423
 
5789
- var sideChannel = getSideChannel();
5790
- for (var i = 0; i < objKeys.length; ++i) {
5791
- var key = objKeys[i];
3424
+ // expose mousetrap as an AMD module
3425
+ if (typeof undefined$1 === 'function' && undefined$1.amd) {
3426
+ undefined$1(function() {
3427
+ return Mousetrap;
3428
+ });
3429
+ }
3430
+ }) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
3431
+ } (mousetrap));
5792
3432
 
5793
- if (options.skipNulls && obj[key] === null) {
5794
- continue;
5795
- }
5796
- pushToArray(keys, stringify$4(
5797
- obj[key],
5798
- key,
5799
- generateArrayPrefix,
5800
- commaRoundTrip,
5801
- options.strictNullHandling,
5802
- options.skipNulls,
5803
- options.encode ? options.encoder : null,
5804
- options.filter,
5805
- options.sort,
5806
- options.allowDots,
5807
- options.serializeDate,
5808
- options.format,
5809
- options.formatter,
5810
- options.encodeValuesOnly,
5811
- options.charset,
5812
- sideChannel
5813
- ));
5814
- }
3433
+ var Mousetrap$1 = mousetrap.exports;
5815
3434
 
5816
- var joined = keys.join(options.delimiter);
5817
- var prefix = options.addQueryPrefix === true ? '?' : '';
3435
+ /**
3436
+ * adds a bindGlobal method to Mousetrap that allows you to
3437
+ * bind specific keyboard shortcuts that will still work
3438
+ * inside a text input field
3439
+ *
3440
+ * usage:
3441
+ * Mousetrap.bindGlobal('ctrl+s', _saveChanges);
3442
+ */
3443
+ /* global Mousetrap:true */
3444
+ (function(Mousetrap) {
3445
+ var _globalCallbacks = {};
3446
+ var _originalStopCallback = Mousetrap.prototype.stopCallback;
3447
+
3448
+ Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
3449
+ var self = this;
3450
+
3451
+ if (self.paused) {
3452
+ return true;
3453
+ }
3454
+
3455
+ if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
3456
+ return false;
3457
+ }
3458
+
3459
+ return _originalStopCallback.call(self, e, element, combo);
3460
+ };
3461
+
3462
+ Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
3463
+ var self = this;
3464
+ self.bind(keys, callback, action);
3465
+
3466
+ if (keys instanceof Array) {
3467
+ for (var i = 0; i < keys.length; i++) {
3468
+ _globalCallbacks[keys[i]] = true;
3469
+ }
3470
+ return;
3471
+ }
3472
+
3473
+ _globalCallbacks[keys] = true;
3474
+ };
3475
+
3476
+ Mousetrap.prototype.unbindGlobal = function(keys, action) {
3477
+ var self = this;
3478
+ self.unbind(keys, action);
3479
+
3480
+ if (keys instanceof Array) {
3481
+ for (var i = 0; i < keys.length; i++) {
3482
+ _globalCallbacks[keys[i]] = false;
3483
+ }
3484
+ return;
3485
+ }
3486
+
3487
+ _globalCallbacks[keys] = false;
3488
+ };
3489
+
3490
+ Mousetrap.init();
3491
+ }) (Mousetrap);
5818
3492
 
5819
- if (options.charsetSentinel) {
5820
- if (options.charset === 'iso-8859-1') {
5821
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
5822
- prefix += 'utf8=%26%2310003%3B&';
5823
- } else {
5824
- // encodeURIComponent('✓')
5825
- prefix += 'utf8=%E2%9C%93&';
5826
- }
5827
- }
3493
+ var MAC_TO_WINDOWS_KEYS_MAP = {
3494
+ option: "alt",
3495
+ command: "ctrl",
3496
+ "return": "enter",
3497
+ "delete": "backspace"
3498
+ };
3499
+ var OS = {
3500
+ mac: "OS X",
3501
+ windows: "Windows"
3502
+ };
5828
3503
 
5829
- return joined.length > 0 ? prefix + joined : '';
3504
+ var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
3505
+ var _platformInfo$os, _platformInfo$os$fami;
3506
+ var platformInfo = platform.parse(navigator.userAgent);
3507
+ var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
3508
+ if (isOSX) return hotkey;
3509
+ var hotkeyForWindows = hotkey;
3510
+ ramda.toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
3511
+ var _ref2 = _slicedToArray(_ref, 2),
3512
+ macKey = _ref2[0],
3513
+ windowsKey = _ref2[1];
3514
+ hotkeyForWindows = hotkeyForWindows.replaceAll(macKey, windowsKey);
3515
+ });
3516
+ return hotkeyForWindows;
5830
3517
  };
5831
3518
 
5832
- var utils = utils$2;
5833
-
5834
- var has = Object.prototype.hasOwnProperty;
5835
- var isArray = Array.isArray;
5836
-
5837
- var defaults$1 = {
5838
- allowDots: false,
5839
- allowPrototypes: false,
5840
- allowSparse: false,
5841
- arrayLimit: 20,
5842
- charset: 'utf-8',
5843
- charsetSentinel: false,
5844
- comma: false,
5845
- decoder: utils.decode,
5846
- delimiter: '&',
5847
- depth: 5,
5848
- ignoreQueryPrefix: false,
5849
- interpretNumericEntities: false,
5850
- parameterLimit: 1000,
5851
- parseArrays: true,
5852
- plainObjects: false,
5853
- strictNullHandling: false
3519
+ var MODES$1 = {
3520
+ "default": "default",
3521
+ global: "global",
3522
+ scoped: "scoped"
3523
+ };
3524
+ var DEFAULT_CONFIG = {
3525
+ mode: MODES$1["default"],
3526
+ unbindOnUnmount: true,
3527
+ enabled: true
5854
3528
  };
5855
3529
 
5856
- var interpretNumericEntities = function (str) {
5857
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
5858
- return String.fromCharCode(parseInt(numberStr, 10));
3530
+ var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
3531
+ var ref = React.useRef(null);
3532
+ var convertedHotkey = convertHotkeyToUsersPlatform(hotkey);
3533
+ var config = ramda.mergeLeft(userConfig, DEFAULT_CONFIG);
3534
+ React.useEffect(function () {
3535
+ config.enabled && bindHotKey({
3536
+ mode: config.mode,
3537
+ hotkey: convertedHotkey,
3538
+ handler: handler,
3539
+ ref: ref
5859
3540
  });
3541
+ return function () {
3542
+ config.unbindOnUnmount && unBindHotKey(config.mode, convertedHotkey);
3543
+ };
3544
+ }, [handler, config.mode, convertedHotkey, config]);
3545
+ return config.mode === MODES$1.scoped ? ref : null;
5860
3546
  };
5861
-
5862
- var parseArrayValue = function (val, options) {
5863
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
5864
- return val.split(',');
5865
- }
5866
-
5867
- return val;
3547
+ var bindHotKey = function bindHotKey(_ref) {
3548
+ var mode = _ref.mode,
3549
+ hotkey = _ref.hotkey,
3550
+ handler = _ref.handler,
3551
+ ref = _ref.ref;
3552
+ switch (mode) {
3553
+ case MODES$1.global:
3554
+ Mousetrap$1.bindGlobal(hotkey, handler);
3555
+ break;
3556
+ case MODES$1.scoped:
3557
+ Mousetrap$1(ref.current).bind(hotkey, handler);
3558
+ break;
3559
+ default:
3560
+ Mousetrap$1.bind(hotkey, handler);
3561
+ }
5868
3562
  };
5869
-
5870
- // This is what browsers will submit when the ✓ character occurs in an
5871
- // application/x-www-form-urlencoded body and the encoding of the page containing
5872
- // the form is iso-8859-1, or when the submitted form has an accept-charset
5873
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
5874
- // the ✓ character, such as us-ascii.
5875
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
5876
-
5877
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
5878
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
5879
-
5880
- var parseValues = function parseQueryStringValues(str, options) {
5881
- var obj = {};
5882
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
5883
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
5884
- var parts = cleanStr.split(options.delimiter, limit);
5885
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
5886
- var i;
5887
-
5888
- var charset = options.charset;
5889
- if (options.charsetSentinel) {
5890
- for (i = 0; i < parts.length; ++i) {
5891
- if (parts[i].indexOf('utf8=') === 0) {
5892
- if (parts[i] === charsetSentinel) {
5893
- charset = 'utf-8';
5894
- } else if (parts[i] === isoSentinel) {
5895
- charset = 'iso-8859-1';
5896
- }
5897
- skipIndex = i;
5898
- i = parts.length; // The eslint settings do not allow break;
5899
- }
5900
- }
5901
- }
5902
-
5903
- for (i = 0; i < parts.length; ++i) {
5904
- if (i === skipIndex) {
5905
- continue;
5906
- }
5907
- var part = parts[i];
5908
-
5909
- var bracketEqualsPos = part.indexOf(']=');
5910
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
5911
-
5912
- var key, val;
5913
- if (pos === -1) {
5914
- key = options.decoder(part, defaults$1.decoder, charset, 'key');
5915
- val = options.strictNullHandling ? null : '';
5916
- } else {
5917
- key = options.decoder(part.slice(0, pos), defaults$1.decoder, charset, 'key');
5918
- val = utils.maybeMap(
5919
- parseArrayValue(part.slice(pos + 1), options),
5920
- function (encodedVal) {
5921
- return options.decoder(encodedVal, defaults$1.decoder, charset, 'value');
5922
- }
5923
- );
5924
- }
5925
-
5926
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
5927
- val = interpretNumericEntities(val);
5928
- }
5929
-
5930
- if (part.indexOf('[]=') > -1) {
5931
- val = isArray(val) ? [val] : val;
5932
- }
5933
-
5934
- if (has.call(obj, key)) {
5935
- obj[key] = utils.combine(obj[key], val);
5936
- } else {
5937
- obj[key] = val;
5938
- }
5939
- }
5940
-
5941
- return obj;
3563
+ var unBindHotKey = function unBindHotKey(mode, hotkey) {
3564
+ return mode === MODES$1.global ? Mousetrap$1.unbindGlobal(hotkey) : Mousetrap$1.unbind(hotkey);
5942
3565
  };
5943
3566
 
5944
- var parseObject = function (chain, val, options, valuesParsed) {
5945
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
5946
-
5947
- for (var i = chain.length - 1; i >= 0; --i) {
5948
- var obj;
5949
- var root = chain[i];
5950
-
5951
- if (root === '[]' && options.parseArrays) {
5952
- obj = [].concat(leaf);
5953
- } else {
5954
- obj = options.plainObjects ? Object.create(null) : {};
5955
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
5956
- var index = parseInt(cleanRoot, 10);
5957
- if (!options.parseArrays && cleanRoot === '') {
5958
- obj = { 0: leaf };
5959
- } else if (
5960
- !isNaN(index)
5961
- && root !== cleanRoot
5962
- && String(index) === cleanRoot
5963
- && index >= 0
5964
- && (options.parseArrays && index <= options.arrayLimit)
5965
- ) {
5966
- obj = [];
5967
- obj[index] = leaf;
5968
- } else if (cleanRoot !== '__proto__') {
5969
- obj[cleanRoot] = leaf;
5970
- }
5971
- }
5972
-
5973
- leaf = obj;
5974
- }
3567
+ var useForceUpdate = function useForceUpdate() {
3568
+ // eslint-disable-next-line react/hook-use-state
3569
+ var _useState = React.useState(0),
3570
+ _useState2 = _slicedToArray(_useState, 2),
3571
+ setValue = _useState2[1];
3572
+ return function () {
3573
+ return setValue(function (value) {
3574
+ return value + 1;
3575
+ });
3576
+ };
3577
+ };
5975
3578
 
5976
- return leaf;
3579
+ var useIsElementVisibleInDom = function useIsElementVisibleInDom(target) {
3580
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
3581
+ var _useState = React.useState(false),
3582
+ _useState2 = _slicedToArray(_useState, 2),
3583
+ isIntersecting = _useState2[0],
3584
+ setIsIntersecting = _useState2[1];
3585
+ var forceUpdate = useForceUpdate();
3586
+ React.useEffect(function () {
3587
+ if (!target) return forceUpdate();
3588
+ var observer = new IntersectionObserver(function (_ref) {
3589
+ var _ref2 = _slicedToArray(_ref, 1),
3590
+ entry = _ref2[0];
3591
+ return setIsIntersecting(entry.isIntersecting);
3592
+ }, options);
3593
+ observer.observe(target);
3594
+ return function () {
3595
+ return observer.unobserve(target);
3596
+ };
3597
+ }, [target, options]);
3598
+ return isIntersecting;
5977
3599
  };
5978
3600
 
5979
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
5980
- if (!givenKey) {
5981
- return;
3601
+ function shallow(objA, objB) {
3602
+ if (Object.is(objA, objB)) {
3603
+ return true;
3604
+ }
3605
+ if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
3606
+ return false;
3607
+ }
3608
+ if (objA instanceof Map && objB instanceof Map) {
3609
+ if (objA.size !== objB.size)
3610
+ return false;
3611
+ for (const [key, value] of objA) {
3612
+ if (!Object.is(value, objB.get(key))) {
3613
+ return false;
3614
+ }
5982
3615
  }
5983
-
5984
- // Transform dot notation to bracket notation
5985
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
5986
-
5987
- // The regex chunks
5988
-
5989
- var brackets = /(\[[^[\]]*])/;
5990
- var child = /(\[[^[\]]*])/g;
5991
-
5992
- // Get the parent
5993
-
5994
- var segment = options.depth > 0 && brackets.exec(key);
5995
- var parent = segment ? key.slice(0, segment.index) : key;
5996
-
5997
- // Stash the parent if it exists
5998
-
5999
- var keys = [];
6000
- if (parent) {
6001
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
6002
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
6003
- if (!options.allowPrototypes) {
6004
- return;
6005
- }
6006
- }
6007
-
6008
- keys.push(parent);
3616
+ return true;
3617
+ }
3618
+ if (objA instanceof Set && objB instanceof Set) {
3619
+ if (objA.size !== objB.size)
3620
+ return false;
3621
+ for (const value of objA) {
3622
+ if (!objB.has(value)) {
3623
+ return false;
3624
+ }
6009
3625
  }
6010
-
6011
- // Loop through children appending to the array until we hit depth
6012
-
6013
- var i = 0;
6014
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
6015
- i += 1;
6016
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
6017
- if (!options.allowPrototypes) {
6018
- return;
6019
- }
6020
- }
6021
- keys.push(segment[1]);
3626
+ return true;
3627
+ }
3628
+ const keysA = Object.keys(objA);
3629
+ if (keysA.length !== Object.keys(objB).length) {
3630
+ return false;
3631
+ }
3632
+ for (let i = 0; i < keysA.length; i++) {
3633
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
3634
+ return false;
6022
3635
  }
3636
+ }
3637
+ return true;
3638
+ }
6023
3639
 
6024
- // If there's a remainder, just add whatever is left
6025
-
6026
- if (segment) {
6027
- keys.push('[' + key.slice(segment.index) + ']');
3640
+ var useKeyboardShortcutsStore = create$9(function (set) {
3641
+ return {
3642
+ isOpen: false,
3643
+ setIsOpen: function setIsOpen(arg) {
3644
+ if (typeof arg === "function") {
3645
+ set(function (state) {
3646
+ return {
3647
+ isOpen: arg(state.isOpen)
3648
+ };
3649
+ });
3650
+ } else {
3651
+ set({
3652
+ isOpen: arg
3653
+ });
3654
+ }
6028
3655
  }
6029
-
6030
- return parseObject(keys, val, options, valuesParsed);
3656
+ };
3657
+ });
3658
+ var useKeyboardShortcutsPaneState = function useKeyboardShortcutsPaneState() {
3659
+ return useKeyboardShortcutsStore(function (_ref) {
3660
+ var isOpen = _ref.isOpen,
3661
+ setIsOpen = _ref.setIsOpen;
3662
+ return [isOpen, setIsOpen];
3663
+ }, shallow);
6031
3664
  };
6032
3665
 
6033
- var normalizeParseOptions = function normalizeParseOptions(opts) {
6034
- if (!opts) {
6035
- return defaults$1;
6036
- }
6037
-
6038
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
6039
- throw new TypeError('Decoder has to be a function.');
6040
- }
6041
-
6042
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
6043
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
6044
- }
6045
- var charset = typeof opts.charset === 'undefined' ? defaults$1.charset : opts.charset;
6046
-
6047
- return {
6048
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
6049
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults$1.allowPrototypes,
6050
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults$1.allowSparse,
6051
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults$1.arrayLimit,
6052
- charset: charset,
6053
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
6054
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults$1.comma,
6055
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults$1.decoder,
6056
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults$1.delimiter,
6057
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
6058
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults$1.depth,
6059
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
6060
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults$1.interpretNumericEntities,
6061
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$1.parameterLimit,
6062
- parseArrays: opts.parseArrays !== false,
6063
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults$1.plainObjects,
6064
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
3666
+ var useOnClickOutside = function useOnClickOutside(ref, handler) {
3667
+ React.useEffect(function () {
3668
+ var listener = function listener(event) {
3669
+ // Do nothing if clicking ref's element or descendent elements
3670
+ if (!ref.current || ref.current.contains(event.target)) {
3671
+ return;
3672
+ }
3673
+ handler(event);
3674
+ };
3675
+ document.addEventListener("mousedown", listener);
3676
+ document.addEventListener("touchstart", listener);
3677
+ return function () {
3678
+ document.removeEventListener("mousedown", listener);
3679
+ document.removeEventListener("touchstart", listener);
6065
3680
  };
3681
+ }, [handler]);
6066
3682
  };
6067
3683
 
6068
- var parse$5 = function (str, opts) {
6069
- var options = normalizeParseOptions(opts);
6070
-
6071
- if (str === '' || str === null || typeof str === 'undefined') {
6072
- return options.plainObjects ? Object.create(null) : {};
6073
- }
6074
-
6075
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
6076
- var obj = options.plainObjects ? Object.create(null) : {};
6077
-
6078
- // Iterate over the keys and setup the new object
6079
-
6080
- var keys = Object.keys(tempObj);
6081
- for (var i = 0; i < keys.length; ++i) {
6082
- var key = keys[i];
6083
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
6084
- obj = utils.merge(obj, newObj, options);
6085
- }
3684
+ var usePrevious = function usePrevious(value) {
3685
+ var ref = React.useRef(value);
3686
+ React.useEffect(function () {
3687
+ ref.current = value;
3688
+ }, [value]);
3689
+ return ref.current;
3690
+ };
6086
3691
 
6087
- if (options.allowSparse === true) {
6088
- return obj;
3692
+ var useUpdateEffect = function useUpdateEffect(callback) {
3693
+ var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3694
+ var isInitialMount = React.useRef(true);
3695
+ React.useEffect(function () {
3696
+ if (isInitialMount.current) {
3697
+ isInitialMount.current = false;
3698
+ return;
6089
3699
  }
6090
-
6091
- return utils.compact(obj);
3700
+ callback();
3701
+ }, dependencies);
6092
3702
  };
6093
3703
 
6094
- var stringify$3 = stringify_1;
6095
- var parse$4 = parse$5;
6096
- var formats = formats$3;
6097
-
6098
- var lib = {
6099
- formats: formats,
6100
- parse: parse$4,
6101
- stringify: stringify$3
3704
+ var DEFAULT_STALE_TIME = 60 * 60 * 1000;
3705
+ var DOMAIN_QUERY_KEY = "custom-domain";
3706
+ var ENTITY_COUNT = {
3707
+ singular: 1,
3708
+ plural: 2
6102
3709
  };
6103
3710
 
6104
- var copyToClipboard = /*#__PURE__*/function () {
6105
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(text) {
6106
- var _ref2,
6107
- _ref2$showToastr,
6108
- showToastr,
6109
- _ref2$message,
6110
- message,
6111
- textArea,
6112
- _args = arguments;
6113
- return regenerator.wrap(function _callee$(_context) {
6114
- while (1) switch (_context.prev = _context.next) {
6115
- case 0:
6116
- _ref2 = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}, _ref2$showToastr = _ref2.showToastr, showToastr = _ref2$showToastr === void 0 ? true : _ref2$showToastr, _ref2$message = _ref2.message, message = _ref2$message === void 0 ? i18next__default["default"].t("neetoCommons.toastr.success.copiedToClipboard") : _ref2$message;
6117
- _context.prev = 1;
6118
- if (!(navigator.clipboard && window.isSecureContext)) {
6119
- _context.next = 7;
6120
- break;
6121
- }
6122
- _context.next = 5;
6123
- return navigator.clipboard.writeText(text);
6124
- case 5:
6125
- _context.next = 17;
6126
- break;
6127
- case 7:
6128
- textArea = document.createElement("textarea");
6129
- textArea.value = text;
6130
- textArea.style.top = "0";
6131
- textArea.style.left = "0";
6132
- textArea.style.position = "fixed";
6133
- document.body.appendChild(textArea);
6134
- textArea.focus();
6135
- textArea.select();
6136
- document.execCommand("copy");
6137
- document.body.removeChild(textArea);
6138
- case 17:
6139
- showToastr && neetoui.Toastr.success(message);
6140
- _context.next = 23;
6141
- break;
6142
- case 20:
6143
- _context.prev = 20;
6144
- _context.t0 = _context["catch"](1);
6145
- neetoui.Toastr.error(_context.t0);
6146
- case 23:
6147
- case "end":
6148
- return _context.stop();
6149
- }
6150
- }, _callee, null, [[1, 20]]);
6151
- }));
6152
- return function copyToClipboard(_x) {
6153
- return _ref.apply(this, arguments);
6154
- };
6155
- }();
6156
- var buildUrl = function buildUrl(route, params) {
6157
- var placeHolders = [];
6158
- ramda.toPairs(params).forEach(function (_ref3) {
6159
- var _ref4 = _slicedToArray(_ref3, 2),
6160
- key = _ref4[0],
6161
- value = _ref4[1];
6162
- if (route.includes(":".concat(key))) {
6163
- placeHolders.push(key);
6164
- route = route.replace(":".concat(key), encodeURIComponent(value));
6165
- }
6166
- });
6167
- var queryParams = ramda.pipe(ramda.omit(placeHolders), preprocessForSerialization, lib.stringify)(params);
6168
- return ramda.isEmpty(queryParams) ? route : "".concat(route, "?").concat(queryParams);
6169
- };
6170
- var joinHyphenCase = function joinHyphenCase() {
6171
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6172
- args[_key] = arguments[_key];
6173
- }
6174
- return args.join(" ").replace(/\s+/g, "-").toLowerCase();
3711
+ var HOSTNAME_REGEX = /^(?!-)[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+/;
3712
+ var INITIAL_VALUES$1 = {
3713
+ hostname: ""
6175
3714
  };
3715
+ var CUSTOM_DOMAIN_VALIDATION_SCHEMA = yup__namespace.object().shape({
3716
+ hostname: yup__namespace.string().required(i18next.t("neetoCommons.customDomain.formikValidation.required")).matches(HOSTNAME_REGEX, i18next.t("neetoCommons.customDomain.formikValidation.valid"))
3717
+ });
6176
3718
 
6177
3719
  var classnames$1 = {exports: {}};
6178
3720
 
@@ -6244,7 +3786,7 @@ var TagBlock = function TagBlock(_ref) {
6244
3786
  var _useTranslation = reactI18next.useTranslation(),
6245
3787
  t = _useTranslation.t;
6246
3788
  var isTxtValidated = status === "active" || status === "pending_cname_validation";
6247
- var camelCasedStatus = snakeToCamelCase(status || "");
3789
+ var camelCasedStatus = pure$1.snakeToCamelCase(status || "");
6248
3790
  return /*#__PURE__*/React__default["default"].createElement("div", {
6249
3791
  className: classnames("flex gap-2", {
6250
3792
  "flex-col items-start": stacked
@@ -6364,62 +3906,31 @@ var Record = function Record(_ref) {
6364
3906
  style: "info"
6365
3907
  }, recordDescription), /*#__PURE__*/React__default["default"].createElement(neetoui.Input, {
6366
3908
  disabled: true,
6367
- "data-cy": joinHyphenCase(recordNameLabel),
3909
+ "data-cy": utils.joinHyphenCase(recordNameLabel),
6368
3910
  label: recordNameLabel,
6369
3911
  value: recordName,
6370
3912
  suffix: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
6371
3913
  icon: neetoIcons.Copy,
6372
3914
  style: "text",
6373
3915
  onClick: function onClick() {
6374
- return copyToClipboard(recordName);
3916
+ return utils.copyToClipboard(recordName);
6375
3917
  }
6376
3918
  })
6377
3919
  }), /*#__PURE__*/React__default["default"].createElement(neetoui.Input, {
6378
3920
  disabled: true,
6379
- "data-cy": joinHyphenCase(recordValueLabel),
3921
+ "data-cy": utils.joinHyphenCase(recordValueLabel),
6380
3922
  label: recordValueLabel,
6381
3923
  value: recordValue,
6382
3924
  suffix: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
6383
3925
  icon: neetoIcons.Copy,
6384
3926
  style: "text",
6385
3927
  onClick: function onClick() {
6386
- return copyToClipboard(recordValue);
3928
+ return utils.copyToClipboard(recordValue);
6387
3929
  }
6388
3930
  })
6389
3931
  }));
6390
3932
  };
6391
3933
 
6392
- dayjs__default["default"].extend(relativeTime__default["default"]);
6393
- dayjs__default["default"].extend(updateLocale__default["default"]);
6394
- var timeFormat = {
6395
- fromNow: function fromNow(time) {
6396
- return dayjs__default["default"](time).fromNow();
6397
- },
6398
- time: function time(_time) {
6399
- return dayjs__default["default"](_time).format("h:mm A");
6400
- },
6401
- date: function date(time) {
6402
- return dayjs__default["default"](time).format("MMM D, YYYY");
6403
- },
6404
- dateWeek: function dateWeek(time) {
6405
- return dayjs__default["default"](time).format("MMM D, YYYY ddd");
6406
- },
6407
- dateWeekWithoutYear: function dateWeekWithoutYear(time) {
6408
- return dayjs__default["default"](time).format("MMM D, ddd");
6409
- },
6410
- dateTime: function dateTime(time) {
6411
- return dayjs__default["default"](time).format("MMM D, YYYY h:mm A");
6412
- },
6413
- dateWeekTime: function dateWeekTime(time) {
6414
- return dayjs__default["default"](time).format("MMM D, YYYY ddd h:mm A");
6415
- },
6416
- extended: function extended(time) {
6417
- var dateTime = dayjs__default["default"](time).format("dddd MMMM D, YYYY h:mm A");
6418
- var fromNow = dayjs__default["default"](time).fromNow();
6419
- return "".concat(dateTime, " (").concat(fromNow, ")");
6420
- }
6421
- };
6422
-
6423
3934
  var CustomDomainInfo = function CustomDomainInfo(_ref) {
6424
3935
  var time = _ref.time;
6425
3936
  var _useTranslation = reactI18next.useTranslation(),
@@ -6438,7 +3949,7 @@ var CustomDomainInfo = function CustomDomainInfo(_ref) {
6438
3949
  icon: neetoIcons.Info,
6439
3950
  style: "info"
6440
3951
  }, t("neetoCommons.customDomain.messageBlock.cnameAddedTime", {
6441
- time: timeFormat.fromNow(time)
3952
+ time: utils.timeFormat.fromNow(time)
6442
3953
  })));
6443
3954
  };
6444
3955
 
@@ -6728,7 +4239,7 @@ var CustomDomain = function CustomDomain(_ref) {
6728
4239
  })
6729
4240
  }, headerProps)), isLoading && /*#__PURE__*/React__default["default"].createElement("div", {
6730
4241
  className: "w-full h-screen"
6731
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.PageLoader, null)), !isLoading && (isNotEmpty(data === null || data === void 0 ? void 0 : data.customDomains) ? /*#__PURE__*/React__default["default"].createElement("div", {
4242
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.PageLoader, null)), !isLoading && (pure$1.isNotEmpty(data === null || data === void 0 ? void 0 : data.customDomains) ? /*#__PURE__*/React__default["default"].createElement("div", {
6732
4243
  className: "w-full flex-grow"
6733
4244
  }, /*#__PURE__*/React__default["default"].createElement(layouts.SubHeader, {
6734
4245
  leftActionBlock: /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
@@ -6792,8 +4303,8 @@ var CustomDomain = function CustomDomain(_ref) {
6792
4303
  }));
6793
4304
  };
6794
4305
 
6795
- var DateFormat = ramda.fromPairs(ramda.keys(timeFormat).map(function (key) {
6796
- return [capitalize(key), function (_ref) {
4306
+ var DateFormat = ramda.fromPairs(ramda.keys(utils.timeFormat).map(function (key) {
4307
+ return [pure$1.capitalize(key), function (_ref) {
6797
4308
  var date = _ref.date,
6798
4309
  _ref$tooltipProps = _ref.tooltipProps,
6799
4310
  tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
@@ -6802,9 +4313,9 @@ var DateFormat = ramda.fromPairs(ramda.keys(timeFormat).map(function (key) {
6802
4313
  var dateDisplay = /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, _extends$4({
6803
4314
  component: "span",
6804
4315
  style: "body2"
6805
- }, typographyProps), timeFormat[key](date));
4316
+ }, typographyProps), utils.timeFormat[key](date));
6806
4317
  return key === "extended" ? dateDisplay : /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, _extends$4({
6807
- content: timeFormat.extended(date),
4318
+ content: utils.timeFormat.extended(date),
6808
4319
  position: "top"
6809
4320
  }, tooltipProps), dateDisplay);
6810
4321
  }];
@@ -10496,16 +8007,16 @@ var HotKeyList = function HotKeyList(_ref) {
10496
8007
  var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
10497
8008
  var _ref$productShortcuts = _ref.productShortcuts,
10498
8009
  productShortcuts = _ref$productShortcuts === void 0 ? {} : _ref$productShortcuts;
10499
- var _useState = React.useState(false),
10500
- _useState2 = _slicedToArray(_useState, 2),
10501
- isOpen = _useState2[0],
10502
- setIsOpen = _useState2[1];
8010
+ var _useKeyboardShortcuts = useKeyboardShortcutsPaneState(),
8011
+ _useKeyboardShortcuts2 = _slicedToArray(_useKeyboardShortcuts, 2),
8012
+ isOpen = _useKeyboardShortcuts2[0],
8013
+ setIsOpen = _useKeyboardShortcuts2[1];
10503
8014
  var hasOverlays = managers.manager.hasOverlays();
10504
8015
  var GLOBAL_SHORTCUTS = getGlobalShortcuts();
10505
8016
  var shortcuts = GLOBAL_SHORTCUTS[i18next__default["default"].t("neetoCommons.keyboardShortcuts.global.categoryName")];
10506
8017
  useHotKeys(shortcuts.openKeyboardShortcutsPane.sequence, function () {
10507
- return setIsOpen(function (prevState) {
10508
- return !prevState;
8018
+ return setIsOpen(function (prevIsOpen) {
8019
+ return !prevIsOpen;
10509
8020
  });
10510
8021
  }, {
10511
8022
  mode: "global"
@@ -10517,7 +8028,7 @@ var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
10517
8028
  });
10518
8029
  return /*#__PURE__*/React__default["default"].createElement("div", {
10519
8030
  className: classnames("neeto-commons-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll", {
10520
- "w-96": isOpen,
8031
+ "w-80": isOpen,
10521
8032
  "w-0": !isOpen,
10522
8033
  absolute: hasOverlays,
10523
8034
  "right-0": hasOverlays
@@ -11630,7 +9141,7 @@ class TokenTreeEmitter extends TokenTree {
11630
9141
  * @param {string} value
11631
9142
  * @returns {RegExp}
11632
9143
  * */
11633
- function escape$1(value) {
9144
+ function escape(value) {
11634
9145
  return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm');
11635
9146
  }
11636
9147
 
@@ -12791,7 +10302,7 @@ Syntax highlighting with language autodetection.
12791
10302
  https://highlightjs.org/
12792
10303
  */
12793
10304
 
12794
- const escape$1$1 = escapeHTML;
10305
+ const escape$1 = escapeHTML;
12795
10306
  const inherit$1 = inherit;
12796
10307
  const NO_MATCH = Symbol("nomatch");
12797
10308
 
@@ -13101,7 +10612,7 @@ const HLJS = function(hljs) {
13101
10612
  }
13102
10613
 
13103
10614
  if (newMode && newMode.endSameAsBegin) {
13104
- newMode.endRe = escape$1(lexeme);
10615
+ newMode.endRe = escape(lexeme);
13105
10616
  }
13106
10617
 
13107
10618
  if (newMode.skip) {
@@ -13330,14 +10841,14 @@ const HLJS = function(hljs) {
13330
10841
  },
13331
10842
  sofar: result,
13332
10843
  relevance: 0,
13333
- value: escape$1$1(codeToHighlight),
10844
+ value: escape$1(codeToHighlight),
13334
10845
  emitter: emitter
13335
10846
  };
13336
10847
  } else if (SAFE_MODE) {
13337
10848
  return {
13338
10849
  illegal: false,
13339
10850
  relevance: 0,
13340
- value: escape$1$1(codeToHighlight),
10851
+ value: escape$1(codeToHighlight),
13341
10852
  emitter: emitter,
13342
10853
  language: languageName,
13343
10854
  top: top,
@@ -13360,7 +10871,7 @@ const HLJS = function(hljs) {
13360
10871
  const result = {
13361
10872
  relevance: 0,
13362
10873
  emitter: new options.__emitter(options),
13363
- value: escape$1$1(code),
10874
+ value: escape$1(code),
13364
10875
  illegal: false,
13365
10876
  top: PLAINTEXT_LANGUAGE
13366
10877
  };
@@ -59060,6 +56571,37 @@ var supportedLanguages$1 = ['1c', 'abnf', 'accesslog', 'actionscript', 'ada', 'a
59060
56571
  var highlighter$1 = highlight$3(lowlight, defaultStyle$1);
59061
56572
  highlighter$1.supportedLanguages = supportedLanguages$1;
59062
56573
 
56574
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
56575
+ try {
56576
+ var info = gen[key](arg);
56577
+ var value = info.value;
56578
+ } catch (error) {
56579
+ reject(error);
56580
+ return;
56581
+ }
56582
+ if (info.done) {
56583
+ resolve(value);
56584
+ } else {
56585
+ Promise.resolve(value).then(_next, _throw);
56586
+ }
56587
+ }
56588
+ function _asyncToGenerator(fn) {
56589
+ return function () {
56590
+ var self = this,
56591
+ args = arguments;
56592
+ return new Promise(function (resolve, reject) {
56593
+ var gen = fn.apply(self, args);
56594
+ function _next(value) {
56595
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
56596
+ }
56597
+ function _throw(err) {
56598
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
56599
+ }
56600
+ _next(undefined);
56601
+ });
56602
+ };
56603
+ }
56604
+
59063
56605
  function _classCallCheck(instance, Constructor) {
59064
56606
  if (!(instance instanceof Constructor)) {
59065
56607
  throw new TypeError("Cannot call a class as a function");
@@ -59132,6 +56674,345 @@ function _getPrototypeOf(o) {
59132
56674
  return _getPrototypeOf(o);
59133
56675
  }
59134
56676
 
56677
+ var regeneratorRuntime$1 = {exports: {}};
56678
+
56679
+ var _typeof = {exports: {}};
56680
+
56681
+ (function (module) {
56682
+ function _typeof(obj) {
56683
+ "@babel/helpers - typeof";
56684
+
56685
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
56686
+ return typeof obj;
56687
+ } : function (obj) {
56688
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
56689
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
56690
+ }
56691
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
56692
+ } (_typeof));
56693
+
56694
+ (function (module) {
56695
+ var _typeof$1 = _typeof.exports["default"];
56696
+ function _regeneratorRuntime() {
56697
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
56698
+ return exports;
56699
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
56700
+ var exports = {},
56701
+ Op = Object.prototype,
56702
+ hasOwn = Op.hasOwnProperty,
56703
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
56704
+ obj[key] = desc.value;
56705
+ },
56706
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
56707
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
56708
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
56709
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
56710
+ function define(obj, key, value) {
56711
+ return Object.defineProperty(obj, key, {
56712
+ value: value,
56713
+ enumerable: !0,
56714
+ configurable: !0,
56715
+ writable: !0
56716
+ }), obj[key];
56717
+ }
56718
+ try {
56719
+ define({}, "");
56720
+ } catch (err) {
56721
+ define = function define(obj, key, value) {
56722
+ return obj[key] = value;
56723
+ };
56724
+ }
56725
+ function wrap(innerFn, outerFn, self, tryLocsList) {
56726
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
56727
+ generator = Object.create(protoGenerator.prototype),
56728
+ context = new Context(tryLocsList || []);
56729
+ return defineProperty(generator, "_invoke", {
56730
+ value: makeInvokeMethod(innerFn, self, context)
56731
+ }), generator;
56732
+ }
56733
+ function tryCatch(fn, obj, arg) {
56734
+ try {
56735
+ return {
56736
+ type: "normal",
56737
+ arg: fn.call(obj, arg)
56738
+ };
56739
+ } catch (err) {
56740
+ return {
56741
+ type: "throw",
56742
+ arg: err
56743
+ };
56744
+ }
56745
+ }
56746
+ exports.wrap = wrap;
56747
+ var ContinueSentinel = {};
56748
+ function Generator() {}
56749
+ function GeneratorFunction() {}
56750
+ function GeneratorFunctionPrototype() {}
56751
+ var IteratorPrototype = {};
56752
+ define(IteratorPrototype, iteratorSymbol, function () {
56753
+ return this;
56754
+ });
56755
+ var getProto = Object.getPrototypeOf,
56756
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
56757
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
56758
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
56759
+ function defineIteratorMethods(prototype) {
56760
+ ["next", "throw", "return"].forEach(function (method) {
56761
+ define(prototype, method, function (arg) {
56762
+ return this._invoke(method, arg);
56763
+ });
56764
+ });
56765
+ }
56766
+ function AsyncIterator(generator, PromiseImpl) {
56767
+ function invoke(method, arg, resolve, reject) {
56768
+ var record = tryCatch(generator[method], generator, arg);
56769
+ if ("throw" !== record.type) {
56770
+ var result = record.arg,
56771
+ value = result.value;
56772
+ return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
56773
+ invoke("next", value, resolve, reject);
56774
+ }, function (err) {
56775
+ invoke("throw", err, resolve, reject);
56776
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
56777
+ result.value = unwrapped, resolve(result);
56778
+ }, function (error) {
56779
+ return invoke("throw", error, resolve, reject);
56780
+ });
56781
+ }
56782
+ reject(record.arg);
56783
+ }
56784
+ var previousPromise;
56785
+ defineProperty(this, "_invoke", {
56786
+ value: function value(method, arg) {
56787
+ function callInvokeWithMethodAndArg() {
56788
+ return new PromiseImpl(function (resolve, reject) {
56789
+ invoke(method, arg, resolve, reject);
56790
+ });
56791
+ }
56792
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
56793
+ }
56794
+ });
56795
+ }
56796
+ function makeInvokeMethod(innerFn, self, context) {
56797
+ var state = "suspendedStart";
56798
+ return function (method, arg) {
56799
+ if ("executing" === state) throw new Error("Generator is already running");
56800
+ if ("completed" === state) {
56801
+ if ("throw" === method) throw arg;
56802
+ return doneResult();
56803
+ }
56804
+ for (context.method = method, context.arg = arg;;) {
56805
+ var delegate = context.delegate;
56806
+ if (delegate) {
56807
+ var delegateResult = maybeInvokeDelegate(delegate, context);
56808
+ if (delegateResult) {
56809
+ if (delegateResult === ContinueSentinel) continue;
56810
+ return delegateResult;
56811
+ }
56812
+ }
56813
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
56814
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
56815
+ context.dispatchException(context.arg);
56816
+ } else "return" === context.method && context.abrupt("return", context.arg);
56817
+ state = "executing";
56818
+ var record = tryCatch(innerFn, self, context);
56819
+ if ("normal" === record.type) {
56820
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
56821
+ return {
56822
+ value: record.arg,
56823
+ done: context.done
56824
+ };
56825
+ }
56826
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
56827
+ }
56828
+ };
56829
+ }
56830
+ function maybeInvokeDelegate(delegate, context) {
56831
+ var methodName = context.method,
56832
+ method = delegate.iterator[methodName];
56833
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
56834
+ var record = tryCatch(method, delegate.iterator, context.arg);
56835
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
56836
+ var info = record.arg;
56837
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
56838
+ }
56839
+ function pushTryEntry(locs) {
56840
+ var entry = {
56841
+ tryLoc: locs[0]
56842
+ };
56843
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
56844
+ }
56845
+ function resetTryEntry(entry) {
56846
+ var record = entry.completion || {};
56847
+ record.type = "normal", delete record.arg, entry.completion = record;
56848
+ }
56849
+ function Context(tryLocsList) {
56850
+ this.tryEntries = [{
56851
+ tryLoc: "root"
56852
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
56853
+ }
56854
+ function values(iterable) {
56855
+ if (iterable) {
56856
+ var iteratorMethod = iterable[iteratorSymbol];
56857
+ if (iteratorMethod) return iteratorMethod.call(iterable);
56858
+ if ("function" == typeof iterable.next) return iterable;
56859
+ if (!isNaN(iterable.length)) {
56860
+ var i = -1,
56861
+ next = function next() {
56862
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
56863
+ return next.value = undefined, next.done = !0, next;
56864
+ };
56865
+ return next.next = next;
56866
+ }
56867
+ }
56868
+ return {
56869
+ next: doneResult
56870
+ };
56871
+ }
56872
+ function doneResult() {
56873
+ return {
56874
+ value: undefined,
56875
+ done: !0
56876
+ };
56877
+ }
56878
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
56879
+ value: GeneratorFunctionPrototype,
56880
+ configurable: !0
56881
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
56882
+ value: GeneratorFunction,
56883
+ configurable: !0
56884
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
56885
+ var ctor = "function" == typeof genFun && genFun.constructor;
56886
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
56887
+ }, exports.mark = function (genFun) {
56888
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
56889
+ }, exports.awrap = function (arg) {
56890
+ return {
56891
+ __await: arg
56892
+ };
56893
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
56894
+ return this;
56895
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
56896
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
56897
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
56898
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
56899
+ return result.done ? result.value : iter.next();
56900
+ });
56901
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
56902
+ return this;
56903
+ }), define(Gp, "toString", function () {
56904
+ return "[object Generator]";
56905
+ }), exports.keys = function (val) {
56906
+ var object = Object(val),
56907
+ keys = [];
56908
+ for (var key in object) keys.push(key);
56909
+ return keys.reverse(), function next() {
56910
+ for (; keys.length;) {
56911
+ var key = keys.pop();
56912
+ if (key in object) return next.value = key, next.done = !1, next;
56913
+ }
56914
+ return next.done = !0, next;
56915
+ };
56916
+ }, exports.values = values, Context.prototype = {
56917
+ constructor: Context,
56918
+ reset: function reset(skipTempReset) {
56919
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
56920
+ },
56921
+ stop: function stop() {
56922
+ this.done = !0;
56923
+ var rootRecord = this.tryEntries[0].completion;
56924
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
56925
+ return this.rval;
56926
+ },
56927
+ dispatchException: function dispatchException(exception) {
56928
+ if (this.done) throw exception;
56929
+ var context = this;
56930
+ function handle(loc, caught) {
56931
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
56932
+ }
56933
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
56934
+ var entry = this.tryEntries[i],
56935
+ record = entry.completion;
56936
+ if ("root" === entry.tryLoc) return handle("end");
56937
+ if (entry.tryLoc <= this.prev) {
56938
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
56939
+ hasFinally = hasOwn.call(entry, "finallyLoc");
56940
+ if (hasCatch && hasFinally) {
56941
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
56942
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
56943
+ } else if (hasCatch) {
56944
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
56945
+ } else {
56946
+ if (!hasFinally) throw new Error("try statement without catch or finally");
56947
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
56948
+ }
56949
+ }
56950
+ }
56951
+ },
56952
+ abrupt: function abrupt(type, arg) {
56953
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
56954
+ var entry = this.tryEntries[i];
56955
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
56956
+ var finallyEntry = entry;
56957
+ break;
56958
+ }
56959
+ }
56960
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
56961
+ var record = finallyEntry ? finallyEntry.completion : {};
56962
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
56963
+ },
56964
+ complete: function complete(record, afterLoc) {
56965
+ if ("throw" === record.type) throw record.arg;
56966
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
56967
+ },
56968
+ finish: function finish(finallyLoc) {
56969
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
56970
+ var entry = this.tryEntries[i];
56971
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
56972
+ }
56973
+ },
56974
+ "catch": function _catch(tryLoc) {
56975
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
56976
+ var entry = this.tryEntries[i];
56977
+ if (entry.tryLoc === tryLoc) {
56978
+ var record = entry.completion;
56979
+ if ("throw" === record.type) {
56980
+ var thrown = record.arg;
56981
+ resetTryEntry(entry);
56982
+ }
56983
+ return thrown;
56984
+ }
56985
+ }
56986
+ throw new Error("illegal catch attempt");
56987
+ },
56988
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
56989
+ return this.delegate = {
56990
+ iterator: values(iterable),
56991
+ resultName: resultName,
56992
+ nextLoc: nextLoc
56993
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
56994
+ }
56995
+ }, exports;
56996
+ }
56997
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
56998
+ } (regeneratorRuntime$1));
56999
+
57000
+ // TODO(Babel 8): Remove this file.
57001
+
57002
+ var runtime = regeneratorRuntime$1.exports();
57003
+ var regenerator = runtime;
57004
+
57005
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
57006
+ try {
57007
+ regeneratorRuntime = runtime;
57008
+ } catch (accidentalStrictMode) {
57009
+ if (typeof globalThis === "object") {
57010
+ globalThis.regeneratorRuntime = runtime;
57011
+ } else {
57012
+ Function("r", "regeneratorRuntime = r")(runtime);
57013
+ }
57014
+ }
57015
+
59135
57016
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
59136
57017
 
59137
57018
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
@@ -93117,7 +90998,7 @@ var CodeBlock = function CodeBlock(_ref) {
93117
90998
  style: "primary",
93118
90999
  label: isCopied ? t("neetoCommons.widget.installation.snippet.copied") : t("neetoCommons.widget.installation.snippet.copy"),
93119
91000
  onClick: function onClick() {
93120
- return copyToClipboard(codeString);
91001
+ return utils.copyToClipboard(codeString);
93121
91002
  }
93122
91003
  }))), /*#__PURE__*/React__default["default"].createElement(SyntaxHighlighter, {
93123
91004
  className: "neeto-ui-bg-gray-800 m-0",
@@ -93225,7 +91106,7 @@ var getEmailWidgetSnippetFormInitialValues = function getEmailWidgetSnippetFormI
93225
91106
  var getSelectedWidgetsCombinedText = function getSelectedWidgetsCombinedText(widgets) {
93226
91107
  var withHtml = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
93227
91108
  var prefixedWidgets = widgets.map(function (widget) {
93228
- return "neeto".concat(capitalize(widget));
91109
+ return "neeto".concat(pure$1.capitalize(widget));
93229
91110
  });
93230
91111
  if (prefixedWidgets.length === 1) {
93231
91112
  return prefixedWidgets[0];
@@ -93241,7 +91122,7 @@ var CodeSnippet = function CodeSnippet(_ref) {
93241
91122
  var isPaneOpen = _ref.isPaneOpen,
93242
91123
  onClose = _ref.onClose,
93243
91124
  _ref$onSent = _ref.onSent,
93244
- onSent = _ref$onSent === void 0 ? noop$2 : _ref$onSent,
91125
+ onSent = _ref$onSent === void 0 ? pure$1.noop : _ref$onSent,
93245
91126
  codeString = _ref.codeString,
93246
91127
  _ref$subject = _ref.subject,
93247
91128
  subject = _ref$subject === void 0 ? "" : _ref$subject,
@@ -93356,7 +91237,7 @@ var SelectionTabs = function SelectionTabs(_ref) {
93356
91237
  var selectedWidgets = _ref.selectedWidgets,
93357
91238
  updateSelectedWidgets = _ref.updateSelectedWidgets,
93358
91239
  primarySelectedWidget = _ref.primarySelectedWidget;
93359
- var formattedPrimaryWidget = capitalize(WIDGET_TYPES_VALUES.includes(primarySelectedWidget) ? primarySelectedWidget : "");
91240
+ var formattedPrimaryWidget = pure$1.capitalize(WIDGET_TYPES_VALUES.includes(primarySelectedWidget) ? primarySelectedWidget : "");
93360
91241
  var renderSelectedTab = function renderSelectedTab() {
93361
91242
  return WIDGET_TYPES_VALUES.map(function (widget) {
93362
91243
  return /*#__PURE__*/React__default["default"].createElement("div", {
@@ -93364,7 +91245,7 @@ var SelectionTabs = function SelectionTabs(_ref) {
93364
91245
  key: widget
93365
91246
  }, primarySelectedWidget !== widget ? /*#__PURE__*/React__default["default"].createElement(neetoui.Switch, {
93366
91247
  checked: selectedWidgets.includes(widget),
93367
- label: "neeto".concat(capitalize(widget)),
91248
+ label: "neeto".concat(pure$1.capitalize(widget)),
93368
91249
  onChange: function onChange() {
93369
91250
  return updateSelectedWidgets(widget);
93370
91251
  }
@@ -93568,7 +91449,7 @@ var EmbedCode = function EmbedCode(_ref) {
93568
91449
  })
93569
91450
  },
93570
91451
  values: {
93571
- selectedWidgets: isNotEmpty(selectedWidgets) ? getSelectedWidgetsCombinedText(selectedWidgets, true) : "none of the widgets"
91452
+ selectedWidgets: pure$1.isNotEmpty(selectedWidgets) ? getSelectedWidgetsCombinedText(selectedWidgets, true) : "none of the widgets"
93572
91453
  }
93573
91454
  }, "Place the embed code in your HTML file. This will embed the selected widgets in your website."))), enabledWidgets.chat || enabledWidgets.replay ? /*#__PURE__*/React__default["default"].createElement("div", {
93574
91455
  className: "mx-auto w-full max-w-2xl flex-grow flex-col items-center justify-start mb-6"
@@ -93619,7 +91500,7 @@ var EmbedCode = function EmbedCode(_ref) {
93619
91500
  })), /*#__PURE__*/React__default["default"].createElement("div", {
93620
91501
  className: "w-full"
93621
91502
  }, t("neetoCommons.widget.installation.instructions.sessionContext"))) : null, /*#__PURE__*/React__default["default"].createElement(CodeSnippet, _extends$4({
93622
- isPaneOpen: !!emailType && isNotEmpty(selectedWidgets),
91503
+ isPaneOpen: !!emailType && pure$1.isNotEmpty(selectedWidgets),
93623
91504
  onClose: function onClose() {
93624
91505
  return setEmailType(EMAIL_TYPES["null"]);
93625
91506
  }
@@ -93749,6 +91630,37 @@ var PublishBlock = function PublishBlock(_ref) {
93749
91630
  };
93750
91631
  PublishBlock.Alert = AlertBlock;
93751
91632
 
91633
+ dayjs__default["default"].extend(relativeTime__default["default"]);
91634
+ dayjs__default["default"].extend(updateLocale__default["default"]);
91635
+ var timeFormat = {
91636
+ fromNow: function fromNow(time) {
91637
+ return dayjs__default["default"](time).fromNow();
91638
+ },
91639
+ time: function time(_time) {
91640
+ return dayjs__default["default"](_time).format("h:mm A");
91641
+ },
91642
+ date: function date(time) {
91643
+ return dayjs__default["default"](time).format("MMM D, YYYY");
91644
+ },
91645
+ dateWeek: function dateWeek(time) {
91646
+ return dayjs__default["default"](time).format("MMM D, YYYY ddd");
91647
+ },
91648
+ dateWeekWithoutYear: function dateWeekWithoutYear(time) {
91649
+ return dayjs__default["default"](time).format("MMM D, ddd");
91650
+ },
91651
+ dateTime: function dateTime(time) {
91652
+ return dayjs__default["default"](time).format("MMM D, YYYY h:mm A");
91653
+ },
91654
+ dateWeekTime: function dateWeekTime(time) {
91655
+ return dayjs__default["default"](time).format("MMM D, YYYY ddd h:mm A");
91656
+ },
91657
+ extended: function extended(time) {
91658
+ var dateTime = dayjs__default["default"](time).format("dddd MMMM D, YYYY h:mm A");
91659
+ var fromNow = dayjs__default["default"](time).fromNow();
91660
+ return "".concat(dateTime, " (").concat(fromNow, ")");
91661
+ }
91662
+ };
91663
+
93752
91664
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
93753
91665
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
93754
91666
  var REMOVE_SELECT_DOWN_ARROW = {
@@ -93767,6 +91679,7 @@ var BLUR_TEXT_WHEN_SELECT_MENU_IS_OPEN = {
93767
91679
  }
93768
91680
  };
93769
91681
  var SLOT_TIME_FORMAT = "hh:mm A";
91682
+ var END_OF_DAY = "11:59 PM";
93770
91683
 
93771
91684
  var INTERVALS = ["year", "quarter", "month", "week", "day", "hour", "minute", "second"];
93772
91685
 
@@ -93921,7 +91834,7 @@ var findIndicesOfOverlappingRangesInPeriods = function findIndicesOfOverlappingR
93921
91834
  var range1 = _ref2.range1,
93922
91835
  range2 = _ref2.range2,
93923
91836
  periods = _ref2.periods;
93924
- var firstIndex = findIndexBy({
91837
+ var firstIndex = pure$1.findIndexBy({
93925
91838
  startTime: range1.startDate.format(SLOT_TIME_FORMAT)
93926
91839
  }, periods);
93927
91840
  var secondIndex = periods.findIndex(function (slot, index) {
@@ -94001,12 +91914,12 @@ var DisplayAvailability = function DisplayAvailability(_ref) {
94001
91914
  key: day
94002
91915
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
94003
91916
  className: "mt-0.5 w-16 text-gray-700",
94004
- "data-cy": joinHyphenCase(day, "day-text"),
91917
+ "data-cy": utils.joinHyphenCase(day, "day-text"),
94005
91918
  style: "h5",
94006
91919
  weight: "semibold"
94007
91920
  }, t("neetoCommons.schedule.days.".concat(day))), /*#__PURE__*/React__default["default"].createElement("div", {
94008
91921
  className: "flex w-9/12 flex-col items-center space-y-4"
94009
- }, isPresent(periods[day]) ? (_sortPeriodsByKey = sortPeriodsByKey({
91922
+ }, pure$1.isPresent(periods[day]) ? (_sortPeriodsByKey = sortPeriodsByKey({
94010
91923
  periods: periods[day],
94011
91924
  key: "startTime",
94012
91925
  order: "asc"
@@ -94019,7 +91932,7 @@ var DisplayAvailability = function DisplayAvailability(_ref) {
94019
91932
  lineHeight: "relaxed",
94020
91933
  style: "h5",
94021
91934
  weight: "semibold",
94022
- "data-cy": joinHyphenCase(day, period.startTime, "start-time-text")
91935
+ "data-cy": utils.joinHyphenCase(day, period.startTime, "start-time-text")
94023
91936
  }, period.startTime), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
94024
91937
  className: "text-gray-600",
94025
91938
  component: "span"
@@ -94028,11 +91941,11 @@ var DisplayAvailability = function DisplayAvailability(_ref) {
94028
91941
  lineHeight: "relaxed",
94029
91942
  style: "h5",
94030
91943
  weight: "semibold",
94031
- "data-cy": joinHyphenCase(day, period.endTime, "start-time-text")
91944
+ "data-cy": utils.joinHyphenCase(day, period.endTime, "start-time-text")
94032
91945
  }, period.endTime));
94033
91946
  }) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
94034
91947
  className: "mx-8 mt-0.5 text-gray-700",
94035
- "data-cy": joinHyphenCase(day, "unavailable-time-text"),
91948
+ "data-cy": utils.joinHyphenCase(day, "unavailable-time-text"),
94036
91949
  lineHeight: "relaxed",
94037
91950
  style: "h5"
94038
91951
  }, t("neetoCommons.schedule.unavailable"))));
@@ -94050,6 +91963,7 @@ var buildSlotIntervals = function buildSlotIntervals(_ref) {
94050
91963
  value: selectedValue
94051
91964
  };
94052
91965
  var allIntervalsForADay = dayjsExtended.timeIntervalsForDay(interval);
91966
+ allIntervalsForADay.push(END_OF_DAY);
94053
91967
  var uniqBookedSlots = ramda.uniq(ramda.pluck(slotType, bookedSlots));
94054
91968
  var slotsAvailableForBooking = ramda.difference(allIntervalsForADay, uniqBookedSlots);
94055
91969
  var slots = slotsAvailableForBooking.map(toLabelAndValue);
@@ -94233,7 +92147,7 @@ var Form = function Form(_ref) {
94233
92147
  setFieldValue("wdays[".concat(index, "].available"), true);
94234
92148
  if ((_deletedPeriods$ = deletedPeriods[0]) !== null && _deletedPeriods$ !== void 0 && _deletedPeriods$.startTime) {
94235
92149
  restoreDeletedPeriods(setFieldValue);
94236
- } else if (isNotPresent(values.wdays[index].periods)) {
92150
+ } else if (pure$1.isNotPresent(values.wdays[index].periods)) {
94237
92151
  setFieldValue("wdays[".concat(index, "].periods"), [addDefaultPeriod(day)]);
94238
92152
  } else {
94239
92153
  setFieldValue("wdays[".concat(index, "].periods"), [""]);
@@ -94258,7 +92172,7 @@ var Form = function Form(_ref) {
94258
92172
  }, /*#__PURE__*/React__default["default"].createElement(formik$1.Checkbox, {
94259
92173
  "aria-label": "wdays[".concat(index, "].available"),
94260
92174
  checked: values.wdays[index].available,
94261
- "data-cy": joinHyphenCase(day, "weekly-hours-checkbox"),
92175
+ "data-cy": utils.joinHyphenCase(day, "weekly-hours-checkbox"),
94262
92176
  id: "day",
94263
92177
  name: "wdays[".concat(index, "].available"),
94264
92178
  onChange: function onChange() {
@@ -94267,7 +92181,7 @@ var Form = function Form(_ref) {
94267
92181
  }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
94268
92182
  className: "ml-2 capitalize",
94269
92183
  component: "span",
94270
- "data-cy": joinHyphenCase(day, "day-text"),
92184
+ "data-cy": utils.joinHyphenCase(day, "day-text"),
94271
92185
  style: "body2",
94272
92186
  weight: "semibold"
94273
92187
  }, t("neetoCommons.schedule.days.".concat(day)))), /*#__PURE__*/React__default["default"].createElement(ScheduleRow, {
@@ -94287,7 +92201,7 @@ var Form = function Form(_ref) {
94287
92201
  hideAfter: 5000
94288
92202
  },
94289
92203
  className: "flex-shrink-0",
94290
- "data-testid": joinHyphenCase(day, "copy-schedule-icon")
92204
+ "data-testid": utils.joinHyphenCase(day, "copy-schedule-icon")
94291
92205
  },
94292
92206
  onClose: function onClose() {
94293
92207
  return setWdaysToCopy([]);
@@ -94313,7 +92227,7 @@ var Form = function Form(_ref) {
94313
92227
  }
94314
92228
  })));
94315
92229
  }), /*#__PURE__*/React__default["default"].createElement("li", null, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
94316
- disabled: isNotPresent(wdaysToCopy),
92230
+ disabled: pure$1.isNotPresent(wdaysToCopy),
94317
92231
  label: "Submit",
94318
92232
  size: "small",
94319
92233
  onClick: function onClick() {
@@ -94448,14 +92362,14 @@ var Header = function Header(_ref) {
94448
92362
  var Schedule = /*#__PURE__*/React.forwardRef(function (_ref, scheduleRef) {
94449
92363
  var periods = _ref.periods,
94450
92364
  _ref$handleSubmit = _ref.handleSubmit,
94451
- handleSubmit = _ref$handleSubmit === void 0 ? noop$2 : _ref$handleSubmit,
92365
+ handleSubmit = _ref$handleSubmit === void 0 ? pure$1.noop : _ref$handleSubmit,
94452
92366
  _ref$isEditing = _ref.isEditing,
94453
92367
  isEditing = _ref$isEditing === void 0 ? false : _ref$isEditing,
94454
92368
  setIsEditing = _ref.setIsEditing,
94455
92369
  _ref$showHeader = _ref.showHeader,
94456
92370
  showHeader = _ref$showHeader === void 0 ? true : _ref$showHeader,
94457
92371
  _ref$handleValuesChan = _ref.handleValuesChanged,
94458
- handleValuesChanged = _ref$handleValuesChan === void 0 ? noop$2 : _ref$handleValuesChan;
92372
+ handleValuesChanged = _ref$handleValuesChan === void 0 ? pure$1.noop : _ref$handleValuesChan;
94459
92373
  var handleCopy = function handleCopy(_ref2) {
94460
92374
  var _values$wdays$index$p;
94461
92375
  var values = _ref2.values,
@@ -94465,7 +92379,7 @@ var Schedule = /*#__PURE__*/React.forwardRef(function (_ref, scheduleRef) {
94465
92379
  var newPeriods = (_values$wdays$index$p = values.wdays[index].periods) === null || _values$wdays$index$p === void 0 ? void 0 : _values$wdays$index$p.map(ramda.pick(["startTime", "endTime"]));
94466
92380
  wdaysToCopy.forEach(function (wday) {
94467
92381
  var dayIndex = DAYS.indexOf(wday);
94468
- setFieldValue("wdays[".concat(dayIndex, "].available"), isPresent(values.wdays[index].periods));
92382
+ setFieldValue("wdays[".concat(dayIndex, "].available"), pure$1.isPresent(values.wdays[index].periods));
94469
92383
  setFieldValue("wdays[".concat(dayIndex, "].periods"), newPeriods.map(function (period) {
94470
92384
  return ramda.assoc("wday", wday, period);
94471
92385
  }));
@@ -94564,6 +92478,7 @@ var Link = function Link(_ref) {
94564
92478
  entityName = _ref.entityName,
94565
92479
  handleRegenerate = _ref.handleRegenerate,
94566
92480
  isRegenerating = _ref.isRegenerating,
92481
+ previewUrl = _ref.previewUrl,
94567
92482
  url = _ref.url;
94568
92483
  var _useState = React.useState(false),
94569
92484
  _useState2 = _slicedToArray(_useState, 2),
@@ -94598,11 +92513,11 @@ var Link = function Link(_ref) {
94598
92513
  icon: neetoIcons.Copy,
94599
92514
  label: t("neetoCommons.shareViaLink.copyLink"),
94600
92515
  onClick: function onClick() {
94601
- return copyToClipboard(url);
92516
+ return utils.copyToClipboard(url);
94602
92517
  }
94603
92518
  }), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
94604
92519
  "data-testid": "preview-button",
94605
- href: url,
92520
+ href: previewUrl || url,
94606
92521
  icon: neetoIcons.ExternalLink,
94607
92522
  style: "secondary",
94608
92523
  target: "_blank",
@@ -94631,30 +92546,16 @@ var Link = function Link(_ref) {
94631
92546
  }))));
94632
92547
  };
94633
92548
 
94634
- var HEADERS_KEYS = {
94635
- xAuthEmail: "X-Auth-Email",
94636
- xAuthToken: "X-Auth-Token",
94637
- xCsrfToken: "X-CSRF-TOKEN",
94638
- contentType: "Content-Type",
94639
- accept: "Accept"
94640
- };
94641
-
94642
- var resetAuthTokens = function resetAuthTokens() {
94643
- ramda.values(HEADERS_KEYS).forEach(function (header) {
94644
- delete axios__default["default"].defaults.headers[header];
94645
- });
94646
- };
94647
-
94648
92549
  var facebookShareLink = function facebookShareLink(_ref) {
94649
92550
  var id = _ref.id;
94650
- return buildUrl("https://www.facebook.com/sharer/sharer.php", {
92551
+ return utils.buildUrl("https://www.facebook.com/sharer/sharer.php", {
94651
92552
  u: "https://".concat(window.location.host, "/").concat(id)
94652
92553
  });
94653
92554
  };
94654
92555
  var linkedInShareLink = function linkedInShareLink(_ref2) {
94655
92556
  var id = _ref2.id,
94656
92557
  title = _ref2.title;
94657
- return buildUrl("https://www.linkedin.com/shareArticle", {
92558
+ return utils.buildUrl("https://www.linkedin.com/shareArticle", {
94658
92559
  mini: true,
94659
92560
  url: "https://".concat(window.location.host, "/").concat(id),
94660
92561
  title: title
@@ -94663,7 +92564,7 @@ var linkedInShareLink = function linkedInShareLink(_ref2) {
94663
92564
  var twitterShareLink = function twitterShareLink(_ref3) {
94664
92565
  var id = _ref3.id,
94665
92566
  title = _ref3.title;
94666
- return buildUrl("http://twitter.com/share", {
92567
+ return utils.buildUrl("http://twitter.com/share", {
94667
92568
  text: title,
94668
92569
  url: "https://".concat(window.location.host, "/").concat(id)
94669
92570
  });
@@ -95574,7 +93475,7 @@ var QRCodeModal = function QRCodeModal(_ref) {
95574
93475
  var handleDownload = function handleDownload() {
95575
93476
  var canvas = document.getElementById(canvasId);
95576
93477
  if (canvas) downloadCanvas(canvas, {
95577
- name: slugify(name)
93478
+ name: pure$1.slugify(name)
95578
93479
  });
95579
93480
  };
95580
93481
  return /*#__PURE__*/React__default["default"].createElement(neetoui.Modal, {
@@ -95677,7 +93578,9 @@ var ShareViaLink = function ShareViaLink(_ref) {
95677
93578
  entity = _ref.entity,
95678
93579
  entityName = _ref.entityName,
95679
93580
  _ref$handleRegenerate = _ref.handleRegenerate,
95680
- handleRegenerate = _ref$handleRegenerate === void 0 ? noop$2 : _ref$handleRegenerate,
93581
+ handleRegenerate = _ref$handleRegenerate === void 0 ? pure$1.noop : _ref$handleRegenerate,
93582
+ _ref$previewUrl = _ref.previewUrl,
93583
+ previewUrl = _ref$previewUrl === void 0 ? "" : _ref$previewUrl,
95681
93584
  socialMediaPostTitle = _ref.socialMediaPostTitle,
95682
93585
  url = _ref.url;
95683
93586
  return /*#__PURE__*/React__default["default"].createElement("div", {
@@ -95688,6 +93591,7 @@ var ShareViaLink = function ShareViaLink(_ref) {
95688
93591
  entityName: entityName,
95689
93592
  handleRegenerate: handleRegenerate,
95690
93593
  isRegenerating: isRegenerating,
93594
+ previewUrl: previewUrl,
95691
93595
  url: url
95692
93596
  }), /*#__PURE__*/React__default["default"].createElement(SocialMedia, {
95693
93597
  entity: entity,
@@ -95722,7 +93626,7 @@ var getTopLinks = function getTopLinks() {
95722
93626
  }) : topLinks;
95723
93627
  };
95724
93628
  var convertAppNameToLogoName = function convertAppNameToLogoName(appName) {
95725
- return "Neeto".concat(capitalize(appName.substr(5).toLowerCase()));
93629
+ return "Neeto".concat(pure$1.capitalize(appName.substr(5).toLowerCase()));
95726
93630
  };
95727
93631
  var buildProductLogo = function buildProductLogo() {
95728
93632
  var logoName = convertAppNameToLogoName(globalProps.appName);
@@ -95753,12 +93657,15 @@ var Sidebar = function Sidebar(_ref) {
95753
93657
  isAppSwitcherOpen = _useState2[0],
95754
93658
  setIsAppSwitcherOpen = _useState2[1];
95755
93659
  var location = reactRouterDom.useLocation();
93660
+ var _useKeyboardShortcuts = useKeyboardShortcutsPaneState(),
93661
+ _useKeyboardShortcuts2 = _slicedToArray(_useKeyboardShortcuts, 2),
93662
+ setIsOpen = _useKeyboardShortcuts2[1];
95756
93663
  React.useEffect(function () {
95757
93664
  isAppSwitcherOpen && setIsAppSwitcherOpen(false);
95758
93665
  // eslint-disable-next-line react-hooks/exhaustive-deps
95759
93666
  }, [location]);
95760
93667
  var handleLogout = function handleLogout() {
95761
- resetAuthTokens();
93668
+ utils.resetAuthTokens();
95762
93669
  window.location.href = "/logout";
95763
93670
  };
95764
93671
  var openChatWidget = function openChatWidget() {
@@ -95776,6 +93683,13 @@ var Sidebar = function Sidebar(_ref) {
95776
93683
  label: i18next__default["default"].t("neetoCommons.sidebar.livechat"),
95777
93684
  onClick: openChatWidget,
95778
93685
  "data-cy": "profile-livechat-button"
93686
+ }, {
93687
+ icon: neetoIcons.Keyboard,
93688
+ label: i18next__default["default"].t("neetoCommons.sidebar.keyboardShortcuts"),
93689
+ onClick: function onClick() {
93690
+ return setIsOpen(true);
93691
+ },
93692
+ "data-cy": "profile-keyboard-shortcuts-button"
95779
93693
  }, {
95780
93694
  icon: neetoIcons.LeftArrow,
95781
93695
  label: i18next__default["default"].t("neetoCommons.sidebar.logout"),
@@ -95786,7 +93700,7 @@ var Sidebar = function Sidebar(_ref) {
95786
93700
  icon: neetoIcons.Help,
95787
93701
  label: i18next__default["default"].t("neetoCommons.sidebar.help"),
95788
93702
  onClick: function onClick() {
95789
- return window.open("https://neeto".concat(ramda.toLower(appName), "help.neetokb.com/"), "_blank");
93703
+ return window.open("https://help.neeto".concat(ramda.toLower(appName), ".com/"), "_blank");
95790
93704
  }
95791
93705
  },
95792
93706
  changelogProps: {
@@ -95796,7 +93710,7 @@ var Sidebar = function Sidebar(_ref) {
95796
93710
  var organizationInfo = ramda.mergeLeft(organizationInfoOverrides, ramda.mergeLeft(globalProps.organization, buildProductLogo()));
95797
93711
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(layouts.Sidebar, {
95798
93712
  isCollapsed: true,
95799
- appName: "neeto".concat(capitalize(appName)),
93713
+ appName: "neeto".concat(pure$1.capitalize(appName)),
95800
93714
  navLinks: navLinks,
95801
93715
  organizationInfo: organizationInfo,
95802
93716
  profileInfo: profileInfo,
@@ -95805,7 +93719,7 @@ var Sidebar = function Sidebar(_ref) {
95805
93719
  return setIsAppSwitcherOpen(ramda.not);
95806
93720
  }
95807
93721
  }), showAppSwitcher && /*#__PURE__*/React__default["default"].createElement(layouts.AppSwitcher, {
95808
- activeApp: capitalize(appName),
93722
+ activeApp: pure$1.capitalize(appName),
95809
93723
  environment: process.env.RAILS_ENV,
95810
93724
  isOpen: isAppSwitcherOpen,
95811
93725
  neetoApps: globalProps.neetoApps,
@@ -95817,7 +93731,7 @@ var Sidebar = function Sidebar(_ref) {
95817
93731
 
95818
93732
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
95819
93733
 
95820
- var css$1 = ".neeto-commons-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-commons-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.neeto-commons-keyboard-shortcuts-pane{z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
93734
+ var css$1 = ".neeto-commons-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-commons-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.neeto-commons-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
95821
93735
  n(css$1,{});
95822
93736
 
95823
93737
  var NeetoWidget = {
@@ -99627,6 +97541,7 @@ exports.useErrorDisplayStore = useErrorDisplayStore;
99627
97541
  exports.useFuncDebounce = useFuncDebounce;
99628
97542
  exports.useHotKeys = useHotKeys;
99629
97543
  exports.useIsElementVisibleInDom = useIsElementVisibleInDom;
97544
+ exports.useKeyboardShortcutsPaneState = useKeyboardShortcutsPaneState;
99630
97545
  exports.useLocalStorage = useLocalStorage;
99631
97546
  exports.useOnClickOutside = useOnClickOutside;
99632
97547
  exports.usePrevious = usePrevious;