@bigbinary/neeto-team-members-frontend 2.4.18 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -14,6 +14,8 @@ var formik = require('formik');
14
14
  var formik$1 = require('@bigbinary/neetoui/formik');
15
15
  var yup = require('yup');
16
16
  var classnames = require('classnames');
17
+ var require$$0 = require('util');
18
+ var neetoFiltersFrontend = require('@bigbinary/neeto-filters-frontend');
17
19
 
18
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
21
 
@@ -39,6 +41,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
39
41
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
40
42
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
41
43
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
44
+ var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
42
45
 
43
46
  function _typeof$1(obj) {
44
47
  "@babel/helpers - typeof";
@@ -428,7 +431,7 @@ var _entityMap = {
428
431
  "'": ''',
429
432
  '/': '/'
430
433
  };
431
- function escape(data) {
434
+ function escape$1(data) {
432
435
  if (typeof data === 'string') {
433
436
  return data.replace(/[&<>"'\/]/g, function (s) {
434
437
  return _entityMap[s];
@@ -1482,7 +1485,7 @@ var Interpolator = function () {
1482
1485
  escapeValue: true
1483
1486
  };
1484
1487
  var iOpts = options.interpolation;
1485
- this.escape = iOpts.escape !== undefined ? iOpts.escape : escape;
1488
+ this.escape = iOpts.escape !== undefined ? iOpts.escape : escape$1;
1486
1489
  this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;
1487
1490
  this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;
1488
1491
  this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';
@@ -2658,9 +2661,9 @@ instance.loadLanguages;
2658
2661
 
2659
2662
  var arr = [];
2660
2663
  var each = arr.forEach;
2661
- var slice = arr.slice;
2662
- function defaults(obj) {
2663
- each.call(slice.call(arguments, 1), function (source) {
2664
+ var slice$1 = arr.slice;
2665
+ function defaults$2(obj) {
2666
+ each.call(slice$1.call(arguments, 1), function (source) {
2664
2667
  if (source) {
2665
2668
  for (var prop in source) {
2666
2669
  if (obj[prop] === undefined) obj[prop] = source[prop];
@@ -2954,7 +2957,7 @@ var Browser = /*#__PURE__*/function () {
2954
2957
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2955
2958
  var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2956
2959
  this.services = services;
2957
- this.options = defaults(options, this.options || {}, getDefaults$1());
2960
+ this.options = defaults$2(options, this.options || {}, getDefaults$1());
2958
2961
 
2959
2962
  // backwards compatibility
2960
2963
  if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
@@ -3168,7 +3171,7 @@ var unescapeHtmlEntity = function unescapeHtmlEntity(m) {
3168
3171
  return htmlEntities[m];
3169
3172
  };
3170
3173
 
3171
- var unescape = function unescape(text) {
3174
+ var unescape$1 = function unescape(text) {
3172
3175
  return text.replace(matchHtmlEntity, unescapeHtmlEntity);
3173
3176
  };
3174
3177
 
@@ -3183,7 +3186,7 @@ var defaultOptions = {
3183
3186
  transWrapTextNodes: '',
3184
3187
  transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
3185
3188
  useSuspense: true,
3186
- unescape: unescape
3189
+ unescape: unescape$1
3187
3190
  };
3188
3191
  function setDefaults() {
3189
3192
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -3973,9 +3976,10 @@ const permissionsApi = {
3973
3976
  const DEFAULT_STALE_TIME = 300000; // 5 minutes
3974
3977
 
3975
3978
  const QUERY_KEYS = {
3976
- TEAMS: "neeto-team-members-teams",
3979
+ PERMISSIONS: "neeto-team-members-permissions",
3977
3980
  ROLES: "neeto-team-members-roles",
3978
- PERMISSIONS: "neeto-team-members-permissions"
3981
+ TEAMS: "neeto-team-members-teams",
3982
+ TEAMS_DEPENDENCIES: "neeto-team-members-teams-dependencies"
3979
3983
  };
3980
3984
 
3981
3985
  function ownKeys$8(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; }
@@ -4089,6 +4093,12 @@ var nullSafe = function nullSafe(func) {
4089
4093
  );
4090
4094
  };
4091
4095
  var noop = function noop() {};
4096
+ var toLabelAndValue = function toLabelAndValue(string) {
4097
+ return {
4098
+ label: string,
4099
+ value: string
4100
+ };
4101
+ };
4092
4102
  var isNotEmpty = /*#__PURE__*/ramda.complement(ramda.isEmpty);
4093
4103
  var notEquals = /*#__PURE__*/ramda.curry(function (x, y) {
4094
4104
  return x !== y;
@@ -4210,6 +4220,7 @@ const useCreateRole = _ref => {
4210
4220
  options = _objectWithoutProperties(_ref, _excluded$2);
4211
4221
  return reactQuery.useMutation(organizationRolesApi.create, _objectSpread$7({
4212
4222
  onSuccess: response => {
4223
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
4213
4224
  queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
4214
4225
  if (!!cachedData.data && !!cachedData.data.organizationRoles) {
4215
4226
  return ramda.modifyPath(["data", "organizationRoles"], ramda.prepend(response.data.organizationRole), cachedData);
@@ -4231,6 +4242,7 @@ const useUpdateRole = _ref2 => {
4231
4242
  }, _objectSpread$7({
4232
4243
  onSuccess: response => {
4233
4244
  queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
4245
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
4234
4246
  queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
4235
4247
  if (!!cachedData.data && !!cachedData.data.organizationRoles) {
4236
4248
  return ramda.assocPath(["data", "organizationRoles", ramda.findIndex(ramda.propEq("id", response.data.organizationRole.id), cachedData.data.organizationRoles)], response.data.organizationRole, cachedData);
@@ -4253,6 +4265,7 @@ const useDestroyRole = _ref4 => {
4253
4265
  }, _objectSpread$7({
4254
4266
  onSuccess: response => {
4255
4267
  queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
4268
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
4256
4269
  queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
4257
4270
  if (!!cachedData.data && !!cachedData.data.organizationRoles) {
4258
4271
  return ramda.dissocPath(["data", "organizationRoles", ramda.findIndex(ramda.propEq("id", response.data.id), cachedData.data.organizationRoles)], cachedData);
@@ -6590,226 +6603,2270 @@ function _extends() {
6590
6603
  return _extends.apply(this, arguments);
6591
6604
  }
6592
6605
 
6593
- const fetch = params => axios__default["default"].get(`${BASE_URL}/teams`, {
6594
- params: keysToSnakeCase(params)
6595
- });
6596
- const create = payload => axios__default["default"].post(`${BASE_URL}/teams`, payload);
6597
- const update = (id, payload) => axios__default["default"].put(`${BASE_URL}/teams/${id}`, {
6598
- team: payload
6599
- });
6600
- const bulkUpdate = payload => axios__default["default"].patch(`${BASE_URL}/teams/bulk_update`, payload);
6601
- const teamsApi = {
6602
- bulkUpdate,
6603
- create,
6604
- fetch,
6605
- update
6606
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
6607
+ var shams = function hasSymbols() {
6608
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
6609
+ if (typeof Symbol.iterator === 'symbol') { return true; }
6610
+
6611
+ var obj = {};
6612
+ var sym = Symbol('test');
6613
+ var symObj = Object(sym);
6614
+ if (typeof sym === 'string') { return false; }
6615
+
6616
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
6617
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
6618
+
6619
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
6620
+ // if (sym instanceof Symbol) { return false; }
6621
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
6622
+ // if (!(symObj instanceof Symbol)) { return false; }
6623
+
6624
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
6625
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
6626
+
6627
+ var symVal = 42;
6628
+ obj[sym] = symVal;
6629
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
6630
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
6631
+
6632
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
6633
+
6634
+ var syms = Object.getOwnPropertySymbols(obj);
6635
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
6636
+
6637
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
6638
+
6639
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
6640
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
6641
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
6642
+ }
6643
+
6644
+ return true;
6606
6645
  };
6607
6646
 
6608
- const _excluded$1 = ["onSuccess"],
6609
- _excluded2$1 = ["onSuccess"],
6610
- _excluded3 = ["onSuccess"];
6611
- function ownKeys$4(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; }
6612
- function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6613
- const useFetchMembers = function () {
6614
- let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6615
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6616
- return reactQuery.useQuery([QUERY_KEYS.TEAMS, params], () => teamsApi.fetch(params), _objectSpread$4({
6617
- staleTime: DEFAULT_STALE_TIME,
6618
- select: response => response.data || response,
6619
- keepPreviousData: true
6620
- }, options));
6647
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
6648
+ var hasSymbolSham = shams;
6649
+
6650
+ var hasSymbols$1 = function hasNativeSymbols() {
6651
+ if (typeof origSymbol !== 'function') { return false; }
6652
+ if (typeof Symbol !== 'function') { return false; }
6653
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
6654
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
6655
+
6656
+ return hasSymbolSham();
6621
6657
  };
6622
- const useCreateMember = _ref => {
6623
- let onSuccess = _ref.onSuccess,
6624
- options = _objectWithoutProperties(_ref, _excluded$1);
6625
- return reactQuery.useMutation(teamsApi.create, _objectSpread$4({
6626
- onSuccess: response => {
6627
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
6628
- neetoui.Toastr.success(response.ntmNotice || response.data.ntmNotice);
6629
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
6658
+
6659
+ /* eslint no-invalid-this: 1 */
6660
+
6661
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
6662
+ var slice = Array.prototype.slice;
6663
+ var toStr$1 = Object.prototype.toString;
6664
+ var funcType = '[object Function]';
6665
+
6666
+ var implementation$1 = function bind(that) {
6667
+ var target = this;
6668
+ if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
6669
+ throw new TypeError(ERROR_MESSAGE + target);
6630
6670
  }
6631
- }, options));
6632
- };
6633
- const useUpdateMember = _ref2 => {
6634
- let onSuccess = _ref2.onSuccess,
6635
- options = _objectWithoutProperties(_ref2, _excluded2$1);
6636
- return reactQuery.useMutation(_ref3 => {
6637
- let id = _ref3.id,
6638
- payload = _ref3.payload;
6639
- return teamsApi.update(id, payload);
6640
- }, _objectSpread$4({
6641
- onSuccess: response => {
6642
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
6643
- neetoui.Toastr.success(response.ntmNotice || response.data.ntmNotice);
6644
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
6671
+ var args = slice.call(arguments, 1);
6672
+
6673
+ var bound;
6674
+ var binder = function () {
6675
+ if (this instanceof bound) {
6676
+ var result = target.apply(
6677
+ this,
6678
+ args.concat(slice.call(arguments))
6679
+ );
6680
+ if (Object(result) === result) {
6681
+ return result;
6682
+ }
6683
+ return this;
6684
+ } else {
6685
+ return target.apply(
6686
+ that,
6687
+ args.concat(slice.call(arguments))
6688
+ );
6689
+ }
6690
+ };
6691
+
6692
+ var boundLength = Math.max(0, target.length - args.length);
6693
+ var boundArgs = [];
6694
+ for (var i = 0; i < boundLength; i++) {
6695
+ boundArgs.push('$' + i);
6645
6696
  }
6646
- }, options));
6647
- };
6648
- const useBulkUpdateMembers = _ref4 => {
6649
- let onSuccess = _ref4.onSuccess,
6650
- options = _objectWithoutProperties(_ref4, _excluded3);
6651
- return reactQuery.useMutation(teamsApi.bulkUpdate, _objectSpread$4({
6652
- onSuccess: response => {
6653
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
6654
- neetoui.Toastr.success(response.ntmNotice || response.data.ntmNotice);
6655
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
6697
+
6698
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
6699
+
6700
+ if (target.prototype) {
6701
+ var Empty = function Empty() {};
6702
+ Empty.prototype = target.prototype;
6703
+ bound.prototype = new Empty();
6704
+ Empty.prototype = null;
6656
6705
  }
6657
- }, options));
6658
- };
6659
- const refetchMembers = () => {
6660
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
6661
- };
6662
6706
 
6663
- const useDebounce = function (value) {
6664
- let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
6665
- const _useState = React.useState(value),
6666
- _useState2 = _slicedToArray$1(_useState, 2),
6667
- debouncedValue = _useState2[0],
6668
- setDebouncedValue = _useState2[1];
6669
- React.useEffect(() => {
6670
- const handler = setTimeout(() => setDebouncedValue(value), delay);
6671
- return () => clearTimeout(handler);
6672
- }, [value, delay]);
6673
- return debouncedValue;
6707
+ return bound;
6674
6708
  };
6675
6709
 
6676
- const FIXED_COLUMNS = ["actions"];
6677
- const COLUMNS_DROPDOWN_PROPS = {
6678
- label: instance.t("common.column", PLURAL)
6710
+ var implementation = implementation$1;
6711
+
6712
+ var functionBind = Function.prototype.bind || implementation;
6713
+
6714
+ var bind$1 = functionBind;
6715
+
6716
+ var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
6717
+
6718
+ var undefined$1;
6719
+
6720
+ var $SyntaxError = SyntaxError;
6721
+ var $Function = Function;
6722
+ var $TypeError$1 = TypeError;
6723
+
6724
+ // eslint-disable-next-line consistent-return
6725
+ var getEvalledConstructor = function (expressionSyntax) {
6726
+ try {
6727
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
6728
+ } catch (e) {}
6679
6729
  };
6680
- const COLUMNS_SEARCH_PROPS = {
6681
- placeholder: instance.t("columns.search")
6730
+
6731
+ var $gOPD = Object.getOwnPropertyDescriptor;
6732
+ if ($gOPD) {
6733
+ try {
6734
+ $gOPD({}, '');
6735
+ } catch (e) {
6736
+ $gOPD = null; // this is IE 8, which has a broken gOPD
6737
+ }
6738
+ }
6739
+
6740
+ var throwTypeError = function () {
6741
+ throw new $TypeError$1();
6742
+ };
6743
+ var ThrowTypeError = $gOPD
6744
+ ? (function () {
6745
+ try {
6746
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
6747
+ arguments.callee; // IE 8 does not throw here
6748
+ return throwTypeError;
6749
+ } catch (calleeThrows) {
6750
+ try {
6751
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
6752
+ return $gOPD(arguments, 'callee').get;
6753
+ } catch (gOPDthrows) {
6754
+ return throwTypeError;
6755
+ }
6756
+ }
6757
+ }())
6758
+ : throwTypeError;
6759
+
6760
+ var hasSymbols = hasSymbols$1();
6761
+
6762
+ var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
6763
+
6764
+ var needsEval = {};
6765
+
6766
+ var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
6767
+
6768
+ var INTRINSICS = {
6769
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
6770
+ '%Array%': Array,
6771
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
6772
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
6773
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
6774
+ '%AsyncFunction%': needsEval,
6775
+ '%AsyncGenerator%': needsEval,
6776
+ '%AsyncGeneratorFunction%': needsEval,
6777
+ '%AsyncIteratorPrototype%': needsEval,
6778
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
6779
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
6780
+ '%Boolean%': Boolean,
6781
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
6782
+ '%Date%': Date,
6783
+ '%decodeURI%': decodeURI,
6784
+ '%decodeURIComponent%': decodeURIComponent,
6785
+ '%encodeURI%': encodeURI,
6786
+ '%encodeURIComponent%': encodeURIComponent,
6787
+ '%Error%': Error,
6788
+ '%eval%': eval, // eslint-disable-line no-eval
6789
+ '%EvalError%': EvalError,
6790
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
6791
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
6792
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
6793
+ '%Function%': $Function,
6794
+ '%GeneratorFunction%': needsEval,
6795
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
6796
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
6797
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
6798
+ '%isFinite%': isFinite,
6799
+ '%isNaN%': isNaN,
6800
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
6801
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
6802
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
6803
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
6804
+ '%Math%': Math,
6805
+ '%Number%': Number,
6806
+ '%Object%': Object,
6807
+ '%parseFloat%': parseFloat,
6808
+ '%parseInt%': parseInt,
6809
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
6810
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
6811
+ '%RangeError%': RangeError,
6812
+ '%ReferenceError%': ReferenceError,
6813
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
6814
+ '%RegExp%': RegExp,
6815
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
6816
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
6817
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
6818
+ '%String%': String,
6819
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
6820
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
6821
+ '%SyntaxError%': $SyntaxError,
6822
+ '%ThrowTypeError%': ThrowTypeError,
6823
+ '%TypedArray%': TypedArray,
6824
+ '%TypeError%': $TypeError$1,
6825
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
6826
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
6827
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
6828
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
6829
+ '%URIError%': URIError,
6830
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
6831
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
6832
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
6833
+ };
6834
+
6835
+ var doEval = function doEval(name) {
6836
+ var value;
6837
+ if (name === '%AsyncFunction%') {
6838
+ value = getEvalledConstructor('async function () {}');
6839
+ } else if (name === '%GeneratorFunction%') {
6840
+ value = getEvalledConstructor('function* () {}');
6841
+ } else if (name === '%AsyncGeneratorFunction%') {
6842
+ value = getEvalledConstructor('async function* () {}');
6843
+ } else if (name === '%AsyncGenerator%') {
6844
+ var fn = doEval('%AsyncGeneratorFunction%');
6845
+ if (fn) {
6846
+ value = fn.prototype;
6847
+ }
6848
+ } else if (name === '%AsyncIteratorPrototype%') {
6849
+ var gen = doEval('%AsyncGenerator%');
6850
+ if (gen) {
6851
+ value = getProto(gen.prototype);
6852
+ }
6853
+ }
6854
+
6855
+ INTRINSICS[name] = value;
6856
+
6857
+ return value;
6858
+ };
6859
+
6860
+ var LEGACY_ALIASES = {
6861
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
6862
+ '%ArrayPrototype%': ['Array', 'prototype'],
6863
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
6864
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
6865
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
6866
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
6867
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
6868
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
6869
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
6870
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
6871
+ '%DataViewPrototype%': ['DataView', 'prototype'],
6872
+ '%DatePrototype%': ['Date', 'prototype'],
6873
+ '%ErrorPrototype%': ['Error', 'prototype'],
6874
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
6875
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
6876
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
6877
+ '%FunctionPrototype%': ['Function', 'prototype'],
6878
+ '%Generator%': ['GeneratorFunction', 'prototype'],
6879
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
6880
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
6881
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
6882
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
6883
+ '%JSONParse%': ['JSON', 'parse'],
6884
+ '%JSONStringify%': ['JSON', 'stringify'],
6885
+ '%MapPrototype%': ['Map', 'prototype'],
6886
+ '%NumberPrototype%': ['Number', 'prototype'],
6887
+ '%ObjectPrototype%': ['Object', 'prototype'],
6888
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
6889
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
6890
+ '%PromisePrototype%': ['Promise', 'prototype'],
6891
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
6892
+ '%Promise_all%': ['Promise', 'all'],
6893
+ '%Promise_reject%': ['Promise', 'reject'],
6894
+ '%Promise_resolve%': ['Promise', 'resolve'],
6895
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
6896
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
6897
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
6898
+ '%SetPrototype%': ['Set', 'prototype'],
6899
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
6900
+ '%StringPrototype%': ['String', 'prototype'],
6901
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
6902
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
6903
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
6904
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
6905
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
6906
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
6907
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
6908
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
6909
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
6910
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
6911
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
6912
+ };
6913
+
6914
+ var bind = functionBind;
6915
+ var hasOwn$1 = src;
6916
+ var $concat$1 = bind.call(Function.call, Array.prototype.concat);
6917
+ var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
6918
+ var $replace$1 = bind.call(Function.call, String.prototype.replace);
6919
+ var $strSlice = bind.call(Function.call, String.prototype.slice);
6920
+ var $exec = bind.call(Function.call, RegExp.prototype.exec);
6921
+
6922
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
6923
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
6924
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
6925
+ var stringToPath = function stringToPath(string) {
6926
+ var first = $strSlice(string, 0, 1);
6927
+ var last = $strSlice(string, -1);
6928
+ if (first === '%' && last !== '%') {
6929
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
6930
+ } else if (last === '%' && first !== '%') {
6931
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
6932
+ }
6933
+ var result = [];
6934
+ $replace$1(string, rePropName, function (match, number, quote, subString) {
6935
+ result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
6936
+ });
6937
+ return result;
6682
6938
  };
6683
- const MANAGE_ROLES_BUTTON_LABEL = instance.t("common.manage_", {
6684
- what: instance.t("common.role", PLURAL).toLocaleLowerCase()
6685
- });
6939
+ /* end adaptation */
6686
6940
 
6687
- const Header = _ref => {
6688
- var _permissions$create, _config$header;
6689
- let config = _ref.config,
6690
- _ref$isEmptyState = _ref.isEmptyState,
6691
- isEmptyState = _ref$isEmptyState === void 0 ? false : _ref$isEmptyState,
6692
- metaName = _ref.metaName,
6693
- _ref$onClick = _ref.onClick,
6694
- onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
6695
- permissions = _ref.permissions,
6696
- rolesButtonProps = _ref.rolesButtonProps;
6697
- const isRolesButtonVisible = !!rolesButtonProps;
6698
- const hasCreatePermission = (_permissions$create = permissions === null || permissions === void 0 ? void 0 : permissions.create) !== null && _permissions$create !== void 0 ? _permissions$create : hasPermission(MANAGE_MEMBER_PERMISSIONS);
6699
- const isOtherActionBlockVisible = !!(config !== null && config !== void 0 && (_config$header = config.header) !== null && _config$header !== void 0 && _config$header.otherActionBlock) && !isEmptyState;
6700
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isOtherActionBlockVisible && config.header.otherActionBlock(), isRolesButtonVisible ? /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends({
6701
- "data-cy": "ntm-manage-roles-button",
6702
- label: MANAGE_ROLES_BUTTON_LABEL,
6703
- style: "secondary"
6704
- }, rolesButtonProps)) : null, /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, {
6705
- content: instance.t("tooltips.noPermissionToAddMember"),
6706
- disabled: hasCreatePermission,
6707
- position: "bottom"
6708
- }, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
6709
- "data-cy": "ntm-add-member-button",
6710
- disabled: !hasCreatePermission,
6711
- label: instance.t("common.add_", {
6712
- what: metaName(SINGULAR).toLocaleLowerCase()
6713
- }),
6714
- onClick: onClick
6715
- }))));
6941
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
6942
+ var intrinsicName = name;
6943
+ var alias;
6944
+ if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
6945
+ alias = LEGACY_ALIASES[intrinsicName];
6946
+ intrinsicName = '%' + alias[0] + '%';
6947
+ }
6948
+
6949
+ if (hasOwn$1(INTRINSICS, intrinsicName)) {
6950
+ var value = INTRINSICS[intrinsicName];
6951
+ if (value === needsEval) {
6952
+ value = doEval(intrinsicName);
6953
+ }
6954
+ if (typeof value === 'undefined' && !allowMissing) {
6955
+ throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
6956
+ }
6957
+
6958
+ return {
6959
+ alias: alias,
6960
+ name: intrinsicName,
6961
+ value: value
6962
+ };
6963
+ }
6964
+
6965
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
6716
6966
  };
6717
6967
 
6718
- const getStorageValue = (key, defaultValue) => {
6719
- const saved = localStorage.getItem(key);
6720
- return JSON.parse(saved) || defaultValue;
6968
+ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
6969
+ if (typeof name !== 'string' || name.length === 0) {
6970
+ throw new $TypeError$1('intrinsic name must be a non-empty string');
6971
+ }
6972
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
6973
+ throw new $TypeError$1('"allowMissing" argument must be a boolean');
6974
+ }
6975
+
6976
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
6977
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
6978
+ }
6979
+ var parts = stringToPath(name);
6980
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
6981
+
6982
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
6983
+ var intrinsicRealName = intrinsic.name;
6984
+ var value = intrinsic.value;
6985
+ var skipFurtherCaching = false;
6986
+
6987
+ var alias = intrinsic.alias;
6988
+ if (alias) {
6989
+ intrinsicBaseName = alias[0];
6990
+ $spliceApply(parts, $concat$1([0, 1], alias));
6991
+ }
6992
+
6993
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
6994
+ var part = parts[i];
6995
+ var first = $strSlice(part, 0, 1);
6996
+ var last = $strSlice(part, -1);
6997
+ if (
6998
+ (
6999
+ (first === '"' || first === "'" || first === '`')
7000
+ || (last === '"' || last === "'" || last === '`')
7001
+ )
7002
+ && first !== last
7003
+ ) {
7004
+ throw new $SyntaxError('property names with quotes must have matching quotes');
7005
+ }
7006
+ if (part === 'constructor' || !isOwn) {
7007
+ skipFurtherCaching = true;
7008
+ }
7009
+
7010
+ intrinsicBaseName += '.' + part;
7011
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
7012
+
7013
+ if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
7014
+ value = INTRINSICS[intrinsicRealName];
7015
+ } else if (value != null) {
7016
+ if (!(part in value)) {
7017
+ if (!allowMissing) {
7018
+ throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
7019
+ }
7020
+ return void undefined$1;
7021
+ }
7022
+ if ($gOPD && (i + 1) >= parts.length) {
7023
+ var desc = $gOPD(value, part);
7024
+ isOwn = !!desc;
7025
+
7026
+ // By convention, when a data property is converted to an accessor
7027
+ // property to emulate a data property that does not suffer from
7028
+ // the override mistake, that accessor's getter is marked with
7029
+ // an `originalValue` property. Here, when we detect this, we
7030
+ // uphold the illusion by pretending to see that original data
7031
+ // property, i.e., returning the value rather than the getter
7032
+ // itself.
7033
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
7034
+ value = desc.get;
7035
+ } else {
7036
+ value = value[part];
7037
+ }
7038
+ } else {
7039
+ isOwn = hasOwn$1(value, part);
7040
+ value = value[part];
7041
+ }
7042
+
7043
+ if (isOwn && !skipFurtherCaching) {
7044
+ INTRINSICS[intrinsicRealName] = value;
7045
+ }
7046
+ }
7047
+ }
7048
+ return value;
6721
7049
  };
6722
- const useLocalStorage = (key, defaultValue) => {
6723
- const _useState = React.useState(() => getStorageValue(key, defaultValue)),
6724
- _useState2 = _slicedToArray$1(_useState, 2),
6725
- storedValue = _useState2[0],
6726
- setStoredValue = _useState2[1];
6727
- const setValue = value => {
6728
- if (ramda.isNil(value)) {
6729
- localStorage.removeItem(key);
6730
- } else {
6731
- localStorage.setItem(key, JSON.stringify(value));
6732
- }
6733
- setStoredValue(value);
6734
- };
6735
- return [storedValue, setValue];
7050
+
7051
+ var callBindExports = {};
7052
+ var callBind$1 = {
7053
+ get exports(){ return callBindExports; },
7054
+ set exports(v){ callBindExports = v; },
6736
7055
  };
6737
7056
 
6738
- const removeFixedColumns = (fixedColumns, columnData) => removeBy({
6739
- dataIndex: ramda.includes(ramda.__, fixedColumns)
6740
- }, columnData);
6741
- const filterBySearchTerm$1 = (searchTerm, columns) => ramda.filter(_ref => {
6742
- let title = _ref.title;
6743
- return ramda.includes(ramda.trim(ramda.toLower(searchTerm)), ramda.trim(ramda.toLower(title)));
6744
- }, columns);
7057
+ (function (module) {
6745
7058
 
6746
- const Columns = _ref => {
6747
- let actionBlock = _ref.actionBlock,
6748
- _ref$checkboxProps = _ref.checkboxProps,
6749
- checkboxProps = _ref$checkboxProps === void 0 ? {} : _ref$checkboxProps,
6750
- _ref$columnData = _ref.columnData,
6751
- columnData = _ref$columnData === void 0 ? [] : _ref$columnData,
6752
- _ref$dropdownProps = _ref.dropdownProps,
6753
- dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
6754
- _ref$fixedColumns = _ref.fixedColumns,
6755
- fixedColumns = _ref$fixedColumns === void 0 ? [] : _ref$fixedColumns,
6756
- _ref$isSearchable = _ref.isSearchable,
6757
- isSearchable = _ref$isSearchable === void 0 ? false : _ref$isSearchable,
6758
- _ref$localStorageKey = _ref.localStorageKey,
6759
- localStorageKey = _ref$localStorageKey === void 0 ? "" : _ref$localStorageKey,
6760
- _ref$noColumnMessage = _ref.noColumnMessage,
6761
- noColumnMessage = _ref$noColumnMessage === void 0 ? "No columns found!" : _ref$noColumnMessage,
6762
- _ref$onChange = _ref.onChange,
6763
- onChange = _ref$onChange === void 0 ? ramda.identity : _ref$onChange,
6764
- _ref$searchProps = _ref.searchProps,
6765
- searchProps = _ref$searchProps === void 0 ? {} : _ref$searchProps;
6766
- // @ts-ignore
6767
- const Divider = neetoui.Dropdown.Divider,
6768
- Menu = neetoui.Dropdown.Menu,
6769
- MenuItem = neetoui.Dropdown.MenuItem;
6770
- const _useLocalStorage = useLocalStorage(localStorageKey, []),
6771
- _useLocalStorage2 = _slicedToArray$1(_useLocalStorage, 2),
6772
- hiddenColumns = _useLocalStorage2[0],
6773
- setHiddenColumns = _useLocalStorage2[1];
6774
- const _useState = React.useState(""),
6775
- _useState2 = _slicedToArray$1(_useState, 2),
6776
- searchTerm = _useState2[0],
6777
- setSearchTerm = _useState2[1];
6778
- const columns = removeFixedColumns(fixedColumns, columnData);
6779
- const filteredColumns = filterBySearchTerm$1(searchTerm, columns);
6780
- const handleChange = _ref2 => {
6781
- let _ref2$target = _ref2.target,
6782
- dataIndex = _ref2$target.name,
6783
- checked = _ref2$target.checked;
6784
- return checked ? setHiddenColumns(ramda.without([dataIndex], hiddenColumns)) : setHiddenColumns(ramda.append(dataIndex, hiddenColumns));
6785
- };
6786
- const handleSearch = _ref3 => {
6787
- let value = _ref3.target.value;
6788
- return setSearchTerm(value);
6789
- };
6790
- React.useEffect(() => {
6791
- onChange(removeBy({
6792
- dataIndex: ramda.includes(ramda.__, hiddenColumns)
6793
- }, columnData));
6794
- }, [columnData, hiddenColumns]); // eslint-disable-line react-hooks/exhaustive-deps
7059
+ var bind = functionBind;
7060
+ var GetIntrinsic = getIntrinsic;
6795
7061
 
6796
- return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, _extends({
6797
- buttonSize: "medium",
6798
- buttonStyle: "secondary",
6799
- closeOnSelect: false,
6800
- label: "Columns",
6801
- onClose: () => setSearchTerm(""),
6802
- position: "bottom-end"
6803
- }, dropdownProps), /*#__PURE__*/React__default["default"].createElement(Menu, null, /*#__PURE__*/React__default["default"].createElement("div", null, isSearchable && /*#__PURE__*/React__default["default"].createElement(neetoui.Input, _extends({
6804
- className: "neeto-ui-px-3 neeto-ui-py-2",
6805
- "data-cy": "neeto-ui-columns-search",
6806
- onChange: handleSearch,
6807
- placeholder: "Search columns",
6808
- prefix: /*#__PURE__*/React__default["default"].createElement(neetoIcons.Search, null),
6809
- type: "search",
6810
- value: searchTerm
6811
- }, searchProps)), isNotEmpty(filteredColumns) ? filteredColumns.map(_ref4 => {
6812
- let dataIndex = _ref4.dataIndex,
7062
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
7063
+ var $call = GetIntrinsic('%Function.prototype.call%');
7064
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
7065
+
7066
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
7067
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
7068
+ var $max = GetIntrinsic('%Math.max%');
7069
+
7070
+ if ($defineProperty) {
7071
+ try {
7072
+ $defineProperty({}, 'a', { value: 1 });
7073
+ } catch (e) {
7074
+ // IE 8 has a broken defineProperty
7075
+ $defineProperty = null;
7076
+ }
7077
+ }
7078
+
7079
+ module.exports = function callBind(originalFunction) {
7080
+ var func = $reflectApply(bind, $call, arguments);
7081
+ if ($gOPD && $defineProperty) {
7082
+ var desc = $gOPD(func, 'length');
7083
+ if (desc.configurable) {
7084
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
7085
+ $defineProperty(
7086
+ func,
7087
+ 'length',
7088
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
7089
+ );
7090
+ }
7091
+ }
7092
+ return func;
7093
+ };
7094
+
7095
+ var applyBind = function applyBind() {
7096
+ return $reflectApply(bind, $apply, arguments);
7097
+ };
7098
+
7099
+ if ($defineProperty) {
7100
+ $defineProperty(module.exports, 'apply', { value: applyBind });
7101
+ } else {
7102
+ module.exports.apply = applyBind;
7103
+ }
7104
+ } (callBind$1));
7105
+
7106
+ var GetIntrinsic$1 = getIntrinsic;
7107
+
7108
+ var callBind = callBindExports;
7109
+
7110
+ var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
7111
+
7112
+ var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
7113
+ var intrinsic = GetIntrinsic$1(name, !!allowMissing);
7114
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
7115
+ return callBind(intrinsic);
7116
+ }
7117
+ return intrinsic;
7118
+ };
7119
+
7120
+ var util_inspect = require$$0__default["default"].inspect;
7121
+
7122
+ var hasMap = typeof Map === 'function' && Map.prototype;
7123
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
7124
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
7125
+ var mapForEach = hasMap && Map.prototype.forEach;
7126
+ var hasSet = typeof Set === 'function' && Set.prototype;
7127
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
7128
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
7129
+ var setForEach = hasSet && Set.prototype.forEach;
7130
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
7131
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
7132
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
7133
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
7134
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
7135
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
7136
+ var booleanValueOf = Boolean.prototype.valueOf;
7137
+ var objectToString = Object.prototype.toString;
7138
+ var functionToString = Function.prototype.toString;
7139
+ var $match = String.prototype.match;
7140
+ var $slice = String.prototype.slice;
7141
+ var $replace = String.prototype.replace;
7142
+ var $toUpperCase = String.prototype.toUpperCase;
7143
+ var $toLowerCase = String.prototype.toLowerCase;
7144
+ var $test = RegExp.prototype.test;
7145
+ var $concat = Array.prototype.concat;
7146
+ var $join = Array.prototype.join;
7147
+ var $arrSlice = Array.prototype.slice;
7148
+ var $floor = Math.floor;
7149
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
7150
+ var gOPS = Object.getOwnPropertySymbols;
7151
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
7152
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
7153
+ // ie, `has-tostringtag/shams
7154
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
7155
+ ? Symbol.toStringTag
7156
+ : null;
7157
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
7158
+
7159
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
7160
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
7161
+ ? function (O) {
7162
+ return O.__proto__; // eslint-disable-line no-proto
7163
+ }
7164
+ : null
7165
+ );
7166
+
7167
+ function addNumericSeparator(num, str) {
7168
+ if (
7169
+ num === Infinity
7170
+ || num === -Infinity
7171
+ || num !== num
7172
+ || (num && num > -1000 && num < 1000)
7173
+ || $test.call(/e/, str)
7174
+ ) {
7175
+ return str;
7176
+ }
7177
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
7178
+ if (typeof num === 'number') {
7179
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
7180
+ if (int !== num) {
7181
+ var intStr = String(int);
7182
+ var dec = $slice.call(str, intStr.length + 1);
7183
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
7184
+ }
7185
+ }
7186
+ return $replace.call(str, sepRegex, '$&_');
7187
+ }
7188
+
7189
+ var utilInspect = util_inspect;
7190
+ var inspectCustom = utilInspect.custom;
7191
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
7192
+
7193
+ var objectInspect = function inspect_(obj, options, depth, seen) {
7194
+ var opts = options || {};
7195
+
7196
+ if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
7197
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
7198
+ }
7199
+ if (
7200
+ has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
7201
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
7202
+ : opts.maxStringLength !== null
7203
+ )
7204
+ ) {
7205
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
7206
+ }
7207
+ var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
7208
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
7209
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
7210
+ }
7211
+
7212
+ if (
7213
+ has$3(opts, 'indent')
7214
+ && opts.indent !== null
7215
+ && opts.indent !== '\t'
7216
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
7217
+ ) {
7218
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
7219
+ }
7220
+ if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
7221
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
7222
+ }
7223
+ var numericSeparator = opts.numericSeparator;
7224
+
7225
+ if (typeof obj === 'undefined') {
7226
+ return 'undefined';
7227
+ }
7228
+ if (obj === null) {
7229
+ return 'null';
7230
+ }
7231
+ if (typeof obj === 'boolean') {
7232
+ return obj ? 'true' : 'false';
7233
+ }
7234
+
7235
+ if (typeof obj === 'string') {
7236
+ return inspectString(obj, opts);
7237
+ }
7238
+ if (typeof obj === 'number') {
7239
+ if (obj === 0) {
7240
+ return Infinity / obj > 0 ? '0' : '-0';
7241
+ }
7242
+ var str = String(obj);
7243
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
7244
+ }
7245
+ if (typeof obj === 'bigint') {
7246
+ var bigIntStr = String(obj) + 'n';
7247
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
7248
+ }
7249
+
7250
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
7251
+ if (typeof depth === 'undefined') { depth = 0; }
7252
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
7253
+ return isArray$3(obj) ? '[Array]' : '[Object]';
7254
+ }
7255
+
7256
+ var indent = getIndent(opts, depth);
7257
+
7258
+ if (typeof seen === 'undefined') {
7259
+ seen = [];
7260
+ } else if (indexOf(seen, obj) >= 0) {
7261
+ return '[Circular]';
7262
+ }
7263
+
7264
+ function inspect(value, from, noIndent) {
7265
+ if (from) {
7266
+ seen = $arrSlice.call(seen);
7267
+ seen.push(from);
7268
+ }
7269
+ if (noIndent) {
7270
+ var newOpts = {
7271
+ depth: opts.depth
7272
+ };
7273
+ if (has$3(opts, 'quoteStyle')) {
7274
+ newOpts.quoteStyle = opts.quoteStyle;
7275
+ }
7276
+ return inspect_(value, newOpts, depth + 1, seen);
7277
+ }
7278
+ return inspect_(value, opts, depth + 1, seen);
7279
+ }
7280
+
7281
+ if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
7282
+ var name = nameOf(obj);
7283
+ var keys = arrObjKeys(obj, inspect);
7284
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
7285
+ }
7286
+ if (isSymbol(obj)) {
7287
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
7288
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
7289
+ }
7290
+ if (isElement(obj)) {
7291
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
7292
+ var attrs = obj.attributes || [];
7293
+ for (var i = 0; i < attrs.length; i++) {
7294
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
7295
+ }
7296
+ s += '>';
7297
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
7298
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
7299
+ return s;
7300
+ }
7301
+ if (isArray$3(obj)) {
7302
+ if (obj.length === 0) { return '[]'; }
7303
+ var xs = arrObjKeys(obj, inspect);
7304
+ if (indent && !singleLineValues(xs)) {
7305
+ return '[' + indentedJoin(xs, indent) + ']';
7306
+ }
7307
+ return '[ ' + $join.call(xs, ', ') + ' ]';
7308
+ }
7309
+ if (isError(obj)) {
7310
+ var parts = arrObjKeys(obj, inspect);
7311
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
7312
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
7313
+ }
7314
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
7315
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
7316
+ }
7317
+ if (typeof obj === 'object' && customInspect) {
7318
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
7319
+ return utilInspect(obj, { depth: maxDepth - depth });
7320
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
7321
+ return obj.inspect();
7322
+ }
7323
+ }
7324
+ if (isMap(obj)) {
7325
+ var mapParts = [];
7326
+ mapForEach.call(obj, function (value, key) {
7327
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
7328
+ });
7329
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
7330
+ }
7331
+ if (isSet(obj)) {
7332
+ var setParts = [];
7333
+ setForEach.call(obj, function (value) {
7334
+ setParts.push(inspect(value, obj));
7335
+ });
7336
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
7337
+ }
7338
+ if (isWeakMap(obj)) {
7339
+ return weakCollectionOf('WeakMap');
7340
+ }
7341
+ if (isWeakSet(obj)) {
7342
+ return weakCollectionOf('WeakSet');
7343
+ }
7344
+ if (isWeakRef(obj)) {
7345
+ return weakCollectionOf('WeakRef');
7346
+ }
7347
+ if (isNumber(obj)) {
7348
+ return markBoxed(inspect(Number(obj)));
7349
+ }
7350
+ if (isBigInt(obj)) {
7351
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
7352
+ }
7353
+ if (isBoolean(obj)) {
7354
+ return markBoxed(booleanValueOf.call(obj));
7355
+ }
7356
+ if (isString(obj)) {
7357
+ return markBoxed(inspect(String(obj)));
7358
+ }
7359
+ if (!isDate(obj) && !isRegExp$1(obj)) {
7360
+ var ys = arrObjKeys(obj, inspect);
7361
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
7362
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
7363
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
7364
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
7365
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
7366
+ if (ys.length === 0) { return tag + '{}'; }
7367
+ if (indent) {
7368
+ return tag + '{' + indentedJoin(ys, indent) + '}';
7369
+ }
7370
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
7371
+ }
7372
+ return String(obj);
7373
+ };
7374
+
7375
+ function wrapQuotes(s, defaultStyle, opts) {
7376
+ var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
7377
+ return quoteChar + s + quoteChar;
7378
+ }
7379
+
7380
+ function quote(s) {
7381
+ return $replace.call(String(s), /"/g, '&quot;');
7382
+ }
7383
+
7384
+ function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7385
+ function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7386
+ function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7387
+ function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7388
+ function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7389
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7390
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
7391
+
7392
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
7393
+ function isSymbol(obj) {
7394
+ if (hasShammedSymbols) {
7395
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
7396
+ }
7397
+ if (typeof obj === 'symbol') {
7398
+ return true;
7399
+ }
7400
+ if (!obj || typeof obj !== 'object' || !symToString) {
7401
+ return false;
7402
+ }
7403
+ try {
7404
+ symToString.call(obj);
7405
+ return true;
7406
+ } catch (e) {}
7407
+ return false;
7408
+ }
7409
+
7410
+ function isBigInt(obj) {
7411
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
7412
+ return false;
7413
+ }
7414
+ try {
7415
+ bigIntValueOf.call(obj);
7416
+ return true;
7417
+ } catch (e) {}
7418
+ return false;
7419
+ }
7420
+
7421
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
7422
+ function has$3(obj, key) {
7423
+ return hasOwn.call(obj, key);
7424
+ }
7425
+
7426
+ function toStr(obj) {
7427
+ return objectToString.call(obj);
7428
+ }
7429
+
7430
+ function nameOf(f) {
7431
+ if (f.name) { return f.name; }
7432
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
7433
+ if (m) { return m[1]; }
7434
+ return null;
7435
+ }
7436
+
7437
+ function indexOf(xs, x) {
7438
+ if (xs.indexOf) { return xs.indexOf(x); }
7439
+ for (var i = 0, l = xs.length; i < l; i++) {
7440
+ if (xs[i] === x) { return i; }
7441
+ }
7442
+ return -1;
7443
+ }
7444
+
7445
+ function isMap(x) {
7446
+ if (!mapSize || !x || typeof x !== 'object') {
7447
+ return false;
7448
+ }
7449
+ try {
7450
+ mapSize.call(x);
7451
+ try {
7452
+ setSize.call(x);
7453
+ } catch (s) {
7454
+ return true;
7455
+ }
7456
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
7457
+ } catch (e) {}
7458
+ return false;
7459
+ }
7460
+
7461
+ function isWeakMap(x) {
7462
+ if (!weakMapHas || !x || typeof x !== 'object') {
7463
+ return false;
7464
+ }
7465
+ try {
7466
+ weakMapHas.call(x, weakMapHas);
7467
+ try {
7468
+ weakSetHas.call(x, weakSetHas);
7469
+ } catch (s) {
7470
+ return true;
7471
+ }
7472
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
7473
+ } catch (e) {}
7474
+ return false;
7475
+ }
7476
+
7477
+ function isWeakRef(x) {
7478
+ if (!weakRefDeref || !x || typeof x !== 'object') {
7479
+ return false;
7480
+ }
7481
+ try {
7482
+ weakRefDeref.call(x);
7483
+ return true;
7484
+ } catch (e) {}
7485
+ return false;
7486
+ }
7487
+
7488
+ function isSet(x) {
7489
+ if (!setSize || !x || typeof x !== 'object') {
7490
+ return false;
7491
+ }
7492
+ try {
7493
+ setSize.call(x);
7494
+ try {
7495
+ mapSize.call(x);
7496
+ } catch (m) {
7497
+ return true;
7498
+ }
7499
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
7500
+ } catch (e) {}
7501
+ return false;
7502
+ }
7503
+
7504
+ function isWeakSet(x) {
7505
+ if (!weakSetHas || !x || typeof x !== 'object') {
7506
+ return false;
7507
+ }
7508
+ try {
7509
+ weakSetHas.call(x, weakSetHas);
7510
+ try {
7511
+ weakMapHas.call(x, weakMapHas);
7512
+ } catch (s) {
7513
+ return true;
7514
+ }
7515
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
7516
+ } catch (e) {}
7517
+ return false;
7518
+ }
7519
+
7520
+ function isElement(x) {
7521
+ if (!x || typeof x !== 'object') { return false; }
7522
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
7523
+ return true;
7524
+ }
7525
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
7526
+ }
7527
+
7528
+ function inspectString(str, opts) {
7529
+ if (str.length > opts.maxStringLength) {
7530
+ var remaining = str.length - opts.maxStringLength;
7531
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
7532
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
7533
+ }
7534
+ // eslint-disable-next-line no-control-regex
7535
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
7536
+ return wrapQuotes(s, 'single', opts);
7537
+ }
7538
+
7539
+ function lowbyte(c) {
7540
+ var n = c.charCodeAt(0);
7541
+ var x = {
7542
+ 8: 'b',
7543
+ 9: 't',
7544
+ 10: 'n',
7545
+ 12: 'f',
7546
+ 13: 'r'
7547
+ }[n];
7548
+ if (x) { return '\\' + x; }
7549
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
7550
+ }
7551
+
7552
+ function markBoxed(str) {
7553
+ return 'Object(' + str + ')';
7554
+ }
7555
+
7556
+ function weakCollectionOf(type) {
7557
+ return type + ' { ? }';
7558
+ }
7559
+
7560
+ function collectionOf(type, size, entries, indent) {
7561
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
7562
+ return type + ' (' + size + ') {' + joinedEntries + '}';
7563
+ }
7564
+
7565
+ function singleLineValues(xs) {
7566
+ for (var i = 0; i < xs.length; i++) {
7567
+ if (indexOf(xs[i], '\n') >= 0) {
7568
+ return false;
7569
+ }
7570
+ }
7571
+ return true;
7572
+ }
7573
+
7574
+ function getIndent(opts, depth) {
7575
+ var baseIndent;
7576
+ if (opts.indent === '\t') {
7577
+ baseIndent = '\t';
7578
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
7579
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
7580
+ } else {
7581
+ return null;
7582
+ }
7583
+ return {
7584
+ base: baseIndent,
7585
+ prev: $join.call(Array(depth + 1), baseIndent)
7586
+ };
7587
+ }
7588
+
7589
+ function indentedJoin(xs, indent) {
7590
+ if (xs.length === 0) { return ''; }
7591
+ var lineJoiner = '\n' + indent.prev + indent.base;
7592
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
7593
+ }
7594
+
7595
+ function arrObjKeys(obj, inspect) {
7596
+ var isArr = isArray$3(obj);
7597
+ var xs = [];
7598
+ if (isArr) {
7599
+ xs.length = obj.length;
7600
+ for (var i = 0; i < obj.length; i++) {
7601
+ xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
7602
+ }
7603
+ }
7604
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
7605
+ var symMap;
7606
+ if (hasShammedSymbols) {
7607
+ symMap = {};
7608
+ for (var k = 0; k < syms.length; k++) {
7609
+ symMap['$' + syms[k]] = syms[k];
7610
+ }
7611
+ }
7612
+
7613
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
7614
+ if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
7615
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
7616
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
7617
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
7618
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
7619
+ } else if ($test.call(/[^\w$]/, key)) {
7620
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
7621
+ } else {
7622
+ xs.push(key + ': ' + inspect(obj[key], obj));
7623
+ }
7624
+ }
7625
+ if (typeof gOPS === 'function') {
7626
+ for (var j = 0; j < syms.length; j++) {
7627
+ if (isEnumerable.call(obj, syms[j])) {
7628
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
7629
+ }
7630
+ }
7631
+ }
7632
+ return xs;
7633
+ }
7634
+
7635
+ var GetIntrinsic = getIntrinsic;
7636
+ var callBound = callBound$1;
7637
+ var inspect = objectInspect;
7638
+
7639
+ var $TypeError = GetIntrinsic('%TypeError%');
7640
+ var $WeakMap = GetIntrinsic('%WeakMap%', true);
7641
+ var $Map = GetIntrinsic('%Map%', true);
7642
+
7643
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
7644
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
7645
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
7646
+ var $mapGet = callBound('Map.prototype.get', true);
7647
+ var $mapSet = callBound('Map.prototype.set', true);
7648
+ var $mapHas = callBound('Map.prototype.has', true);
7649
+
7650
+ /*
7651
+ * This function traverses the list returning the node corresponding to the
7652
+ * given key.
7653
+ *
7654
+ * That node is also moved to the head of the list, so that if it's accessed
7655
+ * again we don't need to traverse the whole list. By doing so, all the recently
7656
+ * used nodes can be accessed relatively quickly.
7657
+ */
7658
+ var listGetNode = function (list, key) { // eslint-disable-line consistent-return
7659
+ for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
7660
+ if (curr.key === key) {
7661
+ prev.next = curr.next;
7662
+ curr.next = list.next;
7663
+ list.next = curr; // eslint-disable-line no-param-reassign
7664
+ return curr;
7665
+ }
7666
+ }
7667
+ };
7668
+
7669
+ var listGet = function (objects, key) {
7670
+ var node = listGetNode(objects, key);
7671
+ return node && node.value;
7672
+ };
7673
+ var listSet = function (objects, key, value) {
7674
+ var node = listGetNode(objects, key);
7675
+ if (node) {
7676
+ node.value = value;
7677
+ } else {
7678
+ // Prepend the new node to the beginning of the list
7679
+ objects.next = { // eslint-disable-line no-param-reassign
7680
+ key: key,
7681
+ next: objects.next,
7682
+ value: value
7683
+ };
7684
+ }
7685
+ };
7686
+ var listHas = function (objects, key) {
7687
+ return !!listGetNode(objects, key);
7688
+ };
7689
+
7690
+ var sideChannel = function getSideChannel() {
7691
+ var $wm;
7692
+ var $m;
7693
+ var $o;
7694
+ var channel = {
7695
+ assert: function (key) {
7696
+ if (!channel.has(key)) {
7697
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
7698
+ }
7699
+ },
7700
+ get: function (key) { // eslint-disable-line consistent-return
7701
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
7702
+ if ($wm) {
7703
+ return $weakMapGet($wm, key);
7704
+ }
7705
+ } else if ($Map) {
7706
+ if ($m) {
7707
+ return $mapGet($m, key);
7708
+ }
7709
+ } else {
7710
+ if ($o) { // eslint-disable-line no-lonely-if
7711
+ return listGet($o, key);
7712
+ }
7713
+ }
7714
+ },
7715
+ has: function (key) {
7716
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
7717
+ if ($wm) {
7718
+ return $weakMapHas($wm, key);
7719
+ }
7720
+ } else if ($Map) {
7721
+ if ($m) {
7722
+ return $mapHas($m, key);
7723
+ }
7724
+ } else {
7725
+ if ($o) { // eslint-disable-line no-lonely-if
7726
+ return listHas($o, key);
7727
+ }
7728
+ }
7729
+ return false;
7730
+ },
7731
+ set: function (key, value) {
7732
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
7733
+ if (!$wm) {
7734
+ $wm = new $WeakMap();
7735
+ }
7736
+ $weakMapSet($wm, key, value);
7737
+ } else if ($Map) {
7738
+ if (!$m) {
7739
+ $m = new $Map();
7740
+ }
7741
+ $mapSet($m, key, value);
7742
+ } else {
7743
+ if (!$o) {
7744
+ /*
7745
+ * Initialize the linked list as an empty node, so that we don't have
7746
+ * to special-case handling of the first node: we can always refer to
7747
+ * it as (previous node).next, instead of something like (list).head
7748
+ */
7749
+ $o = { key: {}, next: null };
7750
+ }
7751
+ listSet($o, key, value);
7752
+ }
7753
+ }
7754
+ };
7755
+ return channel;
7756
+ };
7757
+
7758
+ var replace = String.prototype.replace;
7759
+ var percentTwenties = /%20/g;
7760
+
7761
+ var Format = {
7762
+ RFC1738: 'RFC1738',
7763
+ RFC3986: 'RFC3986'
7764
+ };
7765
+
7766
+ var formats$3 = {
7767
+ 'default': Format.RFC3986,
7768
+ formatters: {
7769
+ RFC1738: function (value) {
7770
+ return replace.call(value, percentTwenties, '+');
7771
+ },
7772
+ RFC3986: function (value) {
7773
+ return String(value);
7774
+ }
7775
+ },
7776
+ RFC1738: Format.RFC1738,
7777
+ RFC3986: Format.RFC3986
7778
+ };
7779
+
7780
+ var formats$2 = formats$3;
7781
+
7782
+ var has$2 = Object.prototype.hasOwnProperty;
7783
+ var isArray$2 = Array.isArray;
7784
+
7785
+ var hexTable = (function () {
7786
+ var array = [];
7787
+ for (var i = 0; i < 256; ++i) {
7788
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
7789
+ }
7790
+
7791
+ return array;
7792
+ }());
7793
+
7794
+ var compactQueue = function compactQueue(queue) {
7795
+ while (queue.length > 1) {
7796
+ var item = queue.pop();
7797
+ var obj = item.obj[item.prop];
7798
+
7799
+ if (isArray$2(obj)) {
7800
+ var compacted = [];
7801
+
7802
+ for (var j = 0; j < obj.length; ++j) {
7803
+ if (typeof obj[j] !== 'undefined') {
7804
+ compacted.push(obj[j]);
7805
+ }
7806
+ }
7807
+
7808
+ item.obj[item.prop] = compacted;
7809
+ }
7810
+ }
7811
+ };
7812
+
7813
+ var arrayToObject = function arrayToObject(source, options) {
7814
+ var obj = options && options.plainObjects ? Object.create(null) : {};
7815
+ for (var i = 0; i < source.length; ++i) {
7816
+ if (typeof source[i] !== 'undefined') {
7817
+ obj[i] = source[i];
7818
+ }
7819
+ }
7820
+
7821
+ return obj;
7822
+ };
7823
+
7824
+ var merge = function merge(target, source, options) {
7825
+ /* eslint no-param-reassign: 0 */
7826
+ if (!source) {
7827
+ return target;
7828
+ }
7829
+
7830
+ if (typeof source !== 'object') {
7831
+ if (isArray$2(target)) {
7832
+ target.push(source);
7833
+ } else if (target && typeof target === 'object') {
7834
+ if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
7835
+ target[source] = true;
7836
+ }
7837
+ } else {
7838
+ return [target, source];
7839
+ }
7840
+
7841
+ return target;
7842
+ }
7843
+
7844
+ if (!target || typeof target !== 'object') {
7845
+ return [target].concat(source);
7846
+ }
7847
+
7848
+ var mergeTarget = target;
7849
+ if (isArray$2(target) && !isArray$2(source)) {
7850
+ mergeTarget = arrayToObject(target, options);
7851
+ }
7852
+
7853
+ if (isArray$2(target) && isArray$2(source)) {
7854
+ source.forEach(function (item, i) {
7855
+ if (has$2.call(target, i)) {
7856
+ var targetItem = target[i];
7857
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
7858
+ target[i] = merge(targetItem, item, options);
7859
+ } else {
7860
+ target.push(item);
7861
+ }
7862
+ } else {
7863
+ target[i] = item;
7864
+ }
7865
+ });
7866
+ return target;
7867
+ }
7868
+
7869
+ return Object.keys(source).reduce(function (acc, key) {
7870
+ var value = source[key];
7871
+
7872
+ if (has$2.call(acc, key)) {
7873
+ acc[key] = merge(acc[key], value, options);
7874
+ } else {
7875
+ acc[key] = value;
7876
+ }
7877
+ return acc;
7878
+ }, mergeTarget);
7879
+ };
7880
+
7881
+ var assign = function assignSingleSource(target, source) {
7882
+ return Object.keys(source).reduce(function (acc, key) {
7883
+ acc[key] = source[key];
7884
+ return acc;
7885
+ }, target);
7886
+ };
7887
+
7888
+ var decode = function (str, decoder, charset) {
7889
+ var strWithoutPlus = str.replace(/\+/g, ' ');
7890
+ if (charset === 'iso-8859-1') {
7891
+ // unescape never throws, no try...catch needed:
7892
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
7893
+ }
7894
+ // utf-8
7895
+ try {
7896
+ return decodeURIComponent(strWithoutPlus);
7897
+ } catch (e) {
7898
+ return strWithoutPlus;
7899
+ }
7900
+ };
7901
+
7902
+ var encode = function encode(str, defaultEncoder, charset, kind, format) {
7903
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
7904
+ // It has been adapted here for stricter adherence to RFC 3986
7905
+ if (str.length === 0) {
7906
+ return str;
7907
+ }
7908
+
7909
+ var string = str;
7910
+ if (typeof str === 'symbol') {
7911
+ string = Symbol.prototype.toString.call(str);
7912
+ } else if (typeof str !== 'string') {
7913
+ string = String(str);
7914
+ }
7915
+
7916
+ if (charset === 'iso-8859-1') {
7917
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
7918
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
7919
+ });
7920
+ }
7921
+
7922
+ var out = '';
7923
+ for (var i = 0; i < string.length; ++i) {
7924
+ var c = string.charCodeAt(i);
7925
+
7926
+ if (
7927
+ c === 0x2D // -
7928
+ || c === 0x2E // .
7929
+ || c === 0x5F // _
7930
+ || c === 0x7E // ~
7931
+ || (c >= 0x30 && c <= 0x39) // 0-9
7932
+ || (c >= 0x41 && c <= 0x5A) // a-z
7933
+ || (c >= 0x61 && c <= 0x7A) // A-Z
7934
+ || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
7935
+ ) {
7936
+ out += string.charAt(i);
7937
+ continue;
7938
+ }
7939
+
7940
+ if (c < 0x80) {
7941
+ out = out + hexTable[c];
7942
+ continue;
7943
+ }
7944
+
7945
+ if (c < 0x800) {
7946
+ out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
7947
+ continue;
7948
+ }
7949
+
7950
+ if (c < 0xD800 || c >= 0xE000) {
7951
+ out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
7952
+ continue;
7953
+ }
7954
+
7955
+ i += 1;
7956
+ c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
7957
+ /* eslint operator-linebreak: [2, "before"] */
7958
+ out += hexTable[0xF0 | (c >> 18)]
7959
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
7960
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
7961
+ + hexTable[0x80 | (c & 0x3F)];
7962
+ }
7963
+
7964
+ return out;
7965
+ };
7966
+
7967
+ var compact = function compact(value) {
7968
+ var queue = [{ obj: { o: value }, prop: 'o' }];
7969
+ var refs = [];
7970
+
7971
+ for (var i = 0; i < queue.length; ++i) {
7972
+ var item = queue[i];
7973
+ var obj = item.obj[item.prop];
7974
+
7975
+ var keys = Object.keys(obj);
7976
+ for (var j = 0; j < keys.length; ++j) {
7977
+ var key = keys[j];
7978
+ var val = obj[key];
7979
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
7980
+ queue.push({ obj: obj, prop: key });
7981
+ refs.push(val);
7982
+ }
7983
+ }
7984
+ }
7985
+
7986
+ compactQueue(queue);
7987
+
7988
+ return value;
7989
+ };
7990
+
7991
+ var isRegExp = function isRegExp(obj) {
7992
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
7993
+ };
7994
+
7995
+ var isBuffer = function isBuffer(obj) {
7996
+ if (!obj || typeof obj !== 'object') {
7997
+ return false;
7998
+ }
7999
+
8000
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
8001
+ };
8002
+
8003
+ var combine = function combine(a, b) {
8004
+ return [].concat(a, b);
8005
+ };
8006
+
8007
+ var maybeMap = function maybeMap(val, fn) {
8008
+ if (isArray$2(val)) {
8009
+ var mapped = [];
8010
+ for (var i = 0; i < val.length; i += 1) {
8011
+ mapped.push(fn(val[i]));
8012
+ }
8013
+ return mapped;
8014
+ }
8015
+ return fn(val);
8016
+ };
8017
+
8018
+ var utils$2 = {
8019
+ arrayToObject: arrayToObject,
8020
+ assign: assign,
8021
+ combine: combine,
8022
+ compact: compact,
8023
+ decode: decode,
8024
+ encode: encode,
8025
+ isBuffer: isBuffer,
8026
+ isRegExp: isRegExp,
8027
+ maybeMap: maybeMap,
8028
+ merge: merge
8029
+ };
8030
+
8031
+ var getSideChannel = sideChannel;
8032
+ var utils$1 = utils$2;
8033
+ var formats$1 = formats$3;
8034
+ var has$1 = Object.prototype.hasOwnProperty;
8035
+
8036
+ var arrayPrefixGenerators = {
8037
+ brackets: function brackets(prefix) {
8038
+ return prefix + '[]';
8039
+ },
8040
+ comma: 'comma',
8041
+ indices: function indices(prefix, key) {
8042
+ return prefix + '[' + key + ']';
8043
+ },
8044
+ repeat: function repeat(prefix) {
8045
+ return prefix;
8046
+ }
8047
+ };
8048
+
8049
+ var isArray$1 = Array.isArray;
8050
+ var split = String.prototype.split;
8051
+ var push = Array.prototype.push;
8052
+ var pushToArray = function (arr, valueOrArray) {
8053
+ push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
8054
+ };
8055
+
8056
+ var toISO = Date.prototype.toISOString;
8057
+
8058
+ var defaultFormat = formats$1['default'];
8059
+ var defaults$1 = {
8060
+ addQueryPrefix: false,
8061
+ allowDots: false,
8062
+ charset: 'utf-8',
8063
+ charsetSentinel: false,
8064
+ delimiter: '&',
8065
+ encode: true,
8066
+ encoder: utils$1.encode,
8067
+ encodeValuesOnly: false,
8068
+ format: defaultFormat,
8069
+ formatter: formats$1.formatters[defaultFormat],
8070
+ // deprecated
8071
+ indices: false,
8072
+ serializeDate: function serializeDate(date) {
8073
+ return toISO.call(date);
8074
+ },
8075
+ skipNulls: false,
8076
+ strictNullHandling: false
8077
+ };
8078
+
8079
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
8080
+ return typeof v === 'string'
8081
+ || typeof v === 'number'
8082
+ || typeof v === 'boolean'
8083
+ || typeof v === 'symbol'
8084
+ || typeof v === 'bigint';
8085
+ };
8086
+
8087
+ var sentinel = {};
8088
+
8089
+ var stringify$1 = function stringify(
8090
+ object,
8091
+ prefix,
8092
+ generateArrayPrefix,
8093
+ commaRoundTrip,
8094
+ strictNullHandling,
8095
+ skipNulls,
8096
+ encoder,
8097
+ filter,
8098
+ sort,
8099
+ allowDots,
8100
+ serializeDate,
8101
+ format,
8102
+ formatter,
8103
+ encodeValuesOnly,
8104
+ charset,
8105
+ sideChannel
8106
+ ) {
8107
+ var obj = object;
8108
+
8109
+ var tmpSc = sideChannel;
8110
+ var step = 0;
8111
+ var findFlag = false;
8112
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
8113
+ // Where object last appeared in the ref tree
8114
+ var pos = tmpSc.get(object);
8115
+ step += 1;
8116
+ if (typeof pos !== 'undefined') {
8117
+ if (pos === step) {
8118
+ throw new RangeError('Cyclic object value');
8119
+ } else {
8120
+ findFlag = true; // Break while
8121
+ }
8122
+ }
8123
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
8124
+ step = 0;
8125
+ }
8126
+ }
8127
+
8128
+ if (typeof filter === 'function') {
8129
+ obj = filter(prefix, obj);
8130
+ } else if (obj instanceof Date) {
8131
+ obj = serializeDate(obj);
8132
+ } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
8133
+ obj = utils$1.maybeMap(obj, function (value) {
8134
+ if (value instanceof Date) {
8135
+ return serializeDate(value);
8136
+ }
8137
+ return value;
8138
+ });
8139
+ }
8140
+
8141
+ if (obj === null) {
8142
+ if (strictNullHandling) {
8143
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
8144
+ }
8145
+
8146
+ obj = '';
8147
+ }
8148
+
8149
+ if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
8150
+ if (encoder) {
8151
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
8152
+ if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
8153
+ var valuesArray = split.call(String(obj), ',');
8154
+ var valuesJoined = '';
8155
+ for (var i = 0; i < valuesArray.length; ++i) {
8156
+ valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$1.encoder, charset, 'value', format));
8157
+ }
8158
+ return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
8159
+ }
8160
+ return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
8161
+ }
8162
+ return [formatter(prefix) + '=' + formatter(String(obj))];
8163
+ }
8164
+
8165
+ var values = [];
8166
+
8167
+ if (typeof obj === 'undefined') {
8168
+ return values;
8169
+ }
8170
+
8171
+ var objKeys;
8172
+ if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
8173
+ // we need to join elements in
8174
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
8175
+ } else if (isArray$1(filter)) {
8176
+ objKeys = filter;
8177
+ } else {
8178
+ var keys = Object.keys(obj);
8179
+ objKeys = sort ? keys.sort(sort) : keys;
8180
+ }
8181
+
8182
+ var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
8183
+
8184
+ for (var j = 0; j < objKeys.length; ++j) {
8185
+ var key = objKeys[j];
8186
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
8187
+
8188
+ if (skipNulls && value === null) {
8189
+ continue;
8190
+ }
8191
+
8192
+ var keyPrefix = isArray$1(obj)
8193
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
8194
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
8195
+
8196
+ sideChannel.set(object, step);
8197
+ var valueSideChannel = getSideChannel();
8198
+ valueSideChannel.set(sentinel, sideChannel);
8199
+ pushToArray(values, stringify(
8200
+ value,
8201
+ keyPrefix,
8202
+ generateArrayPrefix,
8203
+ commaRoundTrip,
8204
+ strictNullHandling,
8205
+ skipNulls,
8206
+ encoder,
8207
+ filter,
8208
+ sort,
8209
+ allowDots,
8210
+ serializeDate,
8211
+ format,
8212
+ formatter,
8213
+ encodeValuesOnly,
8214
+ charset,
8215
+ valueSideChannel
8216
+ ));
8217
+ }
8218
+
8219
+ return values;
8220
+ };
8221
+
8222
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
8223
+ if (!opts) {
8224
+ return defaults$1;
8225
+ }
8226
+
8227
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
8228
+ throw new TypeError('Encoder has to be a function.');
8229
+ }
8230
+
8231
+ var charset = opts.charset || defaults$1.charset;
8232
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
8233
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
8234
+ }
8235
+
8236
+ var format = formats$1['default'];
8237
+ if (typeof opts.format !== 'undefined') {
8238
+ if (!has$1.call(formats$1.formatters, opts.format)) {
8239
+ throw new TypeError('Unknown format option provided.');
8240
+ }
8241
+ format = opts.format;
8242
+ }
8243
+ var formatter = formats$1.formatters[format];
8244
+
8245
+ var filter = defaults$1.filter;
8246
+ if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
8247
+ filter = opts.filter;
8248
+ }
8249
+
8250
+ return {
8251
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
8252
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
8253
+ charset: charset,
8254
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
8255
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
8256
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
8257
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
8258
+ encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
8259
+ filter: filter,
8260
+ format: format,
8261
+ formatter: formatter,
8262
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
8263
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
8264
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
8265
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
8266
+ };
8267
+ };
8268
+
8269
+ var stringify_1 = function (object, opts) {
8270
+ var obj = object;
8271
+ var options = normalizeStringifyOptions(opts);
8272
+
8273
+ var objKeys;
8274
+ var filter;
8275
+
8276
+ if (typeof options.filter === 'function') {
8277
+ filter = options.filter;
8278
+ obj = filter('', obj);
8279
+ } else if (isArray$1(options.filter)) {
8280
+ filter = options.filter;
8281
+ objKeys = filter;
8282
+ }
8283
+
8284
+ var keys = [];
8285
+
8286
+ if (typeof obj !== 'object' || obj === null) {
8287
+ return '';
8288
+ }
8289
+
8290
+ var arrayFormat;
8291
+ if (opts && opts.arrayFormat in arrayPrefixGenerators) {
8292
+ arrayFormat = opts.arrayFormat;
8293
+ } else if (opts && 'indices' in opts) {
8294
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
8295
+ } else {
8296
+ arrayFormat = 'indices';
8297
+ }
8298
+
8299
+ var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
8300
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
8301
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
8302
+ }
8303
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
8304
+
8305
+ if (!objKeys) {
8306
+ objKeys = Object.keys(obj);
8307
+ }
8308
+
8309
+ if (options.sort) {
8310
+ objKeys.sort(options.sort);
8311
+ }
8312
+
8313
+ var sideChannel = getSideChannel();
8314
+ for (var i = 0; i < objKeys.length; ++i) {
8315
+ var key = objKeys[i];
8316
+
8317
+ if (options.skipNulls && obj[key] === null) {
8318
+ continue;
8319
+ }
8320
+ pushToArray(keys, stringify$1(
8321
+ obj[key],
8322
+ key,
8323
+ generateArrayPrefix,
8324
+ commaRoundTrip,
8325
+ options.strictNullHandling,
8326
+ options.skipNulls,
8327
+ options.encode ? options.encoder : null,
8328
+ options.filter,
8329
+ options.sort,
8330
+ options.allowDots,
8331
+ options.serializeDate,
8332
+ options.format,
8333
+ options.formatter,
8334
+ options.encodeValuesOnly,
8335
+ options.charset,
8336
+ sideChannel
8337
+ ));
8338
+ }
8339
+
8340
+ var joined = keys.join(options.delimiter);
8341
+ var prefix = options.addQueryPrefix === true ? '?' : '';
8342
+
8343
+ if (options.charsetSentinel) {
8344
+ if (options.charset === 'iso-8859-1') {
8345
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
8346
+ prefix += 'utf8=%26%2310003%3B&';
8347
+ } else {
8348
+ // encodeURIComponent('✓')
8349
+ prefix += 'utf8=%E2%9C%93&';
8350
+ }
8351
+ }
8352
+
8353
+ return joined.length > 0 ? prefix + joined : '';
8354
+ };
8355
+
8356
+ var utils = utils$2;
8357
+
8358
+ var has = Object.prototype.hasOwnProperty;
8359
+ var isArray = Array.isArray;
8360
+
8361
+ var defaults = {
8362
+ allowDots: false,
8363
+ allowPrototypes: false,
8364
+ allowSparse: false,
8365
+ arrayLimit: 20,
8366
+ charset: 'utf-8',
8367
+ charsetSentinel: false,
8368
+ comma: false,
8369
+ decoder: utils.decode,
8370
+ delimiter: '&',
8371
+ depth: 5,
8372
+ ignoreQueryPrefix: false,
8373
+ interpretNumericEntities: false,
8374
+ parameterLimit: 1000,
8375
+ parseArrays: true,
8376
+ plainObjects: false,
8377
+ strictNullHandling: false
8378
+ };
8379
+
8380
+ var interpretNumericEntities = function (str) {
8381
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
8382
+ return String.fromCharCode(parseInt(numberStr, 10));
8383
+ });
8384
+ };
8385
+
8386
+ var parseArrayValue = function (val, options) {
8387
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
8388
+ return val.split(',');
8389
+ }
8390
+
8391
+ return val;
8392
+ };
8393
+
8394
+ // This is what browsers will submit when the ✓ character occurs in an
8395
+ // application/x-www-form-urlencoded body and the encoding of the page containing
8396
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
8397
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
8398
+ // the ✓ character, such as us-ascii.
8399
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
8400
+
8401
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
8402
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
8403
+
8404
+ var parseValues = function parseQueryStringValues(str, options) {
8405
+ var obj = {};
8406
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
8407
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
8408
+ var parts = cleanStr.split(options.delimiter, limit);
8409
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
8410
+ var i;
8411
+
8412
+ var charset = options.charset;
8413
+ if (options.charsetSentinel) {
8414
+ for (i = 0; i < parts.length; ++i) {
8415
+ if (parts[i].indexOf('utf8=') === 0) {
8416
+ if (parts[i] === charsetSentinel) {
8417
+ charset = 'utf-8';
8418
+ } else if (parts[i] === isoSentinel) {
8419
+ charset = 'iso-8859-1';
8420
+ }
8421
+ skipIndex = i;
8422
+ i = parts.length; // The eslint settings do not allow break;
8423
+ }
8424
+ }
8425
+ }
8426
+
8427
+ for (i = 0; i < parts.length; ++i) {
8428
+ if (i === skipIndex) {
8429
+ continue;
8430
+ }
8431
+ var part = parts[i];
8432
+
8433
+ var bracketEqualsPos = part.indexOf(']=');
8434
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
8435
+
8436
+ var key, val;
8437
+ if (pos === -1) {
8438
+ key = options.decoder(part, defaults.decoder, charset, 'key');
8439
+ val = options.strictNullHandling ? null : '';
8440
+ } else {
8441
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
8442
+ val = utils.maybeMap(
8443
+ parseArrayValue(part.slice(pos + 1), options),
8444
+ function (encodedVal) {
8445
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
8446
+ }
8447
+ );
8448
+ }
8449
+
8450
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
8451
+ val = interpretNumericEntities(val);
8452
+ }
8453
+
8454
+ if (part.indexOf('[]=') > -1) {
8455
+ val = isArray(val) ? [val] : val;
8456
+ }
8457
+
8458
+ if (has.call(obj, key)) {
8459
+ obj[key] = utils.combine(obj[key], val);
8460
+ } else {
8461
+ obj[key] = val;
8462
+ }
8463
+ }
8464
+
8465
+ return obj;
8466
+ };
8467
+
8468
+ var parseObject = function (chain, val, options, valuesParsed) {
8469
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
8470
+
8471
+ for (var i = chain.length - 1; i >= 0; --i) {
8472
+ var obj;
8473
+ var root = chain[i];
8474
+
8475
+ if (root === '[]' && options.parseArrays) {
8476
+ obj = [].concat(leaf);
8477
+ } else {
8478
+ obj = options.plainObjects ? Object.create(null) : {};
8479
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
8480
+ var index = parseInt(cleanRoot, 10);
8481
+ if (!options.parseArrays && cleanRoot === '') {
8482
+ obj = { 0: leaf };
8483
+ } else if (
8484
+ !isNaN(index)
8485
+ && root !== cleanRoot
8486
+ && String(index) === cleanRoot
8487
+ && index >= 0
8488
+ && (options.parseArrays && index <= options.arrayLimit)
8489
+ ) {
8490
+ obj = [];
8491
+ obj[index] = leaf;
8492
+ } else if (cleanRoot !== '__proto__') {
8493
+ obj[cleanRoot] = leaf;
8494
+ }
8495
+ }
8496
+
8497
+ leaf = obj;
8498
+ }
8499
+
8500
+ return leaf;
8501
+ };
8502
+
8503
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
8504
+ if (!givenKey) {
8505
+ return;
8506
+ }
8507
+
8508
+ // Transform dot notation to bracket notation
8509
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
8510
+
8511
+ // The regex chunks
8512
+
8513
+ var brackets = /(\[[^[\]]*])/;
8514
+ var child = /(\[[^[\]]*])/g;
8515
+
8516
+ // Get the parent
8517
+
8518
+ var segment = options.depth > 0 && brackets.exec(key);
8519
+ var parent = segment ? key.slice(0, segment.index) : key;
8520
+
8521
+ // Stash the parent if it exists
8522
+
8523
+ var keys = [];
8524
+ if (parent) {
8525
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
8526
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
8527
+ if (!options.allowPrototypes) {
8528
+ return;
8529
+ }
8530
+ }
8531
+
8532
+ keys.push(parent);
8533
+ }
8534
+
8535
+ // Loop through children appending to the array until we hit depth
8536
+
8537
+ var i = 0;
8538
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
8539
+ i += 1;
8540
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
8541
+ if (!options.allowPrototypes) {
8542
+ return;
8543
+ }
8544
+ }
8545
+ keys.push(segment[1]);
8546
+ }
8547
+
8548
+ // If there's a remainder, just add whatever is left
8549
+
8550
+ if (segment) {
8551
+ keys.push('[' + key.slice(segment.index) + ']');
8552
+ }
8553
+
8554
+ return parseObject(keys, val, options, valuesParsed);
8555
+ };
8556
+
8557
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
8558
+ if (!opts) {
8559
+ return defaults;
8560
+ }
8561
+
8562
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
8563
+ throw new TypeError('Decoder has to be a function.');
8564
+ }
8565
+
8566
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
8567
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
8568
+ }
8569
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
8570
+
8571
+ return {
8572
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
8573
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
8574
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
8575
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
8576
+ charset: charset,
8577
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
8578
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
8579
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
8580
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
8581
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
8582
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
8583
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
8584
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
8585
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
8586
+ parseArrays: opts.parseArrays !== false,
8587
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
8588
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
8589
+ };
8590
+ };
8591
+
8592
+ var parse$1 = function (str, opts) {
8593
+ var options = normalizeParseOptions(opts);
8594
+
8595
+ if (str === '' || str === null || typeof str === 'undefined') {
8596
+ return options.plainObjects ? Object.create(null) : {};
8597
+ }
8598
+
8599
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
8600
+ var obj = options.plainObjects ? Object.create(null) : {};
8601
+
8602
+ // Iterate over the keys and setup the new object
8603
+
8604
+ var keys = Object.keys(tempObj);
8605
+ for (var i = 0; i < keys.length; ++i) {
8606
+ var key = keys[i];
8607
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
8608
+ obj = utils.merge(obj, newObj, options);
8609
+ }
8610
+
8611
+ if (options.allowSparse === true) {
8612
+ return obj;
8613
+ }
8614
+
8615
+ return utils.compact(obj);
8616
+ };
8617
+
8618
+ var stringify = stringify_1;
8619
+ var parse = parse$1;
8620
+ var formats = formats$3;
8621
+
8622
+ var lib = {
8623
+ formats: formats,
8624
+ parse: parse,
8625
+ stringify: stringify
8626
+ };
8627
+
8628
+ const fetch = params => axios__default["default"].get(`${BASE_URL}/teams`, {
8629
+ params: keysToSnakeCase(params),
8630
+ paramsSerializer: params => lib.stringify(params, {
8631
+ arrayFormat: "brackets",
8632
+ encode: false
8633
+ })
8634
+ });
8635
+ const create = payload => axios__default["default"].post(`${BASE_URL}/teams`, payload);
8636
+ const update = (id, payload) => axios__default["default"].put(`${BASE_URL}/teams/${id}`, {
8637
+ team: payload
8638
+ });
8639
+ const bulkUpdate = payload => axios__default["default"].patch(`${BASE_URL}/teams/bulk_update`, payload);
8640
+ const fetchFilterOptions = params => axios__default["default"].get(`${BASE_URL}/teams/filter_options`, {
8641
+ params: keysToSnakeCase(params)
8642
+ });
8643
+ const teamsApi = {
8644
+ bulkUpdate,
8645
+ create,
8646
+ fetch,
8647
+ fetchFilterOptions,
8648
+ update
8649
+ };
8650
+
8651
+ const _excluded$1 = ["onSuccess"],
8652
+ _excluded2$1 = ["onSuccess"],
8653
+ _excluded3 = ["onSuccess"];
8654
+ function ownKeys$4(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; }
8655
+ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8656
+ const useFetchMembers = function () {
8657
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8658
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8659
+ return reactQuery.useQuery([QUERY_KEYS.TEAMS, params], () => teamsApi.fetch(params), _objectSpread$4({
8660
+ staleTime: DEFAULT_STALE_TIME,
8661
+ select: response => response.data || response,
8662
+ keepPreviousData: true
8663
+ }, options));
8664
+ };
8665
+ const useCreateMember = _ref => {
8666
+ let onSuccess = _ref.onSuccess,
8667
+ options = _objectWithoutProperties(_ref, _excluded$1);
8668
+ return reactQuery.useMutation(teamsApi.create, _objectSpread$4({
8669
+ onSuccess: response => {
8670
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
8671
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
8672
+ neetoui.Toastr.success(response.ntmNotice || response.data.ntmNotice);
8673
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
8674
+ }
8675
+ }, options));
8676
+ };
8677
+ const useUpdateMember = _ref2 => {
8678
+ let onSuccess = _ref2.onSuccess,
8679
+ options = _objectWithoutProperties(_ref2, _excluded2$1);
8680
+ return reactQuery.useMutation(_ref3 => {
8681
+ let id = _ref3.id,
8682
+ payload = _ref3.payload;
8683
+ return teamsApi.update(id, payload);
8684
+ }, _objectSpread$4({
8685
+ onSuccess: response => {
8686
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
8687
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
8688
+ neetoui.Toastr.success(response.ntmNotice || response.data.ntmNotice);
8689
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
8690
+ }
8691
+ }, options));
8692
+ };
8693
+ const useBulkUpdateMembers = _ref4 => {
8694
+ let onSuccess = _ref4.onSuccess,
8695
+ options = _objectWithoutProperties(_ref4, _excluded3);
8696
+ return reactQuery.useMutation(teamsApi.bulkUpdate, _objectSpread$4({
8697
+ onSuccess: response => {
8698
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
8699
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
8700
+ neetoui.Toastr.success(response.ntmNotice || response.data.ntmNotice);
8701
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
8702
+ }
8703
+ }, options));
8704
+ };
8705
+ const refetchMembers = () => {
8706
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
8707
+ queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
8708
+ };
8709
+ const useFetchFilterOptions = _ref5 => {
8710
+ let _ref5$params = _ref5.params,
8711
+ params = _ref5$params === void 0 ? {} : _ref5$params,
8712
+ _ref5$options = _ref5.options,
8713
+ options = _ref5$options === void 0 ? {} : _ref5$options;
8714
+ return reactQuery.useQuery([QUERY_KEYS.TEAMS_DEPENDENCIES, params], () => teamsApi.fetchFilterOptions(params), _objectSpread$4({
8715
+ staleTime: DEFAULT_STALE_TIME,
8716
+ select: response => response.data || response
8717
+ }, options));
8718
+ };
8719
+
8720
+ const FIXED_COLUMNS = ["actions"];
8721
+ const COLUMNS_DROPDOWN_PROPS = {
8722
+ label: instance.t("common.column", PLURAL)
8723
+ };
8724
+ const COLUMNS_SEARCH_PROPS = {
8725
+ placeholder: instance.t("columns.search")
8726
+ };
8727
+ const MANAGE_ROLES_BUTTON_LABEL = instance.t("common.manage_", {
8728
+ what: instance.t("common.role", PLURAL).toLocaleLowerCase()
8729
+ });
8730
+
8731
+ const Header = _ref => {
8732
+ var _permissions$create, _config$header;
8733
+ let config = _ref.config,
8734
+ _ref$isEmptyState = _ref.isEmptyState,
8735
+ isEmptyState = _ref$isEmptyState === void 0 ? false : _ref$isEmptyState,
8736
+ metaName = _ref.metaName,
8737
+ _ref$onClick = _ref.onClick,
8738
+ onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
8739
+ permissions = _ref.permissions,
8740
+ rolesButtonProps = _ref.rolesButtonProps;
8741
+ const isRolesButtonVisible = !!rolesButtonProps;
8742
+ const hasCreatePermission = (_permissions$create = permissions === null || permissions === void 0 ? void 0 : permissions.create) !== null && _permissions$create !== void 0 ? _permissions$create : hasPermission(MANAGE_MEMBER_PERMISSIONS);
8743
+ const isOtherActionBlockVisible = !!(config !== null && config !== void 0 && (_config$header = config.header) !== null && _config$header !== void 0 && _config$header.otherActionBlock) && !isEmptyState;
8744
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isOtherActionBlockVisible && config.header.otherActionBlock(), isRolesButtonVisible ? /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends({
8745
+ "data-cy": "ntm-manage-roles-button",
8746
+ label: MANAGE_ROLES_BUTTON_LABEL,
8747
+ style: "secondary"
8748
+ }, rolesButtonProps)) : null, /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, {
8749
+ content: instance.t("tooltips.noPermissionToAddMember"),
8750
+ disabled: hasCreatePermission,
8751
+ position: "bottom"
8752
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
8753
+ "data-cy": "ntm-add-member-button",
8754
+ disabled: !hasCreatePermission,
8755
+ label: instance.t("common.add_", {
8756
+ what: metaName(SINGULAR).toLocaleLowerCase()
8757
+ }),
8758
+ onClick: onClick
8759
+ }))));
8760
+ };
8761
+
8762
+ const useDebounce = function (value) {
8763
+ let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
8764
+ const _useState = React.useState(value),
8765
+ _useState2 = _slicedToArray$1(_useState, 2),
8766
+ debouncedValue = _useState2[0],
8767
+ setDebouncedValue = _useState2[1];
8768
+ React.useEffect(() => {
8769
+ const handler = setTimeout(() => setDebouncedValue(value), delay);
8770
+ return () => clearTimeout(handler);
8771
+ }, [value, delay]);
8772
+ return debouncedValue;
8773
+ };
8774
+
8775
+ const getStorageValue = (key, defaultValue) => {
8776
+ const saved = localStorage.getItem(key);
8777
+ return JSON.parse(saved) || defaultValue;
8778
+ };
8779
+ const useLocalStorage = (key, defaultValue) => {
8780
+ const _useState = React.useState(() => getStorageValue(key, defaultValue)),
8781
+ _useState2 = _slicedToArray$1(_useState, 2),
8782
+ storedValue = _useState2[0],
8783
+ setStoredValue = _useState2[1];
8784
+ const setValue = value => {
8785
+ if (ramda.isNil(value)) {
8786
+ localStorage.removeItem(key);
8787
+ } else {
8788
+ localStorage.setItem(key, JSON.stringify(value));
8789
+ }
8790
+ setStoredValue(value);
8791
+ };
8792
+ return [storedValue, setValue];
8793
+ };
8794
+
8795
+ const removeFixedColumns = (fixedColumns, columnData) => removeBy({
8796
+ dataIndex: ramda.includes(ramda.__, fixedColumns)
8797
+ }, columnData);
8798
+ const filterBySearchTerm$1 = (searchTerm, columns) => ramda.filter(_ref => {
8799
+ let title = _ref.title;
8800
+ return ramda.includes(ramda.trim(ramda.toLower(searchTerm)), ramda.trim(ramda.toLower(title)));
8801
+ }, columns);
8802
+
8803
+ const Columns = _ref => {
8804
+ let actionBlock = _ref.actionBlock,
8805
+ _ref$checkboxProps = _ref.checkboxProps,
8806
+ checkboxProps = _ref$checkboxProps === void 0 ? {} : _ref$checkboxProps,
8807
+ _ref$columnData = _ref.columnData,
8808
+ columnData = _ref$columnData === void 0 ? [] : _ref$columnData,
8809
+ _ref$dropdownProps = _ref.dropdownProps,
8810
+ dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
8811
+ _ref$fixedColumns = _ref.fixedColumns,
8812
+ fixedColumns = _ref$fixedColumns === void 0 ? [] : _ref$fixedColumns,
8813
+ _ref$isSearchable = _ref.isSearchable,
8814
+ isSearchable = _ref$isSearchable === void 0 ? false : _ref$isSearchable,
8815
+ _ref$localStorageKey = _ref.localStorageKey,
8816
+ localStorageKey = _ref$localStorageKey === void 0 ? "" : _ref$localStorageKey,
8817
+ _ref$noColumnMessage = _ref.noColumnMessage,
8818
+ noColumnMessage = _ref$noColumnMessage === void 0 ? "No columns found!" : _ref$noColumnMessage,
8819
+ _ref$onChange = _ref.onChange,
8820
+ onChange = _ref$onChange === void 0 ? ramda.identity : _ref$onChange,
8821
+ _ref$searchProps = _ref.searchProps,
8822
+ searchProps = _ref$searchProps === void 0 ? {} : _ref$searchProps;
8823
+ // @ts-ignore
8824
+ const Divider = neetoui.Dropdown.Divider,
8825
+ Menu = neetoui.Dropdown.Menu,
8826
+ MenuItem = neetoui.Dropdown.MenuItem;
8827
+ const _useLocalStorage = useLocalStorage(localStorageKey, []),
8828
+ _useLocalStorage2 = _slicedToArray$1(_useLocalStorage, 2),
8829
+ hiddenColumns = _useLocalStorage2[0],
8830
+ setHiddenColumns = _useLocalStorage2[1];
8831
+ const _useState = React.useState(""),
8832
+ _useState2 = _slicedToArray$1(_useState, 2),
8833
+ searchTerm = _useState2[0],
8834
+ setSearchTerm = _useState2[1];
8835
+ const columns = removeFixedColumns(fixedColumns, columnData);
8836
+ const filteredColumns = filterBySearchTerm$1(searchTerm, columns);
8837
+ const handleChange = _ref2 => {
8838
+ let _ref2$target = _ref2.target,
8839
+ dataIndex = _ref2$target.name,
8840
+ checked = _ref2$target.checked;
8841
+ return checked ? setHiddenColumns(ramda.without([dataIndex], hiddenColumns)) : setHiddenColumns(ramda.append(dataIndex, hiddenColumns));
8842
+ };
8843
+ const handleSearch = _ref3 => {
8844
+ let value = _ref3.target.value;
8845
+ return setSearchTerm(value);
8846
+ };
8847
+ React.useEffect(() => {
8848
+ onChange(removeBy({
8849
+ dataIndex: ramda.includes(ramda.__, hiddenColumns)
8850
+ }, columnData));
8851
+ }, [columnData, hiddenColumns]); // eslint-disable-line react-hooks/exhaustive-deps
8852
+
8853
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, _extends({
8854
+ buttonSize: "medium",
8855
+ buttonStyle: "secondary",
8856
+ closeOnSelect: false,
8857
+ label: "Columns",
8858
+ onClose: () => setSearchTerm(""),
8859
+ position: "bottom-end"
8860
+ }, dropdownProps), /*#__PURE__*/React__default["default"].createElement(Menu, null, /*#__PURE__*/React__default["default"].createElement("div", null, isSearchable && /*#__PURE__*/React__default["default"].createElement(neetoui.Input, _extends({
8861
+ className: "neeto-ui-px-3 neeto-ui-py-2",
8862
+ "data-cy": "neeto-ui-columns-search",
8863
+ onChange: handleSearch,
8864
+ placeholder: "Search columns",
8865
+ prefix: /*#__PURE__*/React__default["default"].createElement(neetoIcons.Search, null),
8866
+ type: "search",
8867
+ value: searchTerm
8868
+ }, searchProps)), isNotEmpty(filteredColumns) ? filteredColumns.map(_ref4 => {
8869
+ let dataIndex = _ref4.dataIndex,
6813
8870
  key = _ref4.key,
6814
8871
  title = _ref4.title;
6815
8872
  return /*#__PURE__*/React__default["default"].createElement(MenuItem, {
@@ -6956,13 +9013,28 @@ const DEFAULT_FILTER_VALUES = {
6956
9013
  category: ((_URLSearchParams$get = new URLSearchParams(window.location.search).get("filter")) === null || _URLSearchParams$get === void 0 ? void 0 : _URLSearchParams$get.toUpperCase()) || DEFAULT_MEMBER_FILTER,
6957
9014
  search: "",
6958
9015
  sortBy: "",
6959
- sortDirection: ""
9016
+ sortDirection: "",
9017
+ neetoFilters: []
6960
9018
  };
6961
9019
  const DEFAULT_SELECTED_ROWS = {
6962
9020
  active: [],
6963
9021
  emails: [],
6964
9022
  keys: []
6965
9023
  };
9024
+ const DEFAULT_NEETO_FILTERS_COLUMNS = [{
9025
+ key: "email",
9026
+ node: "email",
9027
+ label: instance.t("common.email", SINGULAR),
9028
+ type: "multi_option",
9029
+ values: []
9030
+ }, {
9031
+ key: "role",
9032
+ node: "organization_role.name",
9033
+ model: "OrganizationRole",
9034
+ label: instance.t("common.role", SINGULAR),
9035
+ type: "multi_option",
9036
+ values: []
9037
+ }];
6966
9038
 
6967
9039
  const Left = _ref => {
6968
9040
  var _selectedRows$keys, _selectedRows$keys2, _config$permissions$u, _config$permissions, _config$hiddenBulkAct, _config$otherBulkActi;
@@ -7047,8 +9119,12 @@ const Left = _ref => {
7047
9119
  };
7048
9120
  const Right = _ref2 => {
7049
9121
  let columns = _ref2.columns,
7050
- setColumnData = _ref2.setColumnData;
7051
- return /*#__PURE__*/React__default["default"].createElement(Columns, {
9122
+ setColumnData = _ref2.setColumnData,
9123
+ filterColumns = _ref2.filterColumns,
9124
+ handleFilterChange = _ref2.handleFilterChange,
9125
+ setIsFiltersPaneOpen = _ref2.setIsFiltersPaneOpen,
9126
+ isFiltersPaneOpen = _ref2.isFiltersPaneOpen;
9127
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Columns, {
7052
9128
  columnData: columns,
7053
9129
  dropdownProps: COLUMNS_DROPDOWN_PROPS,
7054
9130
  fixedColumns: FIXED_COLUMNS,
@@ -7056,7 +9132,15 @@ const Right = _ref2 => {
7056
9132
  noColumnMessage: instance.t("columns.noColumnsFound"),
7057
9133
  onChange: setColumnData,
7058
9134
  searchProps: COLUMNS_SEARCH_PROPS
7059
- });
9135
+ }), /*#__PURE__*/React__default["default"].createElement(neetoFiltersFrontend.Filters, {
9136
+ columns: filterColumns,
9137
+ onChange: filters => handleFilterChange({
9138
+ neetoFilters: filters,
9139
+ page: DEFAULT_PAGE_NUMBER
9140
+ }),
9141
+ isOpen: isFiltersPaneOpen,
9142
+ setIsOpen: setIsFiltersPaneOpen
9143
+ }));
7060
9144
  };
7061
9145
  const SubHeader = {
7062
9146
  Left,
@@ -7576,8 +9660,6 @@ var pluralize$1 = {
7576
9660
 
7577
9661
  var pluralize = pluralizeExports;
7578
9662
 
7579
- function ownKeys$3(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; }
7580
- function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7581
9663
  const Menu$1 = neetoui.Dropdown.Menu,
7582
9664
  MenuItem = neetoui.Dropdown.MenuItem;
7583
9665
  const renderNameColumn = (_ref, diplayStatusTag) => {
@@ -7735,9 +9817,15 @@ const renderUpdateAlert = (field, props) => {
7735
9817
  }
7736
9818
  return field === "title" ? getDefaultAlertTitle(props) : getDefaultAlertMessage(props);
7737
9819
  };
7738
- const getSearchParams = (page, filter) => new URLSearchParams(_objectSpread$3(_objectSpread$3({}, page), {}, {
7739
- filter: filter.toLowerCase()
7740
- })).toString();
9820
+ const getSearchParams = (_ref9, filter) => {
9821
+ let page = _ref9.page,
9822
+ results = _ref9.results;
9823
+ const searchParams = new URLSearchParams(window.location.search);
9824
+ searchParams.set("page", page);
9825
+ searchParams.set("results", results);
9826
+ searchParams.set("filter", filter.toLowerCase());
9827
+ return searchParams.toString();
9828
+ };
7741
9829
  const handlePageChange = (setFilters, filter) => (page, results) => {
7742
9830
  const pageParams = {
7743
9831
  page,
@@ -7756,6 +9844,30 @@ const getMetaName = ramda.curry((metaName, count) => {
7756
9844
  return instance.exists(translationWord, count) ? instance.t(translationWord, count) : pluralize(capitalize(singularizedMetaName), count.count);
7757
9845
  });
7758
9846
  const clearSelectedMembers = (previousCategory, currentCategory) => notEquals(previousCategory, currentCategory) && notEquals(currentCategory, "ALL");
9847
+ const buildFilterColumns = _ref10 => {
9848
+ let _ref10$options = _ref10.options,
9849
+ _ref10$options$emails = _ref10$options.emails,
9850
+ emails = _ref10$options$emails === void 0 ? [] : _ref10$options$emails,
9851
+ _ref10$options$organi = _ref10$options.organizationRoles,
9852
+ organizationRoles = _ref10$options$organi === void 0 ? [] : _ref10$options$organi,
9853
+ _ref10$emailConfig = _ref10.emailConfig,
9854
+ setSearchTerm = _ref10$emailConfig.setSearchTerm,
9855
+ isLoading = _ref10$emailConfig.isLoading;
9856
+ const columnValues = {
9857
+ email: emails.map(toLabelAndValue),
9858
+ role: organizationRoles.map(toLabelAndValue)
9859
+ };
9860
+ return DEFAULT_NEETO_FILTERS_COLUMNS.map(column => {
9861
+ const values = columnValues[column.key];
9862
+ if (column.key === "role") return ramda.assoc("values", values, column);
9863
+ const emailConfig = {
9864
+ values,
9865
+ isLoading,
9866
+ onInputChange: setSearchTerm
9867
+ };
9868
+ return ramda.mergeLeft(emailConfig, column);
9869
+ });
9870
+ };
7759
9871
 
7760
9872
  const _excluded = ["className", "children"],
7761
9873
  _excluded2 = ["className", "children"];
@@ -7779,15 +9891,15 @@ Page.Header = PageWrapper;
7779
9891
  Page.Body = PageWrapper;
7780
9892
  Page.Footer = PageWrapper;
7781
9893
 
7782
- function ownKeys$2(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; }
7783
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9894
+ function ownKeys$3(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; }
9895
+ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7784
9896
  const MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA = {
7785
9897
  emails: yup__namespace.array().min(1, instance.t("validations.minOneEmail")).test("are-all-emails-valid", instance.t("validations.validEmail"), emails => emails.every(ramda.prop("valid"))).nullable()
7786
9898
  };
7787
9899
  const ROLES_RADIO_GROUP_VALIDATION_SCHEMA = {
7788
9900
  role: yup__namespace.string().required(instance.t("validations.roleRequired"))
7789
9901
  };
7790
- const VALIDATION_SCHEMA$1 = yup__namespace.object().shape(_objectSpread$2(_objectSpread$2({}, MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA), ROLES_RADIO_GROUP_VALIDATION_SCHEMA));
9902
+ const VALIDATION_SCHEMA$1 = yup__namespace.object().shape(_objectSpread$3(_objectSpread$3({}, MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA), ROLES_RADIO_GROUP_VALIDATION_SCHEMA));
7791
9903
  const FILTER_INVALID_EMAILS = {
7792
9904
  label: instance.t("validations.filterInvalidEmails")
7793
9905
  };
@@ -7906,8 +10018,8 @@ RolesRadioGroup.defaultProps = {
7906
10018
  roles: []
7907
10019
  };
7908
10020
 
7909
- function ownKeys$1(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; }
7910
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10021
+ function ownKeys$2(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; }
10022
+ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7911
10023
  const ManageMember = _ref => {
7912
10024
  var _config$permissions$v, _config$permissions, _config$manageMember;
7913
10025
  let config = _ref.config,
@@ -7923,7 +10035,7 @@ const ManageMember = _ref => {
7923
10035
  hasSubmitted = _useState2[0],
7924
10036
  setHasSubmitted = _useState2[1];
7925
10037
  const formReference = React.useRef(null);
7926
- const manageMemberComponentConfig = _objectSpread$1(_objectSpread$1({}, DEFAULT_COMPONENT_CONFIG), componentConfig);
10038
+ const manageMemberComponentConfig = _objectSpread$2(_objectSpread$2({}, DEFAULT_COMPONENT_CONFIG), componentConfig);
7927
10039
  const Component = MEMBERS_FORM_COMPONENT_MAPPER[manageMemberComponentConfig.type || "pane"];
7928
10040
  const handleClose = () => {
7929
10041
  onComplete();
@@ -7992,7 +10104,7 @@ const ManageMember = _ref => {
7992
10104
  weight: "semibold"
7993
10105
  }, getTitle())), config !== null && config !== void 0 && (_config$manageMember = config.manageMember) !== null && _config$manageMember !== void 0 && _config$manageMember.component ? config.manageMember.component(manageMemberProps) : /*#__PURE__*/React__default["default"].createElement(formik$1.Form, {
7994
10106
  ref: formReference,
7995
- formikProps: _objectSpread$1(_objectSpread$1({}, MANAGE_MEMBERS_FORMIK_PROPS), {}, {
10107
+ formikProps: _objectSpread$2(_objectSpread$2({}, MANAGE_MEMBERS_FORMIK_PROPS), {}, {
7996
10108
  initialValues: renderInitialValues(selectedMember, rolesList),
7997
10109
  onSubmit: handleAddMember,
7998
10110
  validateOnBlur: hasSubmitted,
@@ -8055,6 +10167,64 @@ const Menu = _ref => {
8055
10167
  })), (config === null || config === void 0 ? void 0 : config.otherMenuElements) && config.otherMenuElements());
8056
10168
  };
8057
10169
 
10170
+ function ownKeys$1(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; }
10171
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10172
+ const useFilters = _ref => {
10173
+ let config = _ref.config;
10174
+ const metaName = getMetaName((config === null || config === void 0 ? void 0 : config.metaName) || "member");
10175
+ const defaultNeetoFilters = neetoFiltersFrontend.buildFiltersFromURL(DEFAULT_NEETO_FILTERS_COLUMNS);
10176
+ const _useState = React.useState(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_FILTER_VALUES), defaultNeetoFilters), config === null || config === void 0 ? void 0 : config.defaultFilterValues)),
10177
+ _useState2 = _slicedToArray$1(_useState, 2),
10178
+ filters = _useState2[0],
10179
+ setFilters = _useState2[1];
10180
+ const _useState3 = React.useState(""),
10181
+ _useState4 = _slicedToArray$1(_useState3, 2),
10182
+ emailSearchTerm = _useState4[0],
10183
+ setEmailSearchTerm = _useState4[1];
10184
+ const debouncedSearch = useDebounce(filters.search, 750);
10185
+ const debouncedEmailSearchTerm = useDebounce(emailSearchTerm, 750);
10186
+ const shouldFetchFilterOptions = ramda.isNil(config === null || config === void 0 ? void 0 : config.filterColumns);
10187
+ const _useFetchFilterOption = useFetchFilterOptions({
10188
+ params: {
10189
+ emailSearchTerm: debouncedEmailSearchTerm
10190
+ },
10191
+ options: {
10192
+ enabled: shouldFetchFilterOptions
10193
+ }
10194
+ }),
10195
+ _useFetchFilterOption2 = _useFetchFilterOption.data,
10196
+ filterOptions = _useFetchFilterOption2 === void 0 ? {} : _useFetchFilterOption2,
10197
+ isFilterOptionsLoading = _useFetchFilterOption.isLoading;
10198
+ const filterColumns = shouldFetchFilterOptions ? buildFilterColumns({
10199
+ options: filterOptions,
10200
+ emailConfig: {
10201
+ setSearchTerm: setEmailSearchTerm,
10202
+ isLoading: isFilterOptionsLoading
10203
+ }
10204
+ }) : config === null || config === void 0 ? void 0 : config.filterColumns;
10205
+ const searchProps = {
10206
+ "data-cy": "ntm-search-members-input",
10207
+ onChange: _ref2 => {
10208
+ let value = _ref2.target.value;
10209
+ return setFilters(ramda.mergeLeft({
10210
+ search: value,
10211
+ page: DEFAULT_PAGE_NUMBER
10212
+ }));
10213
+ },
10214
+ placeholder: instance.t("common.search_", {
10215
+ what: metaName(PLURAL).toLocaleLowerCase()
10216
+ }),
10217
+ value: filters.search
10218
+ };
10219
+ return {
10220
+ filters,
10221
+ setFilters,
10222
+ filterColumns,
10223
+ debouncedSearch,
10224
+ searchProps
10225
+ };
10226
+ };
10227
+
8058
10228
  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; }
8059
10229
  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; }
8060
10230
  const TeamMembers = _ref => {
@@ -8065,23 +10235,30 @@ const TeamMembers = _ref => {
8065
10235
  _useState2 = _slicedToArray$1(_useState, 2),
8066
10236
  isOpen = _useState2[0],
8067
10237
  setIsOpen = _useState2[1];
8068
- const _useState3 = React.useState(_objectSpread(_objectSpread({}, DEFAULT_FILTER_VALUES), config === null || config === void 0 ? void 0 : config.defaultFilterValues)),
10238
+ const _useState3 = React.useState(null),
8069
10239
  _useState4 = _slicedToArray$1(_useState3, 2),
8070
- filters = _useState4[0],
8071
- setFilters = _useState4[1];
8072
- const _useState5 = React.useState(null),
10240
+ selectedMember = _useState4[0],
10241
+ setSelectedMember = _useState4[1];
10242
+ const _useState5 = React.useState([]),
8073
10243
  _useState6 = _slicedToArray$1(_useState5, 2),
8074
- selectedMember = _useState6[0],
8075
- setSelectedMember = _useState6[1];
8076
- const debouncedSearch = useDebounce(filters.search, 750);
8077
- const _useState7 = React.useState([]),
10244
+ columnData = _useState6[0],
10245
+ setColumnData = _useState6[1];
10246
+ const _useState7 = React.useState(DEFAULT_SELECTED_ROWS),
8078
10247
  _useState8 = _slicedToArray$1(_useState7, 2),
8079
- columnData = _useState8[0],
8080
- setColumnData = _useState8[1];
8081
- const _useState9 = React.useState(DEFAULT_SELECTED_ROWS),
10248
+ selectedRows = _useState8[0],
10249
+ setSelectedRows = _useState8[1];
10250
+ const _useState9 = React.useState(false),
8082
10251
  _useState10 = _slicedToArray$1(_useState9, 2),
8083
- selectedRows = _useState10[0],
8084
- setSelectedRows = _useState10[1];
10252
+ isFiltersPaneOpen = _useState10[0],
10253
+ setIsFiltersPaneOpen = _useState10[1];
10254
+ const _useFilters = useFilters({
10255
+ config
10256
+ }),
10257
+ filters = _useFilters.filters,
10258
+ setFilters = _useFilters.setFilters,
10259
+ filterColumns = _useFilters.filterColumns,
10260
+ debouncedSearch = _useFilters.debouncedSearch,
10261
+ searchProps = _useFilters.searchProps;
8085
10262
  const _useFetchMembers = useFetchMembers(_objectSpread(_objectSpread({}, filters), {}, {
8086
10263
  search: debouncedSearch.trim(),
8087
10264
  category: filters.category.toLowerCase()
@@ -8109,20 +10286,6 @@ const TeamMembers = _ref => {
8109
10286
  team
8110
10287
  });
8111
10288
  const currentCategoryCount = team === null || team === void 0 ? void 0 : team.perCategoryCount[filters === null || filters === void 0 ? void 0 : (_filters$category = filters.category) === null || _filters$category === void 0 ? void 0 : _filters$category.toLowerCase()];
8112
- const searchProps = {
8113
- "data-cy": "ntm-search-members-input",
8114
- onChange: _ref3 => {
8115
- let value = _ref3.target.value;
8116
- return setFilters(ramda.mergeLeft({
8117
- search: value,
8118
- page: DEFAULT_PAGE_NUMBER
8119
- }));
8120
- },
8121
- placeholder: instance.t("common.search_", {
8122
- what: metaName(PLURAL).toLocaleLowerCase()
8123
- }),
8124
- value: filters.search
8125
- };
8126
10289
  const updateMemberAlertProps = {
8127
10290
  member: selectedMember,
8128
10291
  metaName,
@@ -8173,6 +10336,10 @@ const TeamMembers = _ref => {
8173
10336
  clearSelectedMembers(filters.category, filter) && setSelectedRows(DEFAULT_SELECTED_ROWS);
8174
10337
  handlePageChange(setFilters, filter)(DEFAULT_PAGE_NUMBER, filters.results);
8175
10338
  };
10339
+ const handleNeetoFilterChange = filter => {
10340
+ setFilters(ramda.mergeLeft(filter));
10341
+ clearSelectedMembers(filters.category, filter) && setSelectedRows(DEFAULT_SELECTED_ROWS);
10342
+ };
8176
10343
  const handleTableChange = (_, __, sorter) => {
8177
10344
  setFilters(ramda.mergeLeft({
8178
10345
  sortBy: sorter.field,
@@ -8234,8 +10401,19 @@ const TeamMembers = _ref => {
8234
10401
  }),
8235
10402
  rightActionBlock: /*#__PURE__*/React__default["default"].createElement(SubHeader.Right, {
8236
10403
  columns: columns,
8237
- setColumnData: setColumnData
10404
+ setColumnData: setColumnData,
10405
+ filterColumns: filterColumns,
10406
+ handleFilterChange: handleNeetoFilterChange,
10407
+ setIsFiltersPaneOpen: setIsFiltersPaneOpen,
10408
+ isFiltersPaneOpen: isFiltersPaneOpen
8238
10409
  })
10410
+ }), /*#__PURE__*/React__default["default"].createElement(neetoFiltersFrontend.Bar, {
10411
+ columns: filterColumns,
10412
+ onChange: filters => handleNeetoFilterChange({
10413
+ neetoFilters: filters,
10414
+ page: DEFAULT_PAGE_NUMBER
10415
+ }),
10416
+ setIsPaneOpen: setIsFiltersPaneOpen
8239
10417
  }), (team === null || team === void 0 ? void 0 : team.membersCount) !== 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
8240
10418
  className: "ntm-members__table-wrapper"
8241
10419
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Table, {