bootstrap-table-multiple-sort.js 93 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. })(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _typeof(obj) {
  9. "@babel/helpers - typeof";
  10. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  11. return typeof obj;
  12. } : function (obj) {
  13. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  14. }, _typeof(obj);
  15. }
  16. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  17. function createCommonjsModule(fn, module) {
  18. return module = { exports: {} }, fn(module, module.exports), module.exports;
  19. }
  20. var check = function (it) {
  21. return it && it.Math == Math && it;
  22. };
  23. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  24. var global_1 =
  25. // eslint-disable-next-line es-x/no-global-this -- safe
  26. check(typeof globalThis == 'object' && globalThis) ||
  27. check(typeof window == 'object' && window) ||
  28. // eslint-disable-next-line no-restricted-globals -- safe
  29. check(typeof self == 'object' && self) ||
  30. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  31. // eslint-disable-next-line no-new-func -- fallback
  32. (function () { return this; })() || Function('return this')();
  33. var fails = function (exec) {
  34. try {
  35. return !!exec();
  36. } catch (error) {
  37. return true;
  38. }
  39. };
  40. // Detect IE8's incomplete defineProperty implementation
  41. var descriptors = !fails(function () {
  42. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  43. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  44. });
  45. var functionBindNative = !fails(function () {
  46. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  47. var test = (function () { /* empty */ }).bind();
  48. // eslint-disable-next-line no-prototype-builtins -- safe
  49. return typeof test != 'function' || test.hasOwnProperty('prototype');
  50. });
  51. var call$1 = Function.prototype.call;
  52. var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
  53. return call$1.apply(call$1, arguments);
  54. };
  55. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  56. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  57. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  58. // Nashorn ~ JDK8 bug
  59. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  60. // `Object.prototype.propertyIsEnumerable` method implementation
  61. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  62. var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  63. var descriptor = getOwnPropertyDescriptor$1(this, V);
  64. return !!descriptor && descriptor.enumerable;
  65. } : $propertyIsEnumerable;
  66. var objectPropertyIsEnumerable = {
  67. f: f$5
  68. };
  69. var createPropertyDescriptor = function (bitmap, value) {
  70. return {
  71. enumerable: !(bitmap & 1),
  72. configurable: !(bitmap & 2),
  73. writable: !(bitmap & 4),
  74. value: value
  75. };
  76. };
  77. var FunctionPrototype$1 = Function.prototype;
  78. var bind$1 = FunctionPrototype$1.bind;
  79. var call = FunctionPrototype$1.call;
  80. var uncurryThis = functionBindNative && bind$1.bind(call, call);
  81. var functionUncurryThis = functionBindNative ? function (fn) {
  82. return fn && uncurryThis(fn);
  83. } : function (fn) {
  84. return fn && function () {
  85. return call.apply(fn, arguments);
  86. };
  87. };
  88. var toString$1 = functionUncurryThis({}.toString);
  89. var stringSlice = functionUncurryThis(''.slice);
  90. var classofRaw = function (it) {
  91. return stringSlice(toString$1(it), 8, -1);
  92. };
  93. var Object$4 = global_1.Object;
  94. var split = functionUncurryThis(''.split);
  95. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  96. var indexedObject = fails(function () {
  97. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  98. // eslint-disable-next-line no-prototype-builtins -- safe
  99. return !Object$4('z').propertyIsEnumerable(0);
  100. }) ? function (it) {
  101. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  102. } : Object$4;
  103. var TypeError$9 = global_1.TypeError;
  104. // `RequireObjectCoercible` abstract operation
  105. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  106. var requireObjectCoercible = function (it) {
  107. if (it == undefined) throw TypeError$9("Can't call method on " + it);
  108. return it;
  109. };
  110. // toObject with fallback for non-array-like ES3 strings
  111. var toIndexedObject = function (it) {
  112. return indexedObject(requireObjectCoercible(it));
  113. };
  114. // `IsCallable` abstract operation
  115. // https://tc39.es/ecma262/#sec-iscallable
  116. var isCallable = function (argument) {
  117. return typeof argument == 'function';
  118. };
  119. var isObject = function (it) {
  120. return typeof it == 'object' ? it !== null : isCallable(it);
  121. };
  122. var aFunction = function (argument) {
  123. return isCallable(argument) ? argument : undefined;
  124. };
  125. var getBuiltIn = function (namespace, method) {
  126. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  127. };
  128. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  129. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  130. var process = global_1.process;
  131. var Deno = global_1.Deno;
  132. var versions = process && process.versions || Deno && Deno.version;
  133. var v8 = versions && versions.v8;
  134. var match, version;
  135. if (v8) {
  136. match = v8.split('.');
  137. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  138. // but their correct versions are not interesting for us
  139. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  140. }
  141. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  142. // so check `userAgent` even if `.v8` exists, but 0
  143. if (!version && engineUserAgent) {
  144. match = engineUserAgent.match(/Edge\/(\d+)/);
  145. if (!match || match[1] >= 74) {
  146. match = engineUserAgent.match(/Chrome\/(\d+)/);
  147. if (match) version = +match[1];
  148. }
  149. }
  150. var engineV8Version = version;
  151. /* eslint-disable es-x/no-symbol -- required for testing */
  152. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  153. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  154. var symbol = Symbol();
  155. // Chrome 38 Symbol has incorrect toString conversion
  156. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  157. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  158. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  159. !Symbol.sham && engineV8Version && engineV8Version < 41;
  160. });
  161. /* eslint-disable es-x/no-symbol -- required for testing */
  162. var useSymbolAsUid = nativeSymbol
  163. && !Symbol.sham
  164. && typeof Symbol.iterator == 'symbol';
  165. var Object$3 = global_1.Object;
  166. var isSymbol = useSymbolAsUid ? function (it) {
  167. return typeof it == 'symbol';
  168. } : function (it) {
  169. var $Symbol = getBuiltIn('Symbol');
  170. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  171. };
  172. var String$3 = global_1.String;
  173. var tryToString = function (argument) {
  174. try {
  175. return String$3(argument);
  176. } catch (error) {
  177. return 'Object';
  178. }
  179. };
  180. var TypeError$8 = global_1.TypeError;
  181. // `Assert: IsCallable(argument) is true`
  182. var aCallable = function (argument) {
  183. if (isCallable(argument)) return argument;
  184. throw TypeError$8(tryToString(argument) + ' is not a function');
  185. };
  186. // `GetMethod` abstract operation
  187. // https://tc39.es/ecma262/#sec-getmethod
  188. var getMethod = function (V, P) {
  189. var func = V[P];
  190. return func == null ? undefined : aCallable(func);
  191. };
  192. var TypeError$7 = global_1.TypeError;
  193. // `OrdinaryToPrimitive` abstract operation
  194. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  195. var ordinaryToPrimitive = function (input, pref) {
  196. var fn, val;
  197. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  198. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  199. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  200. throw TypeError$7("Can't convert object to primitive value");
  201. };
  202. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  203. var defineProperty$1 = Object.defineProperty;
  204. var setGlobal = function (key, value) {
  205. try {
  206. defineProperty$1(global_1, key, { value: value, configurable: true, writable: true });
  207. } catch (error) {
  208. global_1[key] = value;
  209. } return value;
  210. };
  211. var SHARED = '__core-js_shared__';
  212. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  213. var sharedStore = store$1;
  214. var shared = createCommonjsModule(function (module) {
  215. (module.exports = function (key, value) {
  216. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  217. })('versions', []).push({
  218. version: '3.22.4',
  219. mode: 'global',
  220. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  221. license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
  222. source: 'https://github.com/zloirock/core-js'
  223. });
  224. });
  225. var Object$2 = global_1.Object;
  226. // `ToObject` abstract operation
  227. // https://tc39.es/ecma262/#sec-toobject
  228. var toObject = function (argument) {
  229. return Object$2(requireObjectCoercible(argument));
  230. };
  231. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  232. // `HasOwnProperty` abstract operation
  233. // https://tc39.es/ecma262/#sec-hasownproperty
  234. // eslint-disable-next-line es-x/no-object-hasown -- safe
  235. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  236. return hasOwnProperty(toObject(it), key);
  237. };
  238. var id = 0;
  239. var postfix = Math.random();
  240. var toString = functionUncurryThis(1.0.toString);
  241. var uid = function (key) {
  242. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  243. };
  244. var WellKnownSymbolsStore = shared('wks');
  245. var Symbol$2 = global_1.Symbol;
  246. var symbolFor = Symbol$2 && Symbol$2['for'];
  247. var createWellKnownSymbol = useSymbolAsUid ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid;
  248. var wellKnownSymbol = function (name) {
  249. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  250. var description = 'Symbol.' + name;
  251. if (nativeSymbol && hasOwnProperty_1(Symbol$2, name)) {
  252. WellKnownSymbolsStore[name] = Symbol$2[name];
  253. } else if (useSymbolAsUid && symbolFor) {
  254. WellKnownSymbolsStore[name] = symbolFor(description);
  255. } else {
  256. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  257. }
  258. } return WellKnownSymbolsStore[name];
  259. };
  260. var TypeError$6 = global_1.TypeError;
  261. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  262. // `ToPrimitive` abstract operation
  263. // https://tc39.es/ecma262/#sec-toprimitive
  264. var toPrimitive = function (input, pref) {
  265. if (!isObject(input) || isSymbol(input)) return input;
  266. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  267. var result;
  268. if (exoticToPrim) {
  269. if (pref === undefined) pref = 'default';
  270. result = functionCall(exoticToPrim, input, pref);
  271. if (!isObject(result) || isSymbol(result)) return result;
  272. throw TypeError$6("Can't convert object to primitive value");
  273. }
  274. if (pref === undefined) pref = 'number';
  275. return ordinaryToPrimitive(input, pref);
  276. };
  277. // `ToPropertyKey` abstract operation
  278. // https://tc39.es/ecma262/#sec-topropertykey
  279. var toPropertyKey = function (argument) {
  280. var key = toPrimitive(argument, 'string');
  281. return isSymbol(key) ? key : key + '';
  282. };
  283. var document$1 = global_1.document;
  284. // typeof document.createElement is 'object' in old IE
  285. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  286. var documentCreateElement = function (it) {
  287. return EXISTS$1 ? document$1.createElement(it) : {};
  288. };
  289. // Thanks to IE8 for its funny defineProperty
  290. var ie8DomDefine = !descriptors && !fails(function () {
  291. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  292. return Object.defineProperty(documentCreateElement('div'), 'a', {
  293. get: function () { return 7; }
  294. }).a != 7;
  295. });
  296. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  297. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  298. // `Object.getOwnPropertyDescriptor` method
  299. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  300. var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  301. O = toIndexedObject(O);
  302. P = toPropertyKey(P);
  303. if (ie8DomDefine) try {
  304. return $getOwnPropertyDescriptor$1(O, P);
  305. } catch (error) { /* empty */ }
  306. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  307. };
  308. var objectGetOwnPropertyDescriptor = {
  309. f: f$4
  310. };
  311. // V8 ~ Chrome 36-
  312. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  313. var v8PrototypeDefineBug = descriptors && fails(function () {
  314. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  315. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  316. value: 42,
  317. writable: false
  318. }).prototype != 42;
  319. });
  320. var String$2 = global_1.String;
  321. var TypeError$5 = global_1.TypeError;
  322. // `Assert: Type(argument) is Object`
  323. var anObject = function (argument) {
  324. if (isObject(argument)) return argument;
  325. throw TypeError$5(String$2(argument) + ' is not an object');
  326. };
  327. var TypeError$4 = global_1.TypeError;
  328. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  329. var $defineProperty = Object.defineProperty;
  330. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  331. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  332. var ENUMERABLE = 'enumerable';
  333. var CONFIGURABLE$1 = 'configurable';
  334. var WRITABLE = 'writable';
  335. // `Object.defineProperty` method
  336. // https://tc39.es/ecma262/#sec-object.defineproperty
  337. var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  338. anObject(O);
  339. P = toPropertyKey(P);
  340. anObject(Attributes);
  341. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  342. var current = $getOwnPropertyDescriptor(O, P);
  343. if (current && current[WRITABLE]) {
  344. O[P] = Attributes.value;
  345. Attributes = {
  346. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  347. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  348. writable: false
  349. };
  350. }
  351. } return $defineProperty(O, P, Attributes);
  352. } : $defineProperty : function defineProperty(O, P, Attributes) {
  353. anObject(O);
  354. P = toPropertyKey(P);
  355. anObject(Attributes);
  356. if (ie8DomDefine) try {
  357. return $defineProperty(O, P, Attributes);
  358. } catch (error) { /* empty */ }
  359. if ('get' in Attributes || 'set' in Attributes) throw TypeError$4('Accessors not supported');
  360. if ('value' in Attributes) O[P] = Attributes.value;
  361. return O;
  362. };
  363. var objectDefineProperty = {
  364. f: f$3
  365. };
  366. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  367. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  368. } : function (object, key, value) {
  369. object[key] = value;
  370. return object;
  371. };
  372. var FunctionPrototype = Function.prototype;
  373. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  374. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  375. var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
  376. // additional protection from minified / mangled / dropped function names
  377. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  378. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
  379. var functionName = {
  380. EXISTS: EXISTS,
  381. PROPER: PROPER,
  382. CONFIGURABLE: CONFIGURABLE
  383. };
  384. var functionToString = functionUncurryThis(Function.toString);
  385. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  386. if (!isCallable(sharedStore.inspectSource)) {
  387. sharedStore.inspectSource = function (it) {
  388. return functionToString(it);
  389. };
  390. }
  391. var inspectSource = sharedStore.inspectSource;
  392. var WeakMap$1 = global_1.WeakMap;
  393. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  394. var keys = shared('keys');
  395. var sharedKey = function (key) {
  396. return keys[key] || (keys[key] = uid(key));
  397. };
  398. var hiddenKeys$1 = {};
  399. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  400. var TypeError$3 = global_1.TypeError;
  401. var WeakMap = global_1.WeakMap;
  402. var set, get, has;
  403. var enforce = function (it) {
  404. return has(it) ? get(it) : set(it, {});
  405. };
  406. var getterFor = function (TYPE) {
  407. return function (it) {
  408. var state;
  409. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  410. throw TypeError$3('Incompatible receiver, ' + TYPE + ' required');
  411. } return state;
  412. };
  413. };
  414. if (nativeWeakMap || sharedStore.state) {
  415. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  416. var wmget = functionUncurryThis(store.get);
  417. var wmhas = functionUncurryThis(store.has);
  418. var wmset = functionUncurryThis(store.set);
  419. set = function (it, metadata) {
  420. if (wmhas(store, it)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
  421. metadata.facade = it;
  422. wmset(store, it, metadata);
  423. return metadata;
  424. };
  425. get = function (it) {
  426. return wmget(store, it) || {};
  427. };
  428. has = function (it) {
  429. return wmhas(store, it);
  430. };
  431. } else {
  432. var STATE = sharedKey('state');
  433. hiddenKeys$1[STATE] = true;
  434. set = function (it, metadata) {
  435. if (hasOwnProperty_1(it, STATE)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
  436. metadata.facade = it;
  437. createNonEnumerableProperty(it, STATE, metadata);
  438. return metadata;
  439. };
  440. get = function (it) {
  441. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  442. };
  443. has = function (it) {
  444. return hasOwnProperty_1(it, STATE);
  445. };
  446. }
  447. var internalState = {
  448. set: set,
  449. get: get,
  450. has: has,
  451. enforce: enforce,
  452. getterFor: getterFor
  453. };
  454. var makeBuiltIn_1 = createCommonjsModule(function (module) {
  455. var defineProperty = objectDefineProperty.f;
  456. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  457. var enforceInternalState = internalState.enforce;
  458. var getInternalState = internalState.get;
  459. var CONFIGURABLE_LENGTH = !fails(function () {
  460. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  461. });
  462. var TEMPLATE = String(String).split('String');
  463. var makeBuiltIn = module.exports = function (value, name, options) {
  464. if (String(name).slice(0, 7) === 'Symbol(') {
  465. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  466. }
  467. if (options && options.getter) name = 'get ' + name;
  468. if (options && options.setter) name = 'set ' + name;
  469. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  470. defineProperty(value, 'name', { value: name, configurable: true });
  471. }
  472. if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
  473. defineProperty(value, 'length', { value: options.arity });
  474. }
  475. var state = enforceInternalState(value);
  476. if (!hasOwnProperty_1(state, 'source')) {
  477. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  478. } return value;
  479. };
  480. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  481. // eslint-disable-next-line no-extend-native -- required
  482. Function.prototype.toString = makeBuiltIn(function toString() {
  483. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  484. }, 'toString');
  485. });
  486. var defineBuiltIn = function (O, key, value, options) {
  487. var unsafe = options ? !!options.unsafe : false;
  488. var simple = options ? !!options.enumerable : false;
  489. var noTargetGet = options ? !!options.noTargetGet : false;
  490. var name = options && options.name !== undefined ? options.name : key;
  491. if (isCallable(value)) makeBuiltIn_1(value, name, options);
  492. if (O === global_1) {
  493. if (simple) O[key] = value;
  494. else setGlobal(key, value);
  495. return O;
  496. } else if (!unsafe) {
  497. delete O[key];
  498. } else if (!noTargetGet && O[key]) {
  499. simple = true;
  500. }
  501. if (simple) O[key] = value;
  502. else createNonEnumerableProperty(O, key, value);
  503. return O;
  504. };
  505. var ceil = Math.ceil;
  506. var floor$1 = Math.floor;
  507. // `ToIntegerOrInfinity` abstract operation
  508. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  509. var toIntegerOrInfinity = function (argument) {
  510. var number = +argument;
  511. // eslint-disable-next-line no-self-compare -- safe
  512. return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
  513. };
  514. var max$3 = Math.max;
  515. var min$2 = Math.min;
  516. // Helper for a popular repeating case of the spec:
  517. // Let integer be ? ToInteger(index).
  518. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  519. var toAbsoluteIndex = function (index, length) {
  520. var integer = toIntegerOrInfinity(index);
  521. return integer < 0 ? max$3(integer + length, 0) : min$2(integer, length);
  522. };
  523. var min$1 = Math.min;
  524. // `ToLength` abstract operation
  525. // https://tc39.es/ecma262/#sec-tolength
  526. var toLength = function (argument) {
  527. return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  528. };
  529. // `LengthOfArrayLike` abstract operation
  530. // https://tc39.es/ecma262/#sec-lengthofarraylike
  531. var lengthOfArrayLike = function (obj) {
  532. return toLength(obj.length);
  533. };
  534. // `Array.prototype.{ indexOf, includes }` methods implementation
  535. var createMethod$2 = function (IS_INCLUDES) {
  536. return function ($this, el, fromIndex) {
  537. var O = toIndexedObject($this);
  538. var length = lengthOfArrayLike(O);
  539. var index = toAbsoluteIndex(fromIndex, length);
  540. var value;
  541. // Array#includes uses SameValueZero equality algorithm
  542. // eslint-disable-next-line no-self-compare -- NaN check
  543. if (IS_INCLUDES && el != el) while (length > index) {
  544. value = O[index++];
  545. // eslint-disable-next-line no-self-compare -- NaN check
  546. if (value != value) return true;
  547. // Array#indexOf ignores holes, Array#includes - not
  548. } else for (;length > index; index++) {
  549. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  550. } return !IS_INCLUDES && -1;
  551. };
  552. };
  553. var arrayIncludes = {
  554. // `Array.prototype.includes` method
  555. // https://tc39.es/ecma262/#sec-array.prototype.includes
  556. includes: createMethod$2(true),
  557. // `Array.prototype.indexOf` method
  558. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  559. indexOf: createMethod$2(false)
  560. };
  561. var indexOf = arrayIncludes.indexOf;
  562. var push$2 = functionUncurryThis([].push);
  563. var objectKeysInternal = function (object, names) {
  564. var O = toIndexedObject(object);
  565. var i = 0;
  566. var result = [];
  567. var key;
  568. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$2(result, key);
  569. // Don't enum bug & hidden keys
  570. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  571. ~indexOf(result, key) || push$2(result, key);
  572. }
  573. return result;
  574. };
  575. // IE8- don't enum bug keys
  576. var enumBugKeys = [
  577. 'constructor',
  578. 'hasOwnProperty',
  579. 'isPrototypeOf',
  580. 'propertyIsEnumerable',
  581. 'toLocaleString',
  582. 'toString',
  583. 'valueOf'
  584. ];
  585. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  586. // `Object.getOwnPropertyNames` method
  587. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  588. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  589. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  590. return objectKeysInternal(O, hiddenKeys);
  591. };
  592. var objectGetOwnPropertyNames = {
  593. f: f$2
  594. };
  595. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  596. var f$1 = Object.getOwnPropertySymbols;
  597. var objectGetOwnPropertySymbols = {
  598. f: f$1
  599. };
  600. var concat$1 = functionUncurryThis([].concat);
  601. // all object keys, includes non-enumerable and symbols
  602. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  603. var keys = objectGetOwnPropertyNames.f(anObject(it));
  604. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  605. return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
  606. };
  607. var copyConstructorProperties = function (target, source, exceptions) {
  608. var keys = ownKeys(source);
  609. var defineProperty = objectDefineProperty.f;
  610. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  611. for (var i = 0; i < keys.length; i++) {
  612. var key = keys[i];
  613. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  614. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  615. }
  616. }
  617. };
  618. var replacement = /#|\.prototype\./;
  619. var isForced = function (feature, detection) {
  620. var value = data[normalize(feature)];
  621. return value == POLYFILL ? true
  622. : value == NATIVE ? false
  623. : isCallable(detection) ? fails(detection)
  624. : !!detection;
  625. };
  626. var normalize = isForced.normalize = function (string) {
  627. return String(string).replace(replacement, '.').toLowerCase();
  628. };
  629. var data = isForced.data = {};
  630. var NATIVE = isForced.NATIVE = 'N';
  631. var POLYFILL = isForced.POLYFILL = 'P';
  632. var isForced_1 = isForced;
  633. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  634. /*
  635. options.target - name of the target object
  636. options.global - target is the global object
  637. options.stat - export as static methods of target
  638. options.proto - export as prototype methods of target
  639. options.real - real prototype method for the `pure` version
  640. options.forced - export even if the native feature is available
  641. options.bind - bind methods to the target, required for the `pure` version
  642. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  643. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  644. options.sham - add a flag to not completely full polyfills
  645. options.enumerable - export as enumerable property
  646. options.noTargetGet - prevent calling a getter on target
  647. options.name - the .name of the function if it does not match the key
  648. */
  649. var _export = function (options, source) {
  650. var TARGET = options.target;
  651. var GLOBAL = options.global;
  652. var STATIC = options.stat;
  653. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  654. if (GLOBAL) {
  655. target = global_1;
  656. } else if (STATIC) {
  657. target = global_1[TARGET] || setGlobal(TARGET, {});
  658. } else {
  659. target = (global_1[TARGET] || {}).prototype;
  660. }
  661. if (target) for (key in source) {
  662. sourceProperty = source[key];
  663. if (options.noTargetGet) {
  664. descriptor = getOwnPropertyDescriptor(target, key);
  665. targetProperty = descriptor && descriptor.value;
  666. } else targetProperty = target[key];
  667. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  668. // contained in target
  669. if (!FORCED && targetProperty !== undefined) {
  670. if (typeof sourceProperty == typeof targetProperty) continue;
  671. copyConstructorProperties(sourceProperty, targetProperty);
  672. }
  673. // add a flag to not completely full polyfills
  674. if (options.sham || (targetProperty && targetProperty.sham)) {
  675. createNonEnumerableProperty(sourceProperty, 'sham', true);
  676. }
  677. defineBuiltIn(target, key, sourceProperty, options);
  678. }
  679. };
  680. var bind = functionUncurryThis(functionUncurryThis.bind);
  681. // optional / simple context binding
  682. var functionBindContext = function (fn, that) {
  683. aCallable(fn);
  684. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  685. return fn.apply(that, arguments);
  686. };
  687. };
  688. // `IsArray` abstract operation
  689. // https://tc39.es/ecma262/#sec-isarray
  690. // eslint-disable-next-line es-x/no-array-isarray -- safe
  691. var isArray = Array.isArray || function isArray(argument) {
  692. return classofRaw(argument) == 'Array';
  693. };
  694. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  695. var test$1 = {};
  696. test$1[TO_STRING_TAG$1] = 'z';
  697. var toStringTagSupport = String(test$1) === '[object z]';
  698. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  699. var Object$1 = global_1.Object;
  700. // ES3 wrong here
  701. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  702. // fallback for IE11 Script Access Denied error
  703. var tryGet = function (it, key) {
  704. try {
  705. return it[key];
  706. } catch (error) { /* empty */ }
  707. };
  708. // getting tag from ES6+ `Object.prototype.toString`
  709. var classof = toStringTagSupport ? classofRaw : function (it) {
  710. var O, tag, result;
  711. return it === undefined ? 'Undefined' : it === null ? 'Null'
  712. // @@toStringTag case
  713. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  714. // builtinTag case
  715. : CORRECT_ARGUMENTS ? classofRaw(O)
  716. // ES3 arguments fallback
  717. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  718. };
  719. var noop = function () { /* empty */ };
  720. var empty = [];
  721. var construct = getBuiltIn('Reflect', 'construct');
  722. var constructorRegExp = /^\s*(?:class|function)\b/;
  723. var exec = functionUncurryThis(constructorRegExp.exec);
  724. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  725. var isConstructorModern = function isConstructor(argument) {
  726. if (!isCallable(argument)) return false;
  727. try {
  728. construct(noop, empty, argument);
  729. return true;
  730. } catch (error) {
  731. return false;
  732. }
  733. };
  734. var isConstructorLegacy = function isConstructor(argument) {
  735. if (!isCallable(argument)) return false;
  736. switch (classof(argument)) {
  737. case 'AsyncFunction':
  738. case 'GeneratorFunction':
  739. case 'AsyncGeneratorFunction': return false;
  740. }
  741. try {
  742. // we can't check .prototype since constructors produced by .bind haven't it
  743. // `Function#toString` throws on some built-it function in some legacy engines
  744. // (for example, `DOMQuad` and similar in FF41-)
  745. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  746. } catch (error) {
  747. return true;
  748. }
  749. };
  750. isConstructorLegacy.sham = true;
  751. // `IsConstructor` abstract operation
  752. // https://tc39.es/ecma262/#sec-isconstructor
  753. var isConstructor = !construct || fails(function () {
  754. var called;
  755. return isConstructorModern(isConstructorModern.call)
  756. || !isConstructorModern(Object)
  757. || !isConstructorModern(function () { called = true; })
  758. || called;
  759. }) ? isConstructorLegacy : isConstructorModern;
  760. var SPECIES$2 = wellKnownSymbol('species');
  761. var Array$3 = global_1.Array;
  762. // a part of `ArraySpeciesCreate` abstract operation
  763. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  764. var arraySpeciesConstructor = function (originalArray) {
  765. var C;
  766. if (isArray(originalArray)) {
  767. C = originalArray.constructor;
  768. // cross-realm fallback
  769. if (isConstructor(C) && (C === Array$3 || isArray(C.prototype))) C = undefined;
  770. else if (isObject(C)) {
  771. C = C[SPECIES$2];
  772. if (C === null) C = undefined;
  773. }
  774. } return C === undefined ? Array$3 : C;
  775. };
  776. // `ArraySpeciesCreate` abstract operation
  777. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  778. var arraySpeciesCreate = function (originalArray, length) {
  779. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  780. };
  781. var push$1 = functionUncurryThis([].push);
  782. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  783. var createMethod$1 = function (TYPE) {
  784. var IS_MAP = TYPE == 1;
  785. var IS_FILTER = TYPE == 2;
  786. var IS_SOME = TYPE == 3;
  787. var IS_EVERY = TYPE == 4;
  788. var IS_FIND_INDEX = TYPE == 6;
  789. var IS_FILTER_REJECT = TYPE == 7;
  790. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  791. return function ($this, callbackfn, that, specificCreate) {
  792. var O = toObject($this);
  793. var self = indexedObject(O);
  794. var boundFunction = functionBindContext(callbackfn, that);
  795. var length = lengthOfArrayLike(self);
  796. var index = 0;
  797. var create = specificCreate || arraySpeciesCreate;
  798. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  799. var value, result;
  800. for (;length > index; index++) if (NO_HOLES || index in self) {
  801. value = self[index];
  802. result = boundFunction(value, index, O);
  803. if (TYPE) {
  804. if (IS_MAP) target[index] = result; // map
  805. else if (result) switch (TYPE) {
  806. case 3: return true; // some
  807. case 5: return value; // find
  808. case 6: return index; // findIndex
  809. case 2: push$1(target, value); // filter
  810. } else switch (TYPE) {
  811. case 4: return false; // every
  812. case 7: push$1(target, value); // filterReject
  813. }
  814. }
  815. }
  816. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  817. };
  818. };
  819. var arrayIteration = {
  820. // `Array.prototype.forEach` method
  821. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  822. forEach: createMethod$1(0),
  823. // `Array.prototype.map` method
  824. // https://tc39.es/ecma262/#sec-array.prototype.map
  825. map: createMethod$1(1),
  826. // `Array.prototype.filter` method
  827. // https://tc39.es/ecma262/#sec-array.prototype.filter
  828. filter: createMethod$1(2),
  829. // `Array.prototype.some` method
  830. // https://tc39.es/ecma262/#sec-array.prototype.some
  831. some: createMethod$1(3),
  832. // `Array.prototype.every` method
  833. // https://tc39.es/ecma262/#sec-array.prototype.every
  834. every: createMethod$1(4),
  835. // `Array.prototype.find` method
  836. // https://tc39.es/ecma262/#sec-array.prototype.find
  837. find: createMethod$1(5),
  838. // `Array.prototype.findIndex` method
  839. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  840. findIndex: createMethod$1(6),
  841. // `Array.prototype.filterReject` method
  842. // https://github.com/tc39/proposal-array-filtering
  843. filterReject: createMethod$1(7)
  844. };
  845. // `Object.keys` method
  846. // https://tc39.es/ecma262/#sec-object.keys
  847. // eslint-disable-next-line es-x/no-object-keys -- safe
  848. var objectKeys = Object.keys || function keys(O) {
  849. return objectKeysInternal(O, enumBugKeys);
  850. };
  851. // `Object.defineProperties` method
  852. // https://tc39.es/ecma262/#sec-object.defineproperties
  853. // eslint-disable-next-line es-x/no-object-defineproperties -- safe
  854. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  855. anObject(O);
  856. var props = toIndexedObject(Properties);
  857. var keys = objectKeys(Properties);
  858. var length = keys.length;
  859. var index = 0;
  860. var key;
  861. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  862. return O;
  863. };
  864. var objectDefineProperties = {
  865. f: f
  866. };
  867. var html = getBuiltIn('document', 'documentElement');
  868. /* global ActiveXObject -- old IE, WSH */
  869. var GT = '>';
  870. var LT = '<';
  871. var PROTOTYPE = 'prototype';
  872. var SCRIPT = 'script';
  873. var IE_PROTO = sharedKey('IE_PROTO');
  874. var EmptyConstructor = function () { /* empty */ };
  875. var scriptTag = function (content) {
  876. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  877. };
  878. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  879. var NullProtoObjectViaActiveX = function (activeXDocument) {
  880. activeXDocument.write(scriptTag(''));
  881. activeXDocument.close();
  882. var temp = activeXDocument.parentWindow.Object;
  883. activeXDocument = null; // avoid memory leak
  884. return temp;
  885. };
  886. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  887. var NullProtoObjectViaIFrame = function () {
  888. // Thrash, waste and sodomy: IE GC bug
  889. var iframe = documentCreateElement('iframe');
  890. var JS = 'java' + SCRIPT + ':';
  891. var iframeDocument;
  892. iframe.style.display = 'none';
  893. html.appendChild(iframe);
  894. // https://github.com/zloirock/core-js/issues/475
  895. iframe.src = String(JS);
  896. iframeDocument = iframe.contentWindow.document;
  897. iframeDocument.open();
  898. iframeDocument.write(scriptTag('document.F=Object'));
  899. iframeDocument.close();
  900. return iframeDocument.F;
  901. };
  902. // Check for document.domain and active x support
  903. // No need to use active x approach when document.domain is not set
  904. // see https://github.com/es-shims/es5-shim/issues/150
  905. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  906. // avoid IE GC bug
  907. var activeXDocument;
  908. var NullProtoObject = function () {
  909. try {
  910. activeXDocument = new ActiveXObject('htmlfile');
  911. } catch (error) { /* ignore */ }
  912. NullProtoObject = typeof document != 'undefined'
  913. ? document.domain && activeXDocument
  914. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  915. : NullProtoObjectViaIFrame()
  916. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  917. var length = enumBugKeys.length;
  918. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  919. return NullProtoObject();
  920. };
  921. hiddenKeys$1[IE_PROTO] = true;
  922. // `Object.create` method
  923. // https://tc39.es/ecma262/#sec-object.create
  924. // eslint-disable-next-line es-x/no-object-create -- safe
  925. var objectCreate = Object.create || function create(O, Properties) {
  926. var result;
  927. if (O !== null) {
  928. EmptyConstructor[PROTOTYPE] = anObject(O);
  929. result = new EmptyConstructor();
  930. EmptyConstructor[PROTOTYPE] = null;
  931. // add "__proto__" for Object.getPrototypeOf polyfill
  932. result[IE_PROTO] = O;
  933. } else result = NullProtoObject();
  934. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  935. };
  936. var UNSCOPABLES = wellKnownSymbol('unscopables');
  937. var ArrayPrototype = Array.prototype;
  938. // Array.prototype[@@unscopables]
  939. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  940. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  941. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  942. configurable: true,
  943. value: objectCreate(null)
  944. });
  945. }
  946. // add a key to Array.prototype[@@unscopables]
  947. var addToUnscopables = function (key) {
  948. ArrayPrototype[UNSCOPABLES][key] = true;
  949. };
  950. var $find = arrayIteration.find;
  951. var FIND = 'find';
  952. var SKIPS_HOLES = true;
  953. // Shouldn't skip holes
  954. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  955. // `Array.prototype.find` method
  956. // https://tc39.es/ecma262/#sec-array.prototype.find
  957. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  958. find: function find(callbackfn /* , that = undefined */) {
  959. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  960. }
  961. });
  962. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  963. addToUnscopables(FIND);
  964. // `Object.prototype.toString` method implementation
  965. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  966. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  967. return '[object ' + classof(this) + ']';
  968. };
  969. // `Object.prototype.toString` method
  970. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  971. if (!toStringTagSupport) {
  972. defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
  973. }
  974. var SPECIES$1 = wellKnownSymbol('species');
  975. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  976. // We can't use this feature detection in V8 since it causes
  977. // deoptimization and serious performance degradation
  978. // https://github.com/zloirock/core-js/issues/677
  979. return engineV8Version >= 51 || !fails(function () {
  980. var array = [];
  981. var constructor = array.constructor = {};
  982. constructor[SPECIES$1] = function () {
  983. return { foo: 1 };
  984. };
  985. return array[METHOD_NAME](Boolean).foo !== 1;
  986. });
  987. };
  988. var $map = arrayIteration.map;
  989. var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('map');
  990. // `Array.prototype.map` method
  991. // https://tc39.es/ecma262/#sec-array.prototype.map
  992. // with adding support of @@species
  993. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
  994. map: function map(callbackfn /* , thisArg */) {
  995. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  996. }
  997. });
  998. var String$1 = global_1.String;
  999. var toString_1 = function (argument) {
  1000. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  1001. return String$1(argument);
  1002. };
  1003. var createProperty = function (object, key, value) {
  1004. var propertyKey = toPropertyKey(key);
  1005. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1006. else object[propertyKey] = value;
  1007. };
  1008. var Array$2 = global_1.Array;
  1009. var max$2 = Math.max;
  1010. var arraySliceSimple = function (O, start, end) {
  1011. var length = lengthOfArrayLike(O);
  1012. var k = toAbsoluteIndex(start, length);
  1013. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1014. var result = Array$2(max$2(fin - k, 0));
  1015. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  1016. result.length = n;
  1017. return result;
  1018. };
  1019. var floor = Math.floor;
  1020. var mergeSort = function (array, comparefn) {
  1021. var length = array.length;
  1022. var middle = floor(length / 2);
  1023. return length < 8 ? insertionSort(array, comparefn) : merge(
  1024. array,
  1025. mergeSort(arraySliceSimple(array, 0, middle), comparefn),
  1026. mergeSort(arraySliceSimple(array, middle), comparefn),
  1027. comparefn
  1028. );
  1029. };
  1030. var insertionSort = function (array, comparefn) {
  1031. var length = array.length;
  1032. var i = 1;
  1033. var element, j;
  1034. while (i < length) {
  1035. j = i;
  1036. element = array[i];
  1037. while (j && comparefn(array[j - 1], element) > 0) {
  1038. array[j] = array[--j];
  1039. }
  1040. if (j !== i++) array[j] = element;
  1041. } return array;
  1042. };
  1043. var merge = function (array, left, right, comparefn) {
  1044. var llength = left.length;
  1045. var rlength = right.length;
  1046. var lindex = 0;
  1047. var rindex = 0;
  1048. while (lindex < llength || rindex < rlength) {
  1049. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  1050. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  1051. : lindex < llength ? left[lindex++] : right[rindex++];
  1052. } return array;
  1053. };
  1054. var arraySort = mergeSort;
  1055. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1056. var method = [][METHOD_NAME];
  1057. return !!method && fails(function () {
  1058. // eslint-disable-next-line no-useless-call -- required for testing
  1059. method.call(null, argument || function () { return 1; }, 1);
  1060. });
  1061. };
  1062. var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
  1063. var engineFfVersion = !!firefox && +firefox[1];
  1064. var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
  1065. var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
  1066. var engineWebkitVersion = !!webkit && +webkit[1];
  1067. var test = [];
  1068. var un$Sort = functionUncurryThis(test.sort);
  1069. var push = functionUncurryThis(test.push);
  1070. // IE8-
  1071. var FAILS_ON_UNDEFINED = fails(function () {
  1072. test.sort(undefined);
  1073. });
  1074. // V8 bug
  1075. var FAILS_ON_NULL = fails(function () {
  1076. test.sort(null);
  1077. });
  1078. // Old WebKit
  1079. var STRICT_METHOD$1 = arrayMethodIsStrict('sort');
  1080. var STABLE_SORT = !fails(function () {
  1081. // feature detection can be too slow, so check engines versions
  1082. if (engineV8Version) return engineV8Version < 70;
  1083. if (engineFfVersion && engineFfVersion > 3) return;
  1084. if (engineIsIeOrEdge) return true;
  1085. if (engineWebkitVersion) return engineWebkitVersion < 603;
  1086. var result = '';
  1087. var code, chr, value, index;
  1088. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  1089. for (code = 65; code < 76; code++) {
  1090. chr = String.fromCharCode(code);
  1091. switch (code) {
  1092. case 66: case 69: case 70: case 72: value = 3; break;
  1093. case 68: case 71: value = 4; break;
  1094. default: value = 2;
  1095. }
  1096. for (index = 0; index < 47; index++) {
  1097. test.push({ k: chr + index, v: value });
  1098. }
  1099. }
  1100. test.sort(function (a, b) { return b.v - a.v; });
  1101. for (index = 0; index < test.length; index++) {
  1102. chr = test[index].k.charAt(0);
  1103. if (result.charAt(result.length - 1) !== chr) result += chr;
  1104. }
  1105. return result !== 'DGBEFHACIJK';
  1106. });
  1107. var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1 || !STABLE_SORT;
  1108. var getSortCompare = function (comparefn) {
  1109. return function (x, y) {
  1110. if (y === undefined) return -1;
  1111. if (x === undefined) return 1;
  1112. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  1113. return toString_1(x) > toString_1(y) ? 1 : -1;
  1114. };
  1115. };
  1116. // `Array.prototype.sort` method
  1117. // https://tc39.es/ecma262/#sec-array.prototype.sort
  1118. _export({ target: 'Array', proto: true, forced: FORCED$2 }, {
  1119. sort: function sort(comparefn) {
  1120. if (comparefn !== undefined) aCallable(comparefn);
  1121. var array = toObject(this);
  1122. if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
  1123. var items = [];
  1124. var arrayLength = lengthOfArrayLike(array);
  1125. var itemsLength, index;
  1126. for (index = 0; index < arrayLength; index++) {
  1127. if (index in array) push(items, array[index]);
  1128. }
  1129. arraySort(items, getSortCompare(comparefn));
  1130. itemsLength = items.length;
  1131. index = 0;
  1132. while (index < itemsLength) array[index] = items[index++];
  1133. while (index < arrayLength) delete array[index++];
  1134. return array;
  1135. }
  1136. });
  1137. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1138. var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
  1139. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1140. var TypeError$2 = global_1.TypeError;
  1141. // We can't use this feature detection in V8 since it causes
  1142. // deoptimization and serious performance degradation
  1143. // https://github.com/zloirock/core-js/issues/679
  1144. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1145. var array = [];
  1146. array[IS_CONCAT_SPREADABLE] = false;
  1147. return array.concat()[0] !== array;
  1148. });
  1149. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1150. var isConcatSpreadable = function (O) {
  1151. if (!isObject(O)) return false;
  1152. var spreadable = O[IS_CONCAT_SPREADABLE];
  1153. return spreadable !== undefined ? !!spreadable : isArray(O);
  1154. };
  1155. var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1156. // `Array.prototype.concat` method
  1157. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1158. // with adding support of @@isConcatSpreadable and @@species
  1159. _export({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
  1160. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1161. concat: function concat(arg) {
  1162. var O = toObject(this);
  1163. var A = arraySpeciesCreate(O, 0);
  1164. var n = 0;
  1165. var i, k, length, len, E;
  1166. for (i = -1, length = arguments.length; i < length; i++) {
  1167. E = i === -1 ? O : arguments[i];
  1168. if (isConcatSpreadable(E)) {
  1169. len = lengthOfArrayLike(E);
  1170. if (n + len > MAX_SAFE_INTEGER$1) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1171. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1172. } else {
  1173. if (n >= MAX_SAFE_INTEGER$1) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1174. createProperty(A, n++, E);
  1175. }
  1176. }
  1177. A.length = n;
  1178. return A;
  1179. }
  1180. });
  1181. var $includes = arrayIncludes.includes;
  1182. // FF99+ bug
  1183. var BROKEN_ON_SPARSE = fails(function () {
  1184. return !Array(1).includes();
  1185. });
  1186. // `Array.prototype.includes` method
  1187. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1188. _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
  1189. includes: function includes(el /* , fromIndex = 0 */) {
  1190. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1191. }
  1192. });
  1193. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1194. addToUnscopables('includes');
  1195. // eslint-disable-next-line es-x/no-object-assign -- safe
  1196. var $assign = Object.assign;
  1197. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  1198. var defineProperty = Object.defineProperty;
  1199. var concat = functionUncurryThis([].concat);
  1200. // `Object.assign` method
  1201. // https://tc39.es/ecma262/#sec-object.assign
  1202. var objectAssign = !$assign || fails(function () {
  1203. // should have correct order of operations (Edge bug)
  1204. if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  1205. enumerable: true,
  1206. get: function () {
  1207. defineProperty(this, 'b', {
  1208. value: 3,
  1209. enumerable: false
  1210. });
  1211. }
  1212. }), { b: 2 })).b !== 1) return true;
  1213. // should work with symbols and should have deterministic property order (V8 bug)
  1214. var A = {};
  1215. var B = {};
  1216. // eslint-disable-next-line es-x/no-symbol -- safe
  1217. var symbol = Symbol();
  1218. var alphabet = 'abcdefghijklmnopqrst';
  1219. A[symbol] = 7;
  1220. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1221. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1222. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1223. var T = toObject(target);
  1224. var argumentsLength = arguments.length;
  1225. var index = 1;
  1226. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  1227. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1228. while (argumentsLength > index) {
  1229. var S = indexedObject(arguments[index++]);
  1230. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  1231. var length = keys.length;
  1232. var j = 0;
  1233. var key;
  1234. while (length > j) {
  1235. key = keys[j++];
  1236. if (!descriptors || functionCall(propertyIsEnumerable, S, key)) T[key] = S[key];
  1237. }
  1238. } return T;
  1239. } : $assign;
  1240. // `Object.assign` method
  1241. // https://tc39.es/ecma262/#sec-object.assign
  1242. // eslint-disable-next-line es-x/no-object-assign -- required for testing
  1243. _export({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== objectAssign }, {
  1244. assign: objectAssign
  1245. });
  1246. var arraySlice = functionUncurryThis([].slice);
  1247. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  1248. var SPECIES = wellKnownSymbol('species');
  1249. var Array$1 = global_1.Array;
  1250. var max$1 = Math.max;
  1251. // `Array.prototype.slice` method
  1252. // https://tc39.es/ecma262/#sec-array.prototype.slice
  1253. // fallback for not array-like ES3 strings and DOM objects
  1254. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1255. slice: function slice(start, end) {
  1256. var O = toIndexedObject(this);
  1257. var length = lengthOfArrayLike(O);
  1258. var k = toAbsoluteIndex(start, length);
  1259. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1260. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1261. var Constructor, result, n;
  1262. if (isArray(O)) {
  1263. Constructor = O.constructor;
  1264. // cross-realm fallback
  1265. if (isConstructor(Constructor) && (Constructor === Array$1 || isArray(Constructor.prototype))) {
  1266. Constructor = undefined;
  1267. } else if (isObject(Constructor)) {
  1268. Constructor = Constructor[SPECIES];
  1269. if (Constructor === null) Constructor = undefined;
  1270. }
  1271. if (Constructor === Array$1 || Constructor === undefined) {
  1272. return arraySlice(O, k, fin);
  1273. }
  1274. }
  1275. result = new (Constructor === undefined ? Array$1 : Constructor)(max$1(fin - k, 0));
  1276. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  1277. result.length = n;
  1278. return result;
  1279. }
  1280. });
  1281. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  1282. var TypeError$1 = global_1.TypeError;
  1283. var max = Math.max;
  1284. var min = Math.min;
  1285. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1286. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  1287. // `Array.prototype.splice` method
  1288. // https://tc39.es/ecma262/#sec-array.prototype.splice
  1289. // with adding support of @@species
  1290. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1291. splice: function splice(start, deleteCount /* , ...items */) {
  1292. var O = toObject(this);
  1293. var len = lengthOfArrayLike(O);
  1294. var actualStart = toAbsoluteIndex(start, len);
  1295. var argumentsLength = arguments.length;
  1296. var insertCount, actualDeleteCount, A, k, from, to;
  1297. if (argumentsLength === 0) {
  1298. insertCount = actualDeleteCount = 0;
  1299. } else if (argumentsLength === 1) {
  1300. insertCount = 0;
  1301. actualDeleteCount = len - actualStart;
  1302. } else {
  1303. insertCount = argumentsLength - 2;
  1304. actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
  1305. }
  1306. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
  1307. throw TypeError$1(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  1308. }
  1309. A = arraySpeciesCreate(O, actualDeleteCount);
  1310. for (k = 0; k < actualDeleteCount; k++) {
  1311. from = actualStart + k;
  1312. if (from in O) createProperty(A, k, O[from]);
  1313. }
  1314. A.length = actualDeleteCount;
  1315. if (insertCount < actualDeleteCount) {
  1316. for (k = actualStart; k < len - actualDeleteCount; k++) {
  1317. from = k + actualDeleteCount;
  1318. to = k + insertCount;
  1319. if (from in O) O[to] = O[from];
  1320. else delete O[to];
  1321. }
  1322. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  1323. } else if (insertCount > actualDeleteCount) {
  1324. for (k = len - actualDeleteCount; k > actualStart; k--) {
  1325. from = k + actualDeleteCount - 1;
  1326. to = k + insertCount - 1;
  1327. if (from in O) O[to] = O[from];
  1328. else delete O[to];
  1329. }
  1330. }
  1331. for (k = 0; k < insertCount; k++) {
  1332. O[k + actualStart] = arguments[k + 2];
  1333. }
  1334. O.length = len - actualDeleteCount + insertCount;
  1335. return A;
  1336. }
  1337. });
  1338. /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
  1339. var $IndexOf = arrayIncludes.indexOf;
  1340. var un$IndexOf = functionUncurryThis([].indexOf);
  1341. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  1342. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  1343. // `Array.prototype.indexOf` method
  1344. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1345. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  1346. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1347. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1348. return NEGATIVE_ZERO
  1349. // convert -0 to +0
  1350. ? un$IndexOf(this, searchElement, fromIndex) || 0
  1351. : $IndexOf(this, searchElement, fromIndex);
  1352. }
  1353. });
  1354. // a string of all valid unicode whitespaces
  1355. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  1356. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1357. var replace = functionUncurryThis(''.replace);
  1358. var whitespace = '[' + whitespaces + ']';
  1359. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1360. var rtrim = RegExp(whitespace + whitespace + '*$');
  1361. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1362. var createMethod = function (TYPE) {
  1363. return function ($this) {
  1364. var string = toString_1(requireObjectCoercible($this));
  1365. if (TYPE & 1) string = replace(string, ltrim, '');
  1366. if (TYPE & 2) string = replace(string, rtrim, '');
  1367. return string;
  1368. };
  1369. };
  1370. var stringTrim = {
  1371. // `String.prototype.{ trimLeft, trimStart }` methods
  1372. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  1373. start: createMethod(1),
  1374. // `String.prototype.{ trimRight, trimEnd }` methods
  1375. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  1376. end: createMethod(2),
  1377. // `String.prototype.trim` method
  1378. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1379. trim: createMethod(3)
  1380. };
  1381. var trim = stringTrim.trim;
  1382. var charAt = functionUncurryThis(''.charAt);
  1383. var n$ParseFloat = global_1.parseFloat;
  1384. var Symbol$1 = global_1.Symbol;
  1385. var ITERATOR = Symbol$1 && Symbol$1.iterator;
  1386. var FORCED = 1 / n$ParseFloat(whitespaces + '-0') !== -Infinity
  1387. // MS Edge 18- broken with boxed symbols
  1388. || (ITERATOR && !fails(function () { n$ParseFloat(Object(ITERATOR)); }));
  1389. // `parseFloat` method
  1390. // https://tc39.es/ecma262/#sec-parsefloat-string
  1391. var numberParseFloat = FORCED ? function parseFloat(string) {
  1392. var trimmedString = trim(toString_1(string));
  1393. var result = n$ParseFloat(trimmedString);
  1394. return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
  1395. } : n$ParseFloat;
  1396. // `parseFloat` method
  1397. // https://tc39.es/ecma262/#sec-parsefloat-string
  1398. _export({ global: true, forced: parseFloat != numberParseFloat }, {
  1399. parseFloat: numberParseFloat
  1400. });
  1401. // `RegExp.prototype.flags` getter implementation
  1402. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1403. var regexpFlags = function () {
  1404. var that = anObject(this);
  1405. var result = '';
  1406. if (that.hasIndices) result += 'd';
  1407. if (that.global) result += 'g';
  1408. if (that.ignoreCase) result += 'i';
  1409. if (that.multiline) result += 'm';
  1410. if (that.dotAll) result += 's';
  1411. if (that.unicode) result += 'u';
  1412. if (that.sticky) result += 'y';
  1413. return result;
  1414. };
  1415. var RegExpPrototype$1 = RegExp.prototype;
  1416. var regexpGetFlags = function (R) {
  1417. var flags = R.flags;
  1418. return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwnProperty_1(R, 'flags') && objectIsPrototypeOf(RegExpPrototype$1, R)
  1419. ? functionCall(regexpFlags, R) : flags;
  1420. };
  1421. var PROPER_FUNCTION_NAME = functionName.PROPER;
  1422. var TO_STRING = 'toString';
  1423. var RegExpPrototype = RegExp.prototype;
  1424. var n$ToString = RegExpPrototype[TO_STRING];
  1425. var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1426. // FF44- RegExp#toString has a wrong name
  1427. var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
  1428. // `RegExp.prototype.toString` method
  1429. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  1430. if (NOT_GENERIC || INCORRECT_NAME) {
  1431. defineBuiltIn(RegExp.prototype, TO_STRING, function toString() {
  1432. var R = anObject(this);
  1433. var pattern = toString_1(R.source);
  1434. var flags = toString_1(regexpGetFlags(R));
  1435. return '/' + pattern + '/' + flags;
  1436. }, { unsafe: true });
  1437. }
  1438. /**
  1439. * @author Nadim Basalamah <dimbslmh@gmail.com>
  1440. * @version: v1.1.0
  1441. * https://github.com/dimbslmh/bootstrap-table/tree/master/src/extensions/multiple-sort/bootstrap-table-multiple-sort.js
  1442. * Modification: ErwannNevou <https://github.com/ErwannNevou>
  1443. */
  1444. var isSingleSort = false;
  1445. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1446. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults.icons, {
  1447. plus: {
  1448. bootstrap3: 'glyphicon-plus',
  1449. bootstrap4: 'fa-plus',
  1450. bootstrap5: 'bi-plus',
  1451. semantic: 'fa-plus',
  1452. materialize: 'plus',
  1453. foundation: 'fa-plus',
  1454. bulma: 'fa-plus',
  1455. 'bootstrap-table': 'icon-plus'
  1456. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-clock',
  1457. minus: {
  1458. bootstrap3: 'glyphicon-minus',
  1459. bootstrap4: 'fa-minus',
  1460. bootstrap5: 'bi-dash',
  1461. semantic: 'fa-minus',
  1462. materialize: 'minus',
  1463. foundation: 'fa-minus',
  1464. bulma: 'fa-minus',
  1465. 'bootstrap-table': 'icon-minus'
  1466. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-clock',
  1467. sort: {
  1468. bootstrap3: 'glyphicon-sort',
  1469. bootstrap4: 'fa-sort',
  1470. bootstrap5: 'bi-arrow-down-up',
  1471. semantic: 'fa-sort',
  1472. materialize: 'sort',
  1473. foundation: 'fa-sort',
  1474. bulma: 'fa-sort',
  1475. 'bootstrap-table': 'icon-sort-amount-asc'
  1476. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-clock'
  1477. });
  1478. var theme = {
  1479. bootstrap3: {
  1480. html: {
  1481. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\n <h4 class=\"modal-title\" id=\"%sLabel\">%s</h4>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\">\n <button id=\"add\" type=\"button\" class=\"btn btn-default\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-default\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1482. multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1483. multipleSortSelect: '<select class="%s %s form-control">'
  1484. }
  1485. },
  1486. bootstrap4: {
  1487. html: {
  1488. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"btn btn-secondary\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1489. multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1490. multipleSortSelect: '<select class="%s %s form-control">'
  1491. }
  1492. },
  1493. bootstrap5: {
  1494. html: {
  1495. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"btn btn-secondary\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1496. multipleSortButton: '<button class="multi-sort %s" type="button" data-bs-toggle="modal" data-bs-target="#%s" title="%s">%s</button>',
  1497. multipleSortSelect: '<select class="%s %s form-control">'
  1498. }
  1499. },
  1500. semantic: {
  1501. html: {
  1502. multipleSortModal: "\n <div class=\"ui modal tiny\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <i class=\"close icon\"></i>\n <div class=\"header\" id=\"%sLabel\">\n %s\n </div>\n <div class=\"image content\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"ui button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"ui button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <div class=\"ui button deny\">%s</div>\n <div class=\"ui button approve multi-sort-order-button\">%s</div>\n </div>\n </div>\n ",
  1503. multipleSortButton: '<button class="multi-sort %s" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1504. multipleSortSelect: '<select class="%s %s">'
  1505. }
  1506. },
  1507. materialize: {
  1508. html: {
  1509. multipleSortModal: "\n <div id=\"%s\" class=\"modal\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-content\" id=\"%sLabel\">\n <h4>%s</h4>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light btn\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light btn\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn\">%s</a>\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn multi-sort-order-button\">%s</a>\n </div>\n </div>\n </div>\n ",
  1510. multipleSortButton: '<a class="multi-sort %s modal-trigger" href="#%s" type="button" data-toggle="modal" title="%s">%s</a>',
  1511. multipleSortSelect: '<select class="%s %s browser-default">'
  1512. }
  1513. },
  1514. foundation: {
  1515. html: {
  1516. multipleSortModal: "\n <div class=\"reveal\" id=\"%s\" data-reveal aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div id=\"%sLabel\">\n <h1>%s</h1>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n\n <button class=\"waves-effect waves-light button\" data-close aria-label=\"Close modal\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n <button class=\"waves-effect waves-light button multi-sort-order-button\" data-close aria-label=\"Order\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n </div>\n </div>\n ",
  1517. multipleSortButton: '<button class="multi-sort %s" data-open="%s" title="%s">%s</button>',
  1518. multipleSortSelect: '<select class="%s %s browser-default">'
  1519. }
  1520. },
  1521. bulma: {
  1522. html: {
  1523. multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <button type=\"button\" class=\"waves-effect waves-light button\" data-close>%s</button>\n <button type=\"button\" class=\"waves-effect waves-light button multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n ",
  1524. multipleSortButton: '<button class="multi-sort %s" data-target="%s" title="%s">%s</button>',
  1525. multipleSortSelect: '<select class="%s %s browser-default">'
  1526. }
  1527. },
  1528. 'bootstrap-table': {
  1529. html: {
  1530. multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"btn\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"mt-30\">\n <button type=\"button\" class=\"btn\" data-close>%s</button>\n <button type=\"button\" class=\"btn multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1531. multipleSortButton: '<button class="multi-sort %s" data-target="%s" title="%s">%s</button>',
  1532. multipleSortSelect: '<select class="%s %s browser-default">'
  1533. }
  1534. }
  1535. }[$__default["default"].fn.bootstrapTable.theme];
  1536. var showSortModal = function showSortModal(that) {
  1537. var _selector = that.sortModalSelector;
  1538. var _id = "#".concat(_selector);
  1539. var o = that.options;
  1540. if (!$__default["default"](_id).hasClass('modal')) {
  1541. var sModal = Utils.sprintf(theme.html.multipleSortModal, _selector, _selector, _selector, that.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.plus), that.options.formatAddLevel(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.minus), that.options.formatDeleteLevel(), that.options.formatColumn(), that.options.formatOrder(), that.options.formatCancel(), that.options.formatSort());
  1542. $__default["default"]('body').append($__default["default"](sModal));
  1543. that.$sortModal = $__default["default"](_id);
  1544. var $rows = that.$sortModal.find('tbody > tr');
  1545. that.$sortModal.off('click', '#add').on('click', '#add', function () {
  1546. var total = that.$sortModal.find('.multi-sort-name:first option').length;
  1547. var current = that.$sortModal.find('tbody tr').length;
  1548. if (current < total) {
  1549. current++;
  1550. that.addLevel();
  1551. that.setButtonStates();
  1552. }
  1553. });
  1554. that.$sortModal.off('click', '#delete').on('click', '#delete', function () {
  1555. var total = that.$sortModal.find('.multi-sort-name:first option').length;
  1556. var current = that.$sortModal.find('tbody tr').length;
  1557. if (current > 1 && current <= total) {
  1558. current--;
  1559. that.$sortModal.find('tbody tr:last').remove();
  1560. that.setButtonStates();
  1561. }
  1562. });
  1563. that.$sortModal.off('click', '.multi-sort-order-button').on('click', '.multi-sort-order-button', function () {
  1564. var $rows = that.$sortModal.find('tbody > tr');
  1565. var $alert = that.$sortModal.find('div.alert');
  1566. var fields = [];
  1567. var results = [];
  1568. var sortPriority = $__default["default"].map($rows, function (row) {
  1569. var $row = $__default["default"](row);
  1570. var name = $row.find('.multi-sort-name').val();
  1571. var order = $row.find('.multi-sort-order').val();
  1572. fields.push(name);
  1573. return {
  1574. sortName: name,
  1575. sortOrder: order
  1576. };
  1577. });
  1578. var sorted_fields = fields.sort();
  1579. for (var i = 0; i < fields.length - 1; i++) {
  1580. if (sorted_fields[i + 1] === sorted_fields[i]) {
  1581. results.push(sorted_fields[i]);
  1582. }
  1583. }
  1584. if (results.length > 0) {
  1585. if ($alert.length === 0) {
  1586. $alert = "<div class=\"alert alert-danger\" role=\"alert\"><strong>".concat(that.options.formatDuplicateAlertTitle(), "</strong> ").concat(that.options.formatDuplicateAlertDescription(), "</div>");
  1587. $__default["default"]($alert).insertBefore(that.$sortModal.find('.bars'));
  1588. }
  1589. } else {
  1590. if ($alert.length === 1) {
  1591. $__default["default"]($alert).remove();
  1592. }
  1593. if (['bootstrap3', 'bootstrap4', 'bootstrap5'].includes($__default["default"].fn.bootstrapTable.theme)) {
  1594. that.$sortModal.modal('hide');
  1595. }
  1596. that.multiSort(sortPriority);
  1597. }
  1598. });
  1599. if (that.options.sortPriority === null || that.options.sortPriority.length === 0) {
  1600. if (that.options.sortName) {
  1601. that.options.sortPriority = [{
  1602. sortName: that.options.sortName,
  1603. sortOrder: that.options.sortOrder
  1604. }];
  1605. }
  1606. }
  1607. if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
  1608. if ($rows.length < that.options.sortPriority.length && _typeof(that.options.sortPriority) === 'object') {
  1609. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1610. that.addLevel(i, that.options.sortPriority[i]);
  1611. }
  1612. }
  1613. } else {
  1614. that.addLevel(0);
  1615. }
  1616. that.setButtonStates();
  1617. }
  1618. };
  1619. $__default["default"].fn.bootstrapTable.methods.push('multipleSort');
  1620. $__default["default"].fn.bootstrapTable.methods.push('multiSort');
  1621. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1622. showMultiSort: false,
  1623. showMultiSortButton: true,
  1624. multiSortStrictSort: false,
  1625. sortPriority: null,
  1626. onMultipleSort: function onMultipleSort() {
  1627. return false;
  1628. }
  1629. });
  1630. $__default["default"].extend($__default["default"].fn.bootstrapTable.Constructor.EVENTS, {
  1631. 'multiple-sort.bs.table': 'onMultipleSort'
  1632. });
  1633. $__default["default"].extend($__default["default"].fn.bootstrapTable.locales, {
  1634. formatMultipleSort: function formatMultipleSort() {
  1635. return 'Multiple Sort';
  1636. },
  1637. formatAddLevel: function formatAddLevel() {
  1638. return 'Add Level';
  1639. },
  1640. formatDeleteLevel: function formatDeleteLevel() {
  1641. return 'Delete Level';
  1642. },
  1643. formatColumn: function formatColumn() {
  1644. return 'Column';
  1645. },
  1646. formatOrder: function formatOrder() {
  1647. return 'Order';
  1648. },
  1649. formatSortBy: function formatSortBy() {
  1650. return 'Sort by';
  1651. },
  1652. formatThenBy: function formatThenBy() {
  1653. return 'Then by';
  1654. },
  1655. formatSort: function formatSort() {
  1656. return 'Sort';
  1657. },
  1658. formatCancel: function formatCancel() {
  1659. return 'Cancel';
  1660. },
  1661. formatDuplicateAlertTitle: function formatDuplicateAlertTitle() {
  1662. return 'Duplicate(s) detected!';
  1663. },
  1664. formatDuplicateAlertDescription: function formatDuplicateAlertDescription() {
  1665. return 'Please remove or change any duplicate column.';
  1666. },
  1667. formatSortOrders: function formatSortOrders() {
  1668. return {
  1669. asc: 'Ascending',
  1670. desc: 'Descending'
  1671. };
  1672. }
  1673. });
  1674. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, $__default["default"].fn.bootstrapTable.locales);
  1675. var BootstrapTable = $__default["default"].fn.bootstrapTable.Constructor;
  1676. var _initToolbar = BootstrapTable.prototype.initToolbar;
  1677. var _destroy = BootstrapTable.prototype.destroy;
  1678. BootstrapTable.prototype.initToolbar = function () {
  1679. var _this = this;
  1680. this.showToolbar = this.showToolbar || this.options.showMultiSort;
  1681. var that = this;
  1682. var sortModalSelector = "sortModal_".concat(this.$el.attr('id'));
  1683. var sortModalId = "#".concat(sortModalSelector);
  1684. var $multiSortBtn = this.$toolbar.find('div.multi-sort');
  1685. var o = this.options;
  1686. this.$sortModal = $__default["default"](sortModalId);
  1687. this.sortModalSelector = sortModalSelector;
  1688. if (that.options.sortPriority !== null) {
  1689. that.onMultipleSort();
  1690. }
  1691. if (this.options.showMultiSortButton) {
  1692. this.buttons = Object.assign(this.buttons, {
  1693. multipleSort: {
  1694. html: Utils.sprintf(theme.html.multipleSortButton, that.constants.buttonsClass, that.sortModalSelector, this.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.sort))
  1695. }
  1696. });
  1697. }
  1698. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1699. args[_key] = arguments[_key];
  1700. }
  1701. _initToolbar.apply(this, Array.prototype.slice.apply(args));
  1702. if (that.options.sidePagination === 'server' && !isSingleSort && that.options.sortPriority !== null) {
  1703. var t = that.options.queryParams;
  1704. that.options.queryParams = function (params) {
  1705. params.multiSort = that.options.sortPriority;
  1706. return t(params);
  1707. };
  1708. }
  1709. if (this.options.showMultiSort) {
  1710. if (!$multiSortBtn.length && this.options.showMultiSortButton) {
  1711. if ($__default["default"].fn.bootstrapTable.theme === 'semantic') {
  1712. this.$toolbar.find('.multi-sort').on('click', function () {
  1713. $__default["default"](sortModalId).modal('show');
  1714. });
  1715. } else if ($__default["default"].fn.bootstrapTable.theme === 'materialize') {
  1716. this.$toolbar.find('.multi-sort').on('click', function () {
  1717. $__default["default"](sortModalId).modal();
  1718. });
  1719. } else if ($__default["default"].fn.bootstrapTable.theme === 'bootstrap-table') {
  1720. this.$toolbar.find('.multi-sort').on('click', function () {
  1721. $__default["default"](sortModalId).addClass('show');
  1722. });
  1723. } else if ($__default["default"].fn.bootstrapTable.theme === 'foundation') {
  1724. this.$toolbar.find('.multi-sort').on('click', function () {
  1725. if (!_this.foundationModal) {
  1726. // eslint-disable-next-line no-undef
  1727. _this.foundationModal = new Foundation.Reveal($__default["default"](sortModalId));
  1728. }
  1729. _this.foundationModal.open();
  1730. });
  1731. } else if ($__default["default"].fn.bootstrapTable.theme === 'bulma') {
  1732. this.$toolbar.find('.multi-sort').on('click', function () {
  1733. $__default["default"]('html').toggleClass('is-clipped');
  1734. $__default["default"](sortModalId).toggleClass('is-active');
  1735. $__default["default"]('button[data-close]').one('click', function () {
  1736. $__default["default"]('html').toggleClass('is-clipped');
  1737. $__default["default"](sortModalId).toggleClass('is-active');
  1738. });
  1739. });
  1740. }
  1741. showSortModal(that);
  1742. }
  1743. this.$el.on('sort.bs.table', function () {
  1744. isSingleSort = true;
  1745. });
  1746. this.$el.on('multiple-sort.bs.table', function () {
  1747. isSingleSort = false;
  1748. });
  1749. this.$el.on('load-success.bs.table', function () {
  1750. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
  1751. that.onMultipleSort();
  1752. }
  1753. });
  1754. this.$el.on('column-switch.bs.table', function (field, checked) {
  1755. if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
  1756. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1757. if (that.options.sortPriority[i].sortName === checked) {
  1758. that.options.sortPriority.splice(i, 1);
  1759. }
  1760. }
  1761. that.assignSortableArrows();
  1762. }
  1763. that.$sortModal.remove();
  1764. showSortModal(that);
  1765. });
  1766. this.$el.on('reset-view.bs.table', function () {
  1767. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object') {
  1768. that.assignSortableArrows();
  1769. }
  1770. });
  1771. }
  1772. };
  1773. BootstrapTable.prototype.destroy = function () {
  1774. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1775. args[_key2] = arguments[_key2];
  1776. }
  1777. _destroy.apply(this, Array.prototype.slice.apply(args));
  1778. if (this.options.showMultiSort) {
  1779. this.enableCustomSort = false;
  1780. this.$sortModal.remove();
  1781. }
  1782. };
  1783. BootstrapTable.prototype.multipleSort = function () {
  1784. var that = this;
  1785. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
  1786. that.onMultipleSort();
  1787. }
  1788. };
  1789. BootstrapTable.prototype.onMultipleSort = function () {
  1790. var that = this;
  1791. var cmp = function cmp(x, y) {
  1792. return x > y ? 1 : x < y ? -1 : 0;
  1793. };
  1794. var arrayCmp = function arrayCmp(a, b) {
  1795. var arr1 = [];
  1796. var arr2 = [];
  1797. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1798. var fieldName = that.options.sortPriority[i].sortName;
  1799. var fieldIndex = that.header.fields.indexOf(fieldName);
  1800. var sorterName = that.header.sorters[that.header.fields.indexOf(fieldName)];
  1801. if (that.header.sortNames[fieldIndex]) {
  1802. fieldName = that.header.sortNames[fieldIndex];
  1803. }
  1804. var order = that.options.sortPriority[i].sortOrder === 'desc' ? -1 : 1;
  1805. var aa = Utils.getItemField(a, fieldName);
  1806. var bb = Utils.getItemField(b, fieldName);
  1807. var value1 = $__default["default"].fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [aa, bb]);
  1808. var value2 = $__default["default"].fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [bb, aa]);
  1809. if (value1 !== undefined && value2 !== undefined) {
  1810. arr1.push(order * value1);
  1811. arr2.push(order * value2);
  1812. continue;
  1813. }
  1814. if (aa === undefined || aa === null) aa = '';
  1815. if (bb === undefined || bb === null) bb = '';
  1816. if ($__default["default"].isNumeric(aa) && $__default["default"].isNumeric(bb)) {
  1817. aa = parseFloat(aa);
  1818. bb = parseFloat(bb);
  1819. } else {
  1820. aa = aa.toString();
  1821. bb = bb.toString();
  1822. if (that.options.multiSortStrictSort) {
  1823. aa = aa.toLowerCase();
  1824. bb = bb.toLowerCase();
  1825. }
  1826. }
  1827. arr1.push(order * cmp(aa, bb));
  1828. arr2.push(order * cmp(bb, aa));
  1829. }
  1830. return cmp(arr1, arr2);
  1831. };
  1832. this.enableCustomSort = true;
  1833. this.data.sort(function (a, b) {
  1834. return arrayCmp(a, b);
  1835. });
  1836. this.initBody();
  1837. this.assignSortableArrows();
  1838. this.trigger('multiple-sort');
  1839. };
  1840. BootstrapTable.prototype.addLevel = function (index, sortPriority) {
  1841. var text = index === 0 ? this.options.formatSortBy() : this.options.formatThenBy();
  1842. this.$sortModal.find('tbody').append($__default["default"]('<tr>').append($__default["default"]('<td>').text(text)).append($__default["default"]('<td>').append($__default["default"](Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-name')))).append($__default["default"]('<td>').append($__default["default"](Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-order')))));
  1843. var $multiSortName = this.$sortModal.find('.multi-sort-name').last();
  1844. var $multiSortOrder = this.$sortModal.find('.multi-sort-order').last();
  1845. $__default["default"].each(this.columns, function (i, column) {
  1846. if (column.sortable === false || column.visible === false) {
  1847. return true;
  1848. }
  1849. $multiSortName.append("<option value=\"".concat(column.field, "\">").concat(column.title, "</option>"));
  1850. });
  1851. $__default["default"].each(this.options.formatSortOrders(), function (value, order) {
  1852. $multiSortOrder.append("<option value=\"".concat(value, "\">").concat(order, "</option>"));
  1853. });
  1854. if (sortPriority !== undefined) {
  1855. $multiSortName.find("option[value=\"".concat(sortPriority.sortName, "\"]")).attr('selected', true);
  1856. $multiSortOrder.find("option[value=\"".concat(sortPriority.sortOrder, "\"]")).attr('selected', true);
  1857. }
  1858. };
  1859. BootstrapTable.prototype.assignSortableArrows = function () {
  1860. var that = this;
  1861. var headers = that.$header.find('th');
  1862. for (var i = 0; i < headers.length; i++) {
  1863. for (var c = 0; c < that.options.sortPriority.length; c++) {
  1864. if ($__default["default"](headers[i]).data('field') === that.options.sortPriority[c].sortName) {
  1865. $__default["default"](headers[i]).find('.sortable').removeClass('desc asc').addClass(that.options.sortPriority[c].sortOrder);
  1866. }
  1867. }
  1868. }
  1869. };
  1870. BootstrapTable.prototype.setButtonStates = function () {
  1871. var total = this.$sortModal.find('.multi-sort-name:first option').length;
  1872. var current = this.$sortModal.find('tbody tr').length;
  1873. if (current === total) {
  1874. this.$sortModal.find('#add').attr('disabled', 'disabled');
  1875. }
  1876. if (current > 1) {
  1877. this.$sortModal.find('#delete').removeAttr('disabled');
  1878. }
  1879. if (current < total) {
  1880. this.$sortModal.find('#add').removeAttr('disabled');
  1881. }
  1882. if (current === 1) {
  1883. this.$sortModal.find('#delete').attr('disabled', 'disabled');
  1884. }
  1885. };
  1886. BootstrapTable.prototype.multiSort = function (sortPriority) {
  1887. var _this2 = this;
  1888. this.options.sortPriority = sortPriority;
  1889. this.options.sortName = undefined;
  1890. if (this.options.sidePagination === 'server') {
  1891. var queryParams = this.options.queryParams;
  1892. this.options.queryParams = function (params) {
  1893. params.multiSort = _this2.options.sortPriority;
  1894. return $__default["default"].fn.bootstrapTable.utils.calculateObjectValue(_this2.options, queryParams, [params]);
  1895. };
  1896. isSingleSort = false;
  1897. this.initServer(this.options.silentSort);
  1898. return;
  1899. }
  1900. this.onMultipleSort();
  1901. };
  1902. }));