bootstrap-table-export.js 75 KB

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