bootstrap-table-toolbar.js 77 KB

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