bootstrap-table-group-by.js 60 KB

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