bootstrap-table-pipeline.js 65 KB

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