bootstrap-table-pipeline.js 62 KB

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