bootstrap-table-addrbar.js 48 KB

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