bootstrap-table-pipeline.js 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498
  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 = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. })(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  9. function createCommonjsModule(fn, module) {
  10. return module = { exports: {} }, fn(module, module.exports), module.exports;
  11. }
  12. var check = function (it) {
  13. return it && it.Math == Math && it;
  14. };
  15. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  16. var global_1 =
  17. // eslint-disable-next-line es/no-global-this -- safe
  18. check(typeof globalThis == 'object' && globalThis) ||
  19. check(typeof window == 'object' && window) ||
  20. // eslint-disable-next-line no-restricted-globals -- safe
  21. check(typeof self == 'object' && self) ||
  22. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  23. // eslint-disable-next-line no-new-func -- fallback
  24. (function () { return this; })() || Function('return this')();
  25. var fails = function (exec) {
  26. try {
  27. return !!exec();
  28. } catch (error) {
  29. return true;
  30. }
  31. };
  32. // Detect IE8's incomplete defineProperty implementation
  33. var descriptors = !fails(function () {
  34. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  35. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  36. });
  37. var functionBindNative = !fails(function () {
  38. var test = (function () { /* empty */ }).bind();
  39. // eslint-disable-next-line no-prototype-builtins -- safe
  40. return typeof test != 'function' || test.hasOwnProperty('prototype');
  41. });
  42. var call$1 = Function.prototype.call;
  43. var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
  44. return call$1.apply(call$1, arguments);
  45. };
  46. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  47. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  48. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  49. // Nashorn ~ JDK8 bug
  50. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  51. // `Object.prototype.propertyIsEnumerable` method implementation
  52. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  53. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  54. var descriptor = getOwnPropertyDescriptor$1(this, V);
  55. return !!descriptor && descriptor.enumerable;
  56. } : $propertyIsEnumerable;
  57. var objectPropertyIsEnumerable = {
  58. f: f$4
  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. var FunctionPrototype$1 = Function.prototype;
  69. var bind$1 = FunctionPrototype$1.bind;
  70. var call = FunctionPrototype$1.call;
  71. var uncurryThis = functionBindNative && bind$1.bind(call, call);
  72. var functionUncurryThis = functionBindNative ? function (fn) {
  73. return fn && uncurryThis(fn);
  74. } : function (fn) {
  75. return fn && function () {
  76. return call.apply(fn, arguments);
  77. };
  78. };
  79. var toString$1 = functionUncurryThis({}.toString);
  80. var stringSlice = functionUncurryThis(''.slice);
  81. var classofRaw = function (it) {
  82. return stringSlice(toString$1(it), 8, -1);
  83. };
  84. var Object$4 = global_1.Object;
  85. var split = functionUncurryThis(''.split);
  86. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  87. var indexedObject = fails(function () {
  88. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  89. // eslint-disable-next-line no-prototype-builtins -- safe
  90. return !Object$4('z').propertyIsEnumerable(0);
  91. }) ? function (it) {
  92. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  93. } : Object$4;
  94. var TypeError$7 = global_1.TypeError;
  95. // `RequireObjectCoercible` abstract operation
  96. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  97. var requireObjectCoercible = function (it) {
  98. if (it == undefined) throw TypeError$7("Can't call method on " + it);
  99. return it;
  100. };
  101. // toObject with fallback for non-array-like ES3 strings
  102. var toIndexedObject = function (it) {
  103. return indexedObject(requireObjectCoercible(it));
  104. };
  105. // `IsCallable` abstract operation
  106. // https://tc39.es/ecma262/#sec-iscallable
  107. var isCallable = function (argument) {
  108. return typeof argument == 'function';
  109. };
  110. var isObject = function (it) {
  111. return typeof it == 'object' ? it !== null : isCallable(it);
  112. };
  113. var aFunction = function (argument) {
  114. return isCallable(argument) ? argument : undefined;
  115. };
  116. var getBuiltIn = function (namespace, method) {
  117. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  118. };
  119. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  120. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  121. var process = global_1.process;
  122. var Deno = global_1.Deno;
  123. var versions = process && process.versions || Deno && Deno.version;
  124. var v8 = versions && versions.v8;
  125. var match, version;
  126. if (v8) {
  127. match = v8.split('.');
  128. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  129. // but their correct versions are not interesting for us
  130. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  131. }
  132. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  133. // so check `userAgent` even if `.v8` exists, but 0
  134. if (!version && engineUserAgent) {
  135. match = engineUserAgent.match(/Edge\/(\d+)/);
  136. if (!match || match[1] >= 74) {
  137. match = engineUserAgent.match(/Chrome\/(\d+)/);
  138. if (match) version = +match[1];
  139. }
  140. }
  141. var engineV8Version = version;
  142. /* eslint-disable es/no-symbol -- required for testing */
  143. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  144. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  145. var symbol = Symbol();
  146. // Chrome 38 Symbol has incorrect toString conversion
  147. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  148. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  149. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  150. !Symbol.sham && engineV8Version && engineV8Version < 41;
  151. });
  152. /* eslint-disable es/no-symbol -- required for testing */
  153. var useSymbolAsUid = nativeSymbol
  154. && !Symbol.sham
  155. && typeof Symbol.iterator == 'symbol';
  156. var Object$3 = global_1.Object;
  157. var isSymbol = useSymbolAsUid ? function (it) {
  158. return typeof it == 'symbol';
  159. } : function (it) {
  160. var $Symbol = getBuiltIn('Symbol');
  161. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  162. };
  163. var String$3 = global_1.String;
  164. var tryToString = function (argument) {
  165. try {
  166. return String$3(argument);
  167. } catch (error) {
  168. return 'Object';
  169. }
  170. };
  171. var TypeError$6 = global_1.TypeError;
  172. // `Assert: IsCallable(argument) is true`
  173. var aCallable = function (argument) {
  174. if (isCallable(argument)) return argument;
  175. throw TypeError$6(tryToString(argument) + ' is not a function');
  176. };
  177. // `GetMethod` abstract operation
  178. // https://tc39.es/ecma262/#sec-getmethod
  179. var getMethod = function (V, P) {
  180. var func = V[P];
  181. return func == null ? undefined : aCallable(func);
  182. };
  183. var TypeError$5 = global_1.TypeError;
  184. // `OrdinaryToPrimitive` abstract operation
  185. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  186. var ordinaryToPrimitive = function (input, pref) {
  187. var fn, val;
  188. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  189. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  190. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  191. throw TypeError$5("Can't convert object to primitive value");
  192. };
  193. // eslint-disable-next-line es/no-object-defineproperty -- safe
  194. var defineProperty = Object.defineProperty;
  195. var setGlobal = function (key, value) {
  196. try {
  197. defineProperty(global_1, key, { value: value, configurable: true, writable: true });
  198. } catch (error) {
  199. global_1[key] = value;
  200. } return value;
  201. };
  202. var SHARED = '__core-js_shared__';
  203. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  204. var sharedStore = store$1;
  205. var shared = createCommonjsModule(function (module) {
  206. (module.exports = function (key, value) {
  207. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  208. })('versions', []).push({
  209. version: '3.21.1',
  210. mode: 'global',
  211. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  212. license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
  213. source: 'https://github.com/zloirock/core-js'
  214. });
  215. });
  216. var Object$2 = global_1.Object;
  217. // `ToObject` abstract operation
  218. // https://tc39.es/ecma262/#sec-toobject
  219. var toObject = function (argument) {
  220. return Object$2(requireObjectCoercible(argument));
  221. };
  222. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  223. // `HasOwnProperty` abstract operation
  224. // https://tc39.es/ecma262/#sec-hasownproperty
  225. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  226. return hasOwnProperty(toObject(it), key);
  227. };
  228. var id = 0;
  229. var postfix = Math.random();
  230. var toString = functionUncurryThis(1.0.toString);
  231. var uid = function (key) {
  232. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  233. };
  234. var WellKnownSymbolsStore = shared('wks');
  235. var Symbol$2 = global_1.Symbol;
  236. var symbolFor = Symbol$2 && Symbol$2['for'];
  237. var createWellKnownSymbol = useSymbolAsUid ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid;
  238. var wellKnownSymbol = function (name) {
  239. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  240. var description = 'Symbol.' + name;
  241. if (nativeSymbol && hasOwnProperty_1(Symbol$2, name)) {
  242. WellKnownSymbolsStore[name] = Symbol$2[name];
  243. } else if (useSymbolAsUid && symbolFor) {
  244. WellKnownSymbolsStore[name] = symbolFor(description);
  245. } else {
  246. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  247. }
  248. } return WellKnownSymbolsStore[name];
  249. };
  250. var TypeError$4 = global_1.TypeError;
  251. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  252. // `ToPrimitive` abstract operation
  253. // https://tc39.es/ecma262/#sec-toprimitive
  254. var toPrimitive = function (input, pref) {
  255. if (!isObject(input) || isSymbol(input)) return input;
  256. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  257. var result;
  258. if (exoticToPrim) {
  259. if (pref === undefined) pref = 'default';
  260. result = functionCall(exoticToPrim, input, pref);
  261. if (!isObject(result) || isSymbol(result)) return result;
  262. throw TypeError$4("Can't convert object to primitive value");
  263. }
  264. if (pref === undefined) pref = 'number';
  265. return ordinaryToPrimitive(input, pref);
  266. };
  267. // `ToPropertyKey` abstract operation
  268. // https://tc39.es/ecma262/#sec-topropertykey
  269. var toPropertyKey = function (argument) {
  270. var key = toPrimitive(argument, 'string');
  271. return isSymbol(key) ? key : key + '';
  272. };
  273. var document = global_1.document;
  274. // typeof document.createElement is 'object' in old IE
  275. var EXISTS$1 = isObject(document) && isObject(document.createElement);
  276. var documentCreateElement = function (it) {
  277. return EXISTS$1 ? document.createElement(it) : {};
  278. };
  279. // Thanks to IE8 for its funny defineProperty
  280. var ie8DomDefine = !descriptors && !fails(function () {
  281. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  282. return Object.defineProperty(documentCreateElement('div'), 'a', {
  283. get: function () { return 7; }
  284. }).a != 7;
  285. });
  286. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  287. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  288. // `Object.getOwnPropertyDescriptor` method
  289. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  290. var f$3 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  291. O = toIndexedObject(O);
  292. P = toPropertyKey(P);
  293. if (ie8DomDefine) try {
  294. return $getOwnPropertyDescriptor$1(O, P);
  295. } catch (error) { /* empty */ }
  296. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  297. };
  298. var objectGetOwnPropertyDescriptor = {
  299. f: f$3
  300. };
  301. // V8 ~ Chrome 36-
  302. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  303. var v8PrototypeDefineBug = descriptors && fails(function () {
  304. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  305. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  306. value: 42,
  307. writable: false
  308. }).prototype != 42;
  309. });
  310. var String$2 = global_1.String;
  311. var TypeError$3 = global_1.TypeError;
  312. // `Assert: Type(argument) is Object`
  313. var anObject = function (argument) {
  314. if (isObject(argument)) return argument;
  315. throw TypeError$3(String$2(argument) + ' is not an object');
  316. };
  317. var TypeError$2 = global_1.TypeError;
  318. // eslint-disable-next-line es/no-object-defineproperty -- safe
  319. var $defineProperty = Object.defineProperty;
  320. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  321. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  322. var ENUMERABLE = 'enumerable';
  323. var CONFIGURABLE$1 = 'configurable';
  324. var WRITABLE = 'writable';
  325. // `Object.defineProperty` method
  326. // https://tc39.es/ecma262/#sec-object.defineproperty
  327. var f$2 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  328. anObject(O);
  329. P = toPropertyKey(P);
  330. anObject(Attributes);
  331. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  332. var current = $getOwnPropertyDescriptor(O, P);
  333. if (current && current[WRITABLE]) {
  334. O[P] = Attributes.value;
  335. Attributes = {
  336. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  337. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  338. writable: false
  339. };
  340. }
  341. } return $defineProperty(O, P, Attributes);
  342. } : $defineProperty : function defineProperty(O, P, Attributes) {
  343. anObject(O);
  344. P = toPropertyKey(P);
  345. anObject(Attributes);
  346. if (ie8DomDefine) try {
  347. return $defineProperty(O, P, Attributes);
  348. } catch (error) { /* empty */ }
  349. if ('get' in Attributes || 'set' in Attributes) throw TypeError$2('Accessors not supported');
  350. if ('value' in Attributes) O[P] = Attributes.value;
  351. return O;
  352. };
  353. var objectDefineProperty = {
  354. f: f$2
  355. };
  356. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  357. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  358. } : function (object, key, value) {
  359. object[key] = value;
  360. return object;
  361. };
  362. var functionToString = functionUncurryThis(Function.toString);
  363. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  364. if (!isCallable(sharedStore.inspectSource)) {
  365. sharedStore.inspectSource = function (it) {
  366. return functionToString(it);
  367. };
  368. }
  369. var inspectSource = sharedStore.inspectSource;
  370. var WeakMap$1 = global_1.WeakMap;
  371. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  372. var keys = shared('keys');
  373. var sharedKey = function (key) {
  374. return keys[key] || (keys[key] = uid(key));
  375. };
  376. var hiddenKeys$1 = {};
  377. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  378. var TypeError$1 = global_1.TypeError;
  379. var WeakMap = global_1.WeakMap;
  380. var set, get, has;
  381. var enforce = function (it) {
  382. return has(it) ? get(it) : set(it, {});
  383. };
  384. var getterFor = function (TYPE) {
  385. return function (it) {
  386. var state;
  387. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  388. throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
  389. } return state;
  390. };
  391. };
  392. if (nativeWeakMap || sharedStore.state) {
  393. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  394. var wmget = functionUncurryThis(store.get);
  395. var wmhas = functionUncurryThis(store.has);
  396. var wmset = functionUncurryThis(store.set);
  397. set = function (it, metadata) {
  398. if (wmhas(store, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
  399. metadata.facade = it;
  400. wmset(store, it, metadata);
  401. return metadata;
  402. };
  403. get = function (it) {
  404. return wmget(store, it) || {};
  405. };
  406. has = function (it) {
  407. return wmhas(store, it);
  408. };
  409. } else {
  410. var STATE = sharedKey('state');
  411. hiddenKeys$1[STATE] = true;
  412. set = function (it, metadata) {
  413. if (hasOwnProperty_1(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
  414. metadata.facade = it;
  415. createNonEnumerableProperty(it, STATE, metadata);
  416. return metadata;
  417. };
  418. get = function (it) {
  419. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  420. };
  421. has = function (it) {
  422. return hasOwnProperty_1(it, STATE);
  423. };
  424. }
  425. var internalState = {
  426. set: set,
  427. get: get,
  428. has: has,
  429. enforce: enforce,
  430. getterFor: getterFor
  431. };
  432. var FunctionPrototype = Function.prototype;
  433. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  434. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  435. var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
  436. // additional protection from minified / mangled / dropped function names
  437. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  438. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
  439. var functionName = {
  440. EXISTS: EXISTS,
  441. PROPER: PROPER,
  442. CONFIGURABLE: CONFIGURABLE
  443. };
  444. var redefine = createCommonjsModule(function (module) {
  445. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  446. var getInternalState = internalState.get;
  447. var enforceInternalState = internalState.enforce;
  448. var TEMPLATE = String(String).split('String');
  449. (module.exports = function (O, key, value, options) {
  450. var unsafe = options ? !!options.unsafe : false;
  451. var simple = options ? !!options.enumerable : false;
  452. var noTargetGet = options ? !!options.noTargetGet : false;
  453. var name = options && options.name !== undefined ? options.name : key;
  454. var state;
  455. if (isCallable(value)) {
  456. if (String(name).slice(0, 7) === 'Symbol(') {
  457. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  458. }
  459. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  460. createNonEnumerableProperty(value, 'name', name);
  461. }
  462. state = enforceInternalState(value);
  463. if (!state.source) {
  464. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  465. }
  466. }
  467. if (O === global_1) {
  468. if (simple) O[key] = value;
  469. else setGlobal(key, value);
  470. return;
  471. } else if (!unsafe) {
  472. delete O[key];
  473. } else if (!noTargetGet && O[key]) {
  474. simple = true;
  475. }
  476. if (simple) O[key] = value;
  477. else createNonEnumerableProperty(O, key, value);
  478. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  479. })(Function.prototype, 'toString', function toString() {
  480. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  481. });
  482. });
  483. var ceil = Math.ceil;
  484. var floor = Math.floor;
  485. // `ToIntegerOrInfinity` abstract operation
  486. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  487. var toIntegerOrInfinity = function (argument) {
  488. var number = +argument;
  489. // eslint-disable-next-line no-self-compare -- safe
  490. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  491. };
  492. var max$1 = Math.max;
  493. var min$1 = Math.min;
  494. // Helper for a popular repeating case of the spec:
  495. // Let integer be ? ToInteger(index).
  496. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  497. var toAbsoluteIndex = function (index, length) {
  498. var integer = toIntegerOrInfinity(index);
  499. return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
  500. };
  501. var min = Math.min;
  502. // `ToLength` abstract operation
  503. // https://tc39.es/ecma262/#sec-tolength
  504. var toLength = function (argument) {
  505. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  506. };
  507. // `LengthOfArrayLike` abstract operation
  508. // https://tc39.es/ecma262/#sec-lengthofarraylike
  509. var lengthOfArrayLike = function (obj) {
  510. return toLength(obj.length);
  511. };
  512. // `Array.prototype.{ indexOf, includes }` methods implementation
  513. var createMethod$2 = function (IS_INCLUDES) {
  514. return function ($this, el, fromIndex) {
  515. var O = toIndexedObject($this);
  516. var length = lengthOfArrayLike(O);
  517. var index = toAbsoluteIndex(fromIndex, length);
  518. var value;
  519. // Array#includes uses SameValueZero equality algorithm
  520. // eslint-disable-next-line no-self-compare -- NaN check
  521. if (IS_INCLUDES && el != el) while (length > index) {
  522. value = O[index++];
  523. // eslint-disable-next-line no-self-compare -- NaN check
  524. if (value != value) return true;
  525. // Array#indexOf ignores holes, Array#includes - not
  526. } else for (;length > index; index++) {
  527. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  528. } return !IS_INCLUDES && -1;
  529. };
  530. };
  531. var arrayIncludes = {
  532. // `Array.prototype.includes` method
  533. // https://tc39.es/ecma262/#sec-array.prototype.includes
  534. includes: createMethod$2(true),
  535. // `Array.prototype.indexOf` method
  536. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  537. indexOf: createMethod$2(false)
  538. };
  539. var indexOf = arrayIncludes.indexOf;
  540. var push$1 = functionUncurryThis([].push);
  541. var objectKeysInternal = function (object, names) {
  542. var O = toIndexedObject(object);
  543. var i = 0;
  544. var result = [];
  545. var key;
  546. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$1(result, key);
  547. // Don't enum bug & hidden keys
  548. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  549. ~indexOf(result, key) || push$1(result, key);
  550. }
  551. return result;
  552. };
  553. // IE8- don't enum bug keys
  554. var enumBugKeys = [
  555. 'constructor',
  556. 'hasOwnProperty',
  557. 'isPrototypeOf',
  558. 'propertyIsEnumerable',
  559. 'toLocaleString',
  560. 'toString',
  561. 'valueOf'
  562. ];
  563. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  564. // `Object.getOwnPropertyNames` method
  565. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  566. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  567. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  568. return objectKeysInternal(O, hiddenKeys);
  569. };
  570. var objectGetOwnPropertyNames = {
  571. f: f$1
  572. };
  573. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  574. var f = Object.getOwnPropertySymbols;
  575. var objectGetOwnPropertySymbols = {
  576. f: f
  577. };
  578. var concat = functionUncurryThis([].concat);
  579. // all object keys, includes non-enumerable and symbols
  580. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  581. var keys = objectGetOwnPropertyNames.f(anObject(it));
  582. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  583. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  584. };
  585. var copyConstructorProperties = function (target, source, exceptions) {
  586. var keys = ownKeys(source);
  587. var defineProperty = objectDefineProperty.f;
  588. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  589. for (var i = 0; i < keys.length; i++) {
  590. var key = keys[i];
  591. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  592. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  593. }
  594. }
  595. };
  596. var replacement = /#|\.prototype\./;
  597. var isForced = function (feature, detection) {
  598. var value = data[normalize(feature)];
  599. return value == POLYFILL ? true
  600. : value == NATIVE ? false
  601. : isCallable(detection) ? fails(detection)
  602. : !!detection;
  603. };
  604. var normalize = isForced.normalize = function (string) {
  605. return String(string).replace(replacement, '.').toLowerCase();
  606. };
  607. var data = isForced.data = {};
  608. var NATIVE = isForced.NATIVE = 'N';
  609. var POLYFILL = isForced.POLYFILL = 'P';
  610. var isForced_1 = isForced;
  611. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  612. /*
  613. options.target - name of the target object
  614. options.global - target is the global object
  615. options.stat - export as static methods of target
  616. options.proto - export as prototype methods of target
  617. options.real - real prototype method for the `pure` version
  618. options.forced - export even if the native feature is available
  619. options.bind - bind methods to the target, required for the `pure` version
  620. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  621. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  622. options.sham - add a flag to not completely full polyfills
  623. options.enumerable - export as enumerable property
  624. options.noTargetGet - prevent calling a getter on target
  625. options.name - the .name of the function if it does not match the key
  626. */
  627. var _export = function (options, source) {
  628. var TARGET = options.target;
  629. var GLOBAL = options.global;
  630. var STATIC = options.stat;
  631. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  632. if (GLOBAL) {
  633. target = global_1;
  634. } else if (STATIC) {
  635. target = global_1[TARGET] || setGlobal(TARGET, {});
  636. } else {
  637. target = (global_1[TARGET] || {}).prototype;
  638. }
  639. if (target) for (key in source) {
  640. sourceProperty = source[key];
  641. if (options.noTargetGet) {
  642. descriptor = getOwnPropertyDescriptor(target, key);
  643. targetProperty = descriptor && descriptor.value;
  644. } else targetProperty = target[key];
  645. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  646. // contained in target
  647. if (!FORCED && targetProperty !== undefined) {
  648. if (typeof sourceProperty == typeof targetProperty) continue;
  649. copyConstructorProperties(sourceProperty, targetProperty);
  650. }
  651. // add a flag to not completely full polyfills
  652. if (options.sham || (targetProperty && targetProperty.sham)) {
  653. createNonEnumerableProperty(sourceProperty, 'sham', true);
  654. }
  655. // extend global
  656. redefine(target, key, sourceProperty, options);
  657. }
  658. };
  659. // `IsArray` abstract operation
  660. // https://tc39.es/ecma262/#sec-isarray
  661. // eslint-disable-next-line es/no-array-isarray -- safe
  662. var isArray = Array.isArray || function isArray(argument) {
  663. return classofRaw(argument) == 'Array';
  664. };
  665. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  666. var test = {};
  667. test[TO_STRING_TAG$1] = 'z';
  668. var toStringTagSupport = String(test) === '[object z]';
  669. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  670. var Object$1 = global_1.Object;
  671. // ES3 wrong here
  672. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  673. // fallback for IE11 Script Access Denied error
  674. var tryGet = function (it, key) {
  675. try {
  676. return it[key];
  677. } catch (error) { /* empty */ }
  678. };
  679. // getting tag from ES6+ `Object.prototype.toString`
  680. var classof = toStringTagSupport ? classofRaw : function (it) {
  681. var O, tag, result;
  682. return it === undefined ? 'Undefined' : it === null ? 'Null'
  683. // @@toStringTag case
  684. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  685. // builtinTag case
  686. : CORRECT_ARGUMENTS ? classofRaw(O)
  687. // ES3 arguments fallback
  688. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  689. };
  690. var noop = function () { /* empty */ };
  691. var empty = [];
  692. var construct = getBuiltIn('Reflect', 'construct');
  693. var constructorRegExp = /^\s*(?:class|function)\b/;
  694. var exec$1 = functionUncurryThis(constructorRegExp.exec);
  695. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  696. var isConstructorModern = function isConstructor(argument) {
  697. if (!isCallable(argument)) return false;
  698. try {
  699. construct(noop, empty, argument);
  700. return true;
  701. } catch (error) {
  702. return false;
  703. }
  704. };
  705. var isConstructorLegacy = function isConstructor(argument) {
  706. if (!isCallable(argument)) return false;
  707. switch (classof(argument)) {
  708. case 'AsyncFunction':
  709. case 'GeneratorFunction':
  710. case 'AsyncGeneratorFunction': return false;
  711. }
  712. try {
  713. // we can't check .prototype since constructors produced by .bind haven't it
  714. // `Function#toString` throws on some built-it function in some legacy engines
  715. // (for example, `DOMQuad` and similar in FF41-)
  716. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  717. } catch (error) {
  718. return true;
  719. }
  720. };
  721. isConstructorLegacy.sham = true;
  722. // `IsConstructor` abstract operation
  723. // https://tc39.es/ecma262/#sec-isconstructor
  724. var isConstructor = !construct || fails(function () {
  725. var called;
  726. return isConstructorModern(isConstructorModern.call)
  727. || !isConstructorModern(Object)
  728. || !isConstructorModern(function () { called = true; })
  729. || called;
  730. }) ? isConstructorLegacy : isConstructorModern;
  731. var createProperty = function (object, key, value) {
  732. var propertyKey = toPropertyKey(key);
  733. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  734. else object[propertyKey] = value;
  735. };
  736. var SPECIES$2 = wellKnownSymbol('species');
  737. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  738. // We can't use this feature detection in V8 since it causes
  739. // deoptimization and serious performance degradation
  740. // https://github.com/zloirock/core-js/issues/677
  741. return engineV8Version >= 51 || !fails(function () {
  742. var array = [];
  743. var constructor = array.constructor = {};
  744. constructor[SPECIES$2] = function () {
  745. return { foo: 1 };
  746. };
  747. return array[METHOD_NAME](Boolean).foo !== 1;
  748. });
  749. };
  750. var arraySlice = functionUncurryThis([].slice);
  751. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  752. var SPECIES$1 = wellKnownSymbol('species');
  753. var Array$2 = global_1.Array;
  754. var max = Math.max;
  755. // `Array.prototype.slice` method
  756. // https://tc39.es/ecma262/#sec-array.prototype.slice
  757. // fallback for not array-like ES3 strings and DOM objects
  758. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  759. slice: function slice(start, end) {
  760. var O = toIndexedObject(this);
  761. var length = lengthOfArrayLike(O);
  762. var k = toAbsoluteIndex(start, length);
  763. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  764. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  765. var Constructor, result, n;
  766. if (isArray(O)) {
  767. Constructor = O.constructor;
  768. // cross-realm fallback
  769. if (isConstructor(Constructor) && (Constructor === Array$2 || isArray(Constructor.prototype))) {
  770. Constructor = undefined;
  771. } else if (isObject(Constructor)) {
  772. Constructor = Constructor[SPECIES$1];
  773. if (Constructor === null) Constructor = undefined;
  774. }
  775. if (Constructor === Array$2 || Constructor === undefined) {
  776. return arraySlice(O, k, fin);
  777. }
  778. }
  779. result = new (Constructor === undefined ? Array$2 : Constructor)(max(fin - k, 0));
  780. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  781. result.length = n;
  782. return result;
  783. }
  784. });
  785. var String$1 = global_1.String;
  786. var toString_1 = function (argument) {
  787. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  788. return String$1(argument);
  789. };
  790. // a string of all valid unicode whitespaces
  791. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  792. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  793. var replace = functionUncurryThis(''.replace);
  794. var whitespace = '[' + whitespaces + ']';
  795. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  796. var rtrim = RegExp(whitespace + whitespace + '*$');
  797. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  798. var createMethod$1 = function (TYPE) {
  799. return function ($this) {
  800. var string = toString_1(requireObjectCoercible($this));
  801. if (TYPE & 1) string = replace(string, ltrim, '');
  802. if (TYPE & 2) string = replace(string, rtrim, '');
  803. return string;
  804. };
  805. };
  806. var stringTrim = {
  807. // `String.prototype.{ trimLeft, trimStart }` methods
  808. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  809. start: createMethod$1(1),
  810. // `String.prototype.{ trimRight, trimEnd }` methods
  811. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  812. end: createMethod$1(2),
  813. // `String.prototype.trim` method
  814. // https://tc39.es/ecma262/#sec-string.prototype.trim
  815. trim: createMethod$1(3)
  816. };
  817. var trim = stringTrim.trim;
  818. var $parseInt = global_1.parseInt;
  819. var Symbol$1 = global_1.Symbol;
  820. var ITERATOR = Symbol$1 && Symbol$1.iterator;
  821. var hex = /^[+-]?0x/i;
  822. var exec = functionUncurryThis(hex.exec);
  823. var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
  824. // MS Edge 18- broken with boxed symbols
  825. || (ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); }));
  826. // `parseInt` method
  827. // https://tc39.es/ecma262/#sec-parseint-string-radix
  828. var numberParseInt = FORCED ? function parseInt(string, radix) {
  829. var S = trim(toString_1(string));
  830. return $parseInt(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
  831. } : $parseInt;
  832. // `parseInt` method
  833. // https://tc39.es/ecma262/#sec-parseint-string-radix
  834. _export({ global: true, forced: parseInt != numberParseInt }, {
  835. parseInt: numberParseInt
  836. });
  837. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  838. var method = [][METHOD_NAME];
  839. return !!method && fails(function () {
  840. // eslint-disable-next-line no-useless-call -- required for testing
  841. method.call(null, argument || function () { return 1; }, 1);
  842. });
  843. };
  844. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  845. var $IndexOf = arrayIncludes.indexOf;
  846. var un$IndexOf = functionUncurryThis([].indexOf);
  847. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  848. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  849. // `Array.prototype.indexOf` method
  850. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  851. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  852. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  853. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  854. return NEGATIVE_ZERO
  855. // convert -0 to +0
  856. ? un$IndexOf(this, searchElement, fromIndex) || 0
  857. : $IndexOf(this, searchElement, fromIndex);
  858. }
  859. });
  860. var bind = functionUncurryThis(functionUncurryThis.bind);
  861. // optional / simple context binding
  862. var functionBindContext = function (fn, that) {
  863. aCallable(fn);
  864. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  865. return fn.apply(that, arguments);
  866. };
  867. };
  868. var SPECIES = wellKnownSymbol('species');
  869. var Array$1 = global_1.Array;
  870. // a part of `ArraySpeciesCreate` abstract operation
  871. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  872. var arraySpeciesConstructor = function (originalArray) {
  873. var C;
  874. if (isArray(originalArray)) {
  875. C = originalArray.constructor;
  876. // cross-realm fallback
  877. if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
  878. else if (isObject(C)) {
  879. C = C[SPECIES];
  880. if (C === null) C = undefined;
  881. }
  882. } return C === undefined ? Array$1 : C;
  883. };
  884. // `ArraySpeciesCreate` abstract operation
  885. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  886. var arraySpeciesCreate = function (originalArray, length) {
  887. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  888. };
  889. var push = functionUncurryThis([].push);
  890. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  891. var createMethod = function (TYPE) {
  892. var IS_MAP = TYPE == 1;
  893. var IS_FILTER = TYPE == 2;
  894. var IS_SOME = TYPE == 3;
  895. var IS_EVERY = TYPE == 4;
  896. var IS_FIND_INDEX = TYPE == 6;
  897. var IS_FILTER_REJECT = TYPE == 7;
  898. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  899. return function ($this, callbackfn, that, specificCreate) {
  900. var O = toObject($this);
  901. var self = indexedObject(O);
  902. var boundFunction = functionBindContext(callbackfn, that);
  903. var length = lengthOfArrayLike(self);
  904. var index = 0;
  905. var create = specificCreate || arraySpeciesCreate;
  906. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  907. var value, result;
  908. for (;length > index; index++) if (NO_HOLES || index in self) {
  909. value = self[index];
  910. result = boundFunction(value, index, O);
  911. if (TYPE) {
  912. if (IS_MAP) target[index] = result; // map
  913. else if (result) switch (TYPE) {
  914. case 3: return true; // some
  915. case 5: return value; // find
  916. case 6: return index; // findIndex
  917. case 2: push(target, value); // filter
  918. } else switch (TYPE) {
  919. case 4: return false; // every
  920. case 7: push(target, value); // filterReject
  921. }
  922. }
  923. }
  924. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  925. };
  926. };
  927. var arrayIteration = {
  928. // `Array.prototype.forEach` method
  929. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  930. forEach: createMethod(0),
  931. // `Array.prototype.map` method
  932. // https://tc39.es/ecma262/#sec-array.prototype.map
  933. map: createMethod(1),
  934. // `Array.prototype.filter` method
  935. // https://tc39.es/ecma262/#sec-array.prototype.filter
  936. filter: createMethod(2),
  937. // `Array.prototype.some` method
  938. // https://tc39.es/ecma262/#sec-array.prototype.some
  939. some: createMethod(3),
  940. // `Array.prototype.every` method
  941. // https://tc39.es/ecma262/#sec-array.prototype.every
  942. every: createMethod(4),
  943. // `Array.prototype.find` method
  944. // https://tc39.es/ecma262/#sec-array.prototype.find
  945. find: createMethod(5),
  946. // `Array.prototype.findIndex` method
  947. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  948. findIndex: createMethod(6),
  949. // `Array.prototype.filterReject` method
  950. // https://github.com/tc39/proposal-array-filtering
  951. filterReject: createMethod(7)
  952. };
  953. var $filter = arrayIteration.filter;
  954. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  955. // `Array.prototype.filter` method
  956. // https://tc39.es/ecma262/#sec-array.prototype.filter
  957. // with adding support of @@species
  958. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  959. filter: function filter(callbackfn /* , thisArg */) {
  960. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  961. }
  962. });
  963. // `Object.prototype.toString` method implementation
  964. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  965. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  966. return '[object ' + classof(this) + ']';
  967. };
  968. // `Object.prototype.toString` method
  969. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  970. if (!toStringTagSupport) {
  971. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  972. }
  973. /**
  974. * @author doug-the-guy
  975. * @version v1.0.0
  976. *
  977. * Bootstrap Table Pipeline
  978. * -----------------------
  979. *
  980. * This plugin enables client side data caching for server side requests which will
  981. * eliminate the need to issue a new request every page change. This will allow
  982. * for a performance balance for a large data set between returning all data at once
  983. * (client side paging) and a new server side request (server side paging).
  984. *
  985. * There are two new options:
  986. * - usePipeline: enables this feature
  987. * - pipelineSize: the size of each cache window
  988. *
  989. * The size of the pipeline must be evenly divisible by the current page size. This is
  990. * assured by rounding up to the nearest evenly divisible value. For example, if
  991. * the pipeline size is 4990 and the current page size is 25, then pipeline size will
  992. * be dynamically set to 5000.
  993. *
  994. * The cache windows are computed based on the pipeline size and the total number of rows
  995. * returned by the server side query. For example, with pipeline size 500 and total rows
  996. * 1300, the cache windows will be:
  997. *
  998. * [{'lower': 0, 'upper': 499}, {'lower': 500, 'upper': 999}, {'lower': 1000, 'upper': 1499}]
  999. *
  1000. * Using the limit (i.e. the pipelineSize) and offset parameters, the server side request
  1001. * **MUST** return only the data in the requested cache window **AND** the total number of rows.
  1002. * To wit, the server side code must use the offset and limit parameters to prepare the response
  1003. * data.
  1004. *
  1005. * On a page change, the new offset is checked if it is within the current cache window. If so,
  1006. * the requested page data is returned from the cached data set. Otherwise, a new server side
  1007. * request will be issued for the new cache window.
  1008. *
  1009. * The current cached data is only invalidated on these events:
  1010. * * sorting
  1011. * * searching
  1012. * * page size change
  1013. * * page change moves into a new cache window
  1014. *
  1015. * There are two new events:
  1016. * - cached-data-hit.bs.table: issued when cached data is used on a page change
  1017. * - cached-data-reset.bs.table: issued when the cached data is invalidated and a
  1018. * new server side request is issued
  1019. *
  1020. **/
  1021. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1022. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1023. usePipeline: false,
  1024. pipelineSize: 1000,
  1025. // eslint-disable-next-line no-unused-vars
  1026. onCachedDataHit: function onCachedDataHit(data) {
  1027. return false;
  1028. },
  1029. // eslint-disable-next-line no-unused-vars
  1030. onCachedDataReset: function onCachedDataReset(data) {
  1031. return false;
  1032. }
  1033. });
  1034. $__default["default"].extend($__default["default"].fn.bootstrapTable.Constructor.EVENTS, {
  1035. 'cached-data-hit.bs.table': 'onCachedDataHit',
  1036. 'cached-data-reset.bs.table': 'onCachedDataReset'
  1037. });
  1038. var BootstrapTable = $__default["default"].fn.bootstrapTable.Constructor;
  1039. var _init = BootstrapTable.prototype.init;
  1040. var _onSearch = BootstrapTable.prototype.onSearch;
  1041. var _onSort = BootstrapTable.prototype.onSort;
  1042. var _onPageListChange = BootstrapTable.prototype.onPageListChange;
  1043. BootstrapTable.prototype.init = function () {
  1044. // needs to be called before initServer()
  1045. this.initPipeline();
  1046. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1047. args[_key] = arguments[_key];
  1048. }
  1049. _init.apply(this, Array.prototype.slice.apply(args));
  1050. };
  1051. BootstrapTable.prototype.initPipeline = function () {
  1052. this.cacheRequestJSON = {};
  1053. this.cacheWindows = [];
  1054. this.currWindow = 0;
  1055. this.resetCache = true;
  1056. };
  1057. BootstrapTable.prototype.onSearch = function () {
  1058. /* force a cache reset on search */
  1059. if (this.options.usePipeline) {
  1060. this.resetCache = true;
  1061. }
  1062. _onSearch.apply(this, Array.prototype.slice.apply(arguments));
  1063. };
  1064. BootstrapTable.prototype.onSort = function () {
  1065. /* force a cache reset on sort */
  1066. if (this.options.usePipeline) {
  1067. this.resetCache = true;
  1068. }
  1069. _onSort.apply(this, Array.prototype.slice.apply(arguments));
  1070. };
  1071. BootstrapTable.prototype.onPageListChange = function (event) {
  1072. /* rebuild cache window on page size change */
  1073. var target = $__default["default"](event.currentTarget);
  1074. var newPageSize = parseInt(target.text(), 10);
  1075. this.options.pipelineSize = this.calculatePipelineSize(this.options.pipelineSize, newPageSize);
  1076. this.resetCache = true;
  1077. _onPageListChange.apply(this, Array.prototype.slice.apply(arguments));
  1078. };
  1079. BootstrapTable.prototype.calculatePipelineSize = function (pipelineSize, pageSize) {
  1080. /* calculate pipeline size by rounding up to the nearest value evenly divisible
  1081. * by the pageSize */
  1082. if (pageSize === 0) return 0;
  1083. return Math.ceil(pipelineSize / pageSize) * pageSize;
  1084. };
  1085. BootstrapTable.prototype.setCacheWindows = function () {
  1086. /* set cache windows based on the total number of rows returned by server side
  1087. * request and the pipelineSize */
  1088. this.cacheWindows = [];
  1089. var numWindows = this.options.totalRows / this.options.pipelineSize;
  1090. for (var i = 0; i <= numWindows; i++) {
  1091. var b = i * this.options.pipelineSize;
  1092. this.cacheWindows[i] = {
  1093. lower: b,
  1094. upper: b + this.options.pipelineSize - 1
  1095. };
  1096. }
  1097. };
  1098. BootstrapTable.prototype.setCurrWindow = function (offset) {
  1099. /* set the current cache window index, based on where the current offset falls */
  1100. this.currWindow = 0;
  1101. for (var i = 0; i < this.cacheWindows.length; i++) {
  1102. if (this.cacheWindows[i].lower <= offset && offset <= this.cacheWindows[i].upper) {
  1103. this.currWindow = i;
  1104. break;
  1105. }
  1106. }
  1107. };
  1108. BootstrapTable.prototype.drawFromCache = function (offset, limit) {
  1109. /* draw rows from the cache using offset and limit */
  1110. var res = $__default["default"].extend(true, {}, this.cacheRequestJSON);
  1111. var drawStart = offset - this.cacheWindows[this.currWindow].lower;
  1112. var drawEnd = drawStart + limit;
  1113. res.rows = res.rows.slice(drawStart, drawEnd);
  1114. return res;
  1115. };
  1116. BootstrapTable.prototype.initServer = function (silent, query, url) {
  1117. /* determine if requested data is in cache (on paging) or if
  1118. * a new ajax request needs to be issued (sorting, searching, paging
  1119. * moving outside of cached data, page size change)
  1120. * initial version of this extension will entirely override base initServer
  1121. **/
  1122. var data = {};
  1123. var index = this.header.fields.indexOf(this.options.sortName);
  1124. var params = {
  1125. searchText: this.searchText,
  1126. sortName: this.options.sortName,
  1127. sortOrder: this.options.sortOrder
  1128. };
  1129. var request = null;
  1130. if (this.header.sortNames[index]) {
  1131. params.sortName = this.header.sortNames[index];
  1132. }
  1133. if (this.options.pagination && this.options.sidePagination === 'server') {
  1134. params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  1135. params.pageNumber = this.options.pageNumber;
  1136. }
  1137. if (!(url || this.options.url) && !this.options.ajax) {
  1138. return;
  1139. }
  1140. var useAjax = true;
  1141. if (this.options.queryParamsType === 'limit') {
  1142. params = {
  1143. searchText: params.searchText,
  1144. sortName: params.sortName,
  1145. sortOrder: params.sortOrder
  1146. };
  1147. if (this.options.pagination && this.options.sidePagination === 'server') {
  1148. params.limit = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  1149. params.offset = (this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize) * (this.options.pageNumber - 1);
  1150. if (this.options.usePipeline) {
  1151. // if cacheWindows is empty, this is the initial request
  1152. if (!this.cacheWindows.length) {
  1153. useAjax = true;
  1154. params.drawOffset = params.offset; // cache exists: determine if the page request is entirely within the current cached window
  1155. } else {
  1156. var w = this.cacheWindows[this.currWindow]; // case 1: reset cache but stay within current window (e.g. column sort)
  1157. // case 2: move outside of the current window (e.g. search or paging)
  1158. // since each cache window is aligned with the current page size
  1159. // checking if params.offset is outside the current window is sufficient.
  1160. // need to requery for preceding or succeeding cache window
  1161. // also handle case
  1162. if (this.resetCache || params.offset < w.lower || params.offset > w.upper) {
  1163. useAjax = true;
  1164. this.setCurrWindow(params.offset); // store the relative offset for drawing the page data afterwards
  1165. params.drawOffset = params.offset; // now set params.offset to the lower bound of the new cache window
  1166. // the server will return that whole cache window
  1167. params.offset = this.cacheWindows[this.currWindow].lower; // within current cache window
  1168. } else {
  1169. useAjax = false;
  1170. }
  1171. }
  1172. } else if (params.limit === 0) {
  1173. delete params.limit;
  1174. }
  1175. }
  1176. } // force an ajax call - this is on search, sort or page size change
  1177. if (this.resetCache) {
  1178. useAjax = true;
  1179. this.resetCache = false;
  1180. }
  1181. if (this.options.usePipeline && useAjax) {
  1182. /* in this scenario limit is used on the server to get the cache window
  1183. * and drawLimit is used to get the page data afterwards */
  1184. params.drawLimit = params.limit;
  1185. params.limit = this.options.pipelineSize;
  1186. } // cached results can be used
  1187. if (!useAjax) {
  1188. var res = this.drawFromCache(params.offset, params.limit);
  1189. this.load(res);
  1190. this.trigger('load-success', res);
  1191. this.trigger('cached-data-hit', res);
  1192. return;
  1193. } // cached results can't be used
  1194. // continue base initServer code
  1195. if (!$__default["default"].isEmptyObject(this.filterColumnsPartial)) {
  1196. params.filter = JSON.stringify(this.filterColumnsPartial, null);
  1197. }
  1198. data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
  1199. $__default["default"].extend(data, query || {}); // false to stop request
  1200. if (data === false) {
  1201. return;
  1202. }
  1203. if (!silent) {
  1204. this.$tableLoading.show();
  1205. }
  1206. var self = this;
  1207. request = $__default["default"].extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
  1208. type: this.options.method,
  1209. url: url || this.options.url,
  1210. data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
  1211. cache: this.options.cache,
  1212. contentType: this.options.contentType,
  1213. dataType: this.options.dataType,
  1214. success: function success(res) {
  1215. res = Utils.calculateObjectValue(self.options, self.options.responseHandler, [res], res); // cache results if using pipelining
  1216. if (self.options.usePipeline) {
  1217. // store entire request in cache
  1218. self.cacheRequestJSON = $__default["default"].extend(true, {}, res); // this gets set in load() also but needs to be set before
  1219. // setting cacheWindows
  1220. self.options.totalRows = res[self.options.totalField]; // if this is a search, potentially less results will be returned
  1221. // so cache windows need to be rebuilt. Otherwise it
  1222. // will come out the same
  1223. self.setCacheWindows();
  1224. self.setCurrWindow(params.drawOffset); // just load data for the page
  1225. res = self.drawFromCache(params.drawOffset, params.drawLimit);
  1226. self.trigger('cached-data-reset', res);
  1227. }
  1228. self.load(res);
  1229. self.trigger('load-success', res);
  1230. if (!silent) {
  1231. self.hideLoading();
  1232. }
  1233. },
  1234. error: function error(res) {
  1235. var data = [];
  1236. if (self.options.sidePagination === 'server') {
  1237. data = {};
  1238. data[self.options.totalField] = 0;
  1239. data[self.options.dataField] = [];
  1240. }
  1241. self.load(data);
  1242. self.trigger('load-error', res.status, res);
  1243. if (!silent) {
  1244. self.hideLoading();
  1245. }
  1246. }
  1247. });
  1248. if (this.options.ajax) {
  1249. Utils.calculateObjectValue(this, this.options.ajax, [request], null);
  1250. } else {
  1251. if (this._xhr && this._xhr.readyState !== 4) {
  1252. this._xhr.abort();
  1253. }
  1254. this._xhr = $__default["default"].ajax(request);
  1255. }
  1256. };
  1257. }));