bootstrap-table-addrbar.js 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631
  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. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  8. function createCommonjsModule(fn, module) {
  9. return module = { exports: {} }, fn(module, module.exports), module.exports;
  10. }
  11. var check = function (it) {
  12. return it && it.Math == Math && it;
  13. };
  14. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  15. var global_1 =
  16. // eslint-disable-next-line no-undef
  17. check(typeof globalThis == 'object' && globalThis) ||
  18. check(typeof window == 'object' && window) ||
  19. check(typeof self == 'object' && self) ||
  20. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  21. // eslint-disable-next-line no-new-func
  22. Function('return this')();
  23. var fails = function (exec) {
  24. try {
  25. return !!exec();
  26. } catch (error) {
  27. return true;
  28. }
  29. };
  30. // Thank's IE8 for his funny defineProperty
  31. var descriptors = !fails(function () {
  32. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  33. });
  34. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  35. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  36. // Nashorn ~ JDK8 bug
  37. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  38. // `Object.prototype.propertyIsEnumerable` method implementation
  39. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  40. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  41. var descriptor = getOwnPropertyDescriptor(this, V);
  42. return !!descriptor && descriptor.enumerable;
  43. } : nativePropertyIsEnumerable;
  44. var objectPropertyIsEnumerable = {
  45. f: f
  46. };
  47. var createPropertyDescriptor = function (bitmap, value) {
  48. return {
  49. enumerable: !(bitmap & 1),
  50. configurable: !(bitmap & 2),
  51. writable: !(bitmap & 4),
  52. value: value
  53. };
  54. };
  55. var toString = {}.toString;
  56. var classofRaw = function (it) {
  57. return toString.call(it).slice(8, -1);
  58. };
  59. var split = ''.split;
  60. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  61. var indexedObject = fails(function () {
  62. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  63. // eslint-disable-next-line no-prototype-builtins
  64. return !Object('z').propertyIsEnumerable(0);
  65. }) ? function (it) {
  66. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  67. } : Object;
  68. // `RequireObjectCoercible` abstract operation
  69. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  70. var requireObjectCoercible = function (it) {
  71. if (it == undefined) throw TypeError("Can't call method on " + it);
  72. return it;
  73. };
  74. // toObject with fallback for non-array-like ES3 strings
  75. var toIndexedObject = function (it) {
  76. return indexedObject(requireObjectCoercible(it));
  77. };
  78. var isObject = function (it) {
  79. return typeof it === 'object' ? it !== null : typeof it === 'function';
  80. };
  81. // `ToPrimitive` abstract operation
  82. // https://tc39.github.io/ecma262/#sec-toprimitive
  83. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  84. // and the second argument - flag - preferred type is a string
  85. var toPrimitive = function (input, PREFERRED_STRING) {
  86. if (!isObject(input)) return input;
  87. var fn, val;
  88. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  89. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  91. throw TypeError("Can't convert object to primitive value");
  92. };
  93. var hasOwnProperty = {}.hasOwnProperty;
  94. var has = function (it, key) {
  95. return hasOwnProperty.call(it, key);
  96. };
  97. var document = global_1.document;
  98. // typeof document.createElement is 'object' in old IE
  99. var EXISTS = isObject(document) && isObject(document.createElement);
  100. var documentCreateElement = function (it) {
  101. return EXISTS ? document.createElement(it) : {};
  102. };
  103. // Thank's IE8 for his funny defineProperty
  104. var ie8DomDefine = !descriptors && !fails(function () {
  105. return Object.defineProperty(documentCreateElement('div'), 'a', {
  106. get: function () { return 7; }
  107. }).a != 7;
  108. });
  109. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  110. // `Object.getOwnPropertyDescriptor` method
  111. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  112. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  113. O = toIndexedObject(O);
  114. P = toPrimitive(P, true);
  115. if (ie8DomDefine) try {
  116. return nativeGetOwnPropertyDescriptor(O, P);
  117. } catch (error) { /* empty */ }
  118. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  119. };
  120. var objectGetOwnPropertyDescriptor = {
  121. f: f$1
  122. };
  123. var anObject = function (it) {
  124. if (!isObject(it)) {
  125. throw TypeError(String(it) + ' is not an object');
  126. } return it;
  127. };
  128. var nativeDefineProperty = Object.defineProperty;
  129. // `Object.defineProperty` method
  130. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  131. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  132. anObject(O);
  133. P = toPrimitive(P, true);
  134. anObject(Attributes);
  135. if (ie8DomDefine) try {
  136. return nativeDefineProperty(O, P, Attributes);
  137. } catch (error) { /* empty */ }
  138. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  139. if ('value' in Attributes) O[P] = Attributes.value;
  140. return O;
  141. };
  142. var objectDefineProperty = {
  143. f: f$2
  144. };
  145. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  146. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  147. } : function (object, key, value) {
  148. object[key] = value;
  149. return object;
  150. };
  151. var setGlobal = function (key, value) {
  152. try {
  153. createNonEnumerableProperty(global_1, key, value);
  154. } catch (error) {
  155. global_1[key] = value;
  156. } return value;
  157. };
  158. var SHARED = '__core-js_shared__';
  159. var store = global_1[SHARED] || setGlobal(SHARED, {});
  160. var sharedStore = store;
  161. var functionToString = Function.toString;
  162. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  163. if (typeof sharedStore.inspectSource != 'function') {
  164. sharedStore.inspectSource = function (it) {
  165. return functionToString.call(it);
  166. };
  167. }
  168. var inspectSource = sharedStore.inspectSource;
  169. var WeakMap = global_1.WeakMap;
  170. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  171. var shared = createCommonjsModule(function (module) {
  172. (module.exports = function (key, value) {
  173. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  174. })('versions', []).push({
  175. version: '3.6.0',
  176. mode: 'global',
  177. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  178. });
  179. });
  180. var id = 0;
  181. var postfix = Math.random();
  182. var uid = function (key) {
  183. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  184. };
  185. var keys = shared('keys');
  186. var sharedKey = function (key) {
  187. return keys[key] || (keys[key] = uid(key));
  188. };
  189. var hiddenKeys = {};
  190. var WeakMap$1 = global_1.WeakMap;
  191. var set, get, has$1;
  192. var enforce = function (it) {
  193. return has$1(it) ? get(it) : set(it, {});
  194. };
  195. var getterFor = function (TYPE) {
  196. return function (it) {
  197. var state;
  198. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  199. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  200. } return state;
  201. };
  202. };
  203. if (nativeWeakMap) {
  204. var store$1 = new WeakMap$1();
  205. var wmget = store$1.get;
  206. var wmhas = store$1.has;
  207. var wmset = store$1.set;
  208. set = function (it, metadata) {
  209. wmset.call(store$1, it, metadata);
  210. return metadata;
  211. };
  212. get = function (it) {
  213. return wmget.call(store$1, it) || {};
  214. };
  215. has$1 = function (it) {
  216. return wmhas.call(store$1, it);
  217. };
  218. } else {
  219. var STATE = sharedKey('state');
  220. hiddenKeys[STATE] = true;
  221. set = function (it, metadata) {
  222. createNonEnumerableProperty(it, STATE, metadata);
  223. return metadata;
  224. };
  225. get = function (it) {
  226. return has(it, STATE) ? it[STATE] : {};
  227. };
  228. has$1 = function (it) {
  229. return has(it, STATE);
  230. };
  231. }
  232. var internalState = {
  233. set: set,
  234. get: get,
  235. has: has$1,
  236. enforce: enforce,
  237. getterFor: getterFor
  238. };
  239. var redefine = createCommonjsModule(function (module) {
  240. var getInternalState = internalState.get;
  241. var enforceInternalState = internalState.enforce;
  242. var TEMPLATE = String(String).split('String');
  243. (module.exports = function (O, key, value, options) {
  244. var unsafe = options ? !!options.unsafe : false;
  245. var simple = options ? !!options.enumerable : false;
  246. var noTargetGet = options ? !!options.noTargetGet : false;
  247. if (typeof value == 'function') {
  248. if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
  249. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  250. }
  251. if (O === global_1) {
  252. if (simple) O[key] = value;
  253. else setGlobal(key, value);
  254. return;
  255. } else if (!unsafe) {
  256. delete O[key];
  257. } else if (!noTargetGet && O[key]) {
  258. simple = true;
  259. }
  260. if (simple) O[key] = value;
  261. else createNonEnumerableProperty(O, key, value);
  262. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  263. })(Function.prototype, 'toString', function toString() {
  264. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  265. });
  266. });
  267. var path = global_1;
  268. var aFunction = function (variable) {
  269. return typeof variable == 'function' ? variable : undefined;
  270. };
  271. var getBuiltIn = function (namespace, method) {
  272. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  273. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  274. };
  275. var ceil = Math.ceil;
  276. var floor = Math.floor;
  277. // `ToInteger` abstract operation
  278. // https://tc39.github.io/ecma262/#sec-tointeger
  279. var toInteger = function (argument) {
  280. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  281. };
  282. var min = Math.min;
  283. // `ToLength` abstract operation
  284. // https://tc39.github.io/ecma262/#sec-tolength
  285. var toLength = function (argument) {
  286. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  287. };
  288. var max = Math.max;
  289. var min$1 = Math.min;
  290. // Helper for a popular repeating case of the spec:
  291. // Let integer be ? ToInteger(index).
  292. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  293. var toAbsoluteIndex = function (index, length) {
  294. var integer = toInteger(index);
  295. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  296. };
  297. // `Array.prototype.{ indexOf, includes }` methods implementation
  298. var createMethod = function (IS_INCLUDES) {
  299. return function ($this, el, fromIndex) {
  300. var O = toIndexedObject($this);
  301. var length = toLength(O.length);
  302. var index = toAbsoluteIndex(fromIndex, length);
  303. var value;
  304. // Array#includes uses SameValueZero equality algorithm
  305. // eslint-disable-next-line no-self-compare
  306. if (IS_INCLUDES && el != el) while (length > index) {
  307. value = O[index++];
  308. // eslint-disable-next-line no-self-compare
  309. if (value != value) return true;
  310. // Array#indexOf ignores holes, Array#includes - not
  311. } else for (;length > index; index++) {
  312. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  313. } return !IS_INCLUDES && -1;
  314. };
  315. };
  316. var arrayIncludes = {
  317. // `Array.prototype.includes` method
  318. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  319. includes: createMethod(true),
  320. // `Array.prototype.indexOf` method
  321. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  322. indexOf: createMethod(false)
  323. };
  324. var indexOf = arrayIncludes.indexOf;
  325. var objectKeysInternal = function (object, names) {
  326. var O = toIndexedObject(object);
  327. var i = 0;
  328. var result = [];
  329. var key;
  330. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  331. // Don't enum bug & hidden keys
  332. while (names.length > i) if (has(O, key = names[i++])) {
  333. ~indexOf(result, key) || result.push(key);
  334. }
  335. return result;
  336. };
  337. // IE8- don't enum bug keys
  338. var enumBugKeys = [
  339. 'constructor',
  340. 'hasOwnProperty',
  341. 'isPrototypeOf',
  342. 'propertyIsEnumerable',
  343. 'toLocaleString',
  344. 'toString',
  345. 'valueOf'
  346. ];
  347. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  348. // `Object.getOwnPropertyNames` method
  349. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  350. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  351. return objectKeysInternal(O, hiddenKeys$1);
  352. };
  353. var objectGetOwnPropertyNames = {
  354. f: f$3
  355. };
  356. var f$4 = Object.getOwnPropertySymbols;
  357. var objectGetOwnPropertySymbols = {
  358. f: f$4
  359. };
  360. // all object keys, includes non-enumerable and symbols
  361. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  362. var keys = objectGetOwnPropertyNames.f(anObject(it));
  363. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  364. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  365. };
  366. var copyConstructorProperties = function (target, source) {
  367. var keys = ownKeys(source);
  368. var defineProperty = objectDefineProperty.f;
  369. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  370. for (var i = 0; i < keys.length; i++) {
  371. var key = keys[i];
  372. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  373. }
  374. };
  375. var replacement = /#|\.prototype\./;
  376. var isForced = function (feature, detection) {
  377. var value = data[normalize(feature)];
  378. return value == POLYFILL ? true
  379. : value == NATIVE ? false
  380. : typeof detection == 'function' ? fails(detection)
  381. : !!detection;
  382. };
  383. var normalize = isForced.normalize = function (string) {
  384. return String(string).replace(replacement, '.').toLowerCase();
  385. };
  386. var data = isForced.data = {};
  387. var NATIVE = isForced.NATIVE = 'N';
  388. var POLYFILL = isForced.POLYFILL = 'P';
  389. var isForced_1 = isForced;
  390. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  391. /*
  392. options.target - name of the target object
  393. options.global - target is the global object
  394. options.stat - export as static methods of target
  395. options.proto - export as prototype methods of target
  396. options.real - real prototype method for the `pure` version
  397. options.forced - export even if the native feature is available
  398. options.bind - bind methods to the target, required for the `pure` version
  399. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  400. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  401. options.sham - add a flag to not completely full polyfills
  402. options.enumerable - export as enumerable property
  403. options.noTargetGet - prevent calling a getter on target
  404. */
  405. var _export = function (options, source) {
  406. var TARGET = options.target;
  407. var GLOBAL = options.global;
  408. var STATIC = options.stat;
  409. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  410. if (GLOBAL) {
  411. target = global_1;
  412. } else if (STATIC) {
  413. target = global_1[TARGET] || setGlobal(TARGET, {});
  414. } else {
  415. target = (global_1[TARGET] || {}).prototype;
  416. }
  417. if (target) for (key in source) {
  418. sourceProperty = source[key];
  419. if (options.noTargetGet) {
  420. descriptor = getOwnPropertyDescriptor$1(target, key);
  421. targetProperty = descriptor && descriptor.value;
  422. } else targetProperty = target[key];
  423. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  424. // contained in target
  425. if (!FORCED && targetProperty !== undefined) {
  426. if (typeof sourceProperty === typeof targetProperty) continue;
  427. copyConstructorProperties(sourceProperty, targetProperty);
  428. }
  429. // add a flag to not completely full polyfills
  430. if (options.sham || (targetProperty && targetProperty.sham)) {
  431. createNonEnumerableProperty(sourceProperty, 'sham', true);
  432. }
  433. // extend global
  434. redefine(target, key, sourceProperty, options);
  435. }
  436. };
  437. // `IsArray` abstract operation
  438. // https://tc39.github.io/ecma262/#sec-isarray
  439. var isArray = Array.isArray || function isArray(arg) {
  440. return classofRaw(arg) == 'Array';
  441. };
  442. // `ToObject` abstract operation
  443. // https://tc39.github.io/ecma262/#sec-toobject
  444. var toObject = function (argument) {
  445. return Object(requireObjectCoercible(argument));
  446. };
  447. var createProperty = function (object, key, value) {
  448. var propertyKey = toPrimitive(key);
  449. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  450. else object[propertyKey] = value;
  451. };
  452. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  453. // Chrome 38 Symbol has incorrect toString conversion
  454. // eslint-disable-next-line no-undef
  455. return !String(Symbol());
  456. });
  457. var useSymbolAsUid = nativeSymbol
  458. // eslint-disable-next-line no-undef
  459. && !Symbol.sham
  460. // eslint-disable-next-line no-undef
  461. && typeof Symbol() == 'symbol';
  462. var WellKnownSymbolsStore = shared('wks');
  463. var Symbol$1 = global_1.Symbol;
  464. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
  465. var wellKnownSymbol = function (name) {
  466. if (!has(WellKnownSymbolsStore, name)) {
  467. if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
  468. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  469. } return WellKnownSymbolsStore[name];
  470. };
  471. var SPECIES = wellKnownSymbol('species');
  472. // `ArraySpeciesCreate` abstract operation
  473. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  474. var arraySpeciesCreate = function (originalArray, length) {
  475. var C;
  476. if (isArray(originalArray)) {
  477. C = originalArray.constructor;
  478. // cross-realm fallback
  479. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  480. else if (isObject(C)) {
  481. C = C[SPECIES];
  482. if (C === null) C = undefined;
  483. }
  484. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  485. };
  486. var userAgent = getBuiltIn('navigator', 'userAgent') || '';
  487. var process = global_1.process;
  488. var versions = process && process.versions;
  489. var v8 = versions && versions.v8;
  490. var match, version;
  491. if (v8) {
  492. match = v8.split('.');
  493. version = match[0] + match[1];
  494. } else if (userAgent) {
  495. match = userAgent.match(/Edge\/(\d+)/);
  496. if (!match || match[1] >= 74) {
  497. match = userAgent.match(/Chrome\/(\d+)/);
  498. if (match) version = match[1];
  499. }
  500. }
  501. var v8Version = version && +version;
  502. var SPECIES$1 = wellKnownSymbol('species');
  503. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  504. // We can't use this feature detection in V8 since it causes
  505. // deoptimization and serious performance degradation
  506. // https://github.com/zloirock/core-js/issues/677
  507. return v8Version >= 51 || !fails(function () {
  508. var array = [];
  509. var constructor = array.constructor = {};
  510. constructor[SPECIES$1] = function () {
  511. return { foo: 1 };
  512. };
  513. return array[METHOD_NAME](Boolean).foo !== 1;
  514. });
  515. };
  516. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  517. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  518. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  519. // We can't use this feature detection in V8 since it causes
  520. // deoptimization and serious performance degradation
  521. // https://github.com/zloirock/core-js/issues/679
  522. var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
  523. var array = [];
  524. array[IS_CONCAT_SPREADABLE] = false;
  525. return array.concat()[0] !== array;
  526. });
  527. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  528. var isConcatSpreadable = function (O) {
  529. if (!isObject(O)) return false;
  530. var spreadable = O[IS_CONCAT_SPREADABLE];
  531. return spreadable !== undefined ? !!spreadable : isArray(O);
  532. };
  533. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  534. // `Array.prototype.concat` method
  535. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  536. // with adding support of @@isConcatSpreadable and @@species
  537. _export({ target: 'Array', proto: true, forced: FORCED }, {
  538. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  539. var O = toObject(this);
  540. var A = arraySpeciesCreate(O, 0);
  541. var n = 0;
  542. var i, k, length, len, E;
  543. for (i = -1, length = arguments.length; i < length; i++) {
  544. E = i === -1 ? O : arguments[i];
  545. if (isConcatSpreadable(E)) {
  546. len = toLength(E.length);
  547. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  548. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  549. } else {
  550. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  551. createProperty(A, n++, E);
  552. }
  553. }
  554. A.length = n;
  555. return A;
  556. }
  557. });
  558. // `Object.keys` method
  559. // https://tc39.github.io/ecma262/#sec-object.keys
  560. var objectKeys = Object.keys || function keys(O) {
  561. return objectKeysInternal(O, enumBugKeys);
  562. };
  563. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  564. // `Object.{ entries, values }` methods implementation
  565. var createMethod$1 = function (TO_ENTRIES) {
  566. return function (it) {
  567. var O = toIndexedObject(it);
  568. var keys = objectKeys(O);
  569. var length = keys.length;
  570. var i = 0;
  571. var result = [];
  572. var key;
  573. while (length > i) {
  574. key = keys[i++];
  575. if (!descriptors || propertyIsEnumerable.call(O, key)) {
  576. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  577. }
  578. }
  579. return result;
  580. };
  581. };
  582. var objectToArray = {
  583. // `Object.entries` method
  584. // https://tc39.github.io/ecma262/#sec-object.entries
  585. entries: createMethod$1(true),
  586. // `Object.values` method
  587. // https://tc39.github.io/ecma262/#sec-object.values
  588. values: createMethod$1(false)
  589. };
  590. var $entries = objectToArray.entries;
  591. // `Object.entries` method
  592. // https://tc39.github.io/ecma262/#sec-object.entries
  593. _export({ target: 'Object', stat: true }, {
  594. entries: function entries(O) {
  595. return $entries(O);
  596. }
  597. });
  598. var aPossiblePrototype = function (it) {
  599. if (!isObject(it) && it !== null) {
  600. throw TypeError("Can't set " + String(it) + ' as a prototype');
  601. } return it;
  602. };
  603. // `Object.setPrototypeOf` method
  604. // https://tc39.github.io/ecma262/#sec-object.setprototypeof
  605. // Works with __proto__ only. Old v8 can't work with null proto objects.
  606. /* eslint-disable no-proto */
  607. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  608. var CORRECT_SETTER = false;
  609. var test = {};
  610. var setter;
  611. try {
  612. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  613. setter.call(test, []);
  614. CORRECT_SETTER = test instanceof Array;
  615. } catch (error) { /* empty */ }
  616. return function setPrototypeOf(O, proto) {
  617. anObject(O);
  618. aPossiblePrototype(proto);
  619. if (CORRECT_SETTER) setter.call(O, proto);
  620. else O.__proto__ = proto;
  621. return O;
  622. };
  623. }() : undefined);
  624. // makes subclassing work correct for wrapped built-ins
  625. var inheritIfRequired = function ($this, dummy, Wrapper) {
  626. var NewTarget, NewTargetPrototype;
  627. if (
  628. // it can work only with native `setPrototypeOf`
  629. objectSetPrototypeOf &&
  630. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  631. typeof (NewTarget = dummy.constructor) == 'function' &&
  632. NewTarget !== Wrapper &&
  633. isObject(NewTargetPrototype = NewTarget.prototype) &&
  634. NewTargetPrototype !== Wrapper.prototype
  635. ) objectSetPrototypeOf($this, NewTargetPrototype);
  636. return $this;
  637. };
  638. var MATCH = wellKnownSymbol('match');
  639. // `IsRegExp` abstract operation
  640. // https://tc39.github.io/ecma262/#sec-isregexp
  641. var isRegexp = function (it) {
  642. var isRegExp;
  643. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  644. };
  645. // `RegExp.prototype.flags` getter implementation
  646. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  647. var regexpFlags = function () {
  648. var that = anObject(this);
  649. var result = '';
  650. if (that.global) result += 'g';
  651. if (that.ignoreCase) result += 'i';
  652. if (that.multiline) result += 'm';
  653. if (that.dotAll) result += 's';
  654. if (that.unicode) result += 'u';
  655. if (that.sticky) result += 'y';
  656. return result;
  657. };
  658. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  659. // so we use an intermediate function.
  660. function RE(s, f) {
  661. return RegExp(s, f);
  662. }
  663. var UNSUPPORTED_Y = fails(function () {
  664. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  665. var re = RE('a', 'y');
  666. re.lastIndex = 2;
  667. return re.exec('abcd') != null;
  668. });
  669. var BROKEN_CARET = fails(function () {
  670. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  671. var re = RE('^r', 'gy');
  672. re.lastIndex = 2;
  673. return re.exec('str') != null;
  674. });
  675. var regexpStickyHelpers = {
  676. UNSUPPORTED_Y: UNSUPPORTED_Y,
  677. BROKEN_CARET: BROKEN_CARET
  678. };
  679. var SPECIES$2 = wellKnownSymbol('species');
  680. var setSpecies = function (CONSTRUCTOR_NAME) {
  681. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  682. var defineProperty = objectDefineProperty.f;
  683. if (descriptors && Constructor && !Constructor[SPECIES$2]) {
  684. defineProperty(Constructor, SPECIES$2, {
  685. configurable: true,
  686. get: function () { return this; }
  687. });
  688. }
  689. };
  690. var defineProperty = objectDefineProperty.f;
  691. var getOwnPropertyNames = objectGetOwnPropertyNames.f;
  692. var setInternalState = internalState.set;
  693. var MATCH$1 = wellKnownSymbol('match');
  694. var NativeRegExp = global_1.RegExp;
  695. var RegExpPrototype = NativeRegExp.prototype;
  696. var re1 = /a/g;
  697. var re2 = /a/g;
  698. // "new" should create a new object, old webkit bug
  699. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  700. var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y;
  701. var FORCED$1 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y$1 || fails(function () {
  702. re2[MATCH$1] = false;
  703. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  704. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
  705. })));
  706. // `RegExp` constructor
  707. // https://tc39.github.io/ecma262/#sec-regexp-constructor
  708. if (FORCED$1) {
  709. var RegExpWrapper = function RegExp(pattern, flags) {
  710. var thisIsRegExp = this instanceof RegExpWrapper;
  711. var patternIsRegExp = isRegexp(pattern);
  712. var flagsAreUndefined = flags === undefined;
  713. var sticky;
  714. if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
  715. return pattern;
  716. }
  717. if (CORRECT_NEW) {
  718. if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
  719. } else if (pattern instanceof RegExpWrapper) {
  720. if (flagsAreUndefined) flags = regexpFlags.call(pattern);
  721. pattern = pattern.source;
  722. }
  723. if (UNSUPPORTED_Y$1) {
  724. sticky = !!flags && flags.indexOf('y') > -1;
  725. if (sticky) flags = flags.replace(/y/g, '');
  726. }
  727. var result = inheritIfRequired(
  728. CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
  729. thisIsRegExp ? this : RegExpPrototype,
  730. RegExpWrapper
  731. );
  732. if (UNSUPPORTED_Y$1 && sticky) setInternalState(result, { sticky: sticky });
  733. return result;
  734. };
  735. var proxy = function (key) {
  736. key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
  737. configurable: true,
  738. get: function () { return NativeRegExp[key]; },
  739. set: function (it) { NativeRegExp[key] = it; }
  740. });
  741. };
  742. var keys$1 = getOwnPropertyNames(NativeRegExp);
  743. var index = 0;
  744. while (keys$1.length > index) proxy(keys$1[index++]);
  745. RegExpPrototype.constructor = RegExpWrapper;
  746. RegExpWrapper.prototype = RegExpPrototype;
  747. redefine(global_1, 'RegExp', RegExpWrapper);
  748. }
  749. // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
  750. setSpecies('RegExp');
  751. var nativeExec = RegExp.prototype.exec;
  752. // This always refers to the native implementation, because the
  753. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  754. // which loads this file before patching the method.
  755. var nativeReplace = String.prototype.replace;
  756. var patchedExec = nativeExec;
  757. var UPDATES_LAST_INDEX_WRONG = (function () {
  758. var re1 = /a/;
  759. var re2 = /b*/g;
  760. nativeExec.call(re1, 'a');
  761. nativeExec.call(re2, 'a');
  762. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  763. })();
  764. var UNSUPPORTED_Y$2 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  765. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  766. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  767. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2;
  768. if (PATCH) {
  769. patchedExec = function exec(str) {
  770. var re = this;
  771. var lastIndex, reCopy, match, i;
  772. var sticky = UNSUPPORTED_Y$2 && re.sticky;
  773. var flags = regexpFlags.call(re);
  774. var source = re.source;
  775. var charsAdded = 0;
  776. var strCopy = str;
  777. if (sticky) {
  778. flags = flags.replace('y', '');
  779. if (flags.indexOf('g') === -1) {
  780. flags += 'g';
  781. }
  782. strCopy = String(str).slice(re.lastIndex);
  783. // Support anchored sticky behavior.
  784. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  785. source = '(?: ' + source + ')';
  786. strCopy = ' ' + strCopy;
  787. charsAdded++;
  788. }
  789. // ^(? + rx + ) is needed, in combination with some str slicing, to
  790. // simulate the 'y' flag.
  791. reCopy = new RegExp('^(?:' + source + ')', flags);
  792. }
  793. if (NPCG_INCLUDED) {
  794. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  795. }
  796. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  797. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  798. if (sticky) {
  799. if (match) {
  800. match.input = match.input.slice(charsAdded);
  801. match[0] = match[0].slice(charsAdded);
  802. match.index = re.lastIndex;
  803. re.lastIndex += match[0].length;
  804. } else re.lastIndex = 0;
  805. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  806. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  807. }
  808. if (NPCG_INCLUDED && match && match.length > 1) {
  809. // Fix browsers whose `exec` methods don't consistently return `undefined`
  810. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  811. nativeReplace.call(match[0], reCopy, function () {
  812. for (i = 1; i < arguments.length - 2; i++) {
  813. if (arguments[i] === undefined) match[i] = undefined;
  814. }
  815. });
  816. }
  817. return match;
  818. };
  819. }
  820. var regexpExec = patchedExec;
  821. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  822. exec: regexpExec
  823. });
  824. var TO_STRING = 'toString';
  825. var RegExpPrototype$1 = RegExp.prototype;
  826. var nativeToString = RegExpPrototype$1[TO_STRING];
  827. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  828. // FF44- RegExp#toString has a wrong name
  829. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  830. // `RegExp.prototype.toString` method
  831. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  832. if (NOT_GENERIC || INCORRECT_NAME) {
  833. redefine(RegExp.prototype, TO_STRING, function toString() {
  834. var R = anObject(this);
  835. var p = String(R.source);
  836. var rf = R.flags;
  837. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$1) ? regexpFlags.call(R) : rf);
  838. return '/' + p + '/' + f;
  839. }, { unsafe: true });
  840. }
  841. var SPECIES$3 = wellKnownSymbol('species');
  842. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  843. // #replace needs built-in support for named groups.
  844. // #match works fine because it just return the exec results, even if it has
  845. // a "grops" property.
  846. var re = /./;
  847. re.exec = function () {
  848. var result = [];
  849. result.groups = { a: '7' };
  850. return result;
  851. };
  852. return ''.replace(re, '$<a>') !== '7';
  853. });
  854. // IE <= 11 replaces $0 with the whole match, as if it was $&
  855. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  856. var REPLACE_KEEPS_$0 = (function () {
  857. return 'a'.replace(/./, '$0') === '$0';
  858. })();
  859. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  860. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  861. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  862. var re = /(?:)/;
  863. var originalExec = re.exec;
  864. re.exec = function () { return originalExec.apply(this, arguments); };
  865. var result = 'ab'.split(re);
  866. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  867. });
  868. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  869. var SYMBOL = wellKnownSymbol(KEY);
  870. var DELEGATES_TO_SYMBOL = !fails(function () {
  871. // String methods call symbol-named RegEp methods
  872. var O = {};
  873. O[SYMBOL] = function () { return 7; };
  874. return ''[KEY](O) != 7;
  875. });
  876. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  877. // Symbol-named RegExp methods call .exec
  878. var execCalled = false;
  879. var re = /a/;
  880. if (KEY === 'split') {
  881. // We can't use real regex here since it causes deoptimization
  882. // and serious performance degradation in V8
  883. // https://github.com/zloirock/core-js/issues/306
  884. re = {};
  885. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  886. // a new one. We need to return the patched regex when creating the new one.
  887. re.constructor = {};
  888. re.constructor[SPECIES$3] = function () { return re; };
  889. re.flags = '';
  890. re[SYMBOL] = /./[SYMBOL];
  891. }
  892. re.exec = function () { execCalled = true; return null; };
  893. re[SYMBOL]('');
  894. return !execCalled;
  895. });
  896. if (
  897. !DELEGATES_TO_SYMBOL ||
  898. !DELEGATES_TO_EXEC ||
  899. (KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
  900. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  901. ) {
  902. var nativeRegExpMethod = /./[SYMBOL];
  903. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  904. if (regexp.exec === regexpExec) {
  905. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  906. // The native String method already delegates to @@method (this
  907. // polyfilled function), leasing to infinite recursion.
  908. // We avoid it by directly calling the native @@method method.
  909. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  910. }
  911. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  912. }
  913. return { done: false };
  914. }, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
  915. var stringMethod = methods[0];
  916. var regexMethod = methods[1];
  917. redefine(String.prototype, KEY, stringMethod);
  918. redefine(RegExp.prototype, SYMBOL, length == 2
  919. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  920. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  921. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  922. // 21.2.5.6 RegExp.prototype[@@match](string)
  923. // 21.2.5.9 RegExp.prototype[@@search](string)
  924. : function (string) { return regexMethod.call(string, this); }
  925. );
  926. }
  927. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  928. };
  929. // `String.prototype.{ codePointAt, at }` methods implementation
  930. var createMethod$2 = function (CONVERT_TO_STRING) {
  931. return function ($this, pos) {
  932. var S = String(requireObjectCoercible($this));
  933. var position = toInteger(pos);
  934. var size = S.length;
  935. var first, second;
  936. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  937. first = S.charCodeAt(position);
  938. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  939. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  940. ? CONVERT_TO_STRING ? S.charAt(position) : first
  941. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  942. };
  943. };
  944. var stringMultibyte = {
  945. // `String.prototype.codePointAt` method
  946. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  947. codeAt: createMethod$2(false),
  948. // `String.prototype.at` method
  949. // https://github.com/mathiasbynens/String.prototype.at
  950. charAt: createMethod$2(true)
  951. };
  952. var charAt = stringMultibyte.charAt;
  953. // `AdvanceStringIndex` abstract operation
  954. // https://tc39.github.io/ecma262/#sec-advancestringindex
  955. var advanceStringIndex = function (S, index, unicode) {
  956. return index + (unicode ? charAt(S, index).length : 1);
  957. };
  958. // `RegExpExec` abstract operation
  959. // https://tc39.github.io/ecma262/#sec-regexpexec
  960. var regexpExecAbstract = function (R, S) {
  961. var exec = R.exec;
  962. if (typeof exec === 'function') {
  963. var result = exec.call(R, S);
  964. if (typeof result !== 'object') {
  965. throw TypeError('RegExp exec method returned something other than an Object or null');
  966. }
  967. return result;
  968. }
  969. if (classofRaw(R) !== 'RegExp') {
  970. throw TypeError('RegExp#exec called on incompatible receiver');
  971. }
  972. return regexpExec.call(R, S);
  973. };
  974. // @@match logic
  975. fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
  976. return [
  977. // `String.prototype.match` method
  978. // https://tc39.github.io/ecma262/#sec-string.prototype.match
  979. function match(regexp) {
  980. var O = requireObjectCoercible(this);
  981. var matcher = regexp == undefined ? undefined : regexp[MATCH];
  982. return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  983. },
  984. // `RegExp.prototype[@@match]` method
  985. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
  986. function (regexp) {
  987. var res = maybeCallNative(nativeMatch, regexp, this);
  988. if (res.done) return res.value;
  989. var rx = anObject(regexp);
  990. var S = String(this);
  991. if (!rx.global) return regexpExecAbstract(rx, S);
  992. var fullUnicode = rx.unicode;
  993. rx.lastIndex = 0;
  994. var A = [];
  995. var n = 0;
  996. var result;
  997. while ((result = regexpExecAbstract(rx, S)) !== null) {
  998. var matchStr = String(result[0]);
  999. A[n] = matchStr;
  1000. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1001. n++;
  1002. }
  1003. return n === 0 ? null : A;
  1004. }
  1005. ];
  1006. });
  1007. var max$1 = Math.max;
  1008. var min$2 = Math.min;
  1009. var floor$1 = Math.floor;
  1010. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
  1011. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
  1012. var maybeToString = function (it) {
  1013. return it === undefined ? it : String(it);
  1014. };
  1015. // @@replace logic
  1016. fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  1017. return [
  1018. // `String.prototype.replace` method
  1019. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  1020. function replace(searchValue, replaceValue) {
  1021. var O = requireObjectCoercible(this);
  1022. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  1023. return replacer !== undefined
  1024. ? replacer.call(searchValue, O, replaceValue)
  1025. : nativeReplace.call(String(O), searchValue, replaceValue);
  1026. },
  1027. // `RegExp.prototype[@@replace]` method
  1028. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  1029. function (regexp, replaceValue) {
  1030. if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
  1031. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  1032. if (res.done) return res.value;
  1033. }
  1034. var rx = anObject(regexp);
  1035. var S = String(this);
  1036. var functionalReplace = typeof replaceValue === 'function';
  1037. if (!functionalReplace) replaceValue = String(replaceValue);
  1038. var global = rx.global;
  1039. if (global) {
  1040. var fullUnicode = rx.unicode;
  1041. rx.lastIndex = 0;
  1042. }
  1043. var results = [];
  1044. while (true) {
  1045. var result = regexpExecAbstract(rx, S);
  1046. if (result === null) break;
  1047. results.push(result);
  1048. if (!global) break;
  1049. var matchStr = String(result[0]);
  1050. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1051. }
  1052. var accumulatedResult = '';
  1053. var nextSourcePosition = 0;
  1054. for (var i = 0; i < results.length; i++) {
  1055. result = results[i];
  1056. var matched = String(result[0]);
  1057. var position = max$1(min$2(toInteger(result.index), S.length), 0);
  1058. var captures = [];
  1059. // NOTE: This is equivalent to
  1060. // captures = result.slice(1).map(maybeToString)
  1061. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1062. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1063. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1064. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1065. var namedCaptures = result.groups;
  1066. if (functionalReplace) {
  1067. var replacerArgs = [matched].concat(captures, position, S);
  1068. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1069. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1070. } else {
  1071. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1072. }
  1073. if (position >= nextSourcePosition) {
  1074. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1075. nextSourcePosition = position + matched.length;
  1076. }
  1077. }
  1078. return accumulatedResult + S.slice(nextSourcePosition);
  1079. }
  1080. ];
  1081. // https://tc39.github.io/ecma262/#sec-getsubstitution
  1082. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  1083. var tailPos = position + matched.length;
  1084. var m = captures.length;
  1085. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1086. if (namedCaptures !== undefined) {
  1087. namedCaptures = toObject(namedCaptures);
  1088. symbols = SUBSTITUTION_SYMBOLS;
  1089. }
  1090. return nativeReplace.call(replacement, symbols, function (match, ch) {
  1091. var capture;
  1092. switch (ch.charAt(0)) {
  1093. case '$': return '$';
  1094. case '&': return matched;
  1095. case '`': return str.slice(0, position);
  1096. case "'": return str.slice(tailPos);
  1097. case '<':
  1098. capture = namedCaptures[ch.slice(1, -1)];
  1099. break;
  1100. default: // \d\d?
  1101. var n = +ch;
  1102. if (n === 0) return match;
  1103. if (n > m) {
  1104. var f = floor$1(n / 10);
  1105. if (f === 0) return match;
  1106. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  1107. return match;
  1108. }
  1109. capture = captures[n - 1];
  1110. }
  1111. return capture === undefined ? '' : capture;
  1112. });
  1113. }
  1114. });
  1115. // `SameValue` abstract operation
  1116. // https://tc39.github.io/ecma262/#sec-samevalue
  1117. var sameValue = Object.is || function is(x, y) {
  1118. // eslint-disable-next-line no-self-compare
  1119. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1120. };
  1121. // @@search logic
  1122. fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
  1123. return [
  1124. // `String.prototype.search` method
  1125. // https://tc39.github.io/ecma262/#sec-string.prototype.search
  1126. function search(regexp) {
  1127. var O = requireObjectCoercible(this);
  1128. var searcher = regexp == undefined ? undefined : regexp[SEARCH];
  1129. return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  1130. },
  1131. // `RegExp.prototype[@@search]` method
  1132. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
  1133. function (regexp) {
  1134. var res = maybeCallNative(nativeSearch, regexp, this);
  1135. if (res.done) return res.value;
  1136. var rx = anObject(regexp);
  1137. var S = String(this);
  1138. var previousLastIndex = rx.lastIndex;
  1139. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  1140. var result = regexpExecAbstract(rx, S);
  1141. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  1142. return result === null ? -1 : result.index;
  1143. }
  1144. ];
  1145. });
  1146. function _classCallCheck(instance, Constructor) {
  1147. if (!(instance instanceof Constructor)) {
  1148. throw new TypeError("Cannot call a class as a function");
  1149. }
  1150. }
  1151. function _defineProperties(target, props) {
  1152. for (var i = 0; i < props.length; i++) {
  1153. var descriptor = props[i];
  1154. descriptor.enumerable = descriptor.enumerable || false;
  1155. descriptor.configurable = true;
  1156. if ("value" in descriptor) descriptor.writable = true;
  1157. Object.defineProperty(target, descriptor.key, descriptor);
  1158. }
  1159. }
  1160. function _createClass(Constructor, protoProps, staticProps) {
  1161. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  1162. if (staticProps) _defineProperties(Constructor, staticProps);
  1163. return Constructor;
  1164. }
  1165. function _inherits(subClass, superClass) {
  1166. if (typeof superClass !== "function" && superClass !== null) {
  1167. throw new TypeError("Super expression must either be null or a function");
  1168. }
  1169. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1170. constructor: {
  1171. value: subClass,
  1172. writable: true,
  1173. configurable: true
  1174. }
  1175. });
  1176. if (superClass) _setPrototypeOf(subClass, superClass);
  1177. }
  1178. function _getPrototypeOf(o) {
  1179. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  1180. return o.__proto__ || Object.getPrototypeOf(o);
  1181. };
  1182. return _getPrototypeOf(o);
  1183. }
  1184. function _setPrototypeOf(o, p) {
  1185. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1186. o.__proto__ = p;
  1187. return o;
  1188. };
  1189. return _setPrototypeOf(o, p);
  1190. }
  1191. function _assertThisInitialized(self) {
  1192. if (self === void 0) {
  1193. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1194. }
  1195. return self;
  1196. }
  1197. function _possibleConstructorReturn(self, call) {
  1198. if (call && (typeof call === "object" || typeof call === "function")) {
  1199. return call;
  1200. }
  1201. return _assertThisInitialized(self);
  1202. }
  1203. function _superPropBase(object, property) {
  1204. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1205. object = _getPrototypeOf(object);
  1206. if (object === null) break;
  1207. }
  1208. return object;
  1209. }
  1210. function _get(target, property, receiver) {
  1211. if (typeof Reflect !== "undefined" && Reflect.get) {
  1212. _get = Reflect.get;
  1213. } else {
  1214. _get = function _get(target, property, receiver) {
  1215. var base = _superPropBase(target, property);
  1216. if (!base) return;
  1217. var desc = Object.getOwnPropertyDescriptor(base, property);
  1218. if (desc.get) {
  1219. return desc.get.call(receiver);
  1220. }
  1221. return desc.value;
  1222. };
  1223. }
  1224. return _get(target, property, receiver || target);
  1225. }
  1226. function _slicedToArray(arr, i) {
  1227. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  1228. }
  1229. function _arrayWithHoles(arr) {
  1230. if (Array.isArray(arr)) return arr;
  1231. }
  1232. function _iterableToArrayLimit(arr, i) {
  1233. if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
  1234. return;
  1235. }
  1236. var _arr = [];
  1237. var _n = true;
  1238. var _d = false;
  1239. var _e = undefined;
  1240. try {
  1241. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  1242. _arr.push(_s.value);
  1243. if (i && _arr.length === i) break;
  1244. }
  1245. } catch (err) {
  1246. _d = true;
  1247. _e = err;
  1248. } finally {
  1249. try {
  1250. if (!_n && _i["return"] != null) _i["return"]();
  1251. } finally {
  1252. if (_d) throw _e;
  1253. }
  1254. }
  1255. return _arr;
  1256. }
  1257. function _nonIterableRest() {
  1258. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  1259. }
  1260. /**
  1261. * @author: general
  1262. * @website: note.generals.space
  1263. * @email: generals.space@gmail.com
  1264. * @github: https://github.com/generals-space/bootstrap-table-addrbar
  1265. * @update: zhixin wen <wenzhixin2010@gmail.com>
  1266. */
  1267. /*
  1268. * function: 获取浏览器地址栏中的指定参数.
  1269. * key: 参数名
  1270. * url: 默认为当前地址栏
  1271. */
  1272. function _GET(key) {
  1273. var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
  1274. /*
  1275. * 注意这里正则表达式的书写方法
  1276. * (^|&)key匹配: 直接以key开始或以&key开始的字符串
  1277. * 同理(&|$)表示以&结束或是直接结束的字符串
  1278. * ...当然, 我并不知道这种用法.
  1279. */
  1280. var reg = new RegExp("(^|&)".concat(key, "=([^&]*)(&|$)"));
  1281. var result = url.substr(1).match(reg);
  1282. if (result) {
  1283. return decodeURIComponent(result[2]);
  1284. }
  1285. return null;
  1286. }
  1287. /*
  1288. * function: 根据给定参数生成url地址
  1289. * var dic = {name: 'genreal', age: 24}
  1290. * var url = 'https://www.baidu.com?age=22';
  1291. * _buildUrl(dic, url);
  1292. * 将得到"https://www.baidu.com?age=24&name=genreal"
  1293. * 哦, 忽略先后顺序吧...
  1294. *
  1295. * 补充: 可以参考浏览器URLSearchParams对象, 更加方便和强大.
  1296. * 考虑到兼容性, 暂时不使用这个工具.
  1297. */
  1298. function _buildUrl(dict) {
  1299. var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
  1300. for (var _i = 0, _Object$entries = Object.entries(dict); _i < _Object$entries.length; _i++) {
  1301. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  1302. key = _Object$entries$_i[0],
  1303. val = _Object$entries$_i[1];
  1304. // 搜索name=general这种形式的字符串(&是分隔符)
  1305. var pattern = "".concat(key, "=([^&]*)");
  1306. var targetStr = "".concat(key, "=").concat(val);
  1307. /*
  1308. * 如果目标url中包含了key键, 我们需要将它替换成我们自己的val
  1309. * 不然就直接添加好了.
  1310. */
  1311. if (url.match(pattern)) {
  1312. var tmp = new RegExp("(".concat(key, "=)([^&]*)"), 'gi');
  1313. url = url.replace(tmp, targetStr);
  1314. } else {
  1315. var seperator = url.match('[?]') ? '&' : '?';
  1316. url = url + seperator + targetStr;
  1317. }
  1318. }
  1319. if (location.hash) {
  1320. url += location.hash;
  1321. }
  1322. return url;
  1323. }
  1324. $.BootstrapTable =
  1325. /*#__PURE__*/
  1326. function (_$$BootstrapTable) {
  1327. _inherits(_class, _$$BootstrapTable);
  1328. function _class() {
  1329. _classCallCheck(this, _class);
  1330. return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
  1331. }
  1332. _createClass(_class, [{
  1333. key: "init",
  1334. value: function init() {
  1335. var _this = this,
  1336. _get2;
  1337. if (this.options.pagination && this.options.sidePagination === 'server' && this.options.addrbar) {
  1338. // 标志位, 初始加载后关闭
  1339. this.addrbarInit = true;
  1340. var _prefix = this.options.addrPrefix || ''; // 优先级排序: 用户指定值最优先, 未指定时从地址栏获取, 未获取到时采用默认值
  1341. this.options.pageNumber = +_GET("".concat(_prefix, "page")) || $.BootstrapTable.DEFAULTS.pageNumber;
  1342. this.options.pageSize = +_GET("".concat(_prefix, "size")) || $.BootstrapTable.DEFAULTS.pageSize;
  1343. this.options.sortOrder = _GET("".concat(_prefix, "order")) || $.BootstrapTable.DEFAULTS.sortOrder;
  1344. this.options.sortName = _GET("".concat(_prefix, "sort")) || $.BootstrapTable.DEFAULTS.sortName;
  1345. this.options.searchText = _GET("".concat(_prefix, "search")) || $.BootstrapTable.DEFAULTS.searchText;
  1346. var _onLoadSuccess = this.options.onLoadSuccess;
  1347. this.options.onLoadSuccess = function (data) {
  1348. if (_this.addrbarInit) {
  1349. _this.addrbarInit = false;
  1350. } else {
  1351. var params = {};
  1352. params["".concat(_prefix, "page")] = _this.options.pageNumber, params["".concat(_prefix, "size")] = _this.options.pageSize, params["".concat(_prefix, "order")] = _this.options.sortOrder, params["".concat(_prefix, "sort")] = _this.options.sortName, params["".concat(_prefix, "search")] = _this.options.searchText; // h5提供的修改浏览器地址栏的方法
  1353. window.history.pushState({}, '', _buildUrl(params));
  1354. }
  1355. if (_onLoadSuccess) {
  1356. _onLoadSuccess.call(_this, data);
  1357. }
  1358. };
  1359. }
  1360. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1361. args[_key] = arguments[_key];
  1362. }
  1363. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  1364. }
  1365. }]);
  1366. return _class;
  1367. }($.BootstrapTable);
  1368. })));