@wix/entity-advanced-permissions 1.801.0 → 1.802.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.
@@ -36017,374 +36017,6 @@ function _interopRequireDefault(obj) {
36017
36017
  }
36018
36018
  module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
36019
36019
 
36020
- /***/ }),
36021
-
36022
- /***/ 9649:
36023
- /*!**************************************************************************!*\
36024
- !*** ../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
36025
- \**************************************************************************/
36026
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
36027
-
36028
- var _typeof = (__webpack_require__(/*! ./typeof.js */ 8114)["default"]);
36029
- function _regeneratorRuntime() {
36030
- "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
36031
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
36032
- return exports;
36033
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
36034
- var exports = {},
36035
- Op = Object.prototype,
36036
- hasOwn = Op.hasOwnProperty,
36037
- defineProperty = Object.defineProperty || function (obj, key, desc) {
36038
- obj[key] = desc.value;
36039
- },
36040
- $Symbol = "function" == typeof Symbol ? Symbol : {},
36041
- iteratorSymbol = $Symbol.iterator || "@@iterator",
36042
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
36043
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
36044
- function define(obj, key, value) {
36045
- return Object.defineProperty(obj, key, {
36046
- value: value,
36047
- enumerable: !0,
36048
- configurable: !0,
36049
- writable: !0
36050
- }), obj[key];
36051
- }
36052
- try {
36053
- define({}, "");
36054
- } catch (err) {
36055
- define = function define(obj, key, value) {
36056
- return obj[key] = value;
36057
- };
36058
- }
36059
- function wrap(innerFn, outerFn, self, tryLocsList) {
36060
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
36061
- generator = Object.create(protoGenerator.prototype),
36062
- context = new Context(tryLocsList || []);
36063
- return defineProperty(generator, "_invoke", {
36064
- value: makeInvokeMethod(innerFn, self, context)
36065
- }), generator;
36066
- }
36067
- function tryCatch(fn, obj, arg) {
36068
- try {
36069
- return {
36070
- type: "normal",
36071
- arg: fn.call(obj, arg)
36072
- };
36073
- } catch (err) {
36074
- return {
36075
- type: "throw",
36076
- arg: err
36077
- };
36078
- }
36079
- }
36080
- exports.wrap = wrap;
36081
- var ContinueSentinel = {};
36082
- function Generator() {}
36083
- function GeneratorFunction() {}
36084
- function GeneratorFunctionPrototype() {}
36085
- var IteratorPrototype = {};
36086
- define(IteratorPrototype, iteratorSymbol, function () {
36087
- return this;
36088
- });
36089
- var getProto = Object.getPrototypeOf,
36090
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
36091
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
36092
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
36093
- function defineIteratorMethods(prototype) {
36094
- ["next", "throw", "return"].forEach(function (method) {
36095
- define(prototype, method, function (arg) {
36096
- return this._invoke(method, arg);
36097
- });
36098
- });
36099
- }
36100
- function AsyncIterator(generator, PromiseImpl) {
36101
- function invoke(method, arg, resolve, reject) {
36102
- var record = tryCatch(generator[method], generator, arg);
36103
- if ("throw" !== record.type) {
36104
- var result = record.arg,
36105
- value = result.value;
36106
- return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
36107
- invoke("next", value, resolve, reject);
36108
- }, function (err) {
36109
- invoke("throw", err, resolve, reject);
36110
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
36111
- result.value = unwrapped, resolve(result);
36112
- }, function (error) {
36113
- return invoke("throw", error, resolve, reject);
36114
- });
36115
- }
36116
- reject(record.arg);
36117
- }
36118
- var previousPromise;
36119
- defineProperty(this, "_invoke", {
36120
- value: function value(method, arg) {
36121
- function callInvokeWithMethodAndArg() {
36122
- return new PromiseImpl(function (resolve, reject) {
36123
- invoke(method, arg, resolve, reject);
36124
- });
36125
- }
36126
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
36127
- }
36128
- });
36129
- }
36130
- function makeInvokeMethod(innerFn, self, context) {
36131
- var state = "suspendedStart";
36132
- return function (method, arg) {
36133
- if ("executing" === state) throw new Error("Generator is already running");
36134
- if ("completed" === state) {
36135
- if ("throw" === method) throw arg;
36136
- return doneResult();
36137
- }
36138
- for (context.method = method, context.arg = arg;;) {
36139
- var delegate = context.delegate;
36140
- if (delegate) {
36141
- var delegateResult = maybeInvokeDelegate(delegate, context);
36142
- if (delegateResult) {
36143
- if (delegateResult === ContinueSentinel) continue;
36144
- return delegateResult;
36145
- }
36146
- }
36147
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
36148
- if ("suspendedStart" === state) throw state = "completed", context.arg;
36149
- context.dispatchException(context.arg);
36150
- } else "return" === context.method && context.abrupt("return", context.arg);
36151
- state = "executing";
36152
- var record = tryCatch(innerFn, self, context);
36153
- if ("normal" === record.type) {
36154
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
36155
- return {
36156
- value: record.arg,
36157
- done: context.done
36158
- };
36159
- }
36160
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
36161
- }
36162
- };
36163
- }
36164
- function maybeInvokeDelegate(delegate, context) {
36165
- var method = delegate.iterator[context.method];
36166
- if (undefined === method) {
36167
- if (context.delegate = null, "throw" === context.method) {
36168
- if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
36169
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
36170
- }
36171
- return ContinueSentinel;
36172
- }
36173
- var record = tryCatch(method, delegate.iterator, context.arg);
36174
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
36175
- var info = record.arg;
36176
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
36177
- }
36178
- function pushTryEntry(locs) {
36179
- var entry = {
36180
- tryLoc: locs[0]
36181
- };
36182
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
36183
- }
36184
- function resetTryEntry(entry) {
36185
- var record = entry.completion || {};
36186
- record.type = "normal", delete record.arg, entry.completion = record;
36187
- }
36188
- function Context(tryLocsList) {
36189
- this.tryEntries = [{
36190
- tryLoc: "root"
36191
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
36192
- }
36193
- function values(iterable) {
36194
- if (iterable) {
36195
- var iteratorMethod = iterable[iteratorSymbol];
36196
- if (iteratorMethod) return iteratorMethod.call(iterable);
36197
- if ("function" == typeof iterable.next) return iterable;
36198
- if (!isNaN(iterable.length)) {
36199
- var i = -1,
36200
- next = function next() {
36201
- for (; ++i < iterable.length;) {
36202
- if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
36203
- }
36204
- return next.value = undefined, next.done = !0, next;
36205
- };
36206
- return next.next = next;
36207
- }
36208
- }
36209
- return {
36210
- next: doneResult
36211
- };
36212
- }
36213
- function doneResult() {
36214
- return {
36215
- value: undefined,
36216
- done: !0
36217
- };
36218
- }
36219
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
36220
- value: GeneratorFunctionPrototype,
36221
- configurable: !0
36222
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
36223
- value: GeneratorFunction,
36224
- configurable: !0
36225
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
36226
- var ctor = "function" == typeof genFun && genFun.constructor;
36227
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
36228
- }, exports.mark = function (genFun) {
36229
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
36230
- }, exports.awrap = function (arg) {
36231
- return {
36232
- __await: arg
36233
- };
36234
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
36235
- return this;
36236
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
36237
- void 0 === PromiseImpl && (PromiseImpl = Promise);
36238
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
36239
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
36240
- return result.done ? result.value : iter.next();
36241
- });
36242
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
36243
- return this;
36244
- }), define(Gp, "toString", function () {
36245
- return "[object Generator]";
36246
- }), exports.keys = function (val) {
36247
- var object = Object(val),
36248
- keys = [];
36249
- for (var key in object) {
36250
- keys.push(key);
36251
- }
36252
- return keys.reverse(), function next() {
36253
- for (; keys.length;) {
36254
- var key = keys.pop();
36255
- if (key in object) return next.value = key, next.done = !1, next;
36256
- }
36257
- return next.done = !0, next;
36258
- };
36259
- }, exports.values = values, Context.prototype = {
36260
- constructor: Context,
36261
- reset: function reset(skipTempReset) {
36262
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
36263
- "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
36264
- }
36265
- },
36266
- stop: function stop() {
36267
- this.done = !0;
36268
- var rootRecord = this.tryEntries[0].completion;
36269
- if ("throw" === rootRecord.type) throw rootRecord.arg;
36270
- return this.rval;
36271
- },
36272
- dispatchException: function dispatchException(exception) {
36273
- if (this.done) throw exception;
36274
- var context = this;
36275
- function handle(loc, caught) {
36276
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
36277
- }
36278
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
36279
- var entry = this.tryEntries[i],
36280
- record = entry.completion;
36281
- if ("root" === entry.tryLoc) return handle("end");
36282
- if (entry.tryLoc <= this.prev) {
36283
- var hasCatch = hasOwn.call(entry, "catchLoc"),
36284
- hasFinally = hasOwn.call(entry, "finallyLoc");
36285
- if (hasCatch && hasFinally) {
36286
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
36287
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
36288
- } else if (hasCatch) {
36289
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
36290
- } else {
36291
- if (!hasFinally) throw new Error("try statement without catch or finally");
36292
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
36293
- }
36294
- }
36295
- }
36296
- },
36297
- abrupt: function abrupt(type, arg) {
36298
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
36299
- var entry = this.tryEntries[i];
36300
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
36301
- var finallyEntry = entry;
36302
- break;
36303
- }
36304
- }
36305
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
36306
- var record = finallyEntry ? finallyEntry.completion : {};
36307
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
36308
- },
36309
- complete: function complete(record, afterLoc) {
36310
- if ("throw" === record.type) throw record.arg;
36311
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
36312
- },
36313
- finish: function finish(finallyLoc) {
36314
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
36315
- var entry = this.tryEntries[i];
36316
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
36317
- }
36318
- },
36319
- "catch": function _catch(tryLoc) {
36320
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
36321
- var entry = this.tryEntries[i];
36322
- if (entry.tryLoc === tryLoc) {
36323
- var record = entry.completion;
36324
- if ("throw" === record.type) {
36325
- var thrown = record.arg;
36326
- resetTryEntry(entry);
36327
- }
36328
- return thrown;
36329
- }
36330
- }
36331
- throw new Error("illegal catch attempt");
36332
- },
36333
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
36334
- return this.delegate = {
36335
- iterator: values(iterable),
36336
- resultName: resultName,
36337
- nextLoc: nextLoc
36338
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
36339
- }
36340
- }, exports;
36341
- }
36342
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
36343
-
36344
- /***/ }),
36345
-
36346
- /***/ 8114:
36347
- /*!**************************************************************!*\
36348
- !*** ../../../node_modules/@babel/runtime/helpers/typeof.js ***!
36349
- \**************************************************************/
36350
- /***/ (function(module) {
36351
-
36352
- function _typeof(obj) {
36353
- "@babel/helpers - typeof";
36354
-
36355
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
36356
- return typeof obj;
36357
- } : function (obj) {
36358
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
36359
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
36360
- }
36361
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
36362
-
36363
- /***/ }),
36364
-
36365
- /***/ 2975:
36366
- /*!*****************************************************************!*\
36367
- !*** ../../../node_modules/@babel/runtime/regenerator/index.js ***!
36368
- \*****************************************************************/
36369
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
36370
-
36371
- // TODO(Babel 8): Remove this file.
36372
-
36373
- var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ 9649)();
36374
- module.exports = runtime;
36375
-
36376
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
36377
- try {
36378
- regeneratorRuntime = runtime;
36379
- } catch (accidentalStrictMode) {
36380
- if (typeof globalThis === "object") {
36381
- globalThis.regeneratorRuntime = runtime;
36382
- } else {
36383
- Function("r", "regeneratorRuntime = r")(runtime);
36384
- }
36385
- }
36386
-
36387
-
36388
36020
  /***/ }),
