UNPKG

322 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
3 typeof define === 'function' && define.amd ? define(['jquery'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BootstrapTable = factory(global.jQuery));
5})(this, (function ($$n) { 'use strict';
6
7 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
9 var $__default = /*#__PURE__*/_interopDefaultLegacy($$n);
10
11 function _typeof(obj) {
12 "@babel/helpers - typeof";
13
14 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
15 return typeof obj;
16 } : function (obj) {
17 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
18 }, _typeof(obj);
19 }
20
21 function _classCallCheck(instance, Constructor) {
22 if (!(instance instanceof Constructor)) {
23 throw new TypeError("Cannot call a class as a function");
24 }
25 }
26
27 function _defineProperties(target, props) {
28 for (var i = 0; i < props.length; i++) {
29 var descriptor = props[i];
30 descriptor.enumerable = descriptor.enumerable || false;
31 descriptor.configurable = true;
32 if ("value" in descriptor) descriptor.writable = true;
33 Object.defineProperty(target, descriptor.key, descriptor);
34 }
35 }
36
37 function _createClass(Constructor, protoProps, staticProps) {
38 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
39 if (staticProps) _defineProperties(Constructor, staticProps);
40 Object.defineProperty(Constructor, "prototype", {
41 writable: false
42 });
43 return Constructor;
44 }
45
46 function _slicedToArray(arr, i) {
47 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
48 }
49
50 function _toConsumableArray(arr) {
51 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
52 }
53
54 function _arrayWithoutHoles(arr) {
55 if (Array.isArray(arr)) return _arrayLikeToArray(arr);
56 }
57
58 function _arrayWithHoles(arr) {
59 if (Array.isArray(arr)) return arr;
60 }
61
62 function _iterableToArray(iter) {
63 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
64 }
65
66 function _iterableToArrayLimit(arr, i) {
67 var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
68
69 if (_i == null) return;
70 var _arr = [];
71 var _n = true;
72 var _d = false;
73
74 var _s, _e;
75
76 try {
77 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
78 _arr.push(_s.value);
79
80 if (i && _arr.length === i) break;
81 }
82 } catch (err) {
83 _d = true;
84 _e = err;
85 } finally {
86 try {
87 if (!_n && _i["return"] != null) _i["return"]();
88 } finally {
89 if (_d) throw _e;
90 }
91 }
92
93 return _arr;
94 }
95
96 function _unsupportedIterableToArray(o, minLen) {
97 if (!o) return;
98 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
99 var n = Object.prototype.toString.call(o).slice(8, -1);
100 if (n === "Object" && o.constructor) n = o.constructor.name;
101 if (n === "Map" || n === "Set") return Array.from(o);
102 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
103 }
104
105 function _arrayLikeToArray(arr, len) {
106 if (len == null || len > arr.length) len = arr.length;
107
108 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
109
110 return arr2;
111 }
112
113 function _nonIterableSpread() {
114 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
115 }
116
117 function _nonIterableRest() {
118 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
119 }
120
121 function _createForOfIteratorHelper(o, allowArrayLike) {
122 var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
123
124 if (!it) {
125 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
126 if (it) o = it;
127 var i = 0;
128
129 var F = function () {};
130
131 return {
132 s: F,
133 n: function () {
134 if (i >= o.length) return {
135 done: true
136 };
137 return {
138 done: false,
139 value: o[i++]
140 };
141 },
142 e: function (e) {
143 throw e;
144 },
145 f: F
146 };
147 }
148
149 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
150 }
151
152 var normalCompletion = true,
153 didErr = false,
154 err;
155 return {
156 s: function () {
157 it = it.call(o);
158 },
159 n: function () {
160 var step = it.next();
161 normalCompletion = step.done;
162 return step;
163 },
164 e: function (e) {
165 didErr = true;
166 err = e;
167 },
168 f: function () {
169 try {
170 if (!normalCompletion && it.return != null) it.return();
171 } finally {
172 if (didErr) throw err;
173 }
174 }
175 };
176 }
177
178 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
179
180 var check = function (it) {
181 return it && it.Math == Math && it;
182 };
183
184 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
185 var global$j =
186 // eslint-disable-next-line es-x/no-global-this -- safe
187 check(typeof globalThis == 'object' && globalThis) ||
188 check(typeof window == 'object' && window) ||
189 // eslint-disable-next-line no-restricted-globals -- safe
190 check(typeof self == 'object' && self) ||
191 check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
192 // eslint-disable-next-line no-new-func -- fallback
193 (function () { return this; })() || Function('return this')();
194
195 var objectGetOwnPropertyDescriptor = {};
196
197 var fails$u = function (exec) {
198 try {
199 return !!exec();
200 } catch (error) {
201 return true;
202 }
203 };
204
205 var fails$t = fails$u;
206
207 // Detect IE8's incomplete defineProperty implementation
208 var descriptors = !fails$t(function () {
209 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
210 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
211 });
212
213 var fails$s = fails$u;
214
215 var functionBindNative = !fails$s(function () {
216 // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
217 var test = (function () { /* empty */ }).bind();
218 // eslint-disable-next-line no-prototype-builtins -- safe
219 return typeof test != 'function' || test.hasOwnProperty('prototype');
220 });
221
222 var NATIVE_BIND$3 = functionBindNative;
223
224 var call$e = Function.prototype.call;
225
226 var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
227 return call$e.apply(call$e, arguments);
228 };
229
230 var objectPropertyIsEnumerable = {};
231
232 var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
233 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
234 var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor;
235
236 // Nashorn ~ JDK8 bug
237 var NASHORN_BUG = getOwnPropertyDescriptor$4 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
238
239 // `Object.prototype.propertyIsEnumerable` method implementation
240 // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
241 objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
242 var descriptor = getOwnPropertyDescriptor$4(this, V);
243 return !!descriptor && descriptor.enumerable;
244 } : $propertyIsEnumerable$1;
245
246 var createPropertyDescriptor$4 = function (bitmap, value) {
247 return {
248 enumerable: !(bitmap & 1),
249 configurable: !(bitmap & 2),
250 writable: !(bitmap & 4),
251 value: value
252 };
253 };
254
255 var NATIVE_BIND$2 = functionBindNative;
256
257 var FunctionPrototype$2 = Function.prototype;
258 var bind$2 = FunctionPrototype$2.bind;
259 var call$d = FunctionPrototype$2.call;
260 var uncurryThis$z = NATIVE_BIND$2 && bind$2.bind(call$d, call$d);
261
262 var functionUncurryThis = NATIVE_BIND$2 ? function (fn) {
263 return fn && uncurryThis$z(fn);
264 } : function (fn) {
265 return fn && function () {
266 return call$d.apply(fn, arguments);
267 };
268 };
269
270 var uncurryThis$y = functionUncurryThis;
271
272 var toString$h = uncurryThis$y({}.toString);
273 var stringSlice$7 = uncurryThis$y(''.slice);
274
275 var classofRaw$1 = function (it) {
276 return stringSlice$7(toString$h(it), 8, -1);
277 };
278
279 var uncurryThis$x = functionUncurryThis;
280 var fails$r = fails$u;
281 var classof$7 = classofRaw$1;
282
283 var $Object$4 = Object;
284 var split = uncurryThis$x(''.split);
285
286 // fallback for non-array-like ES3 and non-enumerable old V8 strings
287 var indexedObject = fails$r(function () {
288 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
289 // eslint-disable-next-line no-prototype-builtins -- safe
290 return !$Object$4('z').propertyIsEnumerable(0);
291 }) ? function (it) {
292 return classof$7(it) == 'String' ? split(it, '') : $Object$4(it);
293 } : $Object$4;
294
295 var $TypeError$b = TypeError;
296
297 // `RequireObjectCoercible` abstract operation
298 // https://tc39.es/ecma262/#sec-requireobjectcoercible
299 var requireObjectCoercible$b = function (it) {
300 if (it == undefined) throw $TypeError$b("Can't call method on " + it);
301 return it;
302 };
303
304 // toObject with fallback for non-array-like ES3 strings
305 var IndexedObject$3 = indexedObject;
306 var requireObjectCoercible$a = requireObjectCoercible$b;
307
308 var toIndexedObject$8 = function (it) {
309 return IndexedObject$3(requireObjectCoercible$a(it));
310 };
311
312 // `IsCallable` abstract operation
313 // https://tc39.es/ecma262/#sec-iscallable
314 var isCallable$j = function (argument) {
315 return typeof argument == 'function';
316 };
317
318 var isCallable$i = isCallable$j;
319
320 var isObject$a = function (it) {
321 return typeof it == 'object' ? it !== null : isCallable$i(it);
322 };
323
324 var global$i = global$j;
325 var isCallable$h = isCallable$j;
326
327 var aFunction = function (argument) {
328 return isCallable$h(argument) ? argument : undefined;
329 };
330
331 var getBuiltIn$6 = function (namespace, method) {
332 return arguments.length < 2 ? aFunction(global$i[namespace]) : global$i[namespace] && global$i[namespace][method];
333 };
334
335 var uncurryThis$w = functionUncurryThis;
336
337 var objectIsPrototypeOf = uncurryThis$w({}.isPrototypeOf);
338
339 var getBuiltIn$5 = getBuiltIn$6;
340
341 var engineUserAgent = getBuiltIn$5('navigator', 'userAgent') || '';
342
343 var global$h = global$j;
344 var userAgent$2 = engineUserAgent;
345
346 var process = global$h.process;
347 var Deno = global$h.Deno;
348 var versions = process && process.versions || Deno && Deno.version;
349 var v8 = versions && versions.v8;
350 var match, version;
351
352 if (v8) {
353 match = v8.split('.');
354 // in old Chrome, versions of V8 isn't V8 = Chrome / 10
355 // but their correct versions are not interesting for us
356 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
357 }
358
359 // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
360 // so check `userAgent` even if `.v8` exists, but 0
361 if (!version && userAgent$2) {
362 match = userAgent$2.match(/Edge\/(\d+)/);
363 if (!match || match[1] >= 74) {
364 match = userAgent$2.match(/Chrome\/(\d+)/);
365 if (match) version = +match[1];
366 }
367 }
368
369 var engineV8Version = version;
370
371 /* eslint-disable es-x/no-symbol -- required for testing */
372
373 var V8_VERSION$2 = engineV8Version;
374 var fails$q = fails$u;
375
376 // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
377 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$q(function () {
378 var symbol = Symbol();
379 // Chrome 38 Symbol has incorrect toString conversion
380 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
381 return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
382 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
383 !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
384 });
385
386 /* eslint-disable es-x/no-symbol -- required for testing */
387
388 var NATIVE_SYMBOL$1 = nativeSymbol;
389
390 var useSymbolAsUid = NATIVE_SYMBOL$1
391 && !Symbol.sham
392 && typeof Symbol.iterator == 'symbol';
393
394 var getBuiltIn$4 = getBuiltIn$6;
395 var isCallable$g = isCallable$j;
396 var isPrototypeOf$3 = objectIsPrototypeOf;
397 var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
398
399 var $Object$3 = Object;
400
401 var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
402 return typeof it == 'symbol';
403 } : function (it) {
404 var $Symbol = getBuiltIn$4('Symbol');
405 return isCallable$g($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it));
406 };
407
408 var $String$3 = String;
409
410 var tryToString$3 = function (argument) {
411 try {
412 return $String$3(argument);
413 } catch (error) {
414 return 'Object';
415 }
416 };
417
418 var isCallable$f = isCallable$j;
419 var tryToString$2 = tryToString$3;
420
421 var $TypeError$a = TypeError;
422
423 // `Assert: IsCallable(argument) is true`
424 var aCallable$3 = function (argument) {
425 if (isCallable$f(argument)) return argument;
426 throw $TypeError$a(tryToString$2(argument) + ' is not a function');
427 };
428
429 var aCallable$2 = aCallable$3;
430
431 // `GetMethod` abstract operation
432 // https://tc39.es/ecma262/#sec-getmethod
433 var getMethod$5 = function (V, P) {
434 var func = V[P];
435 return func == null ? undefined : aCallable$2(func);
436 };
437
438 var call$c = functionCall;
439 var isCallable$e = isCallable$j;
440 var isObject$9 = isObject$a;
441
442 var $TypeError$9 = TypeError;
443
444 // `OrdinaryToPrimitive` abstract operation
445 // https://tc39.es/ecma262/#sec-ordinarytoprimitive
446 var ordinaryToPrimitive$1 = function (input, pref) {
447 var fn, val;
448 if (pref === 'string' && isCallable$e(fn = input.toString) && !isObject$9(val = call$c(fn, input))) return val;
449 if (isCallable$e(fn = input.valueOf) && !isObject$9(val = call$c(fn, input))) return val;
450 if (pref !== 'string' && isCallable$e(fn = input.toString) && !isObject$9(val = call$c(fn, input))) return val;
451 throw $TypeError$9("Can't convert object to primitive value");
452 };
453
454 var shared$4 = {exports: {}};
455
456 var global$g = global$j;
457
458 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
459 var defineProperty$7 = Object.defineProperty;
460
461 var defineGlobalProperty$3 = function (key, value) {
462 try {
463 defineProperty$7(global$g, key, { value: value, configurable: true, writable: true });
464 } catch (error) {
465 global$g[key] = value;
466 } return value;
467 };
468
469 var global$f = global$j;
470 var defineGlobalProperty$2 = defineGlobalProperty$3;
471
472 var SHARED = '__core-js_shared__';
473 var store$3 = global$f[SHARED] || defineGlobalProperty$2(SHARED, {});
474
475 var sharedStore = store$3;
476
477 var store$2 = sharedStore;
478
479 (shared$4.exports = function (key, value) {
480 return store$2[key] || (store$2[key] = value !== undefined ? value : {});
481 })('versions', []).push({
482 version: '3.22.8',
483 mode: 'global',
484 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
485 license: 'https://github.com/zloirock/core-js/blob/v3.22.8/LICENSE',
486 source: 'https://github.com/zloirock/core-js'
487 });
488
489 var requireObjectCoercible$9 = requireObjectCoercible$b;
490
491 var $Object$2 = Object;
492
493 // `ToObject` abstract operation
494 // https://tc39.es/ecma262/#sec-toobject
495 var toObject$9 = function (argument) {
496 return $Object$2(requireObjectCoercible$9(argument));
497 };
498
499 var uncurryThis$v = functionUncurryThis;
500 var toObject$8 = toObject$9;
501
502 var hasOwnProperty = uncurryThis$v({}.hasOwnProperty);
503
504 // `HasOwnProperty` abstract operation
505 // https://tc39.es/ecma262/#sec-hasownproperty
506 // eslint-disable-next-line es-x/no-object-hasown -- safe
507 var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
508 return hasOwnProperty(toObject$8(it), key);
509 };
510
511 var uncurryThis$u = functionUncurryThis;
512
513 var id = 0;
514 var postfix = Math.random();
515 var toString$g = uncurryThis$u(1.0.toString);
516
517 var uid$2 = function (key) {
518 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$g(++id + postfix, 36);
519 };
520
521 var global$e = global$j;
522 var shared$3 = shared$4.exports;
523 var hasOwn$b = hasOwnProperty_1;
524 var uid$1 = uid$2;
525 var NATIVE_SYMBOL = nativeSymbol;
526 var USE_SYMBOL_AS_UID = useSymbolAsUid;
527
528 var WellKnownSymbolsStore = shared$3('wks');
529 var Symbol$3 = global$e.Symbol;
530 var symbolFor = Symbol$3 && Symbol$3['for'];
531 var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
532
533 var wellKnownSymbol$j = function (name) {
534 if (!hasOwn$b(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
535 var description = 'Symbol.' + name;
536 if (NATIVE_SYMBOL && hasOwn$b(Symbol$3, name)) {
537 WellKnownSymbolsStore[name] = Symbol$3[name];
538 } else if (USE_SYMBOL_AS_UID && symbolFor) {
539 WellKnownSymbolsStore[name] = symbolFor(description);
540 } else {
541 WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
542 }
543 } return WellKnownSymbolsStore[name];
544 };
545
546 var call$b = functionCall;
547 var isObject$8 = isObject$a;
548 var isSymbol$2 = isSymbol$3;
549 var getMethod$4 = getMethod$5;
550 var ordinaryToPrimitive = ordinaryToPrimitive$1;
551 var wellKnownSymbol$i = wellKnownSymbol$j;
552
553 var $TypeError$8 = TypeError;
554 var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
555
556 // `ToPrimitive` abstract operation
557 // https://tc39.es/ecma262/#sec-toprimitive
558 var toPrimitive$2 = function (input, pref) {
559 if (!isObject$8(input) || isSymbol$2(input)) return input;
560 var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
561 var result;
562 if (exoticToPrim) {
563 if (pref === undefined) pref = 'default';
564 result = call$b(exoticToPrim, input, pref);
565 if (!isObject$8(result) || isSymbol$2(result)) return result;
566 throw $TypeError$8("Can't convert object to primitive value");
567 }
568 if (pref === undefined) pref = 'number';
569 return ordinaryToPrimitive(input, pref);
570 };
571
572 var toPrimitive$1 = toPrimitive$2;
573 var isSymbol$1 = isSymbol$3;
574
575 // `ToPropertyKey` abstract operation
576 // https://tc39.es/ecma262/#sec-topropertykey
577 var toPropertyKey$3 = function (argument) {
578 var key = toPrimitive$1(argument, 'string');
579 return isSymbol$1(key) ? key : key + '';
580 };
581
582 var global$d = global$j;
583 var isObject$7 = isObject$a;
584
585 var document$1 = global$d.document;
586 // typeof document.createElement is 'object' in old IE
587 var EXISTS$1 = isObject$7(document$1) && isObject$7(document$1.createElement);
588
589 var documentCreateElement$2 = function (it) {
590 return EXISTS$1 ? document$1.createElement(it) : {};
591 };
592
593 var DESCRIPTORS$d = descriptors;
594 var fails$p = fails$u;
595 var createElement = documentCreateElement$2;
596
597 // Thanks to IE8 for its funny defineProperty
598 var ie8DomDefine = !DESCRIPTORS$d && !fails$p(function () {
599 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
600 return Object.defineProperty(createElement('div'), 'a', {
601 get: function () { return 7; }
602 }).a != 7;
603 });
604
605 var DESCRIPTORS$c = descriptors;
606 var call$a = functionCall;
607 var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
608 var createPropertyDescriptor$3 = createPropertyDescriptor$4;
609 var toIndexedObject$7 = toIndexedObject$8;
610 var toPropertyKey$2 = toPropertyKey$3;
611 var hasOwn$a = hasOwnProperty_1;
612 var IE8_DOM_DEFINE$1 = ie8DomDefine;
613
614 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
615 var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
616
617 // `Object.getOwnPropertyDescriptor` method
618 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
619 objectGetOwnPropertyDescriptor.f = DESCRIPTORS$c ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
620 O = toIndexedObject$7(O);
621 P = toPropertyKey$2(P);
622 if (IE8_DOM_DEFINE$1) try {
623 return $getOwnPropertyDescriptor$1(O, P);
624 } catch (error) { /* empty */ }
625 if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
626 };
627
628 var objectDefineProperty = {};
629
630 var DESCRIPTORS$b = descriptors;
631 var fails$o = fails$u;
632
633 // V8 ~ Chrome 36-
634 // https://bugs.chromium.org/p/v8/issues/detail?id=3334
635 var v8PrototypeDefineBug = DESCRIPTORS$b && fails$o(function () {
636 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
637 return Object.defineProperty(function () { /* empty */ }, 'prototype', {
638 value: 42,
639 writable: false
640 }).prototype != 42;
641 });
642
643 var isObject$6 = isObject$a;
644
645 var $String$2 = String;
646 var $TypeError$7 = TypeError;
647
648 // `Assert: Type(argument) is Object`
649 var anObject$d = function (argument) {
650 if (isObject$6(argument)) return argument;
651 throw $TypeError$7($String$2(argument) + ' is not an object');
652 };
653
654 var DESCRIPTORS$a = descriptors;
655 var IE8_DOM_DEFINE = ie8DomDefine;
656 var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
657 var anObject$c = anObject$d;
658 var toPropertyKey$1 = toPropertyKey$3;
659
660 var $TypeError$6 = TypeError;
661 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
662 var $defineProperty = Object.defineProperty;
663 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
664 var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
665 var ENUMERABLE = 'enumerable';
666 var CONFIGURABLE$1 = 'configurable';
667 var WRITABLE = 'writable';
668
669 // `Object.defineProperty` method
670 // https://tc39.es/ecma262/#sec-object.defineproperty
671 objectDefineProperty.f = DESCRIPTORS$a ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
672 anObject$c(O);
673 P = toPropertyKey$1(P);
674 anObject$c(Attributes);
675 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
676 var current = $getOwnPropertyDescriptor(O, P);
677 if (current && current[WRITABLE]) {
678 O[P] = Attributes.value;
679 Attributes = {
680 configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
681 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
682 writable: false
683 };
684 }
685 } return $defineProperty(O, P, Attributes);
686 } : $defineProperty : function defineProperty(O, P, Attributes) {
687 anObject$c(O);
688 P = toPropertyKey$1(P);
689 anObject$c(Attributes);
690 if (IE8_DOM_DEFINE) try {
691 return $defineProperty(O, P, Attributes);
692 } catch (error) { /* empty */ }
693 if ('get' in Attributes || 'set' in Attributes) throw $TypeError$6('Accessors not supported');
694 if ('value' in Attributes) O[P] = Attributes.value;
695 return O;
696 };
697
698 var DESCRIPTORS$9 = descriptors;
699 var definePropertyModule$4 = objectDefineProperty;
700 var createPropertyDescriptor$2 = createPropertyDescriptor$4;
701
702 var createNonEnumerableProperty$8 = DESCRIPTORS$9 ? function (object, key, value) {
703 return definePropertyModule$4.f(object, key, createPropertyDescriptor$2(1, value));
704 } : function (object, key, value) {
705 object[key] = value;
706 return object;
707 };
708
709 var makeBuiltIn$2 = {exports: {}};
710
711 var DESCRIPTORS$8 = descriptors;
712 var hasOwn$9 = hasOwnProperty_1;
713
714 var FunctionPrototype$1 = Function.prototype;
715 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
716 var getDescriptor = DESCRIPTORS$8 && Object.getOwnPropertyDescriptor;
717
718 var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
719 // additional protection from minified / mangled / dropped function names
720 var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
721 var CONFIGURABLE = EXISTS && (!DESCRIPTORS$8 || (DESCRIPTORS$8 && getDescriptor(FunctionPrototype$1, 'name').configurable));
722
723 var functionName = {
724 EXISTS: EXISTS,
725 PROPER: PROPER,
726 CONFIGURABLE: CONFIGURABLE
727 };
728
729 var uncurryThis$t = functionUncurryThis;
730 var isCallable$d = isCallable$j;
731 var store$1 = sharedStore;
732
733 var functionToString = uncurryThis$t(Function.toString);
734
735 // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
736 if (!isCallable$d(store$1.inspectSource)) {
737 store$1.inspectSource = function (it) {
738 return functionToString(it);
739 };
740 }
741
742 var inspectSource$3 = store$1.inspectSource;
743
744 var global$c = global$j;
745 var isCallable$c = isCallable$j;
746 var inspectSource$2 = inspectSource$3;
747
748 var WeakMap$1 = global$c.WeakMap;
749
750 var nativeWeakMap = isCallable$c(WeakMap$1) && /native code/.test(inspectSource$2(WeakMap$1));
751
752 var shared$2 = shared$4.exports;
753 var uid = uid$2;
754
755 var keys$2 = shared$2('keys');
756
757 var sharedKey$3 = function (key) {
758 return keys$2[key] || (keys$2[key] = uid(key));
759 };
760
761 var hiddenKeys$4 = {};
762
763 var NATIVE_WEAK_MAP = nativeWeakMap;
764 var global$b = global$j;
765 var uncurryThis$s = functionUncurryThis;
766 var isObject$5 = isObject$a;
767 var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
768 var hasOwn$8 = hasOwnProperty_1;
769 var shared$1 = sharedStore;
770 var sharedKey$2 = sharedKey$3;
771 var hiddenKeys$3 = hiddenKeys$4;
772
773 var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
774 var TypeError$2 = global$b.TypeError;
775 var WeakMap = global$b.WeakMap;
776 var set, get, has;
777
778 var enforce = function (it) {
779 return has(it) ? get(it) : set(it, {});
780 };
781
782 var getterFor = function (TYPE) {
783 return function (it) {
784 var state;
785 if (!isObject$5(it) || (state = get(it)).type !== TYPE) {
786 throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
787 } return state;
788 };
789 };
790
791 if (NATIVE_WEAK_MAP || shared$1.state) {
792 var store = shared$1.state || (shared$1.state = new WeakMap());
793 var wmget = uncurryThis$s(store.get);
794 var wmhas = uncurryThis$s(store.has);
795 var wmset = uncurryThis$s(store.set);
796 set = function (it, metadata) {
797 if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
798 metadata.facade = it;
799 wmset(store, it, metadata);
800 return metadata;
801 };
802 get = function (it) {
803 return wmget(store, it) || {};
804 };
805 has = function (it) {
806 return wmhas(store, it);
807 };
808 } else {
809 var STATE = sharedKey$2('state');
810 hiddenKeys$3[STATE] = true;
811 set = function (it, metadata) {
812 if (hasOwn$8(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
813 metadata.facade = it;
814 createNonEnumerableProperty$7(it, STATE, metadata);
815 return metadata;
816 };
817 get = function (it) {
818 return hasOwn$8(it, STATE) ? it[STATE] : {};
819 };
820 has = function (it) {
821 return hasOwn$8(it, STATE);
822 };
823 }
824
825 var internalState = {
826 set: set,
827 get: get,
828 has: has,
829 enforce: enforce,
830 getterFor: getterFor
831 };
832
833 var fails$n = fails$u;
834 var isCallable$b = isCallable$j;
835 var hasOwn$7 = hasOwnProperty_1;
836 var DESCRIPTORS$7 = descriptors;
837 var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
838 var inspectSource$1 = inspectSource$3;
839 var InternalStateModule$1 = internalState;
840
841 var enforceInternalState$1 = InternalStateModule$1.enforce;
842 var getInternalState$2 = InternalStateModule$1.get;
843 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
844 var defineProperty$6 = Object.defineProperty;
845
846 var CONFIGURABLE_LENGTH = DESCRIPTORS$7 && !fails$n(function () {
847 return defineProperty$6(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
848 });
849
850 var TEMPLATE = String(String).split('String');
851
852 var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
853 if (String(name).slice(0, 7) === 'Symbol(') {
854 name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
855 }
856 if (options && options.getter) name = 'get ' + name;
857 if (options && options.setter) name = 'set ' + name;
858 if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
859 defineProperty$6(value, 'name', { value: name, configurable: true });
860 }
861 if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
862 defineProperty$6(value, 'length', { value: options.arity });
863 }
864 try {
865 if (options && hasOwn$7(options, 'constructor') && options.constructor) {
866 if (DESCRIPTORS$7) defineProperty$6(value, 'prototype', { writable: false });
867 // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
868 } else if (value.prototype) value.prototype = undefined;
869 } catch (error) { /* empty */ }
870 var state = enforceInternalState$1(value);
871 if (!hasOwn$7(state, 'source')) {
872 state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
873 } return value;
874 };
875
876 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
877 // eslint-disable-next-line no-extend-native -- required
878 Function.prototype.toString = makeBuiltIn$1(function toString() {
879 return isCallable$b(this) && getInternalState$2(this).source || inspectSource$1(this);
880 }, 'toString');
881
882 var isCallable$a = isCallable$j;
883 var createNonEnumerableProperty$6 = createNonEnumerableProperty$8;
884 var makeBuiltIn = makeBuiltIn$2.exports;
885 var defineGlobalProperty$1 = defineGlobalProperty$3;
886
887 var defineBuiltIn$8 = function (O, key, value, options) {
888 if (!options) options = {};
889 var simple = options.enumerable;
890 var name = options.name !== undefined ? options.name : key;
891 if (isCallable$a(value)) makeBuiltIn(value, name, options);
892 if (options.global) {
893 if (simple) O[key] = value;
894 else defineGlobalProperty$1(key, value);
895 } else {
896 if (!options.unsafe) delete O[key];
897 else if (O[key]) simple = true;
898 if (simple) O[key] = value;
899 else createNonEnumerableProperty$6(O, key, value);
900 } return O;
901 };
902
903 var objectGetOwnPropertyNames = {};
904
905 var ceil = Math.ceil;
906 var floor$2 = Math.floor;
907
908 // `Math.trunc` method
909 // https://tc39.es/ecma262/#sec-math.trunc
910 // eslint-disable-next-line es-x/no-math-trunc -- safe
911 var mathTrunc = Math.trunc || function trunc(x) {
912 var n = +x;
913 return (n > 0 ? floor$2 : ceil)(n);
914 };
915
916 var trunc = mathTrunc;
917
918 // `ToIntegerOrInfinity` abstract operation
919 // https://tc39.es/ecma262/#sec-tointegerorinfinity
920 var toIntegerOrInfinity$5 = function (argument) {
921 var number = +argument;
922 // eslint-disable-next-line no-self-compare -- NaN check
923 return number !== number || number === 0 ? 0 : trunc(number);
924 };
925
926 var toIntegerOrInfinity$4 = toIntegerOrInfinity$5;
927
928 var max$4 = Math.max;
929 var min$6 = Math.min;
930
931 // Helper for a popular repeating case of the spec:
932 // Let integer be ? ToInteger(index).
933 // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
934 var toAbsoluteIndex$4 = function (index, length) {
935 var integer = toIntegerOrInfinity$4(index);
936 return integer < 0 ? max$4(integer + length, 0) : min$6(integer, length);
937 };
938
939 var toIntegerOrInfinity$3 = toIntegerOrInfinity$5;
940
941 var min$5 = Math.min;
942
943 // `ToLength` abstract operation
944 // https://tc39.es/ecma262/#sec-tolength
945 var toLength$6 = function (argument) {
946 return argument > 0 ? min$5(toIntegerOrInfinity$3(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
947 };
948
949 var toLength$5 = toLength$6;
950
951 // `LengthOfArrayLike` abstract operation
952 // https://tc39.es/ecma262/#sec-lengthofarraylike
953 var lengthOfArrayLike$7 = function (obj) {
954 return toLength$5(obj.length);
955 };
956
957 var toIndexedObject$6 = toIndexedObject$8;
958 var toAbsoluteIndex$3 = toAbsoluteIndex$4;
959 var lengthOfArrayLike$6 = lengthOfArrayLike$7;
960
961 // `Array.prototype.{ indexOf, includes }` methods implementation
962 var createMethod$4 = function (IS_INCLUDES) {
963 return function ($this, el, fromIndex) {
964 var O = toIndexedObject$6($this);
965 var length = lengthOfArrayLike$6(O);
966 var index = toAbsoluteIndex$3(fromIndex, length);
967 var value;
968 // Array#includes uses SameValueZero equality algorithm
969 // eslint-disable-next-line no-self-compare -- NaN check
970 if (IS_INCLUDES && el != el) while (length > index) {
971 value = O[index++];
972 // eslint-disable-next-line no-self-compare -- NaN check
973 if (value != value) return true;
974 // Array#indexOf ignores holes, Array#includes - not
975 } else for (;length > index; index++) {
976 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
977 } return !IS_INCLUDES && -1;
978 };
979 };
980
981 var arrayIncludes = {
982 // `Array.prototype.includes` method
983 // https://tc39.es/ecma262/#sec-array.prototype.includes
984 includes: createMethod$4(true),
985 // `Array.prototype.indexOf` method
986 // https://tc39.es/ecma262/#sec-array.prototype.indexof
987 indexOf: createMethod$4(false)
988 };
989
990 var uncurryThis$r = functionUncurryThis;
991 var hasOwn$6 = hasOwnProperty_1;
992 var toIndexedObject$5 = toIndexedObject$8;
993 var indexOf$1 = arrayIncludes.indexOf;
994 var hiddenKeys$2 = hiddenKeys$4;
995
996 var push$5 = uncurryThis$r([].push);
997
998 var objectKeysInternal = function (object, names) {
999 var O = toIndexedObject$5(object);
1000 var i = 0;
1001 var result = [];
1002 var key;
1003 for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$5(result, key);
1004 // Don't enum bug & hidden keys
1005 while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
1006 ~indexOf$1(result, key) || push$5(result, key);
1007 }
1008 return result;
1009 };
1010
1011 // IE8- don't enum bug keys
1012 var enumBugKeys$3 = [
1013 'constructor',
1014 'hasOwnProperty',
1015 'isPrototypeOf',
1016 'propertyIsEnumerable',
1017 'toLocaleString',
1018 'toString',
1019 'valueOf'
1020 ];
1021
1022 var internalObjectKeys$1 = objectKeysInternal;
1023 var enumBugKeys$2 = enumBugKeys$3;
1024
1025 var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
1026
1027 // `Object.getOwnPropertyNames` method
1028 // https://tc39.es/ecma262/#sec-object.getownpropertynames
1029 // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
1030 objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1031 return internalObjectKeys$1(O, hiddenKeys$1);
1032 };
1033
1034 var objectGetOwnPropertySymbols = {};
1035
1036 // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
1037 objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1038
1039 var getBuiltIn$3 = getBuiltIn$6;
1040 var uncurryThis$q = functionUncurryThis;
1041 var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1042 var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
1043 var anObject$b = anObject$d;
1044
1045 var concat$2 = uncurryThis$q([].concat);
1046
1047 // all object keys, includes non-enumerable and symbols
1048 var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
1049 var keys = getOwnPropertyNamesModule.f(anObject$b(it));
1050 var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1051 return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
1052 };
1053
1054 var hasOwn$5 = hasOwnProperty_1;
1055 var ownKeys = ownKeys$1;
1056 var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1057 var definePropertyModule$3 = objectDefineProperty;
1058
1059 var copyConstructorProperties$1 = function (target, source, exceptions) {
1060 var keys = ownKeys(source);
1061 var defineProperty = definePropertyModule$3.f;
1062 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1063 for (var i = 0; i < keys.length; i++) {
1064 var key = keys[i];
1065 if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
1066 defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1067 }
1068 }
1069 };
1070
1071 var fails$m = fails$u;
1072 var isCallable$9 = isCallable$j;
1073
1074 var replacement = /#|\.prototype\./;
1075
1076 var isForced$3 = function (feature, detection) {
1077 var value = data[normalize(feature)];
1078 return value == POLYFILL ? true
1079 : value == NATIVE ? false
1080 : isCallable$9(detection) ? fails$m(detection)
1081 : !!detection;
1082 };
1083
1084 var normalize = isForced$3.normalize = function (string) {
1085 return String(string).replace(replacement, '.').toLowerCase();
1086 };
1087
1088 var data = isForced$3.data = {};
1089 var NATIVE = isForced$3.NATIVE = 'N';
1090 var POLYFILL = isForced$3.POLYFILL = 'P';
1091
1092 var isForced_1 = isForced$3;
1093
1094 var global$a = global$j;
1095 var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
1096 var createNonEnumerableProperty$5 = createNonEnumerableProperty$8;
1097 var defineBuiltIn$7 = defineBuiltIn$8;
1098 var defineGlobalProperty = defineGlobalProperty$3;
1099 var copyConstructorProperties = copyConstructorProperties$1;
1100 var isForced$2 = isForced_1;
1101
1102 /*
1103 options.target - name of the target object
1104 options.global - target is the global object
1105 options.stat - export as static methods of target
1106 options.proto - export as prototype methods of target
1107 options.real - real prototype method for the `pure` version
1108 options.forced - export even if the native feature is available
1109 options.bind - bind methods to the target, required for the `pure` version
1110 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1111 options.unsafe - use the simple assignment of property instead of delete + defineProperty
1112 options.sham - add a flag to not completely full polyfills
1113 options.enumerable - export as enumerable property
1114 options.dontCallGetSet - prevent calling a getter on target
1115 options.name - the .name of the function if it does not match the key
1116 */
1117 var _export = function (options, source) {
1118 var TARGET = options.target;
1119 var GLOBAL = options.global;
1120 var STATIC = options.stat;
1121 var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1122 if (GLOBAL) {
1123 target = global$a;
1124 } else if (STATIC) {
1125 target = global$a[TARGET] || defineGlobalProperty(TARGET, {});
1126 } else {
1127 target = (global$a[TARGET] || {}).prototype;
1128 }
1129 if (target) for (key in source) {
1130 sourceProperty = source[key];
1131 if (options.dontCallGetSet) {
1132 descriptor = getOwnPropertyDescriptor$3(target, key);
1133 targetProperty = descriptor && descriptor.value;
1134 } else targetProperty = target[key];
1135 FORCED = isForced$2(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1136 // contained in target
1137 if (!FORCED && targetProperty !== undefined) {
1138 if (typeof sourceProperty == typeof targetProperty) continue;
1139 copyConstructorProperties(sourceProperty, targetProperty);
1140 }
1141 // add a flag to not completely full polyfills
1142 if (options.sham || (targetProperty && targetProperty.sham)) {
1143 createNonEnumerableProperty$5(sourceProperty, 'sham', true);
1144 }
1145 defineBuiltIn$7(target, key, sourceProperty, options);
1146 }
1147 };
1148
1149 var internalObjectKeys = objectKeysInternal;
1150 var enumBugKeys$1 = enumBugKeys$3;
1151
1152 // `Object.keys` method
1153 // https://tc39.es/ecma262/#sec-object.keys
1154 // eslint-disable-next-line es-x/no-object-keys -- safe
1155 var objectKeys$3 = Object.keys || function keys(O) {
1156 return internalObjectKeys(O, enumBugKeys$1);
1157 };
1158
1159 var DESCRIPTORS$6 = descriptors;
1160 var uncurryThis$p = functionUncurryThis;
1161 var call$9 = functionCall;
1162 var fails$l = fails$u;
1163 var objectKeys$2 = objectKeys$3;
1164 var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1165 var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1166 var toObject$7 = toObject$9;
1167 var IndexedObject$2 = indexedObject;
1168
1169 // eslint-disable-next-line es-x/no-object-assign -- safe
1170 var $assign = Object.assign;
1171 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
1172 var defineProperty$5 = Object.defineProperty;
1173 var concat$1 = uncurryThis$p([].concat);
1174
1175 // `Object.assign` method
1176 // https://tc39.es/ecma262/#sec-object.assign
1177 var objectAssign = !$assign || fails$l(function () {
1178 // should have correct order of operations (Edge bug)
1179 if (DESCRIPTORS$6 && $assign({ b: 1 }, $assign(defineProperty$5({}, 'a', {
1180 enumerable: true,
1181 get: function () {
1182 defineProperty$5(this, 'b', {
1183 value: 3,
1184 enumerable: false
1185 });
1186 }
1187 }), { b: 2 })).b !== 1) return true;
1188 // should work with symbols and should have deterministic property order (V8 bug)
1189 var A = {};
1190 var B = {};
1191 // eslint-disable-next-line es-x/no-symbol -- safe
1192 var symbol = Symbol();
1193 var alphabet = 'abcdefghijklmnopqrst';
1194 A[symbol] = 7;
1195 alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1196 return $assign({}, A)[symbol] != 7 || objectKeys$2($assign({}, B)).join('') != alphabet;
1197 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1198 var T = toObject$7(target);
1199 var argumentsLength = arguments.length;
1200 var index = 1;
1201 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1202 var propertyIsEnumerable = propertyIsEnumerableModule.f;
1203 while (argumentsLength > index) {
1204 var S = IndexedObject$2(arguments[index++]);
1205 var keys = getOwnPropertySymbols ? concat$1(objectKeys$2(S), getOwnPropertySymbols(S)) : objectKeys$2(S);
1206 var length = keys.length;
1207 var j = 0;
1208 var key;
1209 while (length > j) {
1210 key = keys[j++];
1211 if (!DESCRIPTORS$6 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
1212 }
1213 } return T;
1214 } : $assign;
1215
1216 var $$m = _export;
1217 var assign = objectAssign;
1218
1219 // `Object.assign` method
1220 // https://tc39.es/ecma262/#sec-object.assign
1221 // eslint-disable-next-line es-x/no-object-assign -- required for testing
1222 $$m({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1223 assign: assign
1224 });
1225
1226 var wellKnownSymbol$h = wellKnownSymbol$j;
1227
1228 var TO_STRING_TAG$3 = wellKnownSymbol$h('toStringTag');
1229 var test$2 = {};
1230
1231 test$2[TO_STRING_TAG$3] = 'z';
1232
1233 var toStringTagSupport = String(test$2) === '[object z]';
1234
1235 var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
1236 var isCallable$8 = isCallable$j;
1237 var classofRaw = classofRaw$1;
1238 var wellKnownSymbol$g = wellKnownSymbol$j;
1239
1240 var TO_STRING_TAG$2 = wellKnownSymbol$g('toStringTag');
1241 var $Object$1 = Object;
1242
1243 // ES3 wrong here
1244 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1245
1246 // fallback for IE11 Script Access Denied error
1247 var tryGet = function (it, key) {
1248 try {
1249 return it[key];
1250 } catch (error) { /* empty */ }
1251 };
1252
1253 // getting tag from ES6+ `Object.prototype.toString`
1254 var classof$6 = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
1255 var O, tag, result;
1256 return it === undefined ? 'Undefined' : it === null ? 'Null'
1257 // @@toStringTag case
1258 : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$2)) == 'string' ? tag
1259 // builtinTag case
1260 : CORRECT_ARGUMENTS ? classofRaw(O)
1261 // ES3 arguments fallback
1262 : (result = classofRaw(O)) == 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
1263 };
1264
1265 var classof$5 = classof$6;
1266
1267 var $String$1 = String;
1268
1269 var toString$f = function (argument) {
1270 if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1271 return $String$1(argument);
1272 };
1273
1274 // a string of all valid unicode whitespaces
1275 var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1276 '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1277
1278 var uncurryThis$o = functionUncurryThis;
1279 var requireObjectCoercible$8 = requireObjectCoercible$b;
1280 var toString$e = toString$f;
1281 var whitespaces$3 = whitespaces$4;
1282
1283 var replace$3 = uncurryThis$o(''.replace);
1284 var whitespace = '[' + whitespaces$3 + ']';
1285 var ltrim = RegExp('^' + whitespace + whitespace + '*');
1286 var rtrim = RegExp(whitespace + whitespace + '*$');
1287
1288 // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1289 var createMethod$3 = function (TYPE) {
1290 return function ($this) {
1291 var string = toString$e(requireObjectCoercible$8($this));
1292 if (TYPE & 1) string = replace$3(string, ltrim, '');
1293 if (TYPE & 2) string = replace$3(string, rtrim, '');
1294 return string;
1295 };
1296 };
1297
1298 var stringTrim = {
1299 // `String.prototype.{ trimLeft, trimStart }` methods
1300 // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1301 start: createMethod$3(1),
1302 // `String.prototype.{ trimRight, trimEnd }` methods
1303 // https://tc39.es/ecma262/#sec-string.prototype.trimend
1304 end: createMethod$3(2),
1305 // `String.prototype.trim` method
1306 // https://tc39.es/ecma262/#sec-string.prototype.trim
1307 trim: createMethod$3(3)
1308 };
1309
1310 var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
1311 var fails$k = fails$u;
1312 var whitespaces$2 = whitespaces$4;
1313
1314 var non = '\u200B\u0085\u180E';
1315
1316 // check that a method works with the correct list
1317 // of whitespaces and has a correct name
1318 var stringTrimForced = function (METHOD_NAME) {
1319 return fails$k(function () {
1320 return !!whitespaces$2[METHOD_NAME]()
1321 || non[METHOD_NAME]() !== non
1322 || (PROPER_FUNCTION_NAME$2 && whitespaces$2[METHOD_NAME].name !== METHOD_NAME);
1323 });
1324 };
1325
1326 var $$l = _export;
1327 var $trim = stringTrim.trim;
1328 var forcedStringTrimMethod = stringTrimForced;
1329
1330 // `String.prototype.trim` method
1331 // https://tc39.es/ecma262/#sec-string.prototype.trim
1332 $$l({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1333 trim: function trim() {
1334 return $trim(this);
1335 }
1336 });
1337
1338 var fails$j = fails$u;
1339
1340 var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) {
1341 var method = [][METHOD_NAME];
1342 return !!method && fails$j(function () {
1343 // eslint-disable-next-line no-useless-call -- required for testing
1344 method.call(null, argument || function () { return 1; }, 1);
1345 });
1346 };
1347
1348 var $$k = _export;
1349 var uncurryThis$n = functionUncurryThis;
1350 var IndexedObject$1 = indexedObject;
1351 var toIndexedObject$4 = toIndexedObject$8;
1352 var arrayMethodIsStrict$3 = arrayMethodIsStrict$4;
1353
1354 var un$Join = uncurryThis$n([].join);
1355
1356 var ES3_STRINGS = IndexedObject$1 != Object;
1357 var STRICT_METHOD$3 = arrayMethodIsStrict$3('join', ',');
1358
1359 // `Array.prototype.join` method
1360 // https://tc39.es/ecma262/#sec-array.prototype.join
1361 $$k({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$3 }, {
1362 join: function join(separator) {
1363 return un$Join(toIndexedObject$4(this), separator === undefined ? ',' : separator);
1364 }
1365 });
1366
1367 var anObject$a = anObject$d;
1368
1369 // `RegExp.prototype.flags` getter implementation
1370 // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1371 var regexpFlags$1 = function () {
1372 var that = anObject$a(this);
1373 var result = '';
1374 if (that.hasIndices) result += 'd';
1375 if (that.global) result += 'g';
1376 if (that.ignoreCase) result += 'i';
1377 if (that.multiline) result += 'm';
1378 if (that.dotAll) result += 's';
1379 if (that.unicode) result += 'u';
1380 if (that.sticky) result += 'y';
1381 return result;
1382 };
1383
1384 var fails$i = fails$u;
1385 var global$9 = global$j;
1386
1387 // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1388 var $RegExp$2 = global$9.RegExp;
1389
1390 var UNSUPPORTED_Y$3 = fails$i(function () {
1391 var re = $RegExp$2('a', 'y');
1392 re.lastIndex = 2;
1393 return re.exec('abcd') != null;
1394 });
1395
1396 // UC Browser bug
1397 // https://github.com/zloirock/core-js/issues/1008
1398 var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$i(function () {
1399 return !$RegExp$2('a', 'y').sticky;
1400 });
1401
1402 var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$i(function () {
1403 // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1404 var re = $RegExp$2('^r', 'gy');
1405 re.lastIndex = 2;
1406 return re.exec('str') != null;
1407 });
1408
1409 var regexpStickyHelpers = {
1410 BROKEN_CARET: BROKEN_CARET,
1411 MISSED_STICKY: MISSED_STICKY$1,
1412 UNSUPPORTED_Y: UNSUPPORTED_Y$3
1413 };
1414
1415 var objectDefineProperties = {};
1416
1417 var DESCRIPTORS$5 = descriptors;
1418 var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1419 var definePropertyModule$2 = objectDefineProperty;
1420 var anObject$9 = anObject$d;
1421 var toIndexedObject$3 = toIndexedObject$8;
1422 var objectKeys$1 = objectKeys$3;
1423
1424 // `Object.defineProperties` method
1425 // https://tc39.es/ecma262/#sec-object.defineproperties
1426 // eslint-disable-next-line es-x/no-object-defineproperties -- safe
1427 objectDefineProperties.f = DESCRIPTORS$5 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1428 anObject$9(O);
1429 var props = toIndexedObject$3(Properties);
1430 var keys = objectKeys$1(Properties);
1431 var length = keys.length;
1432 var index = 0;
1433 var key;
1434 while (length > index) definePropertyModule$2.f(O, key = keys[index++], props[key]);
1435 return O;
1436 };
1437
1438 var getBuiltIn$2 = getBuiltIn$6;
1439
1440 var html$1 = getBuiltIn$2('document', 'documentElement');
1441
1442 /* global ActiveXObject -- old IE, WSH */
1443
1444 var anObject$8 = anObject$d;
1445 var definePropertiesModule = objectDefineProperties;
1446 var enumBugKeys = enumBugKeys$3;
1447 var hiddenKeys = hiddenKeys$4;
1448 var html = html$1;
1449 var documentCreateElement$1 = documentCreateElement$2;
1450 var sharedKey$1 = sharedKey$3;
1451
1452 var GT = '>';
1453 var LT = '<';
1454 var PROTOTYPE = 'prototype';
1455 var SCRIPT = 'script';
1456 var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1457
1458 var EmptyConstructor = function () { /* empty */ };
1459
1460 var scriptTag = function (content) {
1461 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1462 };
1463
1464 // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1465 var NullProtoObjectViaActiveX = function (activeXDocument) {
1466 activeXDocument.write(scriptTag(''));
1467 activeXDocument.close();
1468 var temp = activeXDocument.parentWindow.Object;
1469 activeXDocument = null; // avoid memory leak
1470 return temp;
1471 };
1472
1473 // Create object with fake `null` prototype: use iframe Object with cleared prototype
1474 var NullProtoObjectViaIFrame = function () {
1475 // Thrash, waste and sodomy: IE GC bug
1476 var iframe = documentCreateElement$1('iframe');
1477 var JS = 'java' + SCRIPT + ':';
1478 var iframeDocument;
1479 iframe.style.display = 'none';
1480 html.appendChild(iframe);
1481 // https://github.com/zloirock/core-js/issues/475
1482 iframe.src = String(JS);
1483 iframeDocument = iframe.contentWindow.document;
1484 iframeDocument.open();
1485 iframeDocument.write(scriptTag('document.F=Object'));
1486 iframeDocument.close();
1487 return iframeDocument.F;
1488 };
1489
1490 // Check for document.domain and active x support
1491 // No need to use active x approach when document.domain is not set
1492 // see https://github.com/es-shims/es5-shim/issues/150
1493 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1494 // avoid IE GC bug
1495 var activeXDocument;
1496 var NullProtoObject = function () {
1497 try {
1498 activeXDocument = new ActiveXObject('htmlfile');
1499 } catch (error) { /* ignore */ }
1500 NullProtoObject = typeof document != 'undefined'
1501 ? document.domain && activeXDocument
1502 ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1503 : NullProtoObjectViaIFrame()
1504 : NullProtoObjectViaActiveX(activeXDocument); // WSH
1505 var length = enumBugKeys.length;
1506 while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1507 return NullProtoObject();
1508 };
1509
1510 hiddenKeys[IE_PROTO$1] = true;
1511
1512 // `Object.create` method
1513 // https://tc39.es/ecma262/#sec-object.create
1514 // eslint-disable-next-line es-x/no-object-create -- safe
1515 var objectCreate = Object.create || function create(O, Properties) {
1516 var result;
1517 if (O !== null) {
1518 EmptyConstructor[PROTOTYPE] = anObject$8(O);
1519 result = new EmptyConstructor();
1520 EmptyConstructor[PROTOTYPE] = null;
1521 // add "__proto__" for Object.getPrototypeOf polyfill
1522 result[IE_PROTO$1] = O;
1523 } else result = NullProtoObject();
1524 return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1525 };
1526
1527 var fails$h = fails$u;
1528 var global$8 = global$j;
1529
1530 // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1531 var $RegExp$1 = global$8.RegExp;
1532
1533 var regexpUnsupportedDotAll = fails$h(function () {
1534 var re = $RegExp$1('.', 's');
1535 return !(re.dotAll && re.exec('\n') && re.flags === 's');
1536 });
1537
1538 var fails$g = fails$u;
1539 var global$7 = global$j;
1540
1541 // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1542 var $RegExp = global$7.RegExp;
1543
1544 var regexpUnsupportedNcg = fails$g(function () {
1545 var re = $RegExp('(?<a>b)', 'g');
1546 return re.exec('b').groups.a !== 'b' ||
1547 'b'.replace(re, '$<a>c') !== 'bc';
1548 });
1549
1550 /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1551 /* eslint-disable regexp/no-useless-quantifier -- testing */
1552 var call$8 = functionCall;
1553 var uncurryThis$m = functionUncurryThis;
1554 var toString$d = toString$f;
1555 var regexpFlags = regexpFlags$1;
1556 var stickyHelpers$2 = regexpStickyHelpers;
1557 var shared = shared$4.exports;
1558 var create$2 = objectCreate;
1559 var getInternalState$1 = internalState.get;
1560 var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll;
1561 var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg;
1562
1563 var nativeReplace = shared('native-string-replace', String.prototype.replace);
1564 var nativeExec = RegExp.prototype.exec;
1565 var patchedExec = nativeExec;
1566 var charAt$5 = uncurryThis$m(''.charAt);
1567 var indexOf = uncurryThis$m(''.indexOf);
1568 var replace$2 = uncurryThis$m(''.replace);
1569 var stringSlice$6 = uncurryThis$m(''.slice);
1570
1571 var UPDATES_LAST_INDEX_WRONG = (function () {
1572 var re1 = /a/;
1573 var re2 = /b*/g;
1574 call$8(nativeExec, re1, 'a');
1575 call$8(nativeExec, re2, 'a');
1576 return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1577 })();
1578
1579 var UNSUPPORTED_Y$2 = stickyHelpers$2.BROKEN_CARET;
1580
1581 // nonparticipating capturing group, copied from es5-shim's String#split patch.
1582 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1583
1584 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2 || UNSUPPORTED_DOT_ALL$1 || UNSUPPORTED_NCG$1;
1585
1586 if (PATCH) {
1587 patchedExec = function exec(string) {
1588 var re = this;
1589 var state = getInternalState$1(re);
1590 var str = toString$d(string);
1591 var raw = state.raw;
1592 var result, reCopy, lastIndex, match, i, object, group;
1593
1594 if (raw) {
1595 raw.lastIndex = re.lastIndex;
1596 result = call$8(patchedExec, raw, str);
1597 re.lastIndex = raw.lastIndex;
1598 return result;
1599 }
1600
1601 var groups = state.groups;
1602 var sticky = UNSUPPORTED_Y$2 && re.sticky;
1603 var flags = call$8(regexpFlags, re);
1604 var source = re.source;
1605 var charsAdded = 0;
1606 var strCopy = str;
1607
1608 if (sticky) {
1609 flags = replace$2(flags, 'y', '');
1610 if (indexOf(flags, 'g') === -1) {
1611 flags += 'g';
1612 }
1613
1614 strCopy = stringSlice$6(str, re.lastIndex);
1615 // Support anchored sticky behavior.
1616 if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$5(str, re.lastIndex - 1) !== '\n')) {
1617 source = '(?: ' + source + ')';
1618 strCopy = ' ' + strCopy;
1619 charsAdded++;
1620 }
1621 // ^(? + rx + ) is needed, in combination with some str slicing, to
1622 // simulate the 'y' flag.
1623 reCopy = new RegExp('^(?:' + source + ')', flags);
1624 }
1625
1626 if (NPCG_INCLUDED) {
1627 reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1628 }
1629 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1630
1631 match = call$8(nativeExec, sticky ? reCopy : re, strCopy);
1632
1633 if (sticky) {
1634 if (match) {
1635 match.input = stringSlice$6(match.input, charsAdded);
1636 match[0] = stringSlice$6(match[0], charsAdded);
1637 match.index = re.lastIndex;
1638 re.lastIndex += match[0].length;
1639 } else re.lastIndex = 0;
1640 } else if (UPDATES_LAST_INDEX_WRONG && match) {
1641 re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1642 }
1643 if (NPCG_INCLUDED && match && match.length > 1) {
1644 // Fix browsers whose `exec` methods don't consistently return `undefined`
1645 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
1646 call$8(nativeReplace, match[0], reCopy, function () {
1647 for (i = 1; i < arguments.length - 2; i++) {
1648 if (arguments[i] === undefined) match[i] = undefined;
1649 }
1650 });
1651 }
1652
1653 if (match && groups) {
1654 match.groups = object = create$2(null);
1655 for (i = 0; i < groups.length; i++) {
1656 group = groups[i];
1657 object[group[0]] = match[group[1]];
1658 }
1659 }
1660
1661 return match;
1662 };
1663 }
1664
1665 var regexpExec$3 = patchedExec;
1666
1667 var $$j = _export;
1668 var exec$4 = regexpExec$3;
1669
1670 // `RegExp.prototype.exec` method
1671 // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1672 $$j({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, {
1673 exec: exec$4
1674 });
1675
1676 var NATIVE_BIND$1 = functionBindNative;
1677
1678 var FunctionPrototype = Function.prototype;
1679 var apply$2 = FunctionPrototype.apply;
1680 var call$7 = FunctionPrototype.call;
1681
1682 // eslint-disable-next-line es-x/no-reflect -- safe
1683 var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$2) : function () {
1684 return call$7.apply(apply$2, arguments);
1685 });
1686
1687 // TODO: Remove from `core-js@4` since it's moved to entry points
1688
1689 var uncurryThis$l = functionUncurryThis;
1690 var defineBuiltIn$6 = defineBuiltIn$8;
1691 var regexpExec$2 = regexpExec$3;
1692 var fails$f = fails$u;
1693 var wellKnownSymbol$f = wellKnownSymbol$j;
1694 var createNonEnumerableProperty$4 = createNonEnumerableProperty$8;
1695
1696 var SPECIES$5 = wellKnownSymbol$f('species');
1697 var RegExpPrototype$3 = RegExp.prototype;
1698
1699 var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1700 var SYMBOL = wellKnownSymbol$f(KEY);
1701
1702 var DELEGATES_TO_SYMBOL = !fails$f(function () {
1703 // String methods call symbol-named RegEp methods
1704 var O = {};
1705 O[SYMBOL] = function () { return 7; };
1706 return ''[KEY](O) != 7;
1707 });
1708
1709 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$f(function () {
1710 // Symbol-named RegExp methods call .exec
1711 var execCalled = false;
1712 var re = /a/;
1713
1714 if (KEY === 'split') {
1715 // We can't use real regex here since it causes deoptimization
1716 // and serious performance degradation in V8
1717 // https://github.com/zloirock/core-js/issues/306
1718 re = {};
1719 // RegExp[@@split] doesn't call the regex's exec method, but first creates
1720 // a new one. We need to return the patched regex when creating the new one.
1721 re.constructor = {};
1722 re.constructor[SPECIES$5] = function () { return re; };
1723 re.flags = '';
1724 re[SYMBOL] = /./[SYMBOL];
1725 }
1726
1727 re.exec = function () { execCalled = true; return null; };
1728
1729 re[SYMBOL]('');
1730 return !execCalled;
1731 });
1732
1733 if (
1734 !DELEGATES_TO_SYMBOL ||
1735 !DELEGATES_TO_EXEC ||
1736 FORCED
1737 ) {
1738 var uncurriedNativeRegExpMethod = uncurryThis$l(/./[SYMBOL]);
1739 var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1740 var uncurriedNativeMethod = uncurryThis$l(nativeMethod);
1741 var $exec = regexp.exec;
1742 if ($exec === regexpExec$2 || $exec === RegExpPrototype$3.exec) {
1743 if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1744 // The native String method already delegates to @@method (this
1745 // polyfilled function), leasing to infinite recursion.
1746 // We avoid it by directly calling the native @@method method.
1747 return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
1748 }
1749 return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
1750 }
1751 return { done: false };
1752 });
1753
1754 defineBuiltIn$6(String.prototype, KEY, methods[0]);
1755 defineBuiltIn$6(RegExpPrototype$3, SYMBOL, methods[1]);
1756 }
1757
1758 if (SHAM) createNonEnumerableProperty$4(RegExpPrototype$3[SYMBOL], 'sham', true);
1759 };
1760
1761 var isObject$4 = isObject$a;
1762 var classof$4 = classofRaw$1;
1763 var wellKnownSymbol$e = wellKnownSymbol$j;
1764
1765 var MATCH$2 = wellKnownSymbol$e('match');
1766
1767 // `IsRegExp` abstract operation
1768 // https://tc39.es/ecma262/#sec-isregexp
1769 var isRegexp = function (it) {
1770 var isRegExp;
1771 return isObject$4(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$4(it) == 'RegExp');
1772 };
1773
1774 var uncurryThis$k = functionUncurryThis;
1775 var fails$e = fails$u;
1776 var isCallable$7 = isCallable$j;
1777 var classof$3 = classof$6;
1778 var getBuiltIn$1 = getBuiltIn$6;
1779 var inspectSource = inspectSource$3;
1780
1781 var noop = function () { /* empty */ };
1782 var empty = [];
1783 var construct = getBuiltIn$1('Reflect', 'construct');
1784 var constructorRegExp = /^\s*(?:class|function)\b/;
1785 var exec$3 = uncurryThis$k(constructorRegExp.exec);
1786 var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1787
1788 var isConstructorModern = function isConstructor(argument) {
1789 if (!isCallable$7(argument)) return false;
1790 try {
1791 construct(noop, empty, argument);
1792 return true;
1793 } catch (error) {
1794 return false;
1795 }
1796 };
1797
1798 var isConstructorLegacy = function isConstructor(argument) {
1799 if (!isCallable$7(argument)) return false;
1800 switch (classof$3(argument)) {
1801 case 'AsyncFunction':
1802 case 'GeneratorFunction':
1803 case 'AsyncGeneratorFunction': return false;
1804 }
1805 try {
1806 // we can't check .prototype since constructors produced by .bind haven't it
1807 // `Function#toString` throws on some built-it function in some legacy engines
1808 // (for example, `DOMQuad` and similar in FF41-)
1809 return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource(argument));
1810 } catch (error) {
1811 return true;
1812 }
1813 };
1814
1815 isConstructorLegacy.sham = true;
1816
1817 // `IsConstructor` abstract operation
1818 // https://tc39.es/ecma262/#sec-isconstructor
1819 var isConstructor$3 = !construct || fails$e(function () {
1820 var called;
1821 return isConstructorModern(isConstructorModern.call)
1822 || !isConstructorModern(Object)
1823 || !isConstructorModern(function () { called = true; })
1824 || called;
1825 }) ? isConstructorLegacy : isConstructorModern;
1826
1827 var isConstructor$2 = isConstructor$3;
1828 var tryToString$1 = tryToString$3;
1829
1830 var $TypeError$5 = TypeError;
1831
1832 // `Assert: IsConstructor(argument) is true`
1833 var aConstructor$1 = function (argument) {
1834 if (isConstructor$2(argument)) return argument;
1835 throw $TypeError$5(tryToString$1(argument) + ' is not a constructor');
1836 };
1837
1838 var anObject$7 = anObject$d;
1839 var aConstructor = aConstructor$1;
1840 var wellKnownSymbol$d = wellKnownSymbol$j;
1841
1842 var SPECIES$4 = wellKnownSymbol$d('species');
1843
1844 // `SpeciesConstructor` abstract operation
1845 // https://tc39.es/ecma262/#sec-speciesconstructor
1846 var speciesConstructor$1 = function (O, defaultConstructor) {
1847 var C = anObject$7(O).constructor;
1848 var S;
1849 return C === undefined || (S = anObject$7(C)[SPECIES$4]) == undefined ? defaultConstructor : aConstructor(S);
1850 };
1851
1852 var uncurryThis$j = functionUncurryThis;
1853 var toIntegerOrInfinity$2 = toIntegerOrInfinity$5;
1854 var toString$c = toString$f;
1855 var requireObjectCoercible$7 = requireObjectCoercible$b;
1856
1857 var charAt$4 = uncurryThis$j(''.charAt);
1858 var charCodeAt$1 = uncurryThis$j(''.charCodeAt);
1859 var stringSlice$5 = uncurryThis$j(''.slice);
1860
1861 var createMethod$2 = function (CONVERT_TO_STRING) {
1862 return function ($this, pos) {
1863 var S = toString$c(requireObjectCoercible$7($this));
1864 var position = toIntegerOrInfinity$2(pos);
1865 var size = S.length;
1866 var first, second;
1867 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1868 first = charCodeAt$1(S, position);
1869 return first < 0xD800 || first > 0xDBFF || position + 1 === size
1870 || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
1871 ? CONVERT_TO_STRING
1872 ? charAt$4(S, position)
1873 : first
1874 : CONVERT_TO_STRING
1875 ? stringSlice$5(S, position, position + 2)
1876 : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1877 };
1878 };
1879
1880 var stringMultibyte = {
1881 // `String.prototype.codePointAt` method
1882 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1883 codeAt: createMethod$2(false),
1884 // `String.prototype.at` method
1885 // https://github.com/mathiasbynens/String.prototype.at
1886 charAt: createMethod$2(true)
1887 };
1888
1889 var charAt$3 = stringMultibyte.charAt;
1890
1891 // `AdvanceStringIndex` abstract operation
1892 // https://tc39.es/ecma262/#sec-advancestringindex
1893 var advanceStringIndex$3 = function (S, index, unicode) {
1894 return index + (unicode ? charAt$3(S, index).length : 1);
1895 };
1896
1897 var toPropertyKey = toPropertyKey$3;
1898 var definePropertyModule$1 = objectDefineProperty;
1899 var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1900
1901 var createProperty$4 = function (object, key, value) {
1902 var propertyKey = toPropertyKey(key);
1903 if (propertyKey in object) definePropertyModule$1.f(object, propertyKey, createPropertyDescriptor$1(0, value));
1904 else object[propertyKey] = value;
1905 };
1906
1907 var toAbsoluteIndex$2 = toAbsoluteIndex$4;
1908 var lengthOfArrayLike$5 = lengthOfArrayLike$7;
1909 var createProperty$3 = createProperty$4;
1910
1911 var $Array$2 = Array;
1912 var max$3 = Math.max;
1913
1914 var arraySliceSimple = function (O, start, end) {
1915 var length = lengthOfArrayLike$5(O);
1916 var k = toAbsoluteIndex$2(start, length);
1917 var fin = toAbsoluteIndex$2(end === undefined ? length : end, length);
1918 var result = $Array$2(max$3(fin - k, 0));
1919 for (var n = 0; k < fin; k++, n++) createProperty$3(result, n, O[k]);
1920 result.length = n;
1921 return result;
1922 };
1923
1924 var call$6 = functionCall;
1925 var anObject$6 = anObject$d;
1926 var isCallable$6 = isCallable$j;
1927 var classof$2 = classofRaw$1;
1928 var regexpExec$1 = regexpExec$3;
1929
1930 var $TypeError$4 = TypeError;
1931
1932 // `RegExpExec` abstract operation
1933 // https://tc39.es/ecma262/#sec-regexpexec
1934 var regexpExecAbstract = function (R, S) {
1935 var exec = R.exec;
1936 if (isCallable$6(exec)) {
1937 var result = call$6(exec, R, S);
1938 if (result !== null) anObject$6(result);
1939 return result;
1940 }
1941 if (classof$2(R) === 'RegExp') return call$6(regexpExec$1, R, S);
1942 throw $TypeError$4('RegExp#exec called on incompatible receiver');
1943 };
1944
1945 var apply$1 = functionApply;
1946 var call$5 = functionCall;
1947 var uncurryThis$i = functionUncurryThis;
1948 var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic;
1949 var isRegExp$2 = isRegexp;
1950 var anObject$5 = anObject$d;
1951 var requireObjectCoercible$6 = requireObjectCoercible$b;
1952 var speciesConstructor = speciesConstructor$1;
1953 var advanceStringIndex$2 = advanceStringIndex$3;
1954 var toLength$4 = toLength$6;
1955 var toString$b = toString$f;
1956 var getMethod$3 = getMethod$5;
1957 var arraySlice$3 = arraySliceSimple;
1958 var callRegExpExec = regexpExecAbstract;
1959 var regexpExec = regexpExec$3;
1960 var stickyHelpers$1 = regexpStickyHelpers;
1961 var fails$d = fails$u;
1962
1963 var UNSUPPORTED_Y$1 = stickyHelpers$1.UNSUPPORTED_Y;
1964 var MAX_UINT32 = 0xFFFFFFFF;
1965 var min$4 = Math.min;
1966 var $push = [].push;
1967 var exec$2 = uncurryThis$i(/./.exec);
1968 var push$4 = uncurryThis$i($push);
1969 var stringSlice$4 = uncurryThis$i(''.slice);
1970
1971 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
1972 // Weex JS has frozen built-in prototypes, so use try / catch wrapper
1973 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$d(function () {
1974 // eslint-disable-next-line regexp/no-empty-group -- required for testing
1975 var re = /(?:)/;
1976 var originalExec = re.exec;
1977 re.exec = function () { return originalExec.apply(this, arguments); };
1978 var result = 'ab'.split(re);
1979 return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
1980 });
1981
1982 // @@split logic
1983 fixRegExpWellKnownSymbolLogic$3('split', function (SPLIT, nativeSplit, maybeCallNative) {
1984 var internalSplit;
1985 if (
1986 'abbc'.split(/(b)*/)[1] == 'c' ||
1987 // eslint-disable-next-line regexp/no-empty-group -- required for testing
1988 'test'.split(/(?:)/, -1).length != 4 ||
1989 'ab'.split(/(?:ab)*/).length != 2 ||
1990 '.'.split(/(.?)(.?)/).length != 4 ||
1991 // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
1992 '.'.split(/()()/).length > 1 ||
1993 ''.split(/.?/).length
1994 ) {
1995 // based on es5-shim implementation, need to rework it
1996 internalSplit = function (separator, limit) {
1997 var string = toString$b(requireObjectCoercible$6(this));
1998 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
1999 if (lim === 0) return [];
2000 if (separator === undefined) return [string];
2001 // If `separator` is not a regex, use native split
2002 if (!isRegExp$2(separator)) {
2003 return call$5(nativeSplit, string, separator, lim);
2004 }
2005 var output = [];
2006 var flags = (separator.ignoreCase ? 'i' : '') +
2007 (separator.multiline ? 'm' : '') +
2008 (separator.unicode ? 'u' : '') +
2009 (separator.sticky ? 'y' : '');
2010 var lastLastIndex = 0;
2011 // Make `global` and avoid `lastIndex` issues by working with a copy
2012 var separatorCopy = new RegExp(separator.source, flags + 'g');
2013 var match, lastIndex, lastLength;
2014 while (match = call$5(regexpExec, separatorCopy, string)) {
2015 lastIndex = separatorCopy.lastIndex;
2016 if (lastIndex > lastLastIndex) {
2017 push$4(output, stringSlice$4(string, lastLastIndex, match.index));
2018 if (match.length > 1 && match.index < string.length) apply$1($push, output, arraySlice$3(match, 1));
2019 lastLength = match[0].length;
2020 lastLastIndex = lastIndex;
2021 if (output.length >= lim) break;
2022 }
2023 if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
2024 }
2025 if (lastLastIndex === string.length) {
2026 if (lastLength || !exec$2(separatorCopy, '')) push$4(output, '');
2027 } else push$4(output, stringSlice$4(string, lastLastIndex));
2028 return output.length > lim ? arraySlice$3(output, 0, lim) : output;
2029 };
2030 // Chakra, V8
2031 } else if ('0'.split(undefined, 0).length) {
2032 internalSplit = function (separator, limit) {
2033 return separator === undefined && limit === 0 ? [] : call$5(nativeSplit, this, separator, limit);
2034 };
2035 } else internalSplit = nativeSplit;
2036
2037 return [
2038 // `String.prototype.split` method
2039 // https://tc39.es/ecma262/#sec-string.prototype.split
2040 function split(separator, limit) {
2041 var O = requireObjectCoercible$6(this);
2042 var splitter = separator == undefined ? undefined : getMethod$3(separator, SPLIT);
2043 return splitter
2044 ? call$5(splitter, separator, O, limit)
2045 : call$5(internalSplit, toString$b(O), separator, limit);
2046 },
2047 // `RegExp.prototype[@@split]` method
2048 // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
2049 //
2050 // NOTE: This cannot be properly polyfilled in engines that don't support
2051 // the 'y' flag.
2052 function (string, limit) {
2053 var rx = anObject$5(this);
2054 var S = toString$b(string);
2055 var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
2056
2057 if (res.done) return res.value;
2058
2059 var C = speciesConstructor(rx, RegExp);
2060
2061 var unicodeMatching = rx.unicode;
2062 var flags = (rx.ignoreCase ? 'i' : '') +
2063 (rx.multiline ? 'm' : '') +
2064 (rx.unicode ? 'u' : '') +
2065 (UNSUPPORTED_Y$1 ? 'g' : 'y');
2066
2067 // ^(? + rx + ) is needed, in combination with some S slicing, to
2068 // simulate the 'y' flag.
2069 var splitter = new C(UNSUPPORTED_Y$1 ? '^(?:' + rx.source + ')' : rx, flags);
2070 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2071 if (lim === 0) return [];
2072 if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
2073 var p = 0;
2074 var q = 0;
2075 var A = [];
2076 while (q < S.length) {
2077 splitter.lastIndex = UNSUPPORTED_Y$1 ? 0 : q;
2078 var z = callRegExpExec(splitter, UNSUPPORTED_Y$1 ? stringSlice$4(S, q) : S);
2079 var e;
2080 if (
2081 z === null ||
2082 (e = min$4(toLength$4(splitter.lastIndex + (UNSUPPORTED_Y$1 ? q : 0)), S.length)) === p
2083 ) {
2084 q = advanceStringIndex$2(S, q, unicodeMatching);
2085 } else {
2086 push$4(A, stringSlice$4(S, p, q));
2087 if (A.length === lim) return A;
2088 for (var i = 1; i <= z.length - 1; i++) {
2089 push$4(A, z[i]);
2090 if (A.length === lim) return A;
2091 }
2092 q = p = e;
2093 }
2094 }
2095 push$4(A, stringSlice$4(S, p));
2096 return A;
2097 }
2098 ];
2099 }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y$1);
2100
2101 var DESCRIPTORS$4 = descriptors;
2102 var uncurryThis$h = functionUncurryThis;
2103 var objectKeys = objectKeys$3;
2104 var toIndexedObject$2 = toIndexedObject$8;
2105 var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
2106
2107 var propertyIsEnumerable = uncurryThis$h($propertyIsEnumerable);
2108 var push$3 = uncurryThis$h([].push);
2109
2110 // `Object.{ entries, values }` methods implementation
2111 var createMethod$1 = function (TO_ENTRIES) {
2112 return function (it) {
2113 var O = toIndexedObject$2(it);
2114 var keys = objectKeys(O);
2115 var length = keys.length;
2116 var i = 0;
2117 var result = [];
2118 var key;
2119 while (length > i) {
2120 key = keys[i++];
2121 if (!DESCRIPTORS$4 || propertyIsEnumerable(O, key)) {
2122 push$3(result, TO_ENTRIES ? [key, O[key]] : O[key]);
2123 }
2124 }
2125 return result;
2126 };
2127 };
2128
2129 var objectToArray = {
2130 // `Object.entries` method
2131 // https://tc39.es/ecma262/#sec-object.entries
2132 entries: createMethod$1(true),
2133 // `Object.values` method
2134 // https://tc39.es/ecma262/#sec-object.values
2135 values: createMethod$1(false)
2136 };
2137
2138 var $$i = _export;
2139 var $entries = objectToArray.entries;
2140
2141 // `Object.entries` method
2142 // https://tc39.es/ecma262/#sec-object.entries
2143 $$i({ target: 'Object', stat: true }, {
2144 entries: function entries(O) {
2145 return $entries(O);
2146 }
2147 });
2148
2149 var wellKnownSymbol$c = wellKnownSymbol$j;
2150 var create$1 = objectCreate;
2151 var defineProperty$4 = objectDefineProperty.f;
2152
2153 var UNSCOPABLES = wellKnownSymbol$c('unscopables');
2154 var ArrayPrototype = Array.prototype;
2155
2156 // Array.prototype[@@unscopables]
2157 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2158 if (ArrayPrototype[UNSCOPABLES] == undefined) {
2159 defineProperty$4(ArrayPrototype, UNSCOPABLES, {
2160 configurable: true,
2161 value: create$1(null)
2162 });
2163 }
2164
2165 // add a key to Array.prototype[@@unscopables]
2166 var addToUnscopables$4 = function (key) {
2167 ArrayPrototype[UNSCOPABLES][key] = true;
2168 };
2169
2170 var $$h = _export;
2171 var $includes = arrayIncludes.includes;
2172 var fails$c = fails$u;
2173 var addToUnscopables$3 = addToUnscopables$4;
2174
2175 // FF99+ bug
2176 var BROKEN_ON_SPARSE = fails$c(function () {
2177 return !Array(1).includes();
2178 });
2179
2180 // `Array.prototype.includes` method
2181 // https://tc39.es/ecma262/#sec-array.prototype.includes
2182 $$h({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2183 includes: function includes(el /* , fromIndex = 0 */) {
2184 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2185 }
2186 });
2187
2188 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2189 addToUnscopables$3('includes');
2190
2191 var classof$1 = classofRaw$1;
2192
2193 // `IsArray` abstract operation
2194 // https://tc39.es/ecma262/#sec-isarray
2195 // eslint-disable-next-line es-x/no-array-isarray -- safe
2196 var isArray$4 = Array.isArray || function isArray(argument) {
2197 return classof$1(argument) == 'Array';
2198 };
2199
2200 var $TypeError$3 = TypeError;
2201 var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
2202
2203 var doesNotExceedSafeInteger$2 = function (it) {
2204 if (it > MAX_SAFE_INTEGER) throw $TypeError$3('Maximum allowed index exceeded');
2205 return it;
2206 };
2207
2208 var isArray$3 = isArray$4;
2209 var isConstructor$1 = isConstructor$3;
2210 var isObject$3 = isObject$a;
2211 var wellKnownSymbol$b = wellKnownSymbol$j;
2212
2213 var SPECIES$3 = wellKnownSymbol$b('species');
2214 var $Array$1 = Array;
2215
2216 // a part of `ArraySpeciesCreate` abstract operation
2217 // https://tc39.es/ecma262/#sec-arrayspeciescreate
2218 var arraySpeciesConstructor$1 = function (originalArray) {
2219 var C;
2220 if (isArray$3(originalArray)) {
2221 C = originalArray.constructor;
2222 // cross-realm fallback
2223 if (isConstructor$1(C) && (C === $Array$1 || isArray$3(C.prototype))) C = undefined;
2224 else if (isObject$3(C)) {
2225 C = C[SPECIES$3];
2226 if (C === null) C = undefined;
2227 }
2228 } return C === undefined ? $Array$1 : C;
2229 };
2230
2231 var arraySpeciesConstructor = arraySpeciesConstructor$1;
2232
2233 // `ArraySpeciesCreate` abstract operation
2234 // https://tc39.es/ecma262/#sec-arrayspeciescreate
2235 var arraySpeciesCreate$3 = function (originalArray, length) {
2236 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
2237 };
2238
2239 var fails$b = fails$u;
2240 var wellKnownSymbol$a = wellKnownSymbol$j;
2241 var V8_VERSION$1 = engineV8Version;
2242
2243 var SPECIES$2 = wellKnownSymbol$a('species');
2244
2245 var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
2246 // We can't use this feature detection in V8 since it causes
2247 // deoptimization and serious performance degradation
2248 // https://github.com/zloirock/core-js/issues/677
2249 return V8_VERSION$1 >= 51 || !fails$b(function () {
2250 var array = [];
2251 var constructor = array.constructor = {};
2252 constructor[SPECIES$2] = function () {
2253 return { foo: 1 };
2254 };
2255 return array[METHOD_NAME](Boolean).foo !== 1;
2256 });
2257 };
2258
2259 var $$g = _export;
2260 var fails$a = fails$u;
2261 var isArray$2 = isArray$4;
2262 var isObject$2 = isObject$a;
2263 var toObject$6 = toObject$9;
2264 var lengthOfArrayLike$4 = lengthOfArrayLike$7;
2265 var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
2266 var createProperty$2 = createProperty$4;
2267 var arraySpeciesCreate$2 = arraySpeciesCreate$3;
2268 var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
2269 var wellKnownSymbol$9 = wellKnownSymbol$j;
2270 var V8_VERSION = engineV8Version;
2271
2272 var IS_CONCAT_SPREADABLE = wellKnownSymbol$9('isConcatSpreadable');
2273
2274 // We can't use this feature detection in V8 since it causes
2275 // deoptimization and serious performance degradation
2276 // https://github.com/zloirock/core-js/issues/679
2277 var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$a(function () {
2278 var array = [];
2279 array[IS_CONCAT_SPREADABLE] = false;
2280 return array.concat()[0] !== array;
2281 });
2282
2283 var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport$4('concat');
2284
2285 var isConcatSpreadable = function (O) {
2286 if (!isObject$2(O)) return false;
2287 var spreadable = O[IS_CONCAT_SPREADABLE];
2288 return spreadable !== undefined ? !!spreadable : isArray$2(O);
2289 };
2290
2291 var FORCED$3 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
2292
2293 // `Array.prototype.concat` method
2294 // https://tc39.es/ecma262/#sec-array.prototype.concat
2295 // with adding support of @@isConcatSpreadable and @@species
2296 $$g({ target: 'Array', proto: true, arity: 1, forced: FORCED$3 }, {
2297 // eslint-disable-next-line no-unused-vars -- required for `.length`
2298 concat: function concat(arg) {
2299 var O = toObject$6(this);
2300 var A = arraySpeciesCreate$2(O, 0);
2301 var n = 0;
2302 var i, k, length, len, E;
2303 for (i = -1, length = arguments.length; i < length; i++) {
2304 E = i === -1 ? O : arguments[i];
2305 if (isConcatSpreadable(E)) {
2306 len = lengthOfArrayLike$4(E);
2307 doesNotExceedSafeInteger$1(n + len);
2308 for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
2309 } else {
2310 doesNotExceedSafeInteger$1(n + 1);
2311 createProperty$2(A, n++, E);
2312 }
2313 }
2314 A.length = n;
2315 return A;
2316 }
2317 });
2318
2319 var uncurryThis$g = functionUncurryThis;
2320 var aCallable$1 = aCallable$3;
2321 var NATIVE_BIND = functionBindNative;
2322
2323 var bind$1 = uncurryThis$g(uncurryThis$g.bind);
2324
2325 // optional / simple context binding
2326 var functionBindContext = function (fn, that) {
2327 aCallable$1(fn);
2328 return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
2329 return fn.apply(that, arguments);
2330 };
2331 };
2332
2333 var bind = functionBindContext;
2334 var uncurryThis$f = functionUncurryThis;
2335 var IndexedObject = indexedObject;
2336 var toObject$5 = toObject$9;
2337 var lengthOfArrayLike$3 = lengthOfArrayLike$7;
2338 var arraySpeciesCreate$1 = arraySpeciesCreate$3;
2339
2340 var push$2 = uncurryThis$f([].push);
2341
2342 // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
2343 var createMethod = function (TYPE) {
2344 var IS_MAP = TYPE == 1;
2345 var IS_FILTER = TYPE == 2;
2346 var IS_SOME = TYPE == 3;
2347 var IS_EVERY = TYPE == 4;
2348 var IS_FIND_INDEX = TYPE == 6;
2349 var IS_FILTER_REJECT = TYPE == 7;
2350 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
2351 return function ($this, callbackfn, that, specificCreate) {
2352 var O = toObject$5($this);
2353 var self = IndexedObject(O);
2354 var boundFunction = bind(callbackfn, that);
2355 var length = lengthOfArrayLike$3(self);
2356 var index = 0;
2357 var create = specificCreate || arraySpeciesCreate$1;
2358 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
2359 var value, result;
2360 for (;length > index; index++) if (NO_HOLES || index in self) {
2361 value = self[index];
2362 result = boundFunction(value, index, O);
2363 if (TYPE) {
2364 if (IS_MAP) target[index] = result; // map
2365 else if (result) switch (TYPE) {
2366 case 3: return true; // some
2367 case 5: return value; // find
2368 case 6: return index; // findIndex
2369 case 2: push$2(target, value); // filter
2370 } else switch (TYPE) {
2371 case 4: return false; // every
2372 case 7: push$2(target, value); // filterReject
2373 }
2374 }
2375 }
2376 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
2377 };
2378 };
2379
2380 var arrayIteration = {
2381 // `Array.prototype.forEach` method
2382 // https://tc39.es/ecma262/#sec-array.prototype.foreach
2383 forEach: createMethod(0),
2384 // `Array.prototype.map` method
2385 // https://tc39.es/ecma262/#sec-array.prototype.map
2386 map: createMethod(1),
2387 // `Array.prototype.filter` method
2388 // https://tc39.es/ecma262/#sec-array.prototype.filter
2389 filter: createMethod(2),
2390 // `Array.prototype.some` method
2391 // https://tc39.es/ecma262/#sec-array.prototype.some
2392 some: createMethod(3),
2393 // `Array.prototype.every` method
2394 // https://tc39.es/ecma262/#sec-array.prototype.every
2395 every: createMethod(4),
2396 // `Array.prototype.find` method
2397 // https://tc39.es/ecma262/#sec-array.prototype.find
2398 find: createMethod(5),
2399 // `Array.prototype.findIndex` method
2400 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
2401 findIndex: createMethod(6),
2402 // `Array.prototype.filterReject` method
2403 // https://github.com/tc39/proposal-array-filtering
2404 filterReject: createMethod(7)
2405 };
2406
2407 var $$f = _export;
2408 var $find = arrayIteration.find;
2409 var addToUnscopables$2 = addToUnscopables$4;
2410
2411 var FIND = 'find';
2412 var SKIPS_HOLES$1 = true;
2413
2414 // Shouldn't skip holes
2415 if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
2416
2417 // `Array.prototype.find` method
2418 // https://tc39.es/ecma262/#sec-array.prototype.find
2419 $$f({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
2420 find: function find(callbackfn /* , that = undefined */) {
2421 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2422 }
2423 });
2424
2425 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2426 addToUnscopables$2(FIND);
2427
2428 var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
2429 var classof = classof$6;
2430
2431 // `Object.prototype.toString` method implementation
2432 // https://tc39.es/ecma262/#sec-object.prototype.tostring
2433 var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
2434 return '[object ' + classof(this) + ']';
2435 };
2436
2437 var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2438 var defineBuiltIn$5 = defineBuiltIn$8;
2439 var toString$a = objectToString;
2440
2441 // `Object.prototype.toString` method
2442 // https://tc39.es/ecma262/#sec-object.prototype.tostring
2443 if (!TO_STRING_TAG_SUPPORT) {
2444 defineBuiltIn$5(Object.prototype, 'toString', toString$a, { unsafe: true });
2445 }
2446
2447 var isRegExp$1 = isRegexp;
2448
2449 var $TypeError$2 = TypeError;
2450
2451 var notARegexp = function (it) {
2452 if (isRegExp$1(it)) {
2453 throw $TypeError$2("The method doesn't accept regular expressions");
2454 } return it;
2455 };
2456
2457 var wellKnownSymbol$8 = wellKnownSymbol$j;
2458
2459 var MATCH$1 = wellKnownSymbol$8('match');
2460
2461 var correctIsRegexpLogic = function (METHOD_NAME) {
2462 var regexp = /./;
2463 try {
2464 '/./'[METHOD_NAME](regexp);
2465 } catch (error1) {
2466 try {
2467 regexp[MATCH$1] = false;
2468 return '/./'[METHOD_NAME](regexp);
2469 } catch (error2) { /* empty */ }
2470 } return false;
2471 };
2472
2473 var $$e = _export;
2474 var uncurryThis$e = functionUncurryThis;
2475 var notARegExp$2 = notARegexp;
2476 var requireObjectCoercible$5 = requireObjectCoercible$b;
2477 var toString$9 = toString$f;
2478 var correctIsRegExpLogic$2 = correctIsRegexpLogic;
2479
2480 var stringIndexOf$2 = uncurryThis$e(''.indexOf);
2481
2482 // `String.prototype.includes` method
2483 // https://tc39.es/ecma262/#sec-string.prototype.includes
2484 $$e({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
2485 includes: function includes(searchString /* , position = 0 */) {
2486 return !!~stringIndexOf$2(
2487 toString$9(requireObjectCoercible$5(this)),
2488 toString$9(notARegExp$2(searchString)),
2489 arguments.length > 1 ? arguments[1] : undefined
2490 );
2491 }
2492 });
2493
2494 // iterable DOM collections
2495 // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2496 var domIterables = {
2497 CSSRuleList: 0,
2498 CSSStyleDeclaration: 0,
2499 CSSValueList: 0,
2500 ClientRectList: 0,
2501 DOMRectList: 0,
2502 DOMStringList: 0,
2503 DOMTokenList: 1,
2504 DataTransferItemList: 0,
2505 FileList: 0,
2506 HTMLAllCollection: 0,
2507 HTMLCollection: 0,
2508 HTMLFormElement: 0,
2509 HTMLSelectElement: 0,
2510 MediaList: 0,
2511 MimeTypeArray: 0,
2512 NamedNodeMap: 0,
2513 NodeList: 1,
2514 PaintRequestList: 0,
2515 Plugin: 0,
2516 PluginArray: 0,
2517 SVGLengthList: 0,
2518 SVGNumberList: 0,
2519 SVGPathSegList: 0,
2520 SVGPointList: 0,
2521 SVGStringList: 0,
2522 SVGTransformList: 0,
2523 SourceBufferList: 0,
2524 StyleSheetList: 0,
2525 TextTrackCueList: 0,
2526 TextTrackList: 0,
2527 TouchList: 0
2528 };
2529
2530 // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2531 var documentCreateElement = documentCreateElement$2;
2532
2533 var classList = documentCreateElement('span').classList;
2534 var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype;
2535
2536 var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2;
2537
2538 var $forEach = arrayIteration.forEach;
2539 var arrayMethodIsStrict$2 = arrayMethodIsStrict$4;
2540
2541 var STRICT_METHOD$2 = arrayMethodIsStrict$2('forEach');
2542
2543 // `Array.prototype.forEach` method implementation
2544 // https://tc39.es/ecma262/#sec-array.prototype.foreach
2545 var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
2546 return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2547 // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
2548 } : [].forEach;
2549
2550 var global$6 = global$j;
2551 var DOMIterables$1 = domIterables;
2552 var DOMTokenListPrototype$1 = domTokenListPrototype;
2553 var forEach = arrayForEach;
2554 var createNonEnumerableProperty$3 = createNonEnumerableProperty$8;
2555
2556 var handlePrototype$1 = function (CollectionPrototype) {
2557 // some Chrome versions have non-configurable methods on DOMTokenList
2558 if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
2559 createNonEnumerableProperty$3(CollectionPrototype, 'forEach', forEach);
2560 } catch (error) {
2561 CollectionPrototype.forEach = forEach;
2562 }
2563 };
2564
2565 for (var COLLECTION_NAME$1 in DOMIterables$1) {
2566 if (DOMIterables$1[COLLECTION_NAME$1]) {
2567 handlePrototype$1(global$6[COLLECTION_NAME$1] && global$6[COLLECTION_NAME$1].prototype);
2568 }
2569 }
2570
2571 handlePrototype$1(DOMTokenListPrototype$1);
2572
2573 var global$5 = global$j;
2574 var fails$9 = fails$u;
2575 var uncurryThis$d = functionUncurryThis;
2576 var toString$8 = toString$f;
2577 var trim$2 = stringTrim.trim;
2578 var whitespaces$1 = whitespaces$4;
2579
2580 var charAt$2 = uncurryThis$d(''.charAt);
2581 var n$ParseFloat = global$5.parseFloat;
2582 var Symbol$2 = global$5.Symbol;
2583 var ITERATOR$4 = Symbol$2 && Symbol$2.iterator;
2584 var FORCED$2 = 1 / n$ParseFloat(whitespaces$1 + '-0') !== -Infinity
2585 // MS Edge 18- broken with boxed symbols
2586 || (ITERATOR$4 && !fails$9(function () { n$ParseFloat(Object(ITERATOR$4)); }));
2587
2588 // `parseFloat` method
2589 // https://tc39.es/ecma262/#sec-parsefloat-string
2590 var numberParseFloat = FORCED$2 ? function parseFloat(string) {
2591 var trimmedString = trim$2(toString$8(string));
2592 var result = n$ParseFloat(trimmedString);
2593 return result === 0 && charAt$2(trimmedString, 0) == '-' ? -0 : result;
2594 } : n$ParseFloat;
2595
2596 var $$d = _export;
2597 var $parseFloat = numberParseFloat;
2598
2599 // `parseFloat` method
2600 // https://tc39.es/ecma262/#sec-parsefloat-string
2601 $$d({ global: true, forced: parseFloat != $parseFloat }, {
2602 parseFloat: $parseFloat
2603 });
2604
2605 /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
2606 var $$c = _export;
2607 var uncurryThis$c = functionUncurryThis;
2608 var $IndexOf = arrayIncludes.indexOf;
2609 var arrayMethodIsStrict$1 = arrayMethodIsStrict$4;
2610
2611 var un$IndexOf = uncurryThis$c([].indexOf);
2612
2613 var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
2614 var STRICT_METHOD$1 = arrayMethodIsStrict$1('indexOf');
2615
2616 // `Array.prototype.indexOf` method
2617 // https://tc39.es/ecma262/#sec-array.prototype.indexof
2618 $$c({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$1 }, {
2619 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
2620 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
2621 return NEGATIVE_ZERO
2622 // convert -0 to +0
2623 ? un$IndexOf(this, searchElement, fromIndex) || 0
2624 : $IndexOf(this, searchElement, fromIndex);
2625 }
2626 });
2627
2628 var tryToString = tryToString$3;
2629
2630 var $TypeError$1 = TypeError;
2631
2632 var deletePropertyOrThrow$2 = function (O, P) {
2633 if (!delete O[P]) throw $TypeError$1('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
2634 };
2635
2636 var arraySlice$2 = arraySliceSimple;
2637
2638 var floor$1 = Math.floor;
2639
2640 var mergeSort = function (array, comparefn) {
2641 var length = array.length;
2642 var middle = floor$1(length / 2);
2643 return length < 8 ? insertionSort(array, comparefn) : merge(
2644 array,
2645 mergeSort(arraySlice$2(array, 0, middle), comparefn),
2646 mergeSort(arraySlice$2(array, middle), comparefn),
2647 comparefn
2648 );
2649 };
2650
2651 var insertionSort = function (array, comparefn) {
2652 var length = array.length;
2653 var i = 1;
2654 var element, j;
2655
2656 while (i < length) {
2657 j = i;
2658 element = array[i];
2659 while (j && comparefn(array[j - 1], element) > 0) {
2660 array[j] = array[--j];
2661 }
2662 if (j !== i++) array[j] = element;
2663 } return array;
2664 };
2665
2666 var merge = function (array, left, right, comparefn) {
2667 var llength = left.length;
2668 var rlength = right.length;
2669 var lindex = 0;
2670 var rindex = 0;
2671
2672 while (lindex < llength || rindex < rlength) {
2673 array[lindex + rindex] = (lindex < llength && rindex < rlength)
2674 ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
2675 : lindex < llength ? left[lindex++] : right[rindex++];
2676 } return array;
2677 };
2678
2679 var arraySort = mergeSort;
2680
2681 var userAgent$1 = engineUserAgent;
2682
2683 var firefox = userAgent$1.match(/firefox\/(\d+)/i);
2684
2685 var engineFfVersion = !!firefox && +firefox[1];
2686
2687 var UA = engineUserAgent;
2688
2689 var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
2690
2691 var userAgent = engineUserAgent;
2692
2693 var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
2694
2695 var engineWebkitVersion = !!webkit && +webkit[1];
2696
2697 var $$b = _export;
2698 var uncurryThis$b = functionUncurryThis;
2699 var aCallable = aCallable$3;
2700 var toObject$4 = toObject$9;
2701 var lengthOfArrayLike$2 = lengthOfArrayLike$7;
2702 var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
2703 var toString$7 = toString$f;
2704 var fails$8 = fails$u;
2705 var internalSort = arraySort;
2706 var arrayMethodIsStrict = arrayMethodIsStrict$4;
2707 var FF = engineFfVersion;
2708 var IE_OR_EDGE = engineIsIeOrEdge;
2709 var V8 = engineV8Version;
2710 var WEBKIT = engineWebkitVersion;
2711
2712 var test$1 = [];
2713 var un$Sort = uncurryThis$b(test$1.sort);
2714 var push$1 = uncurryThis$b(test$1.push);
2715
2716 // IE8-
2717 var FAILS_ON_UNDEFINED = fails$8(function () {
2718 test$1.sort(undefined);
2719 });
2720 // V8 bug
2721 var FAILS_ON_NULL = fails$8(function () {
2722 test$1.sort(null);
2723 });
2724 // Old WebKit
2725 var STRICT_METHOD = arrayMethodIsStrict('sort');
2726
2727 var STABLE_SORT = !fails$8(function () {
2728 // feature detection can be too slow, so check engines versions
2729 if (V8) return V8 < 70;
2730 if (FF && FF > 3) return;
2731 if (IE_OR_EDGE) return true;
2732 if (WEBKIT) return WEBKIT < 603;
2733
2734 var result = '';
2735 var code, chr, value, index;
2736
2737 // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
2738 for (code = 65; code < 76; code++) {
2739 chr = String.fromCharCode(code);
2740
2741 switch (code) {
2742 case 66: case 69: case 70: case 72: value = 3; break;
2743 case 68: case 71: value = 4; break;
2744 default: value = 2;
2745 }
2746
2747 for (index = 0; index < 47; index++) {
2748 test$1.push({ k: chr + index, v: value });
2749 }
2750 }
2751
2752 test$1.sort(function (a, b) { return b.v - a.v; });
2753
2754 for (index = 0; index < test$1.length; index++) {
2755 chr = test$1[index].k.charAt(0);
2756 if (result.charAt(result.length - 1) !== chr) result += chr;
2757 }
2758
2759 return result !== 'DGBEFHACIJK';
2760 });
2761
2762 var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
2763
2764 var getSortCompare = function (comparefn) {
2765 return function (x, y) {
2766 if (y === undefined) return -1;
2767 if (x === undefined) return 1;
2768 if (comparefn !== undefined) return +comparefn(x, y) || 0;
2769 return toString$7(x) > toString$7(y) ? 1 : -1;
2770 };
2771 };
2772
2773 // `Array.prototype.sort` method
2774 // https://tc39.es/ecma262/#sec-array.prototype.sort
2775 $$b({ target: 'Array', proto: true, forced: FORCED$1 }, {
2776 sort: function sort(comparefn) {
2777 if (comparefn !== undefined) aCallable(comparefn);
2778
2779 var array = toObject$4(this);
2780
2781 if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
2782
2783 var items = [];
2784 var arrayLength = lengthOfArrayLike$2(array);
2785 var itemsLength, index;
2786
2787 for (index = 0; index < arrayLength; index++) {
2788 if (index in array) push$1(items, array[index]);
2789 }
2790
2791 internalSort(items, getSortCompare(comparefn));
2792
2793 itemsLength = items.length;
2794 index = 0;
2795
2796 while (index < itemsLength) array[index] = items[index++];
2797 while (index < arrayLength) deletePropertyOrThrow$1(array, index++);
2798
2799 return array;
2800 }
2801 });
2802
2803 var uncurryThis$a = functionUncurryThis;
2804 var toObject$3 = toObject$9;
2805
2806 var floor = Math.floor;
2807 var charAt$1 = uncurryThis$a(''.charAt);
2808 var replace$1 = uncurryThis$a(''.replace);
2809 var stringSlice$3 = uncurryThis$a(''.slice);
2810 var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2811 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2812
2813 // `GetSubstitution` abstract operation
2814 // https://tc39.es/ecma262/#sec-getsubstitution
2815 var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
2816 var tailPos = position + matched.length;
2817 var m = captures.length;
2818 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2819 if (namedCaptures !== undefined) {
2820 namedCaptures = toObject$3(namedCaptures);
2821 symbols = SUBSTITUTION_SYMBOLS;
2822 }
2823 return replace$1(replacement, symbols, function (match, ch) {
2824 var capture;
2825 switch (charAt$1(ch, 0)) {
2826 case '$': return '$';
2827 case '&': return matched;
2828 case '`': return stringSlice$3(str, 0, position);
2829 case "'": return stringSlice$3(str, tailPos);
2830 case '<':
2831 capture = namedCaptures[stringSlice$3(ch, 1, -1)];
2832 break;
2833 default: // \d\d?
2834 var n = +ch;
2835 if (n === 0) return match;
2836 if (n > m) {
2837 var f = floor(n / 10);
2838 if (f === 0) return match;
2839 if (f <= m) return captures[f - 1] === undefined ? charAt$1(ch, 1) : captures[f - 1] + charAt$1(ch, 1);
2840 return match;
2841 }
2842 capture = captures[n - 1];
2843 }
2844 return capture === undefined ? '' : capture;
2845 });
2846 };
2847
2848 var apply = functionApply;
2849 var call$4 = functionCall;
2850 var uncurryThis$9 = functionUncurryThis;
2851 var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
2852 var fails$7 = fails$u;
2853 var anObject$4 = anObject$d;
2854 var isCallable$5 = isCallable$j;
2855 var toIntegerOrInfinity$1 = toIntegerOrInfinity$5;
2856 var toLength$3 = toLength$6;
2857 var toString$6 = toString$f;
2858 var requireObjectCoercible$4 = requireObjectCoercible$b;
2859 var advanceStringIndex$1 = advanceStringIndex$3;
2860 var getMethod$2 = getMethod$5;
2861 var getSubstitution = getSubstitution$1;
2862 var regExpExec$2 = regexpExecAbstract;
2863 var wellKnownSymbol$7 = wellKnownSymbol$j;
2864
2865 var REPLACE = wellKnownSymbol$7('replace');
2866 var max$2 = Math.max;
2867 var min$3 = Math.min;
2868 var concat = uncurryThis$9([].concat);
2869 var push = uncurryThis$9([].push);
2870 var stringIndexOf$1 = uncurryThis$9(''.indexOf);
2871 var stringSlice$2 = uncurryThis$9(''.slice);
2872
2873 var maybeToString = function (it) {
2874 return it === undefined ? it : String(it);
2875 };
2876
2877 // IE <= 11 replaces $0 with the whole match, as if it was $&
2878 // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2879 var REPLACE_KEEPS_$0 = (function () {
2880 // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
2881 return 'a'.replace(/./, '$0') === '$0';
2882 })();
2883
2884 // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2885 var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2886 if (/./[REPLACE]) {
2887 return /./[REPLACE]('a', '$0') === '';
2888 }
2889 return false;
2890 })();
2891
2892 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$7(function () {
2893 var re = /./;
2894 re.exec = function () {
2895 var result = [];
2896 result.groups = { a: '7' };
2897 return result;
2898 };
2899 // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
2900 return ''.replace(re, '$<a>') !== '7';
2901 });
2902
2903 // @@replace logic
2904 fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCallNative) {
2905 var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2906
2907 return [
2908 // `String.prototype.replace` method
2909 // https://tc39.es/ecma262/#sec-string.prototype.replace
2910 function replace(searchValue, replaceValue) {
2911 var O = requireObjectCoercible$4(this);
2912 var replacer = searchValue == undefined ? undefined : getMethod$2(searchValue, REPLACE);
2913 return replacer
2914 ? call$4(replacer, searchValue, O, replaceValue)
2915 : call$4(nativeReplace, toString$6(O), searchValue, replaceValue);
2916 },
2917 // `RegExp.prototype[@@replace]` method
2918 // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2919 function (string, replaceValue) {
2920 var rx = anObject$4(this);
2921 var S = toString$6(string);
2922
2923 if (
2924 typeof replaceValue == 'string' &&
2925 stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2926 stringIndexOf$1(replaceValue, '$<') === -1
2927 ) {
2928 var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2929 if (res.done) return res.value;
2930 }
2931
2932 var functionalReplace = isCallable$5(replaceValue);
2933 if (!functionalReplace) replaceValue = toString$6(replaceValue);
2934
2935 var global = rx.global;
2936 if (global) {
2937 var fullUnicode = rx.unicode;
2938 rx.lastIndex = 0;
2939 }
2940 var results = [];
2941 while (true) {
2942 var result = regExpExec$2(rx, S);
2943 if (result === null) break;
2944
2945 push(results, result);
2946 if (!global) break;
2947
2948 var matchStr = toString$6(result[0]);
2949 if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$3(rx.lastIndex), fullUnicode);
2950 }
2951
2952 var accumulatedResult = '';
2953 var nextSourcePosition = 0;
2954 for (var i = 0; i < results.length; i++) {
2955 result = results[i];
2956
2957 var matched = toString$6(result[0]);
2958 var position = max$2(min$3(toIntegerOrInfinity$1(result.index), S.length), 0);
2959 var captures = [];
2960 // NOTE: This is equivalent to
2961 // captures = result.slice(1).map(maybeToString)
2962 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2963 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2964 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2965 for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
2966 var namedCaptures = result.groups;
2967 if (functionalReplace) {
2968 var replacerArgs = concat([matched], captures, position, S);
2969 if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
2970 var replacement = toString$6(apply(replaceValue, undefined, replacerArgs));
2971 } else {
2972 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2973 }
2974 if (position >= nextSourcePosition) {
2975 accumulatedResult += stringSlice$2(S, nextSourcePosition, position) + replacement;
2976 nextSourcePosition = position + matched.length;
2977 }
2978 }
2979 return accumulatedResult + stringSlice$2(S, nextSourcePosition);
2980 }
2981 ];
2982 }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
2983
2984 var $$a = _export;
2985 var $filter = arrayIteration.filter;
2986 var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
2987
2988 var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter');
2989
2990 // `Array.prototype.filter` method
2991 // https://tc39.es/ecma262/#sec-array.prototype.filter
2992 // with adding support of @@species
2993 $$a({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
2994 filter: function filter(callbackfn /* , thisArg */) {
2995 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2996 }
2997 });
2998
2999 // `SameValue` abstract operation
3000 // https://tc39.es/ecma262/#sec-samevalue
3001 // eslint-disable-next-line es-x/no-object-is -- safe
3002 var sameValue$1 = Object.is || function is(x, y) {
3003 // eslint-disable-next-line no-self-compare -- NaN check
3004 return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
3005 };
3006
3007 var call$3 = functionCall;
3008 var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
3009 var anObject$3 = anObject$d;
3010 var requireObjectCoercible$3 = requireObjectCoercible$b;
3011 var sameValue = sameValue$1;
3012 var toString$5 = toString$f;
3013 var getMethod$1 = getMethod$5;
3014 var regExpExec$1 = regexpExecAbstract;
3015
3016 // @@search logic
3017 fixRegExpWellKnownSymbolLogic$1('search', function (SEARCH, nativeSearch, maybeCallNative) {
3018 return [
3019 // `String.prototype.search` method
3020 // https://tc39.es/ecma262/#sec-string.prototype.search
3021 function search(regexp) {
3022 var O = requireObjectCoercible$3(this);
3023 var searcher = regexp == undefined ? undefined : getMethod$1(regexp, SEARCH);
3024 return searcher ? call$3(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$5(O));
3025 },
3026 // `RegExp.prototype[@@search]` method
3027 // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
3028 function (string) {
3029 var rx = anObject$3(this);
3030 var S = toString$5(string);
3031 var res = maybeCallNative(nativeSearch, rx, S);
3032
3033 if (res.done) return res.value;
3034
3035 var previousLastIndex = rx.lastIndex;
3036 if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
3037 var result = regExpExec$1(rx, S);
3038 if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
3039 return result === null ? -1 : result.index;
3040 }
3041 ];
3042 });
3043
3044 var global$4 = global$j;
3045 var fails$6 = fails$u;
3046 var uncurryThis$8 = functionUncurryThis;
3047 var toString$4 = toString$f;
3048 var trim$1 = stringTrim.trim;
3049 var whitespaces = whitespaces$4;
3050
3051 var $parseInt$1 = global$4.parseInt;
3052 var Symbol$1 = global$4.Symbol;
3053 var ITERATOR$3 = Symbol$1 && Symbol$1.iterator;
3054 var hex = /^[+-]?0x/i;
3055 var exec$1 = uncurryThis$8(hex.exec);
3056 var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
3057 // MS Edge 18- broken with boxed symbols
3058 || (ITERATOR$3 && !fails$6(function () { $parseInt$1(Object(ITERATOR$3)); }));
3059
3060 // `parseInt` method
3061 // https://tc39.es/ecma262/#sec-parseint-string-radix
3062 var numberParseInt = FORCED ? function parseInt(string, radix) {
3063 var S = trim$1(toString$4(string));
3064 return $parseInt$1(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10));
3065 } : $parseInt$1;
3066
3067 var $$9 = _export;
3068 var $parseInt = numberParseInt;
3069
3070 // `parseInt` method
3071 // https://tc39.es/ecma262/#sec-parseint-string-radix
3072 $$9({ global: true, forced: parseInt != $parseInt }, {
3073 parseInt: $parseInt
3074 });
3075
3076 var $$8 = _export;
3077 var $map = arrayIteration.map;
3078 var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
3079
3080 var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map');
3081
3082 // `Array.prototype.map` method
3083 // https://tc39.es/ecma262/#sec-array.prototype.map
3084 // with adding support of @@species
3085 $$8({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
3086 map: function map(callbackfn /* , thisArg */) {
3087 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3088 }
3089 });
3090
3091 var $$7 = _export;
3092 var $findIndex = arrayIteration.findIndex;
3093 var addToUnscopables$1 = addToUnscopables$4;
3094
3095 var FIND_INDEX = 'findIndex';
3096 var SKIPS_HOLES = true;
3097
3098 // Shouldn't skip holes
3099 if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
3100
3101 // `Array.prototype.findIndex` method
3102 // https://tc39.es/ecma262/#sec-array.prototype.findindex
3103 $$7({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
3104 findIndex: function findIndex(callbackfn /* , that = undefined */) {
3105 return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3106 }
3107 });
3108
3109 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3110 addToUnscopables$1(FIND_INDEX);
3111
3112 var isCallable$4 = isCallable$j;
3113
3114 var $String = String;
3115 var $TypeError = TypeError;
3116
3117 var aPossiblePrototype$1 = function (argument) {
3118 if (typeof argument == 'object' || isCallable$4(argument)) return argument;
3119 throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
3120 };
3121
3122 /* eslint-disable no-proto -- safe */
3123
3124 var uncurryThis$7 = functionUncurryThis;
3125 var anObject$2 = anObject$d;
3126 var aPossiblePrototype = aPossiblePrototype$1;
3127
3128 // `Object.setPrototypeOf` method
3129 // https://tc39.es/ecma262/#sec-object.setprototypeof
3130 // Works with __proto__ only. Old v8 can't work with null proto objects.
3131 // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
3132 var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3133 var CORRECT_SETTER = false;
3134 var test = {};
3135 var setter;
3136 try {
3137 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3138 setter = uncurryThis$7(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
3139 setter(test, []);
3140 CORRECT_SETTER = test instanceof Array;
3141 } catch (error) { /* empty */ }
3142 return function setPrototypeOf(O, proto) {
3143 anObject$2(O);
3144 aPossiblePrototype(proto);
3145 if (CORRECT_SETTER) setter(O, proto);
3146 else O.__proto__ = proto;
3147 return O;
3148 };
3149 }() : undefined);
3150
3151 var isCallable$3 = isCallable$j;
3152 var isObject$1 = isObject$a;
3153 var setPrototypeOf$1 = objectSetPrototypeOf;
3154
3155 // makes subclassing work correct for wrapped built-ins
3156 var inheritIfRequired$2 = function ($this, dummy, Wrapper) {
3157 var NewTarget, NewTargetPrototype;
3158 if (
3159 // it can work only with native `setPrototypeOf`
3160 setPrototypeOf$1 &&
3161 // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
3162 isCallable$3(NewTarget = dummy.constructor) &&
3163 NewTarget !== Wrapper &&
3164 isObject$1(NewTargetPrototype = NewTarget.prototype) &&
3165 NewTargetPrototype !== Wrapper.prototype
3166 ) setPrototypeOf$1($this, NewTargetPrototype);
3167 return $this;
3168 };
3169
3170 var call$2 = functionCall;
3171 var hasOwn$4 = hasOwnProperty_1;
3172 var isPrototypeOf$2 = objectIsPrototypeOf;
3173 var regExpFlags = regexpFlags$1;
3174
3175 var RegExpPrototype$2 = RegExp.prototype;
3176
3177 var regexpGetFlags = function (R) {
3178 var flags = R.flags;
3179 return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn$4(R, 'flags') && isPrototypeOf$2(RegExpPrototype$2, R)
3180 ? call$2(regExpFlags, R) : flags;
3181 };
3182
3183 var defineProperty$3 = objectDefineProperty.f;
3184
3185 var proxyAccessor$1 = function (Target, Source, key) {
3186 key in Target || defineProperty$3(Target, key, {
3187 configurable: true,
3188 get: function () { return Source[key]; },
3189 set: function (it) { Source[key] = it; }
3190 });
3191 };
3192
3193 var getBuiltIn = getBuiltIn$6;
3194 var definePropertyModule = objectDefineProperty;
3195 var wellKnownSymbol$6 = wellKnownSymbol$j;
3196 var DESCRIPTORS$3 = descriptors;
3197
3198 var SPECIES$1 = wellKnownSymbol$6('species');
3199
3200 var setSpecies$1 = function (CONSTRUCTOR_NAME) {
3201 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
3202 var defineProperty = definePropertyModule.f;
3203
3204 if (DESCRIPTORS$3 && Constructor && !Constructor[SPECIES$1]) {
3205 defineProperty(Constructor, SPECIES$1, {
3206 configurable: true,
3207 get: function () { return this; }
3208 });
3209 }
3210 };
3211
3212 var DESCRIPTORS$2 = descriptors;
3213 var global$3 = global$j;
3214 var uncurryThis$6 = functionUncurryThis;
3215 var isForced$1 = isForced_1;
3216 var inheritIfRequired$1 = inheritIfRequired$2;
3217 var createNonEnumerableProperty$2 = createNonEnumerableProperty$8;
3218 var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
3219 var isPrototypeOf$1 = objectIsPrototypeOf;
3220 var isRegExp = isRegexp;
3221 var toString$3 = toString$f;
3222 var getRegExpFlags$1 = regexpGetFlags;
3223 var stickyHelpers = regexpStickyHelpers;
3224 var proxyAccessor = proxyAccessor$1;
3225 var defineBuiltIn$4 = defineBuiltIn$8;
3226 var fails$5 = fails$u;
3227 var hasOwn$3 = hasOwnProperty_1;
3228 var enforceInternalState = internalState.enforce;
3229 var setSpecies = setSpecies$1;
3230 var wellKnownSymbol$5 = wellKnownSymbol$j;
3231 var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
3232 var UNSUPPORTED_NCG = regexpUnsupportedNcg;
3233
3234 var MATCH = wellKnownSymbol$5('match');
3235 var NativeRegExp = global$3.RegExp;
3236 var RegExpPrototype$1 = NativeRegExp.prototype;
3237 var SyntaxError = global$3.SyntaxError;
3238 var exec = uncurryThis$6(RegExpPrototype$1.exec);
3239 var charAt = uncurryThis$6(''.charAt);
3240 var replace = uncurryThis$6(''.replace);
3241 var stringIndexOf = uncurryThis$6(''.indexOf);
3242 var stringSlice$1 = uncurryThis$6(''.slice);
3243 // TODO: Use only propper RegExpIdentifierName
3244 var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
3245 var re1 = /a/g;
3246 var re2 = /a/g;
3247
3248 // "new" should create a new object, old webkit bug
3249 var CORRECT_NEW = new NativeRegExp(re1) !== re1;
3250
3251 var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
3252 var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
3253
3254 var BASE_FORCED = DESCRIPTORS$2 &&
3255 (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails$5(function () {
3256 re2[MATCH] = false;
3257 // RegExp constructor can alter flags and IsRegExp works correct with @@match
3258 return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
3259 }));
3260
3261 var handleDotAll = function (string) {
3262 var length = string.length;
3263 var index = 0;
3264 var result = '';
3265 var brackets = false;
3266 var chr;
3267 for (; index <= length; index++) {
3268 chr = charAt(string, index);
3269 if (chr === '\\') {
3270 result += chr + charAt(string, ++index);
3271 continue;
3272 }
3273 if (!brackets && chr === '.') {
3274 result += '[\\s\\S]';
3275 } else {
3276 if (chr === '[') {
3277 brackets = true;
3278 } else if (chr === ']') {
3279 brackets = false;
3280 } result += chr;
3281 }
3282 } return result;
3283 };
3284
3285 var handleNCG = function (string) {
3286 var length = string.length;
3287 var index = 0;
3288 var result = '';
3289 var named = [];
3290 var names = {};
3291 var brackets = false;
3292 var ncg = false;
3293 var groupid = 0;
3294 var groupname = '';
3295 var chr;
3296 for (; index <= length; index++) {
3297 chr = charAt(string, index);
3298 if (chr === '\\') {
3299 chr = chr + charAt(string, ++index);
3300 } else if (chr === ']') {
3301 brackets = false;
3302 } else if (!brackets) switch (true) {
3303 case chr === '[':
3304 brackets = true;
3305 break;
3306 case chr === '(':
3307 if (exec(IS_NCG, stringSlice$1(string, index + 1))) {
3308 index += 2;
3309 ncg = true;
3310 }
3311 result += chr;
3312 groupid++;
3313 continue;
3314 case chr === '>' && ncg:
3315 if (groupname === '' || hasOwn$3(names, groupname)) {
3316 throw new SyntaxError('Invalid capture group name');
3317 }
3318 names[groupname] = true;
3319 named[named.length] = [groupname, groupid];
3320 ncg = false;
3321 groupname = '';
3322 continue;
3323 }
3324 if (ncg) groupname += chr;
3325 else result += chr;
3326 } return [result, named];
3327 };
3328
3329 // `RegExp` constructor
3330 // https://tc39.es/ecma262/#sec-regexp-constructor
3331 if (isForced$1('RegExp', BASE_FORCED)) {
3332 var RegExpWrapper = function RegExp(pattern, flags) {
3333 var thisIsRegExp = isPrototypeOf$1(RegExpPrototype$1, this);
3334 var patternIsRegExp = isRegExp(pattern);
3335 var flagsAreUndefined = flags === undefined;
3336 var groups = [];
3337 var rawPattern = pattern;
3338 var rawFlags, dotAll, sticky, handled, result, state;
3339
3340 if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
3341 return pattern;
3342 }
3343
3344 if (patternIsRegExp || isPrototypeOf$1(RegExpPrototype$1, pattern)) {
3345 pattern = pattern.source;
3346 if (flagsAreUndefined) flags = getRegExpFlags$1(rawPattern);
3347 }
3348
3349 pattern = pattern === undefined ? '' : toString$3(pattern);
3350 flags = flags === undefined ? '' : toString$3(flags);
3351 rawPattern = pattern;
3352
3353 if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) {
3354 dotAll = !!flags && stringIndexOf(flags, 's') > -1;
3355 if (dotAll) flags = replace(flags, /s/g, '');
3356 }
3357
3358 rawFlags = flags;
3359
3360 if (MISSED_STICKY && 'sticky' in re1) {
3361 sticky = !!flags && stringIndexOf(flags, 'y') > -1;
3362 if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, '');
3363 }
3364
3365 if (UNSUPPORTED_NCG) {
3366 handled = handleNCG(pattern);
3367 pattern = handled[0];
3368 groups = handled[1];
3369 }
3370
3371 result = inheritIfRequired$1(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype$1, RegExpWrapper);
3372
3373 if (dotAll || sticky || groups.length) {
3374 state = enforceInternalState(result);
3375 if (dotAll) {
3376 state.dotAll = true;
3377 state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
3378 }
3379 if (sticky) state.sticky = true;
3380 if (groups.length) state.groups = groups;
3381 }
3382
3383 if (pattern !== rawPattern) try {
3384 // fails in old engines, but we have no alternatives for unsupported regex syntax
3385 createNonEnumerableProperty$2(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
3386 } catch (error) { /* empty */ }
3387
3388 return result;
3389 };
3390
3391 for (var keys$1 = getOwnPropertyNames$1(NativeRegExp), index = 0; keys$1.length > index;) {
3392 proxyAccessor(RegExpWrapper, NativeRegExp, keys$1[index++]);
3393 }
3394
3395 RegExpPrototype$1.constructor = RegExpWrapper;
3396 RegExpWrapper.prototype = RegExpPrototype$1;
3397 defineBuiltIn$4(global$3, 'RegExp', RegExpWrapper, { constructor: true });
3398 }
3399
3400 // https://tc39.es/ecma262/#sec-get-regexp-@@species
3401 setSpecies('RegExp');
3402
3403 var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
3404 var defineBuiltIn$3 = defineBuiltIn$8;
3405 var anObject$1 = anObject$d;
3406 var $toString = toString$f;
3407 var fails$4 = fails$u;
3408 var getRegExpFlags = regexpGetFlags;
3409
3410 var TO_STRING = 'toString';
3411 var RegExpPrototype = RegExp.prototype;
3412 var n$ToString = RegExpPrototype[TO_STRING];
3413
3414 var NOT_GENERIC = fails$4(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
3415 // FF44- RegExp#toString has a wrong name
3416 var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && n$ToString.name != TO_STRING;
3417
3418 // `RegExp.prototype.toString` method
3419 // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
3420 if (NOT_GENERIC || INCORRECT_NAME) {
3421 defineBuiltIn$3(RegExp.prototype, TO_STRING, function toString() {
3422 var R = anObject$1(this);
3423 var pattern = $toString(R.source);
3424 var flags = $toString(getRegExpFlags(R));
3425 return '/' + pattern + '/' + flags;
3426 }, { unsafe: true });
3427 }
3428
3429 var uncurryThis$5 = functionUncurryThis;
3430
3431 var arraySlice$1 = uncurryThis$5([].slice);
3432
3433 var $$6 = _export;
3434 var isArray$1 = isArray$4;
3435 var isConstructor = isConstructor$3;
3436 var isObject = isObject$a;
3437 var toAbsoluteIndex$1 = toAbsoluteIndex$4;
3438 var lengthOfArrayLike$1 = lengthOfArrayLike$7;
3439 var toIndexedObject$1 = toIndexedObject$8;
3440 var createProperty$1 = createProperty$4;
3441 var wellKnownSymbol$4 = wellKnownSymbol$j;
3442 var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
3443 var un$Slice = arraySlice$1;
3444
3445 var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
3446
3447 var SPECIES = wellKnownSymbol$4('species');
3448 var $Array = Array;
3449 var max$1 = Math.max;
3450
3451 // `Array.prototype.slice` method
3452 // https://tc39.es/ecma262/#sec-array.prototype.slice
3453 // fallback for not array-like ES3 strings and DOM objects
3454 $$6({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
3455 slice: function slice(start, end) {
3456 var O = toIndexedObject$1(this);
3457 var length = lengthOfArrayLike$1(O);
3458 var k = toAbsoluteIndex$1(start, length);
3459 var fin = toAbsoluteIndex$1(end === undefined ? length : end, length);
3460 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
3461 var Constructor, result, n;
3462 if (isArray$1(O)) {
3463 Constructor = O.constructor;
3464 // cross-realm fallback
3465 if (isConstructor(Constructor) && (Constructor === $Array || isArray$1(Constructor.prototype))) {
3466 Constructor = undefined;
3467 } else if (isObject(Constructor)) {
3468 Constructor = Constructor[SPECIES];
3469 if (Constructor === null) Constructor = undefined;
3470 }
3471 if (Constructor === $Array || Constructor === undefined) {
3472 return un$Slice(O, k, fin);
3473 }
3474 }
3475 result = new (Constructor === undefined ? $Array : Constructor)(max$1(fin - k, 0));
3476 for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
3477 result.length = n;
3478 return result;
3479 }
3480 });
3481
3482 var iterators = {};
3483
3484 var fails$3 = fails$u;
3485
3486 var correctPrototypeGetter = !fails$3(function () {
3487 function F() { /* empty */ }
3488 F.prototype.constructor = null;
3489 // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
3490 return Object.getPrototypeOf(new F()) !== F.prototype;
3491 });
3492
3493 var hasOwn$2 = hasOwnProperty_1;
3494 var isCallable$2 = isCallable$j;
3495 var toObject$2 = toObject$9;
3496 var sharedKey = sharedKey$3;
3497 var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
3498
3499 var IE_PROTO = sharedKey('IE_PROTO');
3500 var $Object = Object;
3501 var ObjectPrototype = $Object.prototype;
3502
3503 // `Object.getPrototypeOf` method
3504 // https://tc39.es/ecma262/#sec-object.getprototypeof
3505 // eslint-disable-next-line es-x/no-object-getprototypeof -- safe
3506 var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
3507 var object = toObject$2(O);
3508 if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
3509 var constructor = object.constructor;
3510 if (isCallable$2(constructor) && object instanceof constructor) {
3511 return constructor.prototype;
3512 } return object instanceof $Object ? ObjectPrototype : null;
3513 };
3514
3515 var fails$2 = fails$u;
3516 var isCallable$1 = isCallable$j;
3517 var getPrototypeOf$1 = objectGetPrototypeOf;
3518 var defineBuiltIn$2 = defineBuiltIn$8;
3519 var wellKnownSymbol$3 = wellKnownSymbol$j;
3520
3521 var ITERATOR$2 = wellKnownSymbol$3('iterator');
3522 var BUGGY_SAFARI_ITERATORS$1 = false;
3523
3524 // `%IteratorPrototype%` object
3525 // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
3526 var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
3527
3528 /* eslint-disable es-x/no-array-prototype-keys -- safe */
3529 if ([].keys) {
3530 arrayIterator = [].keys();
3531 // Safari 8 has buggy iterators w/o `next`
3532 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
3533 else {
3534 PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
3535 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
3536 }
3537 }
3538
3539 var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$2(function () {
3540 var test = {};
3541 // FF44- legacy iterators case
3542 return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
3543 });
3544
3545 if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
3546
3547 // `%IteratorPrototype%[@@iterator]()` method
3548 // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
3549 if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
3550 defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
3551 return this;
3552 });
3553 }
3554
3555 var iteratorsCore = {
3556 IteratorPrototype: IteratorPrototype$2,
3557 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
3558 };
3559
3560 var defineProperty$2 = objectDefineProperty.f;
3561 var hasOwn$1 = hasOwnProperty_1;
3562 var wellKnownSymbol$2 = wellKnownSymbol$j;
3563
3564 var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
3565
3566 var setToStringTag$2 = function (target, TAG, STATIC) {
3567 if (target && !STATIC) target = target.prototype;
3568 if (target && !hasOwn$1(target, TO_STRING_TAG$1)) {
3569 defineProperty$2(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
3570 }
3571 };
3572
3573 var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
3574 var create = objectCreate;
3575 var createPropertyDescriptor = createPropertyDescriptor$4;
3576 var setToStringTag$1 = setToStringTag$2;
3577 var Iterators$2 = iterators;
3578
3579 var returnThis$1 = function () { return this; };
3580
3581 var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
3582 var TO_STRING_TAG = NAME + ' Iterator';
3583 IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
3584 setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
3585 Iterators$2[TO_STRING_TAG] = returnThis$1;
3586 return IteratorConstructor;
3587 };
3588
3589 var $$5 = _export;
3590 var call$1 = functionCall;
3591 var FunctionName = functionName;
3592 var isCallable = isCallable$j;
3593 var createIteratorConstructor = createIteratorConstructor$1;
3594 var getPrototypeOf = objectGetPrototypeOf;
3595 var setPrototypeOf = objectSetPrototypeOf;
3596 var setToStringTag = setToStringTag$2;
3597 var createNonEnumerableProperty$1 = createNonEnumerableProperty$8;
3598 var defineBuiltIn$1 = defineBuiltIn$8;
3599 var wellKnownSymbol$1 = wellKnownSymbol$j;
3600 var Iterators$1 = iterators;
3601 var IteratorsCore = iteratorsCore;
3602
3603 var PROPER_FUNCTION_NAME = FunctionName.PROPER;
3604 var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
3605 var IteratorPrototype = IteratorsCore.IteratorPrototype;
3606 var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
3607 var ITERATOR$1 = wellKnownSymbol$1('iterator');
3608 var KEYS = 'keys';
3609 var VALUES = 'values';
3610 var ENTRIES = 'entries';
3611
3612 var returnThis = function () { return this; };
3613
3614 var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
3615 createIteratorConstructor(IteratorConstructor, NAME, next);
3616
3617 var getIterationMethod = function (KIND) {
3618 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
3619 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
3620 switch (KIND) {
3621 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
3622 case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
3623 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
3624 } return function () { return new IteratorConstructor(this); };
3625 };
3626
3627 var TO_STRING_TAG = NAME + ' Iterator';
3628 var INCORRECT_VALUES_NAME = false;
3629 var IterablePrototype = Iterable.prototype;
3630 var nativeIterator = IterablePrototype[ITERATOR$1]
3631 || IterablePrototype['@@iterator']
3632 || DEFAULT && IterablePrototype[DEFAULT];
3633 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
3634 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
3635 var CurrentIteratorPrototype, methods, KEY;
3636
3637 // fix native
3638 if (anyNativeIterator) {
3639 CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
3640 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
3641 if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
3642 if (setPrototypeOf) {
3643 setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
3644 } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
3645 defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
3646 }
3647 }
3648 // Set @@toStringTag to native iterators
3649 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
3650 }
3651 }
3652
3653 // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
3654 if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
3655 if (CONFIGURABLE_FUNCTION_NAME) {
3656 createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
3657 } else {
3658 INCORRECT_VALUES_NAME = true;
3659 defaultIterator = function values() { return call$1(nativeIterator, this); };
3660 }
3661 }
3662
3663 // export additional methods
3664 if (DEFAULT) {
3665 methods = {
3666 values: getIterationMethod(VALUES),
3667 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
3668 entries: getIterationMethod(ENTRIES)
3669 };
3670 if (FORCED) for (KEY in methods) {
3671 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
3672 defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
3673 }
3674 } else $$5({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
3675 }
3676
3677 // define iterator
3678 if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
3679 defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
3680 }
3681 Iterators$1[NAME] = defaultIterator;
3682
3683 return methods;
3684 };
3685
3686 var toIndexedObject = toIndexedObject$8;
3687 var addToUnscopables = addToUnscopables$4;
3688 var Iterators = iterators;
3689 var InternalStateModule = internalState;
3690 var defineProperty$1 = objectDefineProperty.f;
3691 var defineIterator = defineIterator$1;
3692 var DESCRIPTORS$1 = descriptors;
3693
3694 var ARRAY_ITERATOR = 'Array Iterator';
3695 var setInternalState = InternalStateModule.set;
3696 var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
3697
3698 // `Array.prototype.entries` method
3699 // https://tc39.es/ecma262/#sec-array.prototype.entries
3700 // `Array.prototype.keys` method
3701 // https://tc39.es/ecma262/#sec-array.prototype.keys
3702 // `Array.prototype.values` method
3703 // https://tc39.es/ecma262/#sec-array.prototype.values
3704 // `Array.prototype[@@iterator]` method
3705 // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
3706 // `CreateArrayIterator` internal method
3707 // https://tc39.es/ecma262/#sec-createarrayiterator
3708 var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
3709 setInternalState(this, {
3710 type: ARRAY_ITERATOR,
3711 target: toIndexedObject(iterated), // target
3712 index: 0, // next index
3713 kind: kind // kind
3714 });
3715 // `%ArrayIteratorPrototype%.next` method
3716 // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
3717 }, function () {
3718 var state = getInternalState(this);
3719 var target = state.target;
3720 var kind = state.kind;
3721 var index = state.index++;
3722 if (!target || index >= target.length) {
3723 state.target = undefined;
3724 return { value: undefined, done: true };
3725 }
3726 if (kind == 'keys') return { value: index, done: false };
3727 if (kind == 'values') return { value: target[index], done: false };
3728 return { value: [index, target[index]], done: false };
3729 }, 'values');
3730
3731 // argumentsList[@@iterator] is %ArrayProto_values%
3732 // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
3733 // https://tc39.es/ecma262/#sec-createmappedargumentsobject
3734 var values = Iterators.Arguments = Iterators.Array;
3735
3736 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3737 addToUnscopables('keys');
3738 addToUnscopables('values');
3739 addToUnscopables('entries');
3740
3741 // V8 ~ Chrome 45- bug
3742 if (DESCRIPTORS$1 && values.name !== 'values') try {
3743 defineProperty$1(values, 'name', { value: 'values' });
3744 } catch (error) { /* empty */ }
3745
3746 var global$2 = global$j;
3747 var DOMIterables = domIterables;
3748 var DOMTokenListPrototype = domTokenListPrototype;
3749 var ArrayIteratorMethods = es_array_iterator;
3750 var createNonEnumerableProperty = createNonEnumerableProperty$8;
3751 var wellKnownSymbol = wellKnownSymbol$j;
3752
3753 var ITERATOR = wellKnownSymbol('iterator');
3754 var TO_STRING_TAG = wellKnownSymbol('toStringTag');
3755 var ArrayValues = ArrayIteratorMethods.values;
3756
3757 var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3758 if (CollectionPrototype) {
3759 // some Chrome versions have non-configurable methods on DOMTokenList
3760 if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
3761 createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
3762 } catch (error) {
3763 CollectionPrototype[ITERATOR] = ArrayValues;
3764 }
3765 if (!CollectionPrototype[TO_STRING_TAG]) {
3766 createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
3767 }
3768 if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
3769 // some Chrome versions have non-configurable methods on DOMTokenList
3770 if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
3771 createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
3772 } catch (error) {
3773 CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
3774 }
3775 }
3776 }
3777 };
3778
3779 for (var COLLECTION_NAME in DOMIterables) {
3780 handlePrototype(global$2[COLLECTION_NAME] && global$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
3781 }
3782
3783 handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
3784
3785 var $$4 = _export;
3786 var toObject$1 = toObject$9;
3787 var toAbsoluteIndex = toAbsoluteIndex$4;
3788 var toIntegerOrInfinity = toIntegerOrInfinity$5;
3789 var lengthOfArrayLike = lengthOfArrayLike$7;
3790 var doesNotExceedSafeInteger = doesNotExceedSafeInteger$2;
3791 var arraySpeciesCreate = arraySpeciesCreate$3;
3792 var createProperty = createProperty$4;
3793 var deletePropertyOrThrow = deletePropertyOrThrow$2;
3794 var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
3795
3796 var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
3797
3798 var max = Math.max;
3799 var min$2 = Math.min;
3800
3801 // `Array.prototype.splice` method
3802 // https://tc39.es/ecma262/#sec-array.prototype.splice
3803 // with adding support of @@species
3804 $$4({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
3805 splice: function splice(start, deleteCount /* , ...items */) {
3806 var O = toObject$1(this);
3807 var len = lengthOfArrayLike(O);
3808 var actualStart = toAbsoluteIndex(start, len);
3809 var argumentsLength = arguments.length;
3810 var insertCount, actualDeleteCount, A, k, from, to;
3811 if (argumentsLength === 0) {
3812 insertCount = actualDeleteCount = 0;
3813 } else if (argumentsLength === 1) {
3814 insertCount = 0;
3815 actualDeleteCount = len - actualStart;
3816 } else {
3817 insertCount = argumentsLength - 2;
3818 actualDeleteCount = min$2(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
3819 }
3820 doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
3821 A = arraySpeciesCreate(O, actualDeleteCount);
3822 for (k = 0; k < actualDeleteCount; k++) {
3823 from = actualStart + k;
3824 if (from in O) createProperty(A, k, O[from]);
3825 }
3826 A.length = actualDeleteCount;
3827 if (insertCount < actualDeleteCount) {
3828 for (k = actualStart; k < len - actualDeleteCount; k++) {
3829 from = k + actualDeleteCount;
3830 to = k + insertCount;
3831 if (from in O) O[to] = O[from];
3832 else deletePropertyOrThrow(O, to);
3833 }
3834 for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
3835 } else if (insertCount > actualDeleteCount) {
3836 for (k = len - actualDeleteCount; k > actualStart; k--) {
3837 from = k + actualDeleteCount - 1;
3838 to = k + insertCount - 1;
3839 if (from in O) O[to] = O[from];
3840 else deletePropertyOrThrow(O, to);
3841 }
3842 }
3843 for (k = 0; k < insertCount; k++) {
3844 O[k + actualStart] = arguments[k + 2];
3845 }
3846 O.length = len - actualDeleteCount + insertCount;
3847 return A;
3848 }
3849 });
3850
3851 var uncurryThis$4 = functionUncurryThis;
3852
3853 // `thisNumberValue` abstract operation
3854 // https://tc39.es/ecma262/#sec-thisnumbervalue
3855 var thisNumberValue$1 = uncurryThis$4(1.0.valueOf);
3856
3857 var DESCRIPTORS = descriptors;
3858 var global$1 = global$j;
3859 var uncurryThis$3 = functionUncurryThis;
3860 var isForced = isForced_1;
3861 var defineBuiltIn = defineBuiltIn$8;
3862 var hasOwn = hasOwnProperty_1;
3863 var inheritIfRequired = inheritIfRequired$2;
3864 var isPrototypeOf = objectIsPrototypeOf;
3865 var isSymbol = isSymbol$3;
3866 var toPrimitive = toPrimitive$2;
3867 var fails$1 = fails$u;
3868 var getOwnPropertyNames = objectGetOwnPropertyNames.f;
3869 var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
3870 var defineProperty = objectDefineProperty.f;
3871 var thisNumberValue = thisNumberValue$1;
3872 var trim = stringTrim.trim;
3873
3874 var NUMBER = 'Number';
3875 var NativeNumber = global$1[NUMBER];
3876 var NumberPrototype = NativeNumber.prototype;
3877 var TypeError$1 = global$1.TypeError;
3878 var arraySlice = uncurryThis$3(''.slice);
3879 var charCodeAt = uncurryThis$3(''.charCodeAt);
3880
3881 // `ToNumeric` abstract operation
3882 // https://tc39.es/ecma262/#sec-tonumeric
3883 var toNumeric = function (value) {
3884 var primValue = toPrimitive(value, 'number');
3885 return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
3886 };
3887
3888 // `ToNumber` abstract operation
3889 // https://tc39.es/ecma262/#sec-tonumber
3890 var toNumber = function (argument) {
3891 var it = toPrimitive(argument, 'number');
3892 var first, third, radix, maxCode, digits, length, index, code;
3893 if (isSymbol(it)) throw TypeError$1('Cannot convert a Symbol value to a number');
3894 if (typeof it == 'string' && it.length > 2) {
3895 it = trim(it);
3896 first = charCodeAt(it, 0);
3897 if (first === 43 || first === 45) {
3898 third = charCodeAt(it, 2);
3899 if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
3900 } else if (first === 48) {
3901 switch (charCodeAt(it, 1)) {
3902 case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
3903 case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
3904 default: return +it;
3905 }
3906 digits = arraySlice(it, 2);
3907 length = digits.length;
3908 for (index = 0; index < length; index++) {
3909 code = charCodeAt(digits, index);
3910 // parseInt parses a string to a first unavailable symbol
3911 // but ToNumber should return NaN if a string contains unavailable symbols
3912 if (code < 48 || code > maxCode) return NaN;
3913 } return parseInt(digits, radix);
3914 }
3915 } return +it;
3916 };
3917
3918 // `Number` constructor
3919 // https://tc39.es/ecma262/#sec-number-constructor
3920 if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
3921 var NumberWrapper = function Number(value) {
3922 var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
3923 var dummy = this;
3924 // check on 1..constructor(foo) case
3925 return isPrototypeOf(NumberPrototype, dummy) && fails$1(function () { thisNumberValue(dummy); })
3926 ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n;
3927 };
3928 for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
3929 // ES3:
3930 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
3931 // ES2015 (in case, if modules with ES2015 Number statics required before):
3932 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
3933 // ESNext
3934 'fromString,range'
3935 ).split(','), j = 0, key; keys.length > j; j++) {
3936 if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) {
3937 defineProperty(NumberWrapper, key, getOwnPropertyDescriptor$2(NativeNumber, key));
3938 }
3939 }
3940 NumberWrapper.prototype = NumberPrototype;
3941 NumberPrototype.constructor = NumberWrapper;
3942 defineBuiltIn(global$1, NUMBER, NumberWrapper, { constructor: true });
3943 }
3944
3945 var $$3 = _export;
3946 var uncurryThis$2 = functionUncurryThis;
3947 var isArray = isArray$4;
3948
3949 var un$Reverse = uncurryThis$2([].reverse);
3950 var test = [1, 2];
3951
3952 // `Array.prototype.reverse` method
3953 // https://tc39.es/ecma262/#sec-array.prototype.reverse
3954 // fix for Safari 12.0 bug
3955 // https://bugs.webkit.org/show_bug.cgi?id=188794
3956 $$3({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
3957 reverse: function reverse() {
3958 // eslint-disable-next-line no-self-assign -- dirty hack
3959 if (isArray(this)) this.length = this.length;
3960 return un$Reverse(this);
3961 }
3962 });
3963
3964 var $$2 = _export;
3965 var toObject = toObject$9;
3966 var nativeKeys = objectKeys$3;
3967 var fails = fails$u;
3968
3969 var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
3970
3971 // `Object.keys` method
3972 // https://tc39.es/ecma262/#sec-object.keys
3973 $$2({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
3974 keys: function keys(it) {
3975 return nativeKeys(toObject(it));
3976 }
3977 });
3978
3979 var call = functionCall;
3980 var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
3981 var anObject = anObject$d;
3982 var toLength$2 = toLength$6;
3983 var toString$2 = toString$f;
3984 var requireObjectCoercible$2 = requireObjectCoercible$b;
3985 var getMethod = getMethod$5;
3986 var advanceStringIndex = advanceStringIndex$3;
3987 var regExpExec = regexpExecAbstract;
3988
3989 // @@match logic
3990 fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
3991 return [
3992 // `String.prototype.match` method
3993 // https://tc39.es/ecma262/#sec-string.prototype.match
3994 function match(regexp) {
3995 var O = requireObjectCoercible$2(this);
3996 var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH);
3997 return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$2(O));
3998 },
3999 // `RegExp.prototype[@@match]` method
4000 // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
4001 function (string) {
4002 var rx = anObject(this);
4003 var S = toString$2(string);
4004 var res = maybeCallNative(nativeMatch, rx, S);
4005
4006 if (res.done) return res.value;
4007
4008 if (!rx.global) return regExpExec(rx, S);
4009
4010 var fullUnicode = rx.unicode;
4011 rx.lastIndex = 0;
4012 var A = [];
4013 var n = 0;
4014 var result;
4015 while ((result = regExpExec(rx, S)) !== null) {
4016 var matchStr = toString$2(result[0]);
4017 A[n] = matchStr;
4018 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$2(rx.lastIndex), fullUnicode);
4019 n++;
4020 }
4021 return n === 0 ? null : A;
4022 }
4023 ];
4024 });
4025
4026 var $$1 = _export;
4027 var uncurryThis$1 = functionUncurryThis;
4028 var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
4029 var toLength$1 = toLength$6;
4030 var toString$1 = toString$f;
4031 var notARegExp$1 = notARegexp;
4032 var requireObjectCoercible$1 = requireObjectCoercible$b;
4033 var correctIsRegExpLogic$1 = correctIsRegexpLogic;
4034
4035 // eslint-disable-next-line es-x/no-string-prototype-startswith -- safe
4036 var un$StartsWith = uncurryThis$1(''.startsWith);
4037 var stringSlice = uncurryThis$1(''.slice);
4038 var min$1 = Math.min;
4039
4040 var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$1('startsWith');
4041 // https://github.com/zloirock/core-js/pull/702
4042 var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
4043 var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'startsWith');
4044 return descriptor && !descriptor.writable;
4045 }();
4046
4047 // `String.prototype.startsWith` method
4048 // https://tc39.es/ecma262/#sec-string.prototype.startswith
4049 $$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
4050 startsWith: function startsWith(searchString /* , position = 0 */) {
4051 var that = toString$1(requireObjectCoercible$1(this));
4052 notARegExp$1(searchString);
4053 var index = toLength$1(min$1(arguments.length > 1 ? arguments[1] : undefined, that.length));
4054 var search = toString$1(searchString);
4055 return un$StartsWith
4056 ? un$StartsWith(that, search, index)
4057 : stringSlice(that, index, index + search.length) === search;
4058 }
4059 });
4060
4061 var $ = _export;
4062 var uncurryThis = functionUncurryThis;
4063 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
4064 var toLength = toLength$6;
4065 var toString = toString$f;
4066 var notARegExp = notARegexp;
4067 var requireObjectCoercible = requireObjectCoercible$b;
4068 var correctIsRegExpLogic = correctIsRegexpLogic;
4069
4070 // eslint-disable-next-line es-x/no-string-prototype-endswith -- safe
4071 var un$EndsWith = uncurryThis(''.endsWith);
4072 var slice = uncurryThis(''.slice);
4073 var min = Math.min;
4074
4075 var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
4076 // https://github.com/zloirock/core-js/pull/702
4077 var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
4078 var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
4079 return descriptor && !descriptor.writable;
4080 }();
4081
4082 // `String.prototype.endsWith` method
4083 // https://tc39.es/ecma262/#sec-string.prototype.endswith
4084 $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
4085 endsWith: function endsWith(searchString /* , endPosition = @length */) {
4086 var that = toString(requireObjectCoercible(this));
4087 notARegExp(searchString);
4088 var endPosition = arguments.length > 1 ? arguments[1] : undefined;
4089 var len = that.length;
4090 var end = endPosition === undefined ? len : min(toLength(endPosition), len);
4091 var search = toString(searchString);
4092 return un$EndsWith
4093 ? un$EndsWith(that, search, end)
4094 : slice(that, end - search.length, end) === search;
4095 }
4096 });
4097
4098 var Utils = {
4099 getBootstrapVersion: function getBootstrapVersion() {
4100 var bootstrapVersion = 5;
4101
4102 try {
4103 var rawVersion = $__default["default"].fn.dropdown.Constructor.VERSION; // Only try to parse VERSION if it is defined.
4104 // It is undefined in older versions of Bootstrap (tested with 3.1.1).
4105
4106 if (rawVersion !== undefined) {
4107 bootstrapVersion = parseInt(rawVersion, 10);
4108 }
4109 } catch (e) {// ignore
4110 }
4111
4112 try {
4113 // eslint-disable-next-line no-undef
4114 var _rawVersion = bootstrap.Tooltip.VERSION;
4115
4116 if (_rawVersion !== undefined) {
4117 bootstrapVersion = parseInt(_rawVersion, 10);
4118 }
4119 } catch (e) {// ignore
4120 }
4121
4122 return bootstrapVersion;
4123 },
4124 getIconsPrefix: function getIconsPrefix(theme) {
4125 return {
4126 bootstrap3: 'glyphicon',
4127 bootstrap4: 'fa',
4128 bootstrap5: 'bi',
4129 'bootstrap-table': 'icon',
4130 bulma: 'fa',
4131 foundation: 'fa',
4132 materialize: 'material-icons',
4133 semantic: 'fa'
4134 }[theme] || 'fa';
4135 },
4136 getIcons: function getIcons(prefix) {
4137 return {
4138 glyphicon: {
4139 paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
4140 paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
4141 refresh: 'glyphicon-refresh icon-refresh',
4142 toggleOff: 'glyphicon-list-alt icon-list-alt',
4143 toggleOn: 'glyphicon-list-alt icon-list-alt',
4144 columns: 'glyphicon-th icon-th',
4145 detailOpen: 'glyphicon-plus icon-plus',
4146 detailClose: 'glyphicon-minus icon-minus',
4147 fullscreen: 'glyphicon-fullscreen',
4148 search: 'glyphicon-search',
4149 clearSearch: 'glyphicon-trash'
4150 },
4151 fa: {
4152 paginationSwitchDown: 'fa-caret-square-down',
4153 paginationSwitchUp: 'fa-caret-square-up',
4154 refresh: 'fa-sync',
4155 toggleOff: 'fa-toggle-off',
4156 toggleOn: 'fa-toggle-on',
4157 columns: 'fa-th-list',
4158 detailOpen: 'fa-plus',
4159 detailClose: 'fa-minus',
4160 fullscreen: 'fa-arrows-alt',
4161 search: 'fa-search',
4162 clearSearch: 'fa-trash'
4163 },
4164 bi: {
4165 paginationSwitchDown: 'bi-caret-down-square',
4166 paginationSwitchUp: 'bi-caret-up-square',
4167 refresh: 'bi-arrow-clockwise',
4168 toggleOff: 'bi-toggle-off',
4169 toggleOn: 'bi-toggle-on',
4170 columns: 'bi-list-ul',
4171 detailOpen: 'bi-plus',
4172 detailClose: 'bi-dash',
4173 fullscreen: 'bi-arrows-move',
4174 search: 'bi-search',
4175 clearSearch: 'bi-trash'
4176 },
4177 icon: {
4178 paginationSwitchDown: 'icon-arrow-up-circle',
4179 paginationSwitchUp: 'icon-arrow-down-circle',
4180 refresh: 'icon-refresh-cw',
4181 toggleOff: 'icon-toggle-right',
4182 toggleOn: 'icon-toggle-right',
4183 columns: 'icon-list',
4184 detailOpen: 'icon-plus',
4185 detailClose: 'icon-minus',
4186 fullscreen: 'icon-maximize',
4187 search: 'icon-search',
4188 clearSearch: 'icon-trash-2'
4189 },
4190 'material-icons': {
4191 paginationSwitchDown: 'grid_on',
4192 paginationSwitchUp: 'grid_off',
4193 refresh: 'refresh',
4194 toggleOff: 'tablet',
4195 toggleOn: 'tablet_android',
4196 columns: 'view_list',
4197 detailOpen: 'add',
4198 detailClose: 'remove',
4199 fullscreen: 'fullscreen',
4200 sort: 'sort',
4201 search: 'search',
4202 clearSearch: 'delete'
4203 }
4204 }[prefix];
4205 },
4206 getSearchInput: function getSearchInput(that) {
4207 if (typeof that.options.searchSelector === 'string') {
4208 return $__default["default"](that.options.searchSelector);
4209 }
4210
4211 return that.$toolbar.find('.search input');
4212 },
4213 // it only does '%s', and return '' when arguments are undefined
4214 sprintf: function sprintf(_str) {
4215 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4216 args[_key - 1] = arguments[_key];
4217 }
4218
4219 var flag = true;
4220 var i = 0;
4221
4222 var str = _str.replace(/%s/g, function () {
4223 var arg = args[i++];
4224
4225 if (typeof arg === 'undefined') {
4226 flag = false;
4227 return '';
4228 }
4229
4230 return arg;
4231 });
4232
4233 return flag ? str : '';
4234 },
4235 isObject: function isObject(val) {
4236 return val instanceof Object && !Array.isArray(val);
4237 },
4238 isEmptyObject: function isEmptyObject() {
4239 var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4240 return Object.entries(obj).length === 0 && obj.constructor === Object;
4241 },
4242 isNumeric: function isNumeric(n) {
4243 return !isNaN(parseFloat(n)) && isFinite(n);
4244 },
4245 getFieldTitle: function getFieldTitle(list, value) {
4246 var _iterator = _createForOfIteratorHelper(list),
4247 _step;
4248
4249 try {
4250 for (_iterator.s(); !(_step = _iterator.n()).done;) {
4251 var item = _step.value;
4252
4253 if (item.field === value) {
4254 return item.title;
4255 }
4256 }
4257 } catch (err) {
4258 _iterator.e(err);
4259 } finally {
4260 _iterator.f();
4261 }
4262
4263 return '';
4264 },
4265 setFieldIndex: function setFieldIndex(columns) {
4266 var totalCol = 0;
4267 var flag = [];
4268
4269 var _iterator2 = _createForOfIteratorHelper(columns[0]),
4270 _step2;
4271
4272 try {
4273 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
4274 var column = _step2.value;
4275 totalCol += column.colspan || 1;
4276 }
4277 } catch (err) {
4278 _iterator2.e(err);
4279 } finally {
4280 _iterator2.f();
4281 }
4282
4283 for (var i = 0; i < columns.length; i++) {
4284 flag[i] = [];
4285
4286 for (var j = 0; j < totalCol; j++) {
4287 flag[i][j] = false;
4288 }
4289 }
4290
4291 for (var _i = 0; _i < columns.length; _i++) {
4292 var _iterator3 = _createForOfIteratorHelper(columns[_i]),
4293 _step3;
4294
4295 try {
4296 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
4297 var r = _step3.value;
4298 var rowspan = r.rowspan || 1;
4299 var colspan = r.colspan || 1;
4300
4301 var index = flag[_i].indexOf(false);
4302
4303 r.colspanIndex = index;
4304
4305 if (colspan === 1) {
4306 r.fieldIndex = index; // when field is undefined, use index instead
4307
4308 if (typeof r.field === 'undefined') {
4309 r.field = index;
4310 }
4311 } else {
4312 r.colspanGroup = r.colspan;
4313 }
4314
4315 for (var _j = 0; _j < rowspan; _j++) {
4316 for (var k = 0; k < colspan; k++) {
4317 flag[_i + _j][index + k] = true;
4318 }
4319 }
4320 }
4321 } catch (err) {
4322 _iterator3.e(err);
4323 } finally {
4324 _iterator3.f();
4325 }
4326 }
4327 },
4328 normalizeAccent: function normalizeAccent(value) {
4329 if (typeof value !== 'string') {
4330 return value;
4331 }
4332
4333 return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
4334 },
4335 updateFieldGroup: function updateFieldGroup(columns, fieldColumns) {
4336 var _ref;
4337
4338 var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
4339
4340 var _iterator4 = _createForOfIteratorHelper(columns),
4341 _step4;
4342
4343 try {
4344 for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
4345 var c = _step4.value;
4346
4347 var _iterator6 = _createForOfIteratorHelper(c),
4348 _step6;
4349
4350 try {
4351 for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
4352 var r = _step6.value;
4353
4354 if (r.colspanGroup > 1) {
4355 var colspan = 0;
4356
4357 var _loop = function _loop(i) {
4358 var column = allColumns.find(function (col) {
4359 return col.fieldIndex === i;
4360 });
4361
4362 if (column.visible) {
4363 colspan++;
4364 }
4365 };
4366
4367 for (var i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
4368 _loop(i);
4369 }
4370
4371 r.colspan = colspan;
4372 r.visible = colspan > 0;
4373 }
4374 }
4375 } catch (err) {
4376 _iterator6.e(err);
4377 } finally {
4378 _iterator6.f();
4379 }
4380 }
4381 } catch (err) {
4382 _iterator4.e(err);
4383 } finally {
4384 _iterator4.f();
4385 }
4386
4387 if (columns.length < 2) {
4388 return;
4389 }
4390
4391 var _iterator5 = _createForOfIteratorHelper(fieldColumns),
4392 _step5;
4393
4394 try {
4395 var _loop2 = function _loop2() {
4396 var column = _step5.value;
4397 var sameColumns = allColumns.filter(function (col) {
4398 return col.fieldIndex === column.fieldIndex;
4399 });
4400
4401 if (sameColumns.length > 1) {
4402 var _iterator7 = _createForOfIteratorHelper(sameColumns),
4403 _step7;
4404
4405 try {
4406 for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
4407 var _c = _step7.value;
4408 _c.visible = column.visible;
4409 }
4410 } catch (err) {
4411 _iterator7.e(err);
4412 } finally {
4413 _iterator7.f();
4414 }
4415 }
4416 };
4417
4418 for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
4419 _loop2();
4420 }
4421 } catch (err) {
4422 _iterator5.e(err);
4423 } finally {
4424 _iterator5.f();
4425 }
4426 },
4427 getScrollBarWidth: function getScrollBarWidth() {
4428 if (this.cachedWidth === undefined) {
4429 var $inner = $__default["default"]('<div/>').addClass('fixed-table-scroll-inner');
4430 var $outer = $__default["default"]('<div/>').addClass('fixed-table-scroll-outer');
4431 $outer.append($inner);
4432 $__default["default"]('body').append($outer);
4433 var w1 = $inner[0].offsetWidth;
4434 $outer.css('overflow', 'scroll');
4435 var w2 = $inner[0].offsetWidth;
4436
4437 if (w1 === w2) {
4438 w2 = $outer[0].clientWidth;
4439 }
4440
4441 $outer.remove();
4442 this.cachedWidth = w1 - w2;
4443 }
4444
4445 return this.cachedWidth;
4446 },
4447 calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
4448 var func = name;
4449
4450 if (typeof name === 'string') {
4451 // support obj.func1.func2
4452 var names = name.split('.');
4453
4454 if (names.length > 1) {
4455 func = window;
4456
4457 var _iterator8 = _createForOfIteratorHelper(names),
4458 _step8;
4459
4460 try {
4461 for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
4462 var f = _step8.value;
4463 func = func[f];
4464 }
4465 } catch (err) {
4466 _iterator8.e(err);
4467 } finally {
4468 _iterator8.f();
4469 }
4470 } else {
4471 func = window[name];
4472 }
4473 }
4474
4475 if (func !== null && _typeof(func) === 'object') {
4476 return func;
4477 }
4478
4479 if (typeof func === 'function') {
4480 return func.apply(self, args || []);
4481 }
4482
4483 if (!func && typeof name === 'string' && args && this.sprintf.apply(this, [name].concat(_toConsumableArray(args)))) {
4484 return this.sprintf.apply(this, [name].concat(_toConsumableArray(args)));
4485 }
4486
4487 return defaultValue;
4488 },
4489 compareObjects: function compareObjects(objectA, objectB, compareLength) {
4490 var aKeys = Object.keys(objectA);
4491 var bKeys = Object.keys(objectB);
4492
4493 if (compareLength && aKeys.length !== bKeys.length) {
4494 return false;
4495 }
4496
4497 for (var _i2 = 0, _aKeys = aKeys; _i2 < _aKeys.length; _i2++) {
4498 var key = _aKeys[_i2];
4499
4500 if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
4501 return false;
4502 }
4503 }
4504
4505 return true;
4506 },
4507 regexCompare: function regexCompare(value, search) {
4508 try {
4509 var regexpParts = search.match(/^\/(.*?)\/([gim]*)$/);
4510
4511 if (value.toString().search(regexpParts ? new RegExp(regexpParts[1], regexpParts[2]) : new RegExp(search, 'gim')) !== -1) {
4512 return true;
4513 }
4514 } catch (e) {
4515 return false;
4516 }
4517
4518 return false;
4519 },
4520 escapeHTML: function escapeHTML(text) {
4521 if (!text) {
4522 return text;
4523 }
4524
4525 return text.toString().replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
4526 },
4527 unescapeHTML: function unescapeHTML(text) {
4528 if (typeof text !== 'string' || !text) {
4529 return text;
4530 }
4531
4532 return text.toString().replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, '\'');
4533 },
4534 removeHTML: function removeHTML(text) {
4535 if (!text) {
4536 return text;
4537 }
4538
4539 return text.toString().replace(/(<([^>]+)>)/ig, '').replace(/&[#A-Za-z0-9]+;/gi, '').trim();
4540 },
4541 getRealDataAttr: function getRealDataAttr(dataAttr) {
4542 for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
4543 var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
4544 attr = _Object$entries$_i[0],
4545 value = _Object$entries$_i[1];
4546
4547 var auxAttr = attr.split(/(?=[A-Z])/).join('-').toLowerCase();
4548
4549 if (auxAttr !== attr) {
4550 dataAttr[auxAttr] = value;
4551 delete dataAttr[attr];
4552 }
4553 }
4554
4555 return dataAttr;
4556 },
4557 getItemField: function getItemField(item, field, escape) {
4558 var columnEscape = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
4559 var value = item; // use column escape if it is defined
4560
4561 if (typeof columnEscape !== 'undefined') {
4562 escape = columnEscape;
4563 }
4564
4565 if (typeof field !== 'string' || item.hasOwnProperty(field)) {
4566 return escape ? this.escapeHTML(item[field]) : item[field];
4567 }
4568
4569 var props = field.split('.');
4570
4571 var _iterator9 = _createForOfIteratorHelper(props),
4572 _step9;
4573
4574 try {
4575 for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
4576 var p = _step9.value;
4577 value = value && value[p];
4578 }
4579 } catch (err) {
4580 _iterator9.e(err);
4581 } finally {
4582 _iterator9.f();
4583 }
4584
4585 return escape ? this.escapeHTML(value) : value;
4586 },
4587 isIEBrowser: function isIEBrowser() {
4588 return navigator.userAgent.includes('MSIE ') || /Trident.*rv:11\./.test(navigator.userAgent);
4589 },
4590 findIndex: function findIndex(items, item) {
4591 var _iterator10 = _createForOfIteratorHelper(items),
4592 _step10;
4593
4594 try {
4595 for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
4596 var it = _step10.value;
4597
4598 if (JSON.stringify(it) === JSON.stringify(item)) {
4599 return items.indexOf(it);
4600 }
4601 }
4602 } catch (err) {
4603 _iterator10.e(err);
4604 } finally {
4605 _iterator10.f();
4606 }
4607
4608 return -1;
4609 },
4610 trToData: function trToData(columns, $els) {
4611 var _this = this;
4612
4613 var data = [];
4614 var m = [];
4615 $els.each(function (y, el) {
4616 var $el = $__default["default"](el);
4617 var row = {}; // save tr's id, class and data-* attributes
4618
4619 row._id = $el.attr('id');
4620 row._class = $el.attr('class');
4621 row._data = _this.getRealDataAttr($el.data());
4622 row._style = $el.attr('style');
4623 $el.find('>td,>th').each(function (_x, el) {
4624 var $el = $__default["default"](el);
4625 var cspan = +$el.attr('colspan') || 1;
4626 var rspan = +$el.attr('rowspan') || 1;
4627 var x = _x; // skip already occupied cells in current row
4628
4629 for (; m[y] && m[y][x]; x++) {// ignore
4630 } // mark matrix elements occupied by current cell with true
4631
4632
4633 for (var tx = x; tx < x + cspan; tx++) {
4634 for (var ty = y; ty < y + rspan; ty++) {
4635 if (!m[ty]) {
4636 // fill missing rows
4637 m[ty] = [];
4638 }
4639
4640 m[ty][tx] = true;
4641 }
4642 }
4643
4644 var field = columns[x].field;
4645 row[field] = $el.html().trim(); // save td's id, class and data-* attributes
4646
4647 row["_".concat(field, "_id")] = $el.attr('id');
4648 row["_".concat(field, "_class")] = $el.attr('class');
4649 row["_".concat(field, "_rowspan")] = $el.attr('rowspan');
4650 row["_".concat(field, "_colspan")] = $el.attr('colspan');
4651 row["_".concat(field, "_title")] = $el.attr('title');
4652 row["_".concat(field, "_data")] = _this.getRealDataAttr($el.data());
4653 row["_".concat(field, "_style")] = $el.attr('style');
4654 });
4655 data.push(row);
4656 });
4657 return data;
4658 },
4659 sort: function sort(a, b, order, options, aPosition, bPosition) {
4660 if (a === undefined || a === null) {
4661 a = '';
4662 }
4663
4664 if (b === undefined || b === null) {
4665 b = '';
4666 }
4667
4668 if (options.sortStable && a === b) {
4669 a = aPosition;
4670 b = bPosition;
4671 } // If both values are numeric, do a numeric comparison
4672
4673
4674 if (this.isNumeric(a) && this.isNumeric(b)) {
4675 // Convert numerical values form string to float.
4676 a = parseFloat(a);
4677 b = parseFloat(b);
4678
4679 if (a < b) {
4680 return order * -1;
4681 }
4682
4683 if (a > b) {
4684 return order;
4685 }
4686
4687 return 0;
4688 }
4689
4690 if (options.sortEmptyLast) {
4691 if (a === '') {
4692 return 1;
4693 }
4694
4695 if (b === '') {
4696 return -1;
4697 }
4698 }
4699
4700 if (a === b) {
4701 return 0;
4702 } // If value is not a string, convert to string
4703
4704
4705 if (typeof a !== 'string') {
4706 a = a.toString();
4707 }
4708
4709 if (a.localeCompare(b) === -1) {
4710 return order * -1;
4711 }
4712
4713 return order;
4714 },
4715 getEventName: function getEventName(eventPrefix) {
4716 var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4717 id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
4718 return "".concat(eventPrefix, "-").concat(id);
4719 },
4720 hasDetailViewIcon: function hasDetailViewIcon(options) {
4721 return options.detailView && options.detailViewIcon && !options.cardView;
4722 },
4723 getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
4724 return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
4725 },
4726 checkAutoMergeCells: function checkAutoMergeCells(data) {
4727 var _iterator11 = _createForOfIteratorHelper(data),
4728 _step11;
4729
4730 try {
4731 for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
4732 var row = _step11.value;
4733
4734 for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
4735 var key = _Object$keys[_i4];
4736
4737 if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
4738 return true;
4739 }
4740 }
4741 }
4742 } catch (err) {
4743 _iterator11.e(err);
4744 } finally {
4745 _iterator11.f();
4746 }
4747
4748 return false;
4749 },
4750 deepCopy: function deepCopy(arg) {
4751 if (arg === undefined) {
4752 return arg;
4753 }
4754
4755 return $__default["default"].extend(true, Array.isArray(arg) ? [] : {}, arg);
4756 },
4757 debounce: function debounce(func, wait, immediate) {
4758 var timeout;
4759 return function executedFunction() {
4760 var context = this;
4761 var args = arguments;
4762
4763 var later = function later() {
4764 timeout = null;
4765 if (!immediate) func.apply(context, args);
4766 };
4767
4768 var callNow = immediate && !timeout;
4769 clearTimeout(timeout);
4770 timeout = setTimeout(later, wait);
4771 if (callNow) func.apply(context, args);
4772 };
4773 }
4774 };
4775
4776 var VERSION = '1.21.1';
4777 var bootstrapVersion = Utils.getBootstrapVersion();
4778 var CONSTANTS = {
4779 3: {
4780 classes: {
4781 buttonsPrefix: 'btn',
4782 buttons: 'default',
4783 buttonsGroup: 'btn-group',
4784 buttonsDropdown: 'btn-group',
4785 pull: 'pull',
4786 inputGroup: 'input-group',
4787 inputPrefix: 'input-',
4788 input: 'form-control',
4789 select: 'form-control',
4790 paginationDropdown: 'btn-group dropdown',
4791 dropup: 'dropup',
4792 dropdownActive: 'active',
4793 paginationActive: 'active',
4794 buttonActive: 'active'
4795 },
4796 html: {
4797 toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
4798 toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
4799 toolbarDropdownSeparator: '<li class="divider"></li>',
4800 pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
4801 pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
4802 dropdownCaret: '<span class="caret"></span>',
4803 pagination: ['<ul class="pagination%s">', '</ul>'],
4804 paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
4805 icon: '<i class="%s %s"></i>',
4806 inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
4807 searchInput: '<input class="%s%s" type="text" placeholder="%s">',
4808 searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
4809 searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
4810 }
4811 },
4812 4: {
4813 classes: {
4814 buttonsPrefix: 'btn',
4815 buttons: 'secondary',
4816 buttonsGroup: 'btn-group',
4817 buttonsDropdown: 'btn-group',
4818 pull: 'float',
4819 inputGroup: 'btn-group',
4820 inputPrefix: 'form-control-',
4821 input: 'form-control',
4822 select: 'form-control',
4823 paginationDropdown: 'btn-group dropdown',
4824 dropup: 'dropup',
4825 dropdownActive: 'active',
4826 paginationActive: 'active',
4827 buttonActive: 'active'
4828 },
4829 html: {
4830 toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
4831 toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
4832 pageDropdown: ['<div class="dropdown-menu">', '</div>'],
4833 pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
4834 toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
4835 dropdownCaret: '<span class="caret"></span>',
4836 pagination: ['<ul class="pagination%s">', '</ul>'],
4837 paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
4838 icon: '<i class="%s %s"></i>',
4839 inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
4840 searchInput: '<input class="%s%s" type="text" placeholder="%s">',
4841 searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
4842 searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
4843 }
4844 },
4845 5: {
4846 classes: {
4847 buttonsPrefix: 'btn',
4848 buttons: 'secondary',
4849 buttonsGroup: 'btn-group',
4850 buttonsDropdown: 'btn-group',
4851 pull: 'float',
4852 inputGroup: 'btn-group',
4853 inputPrefix: 'form-control-',
4854 input: 'form-control',
4855 select: 'form-select',
4856 paginationDropdown: 'btn-group dropdown',
4857 dropup: 'dropup',
4858 dropdownActive: 'active',
4859 paginationActive: 'active',
4860 buttonActive: 'active'
4861 },
4862 html: {
4863 dataToggle: 'data-bs-toggle',
4864 toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
4865 toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
4866 pageDropdown: ['<div class="dropdown-menu">', '</div>'],
4867 pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
4868 toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
4869 dropdownCaret: '<span class="caret"></span>',
4870 pagination: ['<ul class="pagination%s">', '</ul>'],
4871 paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
4872 icon: '<i class="%s %s"></i>',
4873 inputGroup: '<div class="input-group">%s%s</div>',
4874 searchInput: '<input class="%s%s" type="text" placeholder="%s">',
4875 searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
4876 searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
4877 }
4878 }
4879 }[bootstrapVersion];
4880 var DEFAULTS = {
4881 height: undefined,
4882 classes: 'table table-bordered table-hover',
4883 buttons: {},
4884 theadClasses: '',
4885 headerStyle: function headerStyle(column) {
4886 return {};
4887 },
4888 rowStyle: function rowStyle(row, index) {
4889 return {};
4890 },
4891 rowAttributes: function rowAttributes(row, index) {
4892 return {};
4893 },
4894 undefinedText: '-',
4895 locale: undefined,
4896 virtualScroll: false,
4897 virtualScrollItemHeight: undefined,
4898 sortable: true,
4899 sortClass: undefined,
4900 silentSort: true,
4901 sortEmptyLast: false,
4902 sortName: undefined,
4903 sortOrder: undefined,
4904 sortReset: false,
4905 sortStable: false,
4906 rememberOrder: false,
4907 serverSort: true,
4908 customSort: undefined,
4909 columns: [[]],
4910 data: [],
4911 url: undefined,
4912 method: 'get',
4913 cache: true,
4914 contentType: 'application/json',
4915 dataType: 'json',
4916 ajax: undefined,
4917 ajaxOptions: {},
4918 queryParams: function queryParams(params) {
4919 return params;
4920 },
4921 queryParamsType: 'limit',
4922 // 'limit', undefined
4923 responseHandler: function responseHandler(res) {
4924 return res;
4925 },
4926 totalField: 'total',
4927 totalNotFilteredField: 'totalNotFiltered',
4928 dataField: 'rows',
4929 footerField: 'footer',
4930 pagination: false,
4931 paginationParts: ['pageInfo', 'pageSize', 'pageList'],
4932 showExtendedPagination: false,
4933 paginationLoop: true,
4934 sidePagination: 'client',
4935 // client or server
4936 totalRows: 0,
4937 totalNotFiltered: 0,
4938 pageNumber: 1,
4939 pageSize: 10,
4940 pageList: [10, 25, 50, 100],
4941 paginationHAlign: 'right',
4942 // right, left
4943 paginationVAlign: 'bottom',
4944 // bottom, top, both
4945 paginationDetailHAlign: 'left',
4946 // right, left
4947 paginationPreText: '&lsaquo;',
4948 paginationNextText: '&rsaquo;',
4949 paginationSuccessivelySize: 5,
4950 // Maximum successively number of pages in a row
4951 paginationPagesBySide: 1,
4952 // Number of pages on each side (right, left) of the current page.
4953 paginationUseIntermediate: false,
4954 // Calculate intermediate pages for quick access
4955 search: false,
4956 searchHighlight: false,
4957 searchOnEnterKey: false,
4958 strictSearch: false,
4959 regexSearch: false,
4960 searchSelector: false,
4961 visibleSearch: false,
4962 showButtonIcons: true,
4963 showButtonText: false,
4964 showSearchButton: false,
4965 showSearchClearButton: false,
4966 trimOnSearch: true,
4967 searchAlign: 'right',
4968 searchTimeOut: 500,
4969 searchText: '',
4970 customSearch: undefined,
4971 showHeader: true,
4972 showFooter: false,
4973 footerStyle: function footerStyle(column) {
4974 return {};
4975 },
4976 searchAccentNeutralise: false,
4977 showColumns: false,
4978 showColumnsToggleAll: false,
4979 showColumnsSearch: false,
4980 minimumCountColumns: 1,
4981 showPaginationSwitch: false,
4982 showRefresh: false,
4983 showToggle: false,
4984 showFullscreen: false,
4985 smartDisplay: true,
4986 escape: false,
4987 filterOptions: {
4988 filterAlgorithm: 'and'
4989 },
4990 idField: undefined,
4991 selectItemName: 'btSelectItem',
4992 clickToSelect: false,
4993 ignoreClickToSelectOn: function ignoreClickToSelectOn(_ref) {
4994 var tagName = _ref.tagName;
4995 return ['A', 'BUTTON'].includes(tagName);
4996 },
4997 singleSelect: false,
4998 checkboxHeader: true,
4999 maintainMetaData: false,
5000 multipleSelectRow: false,
5001 uniqueId: undefined,
5002 cardView: false,
5003 detailView: false,
5004 detailViewIcon: true,
5005 detailViewByClick: false,
5006 detailViewAlign: 'left',
5007 detailFormatter: function detailFormatter(index, row) {
5008 return '';
5009 },
5010 detailFilter: function detailFilter(index, row) {
5011 return true;
5012 },
5013 toolbar: undefined,
5014 toolbarAlign: 'left',
5015 buttonsToolbar: undefined,
5016 buttonsAlign: 'right',
5017 buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
5018 buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
5019 buttonsClass: CONSTANTS.classes.buttons,
5020 iconsPrefix: undefined,
5021 // init in initConstants
5022 icons: {},
5023 // init in initConstants
5024 iconSize: undefined,
5025 loadingFontSize: 'auto',
5026 loadingTemplate: function loadingTemplate(loadingMessage) {
5027 return "<span class=\"loading-wrap\">\n <span class=\"loading-text\">".concat(loadingMessage, "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n ");
5028 },
5029 onAll: function onAll(name, args) {
5030 return false;
5031 },
5032 onClickCell: function onClickCell(field, value, row, $element) {
5033 return false;
5034 },
5035 onDblClickCell: function onDblClickCell(field, value, row, $element) {
5036 return false;
5037 },
5038 onClickRow: function onClickRow(item, $element) {
5039 return false;
5040 },
5041 onDblClickRow: function onDblClickRow(item, $element) {
5042 return false;
5043 },
5044 onSort: function onSort(name, order) {
5045 return false;
5046 },
5047 onCheck: function onCheck(row) {
5048 return false;
5049 },
5050 onUncheck: function onUncheck(row) {
5051 return false;
5052 },
5053 onCheckAll: function onCheckAll(rows) {
5054 return false;
5055 },
5056 onUncheckAll: function onUncheckAll(rows) {
5057 return false;
5058 },
5059 onCheckSome: function onCheckSome(rows) {
5060 return false;
5061 },
5062 onUncheckSome: function onUncheckSome(rows) {
5063 return false;
5064 },
5065 onLoadSuccess: function onLoadSuccess(data) {
5066 return false;
5067 },
5068 onLoadError: function onLoadError(status) {
5069 return false;
5070 },
5071 onColumnSwitch: function onColumnSwitch(field, checked) {
5072 return false;
5073 },
5074 onColumnSwitchAll: function onColumnSwitchAll(checked) {
5075 return false;
5076 },
5077 onPageChange: function onPageChange(number, size) {
5078 return false;
5079 },
5080 onSearch: function onSearch(text) {
5081 return false;
5082 },
5083 onToggle: function onToggle(cardView) {
5084 return false;
5085 },
5086 onPreBody: function onPreBody(data) {
5087 return false;
5088 },
5089 onPostBody: function onPostBody() {
5090 return false;
5091 },
5092 onPostHeader: function onPostHeader() {
5093 return false;
5094 },
5095 onPostFooter: function onPostFooter() {
5096 return false;
5097 },
5098 onExpandRow: function onExpandRow(index, row, $detail) {
5099 return false;
5100 },
5101 onCollapseRow: function onCollapseRow(index, row) {
5102 return false;
5103 },
5104 onRefreshOptions: function onRefreshOptions(options) {
5105 return false;
5106 },
5107 onRefresh: function onRefresh(params) {
5108 return false;
5109 },
5110 onResetView: function onResetView() {
5111 return false;
5112 },
5113 onScrollBody: function onScrollBody() {
5114 return false;
5115 },
5116 onTogglePagination: function onTogglePagination(newState) {
5117 return false;
5118 },
5119 onVirtualScroll: function onVirtualScroll(startIndex, endIndex) {
5120 return false;
5121 }
5122 };
5123 var EN = {
5124 formatLoadingMessage: function formatLoadingMessage() {
5125 return 'Loading, please wait';
5126 },
5127 formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
5128 return "".concat(pageNumber, " rows per page");
5129 },
5130 formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows, totalNotFiltered) {
5131 if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
5132 return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows (filtered from ").concat(totalNotFiltered, " total rows)");
5133 }
5134
5135 return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows");
5136 },
5137 formatSRPaginationPreText: function formatSRPaginationPreText() {
5138 return 'previous page';
5139 },
5140 formatSRPaginationPageText: function formatSRPaginationPageText(page) {
5141 return "to page ".concat(page);
5142 },
5143 formatSRPaginationNextText: function formatSRPaginationNextText() {
5144 return 'next page';
5145 },
5146 formatDetailPagination: function formatDetailPagination(totalRows) {
5147 return "Showing ".concat(totalRows, " rows");
5148 },
5149 formatSearch: function formatSearch() {
5150 return 'Search';
5151 },
5152 formatClearSearch: function formatClearSearch() {
5153 return 'Clear Search';
5154 },
5155 formatNoMatches: function formatNoMatches() {
5156 return 'No matching records found';
5157 },
5158 formatPaginationSwitch: function formatPaginationSwitch() {
5159 return 'Hide/Show pagination';
5160 },
5161 formatPaginationSwitchDown: function formatPaginationSwitchDown() {
5162 return 'Show pagination';
5163 },
5164 formatPaginationSwitchUp: function formatPaginationSwitchUp() {
5165 return 'Hide pagination';
5166 },
5167 formatRefresh: function formatRefresh() {
5168 return 'Refresh';
5169 },
5170 formatToggleOn: function formatToggleOn() {
5171 return 'Show card view';
5172 },
5173 formatToggleOff: function formatToggleOff() {
5174 return 'Hide card view';
5175 },
5176 formatColumns: function formatColumns() {
5177 return 'Columns';
5178 },
5179 formatColumnsToggleAll: function formatColumnsToggleAll() {
5180 return 'Toggle all';
5181 },
5182 formatFullscreen: function formatFullscreen() {
5183 return 'Fullscreen';
5184 },
5185 formatAllRows: function formatAllRows() {
5186 return 'All';
5187 }
5188 };
5189 var COLUMN_DEFAULTS = {
5190 field: undefined,
5191 title: undefined,
5192 titleTooltip: undefined,
5193 class: undefined,
5194 width: undefined,
5195 widthUnit: 'px',
5196 rowspan: undefined,
5197 colspan: undefined,
5198 align: undefined,
5199 // left, right, center
5200 halign: undefined,
5201 // left, right, center
5202 falign: undefined,
5203 // left, right, center
5204 valign: undefined,
5205 // top, middle, bottom
5206 cellStyle: undefined,
5207 radio: false,
5208 checkbox: false,
5209 checkboxEnabled: true,
5210 clickToSelect: true,
5211 showSelectTitle: false,
5212 sortable: false,
5213 sortName: undefined,
5214 order: 'asc',
5215 // asc, desc
5216 sorter: undefined,
5217 visible: true,
5218 switchable: true,
5219 cardVisible: true,
5220 searchable: true,
5221 formatter: undefined,
5222 footerFormatter: undefined,
5223 detailFormatter: undefined,
5224 searchFormatter: true,
5225 searchHighlightFormatter: false,
5226 escape: undefined,
5227 events: undefined
5228 };
5229 var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandRowByUniqueId', 'collapseRowByUniqueId', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
5230 var EVENTS = {
5231 'all.bs.table': 'onAll',
5232 'click-row.bs.table': 'onClickRow',
5233 'dbl-click-row.bs.table': 'onDblClickRow',
5234 'click-cell.bs.table': 'onClickCell',
5235 'dbl-click-cell.bs.table': 'onDblClickCell',
5236 'sort.bs.table': 'onSort',
5237 'check.bs.table': 'onCheck',
5238 'uncheck.bs.table': 'onUncheck',
5239 'check-all.bs.table': 'onCheckAll',
5240 'uncheck-all.bs.table': 'onUncheckAll',
5241 'check-some.bs.table': 'onCheckSome',
5242 'uncheck-some.bs.table': 'onUncheckSome',
5243 'load-success.bs.table': 'onLoadSuccess',
5244 'load-error.bs.table': 'onLoadError',
5245 'column-switch.bs.table': 'onColumnSwitch',
5246 'column-switch-all.bs.table': 'onColumnSwitchAll',
5247 'page-change.bs.table': 'onPageChange',
5248 'search.bs.table': 'onSearch',
5249 'toggle.bs.table': 'onToggle',
5250 'pre-body.bs.table': 'onPreBody',
5251 'post-body.bs.table': 'onPostBody',
5252 'post-header.bs.table': 'onPostHeader',
5253 'post-footer.bs.table': 'onPostFooter',
5254 'expand-row.bs.table': 'onExpandRow',
5255 'collapse-row.bs.table': 'onCollapseRow',
5256 'refresh-options.bs.table': 'onRefreshOptions',
5257 'reset-view.bs.table': 'onResetView',
5258 'refresh.bs.table': 'onRefresh',
5259 'scroll-body.bs.table': 'onScrollBody',
5260 'toggle-pagination.bs.table': 'onTogglePagination',
5261 'virtual-scroll.bs.table': 'onVirtualScroll'
5262 };
5263 Object.assign(DEFAULTS, EN);
5264 var Constants = {
5265 VERSION: VERSION,
5266 THEME: "bootstrap".concat(bootstrapVersion),
5267 CONSTANTS: CONSTANTS,
5268 DEFAULTS: DEFAULTS,
5269 COLUMN_DEFAULTS: COLUMN_DEFAULTS,
5270 METHODS: METHODS,
5271 EVENTS: EVENTS,
5272 LOCALES: {
5273 en: EN,
5274 'en-US': EN
5275 }
5276 };
5277
5278 var BLOCK_ROWS = 50;
5279 var CLUSTER_BLOCKS = 4;
5280
5281 var VirtualScroll = /*#__PURE__*/function () {
5282 function VirtualScroll(options) {
5283 var _this = this;
5284
5285 _classCallCheck(this, VirtualScroll);
5286
5287 this.rows = options.rows;
5288 this.scrollEl = options.scrollEl;
5289 this.contentEl = options.contentEl;
5290 this.callback = options.callback;
5291 this.itemHeight = options.itemHeight;
5292 this.cache = {};
5293 this.scrollTop = this.scrollEl.scrollTop;
5294 this.initDOM(this.rows, options.fixedScroll);
5295 this.scrollEl.scrollTop = this.scrollTop;
5296 this.lastCluster = 0;
5297
5298 var onScroll = function onScroll() {
5299 if (_this.lastCluster !== (_this.lastCluster = _this.getNum())) {
5300 _this.initDOM(_this.rows);
5301
5302 _this.callback(_this.startIndex, _this.endIndex);
5303 }
5304 };
5305
5306 this.scrollEl.addEventListener('scroll', onScroll, false);
5307
5308 this.destroy = function () {
5309 _this.contentEl.innerHtml = '';
5310
5311 _this.scrollEl.removeEventListener('scroll', onScroll, false);
5312 };
5313 }
5314
5315 _createClass(VirtualScroll, [{
5316 key: "initDOM",
5317 value: function initDOM(rows, fixedScroll) {
5318 if (typeof this.clusterHeight === 'undefined') {
5319 this.cache.scrollTop = this.scrollEl.scrollTop;
5320 this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
5321 this.getRowsHeight(rows);
5322 }
5323
5324 var data = this.initData(rows, this.getNum(fixedScroll));
5325 var thisRows = data.rows.join('');
5326 var dataChanged = this.checkChanges('data', thisRows);
5327 var topOffsetChanged = this.checkChanges('top', data.topOffset);
5328 var bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);
5329 var html = [];
5330
5331 if (dataChanged && topOffsetChanged) {
5332 if (data.topOffset) {
5333 html.push(this.getExtra('top', data.topOffset));
5334 }
5335
5336 html.push(thisRows);
5337
5338 if (data.bottomOffset) {
5339 html.push(this.getExtra('bottom', data.bottomOffset));
5340 }
5341
5342 this.startIndex = data.start;
5343 this.endIndex = data.end;
5344 this.contentEl.innerHTML = html.join('');
5345
5346 if (fixedScroll) {
5347 this.contentEl.scrollTop = this.cache.scrollTop;
5348 }
5349 } else if (bottomOffsetChanged) {
5350 this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
5351 }
5352 }
5353 }, {
5354 key: "getRowsHeight",
5355 value: function getRowsHeight() {
5356 if (typeof this.itemHeight === 'undefined') {
5357 var nodes = this.contentEl.children;
5358 var node = nodes[Math.floor(nodes.length / 2)];
5359 this.itemHeight = node.offsetHeight;
5360 }
5361
5362 this.blockHeight = this.itemHeight * BLOCK_ROWS;
5363 this.clusterRows = BLOCK_ROWS * CLUSTER_BLOCKS;
5364 this.clusterHeight = this.blockHeight * CLUSTER_BLOCKS;
5365 }
5366 }, {
5367 key: "getNum",
5368 value: function getNum(fixedScroll) {
5369 this.scrollTop = fixedScroll ? this.cache.scrollTop : this.scrollEl.scrollTop;
5370 return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
5371 }
5372 }, {
5373 key: "initData",
5374 value: function initData(rows, num) {
5375 if (rows.length < BLOCK_ROWS) {
5376 return {
5377 topOffset: 0,
5378 bottomOffset: 0,
5379 rowsAbove: 0,
5380 rows: rows
5381 };
5382 }
5383
5384 var start = Math.max((this.clusterRows - BLOCK_ROWS) * num, 0);
5385 var end = start + this.clusterRows;
5386 var topOffset = Math.max(start * this.itemHeight, 0);
5387 var bottomOffset = Math.max((rows.length - end) * this.itemHeight, 0);
5388 var thisRows = [];
5389 var rowsAbove = start;
5390
5391 if (topOffset < 1) {
5392 rowsAbove++;
5393 }
5394
5395 for (var i = start; i < end; i++) {
5396 rows[i] && thisRows.push(rows[i]);
5397 }
5398
5399 return {
5400 start: start,
5401 end: end,
5402 topOffset: topOffset,
5403 bottomOffset: bottomOffset,
5404 rowsAbove: rowsAbove,
5405 rows: thisRows
5406 };
5407 }
5408 }, {
5409 key: "checkChanges",
5410 value: function checkChanges(type, value) {
5411 var changed = value !== this.cache[type];
5412 this.cache[type] = value;
5413 return changed;
5414 }
5415 }, {
5416 key: "getExtra",
5417 value: function getExtra(className, height) {
5418 var tag = document.createElement('tr');
5419 tag.className = "virtual-scroll-".concat(className);
5420
5421 if (height) {
5422 tag.style.height = "".concat(height, "px");
5423 }
5424
5425 return tag.outerHTML;
5426 }
5427 }]);
5428
5429 return VirtualScroll;
5430 }();
5431
5432 var BootstrapTable = /*#__PURE__*/function () {
5433 function BootstrapTable(el, options) {
5434 _classCallCheck(this, BootstrapTable);
5435
5436 this.options = options;
5437 this.$el = $__default["default"](el);
5438 this.$el_ = this.$el.clone();
5439 this.timeoutId_ = 0;
5440 this.timeoutFooter_ = 0;
5441 }
5442
5443 _createClass(BootstrapTable, [{
5444 key: "init",
5445 value: function init() {
5446 this.initConstants();
5447 this.initLocale();
5448 this.initContainer();
5449 this.initTable();
5450 this.initHeader();
5451 this.initData();
5452 this.initHiddenRows();
5453 this.initToolbar();
5454 this.initPagination();
5455 this.initBody();
5456 this.initSearchText();
5457 this.initServer();
5458 }
5459 }, {
5460 key: "initConstants",
5461 value: function initConstants() {
5462 var opts = this.options;
5463 this.constants = Constants.CONSTANTS;
5464 this.constants.theme = $__default["default"].fn.bootstrapTable.theme;
5465 this.constants.dataToggle = this.constants.html.dataToggle || 'data-toggle'; // init iconsPrefix and icons
5466
5467 var iconsPrefix = Utils.getIconsPrefix($__default["default"].fn.bootstrapTable.theme);
5468 var icons = Utils.getIcons(iconsPrefix);
5469
5470 if (typeof opts.icons === 'string') {
5471 opts.icons = Utils.calculateObjectValue(null, opts.icons);
5472 }
5473
5474 opts.iconsPrefix = opts.iconsPrefix || $__default["default"].fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix;
5475 opts.icons = Object.assign(icons, $__default["default"].fn.bootstrapTable.defaults.icons, opts.icons); // init buttons class
5476
5477 var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
5478 this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
5479 this.buttons = Utils.calculateObjectValue(this, opts.buttons, [], {});
5480
5481 if (_typeof(this.buttons) !== 'object') {
5482 this.buttons = {};
5483 }
5484 }
5485 }, {
5486 key: "initLocale",
5487 value: function initLocale() {
5488 if (this.options.locale) {
5489 var locales = $__default["default"].fn.bootstrapTable.locales;
5490 var parts = this.options.locale.split(/-|_/);
5491 parts[0] = parts[0].toLowerCase();
5492
5493 if (parts[1]) {
5494 parts[1] = parts[1].toUpperCase();
5495 }
5496
5497 var localesToExtend = {};
5498
5499 if (locales[this.options.locale]) {
5500 localesToExtend = locales[this.options.locale];
5501 } else if (locales[parts.join('-')]) {
5502 localesToExtend = locales[parts.join('-')];
5503 } else if (locales[parts[0]]) {
5504 localesToExtend = locales[parts[0]];
5505 }
5506
5507 for (var _i = 0, _Object$entries = Object.entries(localesToExtend); _i < _Object$entries.length; _i++) {
5508 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
5509 formatName = _Object$entries$_i[0],
5510 func = _Object$entries$_i[1];
5511
5512 if (this.options[formatName] !== BootstrapTable.DEFAULTS[formatName]) {
5513 continue;
5514 }
5515
5516 this.options[formatName] = func;
5517 }
5518 }
5519 }
5520 }, {
5521 key: "initContainer",
5522 value: function initContainer() {
5523 var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
5524 var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
5525 var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
5526 this.$container = $__default["default"]("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n ").concat(loadingTemplate, "\n </div>\n </div>\n <div class=\"fixed-table-footer\"></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
5527 this.$container.insertAfter(this.$el);
5528 this.$tableContainer = this.$container.find('.fixed-table-container');
5529 this.$tableHeader = this.$container.find('.fixed-table-header');
5530 this.$tableBody = this.$container.find('.fixed-table-body');
5531 this.$tableLoading = this.$container.find('.fixed-table-loading');
5532 this.$tableFooter = this.$el.find('tfoot'); // checking if custom table-toolbar exists or not
5533
5534 if (this.options.buttonsToolbar) {
5535 this.$toolbar = $__default["default"]('body').find(this.options.buttonsToolbar);
5536 } else {
5537 this.$toolbar = this.$container.find('.fixed-table-toolbar');
5538 }
5539
5540 this.$pagination = this.$container.find('.fixed-table-pagination');
5541 this.$tableBody.append(this.$el);
5542 this.$container.after('<div class="clearfix"></div>');
5543 this.$el.addClass(this.options.classes);
5544 this.$tableLoading.addClass(this.options.classes);
5545
5546 if (this.options.height) {
5547 this.$tableContainer.addClass('fixed-height');
5548
5549 if (this.options.showFooter) {
5550 this.$tableContainer.addClass('has-footer');
5551 }
5552
5553 if (this.options.classes.split(' ').includes('table-bordered')) {
5554 this.$tableBody.append('<div class="fixed-table-border"></div>');
5555 this.$tableBorder = this.$tableBody.find('.fixed-table-border');
5556 this.$tableLoading.addClass('fixed-table-border');
5557 }
5558
5559 this.$tableFooter = this.$container.find('.fixed-table-footer');
5560 }
5561 }
5562 }, {
5563 key: "initTable",
5564 value: function initTable() {
5565 var _this = this;
5566
5567 var columns = [];
5568 this.$header = this.$el.find('>thead');
5569
5570 if (!this.$header.length) {
5571 this.$header = $__default["default"]("<thead class=\"".concat(this.options.theadClasses, "\"></thead>")).appendTo(this.$el);
5572 } else if (this.options.theadClasses) {
5573 this.$header.addClass(this.options.theadClasses);
5574 }
5575
5576 this._headerTrClasses = [];
5577 this._headerTrStyles = [];
5578 this.$header.find('tr').each(function (i, el) {
5579 var $tr = $__default["default"](el);
5580 var column = [];
5581 $tr.find('th').each(function (i, el) {
5582 var $th = $__default["default"](el); // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
5583
5584 if (typeof $th.data('field') !== 'undefined') {
5585 $th.data('field', "".concat($th.data('field')));
5586 }
5587
5588 column.push($__default["default"].extend({}, {
5589 title: $th.html(),
5590 class: $th.attr('class'),
5591 titleTooltip: $th.attr('title'),
5592 rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
5593 colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
5594 }, $th.data()));
5595 });
5596 columns.push(column);
5597
5598 if ($tr.attr('class')) {
5599 _this._headerTrClasses.push($tr.attr('class'));
5600 }
5601
5602 if ($tr.attr('style')) {
5603 _this._headerTrStyles.push($tr.attr('style'));
5604 }
5605 });
5606
5607 if (!Array.isArray(this.options.columns[0])) {
5608 this.options.columns = [this.options.columns];
5609 }
5610
5611 this.options.columns = $__default["default"].extend(true, [], columns, this.options.columns);
5612 this.columns = [];
5613 this.fieldsColumnsIndex = [];
5614 Utils.setFieldIndex(this.options.columns);
5615 this.options.columns.forEach(function (columns, i) {
5616 columns.forEach(function (_column, j) {
5617 var column = $__default["default"].extend({}, BootstrapTable.COLUMN_DEFAULTS, _column, {
5618 passed: _column
5619 });
5620
5621 if (typeof column.fieldIndex !== 'undefined') {
5622 _this.columns[column.fieldIndex] = column;
5623 _this.fieldsColumnsIndex[column.field] = column.fieldIndex;
5624 }
5625
5626 _this.options.columns[i][j] = column;
5627 });
5628 }); // if options.data is setting, do not process tbody and tfoot data
5629
5630 if (!this.options.data.length) {
5631 var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
5632
5633 if (htmlData.length) {
5634 this.options.data = htmlData;
5635 this.fromHtml = true;
5636 }
5637 }
5638
5639 if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
5640 this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
5641 }
5642
5643 if (this.footerData) {
5644 this.$el.find('tfoot').html('<tr></tr>');
5645 }
5646
5647 if (!this.options.showFooter || this.options.cardView) {
5648 this.$tableFooter.hide();
5649 } else {
5650 this.$tableFooter.show();
5651 }
5652 }
5653 }, {
5654 key: "initHeader",
5655 value: function initHeader() {
5656 var _this2 = this;
5657
5658 var visibleColumns = {};
5659 var headerHtml = [];
5660 this.header = {
5661 fields: [],
5662 styles: [],
5663 classes: [],
5664 formatters: [],
5665 detailFormatters: [],
5666 events: [],
5667 sorters: [],
5668 sortNames: [],
5669 cellStyles: [],
5670 searchables: []
5671 };
5672 Utils.updateFieldGroup(this.options.columns, this.columns);
5673 this.options.columns.forEach(function (columns, i) {
5674 var html = [];
5675 html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
5676 var detailViewTemplate = '';
5677
5678 if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
5679 var rowspan = _this2.options.columns.length > 1 ? " rowspan=\"".concat(_this2.options.columns.length, "\"") : '';
5680 detailViewTemplate = "<th class=\"detail\"".concat(rowspan, ">\n <div class=\"fht-cell\"></div>\n </th>");
5681 }
5682
5683 if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
5684 html.push(detailViewTemplate);
5685 }
5686
5687 columns.forEach(function (column, j) {
5688 var class_ = Utils.sprintf(' class="%s"', column['class']);
5689 var unitWidth = column.widthUnit;
5690 var width = parseFloat(column.width);
5691 var columnHalign = column.halign ? column.halign : column.align;
5692 var halign = Utils.sprintf('text-align: %s; ', columnHalign);
5693 var align = Utils.sprintf('text-align: %s; ', column.align);
5694 var style = Utils.sprintf('vertical-align: %s; ', column.valign);
5695 style += Utils.sprintf('width: %s; ', (column.checkbox || column.radio) && !width ? !column.showSelectTitle ? '36px' : undefined : width ? width + unitWidth : undefined);
5696
5697 if (typeof column.fieldIndex === 'undefined' && !column.visible) {
5698 return;
5699 }
5700
5701 var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
5702 var csses = [];
5703 var classes = '';
5704
5705 if (headerStyle && headerStyle.css) {
5706 for (var _i2 = 0, _Object$entries2 = Object.entries(headerStyle.css); _i2 < _Object$entries2.length; _i2++) {
5707 var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
5708 key = _Object$entries2$_i[0],
5709 value = _Object$entries2$_i[1];
5710
5711 csses.push("".concat(key, ": ").concat(value));
5712 }
5713 }
5714
5715 if (headerStyle && headerStyle.classes) {
5716 classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
5717 }
5718
5719 if (typeof column.fieldIndex !== 'undefined') {
5720 _this2.header.fields[column.fieldIndex] = column.field;
5721 _this2.header.styles[column.fieldIndex] = align + style;
5722 _this2.header.classes[column.fieldIndex] = class_;
5723 _this2.header.formatters[column.fieldIndex] = column.formatter;
5724 _this2.header.detailFormatters[column.fieldIndex] = column.detailFormatter;
5725 _this2.header.events[column.fieldIndex] = column.events;
5726 _this2.header.sorters[column.fieldIndex] = column.sorter;
5727 _this2.header.sortNames[column.fieldIndex] = column.sortName;
5728 _this2.header.cellStyles[column.fieldIndex] = column.cellStyle;
5729 _this2.header.searchables[column.fieldIndex] = column.searchable;
5730
5731 if (!column.visible) {
5732 return;
5733 }
5734
5735 if (_this2.options.cardView && !column.cardVisible) {
5736 return;
5737 }
5738
5739 visibleColumns[column.field] = column;
5740 }
5741
5742 html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : classes || class_, Utils.sprintf(' style="%s"', halign + style + csses.join('; ')), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field), // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
5743 j === 0 && i > 0 ? ' data-not-first-th' : '', '>');
5744 html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? "sortable".concat(columnHalign === 'center' ? ' sortable-center' : '', " both") : ''));
5745 var text = _this2.options.escape ? Utils.escapeHTML(column.title) : column.title;
5746 var title = text;
5747
5748 if (column.checkbox) {
5749 text = '';
5750
5751 if (!_this2.options.singleSelect && _this2.options.checkboxHeader) {
5752 text = '<label><input name="btSelectAll" type="checkbox" /><span></span></label>';
5753 }
5754
5755 _this2.header.stateField = column.field;
5756 }
5757
5758 if (column.radio) {
5759 text = '';
5760 _this2.header.stateField = column.field;
5761 }
5762
5763 if (!text && column.showSelectTitle) {
5764 text += title;
5765 }
5766
5767 html.push(text);
5768 html.push('</div>');
5769 html.push('<div class="fht-cell"></div>');
5770 html.push('</div>');
5771 html.push('</th>');
5772 });
5773
5774 if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
5775 html.push(detailViewTemplate);
5776 }
5777
5778 html.push('</tr>');
5779
5780 if (html.length > 3) {
5781 headerHtml.push(html.join(''));
5782 }
5783 });
5784 this.$header.html(headerHtml.join(''));
5785 this.$header.find('th[data-field]').each(function (i, el) {
5786 $__default["default"](el).data(visibleColumns[$__default["default"](el).data('field')]);
5787 });
5788 this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) {
5789 var $this = $__default["default"](e.currentTarget);
5790
5791 if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) {
5792 if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) {
5793 return false;
5794 }
5795 }
5796
5797 if (_this2.options.sortable && $this.parent().data().sortable) {
5798 _this2.onSort(e);
5799 }
5800 });
5801 var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
5802 $__default["default"](window).off(resizeEvent);
5803
5804 if (!this.options.showHeader || this.options.cardView) {
5805 this.$header.hide();
5806 this.$tableHeader.hide();
5807 this.$tableLoading.css('top', 0);
5808 } else {
5809 this.$header.show();
5810 this.$tableHeader.show();
5811 this.$tableLoading.css('top', this.$header.outerHeight() + 1); // Assign the correct sortable arrow
5812
5813 this.getCaret();
5814 $__default["default"](window).on(resizeEvent, function () {
5815 return _this2.resetView();
5816 });
5817 }
5818
5819 this.$selectAll = this.$header.find('[name="btSelectAll"]');
5820 this.$selectAll.off('click').on('click', function (e) {
5821 e.stopPropagation();
5822 var checked = $__default["default"](e.currentTarget).prop('checked');
5823
5824 _this2[checked ? 'checkAll' : 'uncheckAll']();
5825
5826 _this2.updateSelected();
5827 });
5828 }
5829 }, {
5830 key: "initData",
5831 value: function initData(data, type) {
5832 if (type === 'append') {
5833 this.options.data = this.options.data.concat(data);
5834 } else if (type === 'prepend') {
5835 this.options.data = [].concat(data).concat(this.options.data);
5836 } else {
5837 data = data || Utils.deepCopy(this.options.data);
5838 this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
5839 }
5840
5841 this.data = _toConsumableArray(this.options.data);
5842
5843 if (this.options.sortReset) {
5844 this.unsortedData = _toConsumableArray(this.data);
5845 }
5846
5847 if (this.options.sidePagination === 'server') {
5848 return;
5849 }
5850
5851 this.initSort();
5852 }
5853 }, {
5854 key: "initSort",
5855 value: function initSort() {
5856 var _this3 = this;
5857
5858 var name = this.options.sortName;
5859 var order = this.options.sortOrder === 'desc' ? -1 : 1;
5860 var index = this.header.fields.indexOf(this.options.sortName);
5861 var timeoutId = 0;
5862
5863 if (index !== -1) {
5864 if (this.options.sortStable) {
5865 this.data.forEach(function (row, i) {
5866 if (!row.hasOwnProperty('_position')) {
5867 row._position = i;
5868 }
5869 });
5870 }
5871
5872 if (this.options.customSort) {
5873 Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
5874 } else {
5875 this.data.sort(function (a, b) {
5876 if (_this3.header.sortNames[index]) {
5877 name = _this3.header.sortNames[index];
5878 }
5879
5880 var aa = Utils.getItemField(a, name, _this3.options.escape);
5881 var bb = Utils.getItemField(b, name, _this3.options.escape);
5882 var value = Utils.calculateObjectValue(_this3.header, _this3.header.sorters[index], [aa, bb, a, b]);
5883
5884 if (value !== undefined) {
5885 if (_this3.options.sortStable && value === 0) {
5886 return order * (a._position - b._position);
5887 }
5888
5889 return order * value;
5890 }
5891
5892 return Utils.sort(aa, bb, order, _this3.options, a._position, b._position);
5893 });
5894 }
5895
5896 if (this.options.sortClass !== undefined) {
5897 clearTimeout(timeoutId);
5898 timeoutId = setTimeout(function () {
5899 _this3.$el.removeClass(_this3.options.sortClass);
5900
5901 var index = _this3.$header.find("[data-field=\"".concat(_this3.options.sortName, "\"]")).index();
5902
5903 _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
5904 }, 250);
5905 }
5906 } else if (this.options.sortReset) {
5907 this.data = _toConsumableArray(this.unsortedData);
5908 }
5909 }
5910 }, {
5911 key: "onSort",
5912 value: function onSort(_ref) {
5913 var type = _ref.type,
5914 currentTarget = _ref.currentTarget;
5915 var $this = type === 'keypress' ? $__default["default"](currentTarget) : $__default["default"](currentTarget).parent();
5916 var $this_ = this.$header.find('th').eq($this.index());
5917 this.$header.add(this.$header_).find('span.order').remove();
5918
5919 if (this.options.sortName === $this.data('field')) {
5920 var currentSortOrder = this.options.sortOrder;
5921
5922 if (currentSortOrder === undefined) {
5923 this.options.sortOrder = 'asc';
5924 } else if (currentSortOrder === 'asc') {
5925 this.options.sortOrder = 'desc';
5926 } else if (this.options.sortOrder === 'desc') {
5927 this.options.sortOrder = this.options.sortReset ? undefined : 'asc';
5928 }
5929
5930 if (this.options.sortOrder === undefined) {
5931 this.options.sortName = undefined;
5932 }
5933 } else {
5934 this.options.sortName = $this.data('field');
5935
5936 if (this.options.rememberOrder) {
5937 this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
5938 } else {
5939 this.options.sortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
5940 }
5941 }
5942
5943 this.trigger('sort', this.options.sortName, this.options.sortOrder);
5944 $this.add($this_).data('order', this.options.sortOrder); // Assign the correct sortable arrow
5945
5946 this.getCaret();
5947
5948 if (this.options.sidePagination === 'server' && this.options.serverSort) {
5949 this.options.pageNumber = 1;
5950 this.initServer(this.options.silentSort);
5951 return;
5952 }
5953
5954 this.initSort();
5955 this.initBody();
5956 }
5957 }, {
5958 key: "initToolbar",
5959 value: function initToolbar() {
5960 var _this4 = this;
5961
5962 var opts = this.options;
5963 var html = [];
5964 var timeoutId = 0;
5965 var $keepOpen;
5966 var switchableCount = 0;
5967
5968 if (this.$toolbar.find('.bs-bars').children().length) {
5969 $__default["default"]('body').append($__default["default"](opts.toolbar));
5970 }
5971
5972 this.$toolbar.html('');
5973
5974 if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
5975 $__default["default"](Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($__default["default"](opts.toolbar));
5976 } // showColumns, showToggle, showRefresh
5977
5978
5979 html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
5980
5981 if (typeof opts.buttonsOrder === 'string') {
5982 opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').split(',');
5983 }
5984
5985 this.buttons = Object.assign(this.buttons, {
5986 paginationSwitch: {
5987 text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
5988 icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
5989 render: false,
5990 event: this.togglePagination,
5991 attributes: {
5992 'aria-label': opts.formatPaginationSwitch(),
5993 title: opts.formatPaginationSwitch()
5994 }
5995 },
5996 refresh: {
5997 text: opts.formatRefresh(),
5998 icon: opts.icons.refresh,
5999 render: false,
6000 event: this.refresh,
6001 attributes: {
6002 'aria-label': opts.formatRefresh(),
6003 title: opts.formatRefresh()
6004 }
6005 },
6006 toggle: {
6007 text: opts.formatToggleOn(),
6008 icon: opts.icons.toggleOff,
6009 render: false,
6010 event: this.toggleView,
6011 attributes: {
6012 'aria-label': opts.formatToggleOn(),
6013 title: opts.formatToggleOn()
6014 }
6015 },
6016 fullscreen: {
6017 text: opts.formatFullscreen(),
6018 icon: opts.icons.fullscreen,
6019 render: false,
6020 event: this.toggleFullscreen,
6021 attributes: {
6022 'aria-label': opts.formatFullscreen(),
6023 title: opts.formatFullscreen()
6024 }
6025 },
6026 columns: {
6027 render: false,
6028 html: function html() {
6029 var html = [];
6030 html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\" title=\"").concat(opts.formatColumns(), "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(_this4.constants.dataToggle, "=\"dropdown\"\n aria-label=\"").concat(opts.formatColumns(), "\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
6031
6032 if (opts.showColumnsSearch) {
6033 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
6034 html.push(_this4.constants.html.toolbarDropdownSeparator);
6035 }
6036
6037 if (opts.showColumnsToggleAll) {
6038 var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
6039 return !_this4.isSelectionColumn(column);
6040 }).length;
6041
6042 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
6043 html.push(_this4.constants.html.toolbarDropdownSeparator);
6044 }
6045
6046 var visibleColumns = 0;
6047
6048 _this4.columns.forEach(function (column) {
6049 if (column.visible) {
6050 visibleColumns++;
6051 }
6052 });
6053
6054 _this4.columns.forEach(function (column, i) {
6055 if (_this4.isSelectionColumn(column)) {
6056 return;
6057 }
6058
6059 if (opts.cardView && !column.cardVisible) {
6060 return;
6061 }
6062
6063 var checked = column.visible ? ' checked="checked"' : '';
6064 var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
6065
6066 if (column.switchable) {
6067 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>', column.field, i, checked, disabled, column.title)));
6068 switchableCount++;
6069 }
6070 });
6071
6072 html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
6073 return html.join('');
6074 }
6075 }
6076 });
6077 var buttonsHtml = {};
6078
6079 for (var _i3 = 0, _Object$entries3 = Object.entries(this.buttons); _i3 < _Object$entries3.length; _i3++) {
6080 var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
6081 buttonName = _Object$entries3$_i[0],
6082 buttonConfig = _Object$entries3$_i[1];
6083
6084 var buttonHtml = void 0;
6085
6086 if (buttonConfig.hasOwnProperty('html')) {
6087 if (typeof buttonConfig.html === 'function') {
6088 buttonHtml = buttonConfig.html();
6089 } else if (typeof buttonConfig.html === 'string') {
6090 buttonHtml = buttonConfig.html;
6091 }
6092 } else {
6093 buttonHtml = "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
6094
6095 if (buttonConfig.hasOwnProperty('attributes')) {
6096 for (var _i4 = 0, _Object$entries4 = Object.entries(buttonConfig.attributes); _i4 < _Object$entries4.length; _i4++) {
6097 var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
6098 attributeName = _Object$entries4$_i[0],
6099 value = _Object$entries4$_i[1];
6100
6101 buttonHtml += " ".concat(attributeName, "=\"").concat(value, "\"");
6102 }
6103 }
6104
6105 buttonHtml += '>';
6106
6107 if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
6108 buttonHtml += "".concat(Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, buttonConfig.icon), " ");
6109 }
6110
6111 if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
6112 buttonHtml += buttonConfig.text;
6113 }
6114
6115 buttonHtml += '</button>';
6116 }
6117
6118 buttonsHtml[buttonName] = buttonHtml;
6119 var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
6120 var showOption = opts[optionName];
6121
6122 if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
6123 opts[optionName] = true;
6124 }
6125
6126 if (!opts.buttonsOrder.includes(buttonName)) {
6127 opts.buttonsOrder.push(buttonName);
6128 }
6129 } // Adding the button html to the final toolbar html when the showOption is true
6130
6131
6132 var _iterator = _createForOfIteratorHelper(opts.buttonsOrder),
6133 _step;
6134
6135 try {
6136 for (_iterator.s(); !(_step = _iterator.n()).done;) {
6137 var button = _step.value;
6138 var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
6139
6140 if (_showOption) {
6141 html.push(buttonsHtml[button]);
6142 }
6143 }
6144 } catch (err) {
6145 _iterator.e(err);
6146 } finally {
6147 _iterator.f();
6148 }
6149
6150 html.push('</div>'); // Fix #188: this.showToolbar is for extensions
6151
6152 if (this.showToolbar || html.length > 2) {
6153 this.$toolbar.append(html.join(''));
6154 }
6155
6156 for (var _i5 = 0, _Object$entries5 = Object.entries(this.buttons); _i5 < _Object$entries5.length; _i5++) {
6157 var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
6158 _buttonName = _Object$entries5$_i[0],
6159 _buttonConfig = _Object$entries5$_i[1];
6160
6161 if (_buttonConfig.hasOwnProperty('event')) {
6162 if (typeof _buttonConfig.event === 'function' || typeof _buttonConfig.event === 'string') {
6163 var _ret = function () {
6164 var event = typeof _buttonConfig.event === 'string' ? window[_buttonConfig.event] : _buttonConfig.event;
6165
6166 _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off('click').on('click', function () {
6167 return event.call(_this4);
6168 });
6169
6170 return "continue";
6171 }();
6172
6173 if (_ret === "continue") continue;
6174 }
6175
6176 var _loop = function _loop() {
6177 var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2),
6178 eventType = _Object$entries6$_i[0],
6179 eventFunction = _Object$entries6$_i[1];
6180
6181 var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
6182
6183 _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off(eventType).on(eventType, function () {
6184 return event.call(_this4);
6185 });
6186 };
6187
6188 for (var _i6 = 0, _Object$entries6 = Object.entries(_buttonConfig.event); _i6 < _Object$entries6.length; _i6++) {
6189 _loop();
6190 }
6191 }
6192 }
6193
6194 if (opts.showColumns) {
6195 $keepOpen = this.$toolbar.find('.keep-open');
6196 var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
6197 var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
6198
6199 if (switchableCount <= opts.minimumCountColumns) {
6200 $keepOpen.find('input').prop('disabled', true);
6201 }
6202
6203 $keepOpen.find('li, label').off('click').on('click', function (e) {
6204 e.stopImmediatePropagation();
6205 });
6206 $checkboxes.off('click').on('click', function (_ref2) {
6207 var currentTarget = _ref2.currentTarget;
6208 var $this = $__default["default"](currentTarget);
6209
6210 _this4._toggleColumn($this.val(), $this.prop('checked'), false);
6211
6212 _this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
6213
6214 $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
6215 return !_this4.isSelectionColumn(column);
6216 }).length);
6217 });
6218 $toggleAll.off('click').on('click', function (_ref3) {
6219 var currentTarget = _ref3.currentTarget;
6220
6221 _this4._toggleAllColumns($__default["default"](currentTarget).prop('checked'));
6222
6223 _this4.trigger('column-switch-all', $__default["default"](currentTarget).prop('checked'));
6224 });
6225
6226 if (opts.showColumnsSearch) {
6227 var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
6228 var $listItems = $keepOpen.find('.dropdown-item-marker');
6229 $columnsSearch.on('keyup paste change', function (_ref4) {
6230 var currentTarget = _ref4.currentTarget;
6231 var $this = $__default["default"](currentTarget);
6232 var searchValue = $this.val().toLowerCase();
6233 $listItems.show();
6234 $checkboxes.each(function (i, el) {
6235 var $checkbox = $__default["default"](el);
6236 var $listItem = $checkbox.parents('.dropdown-item-marker');
6237 var text = $listItem.text().toLowerCase();
6238
6239 if (!text.includes(searchValue)) {
6240 $listItem.hide();
6241 }
6242 });
6243 });
6244 }
6245 }
6246
6247 var handleInputEvent = function handleInputEvent($searchInput) {
6248 var eventTriggers = 'keyup drop blur mouseup';
6249 $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
6250 if (opts.searchOnEnterKey && event.keyCode !== 13) {
6251 return;
6252 }
6253
6254 if ([37, 38, 39, 40].includes(event.keyCode)) {
6255 return;
6256 }
6257
6258 clearTimeout(timeoutId); // doesn't matter if it's 0
6259
6260 timeoutId = setTimeout(function () {
6261 _this4.onSearch({
6262 currentTarget: event.currentTarget
6263 });
6264 }, opts.searchTimeOut);
6265 });
6266 }; // Fix #4516: this.showSearchClearButton is for extensions
6267
6268
6269 if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
6270 html = [];
6271 var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, opts.formatSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.search) : '', opts.showButtonText ? opts.formatSearch() : '');
6272 var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, opts.formatClearSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.clearSearch) : '', opts.showButtonText ? opts.formatClearSearch() : '');
6273 var searchInputHtml = "<input class=\"".concat(this.constants.classes.input, "\n ").concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, opts.iconSize), "\n search-input\" type=\"search\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
6274 var searchInputFinalHtml = searchInputHtml;
6275
6276 if (opts.showSearchButton || opts.showSearchClearButton) {
6277 var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
6278
6279 searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
6280 }
6281
6282 html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(opts.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
6283 this.$toolbar.append(html.join(''));
6284 var $searchInput = Utils.getSearchInput(this);
6285
6286 if (opts.showSearchButton) {
6287 this.$toolbar.find('.search button[name=search]').off('click').on('click', function () {
6288 clearTimeout(timeoutId); // doesn't matter if it's 0
6289
6290 timeoutId = setTimeout(function () {
6291 _this4.onSearch({
6292 currentTarget: $searchInput
6293 });
6294 }, opts.searchTimeOut);
6295 });
6296
6297 if (opts.searchOnEnterKey) {
6298 handleInputEvent($searchInput);
6299 }
6300 } else {
6301 handleInputEvent($searchInput);
6302 }
6303
6304 if (opts.showSearchClearButton) {
6305 this.$toolbar.find('.search button[name=clearSearch]').click(function () {
6306 _this4.resetSearch();
6307 });
6308 }
6309 } else if (typeof opts.searchSelector === 'string') {
6310 var _$searchInput = Utils.getSearchInput(this);
6311
6312 handleInputEvent(_$searchInput);
6313 }
6314 }
6315 }, {
6316 key: "onSearch",
6317 value: function onSearch() {
6318 var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
6319 currentTarget = _ref5.currentTarget,
6320 firedByInitSearchText = _ref5.firedByInitSearchText;
6321
6322 var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
6323
6324 if (currentTarget !== undefined && $__default["default"](currentTarget).length && overwriteSearchText) {
6325 var text = $__default["default"](currentTarget).val().trim();
6326
6327 if (this.options.trimOnSearch && $__default["default"](currentTarget).val() !== text) {
6328 $__default["default"](currentTarget).val(text);
6329 }
6330
6331 if (this.searchText === text) {
6332 return;
6333 }
6334
6335 var $searchInput = Utils.getSearchInput(this);
6336 var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $__default["default"](currentTarget);
6337
6338 if ($currentTarget.is($searchInput) || $currentTarget.hasClass('search-input')) {
6339 this.searchText = text;
6340 this.options.searchText = text;
6341 }
6342 }
6343
6344 if (!firedByInitSearchText && !this.options.cookie) {
6345 this.options.pageNumber = 1;
6346 }
6347
6348 this.initSearch();
6349
6350 if (firedByInitSearchText) {
6351 if (this.options.sidePagination === 'client') {
6352 this.updatePagination();
6353 }
6354 } else {
6355 this.updatePagination();
6356 }
6357
6358 this.trigger('search', this.searchText);
6359 }
6360 }, {
6361 key: "initSearch",
6362 value: function initSearch() {
6363 var _this5 = this;
6364
6365 this.filterOptions = this.filterOptions || this.options.filterOptions;
6366
6367 if (this.options.sidePagination !== 'server') {
6368 if (this.options.customSearch) {
6369 this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
6370
6371 if (this.options.sortReset) {
6372 this.unsortedData = _toConsumableArray(this.data);
6373 }
6374
6375 this.initSort();
6376 return;
6377 }
6378
6379 var rawSearchText = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText);
6380 var searchText = rawSearchText ? rawSearchText.toLowerCase() : '';
6381 var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns;
6382
6383 if (this.options.searchAccentNeutralise) {
6384 searchText = Utils.normalizeAccent(searchText);
6385 } // Check filter
6386
6387
6388 if (typeof this.filterOptions.filterAlgorithm === 'function') {
6389 this.data = this.options.data.filter(function (item) {
6390 return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
6391 });
6392 } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
6393 this.data = f ? this.options.data.filter(function (item) {
6394 var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
6395
6396 if (filterAlgorithm === 'and') {
6397 for (var key in f) {
6398 if (Array.isArray(f[key]) && !f[key].includes(item[key]) || !Array.isArray(f[key]) && item[key] !== f[key]) {
6399 return false;
6400 }
6401 }
6402 } else if (filterAlgorithm === 'or') {
6403 var match = false;
6404
6405 for (var _key in f) {
6406 if (Array.isArray(f[_key]) && f[_key].includes(item[_key]) || !Array.isArray(f[_key]) && item[_key] === f[_key]) {
6407 match = true;
6408 }
6409 }
6410
6411 return match;
6412 }
6413
6414 return true;
6415 }) : _toConsumableArray(this.options.data);
6416 }
6417
6418 var visibleFields = this.getVisibleFields();
6419 this.data = searchText ? this.data.filter(function (item, i) {
6420 for (var j = 0; j < _this5.header.fields.length; j++) {
6421 if (!_this5.header.searchables[j] || _this5.options.visibleSearch && visibleFields.indexOf(_this5.header.fields[j]) === -1) {
6422 continue;
6423 }
6424
6425 var key = Utils.isNumeric(_this5.header.fields[j]) ? parseInt(_this5.header.fields[j], 10) : _this5.header.fields[j];
6426 var column = _this5.columns[_this5.fieldsColumnsIndex[key]];
6427 var value = void 0;
6428
6429 if (typeof key === 'string') {
6430 value = item;
6431 var props = key.split('.');
6432
6433 for (var _i7 = 0; _i7 < props.length; _i7++) {
6434 if (value[props[_i7]] !== null) {
6435 value = value[props[_i7]];
6436 } else {
6437 value = null;
6438 break;
6439 }
6440 }
6441 } else {
6442 value = item[key];
6443 }
6444
6445 if (_this5.options.searchAccentNeutralise) {
6446 value = Utils.normalizeAccent(value);
6447 } // Fix #142: respect searchFormatter boolean
6448
6449
6450 if (column && column.searchFormatter) {
6451 value = Utils.calculateObjectValue(column, _this5.header.formatters[j], [value, item, i, column.field], value);
6452 }
6453
6454 if (typeof value === 'string' || typeof value === 'number') {
6455 if (_this5.options.strictSearch && "".concat(value).toLowerCase() === searchText || _this5.options.regexSearch && Utils.regexCompare(value, rawSearchText)) {
6456 return true;
6457 }
6458
6459 var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
6460 var matches = largerSmallerEqualsRegex.exec(_this5.searchText);
6461 var comparisonCheck = false;
6462
6463 if (matches) {
6464 var operator = matches[1] || "".concat(matches[5], "l");
6465 var comparisonValue = matches[2] || matches[3];
6466 var int = parseInt(value, 10);
6467 var comparisonInt = parseInt(comparisonValue, 10);
6468
6469 switch (operator) {
6470 case '>':
6471 case '<l':
6472 comparisonCheck = int > comparisonInt;
6473 break;
6474
6475 case '<':
6476 case '>l':
6477 comparisonCheck = int < comparisonInt;
6478 break;
6479
6480 case '<=':
6481 case '=<':
6482 case '>=l':
6483 case '=>l':
6484 comparisonCheck = int <= comparisonInt;
6485 break;
6486
6487 case '>=':
6488 case '=>':
6489 case '<=l':
6490 case '=<l':
6491 comparisonCheck = int >= comparisonInt;
6492 break;
6493 }
6494 }
6495
6496 if (comparisonCheck || "".concat(value).toLowerCase().includes(searchText)) {
6497 return true;
6498 }
6499 }
6500 }
6501
6502 return false;
6503 }) : this.data;
6504
6505 if (this.options.sortReset) {
6506 this.unsortedData = _toConsumableArray(this.data);
6507 }
6508
6509 this.initSort();
6510 }
6511 }
6512 }, {
6513 key: "initPagination",
6514 value: function initPagination() {
6515 var _this6 = this;
6516
6517 var opts = this.options;
6518
6519 if (!opts.pagination) {
6520 this.$pagination.hide();
6521 return;
6522 }
6523
6524 this.$pagination.show();
6525 var html = [];
6526 var allSelected = false;
6527 var i;
6528 var from;
6529 var to;
6530 var $pageList;
6531 var $pre;
6532 var $next;
6533 var $number;
6534 var data = this.getData({
6535 includeHiddenRows: false
6536 });
6537 var pageList = opts.pageList;
6538
6539 if (typeof pageList === 'string') {
6540 pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
6541 }
6542
6543 pageList = pageList.map(function (value) {
6544 if (typeof value === 'string') {
6545 return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
6546 }
6547
6548 return value;
6549 });
6550 this.paginationParts = opts.paginationParts;
6551
6552 if (typeof this.paginationParts === 'string') {
6553 this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
6554 }
6555
6556 if (opts.sidePagination !== 'server') {
6557 opts.totalRows = data.length;
6558 }
6559
6560 this.totalPages = 0;
6561
6562 if (opts.totalRows) {
6563 if (opts.pageSize === opts.formatAllRows()) {
6564 opts.pageSize = opts.totalRows;
6565 allSelected = true;
6566 }
6567
6568 this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
6569 opts.totalPages = this.totalPages;
6570 }
6571
6572 if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
6573 opts.pageNumber = this.totalPages;
6574 }
6575
6576 this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
6577 this.pageTo = opts.pageNumber * opts.pageSize;
6578
6579 if (this.pageTo > opts.totalRows) {
6580 this.pageTo = opts.totalRows;
6581 }
6582
6583 if (this.options.pagination && this.options.sidePagination !== 'server') {
6584 this.options.totalNotFiltered = this.options.data.length;
6585 }
6586
6587 if (!this.options.showExtendedPagination) {
6588 this.options.totalNotFiltered = undefined;
6589 }
6590
6591 if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
6592 html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
6593 }
6594
6595 if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
6596 var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
6597 html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
6598 }
6599
6600 if (this.paginationParts.includes('pageSize')) {
6601 html.push('<div class="page-list">');
6602 var pageNumber = ["<div class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(this.constants.dataToggle, "=\"dropdown\">\n <span class=\"page-size\">\n ").concat(allSelected ? opts.formatAllRows() : opts.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
6603 pageList.forEach(function (page, i) {
6604 if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows || page === opts.formatAllRows()) {
6605 var active;
6606
6607 if (allSelected) {
6608 active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
6609 } else {
6610 active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
6611 }
6612
6613 pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
6614 }
6615 });
6616 pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</div>"));
6617 html.push(opts.formatRecordsPerPage(pageNumber.join('')));
6618 }
6619
6620 if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
6621 html.push('</div></div>');
6622 }
6623
6624 if (this.paginationParts.includes('pageList')) {
6625 html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', opts.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', opts.formatSRPaginationPreText(), opts.paginationPreText));
6626
6627 if (this.totalPages < opts.paginationSuccessivelySize) {
6628 from = 1;
6629 to = this.totalPages;
6630 } else {
6631 from = opts.pageNumber - opts.paginationPagesBySide;
6632 to = from + opts.paginationPagesBySide * 2;
6633 }
6634
6635 if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
6636 to = opts.paginationSuccessivelySize;
6637 }
6638
6639 if (opts.paginationSuccessivelySize > this.totalPages - from) {
6640 from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
6641 }
6642
6643 if (from < 1) {
6644 from = 1;
6645 }
6646
6647 if (to > this.totalPages) {
6648 to = this.totalPages;
6649 }
6650
6651 var middleSize = Math.round(opts.paginationPagesBySide / 2);
6652
6653 var pageItem = function pageItem(i) {
6654 var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
6655 return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === opts.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), opts.formatSRPaginationPageText(i), i);
6656 };
6657
6658 if (from > 1) {
6659 var max = opts.paginationPagesBySide;
6660 if (max >= from) max = from - 1;
6661
6662 for (i = 1; i <= max; i++) {
6663 html.push(pageItem(i));
6664 }
6665
6666 if (from - 1 === max + 1) {
6667 i = from - 1;
6668 html.push(pageItem(i));
6669 } else if (from - 1 > max) {
6670 if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
6671 i = Math.round((from - middleSize) / 2 + middleSize);
6672 html.push(pageItem(i, ' page-intermediate'));
6673 } else {
6674 html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
6675 }
6676 }
6677 }
6678
6679 for (i = from; i <= to; i++) {
6680 html.push(pageItem(i));
6681 }
6682
6683 if (this.totalPages > to) {
6684 var min = this.totalPages - (opts.paginationPagesBySide - 1);
6685 if (to >= min) min = to + 1;
6686
6687 if (to + 1 === min - 1) {
6688 i = to + 1;
6689 html.push(pageItem(i));
6690 } else if (min > to + 1) {
6691 if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
6692 i = Math.round((this.totalPages - middleSize - to) / 2 + to);
6693 html.push(pageItem(i, ' page-intermediate'));
6694 } else {
6695 html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
6696 }
6697 }
6698
6699 for (i = min; i <= this.totalPages; i++) {
6700 html.push(pageItem(i));
6701 }
6702 }
6703
6704 html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', opts.formatSRPaginationNextText(), opts.paginationNextText));
6705 html.push(this.constants.html.pagination[1], '</div>');
6706 }
6707
6708 this.$pagination.html(html.join(''));
6709 var dropupClass = ['bottom', 'both'].includes(opts.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
6710 this.$pagination.last().find('.page-list > div').addClass(dropupClass);
6711
6712 if (!opts.onlyInfoPagination) {
6713 $pageList = this.$pagination.find('.page-list a');
6714 $pre = this.$pagination.find('.page-pre');
6715 $next = this.$pagination.find('.page-next');
6716 $number = this.$pagination.find('.page-item').not('.page-next, .page-pre, .page-last-separator, .page-first-separator');
6717
6718 if (this.totalPages <= 1) {
6719 this.$pagination.find('div.pagination').hide();
6720 }
6721
6722 if (opts.smartDisplay) {
6723 if (pageList.length < 2 || opts.totalRows <= pageList[0]) {
6724 this.$pagination.find('div.page-list').hide();
6725 }
6726 } // when data is empty, hide the pagination
6727
6728
6729 this.$pagination[this.getData().length ? 'show' : 'hide']();
6730
6731 if (!opts.paginationLoop) {
6732 if (opts.pageNumber === 1) {
6733 $pre.addClass('disabled');
6734 }
6735
6736 if (opts.pageNumber === this.totalPages) {
6737 $next.addClass('disabled');
6738 }
6739 }
6740
6741 if (allSelected) {
6742 opts.pageSize = opts.formatAllRows();
6743 } // removed the events for last and first, onPageNumber executeds the same logic
6744
6745
6746 $pageList.off('click').on('click', function (e) {
6747 return _this6.onPageListChange(e);
6748 });
6749 $pre.off('click').on('click', function (e) {
6750 return _this6.onPagePre(e);
6751 });
6752 $next.off('click').on('click', function (e) {
6753 return _this6.onPageNext(e);
6754 });
6755 $number.off('click').on('click', function (e) {
6756 return _this6.onPageNumber(e);
6757 });
6758 }
6759 }
6760 }, {
6761 key: "updatePagination",
6762 value: function updatePagination(event) {
6763 // Fix #171: IE disabled button can be clicked bug.
6764 if (event && $__default["default"](event.currentTarget).hasClass('disabled')) {
6765 return;
6766 }
6767
6768 if (!this.options.maintainMetaData) {
6769 this.resetRows();
6770 }
6771
6772 this.initPagination();
6773 this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
6774
6775 if (this.options.sidePagination === 'server') {
6776 this.initServer();
6777 } else {
6778 this.initBody();
6779 }
6780 }
6781 }, {
6782 key: "onPageListChange",
6783 value: function onPageListChange(event) {
6784 event.preventDefault();
6785 var $this = $__default["default"](event.currentTarget);
6786 $this.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive);
6787 this.options.pageSize = $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text();
6788 this.$toolbar.find('.page-size').text(this.options.pageSize);
6789 this.updatePagination(event);
6790 return false;
6791 }
6792 }, {
6793 key: "onPagePre",
6794 value: function onPagePre(event) {
6795 if ($__default["default"](event.target).hasClass('disabled')) {
6796 return;
6797 }
6798
6799 event.preventDefault();
6800
6801 if (this.options.pageNumber - 1 === 0) {
6802 this.options.pageNumber = this.options.totalPages;
6803 } else {
6804 this.options.pageNumber--;
6805 }
6806
6807 this.updatePagination(event);
6808 return false;
6809 }
6810 }, {
6811 key: "onPageNext",
6812 value: function onPageNext(event) {
6813 if ($__default["default"](event.target).hasClass('disabled')) {
6814 return;
6815 }
6816
6817 event.preventDefault();
6818
6819 if (this.options.pageNumber + 1 > this.options.totalPages) {
6820 this.options.pageNumber = 1;
6821 } else {
6822 this.options.pageNumber++;
6823 }
6824
6825 this.updatePagination(event);
6826 return false;
6827 }
6828 }, {
6829 key: "onPageNumber",
6830 value: function onPageNumber(event) {
6831 event.preventDefault();
6832
6833 if (this.options.pageNumber === +$__default["default"](event.currentTarget).text()) {
6834 return;
6835 }
6836
6837 this.options.pageNumber = +$__default["default"](event.currentTarget).text();
6838 this.updatePagination(event);
6839 return false;
6840 } // eslint-disable-next-line no-unused-vars
6841
6842 }, {
6843 key: "initRow",
6844 value: function initRow(item, i, data, trFragments) {
6845 var _this7 = this;
6846
6847 var html = [];
6848 var style = {};
6849 var csses = [];
6850 var data_ = '';
6851 var attributes = {};
6852 var htmlAttributes = [];
6853
6854 if (Utils.findIndex(this.hiddenRows, item) > -1) {
6855 return;
6856 }
6857
6858 style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
6859
6860 if (style && style.css) {
6861 for (var _i8 = 0, _Object$entries7 = Object.entries(style.css); _i8 < _Object$entries7.length; _i8++) {
6862 var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
6863 key = _Object$entries7$_i[0],
6864 value = _Object$entries7$_i[1];
6865
6866 csses.push("".concat(key, ": ").concat(value));
6867 }
6868 }
6869
6870 attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
6871
6872 if (attributes) {
6873 for (var _i9 = 0, _Object$entries8 = Object.entries(attributes); _i9 < _Object$entries8.length; _i9++) {
6874 var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
6875 _key2 = _Object$entries8$_i[0],
6876 _value = _Object$entries8$_i[1];
6877
6878 htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
6879 }
6880 }
6881
6882 if (item._data && !Utils.isEmptyObject(item._data)) {
6883 for (var _i10 = 0, _Object$entries9 = Object.entries(item._data); _i10 < _Object$entries9.length; _i10++) {
6884 var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
6885 k = _Object$entries9$_i[0],
6886 v = _Object$entries9$_i[1];
6887
6888 // ignore data-index
6889 if (k === 'index') {
6890 return;
6891 }
6892
6893 data_ += " data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'");
6894 }
6895 }
6896
6897 html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), Utils.sprintf(' style="%s"', Array.isArray(item) ? undefined : item._style), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
6898
6899 if (this.options.cardView) {
6900 html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
6901 }
6902
6903 var detailViewTemplate = '';
6904
6905 if (Utils.hasDetailViewIcon(this.options)) {
6906 detailViewTemplate = '<td>';
6907
6908 if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
6909 detailViewTemplate += "\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n ");
6910 }
6911
6912 detailViewTemplate += '</td>';
6913 }
6914
6915 if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
6916 html.push(detailViewTemplate);
6917 }
6918
6919 this.header.fields.forEach(function (field, j) {
6920 var column = _this7.columns[j];
6921 var text = '';
6922 var value_ = Utils.getItemField(item, field, _this7.options.escape, column.escape);
6923 var value = '';
6924 var type = '';
6925 var cellStyle = {};
6926 var id_ = '';
6927 var class_ = _this7.header.classes[j];
6928 var style_ = '';
6929 var styleToAdd_ = '';
6930 var data_ = '';
6931 var rowspan_ = '';
6932 var colspan_ = '';
6933 var title_ = '';
6934
6935 if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
6936 if (!column.checkbox && !column.radio) {
6937 return;
6938 }
6939 }
6940
6941 if (!column.visible) {
6942 return;
6943 }
6944
6945 if (_this7.options.cardView && !column.cardVisible) {
6946 return;
6947 } // Style concat
6948
6949
6950 if (csses.concat([_this7.header.styles[j]]).length) {
6951 styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
6952 }
6953
6954 if (item["_".concat(field, "_style")]) {
6955 styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
6956 }
6957
6958 if (styleToAdd_) {
6959 style_ = " style=\"".concat(styleToAdd_, "\"");
6960 } // Style concat
6961 // handle id and class of td
6962
6963
6964 if (item["_".concat(field, "_id")]) {
6965 id_ = Utils.sprintf(' id="%s"', item["_".concat(field, "_id")]);
6966 }
6967
6968 if (item["_".concat(field, "_class")]) {
6969 class_ = Utils.sprintf(' class="%s"', item["_".concat(field, "_class")]);
6970 }
6971
6972 if (item["_".concat(field, "_rowspan")]) {
6973 rowspan_ = Utils.sprintf(' rowspan="%s"', item["_".concat(field, "_rowspan")]);
6974 }
6975
6976 if (item["_".concat(field, "_colspan")]) {
6977 colspan_ = Utils.sprintf(' colspan="%s"', item["_".concat(field, "_colspan")]);
6978 }
6979
6980 if (item["_".concat(field, "_title")]) {
6981 title_ = Utils.sprintf(' title="%s"', item["_".concat(field, "_title")]);
6982 }
6983
6984 cellStyle = Utils.calculateObjectValue(_this7.header, _this7.header.cellStyles[j], [value_, item, i, field], cellStyle);
6985
6986 if (cellStyle.classes) {
6987 class_ = " class=\"".concat(cellStyle.classes, "\"");
6988 }
6989
6990 if (cellStyle.css) {
6991 var csses_ = [];
6992
6993 for (var _i11 = 0, _Object$entries10 = Object.entries(cellStyle.css); _i11 < _Object$entries10.length; _i11++) {
6994 var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
6995 _key3 = _Object$entries10$_i[0],
6996 _value2 = _Object$entries10$_i[1];
6997
6998 csses_.push("".concat(_key3, ": ").concat(_value2));
6999 }
7000
7001 style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
7002 }
7003
7004 value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
7005
7006 if (!(column.checkbox || column.radio)) {
7007 value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
7008 }
7009
7010 if (column.searchable && _this7.searchText && _this7.options.searchHighlight && !(column.checkbox || column.radio)) {
7011 var defValue = '';
7012
7013 var searchText = _this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
7014
7015 if (_this7.options.searchAccentNeutralise) {
7016 var indexRegex = new RegExp("".concat(Utils.normalizeAccent(searchText)), 'gmi');
7017 var match = indexRegex.exec(Utils.normalizeAccent(value));
7018
7019 if (match) {
7020 searchText = value.substring(match.index, match.index + searchText.length);
7021 }
7022 }
7023
7024 var regExp = new RegExp("(".concat(searchText, ")"), 'gim');
7025 var marker = '<mark>$1</mark>';
7026 var isHTML = value && /<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(value);
7027
7028 if (isHTML) {
7029 // value can contains a HTML tags
7030 var textContent = new DOMParser().parseFromString(value.toString(), 'text/html').documentElement.textContent;
7031 var textReplaced = textContent.replace(regExp, marker);
7032 textContent = textContent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
7033 defValue = value.replace(new RegExp("(>\\s*)(".concat(textContent, ")(\\s*)"), 'gm'), "$1".concat(textReplaced, "$3"));
7034 } else {
7035 // but usually not
7036 defValue = value.toString().replace(regExp, marker);
7037 }
7038
7039 value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], defValue);
7040 }
7041
7042 if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
7043 for (var _i12 = 0, _Object$entries11 = Object.entries(item["_".concat(field, "_data")]); _i12 < _Object$entries11.length; _i12++) {
7044 var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
7045 _k = _Object$entries11$_i[0],
7046 _v = _Object$entries11$_i[1];
7047
7048 // ignore data-index
7049 if (_k === 'index') {
7050 return;
7051 }
7052
7053 data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
7054 }
7055 }
7056
7057 if (column.checkbox || column.radio) {
7058 type = column.checkbox ? 'checkbox' : type;
7059 type = column.radio ? 'radio' : type;
7060 var c = column['class'] || '';
7061 var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
7062 var isDisabled = !column.checkboxEnabled || value && value.disabled;
7063 text = [_this7.options.cardView ? "<div class=\"card-view ".concat(c, "\">") : "<td class=\"bs-checkbox ".concat(c, "\"").concat(class_).concat(style_, ">"), "<label>\n <input\n data-index=\"".concat(i, "\"\n name=\"").concat(_this7.options.selectItemName, "\"\n type=\"").concat(type, "\"\n ").concat(Utils.sprintf('value="%s"', item[_this7.options.idField]), "\n ").concat(Utils.sprintf('checked="%s"', isChecked ? 'checked' : undefined), "\n ").concat(Utils.sprintf('disabled="%s"', isDisabled ? 'disabled' : undefined), " />\n <span></span>\n </label>"), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '</div>' : '</td>'].join('');
7064 item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
7065 } else if (_this7.options.cardView) {
7066 var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title ".concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
7067 text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value ").concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(value, "</span></div>");
7068
7069 if (_this7.options.smartDisplay && value === '') {
7070 text = '<div class="card-view"></div>';
7071 }
7072 } else {
7073 text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
7074 }
7075
7076 html.push(text);
7077 });
7078
7079 if (detailViewTemplate && this.options.detailViewAlign === 'right') {
7080 html.push(detailViewTemplate);
7081 }
7082
7083 if (this.options.cardView) {
7084 html.push('</div></td>');
7085 }
7086
7087 html.push('</tr>');
7088 return html.join('');
7089 }
7090 }, {
7091 key: "initBody",
7092 value: function initBody(fixedScroll, updatedUid) {
7093 var _this8 = this;
7094
7095 var data = this.getData();
7096 this.trigger('pre-body', data);
7097 this.$body = this.$el.find('>tbody');
7098
7099 if (!this.$body.length) {
7100 this.$body = $__default["default"]('<tbody></tbody>').appendTo(this.$el);
7101 } // Fix #389 Bootstrap-table-flatJSON is not working
7102
7103
7104 if (!this.options.pagination || this.options.sidePagination === 'server') {
7105 this.pageFrom = 1;
7106 this.pageTo = data.length;
7107 }
7108
7109 var rows = [];
7110 var trFragments = $__default["default"](document.createDocumentFragment());
7111 var hasTr = false;
7112 var toExpand = [];
7113 this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
7114
7115 for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
7116 var item = data[i];
7117 var tr = this.initRow(item, i, data, trFragments);
7118 hasTr = hasTr || !!tr;
7119
7120 if (tr && typeof tr === 'string') {
7121 var uniqueId = this.options.uniqueId;
7122
7123 if (uniqueId && item.hasOwnProperty(uniqueId)) {
7124 var itemUniqueId = item[uniqueId];
7125 var oldTr = this.$body.find(Utils.sprintf('> tr[data-uniqueid="%s"][data-has-detail-view]', itemUniqueId));
7126 var oldTrNext = oldTr.next();
7127
7128 if (oldTrNext.is('tr.detail-view')) {
7129 toExpand.push(i);
7130
7131 if (!updatedUid || itemUniqueId !== updatedUid) {
7132 tr += oldTrNext[0].outerHTML;
7133 }
7134 }
7135 }
7136
7137 if (!this.options.virtualScroll) {
7138 trFragments.append(tr);
7139 } else {
7140 rows.push(tr);
7141 }
7142 }
7143 } // show no records
7144
7145
7146 if (!hasTr) {
7147 this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options), this.options.formatNoMatches()), "</tr>"));
7148 } else if (!this.options.virtualScroll) {
7149 this.$body.html(trFragments);
7150 } else {
7151 if (this.virtualScroll) {
7152 this.virtualScroll.destroy();
7153 }
7154
7155 this.virtualScroll = new VirtualScroll({
7156 rows: rows,
7157 fixedScroll: fixedScroll,
7158 scrollEl: this.$tableBody[0],
7159 contentEl: this.$body[0],
7160 itemHeight: this.options.virtualScrollItemHeight,
7161 callback: function callback(startIndex, endIndex) {
7162 _this8.fitHeader();
7163
7164 _this8.initBodyEvent();
7165
7166 _this8.trigger('virtual-scroll', startIndex, endIndex);
7167 }
7168 });
7169 }
7170
7171 toExpand.forEach(function (index) {
7172 _this8.expandRow(index);
7173 });
7174
7175 if (!fixedScroll) {
7176 this.scrollTo(0);
7177 }
7178
7179 this.initBodyEvent();
7180 this.initFooter();
7181 this.resetView();
7182 this.updateSelected();
7183
7184 if (this.options.sidePagination !== 'server') {
7185 this.options.totalRows = data.length;
7186 }
7187
7188 this.trigger('post-body', data);
7189 }
7190 }, {
7191 key: "initBodyEvent",
7192 value: function initBodyEvent() {
7193 var _this9 = this;
7194
7195 // click to select by column
7196 this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
7197 var $td = $__default["default"](e.currentTarget);
7198
7199 if ($td.find('.detail-icon').length || $td.index() - Utils.getDetailViewIndexOffset(_this9.options) < 0) {
7200 return;
7201 }
7202
7203 var $tr = $td.parent();
7204 var $cardViewArr = $__default["default"](e.target).parents('.card-views').children();
7205 var $cardViewTarget = $__default["default"](e.target).parents('.card-view');
7206 var rowIndex = $tr.data('index');
7207 var item = _this9.data[rowIndex];
7208 var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex;
7209
7210 var fields = _this9.getVisibleFields();
7211
7212 var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
7213 var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
7214 var value = Utils.getItemField(item, field, _this9.options.escape, column.escape);
7215
7216 _this9.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td);
7217
7218 _this9.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field); // if click to select - then trigger the checkbox/radio click
7219
7220
7221 if (e.type === 'click' && _this9.options.clickToSelect && column.clickToSelect && !Utils.calculateObjectValue(_this9.options, _this9.options.ignoreClickToSelectOn, [e.target])) {
7222 var $selectItem = $tr.find(Utils.sprintf('[name="%s"]', _this9.options.selectItemName));
7223
7224 if ($selectItem.length) {
7225 $selectItem[0].click();
7226 }
7227 }
7228
7229 if (e.type === 'click' && _this9.options.detailViewByClick) {
7230 _this9.toggleDetailView(rowIndex, _this9.header.detailFormatters[_this9.fieldsColumnsIndex[field]]);
7231 }
7232 }).off('mousedown').on('mousedown', function (e) {
7233 // https://github.com/jquery/jquery/issues/1741
7234 _this9.multipleSelectRowCtrlKey = e.ctrlKey || e.metaKey;
7235 _this9.multipleSelectRowShiftKey = e.shiftKey;
7236 });
7237 this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) {
7238 e.preventDefault();
7239
7240 _this9.toggleDetailView($__default["default"](e.currentTarget).parent().parent().data('index'));
7241
7242 return false;
7243 });
7244 this.$selectItem = this.$body.find(Utils.sprintf('[name="%s"]', this.options.selectItemName));
7245 this.$selectItem.off('click').on('click', function (e) {
7246 e.stopImmediatePropagation();
7247 var $this = $__default["default"](e.currentTarget);
7248
7249 _this9._toggleCheck($this.prop('checked'), $this.data('index'));
7250 });
7251 this.header.events.forEach(function (_events, i) {
7252 var events = _events;
7253
7254 if (!events) {
7255 return;
7256 } // fix bug, if events is defined with namespace
7257
7258
7259 if (typeof events === 'string') {
7260 events = Utils.calculateObjectValue(null, events);
7261 }
7262
7263 if (!events) {
7264 throw new Error("Unknown event in the scope: ".concat(_events));
7265 }
7266
7267 var field = _this9.header.fields[i];
7268
7269 var fieldIndex = _this9.getVisibleFields().indexOf(field);
7270
7271 if (fieldIndex === -1) {
7272 return;
7273 }
7274
7275 fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
7276
7277 var _loop2 = function _loop2(key) {
7278 if (!events.hasOwnProperty(key)) {
7279 return "continue";
7280 }
7281
7282 var event = events[key];
7283
7284 _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
7285 var $tr = $__default["default"](tr);
7286 var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
7287 var index = key.indexOf(' ');
7288 var name = key.substring(0, index);
7289 var el = key.substring(index + 1);
7290 $td.find(el).off(name).on(name, function (e) {
7291 var index = $tr.data('index');
7292 var row = _this9.data[index];
7293 var value = row[field];
7294 event.apply(_this9, [e, value, row, index]);
7295 });
7296 });
7297 };
7298
7299 for (var key in events) {
7300 var _ret2 = _loop2(key);
7301
7302 if (_ret2 === "continue") continue;
7303 }
7304 });
7305 }
7306 }, {
7307 key: "initServer",
7308 value: function initServer(silent, query, url) {
7309 var _this10 = this;
7310
7311 var data = {};
7312 var index = this.header.fields.indexOf(this.options.sortName);
7313 var params = {
7314 searchText: this.searchText,
7315 sortName: this.options.sortName,
7316 sortOrder: this.options.sortOrder
7317 };
7318
7319 if (this.header.sortNames[index]) {
7320 params.sortName = this.header.sortNames[index];
7321 }
7322
7323 if (this.options.pagination && this.options.sidePagination === 'server') {
7324 params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
7325 params.pageNumber = this.options.pageNumber;
7326 }
7327
7328 if (!(url || this.options.url) && !this.options.ajax) {
7329 return;
7330 }
7331
7332 if (this.options.queryParamsType === 'limit') {
7333 params = {
7334 search: params.searchText,
7335 sort: params.sortName,
7336 order: params.sortOrder
7337 };
7338
7339 if (this.options.pagination && this.options.sidePagination === 'server') {
7340 params.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1);
7341 params.limit = this.options.pageSize;
7342
7343 if (params.limit === 0 || this.options.pageSize === this.options.formatAllRows()) {
7344 delete params.limit;
7345 }
7346 }
7347 }
7348
7349 if (this.options.search && this.options.sidePagination === 'server' && this.columns.filter(function (column) {
7350 return !column.searchable;
7351 }).length) {
7352 params.searchable = [];
7353
7354 var _iterator2 = _createForOfIteratorHelper(this.columns),
7355 _step2;
7356
7357 try {
7358 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
7359 var column = _step2.value;
7360
7361 if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
7362 params.searchable.push(column.field);
7363 }
7364 }
7365 } catch (err) {
7366 _iterator2.e(err);
7367 } finally {
7368 _iterator2.f();
7369 }
7370 }
7371
7372 if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
7373 params.filter = JSON.stringify(this.filterColumnsPartial, null);
7374 }
7375
7376 $__default["default"].extend(params, query || {});
7377 data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data); // false to stop request
7378
7379 if (data === false) {
7380 return;
7381 }
7382
7383 if (!silent) {
7384 this.showLoading();
7385 }
7386
7387 var request = $__default["default"].extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
7388 type: this.options.method,
7389 url: url || this.options.url,
7390 data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
7391 cache: this.options.cache,
7392 contentType: this.options.contentType,
7393 dataType: this.options.dataType,
7394 success: function success(_res, textStatus, jqXHR) {
7395 var res = Utils.calculateObjectValue(_this10.options, _this10.options.responseHandler, [_res, jqXHR], _res);
7396
7397 _this10.load(res);
7398
7399 _this10.trigger('load-success', res, jqXHR && jqXHR.status, jqXHR);
7400
7401 if (!silent) {
7402 _this10.hideLoading();
7403 }
7404
7405 if (_this10.options.sidePagination === 'server' && _this10.options.pageNumber > 1 && res[_this10.options.totalField] > 0 && !res[_this10.options.dataField].length) {
7406 _this10.updatePagination();
7407 }
7408 },
7409 error: function error(jqXHR) {
7410 // abort ajax by multiple request
7411 if (jqXHR && jqXHR.status === 0 && _this10._xhrAbort) {
7412 _this10._xhrAbort = false;
7413 return;
7414 }
7415
7416 var data = [];
7417
7418 if (_this10.options.sidePagination === 'server') {
7419 data = {};
7420 data[_this10.options.totalField] = 0;
7421 data[_this10.options.dataField] = [];
7422 }
7423
7424 _this10.load(data);
7425
7426 _this10.trigger('load-error', jqXHR && jqXHR.status, jqXHR);
7427
7428 if (!silent) {
7429 _this10.hideLoading();
7430 }
7431 }
7432 });
7433
7434 if (this.options.ajax) {
7435 Utils.calculateObjectValue(this, this.options.ajax, [request], null);
7436 } else {
7437 if (this._xhr && this._xhr.readyState !== 4) {
7438 this._xhrAbort = true;
7439
7440 this._xhr.abort();
7441 }
7442
7443 this._xhr = $__default["default"].ajax(request);
7444 }
7445
7446 return data;
7447 }
7448 }, {
7449 key: "initSearchText",
7450 value: function initSearchText() {
7451 if (this.options.search) {
7452 this.searchText = '';
7453
7454 if (this.options.searchText !== '') {
7455 var $search = Utils.getSearchInput(this);
7456 $search.val(this.options.searchText);
7457 this.onSearch({
7458 currentTarget: $search,
7459 firedByInitSearchText: true
7460 });
7461 }
7462 }
7463 }
7464 }, {
7465 key: "getCaret",
7466 value: function getCaret() {
7467 var _this11 = this;
7468
7469 this.$header.find('th').each(function (i, th) {
7470 $__default["default"](th).find('.sortable').removeClass('desc asc').addClass($__default["default"](th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both');
7471 });
7472 }
7473 }, {
7474 key: "updateSelected",
7475 value: function updateSelected() {
7476 var checkAll = this.$selectItem.filter(':enabled').length && this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length;
7477 this.$selectAll.add(this.$selectAll_).prop('checked', checkAll);
7478 this.$selectItem.each(function (i, el) {
7479 $__default["default"](el).closest('tr')[$__default["default"](el).prop('checked') ? 'addClass' : 'removeClass']('selected');
7480 });
7481 }
7482 }, {
7483 key: "updateRows",
7484 value: function updateRows() {
7485 var _this12 = this;
7486
7487 this.$selectItem.each(function (i, el) {
7488 _this12.data[$__default["default"](el).data('index')][_this12.header.stateField] = $__default["default"](el).prop('checked');
7489 });
7490 }
7491 }, {
7492 key: "resetRows",
7493 value: function resetRows() {
7494 var _iterator3 = _createForOfIteratorHelper(this.data),
7495 _step3;
7496
7497 try {
7498 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
7499 var row = _step3.value;
7500 this.$selectAll.prop('checked', false);
7501 this.$selectItem.prop('checked', false);
7502
7503 if (this.header.stateField) {
7504 row[this.header.stateField] = false;
7505 }
7506 }
7507 } catch (err) {
7508 _iterator3.e(err);
7509 } finally {
7510 _iterator3.f();
7511 }
7512
7513 this.initHiddenRows();
7514 }
7515 }, {
7516 key: "trigger",
7517 value: function trigger(_name) {
7518 var _this$options, _this$options2;
7519
7520 var name = "".concat(_name, ".bs.table");
7521
7522 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {
7523 args[_key4 - 1] = arguments[_key4];
7524 }
7525
7526 (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
7527
7528 this.$el.trigger($__default["default"].Event(name, {
7529 sender: this
7530 }), args);
7531
7532 (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
7533
7534 this.$el.trigger($__default["default"].Event('all.bs.table', {
7535 sender: this
7536 }), [name, args]);
7537 }
7538 }, {
7539 key: "resetHeader",
7540 value: function resetHeader() {
7541 var _this13 = this;
7542
7543 // fix #61: the hidden table reset header bug.
7544 // fix bug: get $el.css('width') error sometime (height = 500)
7545 clearTimeout(this.timeoutId_);
7546 this.timeoutId_ = setTimeout(function () {
7547 return _this13.fitHeader();
7548 }, this.$el.is(':hidden') ? 100 : 0);
7549 }
7550 }, {
7551 key: "fitHeader",
7552 value: function fitHeader() {
7553 var _this14 = this;
7554
7555 if (this.$el.is(':hidden')) {
7556 this.timeoutId_ = setTimeout(function () {
7557 return _this14.fitHeader();
7558 }, 100);
7559 return;
7560 }
7561
7562 var fixedBody = this.$tableBody.get(0);
7563 var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
7564 this.$el.css('margin-top', -this.$header.outerHeight());
7565 var focused = $__default["default"](':focus');
7566
7567 if (focused.length > 0) {
7568 var $th = focused.parents('th');
7569
7570 if ($th.length > 0) {
7571 var dataField = $th.attr('data-field');
7572
7573 if (dataField !== undefined) {
7574 var $headerTh = this.$header.find("[data-field='".concat(dataField, "']"));
7575
7576 if ($headerTh.length > 0) {
7577 $headerTh.find(':input').addClass('focus-temp');
7578 }
7579 }
7580 }
7581 }
7582
7583 this.$header_ = this.$header.clone(true, true);
7584 this.$selectAll_ = this.$header_.find('[name="btSelectAll"]');
7585 this.$tableHeader.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).html('').attr('class', this.$el.attr('class')).append(this.$header_);
7586 this.$tableLoading.css('width', this.$el.outerWidth());
7587 var focusedTemp = $__default["default"]('.focus-temp:visible:eq(0)');
7588
7589 if (focusedTemp.length > 0) {
7590 focusedTemp.focus();
7591 this.$header.find('.focus-temp').removeClass('focus-temp');
7592 } // fix bug: $.data() is not working as expected after $.append()
7593
7594
7595 this.$header.find('th[data-field]').each(function (i, el) {
7596 _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $__default["default"](el).data('field'))).data($__default["default"](el).data());
7597 });
7598 var visibleFields = this.getVisibleFields();
7599 var $ths = this.$header_.find('th');
7600 var $tr = this.$body.find('>tr:not(.no-records-found,.virtual-scroll-top)').eq(0);
7601
7602 while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
7603 $tr = $tr.next();
7604 }
7605
7606 var trLength = $tr.find('> *').length;
7607 $tr.find('> *').each(function (i, el) {
7608 var $this = $__default["default"](el);
7609
7610 if (Utils.hasDetailViewIcon(_this14.options)) {
7611 if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
7612 var $thDetail = $ths.filter('.detail');
7613
7614 var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
7615
7616 $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
7617 return;
7618 }
7619 }
7620
7621 var index = i - Utils.getDetailViewIndexOffset(_this14.options);
7622
7623 var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
7624
7625 if ($th.length > 1) {
7626 $th = $__default["default"]($ths[$this[0].cellIndex]);
7627 }
7628
7629 var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
7630 $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
7631 });
7632 this.horizontalScroll();
7633 this.trigger('post-header');
7634 }
7635 }, {
7636 key: "initFooter",
7637 value: function initFooter() {
7638 if (!this.options.showFooter || this.options.cardView) {
7639 // do nothing
7640 return;
7641 }
7642
7643 var data = this.getData();
7644 var html = [];
7645 var detailTemplate = '';
7646
7647 if (Utils.hasDetailViewIcon(this.options)) {
7648 detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
7649 }
7650
7651 if (detailTemplate && this.options.detailViewAlign !== 'right') {
7652 html.push(detailTemplate);
7653 }
7654
7655 var _iterator4 = _createForOfIteratorHelper(this.columns),
7656 _step4;
7657
7658 try {
7659 for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
7660 var column = _step4.value;
7661 var falign = '';
7662 var valign = '';
7663 var csses = [];
7664 var style = {};
7665 var class_ = Utils.sprintf(' class="%s"', column['class']);
7666
7667 if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
7668 continue;
7669 }
7670
7671 if (this.options.cardView && !column.cardVisible) {
7672 return;
7673 }
7674
7675 falign = Utils.sprintf('text-align: %s; ', column.falign ? column.falign : column.align);
7676 valign = Utils.sprintf('vertical-align: %s; ', column.valign);
7677 style = Utils.calculateObjectValue(null, this.options.footerStyle, [column]);
7678
7679 if (style && style.css) {
7680 for (var _i13 = 0, _Object$entries12 = Object.entries(style.css); _i13 < _Object$entries12.length; _i13++) {
7681 var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
7682 key = _Object$entries12$_i[0],
7683 _value3 = _Object$entries12$_i[1];
7684
7685 csses.push("".concat(key, ": ").concat(_value3));
7686 }
7687 }
7688
7689 if (style && style.classes) {
7690 class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
7691 }
7692
7693 html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')));
7694 var colspan = 0;
7695
7696 if (this.footerData && this.footerData.length > 0) {
7697 colspan = this.footerData[0]["_".concat(column.field, "_colspan")] || 0;
7698 }
7699
7700 if (colspan) {
7701 html.push(" colspan=\"".concat(colspan, "\" "));
7702 }
7703
7704 html.push('>');
7705 html.push('<div class="th-inner">');
7706 var value = '';
7707
7708 if (this.footerData && this.footerData.length > 0) {
7709 value = this.footerData[0][column.field] || '';
7710 }
7711
7712 html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
7713 html.push('</div>');
7714 html.push('<div class="fht-cell"></div>');
7715 html.push('</div>');
7716 html.push('</th>');
7717 }
7718 } catch (err) {
7719 _iterator4.e(err);
7720 } finally {
7721 _iterator4.f();
7722 }
7723
7724 if (detailTemplate && this.options.detailViewAlign === 'right') {
7725 html.push(detailTemplate);
7726 }
7727
7728 if (!this.options.height && !this.$tableFooter.length) {
7729 this.$el.append('<tfoot><tr></tr></tfoot>');
7730 this.$tableFooter = this.$el.find('tfoot');
7731 }
7732
7733 if (!this.$tableFooter.find('tr').length) {
7734 this.$tableFooter.html('<table><thead><tr></tr></thead></table>');
7735 }
7736
7737 this.$tableFooter.find('tr').html(html.join(''));
7738 this.trigger('post-footer', this.$tableFooter);
7739 }
7740 }, {
7741 key: "fitFooter",
7742 value: function fitFooter() {
7743 var _this15 = this;
7744
7745 if (this.$el.is(':hidden')) {
7746 setTimeout(function () {
7747 return _this15.fitFooter();
7748 }, 100);
7749 return;
7750 }
7751
7752 var fixedBody = this.$tableBody.get(0);
7753 var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
7754 this.$tableFooter.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).attr('class', this.$el.attr('class'));
7755 var $ths = this.$tableFooter.find('th');
7756 var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
7757 $ths.find('.fht-cell').width('auto');
7758
7759 while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
7760 $tr = $tr.next();
7761 }
7762
7763 var trLength = $tr.find('> *').length;
7764 $tr.find('> *').each(function (i, el) {
7765 var $this = $__default["default"](el);
7766
7767 if (Utils.hasDetailViewIcon(_this15.options)) {
7768 if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
7769 var $thDetail = $ths.filter('.detail');
7770
7771 var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
7772
7773 $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
7774 return;
7775 }
7776 }
7777
7778 var $th = $ths.eq(i);
7779 var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
7780 $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
7781 });
7782 this.horizontalScroll();
7783 }
7784 }, {
7785 key: "horizontalScroll",
7786 value: function horizontalScroll() {
7787 var _this16 = this;
7788
7789 // horizontal scroll event
7790 // TODO: it's probably better improving the layout than binding to scroll event
7791 this.$tableBody.off('scroll').on('scroll', function () {
7792 var scrollLeft = _this16.$tableBody.scrollLeft();
7793
7794 if (_this16.options.showHeader && _this16.options.height) {
7795 _this16.$tableHeader.scrollLeft(scrollLeft);
7796 }
7797
7798 if (_this16.options.showFooter && !_this16.options.cardView) {
7799 _this16.$tableFooter.scrollLeft(scrollLeft);
7800 }
7801
7802 _this16.trigger('scroll-body', _this16.$tableBody);
7803 });
7804 }
7805 }, {
7806 key: "getVisibleFields",
7807 value: function getVisibleFields() {
7808 var visibleFields = [];
7809
7810 var _iterator5 = _createForOfIteratorHelper(this.header.fields),
7811 _step5;
7812
7813 try {
7814 for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
7815 var field = _step5.value;
7816 var column = this.columns[this.fieldsColumnsIndex[field]];
7817
7818 if (!column || !column.visible || this.options.cardView && !column.cardVisible) {
7819 continue;
7820 }
7821
7822 visibleFields.push(field);
7823 }
7824 } catch (err) {
7825 _iterator5.e(err);
7826 } finally {
7827 _iterator5.f();
7828 }
7829
7830 return visibleFields;
7831 }
7832 }, {
7833 key: "initHiddenRows",
7834 value: function initHiddenRows() {
7835 this.hiddenRows = [];
7836 } // PUBLIC FUNCTION DEFINITION
7837 // =======================
7838
7839 }, {
7840 key: "getOptions",
7841 value: function getOptions() {
7842 // deep copy and remove data
7843 var options = $__default["default"].extend({}, this.options);
7844 delete options.data;
7845 return $__default["default"].extend(true, {}, options);
7846 }
7847 }, {
7848 key: "refreshOptions",
7849 value: function refreshOptions(options) {
7850 // If the objects are equivalent then avoid the call of destroy / init methods
7851 if (Utils.compareObjects(this.options, options, true)) {
7852 return;
7853 }
7854
7855 this.options = $__default["default"].extend(this.options, options);
7856 this.trigger('refresh-options', this.options);
7857 this.destroy();
7858 this.init();
7859 }
7860 }, {
7861 key: "getData",
7862 value: function getData(params) {
7863 var _this17 = this;
7864
7865 var data = this.options.data;
7866
7867 if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || this.enableCustomSort || // Fix #4616: this.enableCustomSort is for extensions
7868 !Utils.isEmptyObject(this.filterColumns) || typeof this.options.filterOptions.filterAlgorithm === 'function' || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
7869 data = this.data;
7870 }
7871
7872 if (params && params.useCurrentPage) {
7873 data = data.slice(this.pageFrom - 1, this.pageTo);
7874 }
7875
7876 if (params && !params.includeHiddenRows) {
7877 var hiddenRows = this.getHiddenRows();
7878 data = data.filter(function (row) {
7879 return Utils.findIndex(hiddenRows, row) === -1;
7880 });
7881 }
7882
7883 if (params && params.formatted) {
7884 data.forEach(function (row) {
7885 for (var _i14 = 0, _Object$entries13 = Object.entries(row); _i14 < _Object$entries13.length; _i14++) {
7886 var _Object$entries13$_i = _slicedToArray(_Object$entries13[_i14], 2),
7887 key = _Object$entries13$_i[0],
7888 value = _Object$entries13$_i[1];
7889
7890 var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
7891
7892 if (!column) {
7893 return;
7894 }
7895
7896 row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
7897 }
7898 });
7899 }
7900
7901 return data;
7902 }
7903 }, {
7904 key: "getSelections",
7905 value: function getSelections() {
7906 var _this18 = this;
7907
7908 return (this.options.maintainMetaData ? this.options.data : this.data).filter(function (row) {
7909 return row[_this18.header.stateField] === true;
7910 });
7911 }
7912 }, {
7913 key: "load",
7914 value: function load(_data) {
7915 var fixedScroll = false;
7916 var data = _data; // #431: support pagination
7917
7918 if (this.options.pagination && this.options.sidePagination === 'server') {
7919 this.options.totalRows = data[this.options.totalField];
7920 this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
7921 this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
7922 }
7923
7924 fixedScroll = data.fixedScroll;
7925 data = Array.isArray(data) ? data : data[this.options.dataField];
7926 this.initData(data);
7927 this.initSearch();
7928 this.initPagination();
7929 this.initBody(fixedScroll);
7930 }
7931 }, {
7932 key: "append",
7933 value: function append(data) {
7934 this.initData(data, 'append');
7935 this.initSearch();
7936 this.initPagination();
7937 this.initSort();
7938 this.initBody(true);
7939 }
7940 }, {
7941 key: "prepend",
7942 value: function prepend(data) {
7943 this.initData(data, 'prepend');
7944 this.initSearch();
7945 this.initPagination();
7946 this.initSort();
7947 this.initBody(true);
7948 }
7949 }, {
7950 key: "remove",
7951 value: function remove(params) {
7952 var removed = 0;
7953
7954 for (var i = this.options.data.length - 1; i >= 0; i--) {
7955 var row = this.options.data[i];
7956 var value = Utils.getItemField(row, params.field, this.options.escape, row.escape);
7957
7958 if (value === undefined && params.field !== '$index') {
7959 continue;
7960 }
7961
7962 if (!row.hasOwnProperty(params.field) && params.field === '$index' && params.values.includes(i) || params.values.includes(value)) {
7963 removed++;
7964 this.options.data.splice(i, 1);
7965 }
7966 }
7967
7968 if (!removed) {
7969 return;
7970 }
7971
7972 if (this.options.sidePagination === 'server') {
7973 this.options.totalRows -= removed;
7974 this.data = _toConsumableArray(this.options.data);
7975 }
7976
7977 this.initSearch();
7978 this.initPagination();
7979 this.initSort();
7980 this.initBody(true);
7981 }
7982 }, {
7983 key: "removeAll",
7984 value: function removeAll() {
7985 if (this.options.data.length > 0) {
7986 this.options.data.splice(0, this.options.data.length);
7987 this.initSearch();
7988 this.initPagination();
7989 this.initBody(true);
7990 }
7991 }
7992 }, {
7993 key: "insertRow",
7994 value: function insertRow(params) {
7995 if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
7996 return;
7997 }
7998
7999 this.options.data.splice(params.index, 0, params.row);
8000 this.initSearch();
8001 this.initPagination();
8002 this.initSort();
8003 this.initBody(true);
8004 }
8005 }, {
8006 key: "updateRow",
8007 value: function updateRow(params) {
8008 var allParams = Array.isArray(params) ? params : [params];
8009
8010 var _iterator6 = _createForOfIteratorHelper(allParams),
8011 _step6;
8012
8013 try {
8014 for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
8015 var _params = _step6.value;
8016
8017 if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
8018 continue;
8019 }
8020
8021 if (_params.hasOwnProperty('replace') && _params.replace) {
8022 this.options.data[_params.index] = _params.row;
8023 } else {
8024 $__default["default"].extend(this.options.data[_params.index], _params.row);
8025 }
8026 }
8027 } catch (err) {
8028 _iterator6.e(err);
8029 } finally {
8030 _iterator6.f();
8031 }
8032
8033 this.initSearch();
8034 this.initPagination();
8035 this.initSort();
8036 this.initBody(true);
8037 }
8038 }, {
8039 key: "getRowByUniqueId",
8040 value: function getRowByUniqueId(_id) {
8041 var uniqueId = this.options.uniqueId;
8042 var len = this.options.data.length;
8043 var id = _id;
8044 var dataRow = null;
8045 var i;
8046 var row;
8047
8048 for (i = len - 1; i >= 0; i--) {
8049 row = this.options.data[i];
8050 var rowUniqueId = Utils.getItemField(row, uniqueId, this.options.escape, row.escape);
8051
8052 if (rowUniqueId === undefined) {
8053 continue;
8054 }
8055
8056 if (typeof rowUniqueId === 'string') {
8057 id = id.toString();
8058 } else if (typeof rowUniqueId === 'number') {
8059 if (Number(rowUniqueId) === rowUniqueId && rowUniqueId % 1 === 0) {
8060 id = parseInt(id, 10);
8061 } else if (rowUniqueId === Number(rowUniqueId) && rowUniqueId !== 0) {
8062 id = parseFloat(id);
8063 }
8064 }
8065
8066 if (rowUniqueId === id) {
8067 dataRow = row;
8068 break;
8069 }
8070 }
8071
8072 return dataRow;
8073 }
8074 }, {
8075 key: "updateByUniqueId",
8076 value: function updateByUniqueId(params) {
8077 var allParams = Array.isArray(params) ? params : [params];
8078 var updatedUid = null;
8079
8080 var _iterator7 = _createForOfIteratorHelper(allParams),
8081 _step7;
8082
8083 try {
8084 for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
8085 var _params2 = _step7.value;
8086
8087 if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
8088 continue;
8089 }
8090
8091 var rowId = this.options.data.indexOf(this.getRowByUniqueId(_params2.id));
8092
8093 if (rowId === -1) {
8094 continue;
8095 }
8096
8097 if (_params2.hasOwnProperty('replace') && _params2.replace) {
8098 this.options.data[rowId] = _params2.row;
8099 } else {
8100 $__default["default"].extend(this.options.data[rowId], _params2.row);
8101 }
8102
8103 updatedUid = _params2.id;
8104 }
8105 } catch (err) {
8106 _iterator7.e(err);
8107 } finally {
8108 _iterator7.f();
8109 }
8110
8111 this.initSearch();
8112 this.initPagination();
8113 this.initSort();
8114 this.initBody(true, updatedUid);
8115 }
8116 }, {
8117 key: "removeByUniqueId",
8118 value: function removeByUniqueId(id) {
8119 var len = this.options.data.length;
8120 var row = this.getRowByUniqueId(id);
8121
8122 if (row) {
8123 this.options.data.splice(this.options.data.indexOf(row), 1);
8124 }
8125
8126 if (len === this.options.data.length) {
8127 return;
8128 }
8129
8130 if (this.options.sidePagination === 'server') {
8131 this.options.totalRows -= 1;
8132 this.data = _toConsumableArray(this.options.data);
8133 }
8134
8135 this.initSearch();
8136 this.initPagination();
8137 this.initBody(true);
8138 }
8139 }, {
8140 key: "_updateCellOnly",
8141 value: function _updateCellOnly(field, index) {
8142 var rowHtml = this.initRow(this.options.data[index], index);
8143 var fieldIndex = this.getVisibleFields().indexOf(field);
8144
8145 if (fieldIndex === -1) {
8146 return;
8147 }
8148
8149 fieldIndex += Utils.getDetailViewIndexOffset(this.options);
8150 this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($__default["default"](rowHtml).find(">td:eq(".concat(fieldIndex, ")")));
8151 this.initBodyEvent();
8152 this.initFooter();
8153 this.resetView();
8154 this.updateSelected();
8155 }
8156 }, {
8157 key: "updateCell",
8158 value: function updateCell(params) {
8159 if (!params.hasOwnProperty('index') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
8160 return;
8161 }
8162
8163 this.options.data[params.index][params.field] = params.value;
8164
8165 if (params.reinit === false) {
8166 this._updateCellOnly(params.field, params.index);
8167
8168 return;
8169 }
8170
8171 this.initSort();
8172 this.initBody(true);
8173 }
8174 }, {
8175 key: "updateCellByUniqueId",
8176 value: function updateCellByUniqueId(params) {
8177 var _this19 = this;
8178
8179 var allParams = Array.isArray(params) ? params : [params];
8180 allParams.forEach(function (_ref6) {
8181 var id = _ref6.id,
8182 field = _ref6.field,
8183 value = _ref6.value;
8184
8185 var index = _this19.options.data.indexOf(_this19.getRowByUniqueId(id));
8186
8187 if (index === -1) {
8188 return;
8189 }
8190
8191 _this19.options.data[index][field] = value;
8192 });
8193
8194 if (params.reinit === false) {
8195 this._updateCellOnly(params.field, this.options.data.indexOf(this.getRowByUniqueId(params.id)));
8196
8197 return;
8198 }
8199
8200 this.initSort();
8201 this.initBody(true);
8202 }
8203 }, {
8204 key: "showRow",
8205 value: function showRow(params) {
8206 this._toggleRow(params, true);
8207 }
8208 }, {
8209 key: "hideRow",
8210 value: function hideRow(params) {
8211 this._toggleRow(params, false);
8212 }
8213 }, {
8214 key: "_toggleRow",
8215 value: function _toggleRow(params, visible) {
8216 var row;
8217
8218 if (params.hasOwnProperty('index')) {
8219 row = this.getData()[params.index];
8220 } else if (params.hasOwnProperty('uniqueId')) {
8221 row = this.getRowByUniqueId(params.uniqueId);
8222 }
8223
8224 if (!row) {
8225 return;
8226 }
8227
8228 var index = Utils.findIndex(this.hiddenRows, row);
8229
8230 if (!visible && index === -1) {
8231 this.hiddenRows.push(row);
8232 } else if (visible && index > -1) {
8233 this.hiddenRows.splice(index, 1);
8234 }
8235
8236 this.initBody(true);
8237 this.initPagination();
8238 }
8239 }, {
8240 key: "getHiddenRows",
8241 value: function getHiddenRows(show) {
8242 if (show) {
8243 this.initHiddenRows();
8244 this.initBody(true);
8245 this.initPagination();
8246 return;
8247 }
8248
8249 var data = this.getData();
8250 var rows = [];
8251
8252 var _iterator8 = _createForOfIteratorHelper(data),
8253 _step8;
8254
8255 try {
8256 for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
8257 var row = _step8.value;
8258
8259 if (this.hiddenRows.includes(row)) {
8260 rows.push(row);
8261 }
8262 }
8263 } catch (err) {
8264 _iterator8.e(err);
8265 } finally {
8266 _iterator8.f();
8267 }
8268
8269 this.hiddenRows = rows;
8270 return rows;
8271 }
8272 }, {
8273 key: "showColumn",
8274 value: function showColumn(field) {
8275 var _this20 = this;
8276
8277 var fields = Array.isArray(field) ? field : [field];
8278 fields.forEach(function (field) {
8279 _this20._toggleColumn(_this20.fieldsColumnsIndex[field], true, true);
8280 });
8281 }
8282 }, {
8283 key: "hideColumn",
8284 value: function hideColumn(field) {
8285 var _this21 = this;
8286
8287 var fields = Array.isArray(field) ? field : [field];
8288 fields.forEach(function (field) {
8289 _this21._toggleColumn(_this21.fieldsColumnsIndex[field], false, true);
8290 });
8291 }
8292 }, {
8293 key: "_toggleColumn",
8294 value: function _toggleColumn(index, checked, needUpdate) {
8295 if (index === -1 || this.columns[index].visible === checked) {
8296 return;
8297 }
8298
8299 this.columns[index].visible = checked;
8300 this.initHeader();
8301 this.initSearch();
8302 this.initPagination();
8303 this.initBody();
8304
8305 if (this.options.showColumns) {
8306 var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
8307
8308 if (needUpdate) {
8309 $items.filter(Utils.sprintf('[value="%s"]', index)).prop('checked', checked);
8310 }
8311
8312 if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
8313 $items.filter(':checked').prop('disabled', true);
8314 }
8315 }
8316 }
8317 }, {
8318 key: "getVisibleColumns",
8319 value: function getVisibleColumns() {
8320 var _this22 = this;
8321
8322 return this.columns.filter(function (column) {
8323 return column.visible && !_this22.isSelectionColumn(column);
8324 });
8325 }
8326 }, {
8327 key: "getHiddenColumns",
8328 value: function getHiddenColumns() {
8329 return this.columns.filter(function (_ref7) {
8330 var visible = _ref7.visible;
8331 return !visible;
8332 });
8333 }
8334 }, {
8335 key: "isSelectionColumn",
8336 value: function isSelectionColumn(column) {
8337 return column.radio || column.checkbox;
8338 }
8339 }, {
8340 key: "showAllColumns",
8341 value: function showAllColumns() {
8342 this._toggleAllColumns(true);
8343 }
8344 }, {
8345 key: "hideAllColumns",
8346 value: function hideAllColumns() {
8347 this._toggleAllColumns(false);
8348 }
8349 }, {
8350 key: "_toggleAllColumns",
8351 value: function _toggleAllColumns(visible) {
8352 var _this23 = this;
8353
8354 var _iterator9 = _createForOfIteratorHelper(this.columns.slice().reverse()),
8355 _step9;
8356
8357 try {
8358 for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
8359 var column = _step9.value;
8360
8361 if (column.switchable) {
8362 if (!visible && this.options.showColumns && this.getVisibleColumns().filter(function (it) {
8363 return it.switchable;
8364 }).length === this.options.minimumCountColumns) {
8365 continue;
8366 }
8367
8368 column.visible = visible;
8369 }
8370 }
8371 } catch (err) {
8372 _iterator9.e(err);
8373 } finally {
8374 _iterator9.f();
8375 }
8376
8377 this.initHeader();
8378 this.initSearch();
8379 this.initPagination();
8380 this.initBody();
8381
8382 if (this.options.showColumns) {
8383 var $items = this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop('disabled', false);
8384
8385 if (visible) {
8386 $items.prop('checked', visible);
8387 } else {
8388 $items.get().reverse().forEach(function (item) {
8389 if ($items.filter(':checked').length > _this23.options.minimumCountColumns) {
8390 $__default["default"](item).prop('checked', visible);
8391 }
8392 });
8393 }
8394
8395 if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
8396 $items.filter(':checked').prop('disabled', true);
8397 }
8398 }
8399 }
8400 }, {
8401 key: "mergeCells",
8402 value: function mergeCells(options) {
8403 var row = options.index;
8404 var col = this.getVisibleFields().indexOf(options.field);
8405 var rowspan = options.rowspan || 1;
8406 var colspan = options.colspan || 1;
8407 var i;
8408 var j;
8409 var $tr = this.$body.find('>tr[data-index]');
8410 col += Utils.getDetailViewIndexOffset(this.options);
8411 var $td = $tr.eq(row).find('>td').eq(col);
8412
8413 if (row < 0 || col < 0 || row >= this.data.length) {
8414 return;
8415 }
8416
8417 for (i = row; i < row + rowspan; i++) {
8418 for (j = col; j < col + colspan; j++) {
8419 $tr.eq(i).find('>td').eq(j).hide();
8420 }
8421 }
8422
8423 $td.attr('rowspan', rowspan).attr('colspan', colspan).show();
8424 }
8425 }, {
8426 key: "checkAll",
8427 value: function checkAll() {
8428 this._toggleCheckAll(true);
8429 }
8430 }, {
8431 key: "uncheckAll",
8432 value: function uncheckAll() {
8433 this._toggleCheckAll(false);
8434 }
8435 }, {
8436 key: "_toggleCheckAll",
8437 value: function _toggleCheckAll(checked) {
8438 var rowsBefore = this.getSelections();
8439 this.$selectAll.add(this.$selectAll_).prop('checked', checked);
8440 this.$selectItem.filter(':enabled').prop('checked', checked);
8441 this.updateRows();
8442 this.updateSelected();
8443 var rowsAfter = this.getSelections();
8444
8445 if (checked) {
8446 this.trigger('check-all', rowsAfter, rowsBefore);
8447 return;
8448 }
8449
8450 this.trigger('uncheck-all', rowsAfter, rowsBefore);
8451 }
8452 }, {
8453 key: "checkInvert",
8454 value: function checkInvert() {
8455 var $items = this.$selectItem.filter(':enabled');
8456 var checked = $items.filter(':checked');
8457 $items.each(function (i, el) {
8458 $__default["default"](el).prop('checked', !$__default["default"](el).prop('checked'));
8459 });
8460 this.updateRows();
8461 this.updateSelected();
8462 this.trigger('uncheck-some', checked);
8463 checked = this.getSelections();
8464 this.trigger('check-some', checked);
8465 }
8466 }, {
8467 key: "check",
8468 value: function check(index) {
8469 this._toggleCheck(true, index);
8470 }
8471 }, {
8472 key: "uncheck",
8473 value: function uncheck(index) {
8474 this._toggleCheck(false, index);
8475 }
8476 }, {
8477 key: "_toggleCheck",
8478 value: function _toggleCheck(checked, index) {
8479 var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
8480 var row = this.data[index];
8481
8482 if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
8483 var _iterator10 = _createForOfIteratorHelper(this.options.data),
8484 _step10;
8485
8486 try {
8487 for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
8488 var r = _step10.value;
8489 r[this.header.stateField] = false;
8490 }
8491 } catch (err) {
8492 _iterator10.e(err);
8493 } finally {
8494 _iterator10.f();
8495 }
8496
8497 this.$selectItem.filter(':checked').not($el).prop('checked', false);
8498 }
8499
8500 row[this.header.stateField] = checked;
8501
8502 if (this.options.multipleSelectRow) {
8503 if (this.multipleSelectRowShiftKey && this.multipleSelectRowLastSelectedIndex >= 0) {
8504 var _ref8 = this.multipleSelectRowLastSelectedIndex < index ? [this.multipleSelectRowLastSelectedIndex, index] : [index, this.multipleSelectRowLastSelectedIndex],
8505 _ref9 = _slicedToArray(_ref8, 2),
8506 fromIndex = _ref9[0],
8507 toIndex = _ref9[1];
8508
8509 for (var i = fromIndex + 1; i < toIndex; i++) {
8510 this.data[i][this.header.stateField] = true;
8511 this.$selectItem.filter("[data-index=\"".concat(i, "\"]")).prop('checked', true);
8512 }
8513 }
8514
8515 this.multipleSelectRowCtrlKey = false;
8516 this.multipleSelectRowShiftKey = false;
8517 this.multipleSelectRowLastSelectedIndex = checked ? index : -1;
8518 }
8519
8520 $el.prop('checked', checked);
8521 this.updateSelected();
8522 this.trigger(checked ? 'check' : 'uncheck', this.data[index], $el);
8523 }
8524 }, {
8525 key: "checkBy",
8526 value: function checkBy(obj) {
8527 this._toggleCheckBy(true, obj);
8528 }
8529 }, {
8530 key: "uncheckBy",
8531 value: function uncheckBy(obj) {
8532 this._toggleCheckBy(false, obj);
8533 }
8534 }, {
8535 key: "_toggleCheckBy",
8536 value: function _toggleCheckBy(checked, obj) {
8537 var _this24 = this;
8538
8539 if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
8540 return;
8541 }
8542
8543 var rows = [];
8544 this.data.forEach(function (row, i) {
8545 if (!row.hasOwnProperty(obj.field)) {
8546 return false;
8547 }
8548
8549 if (obj.values.includes(row[obj.field])) {
8550 var $el = _this24.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
8551
8552 var onlyCurrentPage = obj.hasOwnProperty('onlyCurrentPage') ? obj.onlyCurrentPage : false;
8553 $el = checked ? $el.not(':checked') : $el.filter(':checked');
8554
8555 if (!$el.length && onlyCurrentPage) {
8556 return;
8557 }
8558
8559 $el.prop('checked', checked);
8560 row[_this24.header.stateField] = checked;
8561 rows.push(row);
8562
8563 _this24.trigger(checked ? 'check' : 'uncheck', row, $el);
8564 }
8565 });
8566 this.updateSelected();
8567 this.trigger(checked ? 'check-some' : 'uncheck-some', rows);
8568 }
8569 }, {
8570 key: "refresh",
8571 value: function refresh(params) {
8572 if (params && params.url) {
8573 this.options.url = params.url;
8574 }
8575
8576 if (params && params.pageNumber) {
8577 this.options.pageNumber = params.pageNumber;
8578 }
8579
8580 if (params && params.pageSize) {
8581 this.options.pageSize = params.pageSize;
8582 }
8583
8584 this.trigger('refresh', this.initServer(params && params.silent, params && params.query, params && params.url));
8585 }
8586 }, {
8587 key: "destroy",
8588 value: function destroy() {
8589 this.$el.insertBefore(this.$container);
8590 $__default["default"](this.options.toolbar).insertBefore(this.$el);
8591 this.$container.next().remove();
8592 this.$container.remove();
8593 this.$el.html(this.$el_.html()).css('margin-top', '0').attr('class', this.$el_.attr('class') || ''); // reset the class
8594
8595 var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
8596 $__default["default"](window).off(resizeEvent);
8597 }
8598 }, {
8599 key: "resetView",
8600 value: function resetView(params) {
8601 var padding = 0;
8602
8603 if (params && params.height) {
8604 this.options.height = params.height;
8605 }
8606
8607 this.$tableContainer.toggleClass('has-card-view', this.options.cardView);
8608
8609 if (this.options.height) {
8610 var fixedBody = this.$tableBody.get(0);
8611 this.hasScrollBar = fixedBody.scrollWidth > fixedBody.clientWidth;
8612 }
8613
8614 if (!this.options.cardView && this.options.showHeader && this.options.height) {
8615 this.$tableHeader.show();
8616 this.resetHeader();
8617 padding += this.$header.outerHeight(true) + 1;
8618 } else {
8619 this.$tableHeader.hide();
8620 this.trigger('post-header');
8621 }
8622
8623 if (!this.options.cardView && this.options.showFooter) {
8624 this.$tableFooter.show();
8625 this.fitFooter();
8626
8627 if (this.options.height) {
8628 padding += this.$tableFooter.outerHeight(true);
8629 }
8630 }
8631
8632 if (this.$container.hasClass('fullscreen')) {
8633 this.$tableContainer.css('height', '');
8634 this.$tableContainer.css('width', '');
8635 } else if (this.options.height) {
8636 if (this.$tableBorder) {
8637 this.$tableBorder.css('width', '');
8638 this.$tableBorder.css('height', '');
8639 }
8640
8641 var toolbarHeight = this.$toolbar.outerHeight(true);
8642 var paginationHeight = this.$pagination.outerHeight(true);
8643 var height = this.options.height - toolbarHeight - paginationHeight;
8644 var $bodyTable = this.$tableBody.find('>table');
8645 var tableHeight = $bodyTable.outerHeight();
8646 this.$tableContainer.css('height', "".concat(height, "px"));
8647
8648 if (this.$tableBorder && $bodyTable.is(':visible')) {
8649 var tableBorderHeight = height - tableHeight - 2;
8650
8651 if (this.hasScrollBar) {
8652 tableBorderHeight -= Utils.getScrollBarWidth();
8653 }
8654
8655 this.$tableBorder.css('width', "".concat($bodyTable.outerWidth(), "px"));
8656 this.$tableBorder.css('height', "".concat(tableBorderHeight, "px"));
8657 }
8658 }
8659
8660 if (this.options.cardView) {
8661 // remove the element css
8662 this.$el.css('margin-top', '0');
8663 this.$tableContainer.css('padding-bottom', '0');
8664 this.$tableFooter.hide();
8665 } else {
8666 // Assign the correct sortable arrow
8667 this.getCaret();
8668 this.$tableContainer.css('padding-bottom', "".concat(padding, "px"));
8669 }
8670
8671 this.trigger('reset-view');
8672 }
8673 }, {
8674 key: "showLoading",
8675 value: function showLoading() {
8676 this.$tableLoading.toggleClass('open', true);
8677 var fontSize = this.options.loadingFontSize;
8678
8679 if (this.options.loadingFontSize === 'auto') {
8680 fontSize = this.$tableLoading.width() * 0.04;
8681 fontSize = Math.max(12, fontSize);
8682 fontSize = Math.min(32, fontSize);
8683 fontSize = "".concat(fontSize, "px");
8684 }
8685
8686 this.$tableLoading.find('.loading-text').css('font-size', fontSize);
8687 }
8688 }, {
8689 key: "hideLoading",
8690 value: function hideLoading() {
8691 this.$tableLoading.toggleClass('open', false);
8692 }
8693 }, {
8694 key: "togglePagination",
8695 value: function togglePagination() {
8696 this.options.pagination = !this.options.pagination;
8697 var icon = this.options.showButtonIcons ? this.options.pagination ? this.options.icons.paginationSwitchDown : this.options.icons.paginationSwitchUp : '';
8698 var text = this.options.showButtonText ? this.options.pagination ? this.options.formatPaginationSwitchUp() : this.options.formatPaginationSwitchDown() : '';
8699 this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
8700 this.updatePagination();
8701 this.trigger('toggle-pagination', this.options.pagination);
8702 }
8703 }, {
8704 key: "toggleFullscreen",
8705 value: function toggleFullscreen() {
8706 this.$el.closest('.bootstrap-table').toggleClass('fullscreen');
8707 this.resetView();
8708 }
8709 }, {
8710 key: "toggleView",
8711 value: function toggleView() {
8712 this.options.cardView = !this.options.cardView;
8713 this.initHeader();
8714 var icon = this.options.showButtonIcons ? this.options.cardView ? this.options.icons.toggleOn : this.options.icons.toggleOff : '';
8715 var text = this.options.showButtonText ? this.options.cardView ? this.options.formatToggleOff() : this.options.formatToggleOn() : '';
8716 this.$toolbar.find('button[name="toggle"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text)).attr('aria-label', text).attr('title', text);
8717 this.initBody();
8718 this.trigger('toggle', this.options.cardView);
8719 }
8720 }, {
8721 key: "resetSearch",
8722 value: function resetSearch(text) {
8723 var $search = Utils.getSearchInput(this);
8724 var textToUse = text || '';
8725 $search.val(textToUse);
8726 this.searchText = textToUse;
8727 this.onSearch({
8728 currentTarget: $search
8729 }, false);
8730 }
8731 }, {
8732 key: "filterBy",
8733 value: function filterBy(columns, options) {
8734 this.filterOptions = Utils.isEmptyObject(options) ? this.options.filterOptions : $__default["default"].extend(this.options.filterOptions, options);
8735 this.filterColumns = Utils.isEmptyObject(columns) ? {} : columns;
8736 this.options.pageNumber = 1;
8737 this.initSearch();
8738 this.updatePagination();
8739 }
8740 }, {
8741 key: "scrollTo",
8742 value: function scrollTo(params) {
8743 var options = {
8744 unit: 'px',
8745 value: 0
8746 };
8747
8748 if (_typeof(params) === 'object') {
8749 options = Object.assign(options, params);
8750 } else if (typeof params === 'string' && params === 'bottom') {
8751 options.value = this.$tableBody[0].scrollHeight;
8752 } else if (typeof params === 'string' || typeof params === 'number') {
8753 options.value = params;
8754 }
8755
8756 var scrollTo = options.value;
8757
8758 if (options.unit === 'rows') {
8759 scrollTo = 0;
8760 this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) {
8761 scrollTo += $__default["default"](el).outerHeight(true);
8762 });
8763 }
8764
8765 this.$tableBody.scrollTop(scrollTo);
8766 }
8767 }, {
8768 key: "getScrollPosition",
8769 value: function getScrollPosition() {
8770 return this.$tableBody.scrollTop();
8771 }
8772 }, {
8773 key: "selectPage",
8774 value: function selectPage(page) {
8775 if (page > 0 && page <= this.options.totalPages) {
8776 this.options.pageNumber = page;
8777 this.updatePagination();
8778 }
8779 }
8780 }, {
8781 key: "prevPage",
8782 value: function prevPage() {
8783 if (this.options.pageNumber > 1) {
8784 this.options.pageNumber--;
8785 this.updatePagination();
8786 }
8787 }
8788 }, {
8789 key: "nextPage",
8790 value: function nextPage() {
8791 if (this.options.pageNumber < this.options.totalPages) {
8792 this.options.pageNumber++;
8793 this.updatePagination();
8794 }
8795 }
8796 }, {
8797 key: "toggleDetailView",
8798 value: function toggleDetailView(index, _columnDetailFormatter) {
8799 var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"]', index));
8800
8801 if ($tr.next().is('tr.detail-view')) {
8802 this.collapseRow(index);
8803 } else {
8804 this.expandRow(index, _columnDetailFormatter);
8805 }
8806
8807 this.resetView();
8808 }
8809 }, {
8810 key: "expandRow",
8811 value: function expandRow(index, _columnDetailFormatter) {
8812 var row = this.data[index];
8813 var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
8814
8815 if (this.options.detailViewIcon) {
8816 $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailClose));
8817 }
8818
8819 if ($tr.next().is('tr.detail-view')) {
8820 return;
8821 }
8822
8823 $tr.after(Utils.sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.children('td').length));
8824 var $element = $tr.next().find('td');
8825 var detailFormatter = _columnDetailFormatter || this.options.detailFormatter;
8826 var content = Utils.calculateObjectValue(this.options, detailFormatter, [index, row, $element], '');
8827
8828 if ($element.length === 1) {
8829 $element.append(content);
8830 }
8831
8832 this.trigger('expand-row', index, row, $element);
8833 }
8834 }, {
8835 key: "expandRowByUniqueId",
8836 value: function expandRowByUniqueId(uniqueId) {
8837 var row = this.getRowByUniqueId(uniqueId);
8838
8839 if (!row) {
8840 return;
8841 }
8842
8843 this.expandRow(this.data.indexOf(row));
8844 }
8845 }, {
8846 key: "collapseRow",
8847 value: function collapseRow(index) {
8848 var row = this.data[index];
8849 var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
8850
8851 if (!$tr.next().is('tr.detail-view')) {
8852 return;
8853 }
8854
8855 if (this.options.detailViewIcon) {
8856 $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen));
8857 }
8858
8859 this.trigger('collapse-row', index, row, $tr.next());
8860 $tr.next().remove();
8861 }
8862 }, {
8863 key: "collapseRowByUniqueId",
8864 value: function collapseRowByUniqueId(uniqueId) {
8865 var row = this.getRowByUniqueId(uniqueId);
8866
8867 if (!row) {
8868 return;
8869 }
8870
8871 this.collapseRow(this.data.indexOf(row));
8872 }
8873 }, {
8874 key: "expandAllRows",
8875 value: function expandAllRows() {
8876 var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
8877
8878 for (var i = 0; i < trs.length; i++) {
8879 this.expandRow($__default["default"](trs[i]).data('index'));
8880 }
8881 }
8882 }, {
8883 key: "collapseAllRows",
8884 value: function collapseAllRows() {
8885 var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
8886
8887 for (var i = 0; i < trs.length; i++) {
8888 this.collapseRow($__default["default"](trs[i]).data('index'));
8889 }
8890 }
8891 }, {
8892 key: "updateColumnTitle",
8893 value: function updateColumnTitle(params) {
8894 if (!params.hasOwnProperty('field') || !params.hasOwnProperty('title')) {
8895 return;
8896 }
8897
8898 this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape ? Utils.escapeHTML(params.title) : params.title;
8899
8900 if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
8901 this.$header.find('th[data-field]').each(function (i, el) {
8902 if ($__default["default"](el).data('field') === params.field) {
8903 $__default["default"]($__default["default"](el).find('.th-inner')[0]).text(params.title);
8904 return false;
8905 }
8906 });
8907 this.resetView();
8908 }
8909 }
8910 }, {
8911 key: "updateFormatText",
8912 value: function updateFormatText(formatName, text) {
8913 if (!/^format/.test(formatName) || !this.options[formatName]) {
8914 return;
8915 }
8916
8917 if (typeof text === 'string') {
8918 this.options[formatName] = function () {
8919 return text;
8920 };
8921 } else if (typeof text === 'function') {
8922 this.options[formatName] = text;
8923 }
8924
8925 this.initToolbar();
8926 this.initPagination();
8927 this.initBody();
8928 }
8929 }]);
8930
8931 return BootstrapTable;
8932 }();
8933
8934 BootstrapTable.VERSION = Constants.VERSION;
8935 BootstrapTable.DEFAULTS = Constants.DEFAULTS;
8936 BootstrapTable.LOCALES = Constants.LOCALES;
8937 BootstrapTable.COLUMN_DEFAULTS = Constants.COLUMN_DEFAULTS;
8938 BootstrapTable.METHODS = Constants.METHODS;
8939 BootstrapTable.EVENTS = Constants.EVENTS; // BOOTSTRAP TABLE PLUGIN DEFINITION
8940 // =======================
8941
8942 $__default["default"].BootstrapTable = BootstrapTable;
8943
8944 $__default["default"].fn.bootstrapTable = function (option) {
8945 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {
8946 args[_key5 - 1] = arguments[_key5];
8947 }
8948
8949 var value;
8950 this.each(function (i, el) {
8951 var data = $__default["default"](el).data('bootstrap.table');
8952 var options = $__default["default"].extend({}, BootstrapTable.DEFAULTS, $__default["default"](el).data(), _typeof(option) === 'object' && option);
8953
8954 if (typeof option === 'string') {
8955 var _data2;
8956
8957 if (!Constants.METHODS.includes(option)) {
8958 throw new Error("Unknown method: ".concat(option));
8959 }
8960
8961 if (!data) {
8962 return;
8963 }
8964
8965 value = (_data2 = data)[option].apply(_data2, args);
8966
8967 if (option === 'destroy') {
8968 $__default["default"](el).removeData('bootstrap.table');
8969 }
8970 }
8971
8972 if (!data) {
8973 data = new $__default["default"].BootstrapTable(el, options);
8974 $__default["default"](el).data('bootstrap.table', data);
8975 data.init();
8976 }
8977 });
8978 return typeof value === 'undefined' ? this : value;
8979 };
8980
8981 $__default["default"].fn.bootstrapTable.Constructor = BootstrapTable;
8982 $__default["default"].fn.bootstrapTable.theme = Constants.THEME;
8983 $__default["default"].fn.bootstrapTable.VERSION = Constants.VERSION;
8984 $__default["default"].fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS;
8985 $__default["default"].fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS;
8986 $__default["default"].fn.bootstrapTable.events = BootstrapTable.EVENTS;
8987 $__default["default"].fn.bootstrapTable.locales = BootstrapTable.LOCALES;
8988 $__default["default"].fn.bootstrapTable.methods = BootstrapTable.METHODS;
8989 $__default["default"].fn.bootstrapTable.utils = Utils; // BOOTSTRAP TABLE INIT
8990 // =======================
8991
8992 $__default["default"](function () {
8993 $__default["default"]('[data-toggle="table"]').bootstrapTable();
8994 });
8995
8996 return BootstrapTable;
8997
8998}));