bootstrap-table-toolbar.js 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054
  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 _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _inherits(subClass, superClass) {
  28. if (typeof superClass !== "function" && superClass !== null) {
  29. throw new TypeError("Super expression must either be null or a function");
  30. }
  31. subClass.prototype = Object.create(superClass && superClass.prototype, {
  32. constructor: {
  33. value: subClass,
  34. writable: true,
  35. configurable: true
  36. }
  37. });
  38. if (superClass) _setPrototypeOf(subClass, superClass);
  39. }
  40. function _getPrototypeOf(o) {
  41. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  42. return o.__proto__ || Object.getPrototypeOf(o);
  43. };
  44. return _getPrototypeOf(o);
  45. }
  46. function _setPrototypeOf(o, p) {
  47. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  48. o.__proto__ = p;
  49. return o;
  50. };
  51. return _setPrototypeOf(o, p);
  52. }
  53. function _isNativeReflectConstruct() {
  54. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  55. if (Reflect.construct.sham) return false;
  56. if (typeof Proxy === "function") return true;
  57. try {
  58. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  59. return true;
  60. } catch (e) {
  61. return false;
  62. }
  63. }
  64. function _assertThisInitialized(self) {
  65. if (self === void 0) {
  66. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  67. }
  68. return self;
  69. }
  70. function _possibleConstructorReturn(self, call) {
  71. if (call && (typeof call === "object" || typeof call === "function")) {
  72. return call;
  73. }
  74. return _assertThisInitialized(self);
  75. }
  76. function _createSuper(Derived) {
  77. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  78. return function _createSuperInternal() {
  79. var Super = _getPrototypeOf(Derived),
  80. result;
  81. if (hasNativeReflectConstruct) {
  82. var NewTarget = _getPrototypeOf(this).constructor;
  83. result = Reflect.construct(Super, arguments, NewTarget);
  84. } else {
  85. result = Super.apply(this, arguments);
  86. }
  87. return _possibleConstructorReturn(this, result);
  88. };
  89. }
  90. function _superPropBase(object, property) {
  91. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  92. object = _getPrototypeOf(object);
  93. if (object === null) break;
  94. }
  95. return object;
  96. }
  97. function _get(target, property, receiver) {
  98. if (typeof Reflect !== "undefined" && Reflect.get) {
  99. _get = Reflect.get;
  100. } else {
  101. _get = function _get(target, property, receiver) {
  102. var base = _superPropBase(target, property);
  103. if (!base) return;
  104. var desc = Object.getOwnPropertyDescriptor(base, property);
  105. if (desc.get) {
  106. return desc.get.call(receiver);
  107. }
  108. return desc.value;
  109. };
  110. }
  111. return _get(target, property, receiver || target);
  112. }
  113. function _slicedToArray(arr, i) {
  114. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  115. }
  116. function _toConsumableArray(arr) {
  117. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  118. }
  119. function _arrayWithoutHoles(arr) {
  120. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  121. }
  122. function _arrayWithHoles(arr) {
  123. if (Array.isArray(arr)) return arr;
  124. }
  125. function _iterableToArray(iter) {
  126. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  127. }
  128. function _iterableToArrayLimit(arr, i) {
  129. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  130. var _arr = [];
  131. var _n = true;
  132. var _d = false;
  133. var _e = undefined;
  134. try {
  135. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  136. _arr.push(_s.value);
  137. if (i && _arr.length === i) break;
  138. }
  139. } catch (err) {
  140. _d = true;
  141. _e = err;
  142. } finally {
  143. try {
  144. if (!_n && _i["return"] != null) _i["return"]();
  145. } finally {
  146. if (_d) throw _e;
  147. }
  148. }
  149. return _arr;
  150. }
  151. function _unsupportedIterableToArray(o, minLen) {
  152. if (!o) return;
  153. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  154. var n = Object.prototype.toString.call(o).slice(8, -1);
  155. if (n === "Object" && o.constructor) n = o.constructor.name;
  156. if (n === "Map" || n === "Set") return Array.from(o);
  157. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  158. }
  159. function _arrayLikeToArray(arr, len) {
  160. if (len == null || len > arr.length) len = arr.length;
  161. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  162. return arr2;
  163. }
  164. function _nonIterableSpread() {
  165. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  166. }
  167. function _nonIterableRest() {
  168. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  169. }
  170. function _createForOfIteratorHelper(o, allowArrayLike) {
  171. var it;
  172. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  173. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  174. if (it) o = it;
  175. var i = 0;
  176. var F = function () {};
  177. return {
  178. s: F,
  179. n: function () {
  180. if (i >= o.length) return {
  181. done: true
  182. };
  183. return {
  184. done: false,
  185. value: o[i++]
  186. };
  187. },
  188. e: function (e) {
  189. throw e;
  190. },
  191. f: F
  192. };
  193. }
  194. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  195. }
  196. var normalCompletion = true,
  197. didErr = false,
  198. err;
  199. return {
  200. s: function () {
  201. it = o[Symbol.iterator]();
  202. },
  203. n: function () {
  204. var step = it.next();
  205. normalCompletion = step.done;
  206. return step;
  207. },
  208. e: function (e) {
  209. didErr = true;
  210. err = e;
  211. },
  212. f: function () {
  213. try {
  214. if (!normalCompletion && it.return != null) it.return();
  215. } finally {
  216. if (didErr) throw err;
  217. }
  218. }
  219. };
  220. }
  221. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  222. function createCommonjsModule(fn, module) {
  223. return module = { exports: {} }, fn(module, module.exports), module.exports;
  224. }
  225. var check = function (it) {
  226. return it && it.Math == Math && it;
  227. };
  228. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  229. var global_1 =
  230. // eslint-disable-next-line es/no-global-this -- safe
  231. check(typeof globalThis == 'object' && globalThis) ||
  232. check(typeof window == 'object' && window) ||
  233. // eslint-disable-next-line no-restricted-globals -- safe
  234. check(typeof self == 'object' && self) ||
  235. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  236. // eslint-disable-next-line no-new-func -- fallback
  237. (function () { return this; })() || Function('return this')();
  238. var fails = function (exec) {
  239. try {
  240. return !!exec();
  241. } catch (error) {
  242. return true;
  243. }
  244. };
  245. // Detect IE8's incomplete defineProperty implementation
  246. var descriptors = !fails(function () {
  247. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  248. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  249. });
  250. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  251. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  252. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  253. // Nashorn ~ JDK8 bug
  254. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  255. // `Object.prototype.propertyIsEnumerable` method implementation
  256. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  257. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  258. var descriptor = getOwnPropertyDescriptor$1(this, V);
  259. return !!descriptor && descriptor.enumerable;
  260. } : $propertyIsEnumerable;
  261. var objectPropertyIsEnumerable = {
  262. f: f$4
  263. };
  264. var createPropertyDescriptor = function (bitmap, value) {
  265. return {
  266. enumerable: !(bitmap & 1),
  267. configurable: !(bitmap & 2),
  268. writable: !(bitmap & 4),
  269. value: value
  270. };
  271. };
  272. var toString = {}.toString;
  273. var classofRaw = function (it) {
  274. return toString.call(it).slice(8, -1);
  275. };
  276. var split = ''.split;
  277. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  278. var indexedObject = fails(function () {
  279. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  280. // eslint-disable-next-line no-prototype-builtins -- safe
  281. return !Object('z').propertyIsEnumerable(0);
  282. }) ? function (it) {
  283. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  284. } : Object;
  285. // `RequireObjectCoercible` abstract operation
  286. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  287. var requireObjectCoercible = function (it) {
  288. if (it == undefined) throw TypeError("Can't call method on " + it);
  289. return it;
  290. };
  291. // toObject with fallback for non-array-like ES3 strings
  292. var toIndexedObject = function (it) {
  293. return indexedObject(requireObjectCoercible(it));
  294. };
  295. var isObject = function (it) {
  296. return typeof it === 'object' ? it !== null : typeof it === 'function';
  297. };
  298. // `ToPrimitive` abstract operation
  299. // https://tc39.es/ecma262/#sec-toprimitive
  300. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  301. // and the second argument - flag - preferred type is a string
  302. var toPrimitive = function (input, PREFERRED_STRING) {
  303. if (!isObject(input)) return input;
  304. var fn, val;
  305. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  306. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  307. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  308. throw TypeError("Can't convert object to primitive value");
  309. };
  310. var hasOwnProperty = {}.hasOwnProperty;
  311. var has$1 = function (it, key) {
  312. return hasOwnProperty.call(it, key);
  313. };
  314. var document$1 = global_1.document;
  315. // typeof document.createElement is 'object' in old IE
  316. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  317. var documentCreateElement = function (it) {
  318. return EXISTS ? document$1.createElement(it) : {};
  319. };
  320. // Thank's IE8 for his funny defineProperty
  321. var ie8DomDefine = !descriptors && !fails(function () {
  322. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  323. return Object.defineProperty(documentCreateElement('div'), 'a', {
  324. get: function () { return 7; }
  325. }).a != 7;
  326. });
  327. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  328. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  329. // `Object.getOwnPropertyDescriptor` method
  330. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  331. var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  332. O = toIndexedObject(O);
  333. P = toPrimitive(P, true);
  334. if (ie8DomDefine) try {
  335. return $getOwnPropertyDescriptor(O, P);
  336. } catch (error) { /* empty */ }
  337. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  338. };
  339. var objectGetOwnPropertyDescriptor = {
  340. f: f$3
  341. };
  342. var anObject = function (it) {
  343. if (!isObject(it)) {
  344. throw TypeError(String(it) + ' is not an object');
  345. } return it;
  346. };
  347. // eslint-disable-next-line es/no-object-defineproperty -- safe
  348. var $defineProperty = Object.defineProperty;
  349. // `Object.defineProperty` method
  350. // https://tc39.es/ecma262/#sec-object.defineproperty
  351. var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
  352. anObject(O);
  353. P = toPrimitive(P, true);
  354. anObject(Attributes);
  355. if (ie8DomDefine) try {
  356. return $defineProperty(O, P, Attributes);
  357. } catch (error) { /* empty */ }
  358. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  359. if ('value' in Attributes) O[P] = Attributes.value;
  360. return O;
  361. };
  362. var objectDefineProperty = {
  363. f: f$2
  364. };
  365. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  366. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  367. } : function (object, key, value) {
  368. object[key] = value;
  369. return object;
  370. };
  371. var setGlobal = function (key, value) {
  372. try {
  373. createNonEnumerableProperty(global_1, key, value);
  374. } catch (error) {
  375. global_1[key] = value;
  376. } return value;
  377. };
  378. var SHARED = '__core-js_shared__';
  379. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  380. var sharedStore = store$1;
  381. var functionToString = Function.toString;
  382. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  383. if (typeof sharedStore.inspectSource != 'function') {
  384. sharedStore.inspectSource = function (it) {
  385. return functionToString.call(it);
  386. };
  387. }
  388. var inspectSource = sharedStore.inspectSource;
  389. var WeakMap$1 = global_1.WeakMap;
  390. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  391. var shared = createCommonjsModule(function (module) {
  392. (module.exports = function (key, value) {
  393. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  394. })('versions', []).push({
  395. version: '3.10.1',
  396. mode: 'global',
  397. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  398. });
  399. });
  400. var id = 0;
  401. var postfix = Math.random();
  402. var uid = function (key) {
  403. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  404. };
  405. var keys = shared('keys');
  406. var sharedKey = function (key) {
  407. return keys[key] || (keys[key] = uid(key));
  408. };
  409. var hiddenKeys$1 = {};
  410. var WeakMap = global_1.WeakMap;
  411. var set, get, has;
  412. var enforce = function (it) {
  413. return has(it) ? get(it) : set(it, {});
  414. };
  415. var getterFor = function (TYPE) {
  416. return function (it) {
  417. var state;
  418. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  419. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  420. } return state;
  421. };
  422. };
  423. if (nativeWeakMap) {
  424. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  425. var wmget = store.get;
  426. var wmhas = store.has;
  427. var wmset = store.set;
  428. set = function (it, metadata) {
  429. metadata.facade = it;
  430. wmset.call(store, it, metadata);
  431. return metadata;
  432. };
  433. get = function (it) {
  434. return wmget.call(store, it) || {};
  435. };
  436. has = function (it) {
  437. return wmhas.call(store, it);
  438. };
  439. } else {
  440. var STATE = sharedKey('state');
  441. hiddenKeys$1[STATE] = true;
  442. set = function (it, metadata) {
  443. metadata.facade = it;
  444. createNonEnumerableProperty(it, STATE, metadata);
  445. return metadata;
  446. };
  447. get = function (it) {
  448. return has$1(it, STATE) ? it[STATE] : {};
  449. };
  450. has = function (it) {
  451. return has$1(it, STATE);
  452. };
  453. }
  454. var internalState = {
  455. set: set,
  456. get: get,
  457. has: has,
  458. enforce: enforce,
  459. getterFor: getterFor
  460. };
  461. var redefine = createCommonjsModule(function (module) {
  462. var getInternalState = internalState.get;
  463. var enforceInternalState = internalState.enforce;
  464. var TEMPLATE = String(String).split('String');
  465. (module.exports = function (O, key, value, options) {
  466. var unsafe = options ? !!options.unsafe : false;
  467. var simple = options ? !!options.enumerable : false;
  468. var noTargetGet = options ? !!options.noTargetGet : false;
  469. var state;
  470. if (typeof value == 'function') {
  471. if (typeof key == 'string' && !has$1(value, 'name')) {
  472. createNonEnumerableProperty(value, 'name', key);
  473. }
  474. state = enforceInternalState(value);
  475. if (!state.source) {
  476. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  477. }
  478. }
  479. if (O === global_1) {
  480. if (simple) O[key] = value;
  481. else setGlobal(key, value);
  482. return;
  483. } else if (!unsafe) {
  484. delete O[key];
  485. } else if (!noTargetGet && O[key]) {
  486. simple = true;
  487. }
  488. if (simple) O[key] = value;
  489. else createNonEnumerableProperty(O, key, value);
  490. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  491. })(Function.prototype, 'toString', function toString() {
  492. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  493. });
  494. });
  495. var path = global_1;
  496. var aFunction$1 = function (variable) {
  497. return typeof variable == 'function' ? variable : undefined;
  498. };
  499. var getBuiltIn = function (namespace, method) {
  500. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  501. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  502. };
  503. var ceil = Math.ceil;
  504. var floor = Math.floor;
  505. // `ToInteger` abstract operation
  506. // https://tc39.es/ecma262/#sec-tointeger
  507. var toInteger = function (argument) {
  508. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  509. };
  510. var min$1 = Math.min;
  511. // `ToLength` abstract operation
  512. // https://tc39.es/ecma262/#sec-tolength
  513. var toLength = function (argument) {
  514. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  515. };
  516. var max = Math.max;
  517. var min = Math.min;
  518. // Helper for a popular repeating case of the spec:
  519. // Let integer be ? ToInteger(index).
  520. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  521. var toAbsoluteIndex = function (index, length) {
  522. var integer = toInteger(index);
  523. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  524. };
  525. // `Array.prototype.{ indexOf, includes }` methods implementation
  526. var createMethod$3 = function (IS_INCLUDES) {
  527. return function ($this, el, fromIndex) {
  528. var O = toIndexedObject($this);
  529. var length = toLength(O.length);
  530. var index = toAbsoluteIndex(fromIndex, length);
  531. var value;
  532. // Array#includes uses SameValueZero equality algorithm
  533. // eslint-disable-next-line no-self-compare -- NaN check
  534. if (IS_INCLUDES && el != el) while (length > index) {
  535. value = O[index++];
  536. // eslint-disable-next-line no-self-compare -- NaN check
  537. if (value != value) return true;
  538. // Array#indexOf ignores holes, Array#includes - not
  539. } else for (;length > index; index++) {
  540. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  541. } return !IS_INCLUDES && -1;
  542. };
  543. };
  544. var arrayIncludes = {
  545. // `Array.prototype.includes` method
  546. // https://tc39.es/ecma262/#sec-array.prototype.includes
  547. includes: createMethod$3(true),
  548. // `Array.prototype.indexOf` method
  549. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  550. indexOf: createMethod$3(false)
  551. };
  552. var indexOf = arrayIncludes.indexOf;
  553. var objectKeysInternal = function (object, names) {
  554. var O = toIndexedObject(object);
  555. var i = 0;
  556. var result = [];
  557. var key;
  558. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  559. // Don't enum bug & hidden keys
  560. while (names.length > i) if (has$1(O, key = names[i++])) {
  561. ~indexOf(result, key) || result.push(key);
  562. }
  563. return result;
  564. };
  565. // IE8- don't enum bug keys
  566. var enumBugKeys = [
  567. 'constructor',
  568. 'hasOwnProperty',
  569. 'isPrototypeOf',
  570. 'propertyIsEnumerable',
  571. 'toLocaleString',
  572. 'toString',
  573. 'valueOf'
  574. ];
  575. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  576. // `Object.getOwnPropertyNames` method
  577. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  578. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  579. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  580. return objectKeysInternal(O, hiddenKeys);
  581. };
  582. var objectGetOwnPropertyNames = {
  583. f: f$1
  584. };
  585. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  586. var f = Object.getOwnPropertySymbols;
  587. var objectGetOwnPropertySymbols = {
  588. f: f
  589. };
  590. // all object keys, includes non-enumerable and symbols
  591. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  592. var keys = objectGetOwnPropertyNames.f(anObject(it));
  593. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  594. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  595. };
  596. var copyConstructorProperties = function (target, source) {
  597. var keys = ownKeys(source);
  598. var defineProperty = objectDefineProperty.f;
  599. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  600. for (var i = 0; i < keys.length; i++) {
  601. var key = keys[i];
  602. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  603. }
  604. };
  605. var replacement = /#|\.prototype\./;
  606. var isForced = function (feature, detection) {
  607. var value = data[normalize(feature)];
  608. return value == POLYFILL ? true
  609. : value == NATIVE ? false
  610. : typeof detection == 'function' ? fails(detection)
  611. : !!detection;
  612. };
  613. var normalize = isForced.normalize = function (string) {
  614. return String(string).replace(replacement, '.').toLowerCase();
  615. };
  616. var data = isForced.data = {};
  617. var NATIVE = isForced.NATIVE = 'N';
  618. var POLYFILL = isForced.POLYFILL = 'P';
  619. var isForced_1 = isForced;
  620. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  621. /*
  622. options.target - name of the target object
  623. options.global - target is the global object
  624. options.stat - export as static methods of target
  625. options.proto - export as prototype methods of target
  626. options.real - real prototype method for the `pure` version
  627. options.forced - export even if the native feature is available
  628. options.bind - bind methods to the target, required for the `pure` version
  629. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  630. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  631. options.sham - add a flag to not completely full polyfills
  632. options.enumerable - export as enumerable property
  633. options.noTargetGet - prevent calling a getter on target
  634. */
  635. var _export = function (options, source) {
  636. var TARGET = options.target;
  637. var GLOBAL = options.global;
  638. var STATIC = options.stat;
  639. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  640. if (GLOBAL) {
  641. target = global_1;
  642. } else if (STATIC) {
  643. target = global_1[TARGET] || setGlobal(TARGET, {});
  644. } else {
  645. target = (global_1[TARGET] || {}).prototype;
  646. }
  647. if (target) for (key in source) {
  648. sourceProperty = source[key];
  649. if (options.noTargetGet) {
  650. descriptor = getOwnPropertyDescriptor(target, key);
  651. targetProperty = descriptor && descriptor.value;
  652. } else targetProperty = target[key];
  653. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  654. // contained in target
  655. if (!FORCED && targetProperty !== undefined) {
  656. if (typeof sourceProperty === typeof targetProperty) continue;
  657. copyConstructorProperties(sourceProperty, targetProperty);
  658. }
  659. // add a flag to not completely full polyfills
  660. if (options.sham || (targetProperty && targetProperty.sham)) {
  661. createNonEnumerableProperty(sourceProperty, 'sham', true);
  662. }
  663. // extend global
  664. redefine(target, key, sourceProperty, options);
  665. }
  666. };
  667. // `RegExp.prototype.flags` getter implementation
  668. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  669. var regexpFlags = function () {
  670. var that = anObject(this);
  671. var result = '';
  672. if (that.global) result += 'g';
  673. if (that.ignoreCase) result += 'i';
  674. if (that.multiline) result += 'm';
  675. if (that.dotAll) result += 's';
  676. if (that.unicode) result += 'u';
  677. if (that.sticky) result += 'y';
  678. return result;
  679. };
  680. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  681. // so we use an intermediate function.
  682. function RE(s, f) {
  683. return RegExp(s, f);
  684. }
  685. var UNSUPPORTED_Y$1 = fails(function () {
  686. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  687. var re = RE('a', 'y');
  688. re.lastIndex = 2;
  689. return re.exec('abcd') != null;
  690. });
  691. var BROKEN_CARET = fails(function () {
  692. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  693. var re = RE('^r', 'gy');
  694. re.lastIndex = 2;
  695. return re.exec('str') != null;
  696. });
  697. var regexpStickyHelpers = {
  698. UNSUPPORTED_Y: UNSUPPORTED_Y$1,
  699. BROKEN_CARET: BROKEN_CARET
  700. };
  701. var nativeExec = RegExp.prototype.exec;
  702. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  703. var patchedExec = nativeExec;
  704. var UPDATES_LAST_INDEX_WRONG = (function () {
  705. var re1 = /a/;
  706. var re2 = /b*/g;
  707. nativeExec.call(re1, 'a');
  708. nativeExec.call(re2, 'a');
  709. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  710. })();
  711. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  712. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  713. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  714. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  715. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  716. if (PATCH) {
  717. patchedExec = function exec(str) {
  718. var re = this;
  719. var lastIndex, reCopy, match, i;
  720. var sticky = UNSUPPORTED_Y && re.sticky;
  721. var flags = regexpFlags.call(re);
  722. var source = re.source;
  723. var charsAdded = 0;
  724. var strCopy = str;
  725. if (sticky) {
  726. flags = flags.replace('y', '');
  727. if (flags.indexOf('g') === -1) {
  728. flags += 'g';
  729. }
  730. strCopy = String(str).slice(re.lastIndex);
  731. // Support anchored sticky behavior.
  732. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  733. source = '(?: ' + source + ')';
  734. strCopy = ' ' + strCopy;
  735. charsAdded++;
  736. }
  737. // ^(? + rx + ) is needed, in combination with some str slicing, to
  738. // simulate the 'y' flag.
  739. reCopy = new RegExp('^(?:' + source + ')', flags);
  740. }
  741. if (NPCG_INCLUDED) {
  742. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  743. }
  744. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  745. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  746. if (sticky) {
  747. if (match) {
  748. match.input = match.input.slice(charsAdded);
  749. match[0] = match[0].slice(charsAdded);
  750. match.index = re.lastIndex;
  751. re.lastIndex += match[0].length;
  752. } else re.lastIndex = 0;
  753. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  754. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  755. }
  756. if (NPCG_INCLUDED && match && match.length > 1) {
  757. // Fix browsers whose `exec` methods don't consistently return `undefined`
  758. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  759. nativeReplace.call(match[0], reCopy, function () {
  760. for (i = 1; i < arguments.length - 2; i++) {
  761. if (arguments[i] === undefined) match[i] = undefined;
  762. }
  763. });
  764. }
  765. return match;
  766. };
  767. }
  768. var regexpExec = patchedExec;
  769. // `RegExp.prototype.exec` method
  770. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  771. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  772. exec: regexpExec
  773. });
  774. var engineIsNode = classofRaw(global_1.process) == 'process';
  775. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  776. var process = global_1.process;
  777. var versions = process && process.versions;
  778. var v8 = versions && versions.v8;
  779. var match, version;
  780. if (v8) {
  781. match = v8.split('.');
  782. version = match[0] + match[1];
  783. } else if (engineUserAgent) {
  784. match = engineUserAgent.match(/Edge\/(\d+)/);
  785. if (!match || match[1] >= 74) {
  786. match = engineUserAgent.match(/Chrome\/(\d+)/);
  787. if (match) version = match[1];
  788. }
  789. }
  790. var engineV8Version = version && +version;
  791. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  792. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  793. // eslint-disable-next-line es/no-symbol -- required for testing
  794. return !Symbol.sham &&
  795. // Chrome 38 Symbol has incorrect toString conversion
  796. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  797. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  798. });
  799. /* eslint-disable es/no-symbol -- required for testing */
  800. var useSymbolAsUid = nativeSymbol
  801. && !Symbol.sham
  802. && typeof Symbol.iterator == 'symbol';
  803. var WellKnownSymbolsStore = shared('wks');
  804. var Symbol$1 = global_1.Symbol;
  805. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  806. var wellKnownSymbol = function (name) {
  807. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  808. if (nativeSymbol && has$1(Symbol$1, name)) {
  809. WellKnownSymbolsStore[name] = Symbol$1[name];
  810. } else {
  811. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  812. }
  813. } return WellKnownSymbolsStore[name];
  814. };
  815. // TODO: Remove from `core-js@4` since it's moved to entry points
  816. var SPECIES$2 = wellKnownSymbol('species');
  817. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  818. // #replace needs built-in support for named groups.
  819. // #match works fine because it just return the exec results, even if it has
  820. // a "grops" property.
  821. var re = /./;
  822. re.exec = function () {
  823. var result = [];
  824. result.groups = { a: '7' };
  825. return result;
  826. };
  827. return ''.replace(re, '$<a>') !== '7';
  828. });
  829. // IE <= 11 replaces $0 with the whole match, as if it was $&
  830. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  831. var REPLACE_KEEPS_$0 = (function () {
  832. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  833. return 'a'.replace(/./, '$0') === '$0';
  834. })();
  835. var REPLACE = wellKnownSymbol('replace');
  836. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  837. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  838. if (/./[REPLACE]) {
  839. return /./[REPLACE]('a', '$0') === '';
  840. }
  841. return false;
  842. })();
  843. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  844. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  845. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  846. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  847. var re = /(?:)/;
  848. var originalExec = re.exec;
  849. re.exec = function () { return originalExec.apply(this, arguments); };
  850. var result = 'ab'.split(re);
  851. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  852. });
  853. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  854. var SYMBOL = wellKnownSymbol(KEY);
  855. var DELEGATES_TO_SYMBOL = !fails(function () {
  856. // String methods call symbol-named RegEp methods
  857. var O = {};
  858. O[SYMBOL] = function () { return 7; };
  859. return ''[KEY](O) != 7;
  860. });
  861. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  862. // Symbol-named RegExp methods call .exec
  863. var execCalled = false;
  864. var re = /a/;
  865. if (KEY === 'split') {
  866. // We can't use real regex here since it causes deoptimization
  867. // and serious performance degradation in V8
  868. // https://github.com/zloirock/core-js/issues/306
  869. re = {};
  870. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  871. // a new one. We need to return the patched regex when creating the new one.
  872. re.constructor = {};
  873. re.constructor[SPECIES$2] = function () { return re; };
  874. re.flags = '';
  875. re[SYMBOL] = /./[SYMBOL];
  876. }
  877. re.exec = function () { execCalled = true; return null; };
  878. re[SYMBOL]('');
  879. return !execCalled;
  880. });
  881. if (
  882. !DELEGATES_TO_SYMBOL ||
  883. !DELEGATES_TO_EXEC ||
  884. (KEY === 'replace' && !(
  885. REPLACE_SUPPORTS_NAMED_GROUPS &&
  886. REPLACE_KEEPS_$0 &&
  887. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  888. )) ||
  889. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  890. ) {
  891. var nativeRegExpMethod = /./[SYMBOL];
  892. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  893. if (regexp.exec === RegExp.prototype.exec) {
  894. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  895. // The native String method already delegates to @@method (this
  896. // polyfilled function), leasing to infinite recursion.
  897. // We avoid it by directly calling the native @@method method.
  898. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  899. }
  900. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  901. }
  902. return { done: false };
  903. }, {
  904. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  905. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  906. });
  907. var stringMethod = methods[0];
  908. var regexMethod = methods[1];
  909. redefine(String.prototype, KEY, stringMethod);
  910. redefine(RegExp.prototype, SYMBOL, length == 2
  911. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  912. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  913. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  914. // 21.2.5.6 RegExp.prototype[@@match](string)
  915. // 21.2.5.9 RegExp.prototype[@@search](string)
  916. : function (string) { return regexMethod.call(string, this); }
  917. );
  918. }
  919. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  920. };
  921. // `SameValue` abstract operation
  922. // https://tc39.es/ecma262/#sec-samevalue
  923. // eslint-disable-next-line es/no-object-is -- safe
  924. var sameValue = Object.is || function is(x, y) {
  925. // eslint-disable-next-line no-self-compare -- NaN check
  926. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  927. };
  928. // `RegExpExec` abstract operation
  929. // https://tc39.es/ecma262/#sec-regexpexec
  930. var regexpExecAbstract = function (R, S) {
  931. var exec = R.exec;
  932. if (typeof exec === 'function') {
  933. var result = exec.call(R, S);
  934. if (typeof result !== 'object') {
  935. throw TypeError('RegExp exec method returned something other than an Object or null');
  936. }
  937. return result;
  938. }
  939. if (classofRaw(R) !== 'RegExp') {
  940. throw TypeError('RegExp#exec called on incompatible receiver');
  941. }
  942. return regexpExec.call(R, S);
  943. };
  944. // @@search logic
  945. fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
  946. return [
  947. // `String.prototype.search` method
  948. // https://tc39.es/ecma262/#sec-string.prototype.search
  949. function search(regexp) {
  950. var O = requireObjectCoercible(this);
  951. var searcher = regexp == undefined ? undefined : regexp[SEARCH];
  952. return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  953. },
  954. // `RegExp.prototype[@@search]` method
  955. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  956. function (regexp) {
  957. var res = maybeCallNative(nativeSearch, regexp, this);
  958. if (res.done) return res.value;
  959. var rx = anObject(regexp);
  960. var S = String(this);
  961. var previousLastIndex = rx.lastIndex;
  962. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  963. var result = regexpExecAbstract(rx, S);
  964. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  965. return result === null ? -1 : result.index;
  966. }
  967. ];
  968. });
  969. // `Object.keys` method
  970. // https://tc39.es/ecma262/#sec-object.keys
  971. // eslint-disable-next-line es/no-object-keys -- safe
  972. var objectKeys = Object.keys || function keys(O) {
  973. return objectKeysInternal(O, enumBugKeys);
  974. };
  975. // `ToObject` abstract operation
  976. // https://tc39.es/ecma262/#sec-toobject
  977. var toObject = function (argument) {
  978. return Object(requireObjectCoercible(argument));
  979. };
  980. // eslint-disable-next-line es/no-object-assign -- safe
  981. var $assign = Object.assign;
  982. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  983. var defineProperty = Object.defineProperty;
  984. // `Object.assign` method
  985. // https://tc39.es/ecma262/#sec-object.assign
  986. var objectAssign = !$assign || fails(function () {
  987. // should have correct order of operations (Edge bug)
  988. if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  989. enumerable: true,
  990. get: function () {
  991. defineProperty(this, 'b', {
  992. value: 3,
  993. enumerable: false
  994. });
  995. }
  996. }), { b: 2 })).b !== 1) return true;
  997. // should work with symbols and should have deterministic property order (V8 bug)
  998. var A = {};
  999. var B = {};
  1000. // eslint-disable-next-line es/no-symbol -- safe
  1001. var symbol = Symbol();
  1002. var alphabet = 'abcdefghijklmnopqrst';
  1003. A[symbol] = 7;
  1004. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1005. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1006. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1007. var T = toObject(target);
  1008. var argumentsLength = arguments.length;
  1009. var index = 1;
  1010. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  1011. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1012. while (argumentsLength > index) {
  1013. var S = indexedObject(arguments[index++]);
  1014. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  1015. var length = keys.length;
  1016. var j = 0;
  1017. var key;
  1018. while (length > j) {
  1019. key = keys[j++];
  1020. if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  1021. }
  1022. } return T;
  1023. } : $assign;
  1024. // `Object.assign` method
  1025. // https://tc39.es/ecma262/#sec-object.assign
  1026. // eslint-disable-next-line es/no-object-assign -- required for testing
  1027. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  1028. assign: objectAssign
  1029. });
  1030. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1031. var method = [][METHOD_NAME];
  1032. return !!method && fails(function () {
  1033. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  1034. method.call(null, argument || function () { throw 1; }, 1);
  1035. });
  1036. };
  1037. var nativeJoin = [].join;
  1038. var ES3_STRINGS = indexedObject != Object;
  1039. var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
  1040. // `Array.prototype.join` method
  1041. // https://tc39.es/ecma262/#sec-array.prototype.join
  1042. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
  1043. join: function join(separator) {
  1044. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1045. }
  1046. });
  1047. var aFunction = function (it) {
  1048. if (typeof it != 'function') {
  1049. throw TypeError(String(it) + ' is not a function');
  1050. } return it;
  1051. };
  1052. // optional / simple context binding
  1053. var functionBindContext = function (fn, that, length) {
  1054. aFunction(fn);
  1055. if (that === undefined) return fn;
  1056. switch (length) {
  1057. case 0: return function () {
  1058. return fn.call(that);
  1059. };
  1060. case 1: return function (a) {
  1061. return fn.call(that, a);
  1062. };
  1063. case 2: return function (a, b) {
  1064. return fn.call(that, a, b);
  1065. };
  1066. case 3: return function (a, b, c) {
  1067. return fn.call(that, a, b, c);
  1068. };
  1069. }
  1070. return function (/* ...args */) {
  1071. return fn.apply(that, arguments);
  1072. };
  1073. };
  1074. // `IsArray` abstract operation
  1075. // https://tc39.es/ecma262/#sec-isarray
  1076. // eslint-disable-next-line es/no-array-isarray -- safe
  1077. var isArray = Array.isArray || function isArray(arg) {
  1078. return classofRaw(arg) == 'Array';
  1079. };
  1080. var SPECIES$1 = wellKnownSymbol('species');
  1081. // `ArraySpeciesCreate` abstract operation
  1082. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1083. var arraySpeciesCreate = function (originalArray, length) {
  1084. var C;
  1085. if (isArray(originalArray)) {
  1086. C = originalArray.constructor;
  1087. // cross-realm fallback
  1088. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  1089. else if (isObject(C)) {
  1090. C = C[SPECIES$1];
  1091. if (C === null) C = undefined;
  1092. }
  1093. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  1094. };
  1095. var push = [].push;
  1096. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  1097. var createMethod$2 = function (TYPE) {
  1098. var IS_MAP = TYPE == 1;
  1099. var IS_FILTER = TYPE == 2;
  1100. var IS_SOME = TYPE == 3;
  1101. var IS_EVERY = TYPE == 4;
  1102. var IS_FIND_INDEX = TYPE == 6;
  1103. var IS_FILTER_OUT = TYPE == 7;
  1104. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1105. return function ($this, callbackfn, that, specificCreate) {
  1106. var O = toObject($this);
  1107. var self = indexedObject(O);
  1108. var boundFunction = functionBindContext(callbackfn, that, 3);
  1109. var length = toLength(self.length);
  1110. var index = 0;
  1111. var create = specificCreate || arraySpeciesCreate;
  1112. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  1113. var value, result;
  1114. for (;length > index; index++) if (NO_HOLES || index in self) {
  1115. value = self[index];
  1116. result = boundFunction(value, index, O);
  1117. if (TYPE) {
  1118. if (IS_MAP) target[index] = result; // map
  1119. else if (result) switch (TYPE) {
  1120. case 3: return true; // some
  1121. case 5: return value; // find
  1122. case 6: return index; // findIndex
  1123. case 2: push.call(target, value); // filter
  1124. } else switch (TYPE) {
  1125. case 4: return false; // every
  1126. case 7: push.call(target, value); // filterOut
  1127. }
  1128. }
  1129. }
  1130. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1131. };
  1132. };
  1133. var arrayIteration = {
  1134. // `Array.prototype.forEach` method
  1135. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1136. forEach: createMethod$2(0),
  1137. // `Array.prototype.map` method
  1138. // https://tc39.es/ecma262/#sec-array.prototype.map
  1139. map: createMethod$2(1),
  1140. // `Array.prototype.filter` method
  1141. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1142. filter: createMethod$2(2),
  1143. // `Array.prototype.some` method
  1144. // https://tc39.es/ecma262/#sec-array.prototype.some
  1145. some: createMethod$2(3),
  1146. // `Array.prototype.every` method
  1147. // https://tc39.es/ecma262/#sec-array.prototype.every
  1148. every: createMethod$2(4),
  1149. // `Array.prototype.find` method
  1150. // https://tc39.es/ecma262/#sec-array.prototype.find
  1151. find: createMethod$2(5),
  1152. // `Array.prototype.findIndex` method
  1153. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1154. findIndex: createMethod$2(6),
  1155. // `Array.prototype.filterOut` method
  1156. // https://github.com/tc39/proposal-array-filtering
  1157. filterOut: createMethod$2(7)
  1158. };
  1159. // `Object.defineProperties` method
  1160. // https://tc39.es/ecma262/#sec-object.defineproperties
  1161. // eslint-disable-next-line es/no-object-defineproperties -- safe
  1162. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  1163. anObject(O);
  1164. var keys = objectKeys(Properties);
  1165. var length = keys.length;
  1166. var index = 0;
  1167. var key;
  1168. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  1169. return O;
  1170. };
  1171. var html = getBuiltIn('document', 'documentElement');
  1172. var GT = '>';
  1173. var LT = '<';
  1174. var PROTOTYPE = 'prototype';
  1175. var SCRIPT = 'script';
  1176. var IE_PROTO = sharedKey('IE_PROTO');
  1177. var EmptyConstructor = function () { /* empty */ };
  1178. var scriptTag = function (content) {
  1179. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1180. };
  1181. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1182. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1183. activeXDocument.write(scriptTag(''));
  1184. activeXDocument.close();
  1185. var temp = activeXDocument.parentWindow.Object;
  1186. activeXDocument = null; // avoid memory leak
  1187. return temp;
  1188. };
  1189. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1190. var NullProtoObjectViaIFrame = function () {
  1191. // Thrash, waste and sodomy: IE GC bug
  1192. var iframe = documentCreateElement('iframe');
  1193. var JS = 'java' + SCRIPT + ':';
  1194. var iframeDocument;
  1195. iframe.style.display = 'none';
  1196. html.appendChild(iframe);
  1197. // https://github.com/zloirock/core-js/issues/475
  1198. iframe.src = String(JS);
  1199. iframeDocument = iframe.contentWindow.document;
  1200. iframeDocument.open();
  1201. iframeDocument.write(scriptTag('document.F=Object'));
  1202. iframeDocument.close();
  1203. return iframeDocument.F;
  1204. };
  1205. // Check for document.domain and active x support
  1206. // No need to use active x approach when document.domain is not set
  1207. // see https://github.com/es-shims/es5-shim/issues/150
  1208. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1209. // avoid IE GC bug
  1210. var activeXDocument;
  1211. var NullProtoObject = function () {
  1212. try {
  1213. /* global ActiveXObject -- old IE */
  1214. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  1215. } catch (error) { /* ignore */ }
  1216. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  1217. var length = enumBugKeys.length;
  1218. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1219. return NullProtoObject();
  1220. };
  1221. hiddenKeys$1[IE_PROTO] = true;
  1222. // `Object.create` method
  1223. // https://tc39.es/ecma262/#sec-object.create
  1224. var objectCreate = Object.create || function create(O, Properties) {
  1225. var result;
  1226. if (O !== null) {
  1227. EmptyConstructor[PROTOTYPE] = anObject(O);
  1228. result = new EmptyConstructor();
  1229. EmptyConstructor[PROTOTYPE] = null;
  1230. // add "__proto__" for Object.getPrototypeOf polyfill
  1231. result[IE_PROTO] = O;
  1232. } else result = NullProtoObject();
  1233. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  1234. };
  1235. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1236. var ArrayPrototype = Array.prototype;
  1237. // Array.prototype[@@unscopables]
  1238. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1239. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1240. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1241. configurable: true,
  1242. value: objectCreate(null)
  1243. });
  1244. }
  1245. // add a key to Array.prototype[@@unscopables]
  1246. var addToUnscopables = function (key) {
  1247. ArrayPrototype[UNSCOPABLES][key] = true;
  1248. };
  1249. var $find = arrayIteration.find;
  1250. var FIND = 'find';
  1251. var SKIPS_HOLES = true;
  1252. // Shouldn't skip holes
  1253. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1254. // `Array.prototype.find` method
  1255. // https://tc39.es/ecma262/#sec-array.prototype.find
  1256. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1257. find: function find(callbackfn /* , that = undefined */) {
  1258. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1259. }
  1260. });
  1261. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1262. addToUnscopables(FIND);
  1263. var createProperty = function (object, key, value) {
  1264. var propertyKey = toPrimitive(key);
  1265. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1266. else object[propertyKey] = value;
  1267. };
  1268. var SPECIES = wellKnownSymbol('species');
  1269. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1270. // We can't use this feature detection in V8 since it causes
  1271. // deoptimization and serious performance degradation
  1272. // https://github.com/zloirock/core-js/issues/677
  1273. return engineV8Version >= 51 || !fails(function () {
  1274. var array = [];
  1275. var constructor = array.constructor = {};
  1276. constructor[SPECIES] = function () {
  1277. return { foo: 1 };
  1278. };
  1279. return array[METHOD_NAME](Boolean).foo !== 1;
  1280. });
  1281. };
  1282. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1283. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1284. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1285. // We can't use this feature detection in V8 since it causes
  1286. // deoptimization and serious performance degradation
  1287. // https://github.com/zloirock/core-js/issues/679
  1288. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1289. var array = [];
  1290. array[IS_CONCAT_SPREADABLE] = false;
  1291. return array.concat()[0] !== array;
  1292. });
  1293. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1294. var isConcatSpreadable = function (O) {
  1295. if (!isObject(O)) return false;
  1296. var spreadable = O[IS_CONCAT_SPREADABLE];
  1297. return spreadable !== undefined ? !!spreadable : isArray(O);
  1298. };
  1299. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1300. // `Array.prototype.concat` method
  1301. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1302. // with adding support of @@isConcatSpreadable and @@species
  1303. _export({ target: 'Array', proto: true, forced: FORCED }, {
  1304. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1305. concat: function concat(arg) {
  1306. var O = toObject(this);
  1307. var A = arraySpeciesCreate(O, 0);
  1308. var n = 0;
  1309. var i, k, length, len, E;
  1310. for (i = -1, length = arguments.length; i < length; i++) {
  1311. E = i === -1 ? O : arguments[i];
  1312. if (isConcatSpreadable(E)) {
  1313. len = toLength(E.length);
  1314. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1315. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1316. } else {
  1317. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1318. createProperty(A, n++, E);
  1319. }
  1320. }
  1321. A.length = n;
  1322. return A;
  1323. }
  1324. });
  1325. var $filter = arrayIteration.filter;
  1326. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  1327. // `Array.prototype.filter` method
  1328. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1329. // with adding support of @@species
  1330. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1331. filter: function filter(callbackfn /* , thisArg */) {
  1332. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1333. }
  1334. });
  1335. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1336. // `Object.{ entries, values }` methods implementation
  1337. var createMethod$1 = function (TO_ENTRIES) {
  1338. return function (it) {
  1339. var O = toIndexedObject(it);
  1340. var keys = objectKeys(O);
  1341. var length = keys.length;
  1342. var i = 0;
  1343. var result = [];
  1344. var key;
  1345. while (length > i) {
  1346. key = keys[i++];
  1347. if (!descriptors || propertyIsEnumerable.call(O, key)) {
  1348. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  1349. }
  1350. }
  1351. return result;
  1352. };
  1353. };
  1354. var objectToArray = {
  1355. // `Object.entries` method
  1356. // https://tc39.es/ecma262/#sec-object.entries
  1357. entries: createMethod$1(true),
  1358. // `Object.values` method
  1359. // https://tc39.es/ecma262/#sec-object.values
  1360. values: createMethod$1(false)
  1361. };
  1362. var $entries = objectToArray.entries;
  1363. // `Object.entries` method
  1364. // https://tc39.es/ecma262/#sec-object.entries
  1365. _export({ target: 'Object', stat: true }, {
  1366. entries: function entries(O) {
  1367. return $entries(O);
  1368. }
  1369. });
  1370. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  1371. var $indexOf = arrayIncludes.indexOf;
  1372. var nativeIndexOf = [].indexOf;
  1373. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  1374. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  1375. // `Array.prototype.indexOf` method
  1376. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1377. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  1378. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1379. return NEGATIVE_ZERO
  1380. // convert -0 to +0
  1381. ? nativeIndexOf.apply(this, arguments) || 0
  1382. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  1383. }
  1384. });
  1385. var $includes = arrayIncludes.includes;
  1386. // `Array.prototype.includes` method
  1387. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1388. _export({ target: 'Array', proto: true }, {
  1389. includes: function includes(el /* , fromIndex = 0 */) {
  1390. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1391. }
  1392. });
  1393. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1394. addToUnscopables('includes');
  1395. var MATCH$1 = wellKnownSymbol('match');
  1396. // `IsRegExp` abstract operation
  1397. // https://tc39.es/ecma262/#sec-isregexp
  1398. var isRegexp = function (it) {
  1399. var isRegExp;
  1400. return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1401. };
  1402. var notARegexp = function (it) {
  1403. if (isRegexp(it)) {
  1404. throw TypeError("The method doesn't accept regular expressions");
  1405. } return it;
  1406. };
  1407. var MATCH = wellKnownSymbol('match');
  1408. var correctIsRegexpLogic = function (METHOD_NAME) {
  1409. var regexp = /./;
  1410. try {
  1411. '/./'[METHOD_NAME](regexp);
  1412. } catch (error1) {
  1413. try {
  1414. regexp[MATCH] = false;
  1415. return '/./'[METHOD_NAME](regexp);
  1416. } catch (error2) { /* empty */ }
  1417. } return false;
  1418. };
  1419. // `String.prototype.includes` method
  1420. // https://tc39.es/ecma262/#sec-string.prototype.includes
  1421. _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
  1422. includes: function includes(searchString /* , position = 0 */) {
  1423. return !!~String(requireObjectCoercible(this))
  1424. .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined);
  1425. }
  1426. });
  1427. // a string of all valid unicode whitespaces
  1428. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  1429. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1430. var whitespace = '[' + whitespaces + ']';
  1431. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1432. var rtrim = RegExp(whitespace + whitespace + '*$');
  1433. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1434. var createMethod = function (TYPE) {
  1435. return function ($this) {
  1436. var string = String(requireObjectCoercible($this));
  1437. if (TYPE & 1) string = string.replace(ltrim, '');
  1438. if (TYPE & 2) string = string.replace(rtrim, '');
  1439. return string;
  1440. };
  1441. };
  1442. var stringTrim = {
  1443. // `String.prototype.{ trimLeft, trimStart }` methods
  1444. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  1445. start: createMethod(1),
  1446. // `String.prototype.{ trimRight, trimEnd }` methods
  1447. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  1448. end: createMethod(2),
  1449. // `String.prototype.trim` method
  1450. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1451. trim: createMethod(3)
  1452. };
  1453. var non = '\u200B\u0085\u180E';
  1454. // check that a method works with the correct list
  1455. // of whitespaces and has a correct name
  1456. var stringTrimForced = function (METHOD_NAME) {
  1457. return fails(function () {
  1458. return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
  1459. });
  1460. };
  1461. var $trim = stringTrim.trim;
  1462. // `String.prototype.trim` method
  1463. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1464. _export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
  1465. trim: function trim() {
  1466. return $trim(this);
  1467. }
  1468. });
  1469. /**
  1470. * @author: aperez <aperez@datadec.es>
  1471. * @version: v2.0.0
  1472. *
  1473. * @update Dennis Hernández <http://djhvscf.github.io/Blog>
  1474. * @update zhixin wen <wenzhixin2010@gmail.com>
  1475. */
  1476. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1477. var theme = {
  1478. bootstrap3: {
  1479. icons: {
  1480. advancedSearchIcon: 'glyphicon-chevron-down'
  1481. },
  1482. html: {
  1483. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">%s</h4>\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 modal-body-custom\">\n <div class=\"container-fluid\" id=\"avdSearchModalContent_%s\"\n style=\"padding-right: 0px; padding-left: 0px;\" >\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" id=\"btnCloseAvd_%s\" class=\"btn btn-%s\">%s</button>\n </div>\n </div>\n </div>\n </div>\n "
  1484. }
  1485. },
  1486. bootstrap4: {
  1487. icons: {
  1488. advancedSearchIcon: 'fa-chevron-down'
  1489. },
  1490. html: {
  1491. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">%s</h4>\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 modal-body-custom\">\n <div class=\"container-fluid\" id=\"avdSearchModalContent_%s\"\n style=\"padding-right: 0; padding-left: 0;\" >\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" id=\"btnCloseAvd_%s\" class=\"btn btn-%s\">%s</button>\n </div>\n </div>\n </div>\n </div>\n "
  1492. }
  1493. },
  1494. bootstrap5: {
  1495. icons: {
  1496. advancedSearchIcon: 'bi-chevron-down'
  1497. },
  1498. html: {
  1499. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">%s</h4>\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 modal-body-custom\">\n <div class=\"container-fluid\" id=\"avdSearchModalContent_%s\"\n style=\"padding-right: 0; padding-left: 0;\" >\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" id=\"btnCloseAvd_%s\" class=\"btn btn-%s\">%s</button>\n </div>\n </div>\n </div>\n </div>\n "
  1500. }
  1501. },
  1502. bulma: {
  1503. icons: {
  1504. advancedSearchIcon: 'fa-chevron-down'
  1505. },
  1506. html: {
  1507. modal: "\n <div class=\"modal\" id=\"avdSearchModal_%s\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">%s</p>\n <button class=\"delete\" aria-label=\"close\"></button>\n </header>\n <section class=\"modal-card-body\" id=\"avdSearchModalContent_%s\"></section>\n <footer class=\"modal-card-foot\">\n <button class=\"button\" id=\"btnCloseAvd_%s\" data-close=\"btn btn-%s\">%s</button>\n </footer>\n </div>\n </div>\n "
  1508. }
  1509. },
  1510. foundation: {
  1511. icons: {
  1512. advancedSearchIcon: 'fa-chevron-down'
  1513. },
  1514. html: {
  1515. modal: "\n <div class=\"reveal\" id=\"avdSearchModal_%s\" data-reveal>\n <h1>%s</h1>\n <div id=\"avdSearchModalContent_%s\">\n\n </div>\n <button class=\"close-button\" data-close aria-label=\"Close modal\" type=\"button\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n\n <button id=\"btnCloseAvd_%s\" class=\"%s\" type=\"button\">%s</button>\n </div>\n "
  1516. }
  1517. },
  1518. materialize: {
  1519. icons: {
  1520. advancedSearchIcon: 'expand_more'
  1521. },
  1522. html: {
  1523. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal\">\n <div class=\"modal-content\">\n <h4>%s</h4>\n <div id=\"avdSearchModalContent_%s\">\n\n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:void(0)\"\" id=\"btnCloseAvd_%s\" class=\"modal-close waves-effect waves-green btn-flat %s\">%s</a>\n </div>\n </div>\n "
  1524. }
  1525. },
  1526. semantic: {
  1527. icons: {
  1528. advancedSearchIcon: 'fa-chevron-down'
  1529. },
  1530. html: {
  1531. modal: "\n <div class=\"ui modal\" id=\"avdSearchModal_%s\">\n <i class=\"close icon\"></i>\n <div class=\"header\">\n %s\n </div>\n <div class=\"image content ui form\" id=\"avdSearchModalContent_%s\"></div>\n <div class=\"actions\">\n <div id=\"btnCloseAvd_%s\" class=\"ui black deny button %s\">%s</div>\n </div>\n </div>\n "
  1532. }
  1533. }
  1534. }[$__default['default'].fn.bootstrapTable.theme];
  1535. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1536. advancedSearch: false,
  1537. idForm: 'advancedSearch',
  1538. actionForm: '',
  1539. idTable: undefined,
  1540. // eslint-disable-next-line no-unused-vars
  1541. onColumnAdvancedSearch: function onColumnAdvancedSearch(field, text) {
  1542. return false;
  1543. }
  1544. });
  1545. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults.icons, {
  1546. advancedSearchIcon: theme.icons.advancedSearchIcon
  1547. });
  1548. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  1549. 'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
  1550. });
  1551. $__default['default'].extend($__default['default'].fn.bootstrapTable.locales, {
  1552. formatAdvancedSearch: function formatAdvancedSearch() {
  1553. return 'Advanced search';
  1554. },
  1555. formatAdvancedCloseButton: function formatAdvancedCloseButton() {
  1556. return 'Close';
  1557. }
  1558. });
  1559. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, $__default['default'].fn.bootstrapTable.locales);
  1560. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1561. _inherits(_class, _$$BootstrapTable);
  1562. var _super = _createSuper(_class);
  1563. function _class() {
  1564. _classCallCheck(this, _class);
  1565. return _super.apply(this, arguments);
  1566. }
  1567. _createClass(_class, [{
  1568. key: "initToolbar",
  1569. value: function initToolbar() {
  1570. var o = this.options;
  1571. this.showToolbar = this.showToolbar || o.search && o.advancedSearch && o.idTable;
  1572. if (o.search && o.advancedSearch && o.idTable) {
  1573. this.buttons = Object.assign(this.buttons, {
  1574. advancedSearch: {
  1575. text: this.options.formatAdvancedSearch(),
  1576. icon: this.options.icons.advancedSearchIcon,
  1577. event: this.showAvdSearch,
  1578. attributes: {
  1579. 'aria-label': this.options.formatAdvancedSearch(),
  1580. title: this.options.formatAdvancedSearch()
  1581. }
  1582. }
  1583. });
  1584. }
  1585. _get(_getPrototypeOf(_class.prototype), "initToolbar", this).call(this);
  1586. }
  1587. }, {
  1588. key: "showAvdSearch",
  1589. value: function showAvdSearch() {
  1590. var _this = this;
  1591. var o = this.options;
  1592. var modalSelector = "#avdSearchModal_".concat(o.idTable);
  1593. if ($__default['default'](modalSelector).length <= 0) {
  1594. $__default['default']('body').append(Utils.sprintf(theme.html.modal, o.idTable, o.formatAdvancedSearch(), o.idTable, o.idTable, o.buttonsClass, o.formatAdvancedCloseButton()));
  1595. var timeoutId = 0;
  1596. $__default['default']("#avdSearchModalContent_".concat(o.idTable)).append(this.createFormAvd().join(''));
  1597. $__default['default']("#".concat(o.idForm)).off('keyup blur', 'input').on('keyup blur', 'input', function (e) {
  1598. if (o.sidePagination === 'server') {
  1599. _this.onColumnAdvancedSearch(e);
  1600. } else {
  1601. clearTimeout(timeoutId);
  1602. timeoutId = setTimeout(function () {
  1603. _this.onColumnAdvancedSearch(e);
  1604. }, o.searchTimeOut);
  1605. }
  1606. });
  1607. $__default['default']("#btnCloseAvd_".concat(o.idTable)).click(function () {
  1608. return _this.hideModal();
  1609. });
  1610. if ($__default['default'].fn.bootstrapTable.theme === 'bulma') {
  1611. $__default['default'](modalSelector).find('.delete').off('click').on('click', function () {
  1612. return _this.hideModal();
  1613. });
  1614. }
  1615. this.showModal();
  1616. } else {
  1617. this.showModal();
  1618. }
  1619. }
  1620. }, {
  1621. key: "showModal",
  1622. value: function showModal() {
  1623. var modalSelector = "#avdSearchModal_".concat(this.options.idTable);
  1624. if ($__default['default'].inArray($__default['default'].fn.bootstrapTable.theme, ['bootstrap3', 'bootstrap4']) !== -1) {
  1625. $__default['default'](modalSelector).modal();
  1626. } else if ($__default['default'].fn.bootstrapTable.theme === 'bootstrap5') {
  1627. if (!this.toolbarModal) {
  1628. // eslint-disable-next-line no-undef
  1629. this.toolbarModal = new bootstrap.Modal(document.getElementById("avdSearchModal_".concat(this.options.idTable)), {});
  1630. }
  1631. this.toolbarModal.show();
  1632. } else if ($__default['default'].fn.bootstrapTable.theme === 'bulma') {
  1633. $__default['default'](modalSelector).toggleClass('is-active');
  1634. } else if ($__default['default'].fn.bootstrapTable.theme === 'foundation') {
  1635. if (!this.toolbarModal) {
  1636. // eslint-disable-next-line no-undef
  1637. this.toolbarModal = new Foundation.Reveal($__default['default'](modalSelector));
  1638. }
  1639. this.toolbarModal.open();
  1640. } else if ($__default['default'].fn.bootstrapTable.theme === 'materialize') {
  1641. $__default['default'](modalSelector).modal();
  1642. $__default['default'](modalSelector).modal('open');
  1643. } else if ($__default['default'].fn.bootstrapTable.theme === 'semantic') {
  1644. $__default['default'](modalSelector).modal('show');
  1645. }
  1646. }
  1647. }, {
  1648. key: "hideModal",
  1649. value: function hideModal() {
  1650. var $closeModalButton = $__default['default']("#avdSearchModal_".concat(this.options.idTable));
  1651. var modalSelector = "#avdSearchModal_".concat(this.options.idTable);
  1652. if ($__default['default'].inArray($__default['default'].fn.bootstrapTable.theme, ['bootstrap3', 'bootstrap4']) !== -1) {
  1653. $closeModalButton.modal('hide');
  1654. } else if ($__default['default'].fn.bootstrapTable.theme === 'bootstrap5') {
  1655. this.toolbarModal.hide();
  1656. } else if ($__default['default'].fn.bootstrapTable.theme === 'bulma') {
  1657. $__default['default']('html').toggleClass('is-clipped');
  1658. $__default['default'](modalSelector).toggleClass('is-active');
  1659. } else if ($__default['default'].fn.bootstrapTable.theme === 'foundation') {
  1660. this.toolbarModal.close();
  1661. } else if ($__default['default'].fn.bootstrapTable.theme === 'materialize') {
  1662. $__default['default'](modalSelector).modal('open');
  1663. } else if ($__default['default'].fn.bootstrapTable.theme === 'semantic') {
  1664. $__default['default'](modalSelector).modal('close');
  1665. }
  1666. if (this.options.sidePagination === 'server') {
  1667. this.options.pageNumber = 1;
  1668. this.updatePagination();
  1669. this.trigger('column-advanced-search', this.filterColumnsPartial);
  1670. }
  1671. }
  1672. }, {
  1673. key: "createFormAvd",
  1674. value: function createFormAvd() {
  1675. var o = this.options;
  1676. var html = ["<form class=\"form-horizontal\" id=\"".concat(o.idForm, "\" action=\"").concat(o.actionForm, "\">")];
  1677. var _iterator = _createForOfIteratorHelper(this.columns),
  1678. _step;
  1679. try {
  1680. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1681. var column = _step.value;
  1682. if (!column.checkbox && column.visible && column.searchable) {
  1683. html.push("\n <div class=\"form-group row\">\n <label class=\"col-sm-4 control-label\">".concat(column.title, "</label>\n <div class=\"col-sm-6\">\n <input type=\"text\" class=\"form-control ").concat(this.constants.classes.input, "\" name=\"").concat(column.field, "\" placeholder=\"").concat(column.title, "\" id=\"").concat(column.field, "\">\n </div>\n </div>\n "));
  1684. }
  1685. }
  1686. } catch (err) {
  1687. _iterator.e(err);
  1688. } finally {
  1689. _iterator.f();
  1690. }
  1691. html.push('</form>');
  1692. return html;
  1693. }
  1694. }, {
  1695. key: "initSearch",
  1696. value: function initSearch() {
  1697. var _this2 = this;
  1698. _get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
  1699. if (!this.options.advancedSearch || this.options.sidePagination === 'server') {
  1700. return;
  1701. }
  1702. var fp = $__default['default'].isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
  1703. this.data = fp ? this.data.filter(function (item, i) {
  1704. for (var _i = 0, _Object$entries = Object.entries(fp); _i < _Object$entries.length; _i++) {
  1705. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  1706. key = _Object$entries$_i[0],
  1707. v = _Object$entries$_i[1];
  1708. var fval = v.toLowerCase();
  1709. var value = item[key];
  1710. var index = _this2.header.fields.indexOf(key);
  1711. value = Utils.calculateObjectValue(_this2.header, _this2.header.formatters[index], [value, item, i], value);
  1712. if (!(index !== -1 && (typeof value === 'string' || typeof value === 'number') && "".concat(value).toLowerCase().includes(fval))) {
  1713. return false;
  1714. }
  1715. }
  1716. return true;
  1717. }) : this.data;
  1718. this.unsortedData = _toConsumableArray(this.data);
  1719. }
  1720. }, {
  1721. key: "onColumnAdvancedSearch",
  1722. value: function onColumnAdvancedSearch(e) {
  1723. var text = $__default['default'].trim($__default['default'](e.currentTarget).val());
  1724. var $field = $__default['default'](e.currentTarget)[0].id;
  1725. if ($__default['default'].isEmptyObject(this.filterColumnsPartial)) {
  1726. this.filterColumnsPartial = {};
  1727. }
  1728. if (text) {
  1729. this.filterColumnsPartial[$field] = text;
  1730. } else {
  1731. delete this.filterColumnsPartial[$field];
  1732. }
  1733. if (this.options.sidePagination !== 'server') {
  1734. this.options.pageNumber = 1;
  1735. this.onSearch(e);
  1736. this.updatePagination();
  1737. this.trigger('column-advanced-search', $field, text);
  1738. }
  1739. }
  1740. }]);
  1741. return _class;
  1742. }($__default['default'].BootstrapTable);
  1743. })));