36389
36021
 
36390
36022
  /***/ 191:
@@ -36650,7 +36282,7 @@ var __webpack_exports__ = {};
36650
36282
  !function() {
36651
36283
  "use strict";
36652
36284
  /*!********************************!*\
36653
- !*** ./index.ts + 430 modules ***!
36285
+ !*** ./index.ts + 415 modules ***!
36654
36286
  \********************************/
36655
36287
  // ESM COMPAT FLAG
36656
36288
  __webpack_require__.r(__webpack_exports__);
@@ -56758,29 +56390,6 @@ var index = manageState(Select);
56758
56390
  /* harmony default export */ var react_select_browser_esm = (index);
56759
56391
 
56760
56392
 
56761
- ;// CONCATENATED MODULE: ../../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js
56762
-
56763
- function objectSpread2_ownKeys(object, enumerableOnly) {
56764
- var keys = Object.keys(object);
56765
- if (Object.getOwnPropertySymbols) {
56766
- var symbols = Object.getOwnPropertySymbols(object);
56767
- enumerableOnly && (symbols = symbols.filter(function (sym) {
56768
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
56769
- })), keys.push.apply(keys, symbols);
56770
- }
56771
- return keys;
56772
- }
56773
- function _objectSpread2(target) {
56774
- for (var i = 1; i < arguments.length; i++) {
56775
- var source = null != arguments[i] ? arguments[i] : {};
56776
- i % 2 ? objectSpread2_ownKeys(Object(source), !0).forEach(function (key) {
56777
- defineProperty_defineProperty(target, key, source[key]);
56778
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : objectSpread2_ownKeys(Object(source)).forEach(function (key) {
56779
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
56780
- });
56781
- }
56782
- return target;
56783
- }
56784
56393
  ;// CONCATENATED MODULE: ../../../node_modules/use-is-mounted-ref/dist/use-is-mounted-ref.es.js
56785
56394
 
56786
56395
 
@@ -56810,27 +56419,45 @@ const useLazyRef = (init) => {
56810
56419
  };
56811
56420
 
56812
56421
 
56813
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/getInitialCache.js
56814
- var getInitialCache = function getInitialCache(params) {
56815
- return {
56816
- isFirstLoad: true,
56817
- options: [],
56818
- hasMore: true,
56819
- isLoading: false,
56820
- additional: params.additional
56821
- };
56822
- };
56823
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/getInitialOptionsCache.js
56824
- var getInitialOptionsCache = function getInitialOptionsCache(_ref) {
56825
- var options = _ref.options,
56826
- defaultOptions = _ref.defaultOptions,
56827
- additional = _ref.additional,
56828
- defaultAdditional = _ref.defaultAdditional;
56829
- var initialOptions = defaultOptions === true ? null : defaultOptions instanceof Array ? defaultOptions : options;
56422
+ ;// CONCATENATED MODULE: ../../../node_modules/sleep-promise/build/esm.mjs
56423
+ var e=setTimeout;function t(t,n){var u=n.useCachedSetTimeout?e:setTimeout;return new Promise((function(e){u(e,t)}))}function n(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=n.useCachedSetTimeout,r=t(e,{useCachedSetTimeout:u});function o(e){return r.then((function(){return e}))}return o.then=function(){return r.then.apply(r,arguments)},o.catch=Promise.resolve().catch,o}/* harmony default export */ var esm = (n);
56424
+
56425
+ // EXTERNAL MODULE: ../../../node_modules/@seznam/compose-react-refs/composeRefs.js
56426
+ var composeRefs = __webpack_require__(1596);
56427
+ // EXTERNAL MODULE: ../../../node_modules/react/jsx-runtime.js
56428
+ var jsx_runtime = __webpack_require__(4512);
56429
+ ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/dist/esm/index.js
56430
+ // src/index.ts
56431
+
56432
+
56433
+ // src/useAsyncPaginate.ts
56434
+
56435
+
56436
+ // src/useAsyncPaginateBase.ts
56830
56437
 
56438
+
56439
+
56440
+
56441
+ // src/getInitialCache.ts
56442
+ var getInitialCache = (params) => ({
56443
+ isFirstLoad: true,
56444
+ options: [],
56445
+ hasMore: true,
56446
+ isLoading: false,
56447
+ additional: params.additional
56448
+ });
56449
+
56450
+ // src/getInitialOptionsCache.ts
56451
+ var getInitialOptionsCache = ({
56452
+ options,
56453
+ defaultOptions,
56454
+ additional,
56455
+ defaultAdditional
56456
+ }) => {
56457
+ const initialOptions = defaultOptions === true ? null : defaultOptions instanceof Array ? defaultOptions : options;
56831
56458
  if (initialOptions) {
56832
56459
  return {
56833
- '': {
56460
+ "": {
56834
56461
  isFirstLoad: false,
56835
56462
  isLoading: false,
56836
56463
  options: initialOptions,
@@ -56839,471 +56466,350 @@ var getInitialOptionsCache = function getInitialOptionsCache(_ref) {
56839
56466
  }
56840
56467
  };
56841
56468
  }
56842
-
56843
56469
  return {};
56844
56470
  };
56845
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/defaultShouldLoadMore.js
56471
+
56472
+ // src/defaultShouldLoadMore.ts
56846
56473
  var AVAILABLE_DELTA = 10;
56847
- var defaultShouldLoadMore = function defaultShouldLoadMore(scrollHeight, clientHeight, scrollTop) {
56848
- var bottomBorder = scrollHeight - clientHeight - AVAILABLE_DELTA;
56474
+ var defaultShouldLoadMore = (scrollHeight, clientHeight, scrollTop) => {
56475
+ const bottomBorder = scrollHeight - clientHeight - AVAILABLE_DELTA;
56849
56476
  return bottomBorder < scrollTop;
56850
56477
  };
56851
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/defaultReduceOptions.js
56852
-
56853
- var defaultReduceOptions = function defaultReduceOptions(prevOptions, loadedOptions) {
56854
- return [].concat(_toConsumableArray(prevOptions), _toConsumableArray(loadedOptions));
56855
- };
56856
- ;// CONCATENATED MODULE: ../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
56857
56478
 
56858
- function _toPrimitive(input, hint) {
56859
- if (_typeof(input) !== "object" || input === null) return input;
56860
- var prim = input[Symbol.toPrimitive];
56861
- if (prim !== undefined) {
56862
- var res = prim.call(input, hint || "default");
56863
- if (_typeof(res) !== "object") return res;
56864
- throw new TypeError("@@toPrimitive must return a primitive value.");
56865
- }
56866
- return (hint === "string" ? String : Number)(input);
56867
- }
56868
- ;// CONCATENATED MODULE: ../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
56479
+ // src/defaultReduceOptions.ts
56480
+ var defaultReduceOptions = (prevOptions, loadedOptions) => [...prevOptions, ...loadedOptions];
56869
56481
 
56482
+ // src/requestOptions.ts
56870
56483
 
56871
- function _toPropertyKey(arg) {
56872
- var key = _toPrimitive(arg, "string");
56873
- return _typeof(key) === "symbol" ? key : String(key);
56874
- }
56875
- ;// CONCATENATED MODULE: ../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
56876
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
56877
- try {
56878
- var info = gen[key](arg);
56879
- var value = info.value;
56880
- } catch (error) {
56881
- reject(error);
56882
- return;
56883
- }
56884
- if (info.done) {
56885
- resolve(value);
56886
- } else {
56887
- Promise.resolve(value).then(_next, _throw);
56888
- }
56889
- }
56890
- function _asyncToGenerator(fn) {
56891
- return function () {
56892
- var self = this,
56893
- args = arguments;
56894
- return new Promise(function (resolve, reject) {
56895
- var gen = fn.apply(self, args);
56896
- function _next(value) {
56897
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
56898
- }
56899
- function _throw(err) {
56900
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
56901
- }
56902
- _next(undefined);
56903
- });
56904
- };
56905
- }
56906
- // EXTERNAL MODULE: ../../../node_modules/@babel/runtime/regenerator/index.js
56907
- var regenerator = __webpack_require__(2975);
56908
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
56909
- ;// CONCATENATED MODULE: ../../../node_modules/sleep-promise/build/esm.mjs
56910
- var e=setTimeout;function t(t,n){var u=n.useCachedSetTimeout?e:setTimeout;return new Promise((function(e){u(e,t)}))}function n(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=n.useCachedSetTimeout,r=t(e,{useCachedSetTimeout:u});function o(e){return r.then((function(){return e}))}return o.then=function(){return r.then.apply(r,arguments)},o.catch=Promise.resolve().catch,o}/* harmony default export */ var esm = (n);
56911
56484
 
56912
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/validateResponse.js
56485
+ // src/validateResponse.ts
56913
56486
  var errorText = '[react-select-async-paginate] response of "loadOptions" should be an object with "options" prop, which contains array of options.';
56914
- var checkIsResponse = function checkIsResponse(response) {
56487
+ var checkIsResponse = (response) => {
56915
56488
  if (!response) {
56916
56489
  return false;
56917
56490
  }
56918
-
56919
- var _ref = response,
56920
- options = _ref.options,
56921
- hasMore = _ref.hasMore;
56922
-
56491
+ const {
56492
+ options,
56493
+ hasMore
56494
+ } = response;
56923
56495
  if (!Array.isArray(options)) {
56924
56496
  return false;
56925
56497
  }
56926
-
56927
- if (typeof hasMore !== 'boolean' && typeof hasMore !== 'undefined') {
56498
+ if (typeof hasMore !== "boolean" && typeof hasMore !== "undefined") {
56928
56499
  return false;
56929
56500
  }
56930
-
56931
56501
  return true;
56932
56502
  };
56933
- var validateResponse = function validateResponse(response) {
56503
+ var validateResponse = (response) => {
56934
56504
  if (!checkIsResponse(response)) {
56935
- // eslint-disable-next-line no-console
56936
- console.error(errorText, 'Received:', response);
56505
+ console.error(errorText, "Received:", response);
56937
56506
  throw new Error(errorText);
56938
56507
  }
56939
-
56940
56508
  return true;
56941
56509
  };
56942
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/requestOptions.js
56943
-
56944
-
56945
-
56946
-
56947
-
56948
-
56949
-
56950
-
56951
-
56952
- var requestOptions = /*#__PURE__*/function () {
56953
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(caller, paramsRef, optionsCacheRef, debounceTimeout, setOptionsCache, reduceOptions) {
56954
- var currentInputValue, isCacheEmpty, currentOptions, newInputValue, response, hasError, loadOptions, _response, options, hasMore, newAdditional;
56955
-
56956
- return regenerator_default().wrap(function _callee$(_context) {
56957
- while (1) {
56958
- switch (_context.prev = _context.next) {
56959
- case 0:
56960
- currentInputValue = paramsRef.current.inputValue;
56961
- isCacheEmpty = !optionsCacheRef.current[currentInputValue];
56962
- currentOptions = isCacheEmpty ? getInitialCache(paramsRef.current) : optionsCacheRef.current[currentInputValue];
56963
-
56964
- if (!(currentOptions.isLoading || !currentOptions.hasMore)) {
56965
- _context.next = 5;
56966
- break;
56967
- }
56968
-
56969
- return _context.abrupt("return");
56970
-
56971
- case 5:
56972
- setOptionsCache(function (prevOptionsCache) {
56973
- return _objectSpread2(_objectSpread2({}, prevOptionsCache), {}, defineProperty_defineProperty({}, currentInputValue, _objectSpread2(_objectSpread2({}, currentOptions), {}, {
56974
- isLoading: true
56975
- })));
56976
- });
56977
-
56978
- if (!(debounceTimeout > 0 && caller === 'input-change')) {
56979
- _context.next = 13;
56980
- break;
56981
- }
56982
-
56983
- _context.next = 9;
56984
- return esm(debounceTimeout);
56985
-
56986
- case 9:
56987
- newInputValue = paramsRef.current.inputValue;
56988
-
56989
- if (!(currentInputValue !== newInputValue)) {
56990
- _context.next = 13;
56991
- break;
56992
- }
56993
-
56994
- setOptionsCache(function (prevOptionsCache) {
56995
- if (isCacheEmpty) {
56996
- var itemForDelete = prevOptionsCache[currentInputValue],
56997
- restCache = _objectWithoutProperties(prevOptionsCache, [currentInputValue].map(_toPropertyKey));
56998
-
56999
- return restCache;
57000
- }
57001
-
57002
- return _objectSpread2(_objectSpread2({}, prevOptionsCache), {}, defineProperty_defineProperty({}, currentInputValue, _objectSpread2(_objectSpread2({}, currentOptions), {}, {
57003
- isLoading: false
57004
- })));
57005
- });
57006
- return _context.abrupt("return");
57007
-
57008
- case 13:
57009
- hasError = false;
57010
- _context.prev = 14;
57011
- loadOptions = paramsRef.current.loadOptions;
57012
- _context.next = 18;
57013
- return loadOptions(currentInputValue, currentOptions.options, currentOptions.additional);
57014
-
57015
- case 18:
57016
- response = _context.sent;
57017
- _context.next = 24;
57018
- break;
57019
56510
 
57020
- case 21:
57021
- _context.prev = 21;
57022
- _context.t0 = _context["catch"](14);
57023
- hasError = true;
57024
-
57025
- case 24:
57026
- if (!hasError) {
57027
- _context.next = 27;
57028
- break;
57029
- }
57030
-
57031
- setOptionsCache(function (prevOptionsCache) {
57032
- return _objectSpread2(_objectSpread2({}, prevOptionsCache), {}, defineProperty_defineProperty({}, currentInputValue, _objectSpread2(_objectSpread2({}, currentOptions), {}, {
57033
- isLoading: false
57034
- })));
57035
- });
57036
- return _context.abrupt("return");
57037
-
57038
- case 27:
57039
- if (validateResponse(response)) {
57040
- _response = response, options = _response.options, hasMore = _response.hasMore; // eslint-disable-next-line no-prototype-builtins
57041
-
57042
- newAdditional = response.hasOwnProperty('additional') ? response.additional : currentOptions.additional;
57043
- setOptionsCache(function (prevOptionsCache) {
57044
- return _objectSpread2(_objectSpread2({}, prevOptionsCache), {}, defineProperty_defineProperty({}, currentInputValue, _objectSpread2(_objectSpread2({}, currentOptions), {}, {
57045
- options: reduceOptions(currentOptions.options, options, newAdditional),
57046
- hasMore: !!hasMore,
57047
- isLoading: false,
57048
- isFirstLoad: false,
57049
- additional: newAdditional
57050
- })));
57051
- });
57052
- }
57053
-
57054
- case 28:
57055
- case "end":
57056
- return _context.stop();
56511
+ // src/requestOptions.ts
56512
+ var requestOptions = async (caller, paramsRef, optionsCacheRef, debounceTimeout, setOptionsCache, reduceOptions) => {
56513
+ const currentInputValue = paramsRef.current.inputValue;
56514
+ const isCacheEmpty = !optionsCacheRef.current[currentInputValue];
56515
+ const currentOptions = isCacheEmpty ? getInitialCache(paramsRef.current) : optionsCacheRef.current[currentInputValue];
56516
+ if (currentOptions.isLoading || !currentOptions.hasMore) {
56517
+ return;
56518
+ }
56519
+ setOptionsCache((prevOptionsCache) => ({
56520
+ ...prevOptionsCache,
56521
+ [currentInputValue]: {
56522
+ ...currentOptions,
56523
+ isLoading: true
56524
+ }
56525
+ }));
56526
+ if (debounceTimeout > 0 && caller === "input-change") {
56527
+ await esm(debounceTimeout);
56528
+ const newInputValue = paramsRef.current.inputValue;
56529
+ if (currentInputValue !== newInputValue) {
56530
+ setOptionsCache((prevOptionsCache) => {
56531
+ if (isCacheEmpty) {
56532
+ const {
56533
+ [currentInputValue]: itemForDelete,
56534
+ ...restCache
56535
+ } = prevOptionsCache;
56536
+ return restCache;
57057
56537
  }
56538
+ return {
56539
+ ...prevOptionsCache,
56540
+ [currentInputValue]: {
56541
+ ...currentOptions,
56542
+ isLoading: false
56543
+ }
56544
+ };
56545
+ });
56546
+ return;
56547
+ }
56548
+ }
56549
+ let response;
56550
+ let hasError = false;
56551
+ try {
56552
+ const {
56553
+ loadOptions
56554
+ } = paramsRef.current;
56555
+ response = await loadOptions(
56556
+ currentInputValue,
56557
+ currentOptions.options,
56558
+ currentOptions.additional
56559
+ );
56560
+ } catch (e) {
56561
+ hasError = true;
56562
+ }
56563
+ if (hasError) {
56564
+ setOptionsCache((prevOptionsCache) => ({
56565
+ ...prevOptionsCache,
56566
+ [currentInputValue]: {
56567
+ ...currentOptions,
56568
+ isLoading: false
57058
56569
  }
57059
- }, _callee, null, [[14, 21]]);
57060
- }));
57061
-
57062
- return function requestOptions(_x, _x2, _x3, _x4, _x5, _x6) {
57063
- return _ref.apply(this, arguments);
57064
- };
57065
- }();
57066
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/useAsyncPaginateBase.js
57067
-
57068
-
57069
-
57070
-
57071
-
57072
-
57073
-
57074
-
57075
- var increaseStateId = function increaseStateId(prevStateId) {
57076
- return prevStateId + 1;
56570
+ }));
56571
+ return;
56572
+ }
56573
+ if (validateResponse(response)) {
56574
+ const {
56575
+ options,
56576
+ hasMore
56577
+ } = response;
56578
+ const newAdditional = response.hasOwnProperty("additional") ? response.additional : currentOptions.additional;
56579
+ setOptionsCache((prevOptionsCache) => ({
56580
+ ...prevOptionsCache,
56581
+ [currentInputValue]: {
56582
+ ...currentOptions,
56583
+ options: reduceOptions(currentOptions.options, options, newAdditional),
56584
+ hasMore: !!hasMore,
56585
+ isLoading: false,
56586
+ isFirstLoad: false,
56587
+ additional: newAdditional
56588
+ }
56589
+ }));
56590
+ }
57077
56591
  };
57078
- var useAsyncPaginateBase = function useAsyncPaginateBase(params) {
57079
- var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
57080
- var defaultOptions = params.defaultOptions,
57081
- _params$loadOptionsOn = params.loadOptionsOnMenuOpen,
57082
- loadOptionsOnMenuOpen = _params$loadOptionsOn === void 0 ? true : _params$loadOptionsOn,
57083
- _params$debounceTimeo = params.debounceTimeout,
57084
- debounceTimeout = _params$debounceTimeo === void 0 ? 0 : _params$debounceTimeo,
57085
- inputValue = params.inputValue,
57086
- menuIsOpen = params.menuIsOpen,
57087
- _params$filterOption = params.filterOption,
57088
- filterOption = _params$filterOption === void 0 ? null : _params$filterOption,
57089
- _params$reduceOptions = params.reduceOptions,
57090
- reduceOptions = _params$reduceOptions === void 0 ? defaultReduceOptions : _params$reduceOptions,
57091
- _params$shouldLoadMor = params.shouldLoadMore,
57092
- shouldLoadMore = _params$shouldLoadMor === void 0 ? defaultShouldLoadMore : _params$shouldLoadMor;
57093
- var isMountedRef = useIsMountedRef();
57094
- var isInitRef = (0,external_React_.useRef)(true);
57095
- var paramsRef = (0,external_React_.useRef)(params);
57096
- paramsRef.current = params;
57097
- var setStateId = (0,external_React_.useState)(0)[1];
57098
- var optionsCacheRef = useLazyRef(function () {
57099
- return getInitialOptionsCache(params);
57100
- });
57101
- var callRequestOptions = (0,external_React_.useCallback)(function (caller) {
57102
- requestOptions(caller, paramsRef, optionsCacheRef, debounceTimeout, function (reduceState) {
57103
- optionsCacheRef.current = reduceState(optionsCacheRef.current);
57104
56592
 
57105
- if (isMountedRef.current) {
57106
- setStateId(increaseStateId);
57107
- }
57108
- }, reduceOptions);
56593
+ // src/useAsyncPaginateBase.ts
56594
+ var increaseStateId = (prevStateId) => prevStateId + 1;
56595
+ var useAsyncPaginateBase = (params, deps = []) => {
56596
+ const {
56597
+ defaultOptions,
56598
+ loadOptionsOnMenuOpen = true,
56599
+ debounceTimeout = 0,
56600
+ inputValue,
56601
+ menuIsOpen,
56602
+ filterOption = null,
56603
+ reduceOptions = defaultReduceOptions,
56604
+ shouldLoadMore = defaultShouldLoadMore
56605
+ } = params;
56606
+ const isMountedRef = useIsMountedRef();
56607
+ const isInitRef = (0,external_React_.useRef)(true);
56608
+ const paramsRef = (0,external_React_.useRef)(params);
56609
+ paramsRef.current = params;
56610
+ const setStateId = (0,external_React_.useState)(0)[1];
56611
+ const optionsCacheRef = useLazyRef(() => getInitialOptionsCache(params));
56612
+ const callRequestOptions = (0,external_React_.useCallback)((caller) => {
56613
+ requestOptions(
56614
+ caller,
56615
+ paramsRef,
56616
+ optionsCacheRef,
56617
+ debounceTimeout,
56618
+ (reduceState) => {
56619
+ optionsCacheRef.current = reduceState(optionsCacheRef.current);
56620
+ if (isMountedRef.current) {
56621
+ setStateId(increaseStateId);
56622
+ }
56623
+ },
56624
+ reduceOptions
56625
+ );
57109
56626
  }, [debounceTimeout]);
57110
- var handleScrolledToBottom = (0,external_React_.useCallback)(function () {
57111
- var currentInputValue = paramsRef.current.inputValue;
57112
- var currentOptions = optionsCacheRef.current[currentInputValue];
57113
-
57114
- if (currentOptions) {
57115
- callRequestOptions('menu-scroll');
56627
+ const handleScrolledToBottom = (0,external_React_.useCallback)(() => {
56628
+ const currentInputValue = paramsRef.current.inputValue;
56629
+ const currentOptions2 = optionsCacheRef.current[currentInputValue];
56630
+ if (currentOptions2) {
56631
+ callRequestOptions("menu-scroll");
57116
56632
  }
57117
56633
  }, [callRequestOptions]);
57118
- (0,external_React_.useEffect)(function () {
56634
+ (0,external_React_.useEffect)(() => {
57119
56635
  if (isInitRef.current) {
57120
56636
  isInitRef.current = false;
57121
56637
  } else {
57122
56638
  optionsCacheRef.current = {};
57123
56639
  setStateId(increaseStateId);
57124
56640
  }
57125
-
57126
56641
  if (defaultOptions === true) {
57127
- callRequestOptions('autoload');
56642
+ callRequestOptions("autoload");
57128
56643
  }
57129
56644
  }, deps);
57130
- (0,external_React_.useEffect)(function () {
56645
+ (0,external_React_.useEffect)(() => {
57131
56646
  if (menuIsOpen && !optionsCacheRef.current[inputValue]) {
57132
- callRequestOptions('input-change');
56647
+ callRequestOptions("input-change");
57133
56648
  }
57134
56649
  }, [inputValue]);
57135
- (0,external_React_.useEffect)(function () {
57136
- if (menuIsOpen && !optionsCacheRef.current[''] && loadOptionsOnMenuOpen) {
57137
- callRequestOptions('menu-toggle');
56650
+ (0,external_React_.useEffect)(() => {
56651
+ if (menuIsOpen && !optionsCacheRef.current[""] && loadOptionsOnMenuOpen) {
56652
+ callRequestOptions("menu-toggle");
57138
56653
  }
57139
56654
  }, [menuIsOpen]);
57140
- var currentOptions = optionsCacheRef.current[inputValue] || getInitialCache(params);
56655
+ const currentOptions = optionsCacheRef.current[inputValue] || getInitialCache(params);
57141
56656
  return {
57142
- handleScrolledToBottom: handleScrolledToBottom,
57143
- shouldLoadMore: shouldLoadMore,
57144
- filterOption: filterOption,
56657
+ handleScrolledToBottom,
56658
+ shouldLoadMore,
56659
+ filterOption,
57145
56660
  isLoading: currentOptions.isLoading,
57146
56661
  isFirstLoad: currentOptions.isFirstLoad,
57147
56662
  options: currentOptions.options
57148
56663
  };
57149
56664
  };
57150
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/useAsyncPaginate.js
57151
-
57152
-
57153
56665
 
57154
-
57155
- var useAsyncPaginate = function useAsyncPaginate(params) {
57156
- var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
57157
- var inputValueParam = params.inputValue,
57158
- menuIsOpenParam = params.menuIsOpen,
57159
- defaultInputValueParam = params.defaultInputValue,
57160
- defaultMenuIsOpenParam = params.defaultMenuIsOpen,
57161
- onInputChangeParam = params.onInputChange,
57162
- onMenuCloseParam = params.onMenuClose,
57163
- onMenuOpenParam = params.onMenuOpen;
57164
-
57165
- var _useState = (0,external_React_.useState)(defaultInputValueParam || ''),
57166
- _useState2 = _slicedToArray(_useState, 2),
57167
- inputValueState = _useState2[0],
57168
- setInputValue = _useState2[1];
57169
-
57170
- var _useState3 = (0,external_React_.useState)(!!defaultMenuIsOpenParam),
57171
- _useState4 = _slicedToArray(_useState3, 2),
57172
- menuIsOpenState = _useState4[0],
57173
- setMenuIsOpen = _useState4[1];
57174
-
57175
- var inputValue = typeof inputValueParam === 'string' ? inputValueParam : inputValueState;
57176
- var menuIsOpen = typeof menuIsOpenParam === 'boolean' ? menuIsOpenParam : menuIsOpenState;
57177
- var onInputChange = (0,external_React_.useCallback)(function (nextInputValue, actionMeta) {
56666
+ // src/useAsyncPaginate.ts
56667
+ var useAsyncPaginate = (params, deps = []) => {
56668
+ const {
56669
+ inputValue: inputValueParam,
56670
+ menuIsOpen: menuIsOpenParam,
56671
+ defaultInputValue: defaultInputValueParam,
56672
+ defaultMenuIsOpen: defaultMenuIsOpenParam,
56673
+ onInputChange: onInputChangeParam,
56674
+ onMenuClose: onMenuCloseParam,
56675
+ onMenuOpen: onMenuOpenParam
56676
+ } = params;
56677
+ const [inputValueState, setInputValue] = (0,external_React_.useState)(
56678
+ defaultInputValueParam || ""
56679
+ );
56680
+ const [menuIsOpenState, setMenuIsOpen] = (0,external_React_.useState)(
56681
+ !!defaultMenuIsOpenParam
56682
+ );
56683
+ const inputValue = typeof inputValueParam === "string" ? inputValueParam : inputValueState;
56684
+ const menuIsOpen = typeof menuIsOpenParam === "boolean" ? menuIsOpenParam : menuIsOpenState;
56685
+ const onInputChange = (0,external_React_.useCallback)((nextInputValue, actionMeta) => {
57178
56686
  if (onInputChangeParam) {
57179
56687
  onInputChangeParam(nextInputValue, actionMeta);
57180
56688
  }
57181
-
57182
56689
  setInputValue(nextInputValue);
57183
56690
  }, [onInputChangeParam]);
57184
- var onMenuClose = (0,external_React_.useCallback)(function () {
56691
+ const onMenuClose = (0,external_React_.useCallback)(() => {
57185
56692
  if (onMenuCloseParam) {
57186
56693
  onMenuCloseParam();
57187
56694
  }
57188
-
57189
56695
  setMenuIsOpen(false);
57190
56696
  }, [onMenuCloseParam]);
57191
- var onMenuOpen = (0,external_React_.useCallback)(function () {
56697
+ const onMenuOpen = (0,external_React_.useCallback)(() => {
57192
56698
  if (onMenuOpenParam) {
57193
56699
  onMenuOpenParam();
57194
56700
  }
57195
-
57196
56701
  setMenuIsOpen(true);
57197
56702
  }, [onMenuOpenParam]);
57198
- var baseResult = useAsyncPaginateBase(_objectSpread2(_objectSpread2({}, params), {}, {
57199
- inputValue: inputValue,
57200
- menuIsOpen: menuIsOpen
57201
- }), deps);
57202
- return _objectSpread2(_objectSpread2({}, baseResult), {}, {
57203
- inputValue: inputValue,
57204
- menuIsOpen: menuIsOpen,
57205
- onInputChange: onInputChange,
57206
- onMenuClose: onMenuClose,
57207
- onMenuOpen: onMenuOpen
57208
- });
56703
+ const baseResult = useAsyncPaginateBase(
56704
+ {
56705
+ ...params,
56706
+ inputValue,
56707
+ menuIsOpen
56708
+ },
56709
+ deps
56710
+ );
56711
+ return {
56712
+ ...baseResult,
56713
+ inputValue,
56714
+ menuIsOpen,
56715
+ onInputChange,
56716
+ onMenuClose,
56717
+ onMenuOpen
56718
+ };
57209
56719
  };
57210
- // EXTERNAL MODULE: ../../../node_modules/@seznam/compose-react-refs/composeRefs.js
57211
- var composeRefs = __webpack_require__(1596);
57212
- // EXTERNAL MODULE: ../../../node_modules/react/jsx-runtime.js
57213
- var jsx_runtime = __webpack_require__(4512);
57214
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/wrapMenuList.js
56720
+
56721
+ // src/useComponents.ts
57215
56722
 
57216
56723
 
57217
56724
 
56725
+ // src/wrapMenuList.tsx
56726
+
56727
+
57218
56728
 
57219
56729
  var CHECK_TIMEOUT = 300;
57220
- function wrapMenuList( // eslint-disable-next-line @typescript-eslint/naming-convention
57221
- MenuList) {
56730
+ function wrapMenuList(MenuList2) {
57222
56731
  function WrappedMenuList(props) {
57223
- var selectProps = props.selectProps,
57224
- innerRef = props.innerRef;
57225
- var _ref = selectProps,
57226
- handleScrolledToBottom = _ref.handleScrolledToBottom,
57227
- shouldLoadMore = _ref.shouldLoadMore;
57228
- var checkTimeoutRef = (0,external_React_.useRef)();
57229
- var menuListRef = (0,external_React_.useRef)(null);
57230
- var shouldHandle = (0,external_React_.useCallback)(function () {
57231
- var el = menuListRef.current; // menu is not rendered
57232
-
56732
+ const {
56733
+ selectProps,
56734
+ innerRef
56735
+ } = props;
56736
+ const {
56737
+ handleScrolledToBottom,
56738
+ shouldLoadMore
56739
+ } = selectProps;
56740
+ const checkTimeoutRef = (0,external_React_.useRef)();
56741
+ const menuListRef = (0,external_React_.useRef)(null);
56742
+ const shouldHandle = (0,external_React_.useCallback)(() => {
56743
+ const el = menuListRef.current;
57233
56744
  if (!el) {
57234
56745
  return false;
57235
56746
  }
57236
-
57237
- var scrollTop = el.scrollTop,
57238
- scrollHeight = el.scrollHeight,
57239
- clientHeight = el.clientHeight;
56747
+ const {
56748
+ scrollTop,
56749
+ scrollHeight,
56750
+ clientHeight
56751
+ } = el;
57240
56752
  return shouldLoadMore(scrollHeight, clientHeight, scrollTop);
57241
56753
  }, [shouldLoadMore]);
57242
- var checkAndHandle = (0,external_React_.useCallback)(function () {
56754
+ const checkAndHandle = (0,external_React_.useCallback)(() => {
57243
56755
  if (shouldHandle()) {
57244
56756
  if (handleScrolledToBottom) {
57245
56757
  handleScrolledToBottom();
57246
56758
  }
57247
56759
  }
57248
56760
  }, [shouldHandle, handleScrolledToBottom]);
57249
- var setCheckAndHandleTimeout = (0,external_React_.useCallback)(function () {
56761
+ const setCheckAndHandleTimeout = (0,external_React_.useCallback)(() => {
57250
56762
  checkAndHandle();
57251
56763
  checkTimeoutRef.current = setTimeout(setCheckAndHandleTimeout, CHECK_TIMEOUT);
57252
56764
  }, [checkAndHandle]);
57253
- (0,external_React_.useEffect)(function () {
56765
+ (0,external_React_.useEffect)(() => {
57254
56766
  setCheckAndHandleTimeout();
57255
- return function () {
56767
+ return () => {
57256
56768
  if (checkTimeoutRef.current) {
57257
56769
  clearTimeout(checkTimeoutRef.current);
57258
56770
  }
57259
56771
  };
57260
56772
  }, []);
57261
- return /*#__PURE__*/(0,jsx_runtime.jsx)(MenuList, _objectSpread2(_objectSpread2({}, props), {}, {
56773
+ return /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuList2, {
56774
+ ...props,
57262
56775
  innerRef: (0,composeRefs/* default */.Z)(innerRef, menuListRef)
57263
- }));
56776
+ });
57264
56777
  }
57265
-
57266
56778
  return WrappedMenuList;
57267
56779
  }
57268
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/useComponents.js
57269
-
57270
-
57271
-
57272
-
57273
- var useComponents_MenuList = wrapMenuList(components.MenuList);
57274
- var useComponents = function useComponents(components) {
57275
- return (0,external_React_.useMemo)(function () {
57276
- return _objectSpread2({
57277
- MenuList: useComponents_MenuList
57278
- }, components);
57279
- }, [components]);
57280
- };
57281
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/withAsyncPaginate.js
57282
-
57283
56780
 
57284
- var withAsyncPaginate_excluded = ["components", "selectRef", "isLoading", "cacheUniqs"];
56781
+ // src/useComponents.ts
56782
+ var esm_MenuList = wrapMenuList(components.MenuList);
56783
+ var useComponents = (components) => (0,external_React_.useMemo)(() => ({
56784
+ MenuList: esm_MenuList,
56785
+ ...components
56786
+ }), [components]);
57285
56787
 
56788
+ // src/withAsyncPaginate.tsx
57286
56789
 
57287
-
57288
- function withAsyncPaginate( // eslint-disable-next-line @typescript-eslint/naming-convention
57289
- SelectComponent) {
56790
+ function withAsyncPaginate(SelectComponent) {
57290
56791
  function WithAsyncPaginate(props) {
57291
- var components = props.components,
57292
- selectRef = props.selectRef,
57293
- isLoadingProp = props.isLoading,
57294
- cacheUniqs = props.cacheUniqs,
57295
- rest = _objectWithoutProperties(props, withAsyncPaginate_excluded);
57296
-
57297
- var asyncPaginateProps = useAsyncPaginate(rest, cacheUniqs);
57298
- var processedComponents = useComponents(components);
57299
- var isLoading = typeof isLoadingProp === 'boolean' ? isLoadingProp : asyncPaginateProps.isLoading;
57300
- return /*#__PURE__*/(0,jsx_runtime.jsx)(SelectComponent, _objectSpread2(_objectSpread2(_objectSpread2({}, props), asyncPaginateProps), {}, {
57301
- isLoading: isLoading,
56792
+ const {
56793
+ components,
56794
+ selectRef,
56795
+ isLoading: isLoadingProp,
56796
+ cacheUniqs,
56797
+ ...rest
56798
+ } = props;
56799
+ const asyncPaginateProps = useAsyncPaginate(
56800
+ rest,
56801
+ cacheUniqs
56802
+ );
56803
+ const processedComponents = useComponents(components);
56804
+ const isLoading = typeof isLoadingProp === "boolean" ? isLoadingProp : asyncPaginateProps.isLoading;
56805
+ return /* @__PURE__ */ (0,jsx_runtime.jsx)(SelectComponent, {
56806
+ ...props,
56807
+ ...asyncPaginateProps,
56808
+ isLoading,
57302
56809
  components: processedComponents,
57303
56810
  ref: selectRef
57304
- }));
56811
+ });
57305
56812
  }
57306
-
57307
56813
  WithAsyncPaginate.defaultProps = {
57308
56814
  selectRef: null,
57309
56815
  cacheUniqs: [],
@@ -57311,18 +56817,63 @@ SelectComponent) {
57311
56817
  };
57312
56818
  return WithAsyncPaginate;
57313
56819
  }
57314
- ;// CONCATENATED MODULE: ../../../node_modules/react-select-async-paginate/es/index.js
57315
-
57316
-
57317
-
57318
-
57319
-
57320
-
57321
-
57322
56820
 
56821
+ // src/reduceGroupedOptions.ts
56822
+ var checkGroup = (group) => {
56823
+ if (!group) {
56824
+ return false;
56825
+ }
56826
+ const {
56827
+ label,
56828
+ options
56829
+ } = group;
56830
+ if (typeof label !== "string" && typeof label !== "undefined") {
56831
+ return false;
56832
+ }
56833
+ if (!Array.isArray(options)) {
56834
+ return false;
56835
+ }
56836
+ return true;
56837
+ };
56838
+ var reduceGroupedOptions = (prevOptions, loadedOptions) => {
56839
+ const res = prevOptions.slice();
56840
+ const mapLabelToIndex = {};
56841
+ let prevOptionsIndex = 0;
56842
+ const prevOptionsLength = prevOptions.length;
56843
+ loadedOptions.forEach((optionOrGroup) => {
56844
+ const group = checkGroup(optionOrGroup) ? optionOrGroup : {
56845
+ options: [optionOrGroup]
56846
+ };
56847
+ const {
56848
+ label = ""
56849
+ } = group;
56850
+ let groupIndex = mapLabelToIndex[label];
56851
+ if (typeof groupIndex !== "number") {
56852
+ for (; prevOptionsIndex < prevOptionsLength && typeof mapLabelToIndex[label] !== "number"; ++prevOptionsIndex) {
56853
+ const prevGroup = prevOptions[prevOptionsIndex];
56854
+ if (checkGroup(prevGroup)) {
56855
+ mapLabelToIndex[prevGroup.label || ""] = prevOptionsIndex;
56856
+ }
56857
+ }
56858
+ groupIndex = mapLabelToIndex[label];
56859
+ }
56860
+ if (typeof groupIndex !== "number") {
56861
+ mapLabelToIndex[label] = res.length;
56862
+ res.push(group);
56863
+ return;
56864
+ }
56865
+ res[groupIndex] = {
56866
+ ...res[groupIndex],
56867
+ options: [...res[groupIndex].options, ...group.options]
56868
+ };
56869
+ });
56870
+ return res;
56871
+ };
57323
56872
 
56873
+ // src/index.ts
57324
56874
  var AsyncPaginate = withAsyncPaginate(react_select_browser_esm);
57325
56875
 
56876
+ //# sourceMappingURL=index.js.map
57326
56877
  ;// CONCATENATED MODULE: ../../../node_modules/cnbuilder/esm/cnb.js
57327
56878
  var cnb_isArray = Array.isArray;
57328
56879
  var toClassName = function (val) {