UNPKG

48.5 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
3 typeof define === 'function' && define.amd ? define(['jquery'], factory) :
4 (global = global || self, factory(global.jQuery));
5}(this, function ($) { 'use strict';
6
7 $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
8
9 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
10
11 function createCommonjsModule(fn, module) {
12 return module = { exports: {} }, fn(module, module.exports), module.exports;
13 }
14
15 var O = 'object';
16 var check = function (it) {
17 return it && it.Math == Math && it;
18 };
19
20 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
21 var global_1 =
22 // eslint-disable-next-line no-undef
23 check(typeof globalThis == O && globalThis) ||
24 check(typeof window == O && window) ||
25 check(typeof self == O && self) ||
26 check(typeof commonjsGlobal == O && commonjsGlobal) ||
27 // eslint-disable-next-line no-new-func
28 Function('return this')();
29
30 var fails = function (exec) {
31 try {
32 return !!exec();
33 } catch (error) {
34 return true;
35 }
36 };
37
38 // Thank's IE8 for his funny defineProperty
39 var descriptors = !fails(function () {
40 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
41 });
42
43 var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
44 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
45
46 // Nashorn ~ JDK8 bug
47 var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
48
49 // `Object.prototype.propertyIsEnumerable` method implementation
50 // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
51 var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
52 var descriptor = getOwnPropertyDescriptor(this, V);
53 return !!descriptor && descriptor.enumerable;
54 } : nativePropertyIsEnumerable;
55
56 var objectPropertyIsEnumerable = {
57 f: f
58 };
59
60 var createPropertyDescriptor = function (bitmap, value) {
61 return {
62 enumerable: !(bitmap & 1),
63 configurable: !(bitmap & 2),
64 writable: !(bitmap & 4),
65 value: value
66 };
67 };
68
69 var toString = {}.toString;
70
71 var classofRaw = function (it) {
72 return toString.call(it).slice(8, -1);
73 };
74
75 var split = ''.split;
76
77 // fallback for non-array-like ES3 and non-enumerable old V8 strings
78 var indexedObject = fails(function () {
79 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
80 // eslint-disable-next-line no-prototype-builtins
81 return !Object('z').propertyIsEnumerable(0);
82 }) ? function (it) {
83 return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
84 } : Object;
85
86 // `RequireObjectCoercible` abstract operation
87 // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
88 var requireObjectCoercible = function (it) {
89 if (it == undefined) throw TypeError("Can't call method on " + it);
90 return it;
91 };
92
93 // toObject with fallback for non-array-like ES3 strings
94
95
96
97 var toIndexedObject = function (it) {
98 return indexedObject(requireObjectCoercible(it));
99 };
100
101 var isObject = function (it) {
102 return typeof it === 'object' ? it !== null : typeof it === 'function';
103 };
104
105 // `ToPrimitive` abstract operation
106 // https://tc39.github.io/ecma262/#sec-toprimitive
107 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
108 // and the second argument - flag - preferred type is a string
109 var toPrimitive = function (input, PREFERRED_STRING) {
110 if (!isObject(input)) return input;
111 var fn, val;
112 if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
113 if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
114 if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
115 throw TypeError("Can't convert object to primitive value");
116 };
117
118 var hasOwnProperty = {}.hasOwnProperty;
119
120 var has = function (it, key) {
121 return hasOwnProperty.call(it, key);
122 };
123
124 var document = global_1.document;
125 // typeof document.createElement is 'object' in old IE
126 var EXISTS = isObject(document) && isObject(document.createElement);
127
128 var documentCreateElement = function (it) {
129 return EXISTS ? document.createElement(it) : {};
130 };
131
132 // Thank's IE8 for his funny defineProperty
133 var ie8DomDefine = !descriptors && !fails(function () {
134 return Object.defineProperty(documentCreateElement('div'), 'a', {
135 get: function () { return 7; }
136 }).a != 7;
137 });
138
139 var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
140
141 // `Object.getOwnPropertyDescriptor` method
142 // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
143 var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
144 O = toIndexedObject(O);
145 P = toPrimitive(P, true);
146 if (ie8DomDefine) try {
147 return nativeGetOwnPropertyDescriptor(O, P);
148 } catch (error) { /* empty */ }
149 if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
150 };
151
152 var objectGetOwnPropertyDescriptor = {
153 f: f$1
154 };
155
156 var anObject = function (it) {
157 if (!isObject(it)) {
158 throw TypeError(String(it) + ' is not an object');
159 } return it;
160 };
161
162 var nativeDefineProperty = Object.defineProperty;
163
164 // `Object.defineProperty` method
165 // https://tc39.github.io/ecma262/#sec-object.defineproperty
166 var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
167 anObject(O);
168 P = toPrimitive(P, true);
169 anObject(Attributes);
170 if (ie8DomDefine) try {
171 return nativeDefineProperty(O, P, Attributes);
172 } catch (error) { /* empty */ }
173 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
174 if ('value' in Attributes) O[P] = Attributes.value;
175 return O;
176 };
177
178 var objectDefineProperty = {
179 f: f$2
180 };
181
182 var hide = descriptors ? function (object, key, value) {
183 return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
184 } : function (object, key, value) {
185 object[key] = value;
186 return object;
187 };
188
189 var setGlobal = function (key, value) {
190 try {
191 hide(global_1, key, value);
192 } catch (error) {
193 global_1[key] = value;
194 } return value;
195 };
196
197 var shared = createCommonjsModule(function (module) {
198 var SHARED = '__core-js_shared__';
199 var store = global_1[SHARED] || setGlobal(SHARED, {});
200
201 (module.exports = function (key, value) {
202 return store[key] || (store[key] = value !== undefined ? value : {});
203 })('versions', []).push({
204 version: '3.1.3',
205 mode: 'global',
206 copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
207 });
208 });
209
210 var functionToString = shared('native-function-to-string', Function.toString);
211
212 var WeakMap = global_1.WeakMap;
213
214 var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
215
216 var id = 0;
217 var postfix = Math.random();
218
219 var uid = function (key) {
220 return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
221 };
222
223 var keys = shared('keys');
224
225 var sharedKey = function (key) {
226 return keys[key] || (keys[key] = uid(key));
227 };
228
229 var hiddenKeys = {};
230
231 var WeakMap$1 = global_1.WeakMap;
232 var set, get, has$1;
233
234 var enforce = function (it) {
235 return has$1(it) ? get(it) : set(it, {});
236 };
237
238 var getterFor = function (TYPE) {
239 return function (it) {
240 var state;
241 if (!isObject(it) || (state = get(it)).type !== TYPE) {
242 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
243 } return state;
244 };
245 };
246
247 if (nativeWeakMap) {
248 var store = new WeakMap$1();
249 var wmget = store.get;
250 var wmhas = store.has;
251 var wmset = store.set;
252 set = function (it, metadata) {
253 wmset.call(store, it, metadata);
254 return metadata;
255 };
256 get = function (it) {
257 return wmget.call(store, it) || {};
258 };
259 has$1 = function (it) {
260 return wmhas.call(store, it);
261 };
262 } else {
263 var STATE = sharedKey('state');
264 hiddenKeys[STATE] = true;
265 set = function (it, metadata) {
266 hide(it, STATE, metadata);
267 return metadata;
268 };
269 get = function (it) {
270 return has(it, STATE) ? it[STATE] : {};
271 };
272 has$1 = function (it) {
273 return has(it, STATE);
274 };
275 }
276
277 var internalState = {
278 set: set,
279 get: get,
280 has: has$1,
281 enforce: enforce,
282 getterFor: getterFor
283 };
284
285 var redefine = createCommonjsModule(function (module) {
286 var getInternalState = internalState.get;
287 var enforceInternalState = internalState.enforce;
288 var TEMPLATE = String(functionToString).split('toString');
289
290 shared('inspectSource', function (it) {
291 return functionToString.call(it);
292 });
293
294 (module.exports = function (O, key, value, options) {
295 var unsafe = options ? !!options.unsafe : false;
296 var simple = options ? !!options.enumerable : false;
297 var noTargetGet = options ? !!options.noTargetGet : false;
298 if (typeof value == 'function') {
299 if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
300 enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
301 }
302 if (O === global_1) {
303 if (simple) O[key] = value;
304 else setGlobal(key, value);
305 return;
306 } else if (!unsafe) {
307 delete O[key];
308 } else if (!noTargetGet && O[key]) {
309 simple = true;
310 }
311 if (simple) O[key] = value;
312 else hide(O, key, value);
313 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
314 })(Function.prototype, 'toString', function toString() {
315 return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
316 });
317 });
318
319 var path = global_1;
320
321 var aFunction = function (variable) {
322 return typeof variable == 'function' ? variable : undefined;
323 };
324
325 var getBuiltIn = function (namespace, method) {
326 return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
327 : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
328 };
329
330 var ceil = Math.ceil;
331 var floor = Math.floor;
332
333 // `ToInteger` abstract operation
334 // https://tc39.github.io/ecma262/#sec-tointeger
335 var toInteger = function (argument) {
336 return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
337 };
338
339 var min = Math.min;
340
341 // `ToLength` abstract operation
342 // https://tc39.github.io/ecma262/#sec-tolength
343 var toLength = function (argument) {
344 return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
345 };
346
347 var max = Math.max;
348 var min$1 = Math.min;
349
350 // Helper for a popular repeating case of the spec:
351 // Let integer be ? ToInteger(index).
352 // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
353 var toAbsoluteIndex = function (index, length) {
354 var integer = toInteger(index);
355 return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
356 };
357
358 // `Array.prototype.{ indexOf, includes }` methods implementation
359 var createMethod = function (IS_INCLUDES) {
360 return function ($this, el, fromIndex) {
361 var O = toIndexedObject($this);
362 var length = toLength(O.length);
363 var index = toAbsoluteIndex(fromIndex, length);
364 var value;
365 // Array#includes uses SameValueZero equality algorithm
366 // eslint-disable-next-line no-self-compare
367 if (IS_INCLUDES && el != el) while (length > index) {
368 value = O[index++];
369 // eslint-disable-next-line no-self-compare
370 if (value != value) return true;
371 // Array#indexOf ignores holes, Array#includes - not
372 } else for (;length > index; index++) {
373 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
374 } return !IS_INCLUDES && -1;
375 };
376 };
377
378 var arrayIncludes = {
379 // `Array.prototype.includes` method
380 // https://tc39.github.io/ecma262/#sec-array.prototype.includes
381 includes: createMethod(true),
382 // `Array.prototype.indexOf` method
383 // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
384 indexOf: createMethod(false)
385 };
386
387 var indexOf = arrayIncludes.indexOf;
388
389
390 var objectKeysInternal = function (object, names) {
391 var O = toIndexedObject(object);
392 var i = 0;
393 var result = [];
394 var key;
395 for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
396 // Don't enum bug & hidden keys
397 while (names.length > i) if (has(O, key = names[i++])) {
398 ~indexOf(result, key) || result.push(key);
399 }
400 return result;
401 };
402
403 // IE8- don't enum bug keys
404 var enumBugKeys = [
405 'constructor',
406 'hasOwnProperty',
407 'isPrototypeOf',
408 'propertyIsEnumerable',
409 'toLocaleString',
410 'toString',
411 'valueOf'
412 ];
413
414 var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
415
416 // `Object.getOwnPropertyNames` method
417 // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
418 var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
419 return objectKeysInternal(O, hiddenKeys$1);
420 };
421
422 var objectGetOwnPropertyNames = {
423 f: f$3
424 };
425
426 var f$4 = Object.getOwnPropertySymbols;
427
428 var objectGetOwnPropertySymbols = {
429 f: f$4
430 };
431
432 // all object keys, includes non-enumerable and symbols
433 var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
434 var keys = objectGetOwnPropertyNames.f(anObject(it));
435 var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
436 return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
437 };
438
439 var copyConstructorProperties = function (target, source) {
440 var keys = ownKeys(source);
441 var defineProperty = objectDefineProperty.f;
442 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
443 for (var i = 0; i < keys.length; i++) {
444 var key = keys[i];
445 if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
446 }
447 };
448
449 var replacement = /#|\.prototype\./;
450
451 var isForced = function (feature, detection) {
452 var value = data[normalize(feature)];
453 return value == POLYFILL ? true
454 : value == NATIVE ? false
455 : typeof detection == 'function' ? fails(detection)
456 : !!detection;
457 };
458
459 var normalize = isForced.normalize = function (string) {
460 return String(string).replace(replacement, '.').toLowerCase();
461 };
462
463 var data = isForced.data = {};
464 var NATIVE = isForced.NATIVE = 'N';
465 var POLYFILL = isForced.POLYFILL = 'P';
466
467 var isForced_1 = isForced;
468
469 var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
470
471
472
473
474
475
476 /*
477 options.target - name of the target object
478 options.global - target is the global object
479 options.stat - export as static methods of target
480 options.proto - export as prototype methods of target
481 options.real - real prototype method for the `pure` version
482 options.forced - export even if the native feature is available
483 options.bind - bind methods to the target, required for the `pure` version
484 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
485 options.unsafe - use the simple assignment of property instead of delete + defineProperty
486 options.sham - add a flag to not completely full polyfills
487 options.enumerable - export as enumerable property
488 options.noTargetGet - prevent calling a getter on target
489 */
490 var _export = function (options, source) {
491 var TARGET = options.target;
492 var GLOBAL = options.global;
493 var STATIC = options.stat;
494 var FORCED, target, key, targetProperty, sourceProperty, descriptor;
495 if (GLOBAL) {
496 target = global_1;
497 } else if (STATIC) {
498 target = global_1[TARGET] || setGlobal(TARGET, {});
499 } else {
500 target = (global_1[TARGET] || {}).prototype;
501 }
502 if (target) for (key in source) {
503 sourceProperty = source[key];
504 if (options.noTargetGet) {
505 descriptor = getOwnPropertyDescriptor$1(target, key);
506 targetProperty = descriptor && descriptor.value;
507 } else targetProperty = target[key];
508 FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
509 // contained in target
510 if (!FORCED && targetProperty !== undefined) {
511 if (typeof sourceProperty === typeof targetProperty) continue;
512 copyConstructorProperties(sourceProperty, targetProperty);
513 }
514 // add a flag to not completely full polyfills
515 if (options.sham || (targetProperty && targetProperty.sham)) {
516 hide(sourceProperty, 'sham', true);
517 }
518 // extend global
519 redefine(target, key, sourceProperty, options);
520 }
521 };
522
523 var aFunction$1 = function (it) {
524 if (typeof it != 'function') {
525 throw TypeError(String(it) + ' is not a function');
526 } return it;
527 };
528
529 // optional / simple context binding
530 var bindContext = function (fn, that, length) {
531 aFunction$1(fn);
532 if (that === undefined) return fn;
533 switch (length) {
534 case 0: return function () {
535 return fn.call(that);
536 };
537 case 1: return function (a) {
538 return fn.call(that, a);
539 };
540 case 2: return function (a, b) {
541 return fn.call(that, a, b);
542 };
543 case 3: return function (a, b, c) {
544 return fn.call(that, a, b, c);
545 };
546 }
547 return function (/* ...args */) {
548 return fn.apply(that, arguments);
549 };
550 };
551
552 // `ToObject` abstract operation
553 // https://tc39.github.io/ecma262/#sec-toobject
554 var toObject = function (argument) {
555 return Object(requireObjectCoercible(argument));
556 };
557
558 // `IsArray` abstract operation
559 // https://tc39.github.io/ecma262/#sec-isarray
560 var isArray = Array.isArray || function isArray(arg) {
561 return classofRaw(arg) == 'Array';
562 };
563
564 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
565 // Chrome 38 Symbol has incorrect toString conversion
566 // eslint-disable-next-line no-undef
567 return !String(Symbol());
568 });
569
570 var Symbol$1 = global_1.Symbol;
571 var store$1 = shared('wks');
572
573 var wellKnownSymbol = function (name) {
574 return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
575 || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
576 };
577
578 var SPECIES = wellKnownSymbol('species');
579
580 // `ArraySpeciesCreate` abstract operation
581 // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
582 var arraySpeciesCreate = function (originalArray, length) {
583 var C;
584 if (isArray(originalArray)) {
585 C = originalArray.constructor;
586 // cross-realm fallback
587 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
588 else if (isObject(C)) {
589 C = C[SPECIES];
590 if (C === null) C = undefined;
591 }
592 } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
593 };
594
595 var push = [].push;
596
597 // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
598 var createMethod$1 = function (TYPE) {
599 var IS_MAP = TYPE == 1;
600 var IS_FILTER = TYPE == 2;
601 var IS_SOME = TYPE == 3;
602 var IS_EVERY = TYPE == 4;
603 var IS_FIND_INDEX = TYPE == 6;
604 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
605 return function ($this, callbackfn, that, specificCreate) {
606 var O = toObject($this);
607 var self = indexedObject(O);
608 var boundFunction = bindContext(callbackfn, that, 3);
609 var length = toLength(self.length);
610 var index = 0;
611 var create = specificCreate || arraySpeciesCreate;
612 var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
613 var value, result;
614 for (;length > index; index++) if (NO_HOLES || index in self) {
615 value = self[index];
616 result = boundFunction(value, index, O);
617 if (TYPE) {
618 if (IS_MAP) target[index] = result; // map
619 else if (result) switch (TYPE) {
620 case 3: return true; // some
621 case 5: return value; // find
622 case 6: return index; // findIndex
623 case 2: push.call(target, value); // filter
624 } else if (IS_EVERY) return false; // every
625 }
626 }
627 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
628 };
629 };
630
631 var arrayIteration = {
632 // `Array.prototype.forEach` method
633 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
634 forEach: createMethod$1(0),
635 // `Array.prototype.map` method
636 // https://tc39.github.io/ecma262/#sec-array.prototype.map
637 map: createMethod$1(1),
638 // `Array.prototype.filter` method
639 // https://tc39.github.io/ecma262/#sec-array.prototype.filter
640 filter: createMethod$1(2),
641 // `Array.prototype.some` method
642 // https://tc39.github.io/ecma262/#sec-array.prototype.some
643 some: createMethod$1(3),
644 // `Array.prototype.every` method
645 // https://tc39.github.io/ecma262/#sec-array.prototype.every
646 every: createMethod$1(4),
647 // `Array.prototype.find` method
648 // https://tc39.github.io/ecma262/#sec-array.prototype.find
649 find: createMethod$1(5),
650 // `Array.prototype.findIndex` method
651 // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
652 findIndex: createMethod$1(6)
653 };
654
655 var SPECIES$1 = wellKnownSymbol('species');
656
657 var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
658 return !fails(function () {
659 var array = [];
660 var constructor = array.constructor = {};
661 constructor[SPECIES$1] = function () {
662 return { foo: 1 };
663 };
664 return array[METHOD_NAME](Boolean).foo !== 1;
665 });
666 };
667
668 var $filter = arrayIteration.filter;
669
670
671 // `Array.prototype.filter` method
672 // https://tc39.github.io/ecma262/#sec-array.prototype.filter
673 // with adding support of @@species
674 _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
675 filter: function filter(callbackfn /* , thisArg */) {
676 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
677 }
678 });
679
680 // `Object.keys` method
681 // https://tc39.github.io/ecma262/#sec-object.keys
682 var objectKeys = Object.keys || function keys(O) {
683 return objectKeysInternal(O, enumBugKeys);
684 };
685
686 // `Object.defineProperties` method
687 // https://tc39.github.io/ecma262/#sec-object.defineproperties
688 var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
689 anObject(O);
690 var keys = objectKeys(Properties);
691 var length = keys.length;
692 var index = 0;
693 var key;
694 while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
695 return O;
696 };
697
698 var html = getBuiltIn('document', 'documentElement');
699
700 var IE_PROTO = sharedKey('IE_PROTO');
701
702 var PROTOTYPE = 'prototype';
703 var Empty = function () { /* empty */ };
704
705 // Create object with fake `null` prototype: use iframe Object with cleared prototype
706 var createDict = function () {
707 // Thrash, waste and sodomy: IE GC bug
708 var iframe = documentCreateElement('iframe');
709 var length = enumBugKeys.length;
710 var lt = '<';
711 var script = 'script';
712 var gt = '>';
713 var js = 'java' + script + ':';
714 var iframeDocument;
715 iframe.style.display = 'none';
716 html.appendChild(iframe);
717 iframe.src = String(js);
718 iframeDocument = iframe.contentWindow.document;
719 iframeDocument.open();
720 iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
721 iframeDocument.close();
722 createDict = iframeDocument.F;
723 while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
724 return createDict();
725 };
726
727 // `Object.create` method
728 // https://tc39.github.io/ecma262/#sec-object.create
729 var objectCreate = Object.create || function create(O, Properties) {
730 var result;
731 if (O !== null) {
732 Empty[PROTOTYPE] = anObject(O);
733 result = new Empty();
734 Empty[PROTOTYPE] = null;
735 // add "__proto__" for Object.getPrototypeOf polyfill
736 result[IE_PROTO] = O;
737 } else result = createDict();
738 return Properties === undefined ? result : objectDefineProperties(result, Properties);
739 };
740
741 hiddenKeys[IE_PROTO] = true;
742
743 var UNSCOPABLES = wellKnownSymbol('unscopables');
744 var ArrayPrototype = Array.prototype;
745
746 // Array.prototype[@@unscopables]
747 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
748 if (ArrayPrototype[UNSCOPABLES] == undefined) {
749 hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
750 }
751
752 // add a key to Array.prototype[@@unscopables]
753 var addToUnscopables = function (key) {
754 ArrayPrototype[UNSCOPABLES][key] = true;
755 };
756
757 var $find = arrayIteration.find;
758
759
760 var FIND = 'find';
761 var SKIPS_HOLES = true;
762
763 // Shouldn't skip holes
764 if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
765
766 // `Array.prototype.find` method
767 // https://tc39.github.io/ecma262/#sec-array.prototype.find
768 _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
769 find: function find(callbackfn /* , that = undefined */) {
770 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
771 }
772 });
773
774 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
775 addToUnscopables(FIND);
776
777 var sloppyArrayMethod = function (METHOD_NAME, argument) {
778 var method = [][METHOD_NAME];
779 return !method || !fails(function () {
780 // eslint-disable-next-line no-useless-call,no-throw-literal
781 method.call(null, argument || function () { throw 1; }, 1);
782 });
783 };
784
785 var nativeJoin = [].join;
786
787 var ES3_STRINGS = indexedObject != Object;
788 var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
789
790 // `Array.prototype.join` method
791 // https://tc39.github.io/ecma262/#sec-array.prototype.join
792 _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
793 join: function join(separator) {
794 return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
795 }
796 });
797
798 var createProperty = function (object, key, value) {
799 var propertyKey = toPrimitive(key);
800 if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
801 else object[propertyKey] = value;
802 };
803
804 var SPECIES$2 = wellKnownSymbol('species');
805 var nativeSlice = [].slice;
806 var max$1 = Math.max;
807
808 // `Array.prototype.slice` method
809 // https://tc39.github.io/ecma262/#sec-array.prototype.slice
810 // fallback for not array-like ES3 strings and DOM objects
811 _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
812 slice: function slice(start, end) {
813 var O = toIndexedObject(this);
814 var length = toLength(O.length);
815 var k = toAbsoluteIndex(start, length);
816 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
817 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
818 var Constructor, result, n;
819 if (isArray(O)) {
820 Constructor = O.constructor;
821 // cross-realm fallback
822 if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
823 Constructor = undefined;
824 } else if (isObject(Constructor)) {
825 Constructor = Constructor[SPECIES$2];
826 if (Constructor === null) Constructor = undefined;
827 }
828 if (Constructor === Array || Constructor === undefined) {
829 return nativeSlice.call(O, k, fin);
830 }
831 }
832 result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
833 for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
834 result.length = n;
835 return result;
836 }
837 });
838
839 var nativeSort = [].sort;
840 var test = [1, 2, 3];
841
842 // IE8-
843 var FAILS_ON_UNDEFINED = fails(function () {
844 test.sort(undefined);
845 });
846 // V8 bug
847 var FAILS_ON_NULL = fails(function () {
848 test.sort(null);
849 });
850 // Old WebKit
851 var SLOPPY_METHOD$1 = sloppyArrayMethod('sort');
852
853 var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$1;
854
855 // `Array.prototype.sort` method
856 // https://tc39.github.io/ecma262/#sec-array.prototype.sort
857 _export({ target: 'Array', proto: true, forced: FORCED }, {
858 sort: function sort(comparefn) {
859 return comparefn === undefined
860 ? nativeSort.call(toObject(this))
861 : nativeSort.call(toObject(this), aFunction$1(comparefn));
862 }
863 });
864
865 var defineProperty = objectDefineProperty.f;
866
867 var FunctionPrototype = Function.prototype;
868 var FunctionPrototypeToString = FunctionPrototype.toString;
869 var nameRE = /^\s*function ([^ (]*)/;
870 var NAME = 'name';
871
872 // Function instances `.name` property
873 // https://tc39.github.io/ecma262/#sec-function-instances-name
874 if (descriptors && !(NAME in FunctionPrototype)) {
875 defineProperty(FunctionPrototype, NAME, {
876 configurable: true,
877 get: function () {
878 try {
879 return FunctionPrototypeToString.call(this).match(nameRE)[1];
880 } catch (error) {
881 return '';
882 }
883 }
884 });
885 }
886
887 // `RegExp.prototype.flags` getter implementation
888 // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
889 var regexpFlags = function () {
890 var that = anObject(this);
891 var result = '';
892 if (that.global) result += 'g';
893 if (that.ignoreCase) result += 'i';
894 if (that.multiline) result += 'm';
895 if (that.dotAll) result += 's';
896 if (that.unicode) result += 'u';
897 if (that.sticky) result += 'y';
898 return result;
899 };
900
901 var nativeExec = RegExp.prototype.exec;
902 // This always refers to the native implementation, because the
903 // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
904 // which loads this file before patching the method.
905 var nativeReplace = String.prototype.replace;
906
907 var patchedExec = nativeExec;
908
909 var UPDATES_LAST_INDEX_WRONG = (function () {
910 var re1 = /a/;
911 var re2 = /b*/g;
912 nativeExec.call(re1, 'a');
913 nativeExec.call(re2, 'a');
914 return re1.lastIndex !== 0 || re2.lastIndex !== 0;
915 })();
916
917 // nonparticipating capturing group, copied from es5-shim's String#split patch.
918 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
919
920 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
921
922 if (PATCH) {
923 patchedExec = function exec(str) {
924 var re = this;
925 var lastIndex, reCopy, match, i;
926
927 if (NPCG_INCLUDED) {
928 reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
929 }
930 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
931
932 match = nativeExec.call(re, str);
933
934 if (UPDATES_LAST_INDEX_WRONG && match) {
935 re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
936 }
937 if (NPCG_INCLUDED && match && match.length > 1) {
938 // Fix browsers whose `exec` methods don't consistently return `undefined`
939 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
940 nativeReplace.call(match[0], reCopy, function () {
941 for (i = 1; i < arguments.length - 2; i++) {
942 if (arguments[i] === undefined) match[i] = undefined;
943 }
944 });
945 }
946
947 return match;
948 };
949 }
950
951 var regexpExec = patchedExec;
952
953 var SPECIES$3 = wellKnownSymbol('species');
954
955 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
956 // #replace needs built-in support for named groups.
957 // #match works fine because it just return the exec results, even if it has
958 // a "grops" property.
959 var re = /./;
960 re.exec = function () {
961 var result = [];
962 result.groups = { a: '7' };
963 return result;
964 };
965 return ''.replace(re, '$<a>') !== '7';
966 });
967
968 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
969 // Weex JS has frozen built-in prototypes, so use try / catch wrapper
970 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
971 var re = /(?:)/;
972 var originalExec = re.exec;
973 re.exec = function () { return originalExec.apply(this, arguments); };
974 var result = 'ab'.split(re);
975 return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
976 });
977
978 var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
979 var SYMBOL = wellKnownSymbol(KEY);
980
981 var DELEGATES_TO_SYMBOL = !fails(function () {
982 // String methods call symbol-named RegEp methods
983 var O = {};
984 O[SYMBOL] = function () { return 7; };
985 return ''[KEY](O) != 7;
986 });
987
988 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
989 // Symbol-named RegExp methods call .exec
990 var execCalled = false;
991 var re = /a/;
992 re.exec = function () { execCalled = true; return null; };
993
994 if (KEY === 'split') {
995 // RegExp[@@split] doesn't call the regex's exec method, but first creates
996 // a new one. We need to return the patched regex when creating the new one.
997 re.constructor = {};
998 re.constructor[SPECIES$3] = function () { return re; };
999 }
1000
1001 re[SYMBOL]('');
1002 return !execCalled;
1003 });
1004
1005 if (
1006 !DELEGATES_TO_SYMBOL ||
1007 !DELEGATES_TO_EXEC ||
1008 (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
1009 (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
1010 ) {
1011 var nativeRegExpMethod = /./[SYMBOL];
1012 var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1013 if (regexp.exec === regexpExec) {
1014 if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1015 // The native String method already delegates to @@method (this
1016 // polyfilled function), leasing to infinite recursion.
1017 // We avoid it by directly calling the native @@method method.
1018 return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
1019 }
1020 return { done: true, value: nativeMethod.call(str, regexp, arg2) };
1021 }
1022 return { done: false };
1023 });
1024 var stringMethod = methods[0];
1025 var regexMethod = methods[1];
1026
1027 redefine(String.prototype, KEY, stringMethod);
1028 redefine(RegExp.prototype, SYMBOL, length == 2
1029 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
1030 // 21.2.5.11 RegExp.prototype[@@split](string, limit)
1031 ? function (string, arg) { return regexMethod.call(string, this, arg); }
1032 // 21.2.5.6 RegExp.prototype[@@match](string)
1033 // 21.2.5.9 RegExp.prototype[@@search](string)
1034 : function (string) { return regexMethod.call(string, this); }
1035 );
1036 if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
1037 }
1038 };
1039
1040 // `String.prototype.{ codePointAt, at }` methods implementation
1041 var createMethod$2 = function (CONVERT_TO_STRING) {
1042 return function ($this, pos) {
1043 var S = String(requireObjectCoercible($this));
1044 var position = toInteger(pos);
1045 var size = S.length;
1046 var first, second;
1047 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1048 first = S.charCodeAt(position);
1049 return first < 0xD800 || first > 0xDBFF || position + 1 === size
1050 || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
1051 ? CONVERT_TO_STRING ? S.charAt(position) : first
1052 : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1053 };
1054 };
1055
1056 var stringMultibyte = {
1057 // `String.prototype.codePointAt` method
1058 // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
1059 codeAt: createMethod$2(false),
1060 // `String.prototype.at` method
1061 // https://github.com/mathiasbynens/String.prototype.at
1062 charAt: createMethod$2(true)
1063 };
1064
1065 var charAt = stringMultibyte.charAt;
1066
1067 // `AdvanceStringIndex` abstract operation
1068 // https://tc39.github.io/ecma262/#sec-advancestringindex
1069 var advanceStringIndex = function (S, index, unicode) {
1070 return index + (unicode ? charAt(S, index).length : 1);
1071 };
1072
1073 // `RegExpExec` abstract operation
1074 // https://tc39.github.io/ecma262/#sec-regexpexec
1075 var regexpExecAbstract = function (R, S) {
1076 var exec = R.exec;
1077 if (typeof exec === 'function') {
1078 var result = exec.call(R, S);
1079 if (typeof result !== 'object') {
1080 throw TypeError('RegExp exec method returned something other than an Object or null');
1081 }
1082 return result;
1083 }
1084
1085 if (classofRaw(R) !== 'RegExp') {
1086 throw TypeError('RegExp#exec called on incompatible receiver');
1087 }
1088
1089 return regexpExec.call(R, S);
1090 };
1091
1092 var max$2 = Math.max;
1093 var min$2 = Math.min;
1094 var floor$1 = Math.floor;
1095 var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
1096 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
1097
1098 var maybeToString = function (it) {
1099 return it === undefined ? it : String(it);
1100 };
1101
1102 // @@replace logic
1103 fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
1104 return [
1105 // `String.prototype.replace` method
1106 // https://tc39.github.io/ecma262/#sec-string.prototype.replace
1107 function replace(searchValue, replaceValue) {
1108 var O = requireObjectCoercible(this);
1109 var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
1110 return replacer !== undefined
1111 ? replacer.call(searchValue, O, replaceValue)
1112 : nativeReplace.call(String(O), searchValue, replaceValue);
1113 },
1114 // `RegExp.prototype[@@replace]` method
1115 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
1116 function (regexp, replaceValue) {
1117 var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
1118 if (res.done) return res.value;
1119
1120 var rx = anObject(regexp);
1121 var S = String(this);
1122
1123 var functionalReplace = typeof replaceValue === 'function';
1124 if (!functionalReplace) replaceValue = String(replaceValue);
1125
1126 var global = rx.global;
1127 if (global) {
1128 var fullUnicode = rx.unicode;
1129 rx.lastIndex = 0;
1130 }
1131 var results = [];
1132 while (true) {
1133 var result = regexpExecAbstract(rx, S);
1134 if (result === null) break;
1135
1136 results.push(result);
1137 if (!global) break;
1138
1139 var matchStr = String(result[0]);
1140 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1141 }
1142
1143 var accumulatedResult = '';
1144 var nextSourcePosition = 0;
1145 for (var i = 0; i < results.length; i++) {
1146 result = results[i];
1147
1148 var matched = String(result[0]);
1149 var position = max$2(min$2(toInteger(result.index), S.length), 0);
1150 var captures = [];
1151 // NOTE: This is equivalent to
1152 // captures = result.slice(1).map(maybeToString)
1153 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
1154 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
1155 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
1156 for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
1157 var namedCaptures = result.groups;
1158 if (functionalReplace) {
1159 var replacerArgs = [matched].concat(captures, position, S);
1160 if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
1161 var replacement = String(replaceValue.apply(undefined, replacerArgs));
1162 } else {
1163 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
1164 }
1165 if (position >= nextSourcePosition) {
1166 accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
1167 nextSourcePosition = position + matched.length;
1168 }
1169 }
1170 return accumulatedResult + S.slice(nextSourcePosition);
1171 }
1172 ];
1173
1174 // https://tc39.github.io/ecma262/#sec-getsubstitution
1175 function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
1176 var tailPos = position + matched.length;
1177 var m = captures.length;
1178 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
1179 if (namedCaptures !== undefined) {
1180 namedCaptures = toObject(namedCaptures);
1181 symbols = SUBSTITUTION_SYMBOLS;
1182 }
1183 return nativeReplace.call(replacement, symbols, function (match, ch) {
1184 var capture;
1185 switch (ch.charAt(0)) {
1186 case '$': return '$';
1187 case '&': return matched;
1188 case '`': return str.slice(0, position);
1189 case "'": return str.slice(tailPos);
1190 case '<':
1191 capture = namedCaptures[ch.slice(1, -1)];
1192 break;
1193 default: // \d\d?
1194 var n = +ch;
1195 if (n === 0) return match;
1196 if (n > m) {
1197 var f = floor$1(n / 10);
1198 if (f === 0) return match;
1199 if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
1200 return match;
1201 }
1202 capture = captures[n - 1];
1203 }
1204 return capture === undefined ? '' : capture;
1205 });
1206 }
1207 });
1208
1209 // iterable DOM collections
1210 // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1211 var domIterables = {
1212 CSSRuleList: 0,
1213 CSSStyleDeclaration: 0,
1214 CSSValueList: 0,
1215 ClientRectList: 0,
1216 DOMRectList: 0,
1217 DOMStringList: 0,
1218 DOMTokenList: 1,
1219 DataTransferItemList: 0,
1220 FileList: 0,
1221 HTMLAllCollection: 0,
1222 HTMLCollection: 0,
1223 HTMLFormElement: 0,
1224 HTMLSelectElement: 0,
1225 MediaList: 0,
1226 MimeTypeArray: 0,
1227 NamedNodeMap: 0,
1228 NodeList: 1,
1229 PaintRequestList: 0,
1230 Plugin: 0,
1231 PluginArray: 0,
1232 SVGLengthList: 0,
1233 SVGNumberList: 0,
1234 SVGPathSegList: 0,
1235 SVGPointList: 0,
1236 SVGStringList: 0,
1237 SVGTransformList: 0,
1238 SourceBufferList: 0,
1239 StyleSheetList: 0,
1240 TextTrackCueList: 0,
1241 TextTrackList: 0,
1242 TouchList: 0
1243 };
1244
1245 var $forEach = arrayIteration.forEach;
1246
1247
1248 // `Array.prototype.forEach` method implementation
1249 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
1250 var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
1251 return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1252 } : [].forEach;
1253
1254 for (var COLLECTION_NAME in domIterables) {
1255 var Collection = global_1[COLLECTION_NAME];
1256 var CollectionPrototype = Collection && Collection.prototype;
1257 // some Chrome versions have non-configurable methods on DOMTokenList
1258 if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
1259 hide(CollectionPrototype, 'forEach', arrayForEach);
1260 } catch (error) {
1261 CollectionPrototype.forEach = arrayForEach;
1262 }
1263 }
1264
1265 /**
1266 * @author: Yura Knoxville
1267 * @version: v1.1.0
1268 */
1269
1270 var initBodyCaller;
1271 var tableGroups; // it only does '%s', and return '' when arguments are undefined
1272
1273 var sprintf = function sprintf(str) {
1274 var args = arguments;
1275 var flag = true;
1276 var i = 1;
1277 str = str.replace(/%s/g, function () {
1278 var arg = args[i++];
1279
1280 if (typeof arg === 'undefined') {
1281 flag = false;
1282 return '';
1283 }
1284
1285 return arg;
1286 });
1287 return flag ? str : '';
1288 };
1289
1290 var groupBy = function groupBy(array, f) {
1291 var groups = {};
1292 array.forEach(function (o) {
1293 var group = f(o);
1294 groups[group] = groups[group] || [];
1295 groups[group].push(o);
1296 });
1297 return groups;
1298 };
1299
1300 $.extend($.fn.bootstrapTable.defaults, {
1301 groupBy: false,
1302 groupByField: '',
1303 groupByFormatter: undefined
1304 });
1305 var BootstrapTable = $.fn.bootstrapTable.Constructor;
1306 var _initSort = BootstrapTable.prototype.initSort;
1307 var _initBody = BootstrapTable.prototype.initBody;
1308 var _updateSelected = BootstrapTable.prototype.updateSelected;
1309
1310 BootstrapTable.prototype.initSort = function () {
1311 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1312 args[_key] = arguments[_key];
1313 }
1314
1315 _initSort.apply(this, Array.prototype.slice.apply(args));
1316
1317 var that = this;
1318 tableGroups = [];
1319
1320 if (this.options.groupBy && this.options.groupByField !== '') {
1321 if (this.options.sortName !== this.options.groupByField) {
1322 this.data.sort(function (a, b) {
1323 return a[that.options.groupByField].localeCompare(b[that.options.groupByField]);
1324 });
1325 }
1326
1327 var groups = groupBy(that.data, function (item) {
1328 return [item[that.options.groupByField]];
1329 });
1330 var index = 0;
1331 $.each(groups, function (key, value) {
1332 tableGroups.push({
1333 id: index,
1334 name: key,
1335 data: value
1336 });
1337 value.forEach(function (item) {
1338 if (!item._data) {
1339 item._data = {};
1340 }
1341
1342 item._data['parent-index'] = index;
1343 });
1344 index++;
1345 });
1346 }
1347 };
1348
1349 BootstrapTable.prototype.initBody = function () {
1350 initBodyCaller = true;
1351
1352 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1353 args[_key2] = arguments[_key2];
1354 }
1355
1356 _initBody.apply(this, Array.prototype.slice.apply(args));
1357
1358 if (this.options.groupBy && this.options.groupByField !== '') {
1359 var that = this;
1360 var checkBox = false;
1361 var visibleColumns = 0;
1362 this.columns.forEach(function (column) {
1363 if (column.checkbox) {
1364 checkBox = true;
1365 } else {
1366 if (column.visible) {
1367 visibleColumns += 1;
1368 }
1369 }
1370 });
1371
1372 if (this.options.detailView && !this.options.cardView) {
1373 visibleColumns += 1;
1374 }
1375
1376 tableGroups.forEach(function (item) {
1377 var html = [];
1378 html.push(sprintf('<tr class="info groupBy expanded" data-group-index="%s">', item.id));
1379
1380 if (that.options.detailView && !that.options.cardView) {
1381 html.push('<td class="detail"></td>');
1382 }
1383
1384 if (checkBox) {
1385 html.push('<td class="bs-checkbox">', '<input name="btSelectGroup" type="checkbox" />', '</td>');
1386 }
1387
1388 var formattedValue = item.name;
1389
1390 if (typeof that.options.groupByFormatter === 'function') {
1391 formattedValue = that.options.groupByFormatter(item.name, item.id, item.data);
1392 }
1393
1394 html.push('<td', sprintf(' colspan="%s"', visibleColumns), '>', formattedValue, '</td>');
1395 html.push('</tr>');
1396 that.$body.find("tr[data-parent-index=".concat(item.id, "]:first")).before($(html.join('')));
1397 });
1398 this.$selectGroup = [];
1399 this.$body.find('[name="btSelectGroup"]').each(function () {
1400 var self = $(this);
1401 that.$selectGroup.push({
1402 group: self,
1403 item: that.$selectItem.filter(function () {
1404 return $(this).closest('tr').data('parent-index') === self.closest('tr').data('group-index');
1405 })
1406 });
1407 });
1408 this.$container.off('click', '.groupBy').on('click', '.groupBy', function () {
1409 $(this).toggleClass('expanded');
1410 that.$body.find("tr[data-parent-index=".concat($(this).closest('tr').data('group-index'), "]")).toggleClass('hidden');
1411 });
1412 this.$container.off('click', '[name="btSelectGroup"]').on('click', '[name="btSelectGroup"]', function (event) {
1413 event.stopImmediatePropagation();
1414 var self = $(this);
1415 var checked = self.prop('checked');
1416 that[checked ? 'checkGroup' : 'uncheckGroup']($(this).closest('tr').data('group-index'));
1417 });
1418 }
1419
1420 initBodyCaller = false;
1421 this.updateSelected();
1422 };
1423
1424 BootstrapTable.prototype.updateSelected = function () {
1425 if (!initBodyCaller) {
1426 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1427 args[_key3] = arguments[_key3];
1428 }
1429
1430 _updateSelected.apply(this, Array.prototype.slice.apply(args));
1431
1432 if (this.options.groupBy && this.options.groupByField !== '') {
1433 this.$selectGroup.forEach(function (item) {
1434 var checkGroup = item.item.filter(':enabled').length === item.item.filter(':enabled').filter(':checked').length;
1435 item.group.prop('checked', checkGroup);
1436 });
1437 }
1438 }
1439 };
1440
1441 BootstrapTable.prototype.getGroupSelections = function (index) {
1442 var that = this;
1443 return this.data.filter(function (row) {
1444 return row[that.header.stateField] && row._data['parent-index'] === index;
1445 });
1446 };
1447
1448 BootstrapTable.prototype.checkGroup = function (index) {
1449 this.checkGroup_(index, true);
1450 };
1451
1452 BootstrapTable.prototype.uncheckGroup = function (index) {
1453 this.checkGroup_(index, false);
1454 };
1455
1456 BootstrapTable.prototype.checkGroup_ = function (index, checked) {
1457 var rows;
1458
1459 var filter = function filter() {
1460 return $(this).closest('tr').data('parent-index') === index;
1461 };
1462
1463 if (!checked) {
1464 rows = this.getGroupSelections(index);
1465 }
1466
1467 this.$selectItem.filter(filter).prop('checked', checked);
1468 this.updateRows();
1469 this.updateSelected();
1470
1471 if (checked) {
1472 rows = this.getGroupSelections(index);
1473 }
1474
1475 this.trigger(checked ? 'check-all' : 'uncheck-all', rows);
1476 };
1477
1478}));