bootstrap-table-print.js 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. }(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _inherits(subClass, superClass) {
  28. if (typeof superClass !== "function" && superClass !== null) {
  29. throw new TypeError("Super expression must either be null or a function");
  30. }
  31. subClass.prototype = Object.create(superClass && superClass.prototype, {
  32. constructor: {
  33. value: subClass,
  34. writable: true,
  35. configurable: true
  36. }
  37. });
  38. if (superClass) _setPrototypeOf(subClass, superClass);
  39. }
  40. function _getPrototypeOf(o) {
  41. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  42. return o.__proto__ || Object.getPrototypeOf(o);
  43. };
  44. return _getPrototypeOf(o);
  45. }
  46. function _setPrototypeOf(o, p) {
  47. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  48. o.__proto__ = p;
  49. return o;
  50. };
  51. return _setPrototypeOf(o, p);
  52. }
  53. function _isNativeReflectConstruct() {
  54. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  55. if (Reflect.construct.sham) return false;
  56. if (typeof Proxy === "function") return true;
  57. try {
  58. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  59. return true;
  60. } catch (e) {
  61. return false;
  62. }
  63. }
  64. function _assertThisInitialized(self) {
  65. if (self === void 0) {
  66. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  67. }
  68. return self;
  69. }
  70. function _possibleConstructorReturn(self, call) {
  71. if (call && (typeof call === "object" || typeof call === "function")) {
  72. return call;
  73. }
  74. return _assertThisInitialized(self);
  75. }
  76. function _createSuper(Derived) {
  77. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  78. return function _createSuperInternal() {
  79. var Super = _getPrototypeOf(Derived),
  80. result;
  81. if (hasNativeReflectConstruct) {
  82. var NewTarget = _getPrototypeOf(this).constructor;
  83. result = Reflect.construct(Super, arguments, NewTarget);
  84. } else {
  85. result = Super.apply(this, arguments);
  86. }
  87. return _possibleConstructorReturn(this, result);
  88. };
  89. }
  90. function _superPropBase(object, property) {
  91. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  92. object = _getPrototypeOf(object);
  93. if (object === null) break;
  94. }
  95. return object;
  96. }
  97. function _get(target, property, receiver) {
  98. if (typeof Reflect !== "undefined" && Reflect.get) {
  99. _get = Reflect.get;
  100. } else {
  101. _get = function _get(target, property, receiver) {
  102. var base = _superPropBase(target, property);
  103. if (!base) return;
  104. var desc = Object.getOwnPropertyDescriptor(base, property);
  105. if (desc.get) {
  106. return desc.get.call(receiver);
  107. }
  108. return desc.value;
  109. };
  110. }
  111. return _get(target, property, receiver || target);
  112. }
  113. function _unsupportedIterableToArray(o, minLen) {
  114. if (!o) return;
  115. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  116. var n = Object.prototype.toString.call(o).slice(8, -1);
  117. if (n === "Object" && o.constructor) n = o.constructor.name;
  118. if (n === "Map" || n === "Set") return Array.from(o);
  119. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  120. }
  121. function _arrayLikeToArray(arr, len) {
  122. if (len == null || len > arr.length) len = arr.length;
  123. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  124. return arr2;
  125. }
  126. function _createForOfIteratorHelper(o, allowArrayLike) {
  127. var it;
  128. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  129. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  130. if (it) o = it;
  131. var i = 0;
  132. var F = function () {};
  133. return {
  134. s: F,
  135. n: function () {
  136. if (i >= o.length) return {
  137. done: true
  138. };
  139. return {
  140. done: false,
  141. value: o[i++]
  142. };
  143. },
  144. e: function (e) {
  145. throw e;
  146. },
  147. f: F
  148. };
  149. }
  150. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  151. }
  152. var normalCompletion = true,
  153. didErr = false,
  154. err;
  155. return {
  156. s: function () {
  157. it = o[Symbol.iterator]();
  158. },
  159. n: function () {
  160. var step = it.next();
  161. normalCompletion = step.done;
  162. return step;
  163. },
  164. e: function (e) {
  165. didErr = true;
  166. err = e;
  167. },
  168. f: function () {
  169. try {
  170. if (!normalCompletion && it.return != null) it.return();
  171. } finally {
  172. if (didErr) throw err;
  173. }
  174. }
  175. };
  176. }
  177. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  178. function createCommonjsModule(fn, module) {
  179. return module = { exports: {} }, fn(module, module.exports), module.exports;
  180. }
  181. var check = function (it) {
  182. return it && it.Math == Math && it;
  183. };
  184. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  185. var global_1 =
  186. /* global globalThis -- safe */
  187. check(typeof globalThis == 'object' && globalThis) ||
  188. check(typeof window == 'object' && window) ||
  189. check(typeof self == 'object' && self) ||
  190. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  191. // eslint-disable-next-line no-new-func -- fallback
  192. (function () { return this; })() || Function('return this')();
  193. var fails = function (exec) {
  194. try {
  195. return !!exec();
  196. } catch (error) {
  197. return true;
  198. }
  199. };
  200. // Detect IE8's incomplete defineProperty implementation
  201. var descriptors = !fails(function () {
  202. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  203. });
  204. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  205. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  206. // Nashorn ~ JDK8 bug
  207. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  208. // `Object.prototype.propertyIsEnumerable` method implementation
  209. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  210. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  211. var descriptor = getOwnPropertyDescriptor$1(this, V);
  212. return !!descriptor && descriptor.enumerable;
  213. } : nativePropertyIsEnumerable;
  214. var objectPropertyIsEnumerable = {
  215. f: f$4
  216. };
  217. var createPropertyDescriptor = function (bitmap, value) {
  218. return {
  219. enumerable: !(bitmap & 1),
  220. configurable: !(bitmap & 2),
  221. writable: !(bitmap & 4),
  222. value: value
  223. };
  224. };
  225. var toString = {}.toString;
  226. var classofRaw = function (it) {
  227. return toString.call(it).slice(8, -1);
  228. };
  229. var split = ''.split;
  230. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  231. var indexedObject = fails(function () {
  232. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  233. // eslint-disable-next-line no-prototype-builtins -- safe
  234. return !Object('z').propertyIsEnumerable(0);
  235. }) ? function (it) {
  236. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  237. } : Object;
  238. // `RequireObjectCoercible` abstract operation
  239. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  240. var requireObjectCoercible = function (it) {
  241. if (it == undefined) throw TypeError("Can't call method on " + it);
  242. return it;
  243. };
  244. // toObject with fallback for non-array-like ES3 strings
  245. var toIndexedObject = function (it) {
  246. return indexedObject(requireObjectCoercible(it));
  247. };
  248. var isObject = function (it) {
  249. return typeof it === 'object' ? it !== null : typeof it === 'function';
  250. };
  251. // `ToPrimitive` abstract operation
  252. // https://tc39.es/ecma262/#sec-toprimitive
  253. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  254. // and the second argument - flag - preferred type is a string
  255. var toPrimitive = function (input, PREFERRED_STRING) {
  256. if (!isObject(input)) return input;
  257. var fn, val;
  258. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  259. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  260. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  261. throw TypeError("Can't convert object to primitive value");
  262. };
  263. var hasOwnProperty = {}.hasOwnProperty;
  264. var has$1 = function (it, key) {
  265. return hasOwnProperty.call(it, key);
  266. };
  267. var document$1 = global_1.document;
  268. // typeof document.createElement is 'object' in old IE
  269. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  270. var documentCreateElement = function (it) {
  271. return EXISTS ? document$1.createElement(it) : {};
  272. };
  273. // Thank's IE8 for his funny defineProperty
  274. var ie8DomDefine = !descriptors && !fails(function () {
  275. return Object.defineProperty(documentCreateElement('div'), 'a', {
  276. get: function () { return 7; }
  277. }).a != 7;
  278. });
  279. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  280. // `Object.getOwnPropertyDescriptor` method
  281. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  282. var f$3 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  283. O = toIndexedObject(O);
  284. P = toPrimitive(P, true);
  285. if (ie8DomDefine) try {
  286. return nativeGetOwnPropertyDescriptor(O, P);
  287. } catch (error) { /* empty */ }
  288. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  289. };
  290. var objectGetOwnPropertyDescriptor = {
  291. f: f$3
  292. };
  293. var anObject = function (it) {
  294. if (!isObject(it)) {
  295. throw TypeError(String(it) + ' is not an object');
  296. } return it;
  297. };
  298. var nativeDefineProperty = Object.defineProperty;
  299. // `Object.defineProperty` method
  300. // https://tc39.es/ecma262/#sec-object.defineproperty
  301. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  302. anObject(O);
  303. P = toPrimitive(P, true);
  304. anObject(Attributes);
  305. if (ie8DomDefine) try {
  306. return nativeDefineProperty(O, P, Attributes);
  307. } catch (error) { /* empty */ }
  308. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  309. if ('value' in Attributes) O[P] = Attributes.value;
  310. return O;
  311. };
  312. var objectDefineProperty = {
  313. f: f$2
  314. };
  315. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  316. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  317. } : function (object, key, value) {
  318. object[key] = value;
  319. return object;
  320. };
  321. var setGlobal = function (key, value) {
  322. try {
  323. createNonEnumerableProperty(global_1, key, value);
  324. } catch (error) {
  325. global_1[key] = value;
  326. } return value;
  327. };
  328. var SHARED = '__core-js_shared__';
  329. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  330. var sharedStore = store$1;
  331. var functionToString = Function.toString;
  332. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  333. if (typeof sharedStore.inspectSource != 'function') {
  334. sharedStore.inspectSource = function (it) {
  335. return functionToString.call(it);
  336. };
  337. }
  338. var inspectSource = sharedStore.inspectSource;
  339. var WeakMap$1 = global_1.WeakMap;
  340. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  341. var shared = createCommonjsModule(function (module) {
  342. (module.exports = function (key, value) {
  343. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  344. })('versions', []).push({
  345. version: '3.9.1',
  346. mode: 'global',
  347. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  348. });
  349. });
  350. var id = 0;
  351. var postfix = Math.random();
  352. var uid = function (key) {
  353. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  354. };
  355. var keys = shared('keys');
  356. var sharedKey = function (key) {
  357. return keys[key] || (keys[key] = uid(key));
  358. };
  359. var hiddenKeys$1 = {};
  360. var WeakMap = global_1.WeakMap;
  361. var set, get, has;
  362. var enforce = function (it) {
  363. return has(it) ? get(it) : set(it, {});
  364. };
  365. var getterFor = function (TYPE) {
  366. return function (it) {
  367. var state;
  368. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  369. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  370. } return state;
  371. };
  372. };
  373. if (nativeWeakMap) {
  374. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  375. var wmget = store.get;
  376. var wmhas = store.has;
  377. var wmset = store.set;
  378. set = function (it, metadata) {
  379. metadata.facade = it;
  380. wmset.call(store, it, metadata);
  381. return metadata;
  382. };
  383. get = function (it) {
  384. return wmget.call(store, it) || {};
  385. };
  386. has = function (it) {
  387. return wmhas.call(store, it);
  388. };
  389. } else {
  390. var STATE = sharedKey('state');
  391. hiddenKeys$1[STATE] = true;
  392. set = function (it, metadata) {
  393. metadata.facade = it;
  394. createNonEnumerableProperty(it, STATE, metadata);
  395. return metadata;
  396. };
  397. get = function (it) {
  398. return has$1(it, STATE) ? it[STATE] : {};
  399. };
  400. has = function (it) {
  401. return has$1(it, STATE);
  402. };
  403. }
  404. var internalState = {
  405. set: set,
  406. get: get,
  407. has: has,
  408. enforce: enforce,
  409. getterFor: getterFor
  410. };
  411. var redefine = createCommonjsModule(function (module) {
  412. var getInternalState = internalState.get;
  413. var enforceInternalState = internalState.enforce;
  414. var TEMPLATE = String(String).split('String');
  415. (module.exports = function (O, key, value, options) {
  416. var unsafe = options ? !!options.unsafe : false;
  417. var simple = options ? !!options.enumerable : false;
  418. var noTargetGet = options ? !!options.noTargetGet : false;
  419. var state;
  420. if (typeof value == 'function') {
  421. if (typeof key == 'string' && !has$1(value, 'name')) {
  422. createNonEnumerableProperty(value, 'name', key);
  423. }
  424. state = enforceInternalState(value);
  425. if (!state.source) {
  426. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  427. }
  428. }
  429. if (O === global_1) {
  430. if (simple) O[key] = value;
  431. else setGlobal(key, value);
  432. return;
  433. } else if (!unsafe) {
  434. delete O[key];
  435. } else if (!noTargetGet && O[key]) {
  436. simple = true;
  437. }
  438. if (simple) O[key] = value;
  439. else createNonEnumerableProperty(O, key, value);
  440. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  441. })(Function.prototype, 'toString', function toString() {
  442. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  443. });
  444. });
  445. var path = global_1;
  446. var aFunction$1 = function (variable) {
  447. return typeof variable == 'function' ? variable : undefined;
  448. };
  449. var getBuiltIn = function (namespace, method) {
  450. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  451. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  452. };
  453. var ceil = Math.ceil;
  454. var floor = Math.floor;
  455. // `ToInteger` abstract operation
  456. // https://tc39.es/ecma262/#sec-tointeger
  457. var toInteger = function (argument) {
  458. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  459. };
  460. var min$1 = Math.min;
  461. // `ToLength` abstract operation
  462. // https://tc39.es/ecma262/#sec-tolength
  463. var toLength = function (argument) {
  464. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  465. };
  466. var max$1 = Math.max;
  467. var min = Math.min;
  468. // Helper for a popular repeating case of the spec:
  469. // Let integer be ? ToInteger(index).
  470. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  471. var toAbsoluteIndex = function (index, length) {
  472. var integer = toInteger(index);
  473. return integer < 0 ? max$1(integer + length, 0) : min(integer, length);
  474. };
  475. // `Array.prototype.{ indexOf, includes }` methods implementation
  476. var createMethod$1 = function (IS_INCLUDES) {
  477. return function ($this, el, fromIndex) {
  478. var O = toIndexedObject($this);
  479. var length = toLength(O.length);
  480. var index = toAbsoluteIndex(fromIndex, length);
  481. var value;
  482. // Array#includes uses SameValueZero equality algorithm
  483. // eslint-disable-next-line no-self-compare -- NaN check
  484. if (IS_INCLUDES && el != el) while (length > index) {
  485. value = O[index++];
  486. // eslint-disable-next-line no-self-compare -- NaN check
  487. if (value != value) return true;
  488. // Array#indexOf ignores holes, Array#includes - not
  489. } else for (;length > index; index++) {
  490. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  491. } return !IS_INCLUDES && -1;
  492. };
  493. };
  494. var arrayIncludes = {
  495. // `Array.prototype.includes` method
  496. // https://tc39.es/ecma262/#sec-array.prototype.includes
  497. includes: createMethod$1(true),
  498. // `Array.prototype.indexOf` method
  499. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  500. indexOf: createMethod$1(false)
  501. };
  502. var indexOf = arrayIncludes.indexOf;
  503. var objectKeysInternal = function (object, names) {
  504. var O = toIndexedObject(object);
  505. var i = 0;
  506. var result = [];
  507. var key;
  508. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  509. // Don't enum bug & hidden keys
  510. while (names.length > i) if (has$1(O, key = names[i++])) {
  511. ~indexOf(result, key) || result.push(key);
  512. }
  513. return result;
  514. };
  515. // IE8- don't enum bug keys
  516. var enumBugKeys = [
  517. 'constructor',
  518. 'hasOwnProperty',
  519. 'isPrototypeOf',
  520. 'propertyIsEnumerable',
  521. 'toLocaleString',
  522. 'toString',
  523. 'valueOf'
  524. ];
  525. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  526. // `Object.getOwnPropertyNames` method
  527. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  528. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  529. return objectKeysInternal(O, hiddenKeys);
  530. };
  531. var objectGetOwnPropertyNames = {
  532. f: f$1
  533. };
  534. var f = Object.getOwnPropertySymbols;
  535. var objectGetOwnPropertySymbols = {
  536. f: f
  537. };
  538. // all object keys, includes non-enumerable and symbols
  539. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  540. var keys = objectGetOwnPropertyNames.f(anObject(it));
  541. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  542. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  543. };
  544. var copyConstructorProperties = function (target, source) {
  545. var keys = ownKeys(source);
  546. var defineProperty = objectDefineProperty.f;
  547. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  548. for (var i = 0; i < keys.length; i++) {
  549. var key = keys[i];
  550. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  551. }
  552. };
  553. var replacement = /#|\.prototype\./;
  554. var isForced = function (feature, detection) {
  555. var value = data[normalize(feature)];
  556. return value == POLYFILL ? true
  557. : value == NATIVE ? false
  558. : typeof detection == 'function' ? fails(detection)
  559. : !!detection;
  560. };
  561. var normalize = isForced.normalize = function (string) {
  562. return String(string).replace(replacement, '.').toLowerCase();
  563. };
  564. var data = isForced.data = {};
  565. var NATIVE = isForced.NATIVE = 'N';
  566. var POLYFILL = isForced.POLYFILL = 'P';
  567. var isForced_1 = isForced;
  568. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  569. /*
  570. options.target - name of the target object
  571. options.global - target is the global object
  572. options.stat - export as static methods of target
  573. options.proto - export as prototype methods of target
  574. options.real - real prototype method for the `pure` version
  575. options.forced - export even if the native feature is available
  576. options.bind - bind methods to the target, required for the `pure` version
  577. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  578. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  579. options.sham - add a flag to not completely full polyfills
  580. options.enumerable - export as enumerable property
  581. options.noTargetGet - prevent calling a getter on target
  582. */
  583. var _export = function (options, source) {
  584. var TARGET = options.target;
  585. var GLOBAL = options.global;
  586. var STATIC = options.stat;
  587. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  588. if (GLOBAL) {
  589. target = global_1;
  590. } else if (STATIC) {
  591. target = global_1[TARGET] || setGlobal(TARGET, {});
  592. } else {
  593. target = (global_1[TARGET] || {}).prototype;
  594. }
  595. if (target) for (key in source) {
  596. sourceProperty = source[key];
  597. if (options.noTargetGet) {
  598. descriptor = getOwnPropertyDescriptor(target, key);
  599. targetProperty = descriptor && descriptor.value;
  600. } else targetProperty = target[key];
  601. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  602. // contained in target
  603. if (!FORCED && targetProperty !== undefined) {
  604. if (typeof sourceProperty === typeof targetProperty) continue;
  605. copyConstructorProperties(sourceProperty, targetProperty);
  606. }
  607. // add a flag to not completely full polyfills
  608. if (options.sham || (targetProperty && targetProperty.sham)) {
  609. createNonEnumerableProperty(sourceProperty, 'sham', true);
  610. }
  611. // extend global
  612. redefine(target, key, sourceProperty, options);
  613. }
  614. };
  615. // `IsArray` abstract operation
  616. // https://tc39.es/ecma262/#sec-isarray
  617. var isArray = Array.isArray || function isArray(arg) {
  618. return classofRaw(arg) == 'Array';
  619. };
  620. // `ToObject` abstract operation
  621. // https://tc39.es/ecma262/#sec-toobject
  622. var toObject = function (argument) {
  623. return Object(requireObjectCoercible(argument));
  624. };
  625. var createProperty = function (object, key, value) {
  626. var propertyKey = toPrimitive(key);
  627. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  628. else object[propertyKey] = value;
  629. };
  630. var engineIsNode = classofRaw(global_1.process) == 'process';
  631. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  632. var process = global_1.process;
  633. var versions = process && process.versions;
  634. var v8 = versions && versions.v8;
  635. var match, version;
  636. if (v8) {
  637. match = v8.split('.');
  638. version = match[0] + match[1];
  639. } else if (engineUserAgent) {
  640. match = engineUserAgent.match(/Edge\/(\d+)/);
  641. if (!match || match[1] >= 74) {
  642. match = engineUserAgent.match(/Chrome\/(\d+)/);
  643. if (match) version = match[1];
  644. }
  645. }
  646. var engineV8Version = version && +version;
  647. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  648. /* global Symbol -- required for testing */
  649. return !Symbol.sham &&
  650. // Chrome 38 Symbol has incorrect toString conversion
  651. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  652. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  653. });
  654. var useSymbolAsUid = nativeSymbol
  655. /* global Symbol -- safe */
  656. && !Symbol.sham
  657. && typeof Symbol.iterator == 'symbol';
  658. var WellKnownSymbolsStore = shared('wks');
  659. var Symbol$1 = global_1.Symbol;
  660. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  661. var wellKnownSymbol = function (name) {
  662. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  663. if (nativeSymbol && has$1(Symbol$1, name)) {
  664. WellKnownSymbolsStore[name] = Symbol$1[name];
  665. } else {
  666. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  667. }
  668. } return WellKnownSymbolsStore[name];
  669. };
  670. var SPECIES$2 = wellKnownSymbol('species');
  671. // `ArraySpeciesCreate` abstract operation
  672. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  673. var arraySpeciesCreate = function (originalArray, length) {
  674. var C;
  675. if (isArray(originalArray)) {
  676. C = originalArray.constructor;
  677. // cross-realm fallback
  678. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  679. else if (isObject(C)) {
  680. C = C[SPECIES$2];
  681. if (C === null) C = undefined;
  682. }
  683. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  684. };
  685. var SPECIES$1 = wellKnownSymbol('species');
  686. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  687. // We can't use this feature detection in V8 since it causes
  688. // deoptimization and serious performance degradation
  689. // https://github.com/zloirock/core-js/issues/677
  690. return engineV8Version >= 51 || !fails(function () {
  691. var array = [];
  692. var constructor = array.constructor = {};
  693. constructor[SPECIES$1] = function () {
  694. return { foo: 1 };
  695. };
  696. return array[METHOD_NAME](Boolean).foo !== 1;
  697. });
  698. };
  699. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  700. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  701. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  702. // We can't use this feature detection in V8 since it causes
  703. // deoptimization and serious performance degradation
  704. // https://github.com/zloirock/core-js/issues/679
  705. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  706. var array = [];
  707. array[IS_CONCAT_SPREADABLE] = false;
  708. return array.concat()[0] !== array;
  709. });
  710. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  711. var isConcatSpreadable = function (O) {
  712. if (!isObject(O)) return false;
  713. var spreadable = O[IS_CONCAT_SPREADABLE];
  714. return spreadable !== undefined ? !!spreadable : isArray(O);
  715. };
  716. var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  717. // `Array.prototype.concat` method
  718. // https://tc39.es/ecma262/#sec-array.prototype.concat
  719. // with adding support of @@isConcatSpreadable and @@species
  720. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  721. // eslint-disable-next-line no-unused-vars -- required for `.length`
  722. concat: function concat(arg) {
  723. var O = toObject(this);
  724. var A = arraySpeciesCreate(O, 0);
  725. var n = 0;
  726. var i, k, length, len, E;
  727. for (i = -1, length = arguments.length; i < length; i++) {
  728. E = i === -1 ? O : arguments[i];
  729. if (isConcatSpreadable(E)) {
  730. len = toLength(E.length);
  731. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  732. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  733. } else {
  734. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  735. createProperty(A, n++, E);
  736. }
  737. }
  738. A.length = n;
  739. return A;
  740. }
  741. });
  742. // `Object.keys` method
  743. // https://tc39.es/ecma262/#sec-object.keys
  744. var objectKeys = Object.keys || function keys(O) {
  745. return objectKeysInternal(O, enumBugKeys);
  746. };
  747. var nativeAssign = Object.assign;
  748. var defineProperty = Object.defineProperty;
  749. // `Object.assign` method
  750. // https://tc39.es/ecma262/#sec-object.assign
  751. var objectAssign = !nativeAssign || fails(function () {
  752. // should have correct order of operations (Edge bug)
  753. if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
  754. enumerable: true,
  755. get: function () {
  756. defineProperty(this, 'b', {
  757. value: 3,
  758. enumerable: false
  759. });
  760. }
  761. }), { b: 2 })).b !== 1) return true;
  762. // should work with symbols and should have deterministic property order (V8 bug)
  763. var A = {};
  764. var B = {};
  765. /* global Symbol -- required for testing */
  766. var symbol = Symbol();
  767. var alphabet = 'abcdefghijklmnopqrst';
  768. A[symbol] = 7;
  769. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  770. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  771. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  772. var T = toObject(target);
  773. var argumentsLength = arguments.length;
  774. var index = 1;
  775. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  776. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  777. while (argumentsLength > index) {
  778. var S = indexedObject(arguments[index++]);
  779. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  780. var length = keys.length;
  781. var j = 0;
  782. var key;
  783. while (length > j) {
  784. key = keys[j++];
  785. if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  786. }
  787. } return T;
  788. } : nativeAssign;
  789. // `Object.assign` method
  790. // https://tc39.es/ecma262/#sec-object.assign
  791. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  792. assign: objectAssign
  793. });
  794. var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('slice');
  795. var SPECIES = wellKnownSymbol('species');
  796. var nativeSlice = [].slice;
  797. var max = Math.max;
  798. // `Array.prototype.slice` method
  799. // https://tc39.es/ecma262/#sec-array.prototype.slice
  800. // fallback for not array-like ES3 strings and DOM objects
  801. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
  802. slice: function slice(start, end) {
  803. var O = toIndexedObject(this);
  804. var length = toLength(O.length);
  805. var k = toAbsoluteIndex(start, length);
  806. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  807. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  808. var Constructor, result, n;
  809. if (isArray(O)) {
  810. Constructor = O.constructor;
  811. // cross-realm fallback
  812. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  813. Constructor = undefined;
  814. } else if (isObject(Constructor)) {
  815. Constructor = Constructor[SPECIES];
  816. if (Constructor === null) Constructor = undefined;
  817. }
  818. if (Constructor === Array || Constructor === undefined) {
  819. return nativeSlice.call(O, k, fin);
  820. }
  821. }
  822. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  823. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  824. result.length = n;
  825. return result;
  826. }
  827. });
  828. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  829. var method = [][METHOD_NAME];
  830. return !!method && fails(function () {
  831. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  832. method.call(null, argument || function () { throw 1; }, 1);
  833. });
  834. };
  835. var $indexOf = arrayIncludes.indexOf;
  836. var nativeIndexOf = [].indexOf;
  837. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  838. var STRICT_METHOD$2 = arrayMethodIsStrict('indexOf');
  839. // `Array.prototype.indexOf` method
  840. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  841. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$2 }, {
  842. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  843. return NEGATIVE_ZERO
  844. // convert -0 to +0
  845. ? nativeIndexOf.apply(this, arguments) || 0
  846. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  847. }
  848. });
  849. var aFunction = function (it) {
  850. if (typeof it != 'function') {
  851. throw TypeError(String(it) + ' is not a function');
  852. } return it;
  853. };
  854. // optional / simple context binding
  855. var functionBindContext = function (fn, that, length) {
  856. aFunction(fn);
  857. if (that === undefined) return fn;
  858. switch (length) {
  859. case 0: return function () {
  860. return fn.call(that);
  861. };
  862. case 1: return function (a) {
  863. return fn.call(that, a);
  864. };
  865. case 2: return function (a, b) {
  866. return fn.call(that, a, b);
  867. };
  868. case 3: return function (a, b, c) {
  869. return fn.call(that, a, b, c);
  870. };
  871. }
  872. return function (/* ...args */) {
  873. return fn.apply(that, arguments);
  874. };
  875. };
  876. // `FlattenIntoArray` abstract operation
  877. // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
  878. var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
  879. var targetIndex = start;
  880. var sourceIndex = 0;
  881. var mapFn = mapper ? functionBindContext(mapper, thisArg, 3) : false;
  882. var element;
  883. while (sourceIndex < sourceLen) {
  884. if (sourceIndex in source) {
  885. element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
  886. if (depth > 0 && isArray(element)) {
  887. targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
  888. } else {
  889. if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
  890. target[targetIndex] = element;
  891. }
  892. targetIndex++;
  893. }
  894. sourceIndex++;
  895. }
  896. return targetIndex;
  897. };
  898. var flattenIntoArray_1 = flattenIntoArray;
  899. // `Array.prototype.flat` method
  900. // https://tc39.es/ecma262/#sec-array.prototype.flat
  901. _export({ target: 'Array', proto: true }, {
  902. flat: function flat(/* depthArg = 1 */) {
  903. var depthArg = arguments.length ? arguments[0] : undefined;
  904. var O = toObject(this);
  905. var sourceLen = toLength(O.length);
  906. var A = arraySpeciesCreate(O, 0);
  907. A.length = flattenIntoArray_1(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
  908. return A;
  909. }
  910. });
  911. var test = [];
  912. var nativeSort = test.sort;
  913. // IE8-
  914. var FAILS_ON_UNDEFINED = fails(function () {
  915. test.sort(undefined);
  916. });
  917. // V8 bug
  918. var FAILS_ON_NULL = fails(function () {
  919. test.sort(null);
  920. });
  921. // Old WebKit
  922. var STRICT_METHOD$1 = arrayMethodIsStrict('sort');
  923. var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1;
  924. // `Array.prototype.sort` method
  925. // https://tc39.es/ecma262/#sec-array.prototype.sort
  926. _export({ target: 'Array', proto: true, forced: FORCED }, {
  927. sort: function sort(comparefn) {
  928. return comparefn === undefined
  929. ? nativeSort.call(toObject(this))
  930. : nativeSort.call(toObject(this), aFunction(comparefn));
  931. }
  932. });
  933. // `Object.defineProperties` method
  934. // https://tc39.es/ecma262/#sec-object.defineproperties
  935. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  936. anObject(O);
  937. var keys = objectKeys(Properties);
  938. var length = keys.length;
  939. var index = 0;
  940. var key;
  941. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  942. return O;
  943. };
  944. var html = getBuiltIn('document', 'documentElement');
  945. var GT = '>';
  946. var LT = '<';
  947. var PROTOTYPE = 'prototype';
  948. var SCRIPT = 'script';
  949. var IE_PROTO = sharedKey('IE_PROTO');
  950. var EmptyConstructor = function () { /* empty */ };
  951. var scriptTag = function (content) {
  952. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  953. };
  954. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  955. var NullProtoObjectViaActiveX = function (activeXDocument) {
  956. activeXDocument.write(scriptTag(''));
  957. activeXDocument.close();
  958. var temp = activeXDocument.parentWindow.Object;
  959. activeXDocument = null; // avoid memory leak
  960. return temp;
  961. };
  962. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  963. var NullProtoObjectViaIFrame = function () {
  964. // Thrash, waste and sodomy: IE GC bug
  965. var iframe = documentCreateElement('iframe');
  966. var JS = 'java' + SCRIPT + ':';
  967. var iframeDocument;
  968. iframe.style.display = 'none';
  969. html.appendChild(iframe);
  970. // https://github.com/zloirock/core-js/issues/475
  971. iframe.src = String(JS);
  972. iframeDocument = iframe.contentWindow.document;
  973. iframeDocument.open();
  974. iframeDocument.write(scriptTag('document.F=Object'));
  975. iframeDocument.close();
  976. return iframeDocument.F;
  977. };
  978. // Check for document.domain and active x support
  979. // No need to use active x approach when document.domain is not set
  980. // see https://github.com/es-shims/es5-shim/issues/150
  981. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  982. // avoid IE GC bug
  983. var activeXDocument;
  984. var NullProtoObject = function () {
  985. try {
  986. /* global ActiveXObject -- old IE */
  987. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  988. } catch (error) { /* ignore */ }
  989. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  990. var length = enumBugKeys.length;
  991. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  992. return NullProtoObject();
  993. };
  994. hiddenKeys$1[IE_PROTO] = true;
  995. // `Object.create` method
  996. // https://tc39.es/ecma262/#sec-object.create
  997. var objectCreate = Object.create || function create(O, Properties) {
  998. var result;
  999. if (O !== null) {
  1000. EmptyConstructor[PROTOTYPE] = anObject(O);
  1001. result = new EmptyConstructor();
  1002. EmptyConstructor[PROTOTYPE] = null;
  1003. // add "__proto__" for Object.getPrototypeOf polyfill
  1004. result[IE_PROTO] = O;
  1005. } else result = NullProtoObject();
  1006. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  1007. };
  1008. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1009. var ArrayPrototype = Array.prototype;
  1010. // Array.prototype[@@unscopables]
  1011. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1012. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1013. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1014. configurable: true,
  1015. value: objectCreate(null)
  1016. });
  1017. }
  1018. // add a key to Array.prototype[@@unscopables]
  1019. var addToUnscopables = function (key) {
  1020. ArrayPrototype[UNSCOPABLES][key] = true;
  1021. };
  1022. var $includes = arrayIncludes.includes;
  1023. // `Array.prototype.includes` method
  1024. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1025. _export({ target: 'Array', proto: true }, {
  1026. includes: function includes(el /* , fromIndex = 0 */) {
  1027. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1028. }
  1029. });
  1030. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1031. addToUnscopables('includes');
  1032. var push = [].push;
  1033. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  1034. var createMethod = function (TYPE) {
  1035. var IS_MAP = TYPE == 1;
  1036. var IS_FILTER = TYPE == 2;
  1037. var IS_SOME = TYPE == 3;
  1038. var IS_EVERY = TYPE == 4;
  1039. var IS_FIND_INDEX = TYPE == 6;
  1040. var IS_FILTER_OUT = TYPE == 7;
  1041. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1042. return function ($this, callbackfn, that, specificCreate) {
  1043. var O = toObject($this);
  1044. var self = indexedObject(O);
  1045. var boundFunction = functionBindContext(callbackfn, that, 3);
  1046. var length = toLength(self.length);
  1047. var index = 0;
  1048. var create = specificCreate || arraySpeciesCreate;
  1049. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  1050. var value, result;
  1051. for (;length > index; index++) if (NO_HOLES || index in self) {
  1052. value = self[index];
  1053. result = boundFunction(value, index, O);
  1054. if (TYPE) {
  1055. if (IS_MAP) target[index] = result; // map
  1056. else if (result) switch (TYPE) {
  1057. case 3: return true; // some
  1058. case 5: return value; // find
  1059. case 6: return index; // findIndex
  1060. case 2: push.call(target, value); // filter
  1061. } else switch (TYPE) {
  1062. case 4: return false; // every
  1063. case 7: push.call(target, value); // filterOut
  1064. }
  1065. }
  1066. }
  1067. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1068. };
  1069. };
  1070. var arrayIteration = {
  1071. // `Array.prototype.forEach` method
  1072. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1073. forEach: createMethod(0),
  1074. // `Array.prototype.map` method
  1075. // https://tc39.es/ecma262/#sec-array.prototype.map
  1076. map: createMethod(1),
  1077. // `Array.prototype.filter` method
  1078. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1079. filter: createMethod(2),
  1080. // `Array.prototype.some` method
  1081. // https://tc39.es/ecma262/#sec-array.prototype.some
  1082. some: createMethod(3),
  1083. // `Array.prototype.every` method
  1084. // https://tc39.es/ecma262/#sec-array.prototype.every
  1085. every: createMethod(4),
  1086. // `Array.prototype.find` method
  1087. // https://tc39.es/ecma262/#sec-array.prototype.find
  1088. find: createMethod(5),
  1089. // `Array.prototype.findIndex` method
  1090. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1091. findIndex: createMethod(6),
  1092. // `Array.prototype.filterOut` method
  1093. // https://github.com/tc39/proposal-array-filtering
  1094. filterOut: createMethod(7)
  1095. };
  1096. var $find = arrayIteration.find;
  1097. var FIND = 'find';
  1098. var SKIPS_HOLES = true;
  1099. // Shouldn't skip holes
  1100. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1101. // `Array.prototype.find` method
  1102. // https://tc39.es/ecma262/#sec-array.prototype.find
  1103. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1104. find: function find(callbackfn /* , that = undefined */) {
  1105. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1106. }
  1107. });
  1108. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1109. addToUnscopables(FIND);
  1110. var nativeJoin = [].join;
  1111. var ES3_STRINGS = indexedObject != Object;
  1112. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  1113. // `Array.prototype.join` method
  1114. // https://tc39.es/ecma262/#sec-array.prototype.join
  1115. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  1116. join: function join(separator) {
  1117. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1118. }
  1119. });
  1120. var $filter = arrayIteration.filter;
  1121. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('filter');
  1122. // `Array.prototype.filter` method
  1123. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1124. // with adding support of @@species
  1125. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1126. filter: function filter(callbackfn /* , thisArg */) {
  1127. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1128. }
  1129. });
  1130. var $map = arrayIteration.map;
  1131. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  1132. // `Array.prototype.map` method
  1133. // https://tc39.es/ecma262/#sec-array.prototype.map
  1134. // with adding support of @@species
  1135. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1136. map: function map(callbackfn /* , thisArg */) {
  1137. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1138. }
  1139. });
  1140. /**
  1141. * @update zhixin wen <wenzhixin2010@gmail.com>
  1142. */
  1143. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1144. function printPageBuilderDefault(table) {
  1145. return "\n <html>\n <head>\n <style type=\"text/css\" media=\"print\">\n @page {\n size: auto;\n margin: 25px 0 25px 0;\n }\n </style>\n <style type=\"text/css\" media=\"all\">\n table {\n border-collapse: collapse;\n font-size: 12px;\n }\n table, th, td {\n border: 1px solid grey;\n }\n th, td {\n text-align: center;\n vertical-align: middle;\n }\n p {\n font-weight: bold;\n margin-left:20px;\n }\n table {\n width:94%;\n margin-left:3%;\n margin-right:3%;\n }\n div.bs-table-print {\n text-align:center;\n }\n </style>\n </head>\n <title>Print Table</title>\n <body>\n <p>Printed on: ".concat(new Date(), " </p>\n <div class=\"bs-table-print\">").concat(table, "</div>\n </body>\n </html>");
  1146. }
  1147. $__default['default'].extend($__default['default'].fn.bootstrapTable.locales, {
  1148. formatPrint: function formatPrint() {
  1149. return 'Print';
  1150. }
  1151. });
  1152. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, $__default['default'].fn.bootstrapTable.locales);
  1153. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1154. showPrint: false,
  1155. printAsFilteredAndSortedOnUI: true,
  1156. printSortColumn: undefined,
  1157. printSortOrder: 'asc',
  1158. printPageBuilder: function printPageBuilder(table) {
  1159. return printPageBuilderDefault(table);
  1160. }
  1161. });
  1162. $__default['default'].extend($__default['default'].fn.bootstrapTable.COLUMN_DEFAULTS, {
  1163. printFilter: undefined,
  1164. printIgnore: false,
  1165. printFormatter: undefined
  1166. });
  1167. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults.icons, {
  1168. print: {
  1169. bootstrap3: 'glyphicon-print icon-share',
  1170. 'bootstrap-table': 'icon-printer'
  1171. }[$__default['default'].fn.bootstrapTable.theme] || 'fa-print'
  1172. });
  1173. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1174. _inherits(_class, _$$BootstrapTable);
  1175. var _super = _createSuper(_class);
  1176. function _class() {
  1177. _classCallCheck(this, _class);
  1178. return _super.apply(this, arguments);
  1179. }
  1180. _createClass(_class, [{
  1181. key: "init",
  1182. value: function init() {
  1183. var _get2;
  1184. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1185. args[_key] = arguments[_key];
  1186. }
  1187. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  1188. if (!this.options.showPrint) {
  1189. return;
  1190. }
  1191. this.mergedCells = [];
  1192. }
  1193. }, {
  1194. key: "initToolbar",
  1195. value: function initToolbar() {
  1196. var _this = this,
  1197. _get3;
  1198. this.showToolbar = this.showToolbar || this.options.showPrint;
  1199. if (this.options.showPrint) {
  1200. this.buttons = Object.assign(this.buttons, {
  1201. print: {
  1202. text: this.options.formatPrint(),
  1203. icon: this.options.icons.print,
  1204. event: function event() {
  1205. _this.doPrint(_this.options.printAsFilteredAndSortedOnUI ? _this.getData() : _this.options.data.slice(0));
  1206. },
  1207. attributes: {
  1208. 'aria-label': this.options.formatPrint(),
  1209. title: this.options.formatPrint()
  1210. }
  1211. }
  1212. });
  1213. }
  1214. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1215. args[_key2] = arguments[_key2];
  1216. }
  1217. (_get3 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get3, [this].concat(args));
  1218. }
  1219. }, {
  1220. key: "mergeCells",
  1221. value: function mergeCells(options) {
  1222. _get(_getPrototypeOf(_class.prototype), "mergeCells", this).call(this, options);
  1223. if (!this.options.showPrint) {
  1224. return;
  1225. }
  1226. var col = this.getVisibleFields().indexOf(options.field);
  1227. if (Utils.hasDetailViewIcon(this.options)) {
  1228. col += 1;
  1229. }
  1230. this.mergedCells.push({
  1231. row: options.index,
  1232. col: col,
  1233. rowspan: options.rowspan || 1,
  1234. colspan: options.colspan || 1
  1235. });
  1236. }
  1237. }, {
  1238. key: "doPrint",
  1239. value: function doPrint(data) {
  1240. var _this2 = this;
  1241. var formatValue = function formatValue(row, i, column) {
  1242. var value = Utils.calculateObjectValue(column, column.printFormatter, [row[column.field], row, i], row[column.field]);
  1243. return typeof value === 'undefined' || value === null ? _this2.options.undefinedText : value;
  1244. };
  1245. var buildTable = function buildTable(data, columnsArray) {
  1246. var dir = _this2.$el.attr('dir') || 'ltr';
  1247. var html = ["<table dir=\"".concat(dir, "\"><thead>")];
  1248. var _iterator = _createForOfIteratorHelper(columnsArray),
  1249. _step;
  1250. try {
  1251. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1252. var _columns2 = _step.value;
  1253. html.push('<tr>');
  1254. for (var _h = 0; _h < _columns2.length; _h++) {
  1255. if (!_columns2[_h].printIgnore) {
  1256. html.push("<th\n ".concat(Utils.sprintf(' rowspan="%s"', _columns2[_h].rowspan), "\n ").concat(Utils.sprintf(' colspan="%s"', _columns2[_h].colspan), "\n >").concat(_columns2[_h].title, "</th>"));
  1257. }
  1258. }
  1259. html.push('</tr>');
  1260. }
  1261. } catch (err) {
  1262. _iterator.e(err);
  1263. } finally {
  1264. _iterator.f();
  1265. }
  1266. html.push('</thead><tbody>');
  1267. var dontRender = [];
  1268. if (_this2.mergedCells) {
  1269. for (var mc = 0; mc < _this2.mergedCells.length; mc++) {
  1270. var currentMergedCell = _this2.mergedCells[mc];
  1271. for (var rs = 0; rs < currentMergedCell.rowspan; rs++) {
  1272. var row = currentMergedCell.row + rs;
  1273. for (var cs = 0; cs < currentMergedCell.colspan; cs++) {
  1274. var col = currentMergedCell.col + cs;
  1275. dontRender.push("".concat(row, ",").concat(col));
  1276. }
  1277. }
  1278. }
  1279. }
  1280. for (var i = 0; i < data.length; i++) {
  1281. html.push('<tr>');
  1282. var columns = columnsArray.flat(1);
  1283. columns.sort(function (c1, c2) {
  1284. return c1.colspanIndex - c2.colspanIndex;
  1285. });
  1286. for (var j = 0; j < columns.length; j++) {
  1287. if (columns[j].colspanGroup > 0) continue;
  1288. var rowspan = 0;
  1289. var colspan = 0;
  1290. if (_this2.mergedCells) {
  1291. for (var _mc = 0; _mc < _this2.mergedCells.length; _mc++) {
  1292. var _currentMergedCell = _this2.mergedCells[_mc];
  1293. if (_currentMergedCell.col === j && _currentMergedCell.row === i) {
  1294. rowspan = _currentMergedCell.rowspan;
  1295. colspan = _currentMergedCell.colspan;
  1296. }
  1297. }
  1298. }
  1299. if (!columns[j].printIgnore && columns[j].field && (!dontRender.includes("".concat(i, ",").concat(j)) || rowspan > 0 && colspan > 0)) {
  1300. if (rowspan > 0 && colspan > 0) {
  1301. html.push("<td ".concat(Utils.sprintf(' rowspan="%s"', rowspan), " ").concat(Utils.sprintf(' colspan="%s"', colspan), ">"), formatValue(data[i], i, columns[j]), '</td>');
  1302. } else {
  1303. html.push('<td>', formatValue(data[i], i, columns[j]), '</td>');
  1304. }
  1305. }
  1306. }
  1307. html.push('</tr>');
  1308. }
  1309. html.push('</tbody>');
  1310. if (_this2.options.showFooter) {
  1311. html.push('<footer><tr>');
  1312. var _iterator2 = _createForOfIteratorHelper(columnsArray),
  1313. _step2;
  1314. try {
  1315. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  1316. var _columns = _step2.value;
  1317. for (var h = 0; h < _columns.length; h++) {
  1318. if (!_columns[h].printIgnore) {
  1319. var footerData = Utils.trToData(_columns, _this2.$el.find('>tfoot>tr'));
  1320. var footerValue = Utils.calculateObjectValue(_columns[h], _columns[h].footerFormatter, [data], footerData[0] && footerData[0][_columns[h].field] || '');
  1321. html.push("<th>".concat(footerValue, "</th>"));
  1322. }
  1323. }
  1324. }
  1325. } catch (err) {
  1326. _iterator2.e(err);
  1327. } finally {
  1328. _iterator2.f();
  1329. }
  1330. html.push('</tr></footer>');
  1331. }
  1332. html.push('</table>');
  1333. return html.join('');
  1334. };
  1335. var sortRows = function sortRows(data, colName, sortOrder) {
  1336. if (!colName) {
  1337. return data;
  1338. }
  1339. var reverse = sortOrder !== 'asc';
  1340. reverse = -(+reverse || -1);
  1341. return data.sort(function (a, b) {
  1342. return reverse * a[colName].localeCompare(b[colName]);
  1343. });
  1344. };
  1345. var filterRow = function filterRow(row, filters) {
  1346. for (var index = 0; index < filters.length; ++index) {
  1347. if (row[filters[index].colName] !== filters[index].value) {
  1348. return false;
  1349. }
  1350. }
  1351. return true;
  1352. };
  1353. var filterRows = function filterRows(data, filters) {
  1354. return data.filter(function (row) {
  1355. return filterRow(row, filters);
  1356. });
  1357. };
  1358. var getColumnFilters = function getColumnFilters(columns) {
  1359. return !columns || !columns[0] ? [] : columns[0].filter(function (col) {
  1360. return col.printFilter;
  1361. }).map(function (col) {
  1362. return {
  1363. colName: col.field,
  1364. value: col.printFilter
  1365. };
  1366. });
  1367. };
  1368. data = filterRows(data, getColumnFilters(this.options.columns));
  1369. data = sortRows(data, this.options.printSortColumn, this.options.printSortOrder);
  1370. var table = buildTable(data, this.options.columns);
  1371. var newWin = window.open('');
  1372. newWin.document.write(this.options.printPageBuilder.call(this, table));
  1373. newWin.document.close();
  1374. newWin.focus();
  1375. newWin.print();
  1376. newWin.close();
  1377. }
  1378. }]);
  1379. return _class;
  1380. }($__default['default'].BootstrapTable);
  1381. })));