bootstrap-table-cookie.js 88 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546
  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$1 = 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$1 : ceil)(argument);
  459. };
  460. var min$3 = Math.min;
  461. // `ToLength` abstract operation
  462. // https://tc39.es/ecma262/#sec-tolength
  463. var toLength = function (argument) {
  464. return argument > 0 ? min$3(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  465. };
  466. var max$1 = Math.max;
  467. var min$2 = 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$2(integer, length);
  474. };
  475. // `Array.prototype.{ indexOf, includes }` methods implementation
  476. var createMethod$2 = 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$2(true),
  498. // `Array.prototype.indexOf` method
  499. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  500. indexOf: createMethod$2(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$3 = 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$3];
  681. if (C === null) C = undefined;
  682. }
  683. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  684. };
  685. var SPECIES$2 = 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$2] = 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 = !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 }, {
  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. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  743. var method = [][METHOD_NAME];
  744. return !!method && fails(function () {
  745. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  746. method.call(null, argument || function () { throw 1; }, 1);
  747. });
  748. };
  749. var nativeJoin = [].join;
  750. var ES3_STRINGS = indexedObject != Object;
  751. var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
  752. // `Array.prototype.join` method
  753. // https://tc39.es/ecma262/#sec-array.prototype.join
  754. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
  755. join: function join(separator) {
  756. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  757. }
  758. });
  759. // `RegExp.prototype.flags` getter implementation
  760. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  761. var regexpFlags = function () {
  762. var that = anObject(this);
  763. var result = '';
  764. if (that.global) result += 'g';
  765. if (that.ignoreCase) result += 'i';
  766. if (that.multiline) result += 'm';
  767. if (that.dotAll) result += 's';
  768. if (that.unicode) result += 'u';
  769. if (that.sticky) result += 'y';
  770. return result;
  771. };
  772. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  773. // so we use an intermediate function.
  774. function RE(s, f) {
  775. return RegExp(s, f);
  776. }
  777. var UNSUPPORTED_Y$1 = fails(function () {
  778. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  779. var re = RE('a', 'y');
  780. re.lastIndex = 2;
  781. return re.exec('abcd') != null;
  782. });
  783. var BROKEN_CARET = fails(function () {
  784. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  785. var re = RE('^r', 'gy');
  786. re.lastIndex = 2;
  787. return re.exec('str') != null;
  788. });
  789. var regexpStickyHelpers = {
  790. UNSUPPORTED_Y: UNSUPPORTED_Y$1,
  791. BROKEN_CARET: BROKEN_CARET
  792. };
  793. var nativeExec = RegExp.prototype.exec;
  794. // This always refers to the native implementation, because the
  795. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  796. // which loads this file before patching the method.
  797. var nativeReplace = String.prototype.replace;
  798. var patchedExec = nativeExec;
  799. var UPDATES_LAST_INDEX_WRONG = (function () {
  800. var re1 = /a/;
  801. var re2 = /b*/g;
  802. nativeExec.call(re1, 'a');
  803. nativeExec.call(re2, 'a');
  804. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  805. })();
  806. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  807. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  808. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  809. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  810. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  811. if (PATCH) {
  812. patchedExec = function exec(str) {
  813. var re = this;
  814. var lastIndex, reCopy, match, i;
  815. var sticky = UNSUPPORTED_Y && re.sticky;
  816. var flags = regexpFlags.call(re);
  817. var source = re.source;
  818. var charsAdded = 0;
  819. var strCopy = str;
  820. if (sticky) {
  821. flags = flags.replace('y', '');
  822. if (flags.indexOf('g') === -1) {
  823. flags += 'g';
  824. }
  825. strCopy = String(str).slice(re.lastIndex);
  826. // Support anchored sticky behavior.
  827. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  828. source = '(?: ' + source + ')';
  829. strCopy = ' ' + strCopy;
  830. charsAdded++;
  831. }
  832. // ^(? + rx + ) is needed, in combination with some str slicing, to
  833. // simulate the 'y' flag.
  834. reCopy = new RegExp('^(?:' + source + ')', flags);
  835. }
  836. if (NPCG_INCLUDED) {
  837. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  838. }
  839. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  840. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  841. if (sticky) {
  842. if (match) {
  843. match.input = match.input.slice(charsAdded);
  844. match[0] = match[0].slice(charsAdded);
  845. match.index = re.lastIndex;
  846. re.lastIndex += match[0].length;
  847. } else re.lastIndex = 0;
  848. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  849. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  850. }
  851. if (NPCG_INCLUDED && match && match.length > 1) {
  852. // Fix browsers whose `exec` methods don't consistently return `undefined`
  853. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  854. nativeReplace.call(match[0], reCopy, function () {
  855. for (i = 1; i < arguments.length - 2; i++) {
  856. if (arguments[i] === undefined) match[i] = undefined;
  857. }
  858. });
  859. }
  860. return match;
  861. };
  862. }
  863. var regexpExec = patchedExec;
  864. // `RegExp.prototype.exec` method
  865. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  866. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  867. exec: regexpExec
  868. });
  869. // TODO: Remove from `core-js@4` since it's moved to entry points
  870. var SPECIES$1 = wellKnownSymbol('species');
  871. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  872. // #replace needs built-in support for named groups.
  873. // #match works fine because it just return the exec results, even if it has
  874. // a "grops" property.
  875. var re = /./;
  876. re.exec = function () {
  877. var result = [];
  878. result.groups = { a: '7' };
  879. return result;
  880. };
  881. return ''.replace(re, '$<a>') !== '7';
  882. });
  883. // IE <= 11 replaces $0 with the whole match, as if it was $&
  884. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  885. var REPLACE_KEEPS_$0 = (function () {
  886. return 'a'.replace(/./, '$0') === '$0';
  887. })();
  888. var REPLACE = wellKnownSymbol('replace');
  889. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  890. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  891. if (/./[REPLACE]) {
  892. return /./[REPLACE]('a', '$0') === '';
  893. }
  894. return false;
  895. })();
  896. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  897. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  898. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  899. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  900. var re = /(?:)/;
  901. var originalExec = re.exec;
  902. re.exec = function () { return originalExec.apply(this, arguments); };
  903. var result = 'ab'.split(re);
  904. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  905. });
  906. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  907. var SYMBOL = wellKnownSymbol(KEY);
  908. var DELEGATES_TO_SYMBOL = !fails(function () {
  909. // String methods call symbol-named RegEp methods
  910. var O = {};
  911. O[SYMBOL] = function () { return 7; };
  912. return ''[KEY](O) != 7;
  913. });
  914. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  915. // Symbol-named RegExp methods call .exec
  916. var execCalled = false;
  917. var re = /a/;
  918. if (KEY === 'split') {
  919. // We can't use real regex here since it causes deoptimization
  920. // and serious performance degradation in V8
  921. // https://github.com/zloirock/core-js/issues/306
  922. re = {};
  923. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  924. // a new one. We need to return the patched regex when creating the new one.
  925. re.constructor = {};
  926. re.constructor[SPECIES$1] = function () { return re; };
  927. re.flags = '';
  928. re[SYMBOL] = /./[SYMBOL];
  929. }
  930. re.exec = function () { execCalled = true; return null; };
  931. re[SYMBOL]('');
  932. return !execCalled;
  933. });
  934. if (
  935. !DELEGATES_TO_SYMBOL ||
  936. !DELEGATES_TO_EXEC ||
  937. (KEY === 'replace' && !(
  938. REPLACE_SUPPORTS_NAMED_GROUPS &&
  939. REPLACE_KEEPS_$0 &&
  940. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  941. )) ||
  942. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  943. ) {
  944. var nativeRegExpMethod = /./[SYMBOL];
  945. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  946. if (regexp.exec === regexpExec) {
  947. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  948. // The native String method already delegates to @@method (this
  949. // polyfilled function), leasing to infinite recursion.
  950. // We avoid it by directly calling the native @@method method.
  951. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  952. }
  953. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  954. }
  955. return { done: false };
  956. }, {
  957. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  958. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  959. });
  960. var stringMethod = methods[0];
  961. var regexMethod = methods[1];
  962. redefine(String.prototype, KEY, stringMethod);
  963. redefine(RegExp.prototype, SYMBOL, length == 2
  964. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  965. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  966. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  967. // 21.2.5.6 RegExp.prototype[@@match](string)
  968. // 21.2.5.9 RegExp.prototype[@@search](string)
  969. : function (string) { return regexMethod.call(string, this); }
  970. );
  971. }
  972. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  973. };
  974. var MATCH = wellKnownSymbol('match');
  975. // `IsRegExp` abstract operation
  976. // https://tc39.es/ecma262/#sec-isregexp
  977. var isRegexp = function (it) {
  978. var isRegExp;
  979. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  980. };
  981. var aFunction = function (it) {
  982. if (typeof it != 'function') {
  983. throw TypeError(String(it) + ' is not a function');
  984. } return it;
  985. };
  986. var SPECIES = wellKnownSymbol('species');
  987. // `SpeciesConstructor` abstract operation
  988. // https://tc39.es/ecma262/#sec-speciesconstructor
  989. var speciesConstructor = function (O, defaultConstructor) {
  990. var C = anObject(O).constructor;
  991. var S;
  992. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
  993. };
  994. // `String.prototype.{ codePointAt, at }` methods implementation
  995. var createMethod$1 = function (CONVERT_TO_STRING) {
  996. return function ($this, pos) {
  997. var S = String(requireObjectCoercible($this));
  998. var position = toInteger(pos);
  999. var size = S.length;
  1000. var first, second;
  1001. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1002. first = S.charCodeAt(position);
  1003. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1004. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  1005. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1006. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1007. };
  1008. };
  1009. var stringMultibyte = {
  1010. // `String.prototype.codePointAt` method
  1011. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  1012. codeAt: createMethod$1(false),
  1013. // `String.prototype.at` method
  1014. // https://github.com/mathiasbynens/String.prototype.at
  1015. charAt: createMethod$1(true)
  1016. };
  1017. var charAt = stringMultibyte.charAt;
  1018. // `AdvanceStringIndex` abstract operation
  1019. // https://tc39.es/ecma262/#sec-advancestringindex
  1020. var advanceStringIndex = function (S, index, unicode) {
  1021. return index + (unicode ? charAt(S, index).length : 1);
  1022. };
  1023. // `RegExpExec` abstract operation
  1024. // https://tc39.es/ecma262/#sec-regexpexec
  1025. var regexpExecAbstract = function (R, S) {
  1026. var exec = R.exec;
  1027. if (typeof exec === 'function') {
  1028. var result = exec.call(R, S);
  1029. if (typeof result !== 'object') {
  1030. throw TypeError('RegExp exec method returned something other than an Object or null');
  1031. }
  1032. return result;
  1033. }
  1034. if (classofRaw(R) !== 'RegExp') {
  1035. throw TypeError('RegExp#exec called on incompatible receiver');
  1036. }
  1037. return regexpExec.call(R, S);
  1038. };
  1039. var arrayPush = [].push;
  1040. var min$1 = Math.min;
  1041. var MAX_UINT32 = 0xFFFFFFFF;
  1042. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  1043. var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
  1044. // @@split logic
  1045. fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  1046. var internalSplit;
  1047. if (
  1048. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1049. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1050. 'test'.split(/(?:)/, -1).length != 4 ||
  1051. 'ab'.split(/(?:ab)*/).length != 2 ||
  1052. '.'.split(/(.?)(.?)/).length != 4 ||
  1053. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  1054. '.'.split(/()()/).length > 1 ||
  1055. ''.split(/.?/).length
  1056. ) {
  1057. // based on es5-shim implementation, need to rework it
  1058. internalSplit = function (separator, limit) {
  1059. var string = String(requireObjectCoercible(this));
  1060. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1061. if (lim === 0) return [];
  1062. if (separator === undefined) return [string];
  1063. // If `separator` is not a regex, use native split
  1064. if (!isRegexp(separator)) {
  1065. return nativeSplit.call(string, separator, lim);
  1066. }
  1067. var output = [];
  1068. var flags = (separator.ignoreCase ? 'i' : '') +
  1069. (separator.multiline ? 'm' : '') +
  1070. (separator.unicode ? 'u' : '') +
  1071. (separator.sticky ? 'y' : '');
  1072. var lastLastIndex = 0;
  1073. // Make `global` and avoid `lastIndex` issues by working with a copy
  1074. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1075. var match, lastIndex, lastLength;
  1076. while (match = regexpExec.call(separatorCopy, string)) {
  1077. lastIndex = separatorCopy.lastIndex;
  1078. if (lastIndex > lastLastIndex) {
  1079. output.push(string.slice(lastLastIndex, match.index));
  1080. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  1081. lastLength = match[0].length;
  1082. lastLastIndex = lastIndex;
  1083. if (output.length >= lim) break;
  1084. }
  1085. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1086. }
  1087. if (lastLastIndex === string.length) {
  1088. if (lastLength || !separatorCopy.test('')) output.push('');
  1089. } else output.push(string.slice(lastLastIndex));
  1090. return output.length > lim ? output.slice(0, lim) : output;
  1091. };
  1092. // Chakra, V8
  1093. } else if ('0'.split(undefined, 0).length) {
  1094. internalSplit = function (separator, limit) {
  1095. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  1096. };
  1097. } else internalSplit = nativeSplit;
  1098. return [
  1099. // `String.prototype.split` method
  1100. // https://tc39.es/ecma262/#sec-string.prototype.split
  1101. function split(separator, limit) {
  1102. var O = requireObjectCoercible(this);
  1103. var splitter = separator == undefined ? undefined : separator[SPLIT];
  1104. return splitter !== undefined
  1105. ? splitter.call(separator, O, limit)
  1106. : internalSplit.call(String(O), separator, limit);
  1107. },
  1108. // `RegExp.prototype[@@split]` method
  1109. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1110. //
  1111. // NOTE: This cannot be properly polyfilled in engines that don't support
  1112. // the 'y' flag.
  1113. function (regexp, limit) {
  1114. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  1115. if (res.done) return res.value;
  1116. var rx = anObject(regexp);
  1117. var S = String(this);
  1118. var C = speciesConstructor(rx, RegExp);
  1119. var unicodeMatching = rx.unicode;
  1120. var flags = (rx.ignoreCase ? 'i' : '') +
  1121. (rx.multiline ? 'm' : '') +
  1122. (rx.unicode ? 'u' : '') +
  1123. (SUPPORTS_Y ? 'y' : 'g');
  1124. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1125. // simulate the 'y' flag.
  1126. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  1127. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1128. if (lim === 0) return [];
  1129. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1130. var p = 0;
  1131. var q = 0;
  1132. var A = [];
  1133. while (q < S.length) {
  1134. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  1135. var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
  1136. var e;
  1137. if (
  1138. z === null ||
  1139. (e = min$1(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  1140. ) {
  1141. q = advanceStringIndex(S, q, unicodeMatching);
  1142. } else {
  1143. A.push(S.slice(p, q));
  1144. if (A.length === lim) return A;
  1145. for (var i = 1; i <= z.length - 1; i++) {
  1146. A.push(z[i]);
  1147. if (A.length === lim) return A;
  1148. }
  1149. q = p = e;
  1150. }
  1151. }
  1152. A.push(S.slice(p));
  1153. return A;
  1154. }
  1155. ];
  1156. }, !SUPPORTS_Y);
  1157. var floor = Math.floor;
  1158. var replace = ''.replace;
  1159. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  1160. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  1161. // https://tc39.es/ecma262/#sec-getsubstitution
  1162. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  1163. var tailPos = position + matched.length;
  1164. var m = captures.length;
  1165. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1166. if (namedCaptures !== undefined) {
  1167. namedCaptures = toObject(namedCaptures);
  1168. symbols = SUBSTITUTION_SYMBOLS;
  1169. }
  1170. return replace.call(replacement, symbols, function (match, ch) {
  1171. var capture;
  1172. switch (ch.charAt(0)) {
  1173. case '$': return '$';
  1174. case '&': return matched;
  1175. case '`': return str.slice(0, position);
  1176. case "'": return str.slice(tailPos);
  1177. case '<':
  1178. capture = namedCaptures[ch.slice(1, -1)];
  1179. break;
  1180. default: // \d\d?
  1181. var n = +ch;
  1182. if (n === 0) return match;
  1183. if (n > m) {
  1184. var f = floor(n / 10);
  1185. if (f === 0) return match;
  1186. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  1187. return match;
  1188. }
  1189. capture = captures[n - 1];
  1190. }
  1191. return capture === undefined ? '' : capture;
  1192. });
  1193. };
  1194. var max = Math.max;
  1195. var min = Math.min;
  1196. var maybeToString = function (it) {
  1197. return it === undefined ? it : String(it);
  1198. };
  1199. // @@replace logic
  1200. fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  1201. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  1202. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  1203. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1204. return [
  1205. // `String.prototype.replace` method
  1206. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1207. function replace(searchValue, replaceValue) {
  1208. var O = requireObjectCoercible(this);
  1209. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  1210. return replacer !== undefined
  1211. ? replacer.call(searchValue, O, replaceValue)
  1212. : nativeReplace.call(String(O), searchValue, replaceValue);
  1213. },
  1214. // `RegExp.prototype[@@replace]` method
  1215. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1216. function (regexp, replaceValue) {
  1217. if (
  1218. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  1219. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  1220. ) {
  1221. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  1222. if (res.done) return res.value;
  1223. }
  1224. var rx = anObject(regexp);
  1225. var S = String(this);
  1226. var functionalReplace = typeof replaceValue === 'function';
  1227. if (!functionalReplace) replaceValue = String(replaceValue);
  1228. var global = rx.global;
  1229. if (global) {
  1230. var fullUnicode = rx.unicode;
  1231. rx.lastIndex = 0;
  1232. }
  1233. var results = [];
  1234. while (true) {
  1235. var result = regexpExecAbstract(rx, S);
  1236. if (result === null) break;
  1237. results.push(result);
  1238. if (!global) break;
  1239. var matchStr = String(result[0]);
  1240. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1241. }
  1242. var accumulatedResult = '';
  1243. var nextSourcePosition = 0;
  1244. for (var i = 0; i < results.length; i++) {
  1245. result = results[i];
  1246. var matched = String(result[0]);
  1247. var position = max(min(toInteger(result.index), S.length), 0);
  1248. var captures = [];
  1249. // NOTE: This is equivalent to
  1250. // captures = result.slice(1).map(maybeToString)
  1251. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1252. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1253. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1254. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1255. var namedCaptures = result.groups;
  1256. if (functionalReplace) {
  1257. var replacerArgs = [matched].concat(captures, position, S);
  1258. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1259. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1260. } else {
  1261. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1262. }
  1263. if (position >= nextSourcePosition) {
  1264. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1265. nextSourcePosition = position + matched.length;
  1266. }
  1267. }
  1268. return accumulatedResult + S.slice(nextSourcePosition);
  1269. }
  1270. ];
  1271. });
  1272. // iterable DOM collections
  1273. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1274. var domIterables = {
  1275. CSSRuleList: 0,
  1276. CSSStyleDeclaration: 0,
  1277. CSSValueList: 0,
  1278. ClientRectList: 0,
  1279. DOMRectList: 0,
  1280. DOMStringList: 0,
  1281. DOMTokenList: 1,
  1282. DataTransferItemList: 0,
  1283. FileList: 0,
  1284. HTMLAllCollection: 0,
  1285. HTMLCollection: 0,
  1286. HTMLFormElement: 0,
  1287. HTMLSelectElement: 0,
  1288. MediaList: 0,
  1289. MimeTypeArray: 0,
  1290. NamedNodeMap: 0,
  1291. NodeList: 1,
  1292. PaintRequestList: 0,
  1293. Plugin: 0,
  1294. PluginArray: 0,
  1295. SVGLengthList: 0,
  1296. SVGNumberList: 0,
  1297. SVGPathSegList: 0,
  1298. SVGPointList: 0,
  1299. SVGStringList: 0,
  1300. SVGTransformList: 0,
  1301. SourceBufferList: 0,
  1302. StyleSheetList: 0,
  1303. TextTrackCueList: 0,
  1304. TextTrackList: 0,
  1305. TouchList: 0
  1306. };
  1307. // optional / simple context binding
  1308. var functionBindContext = function (fn, that, length) {
  1309. aFunction(fn);
  1310. if (that === undefined) return fn;
  1311. switch (length) {
  1312. case 0: return function () {
  1313. return fn.call(that);
  1314. };
  1315. case 1: return function (a) {
  1316. return fn.call(that, a);
  1317. };
  1318. case 2: return function (a, b) {
  1319. return fn.call(that, a, b);
  1320. };
  1321. case 3: return function (a, b, c) {
  1322. return fn.call(that, a, b, c);
  1323. };
  1324. }
  1325. return function (/* ...args */) {
  1326. return fn.apply(that, arguments);
  1327. };
  1328. };
  1329. var push = [].push;
  1330. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  1331. var createMethod = function (TYPE) {
  1332. var IS_MAP = TYPE == 1;
  1333. var IS_FILTER = TYPE == 2;
  1334. var IS_SOME = TYPE == 3;
  1335. var IS_EVERY = TYPE == 4;
  1336. var IS_FIND_INDEX = TYPE == 6;
  1337. var IS_FILTER_OUT = TYPE == 7;
  1338. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1339. return function ($this, callbackfn, that, specificCreate) {
  1340. var O = toObject($this);
  1341. var self = indexedObject(O);
  1342. var boundFunction = functionBindContext(callbackfn, that, 3);
  1343. var length = toLength(self.length);
  1344. var index = 0;
  1345. var create = specificCreate || arraySpeciesCreate;
  1346. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  1347. var value, result;
  1348. for (;length > index; index++) if (NO_HOLES || index in self) {
  1349. value = self[index];
  1350. result = boundFunction(value, index, O);
  1351. if (TYPE) {
  1352. if (IS_MAP) target[index] = result; // map
  1353. else if (result) switch (TYPE) {
  1354. case 3: return true; // some
  1355. case 5: return value; // find
  1356. case 6: return index; // findIndex
  1357. case 2: push.call(target, value); // filter
  1358. } else switch (TYPE) {
  1359. case 4: return false; // every
  1360. case 7: push.call(target, value); // filterOut
  1361. }
  1362. }
  1363. }
  1364. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1365. };
  1366. };
  1367. var arrayIteration = {
  1368. // `Array.prototype.forEach` method
  1369. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1370. forEach: createMethod(0),
  1371. // `Array.prototype.map` method
  1372. // https://tc39.es/ecma262/#sec-array.prototype.map
  1373. map: createMethod(1),
  1374. // `Array.prototype.filter` method
  1375. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1376. filter: createMethod(2),
  1377. // `Array.prototype.some` method
  1378. // https://tc39.es/ecma262/#sec-array.prototype.some
  1379. some: createMethod(3),
  1380. // `Array.prototype.every` method
  1381. // https://tc39.es/ecma262/#sec-array.prototype.every
  1382. every: createMethod(4),
  1383. // `Array.prototype.find` method
  1384. // https://tc39.es/ecma262/#sec-array.prototype.find
  1385. find: createMethod(5),
  1386. // `Array.prototype.findIndex` method
  1387. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1388. findIndex: createMethod(6),
  1389. // `Array.prototype.filterOut` method
  1390. // https://github.com/tc39/proposal-array-filtering
  1391. filterOut: createMethod(7)
  1392. };
  1393. var $forEach = arrayIteration.forEach;
  1394. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  1395. // `Array.prototype.forEach` method implementation
  1396. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1397. var arrayForEach = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
  1398. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1399. } : [].forEach;
  1400. for (var COLLECTION_NAME in domIterables) {
  1401. var Collection = global_1[COLLECTION_NAME];
  1402. var CollectionPrototype = Collection && Collection.prototype;
  1403. // some Chrome versions have non-configurable methods on DOMTokenList
  1404. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1405. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1406. } catch (error) {
  1407. CollectionPrototype.forEach = arrayForEach;
  1408. }
  1409. }
  1410. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  1411. var test = {};
  1412. test[TO_STRING_TAG$1] = 'z';
  1413. var toStringTagSupport = String(test) === '[object z]';
  1414. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1415. // ES3 wrong here
  1416. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  1417. // fallback for IE11 Script Access Denied error
  1418. var tryGet = function (it, key) {
  1419. try {
  1420. return it[key];
  1421. } catch (error) { /* empty */ }
  1422. };
  1423. // getting tag from ES6+ `Object.prototype.toString`
  1424. var classof = toStringTagSupport ? classofRaw : function (it) {
  1425. var O, tag, result;
  1426. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1427. // @@toStringTag case
  1428. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
  1429. // builtinTag case
  1430. : CORRECT_ARGUMENTS ? classofRaw(O)
  1431. // ES3 arguments fallback
  1432. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  1433. };
  1434. // `Object.prototype.toString` method implementation
  1435. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1436. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  1437. return '[object ' + classof(this) + ']';
  1438. };
  1439. // `Object.prototype.toString` method
  1440. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1441. if (!toStringTagSupport) {
  1442. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  1443. }
  1444. var TO_STRING = 'toString';
  1445. var RegExpPrototype = RegExp.prototype;
  1446. var nativeToString = RegExpPrototype[TO_STRING];
  1447. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1448. // FF44- RegExp#toString has a wrong name
  1449. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  1450. // `RegExp.prototype.toString` method
  1451. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  1452. if (NOT_GENERIC || INCORRECT_NAME) {
  1453. redefine(RegExp.prototype, TO_STRING, function toString() {
  1454. var R = anObject(this);
  1455. var p = String(R.source);
  1456. var rf = R.flags;
  1457. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
  1458. return '/' + p + '/' + f;
  1459. }, { unsafe: true });
  1460. }
  1461. // `Object.keys` method
  1462. // https://tc39.es/ecma262/#sec-object.keys
  1463. var objectKeys = Object.keys || function keys(O) {
  1464. return objectKeysInternal(O, enumBugKeys);
  1465. };
  1466. // `Object.defineProperties` method
  1467. // https://tc39.es/ecma262/#sec-object.defineproperties
  1468. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  1469. anObject(O);
  1470. var keys = objectKeys(Properties);
  1471. var length = keys.length;
  1472. var index = 0;
  1473. var key;
  1474. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  1475. return O;
  1476. };
  1477. var html = getBuiltIn('document', 'documentElement');
  1478. var GT = '>';
  1479. var LT = '<';
  1480. var PROTOTYPE = 'prototype';
  1481. var SCRIPT = 'script';
  1482. var IE_PROTO = sharedKey('IE_PROTO');
  1483. var EmptyConstructor = function () { /* empty */ };
  1484. var scriptTag = function (content) {
  1485. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1486. };
  1487. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1488. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1489. activeXDocument.write(scriptTag(''));
  1490. activeXDocument.close();
  1491. var temp = activeXDocument.parentWindow.Object;
  1492. activeXDocument = null; // avoid memory leak
  1493. return temp;
  1494. };
  1495. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1496. var NullProtoObjectViaIFrame = function () {
  1497. // Thrash, waste and sodomy: IE GC bug
  1498. var iframe = documentCreateElement('iframe');
  1499. var JS = 'java' + SCRIPT + ':';
  1500. var iframeDocument;
  1501. iframe.style.display = 'none';
  1502. html.appendChild(iframe);
  1503. // https://github.com/zloirock/core-js/issues/475
  1504. iframe.src = String(JS);
  1505. iframeDocument = iframe.contentWindow.document;
  1506. iframeDocument.open();
  1507. iframeDocument.write(scriptTag('document.F=Object'));
  1508. iframeDocument.close();
  1509. return iframeDocument.F;
  1510. };
  1511. // Check for document.domain and active x support
  1512. // No need to use active x approach when document.domain is not set
  1513. // see https://github.com/es-shims/es5-shim/issues/150
  1514. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1515. // avoid IE GC bug
  1516. var activeXDocument;
  1517. var NullProtoObject = function () {
  1518. try {
  1519. /* global ActiveXObject -- old IE */
  1520. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  1521. } catch (error) { /* ignore */ }
  1522. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  1523. var length = enumBugKeys.length;
  1524. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1525. return NullProtoObject();
  1526. };
  1527. hiddenKeys$1[IE_PROTO] = true;
  1528. // `Object.create` method
  1529. // https://tc39.es/ecma262/#sec-object.create
  1530. var objectCreate = Object.create || function create(O, Properties) {
  1531. var result;
  1532. if (O !== null) {
  1533. EmptyConstructor[PROTOTYPE] = anObject(O);
  1534. result = new EmptyConstructor();
  1535. EmptyConstructor[PROTOTYPE] = null;
  1536. // add "__proto__" for Object.getPrototypeOf polyfill
  1537. result[IE_PROTO] = O;
  1538. } else result = NullProtoObject();
  1539. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  1540. };
  1541. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1542. var ArrayPrototype = Array.prototype;
  1543. // Array.prototype[@@unscopables]
  1544. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1545. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1546. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1547. configurable: true,
  1548. value: objectCreate(null)
  1549. });
  1550. }
  1551. // add a key to Array.prototype[@@unscopables]
  1552. var addToUnscopables = function (key) {
  1553. ArrayPrototype[UNSCOPABLES][key] = true;
  1554. };
  1555. var $find = arrayIteration.find;
  1556. var FIND = 'find';
  1557. var SKIPS_HOLES = true;
  1558. // Shouldn't skip holes
  1559. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1560. // `Array.prototype.find` method
  1561. // https://tc39.es/ecma262/#sec-array.prototype.find
  1562. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1563. find: function find(callbackfn /* , that = undefined */) {
  1564. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1565. }
  1566. });
  1567. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1568. addToUnscopables(FIND);
  1569. var $filter = arrayIteration.filter;
  1570. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('filter');
  1571. // `Array.prototype.filter` method
  1572. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1573. // with adding support of @@species
  1574. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1575. filter: function filter(callbackfn /* , thisArg */) {
  1576. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1577. }
  1578. });
  1579. var $map = arrayIteration.map;
  1580. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  1581. // `Array.prototype.map` method
  1582. // https://tc39.es/ecma262/#sec-array.prototype.map
  1583. // with adding support of @@species
  1584. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1585. map: function map(callbackfn /* , thisArg */) {
  1586. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1587. }
  1588. });
  1589. // `SameValue` abstract operation
  1590. // https://tc39.es/ecma262/#sec-samevalue
  1591. var sameValue = Object.is || function is(x, y) {
  1592. // eslint-disable-next-line no-self-compare -- NaN check
  1593. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1594. };
  1595. // @@search logic
  1596. fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
  1597. return [
  1598. // `String.prototype.search` method
  1599. // https://tc39.es/ecma262/#sec-string.prototype.search
  1600. function search(regexp) {
  1601. var O = requireObjectCoercible(this);
  1602. var searcher = regexp == undefined ? undefined : regexp[SEARCH];
  1603. return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  1604. },
  1605. // `RegExp.prototype[@@search]` method
  1606. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  1607. function (regexp) {
  1608. var res = maybeCallNative(nativeSearch, regexp, this);
  1609. if (res.done) return res.value;
  1610. var rx = anObject(regexp);
  1611. var S = String(this);
  1612. var previousLastIndex = rx.lastIndex;
  1613. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  1614. var result = regexpExecAbstract(rx, S);
  1615. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  1616. return result === null ? -1 : result.index;
  1617. }
  1618. ];
  1619. });
  1620. /**
  1621. * @author: Dennis Hernández
  1622. * @webSite: http://djhvscf.github.io/Blog
  1623. * @update zhixin wen <wenzhixin2010@gmail.com>
  1624. */
  1625. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1626. var UtilsCookie = {
  1627. cookieIds: {
  1628. sortOrder: 'bs.table.sortOrder',
  1629. sortName: 'bs.table.sortName',
  1630. pageNumber: 'bs.table.pageNumber',
  1631. pageList: 'bs.table.pageList',
  1632. columns: 'bs.table.columns',
  1633. searchText: 'bs.table.searchText',
  1634. reorderColumns: 'bs.table.reorderColumns',
  1635. filterControl: 'bs.table.filterControl',
  1636. filterBy: 'bs.table.filterBy'
  1637. },
  1638. getCurrentHeader: function getCurrentHeader(that) {
  1639. var header = that.$header;
  1640. if (that.options.height) {
  1641. header = that.$tableHeader;
  1642. }
  1643. return header;
  1644. },
  1645. getCurrentSearchControls: function getCurrentSearchControls(that) {
  1646. var searchControls = 'select, input';
  1647. if (that.options.height) {
  1648. searchControls = 'table select, table input';
  1649. }
  1650. return searchControls;
  1651. },
  1652. cookieEnabled: function cookieEnabled() {
  1653. return !!navigator.cookieEnabled;
  1654. },
  1655. inArrayCookiesEnabled: function inArrayCookiesEnabled(cookieName, cookiesEnabled) {
  1656. var index = -1;
  1657. for (var i = 0; i < cookiesEnabled.length; i++) {
  1658. if (cookieName.toLowerCase() === cookiesEnabled[i].toLowerCase()) {
  1659. index = i;
  1660. break;
  1661. }
  1662. }
  1663. return index;
  1664. },
  1665. setCookie: function setCookie(that, cookieName, cookieValue) {
  1666. if (!that.options.cookie || !UtilsCookie.cookieEnabled() || that.options.cookieIdTable === '') {
  1667. return;
  1668. }
  1669. if (UtilsCookie.inArrayCookiesEnabled(cookieName, that.options.cookiesEnabled) === -1) {
  1670. return;
  1671. }
  1672. cookieName = "".concat(that.options.cookieIdTable, ".").concat(cookieName);
  1673. switch (that.options.cookieStorage) {
  1674. case 'cookieStorage':
  1675. document.cookie = [cookieName, '=', encodeURIComponent(cookieValue), "; expires=".concat(UtilsCookie.calculateExpiration(that.options.cookieExpire)), that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', that.options.cookieSecure ? '; secure' : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
  1676. break;
  1677. case 'localStorage':
  1678. localStorage.setItem(cookieName, cookieValue);
  1679. break;
  1680. case 'sessionStorage':
  1681. sessionStorage.setItem(cookieName, cookieValue);
  1682. break;
  1683. case 'customStorage':
  1684. if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
  1685. throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
  1686. }
  1687. Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageSet, [cookieName, cookieValue], '');
  1688. break;
  1689. default:
  1690. return false;
  1691. }
  1692. return true;
  1693. },
  1694. getCookie: function getCookie(that, tableName, cookieName) {
  1695. if (!cookieName) {
  1696. return null;
  1697. }
  1698. if (UtilsCookie.inArrayCookiesEnabled(cookieName, that.options.cookiesEnabled) === -1) {
  1699. return null;
  1700. }
  1701. cookieName = "".concat(tableName, ".").concat(cookieName);
  1702. switch (that.options.cookieStorage) {
  1703. case 'cookieStorage':
  1704. var value = "; ".concat(document.cookie);
  1705. var parts = value.split("; ".concat(cookieName, "="));
  1706. return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null;
  1707. case 'localStorage':
  1708. return localStorage.getItem(cookieName);
  1709. case 'sessionStorage':
  1710. return sessionStorage.getItem(cookieName);
  1711. case 'customStorage':
  1712. if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
  1713. throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
  1714. }
  1715. return Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageGet, [cookieName], '');
  1716. default:
  1717. return null;
  1718. }
  1719. },
  1720. deleteCookie: function deleteCookie(that, tableName, cookieName) {
  1721. cookieName = "".concat(tableName, ".").concat(cookieName);
  1722. switch (that.options.cookieStorage) {
  1723. case 'cookieStorage':
  1724. document.cookie = [encodeURIComponent(cookieName), '=', '; expires=Thu, 01 Jan 1970 00:00:00 GMT', that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
  1725. break;
  1726. case 'localStorage':
  1727. localStorage.removeItem(cookieName);
  1728. break;
  1729. case 'sessionStorage':
  1730. sessionStorage.removeItem(cookieName);
  1731. break;
  1732. case 'customStorage':
  1733. if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
  1734. throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
  1735. }
  1736. Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageDelete, [cookieName], '');
  1737. break;
  1738. default:
  1739. return false;
  1740. }
  1741. return true;
  1742. },
  1743. calculateExpiration: function calculateExpiration(cookieExpire) {
  1744. var time = cookieExpire.replace(/[0-9]*/, ''); // s,mi,h,d,m,y
  1745. cookieExpire = cookieExpire.replace(/[A-Za-z]{1,2}/, ''); // number
  1746. switch (time.toLowerCase()) {
  1747. case 's':
  1748. cookieExpire = +cookieExpire;
  1749. break;
  1750. case 'mi':
  1751. cookieExpire *= 60;
  1752. break;
  1753. case 'h':
  1754. cookieExpire = cookieExpire * 60 * 60;
  1755. break;
  1756. case 'd':
  1757. cookieExpire = cookieExpire * 24 * 60 * 60;
  1758. break;
  1759. case 'm':
  1760. cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
  1761. break;
  1762. case 'y':
  1763. cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
  1764. break;
  1765. default:
  1766. cookieExpire = undefined;
  1767. break;
  1768. }
  1769. if (!cookieExpire) {
  1770. return '';
  1771. }
  1772. var d = new Date();
  1773. d.setTime(d.getTime() + cookieExpire * 1000);
  1774. return d.toGMTString();
  1775. },
  1776. initCookieFilters: function initCookieFilters(bootstrapTable) {
  1777. setTimeout(function () {
  1778. var parsedCookieFilters = JSON.parse(UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, UtilsCookie.cookieIds.filterControl));
  1779. if (!bootstrapTable.options.filterControlValuesLoaded && parsedCookieFilters) {
  1780. var cachedFilters = {};
  1781. var header = UtilsCookie.getCurrentHeader(bootstrapTable);
  1782. var searchControls = UtilsCookie.getCurrentSearchControls(bootstrapTable);
  1783. var applyCookieFilters = function applyCookieFilters(element, filteredCookies) {
  1784. filteredCookies.forEach(function (cookie) {
  1785. if (cookie.text === '' || element.type === 'radio' && element.value.toString() !== cookie.text.toString()) {
  1786. return;
  1787. }
  1788. if (element.tagName === 'INPUT' && element.type === 'radio' && element.value.toString() === cookie.text.toString()) {
  1789. element.checked = true;
  1790. cachedFilters[cookie.field] = cookie.text;
  1791. } else if (element.tagName === 'INPUT') {
  1792. element.value = cookie.text;
  1793. cachedFilters[cookie.field] = cookie.text;
  1794. } else if (element.tagName === 'SELECT' && bootstrapTable.options.filterControlContainer) {
  1795. element.value = cookie.text;
  1796. cachedFilters[cookie.field] = cookie.text;
  1797. } else if (cookie.text !== '' && element.tagName === 'SELECT') {
  1798. for (var i = 0; i < element.length; i++) {
  1799. var currentElement = element[i];
  1800. if (currentElement.value === cookie.text) {
  1801. currentElement.selected = true;
  1802. return;
  1803. }
  1804. }
  1805. var option = document.createElement('option');
  1806. option.value = cookie.text;
  1807. option.text = cookie.text;
  1808. element.add(option, element[1]);
  1809. element.selectedIndex = 1;
  1810. cachedFilters[cookie.field] = cookie.text;
  1811. }
  1812. });
  1813. };
  1814. var filterContainer = header;
  1815. if (bootstrapTable.options.filterControlContainer) {
  1816. filterContainer = $__default['default']("".concat(bootstrapTable.options.filterControlContainer));
  1817. }
  1818. filterContainer.find(searchControls).each(function () {
  1819. var field = $__default['default'](this).closest('[data-field]').data('field');
  1820. var filteredCookies = parsedCookieFilters.filter(function (cookie) {
  1821. return cookie.field === field;
  1822. });
  1823. applyCookieFilters(this, filteredCookies);
  1824. });
  1825. bootstrapTable.initColumnSearch(cachedFilters);
  1826. bootstrapTable.options.filterControlValuesLoaded = true;
  1827. bootstrapTable.initServer();
  1828. }
  1829. }, 250);
  1830. }
  1831. };
  1832. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1833. cookie: false,
  1834. cookieExpire: '2h',
  1835. cookiePath: null,
  1836. cookieDomain: null,
  1837. cookieSecure: null,
  1838. cookieSameSite: 'Lax',
  1839. cookieIdTable: '',
  1840. cookiesEnabled: ['bs.table.sortOrder', 'bs.table.sortName', 'bs.table.pageNumber', 'bs.table.pageList', 'bs.table.columns', 'bs.table.searchText', 'bs.table.filterControl', 'bs.table.filterBy', 'bs.table.reorderColumns'],
  1841. cookieStorage: 'cookieStorage',
  1842. // localStorage, sessionStorage, customStorage
  1843. cookieCustomStorageGet: null,
  1844. cookieCustomStorageSet: null,
  1845. cookieCustomStorageDelete: null,
  1846. // internal variable
  1847. filterControls: [],
  1848. filterControlValuesLoaded: false
  1849. });
  1850. $__default['default'].fn.bootstrapTable.methods.push('getCookies');
  1851. $__default['default'].fn.bootstrapTable.methods.push('deleteCookie');
  1852. $__default['default'].extend($__default['default'].fn.bootstrapTable.utils, {
  1853. setCookie: UtilsCookie.setCookie,
  1854. getCookie: UtilsCookie.getCookie
  1855. });
  1856. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1857. _inherits(_class, _$$BootstrapTable);
  1858. var _super = _createSuper(_class);
  1859. function _class() {
  1860. _classCallCheck(this, _class);
  1861. return _super.apply(this, arguments);
  1862. }
  1863. _createClass(_class, [{
  1864. key: "init",
  1865. value: function init() {
  1866. if (this.options.cookie) {
  1867. // FilterBy logic
  1868. var filterByCookieValue = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterBy);
  1869. if (typeof filterByCookieValue === 'boolean' && !filterByCookieValue) {
  1870. throw new Error('The cookie value of filterBy must be a json!');
  1871. }
  1872. var filterByCookie = {};
  1873. try {
  1874. filterByCookie = JSON.parse(filterByCookieValue);
  1875. } catch (e) {
  1876. throw new Error('Could not parse the json of the filterBy cookie!');
  1877. }
  1878. this.filterColumns = filterByCookie ? filterByCookie : {}; // FilterControl logic
  1879. this.options.filterControls = [];
  1880. this.options.filterControlValuesLoaded = false;
  1881. this.options.cookiesEnabled = typeof this.options.cookiesEnabled === 'string' ? this.options.cookiesEnabled.replace('[', '').replace(']', '').replace(/'/g, '').replace(/ /g, '').toLowerCase().split(',') : this.options.cookiesEnabled;
  1882. if (this.options.filterControl) {
  1883. var that = this;
  1884. this.$el.on('column-search.bs.table', function (e, field, text) {
  1885. var isNewField = true;
  1886. for (var i = 0; i < that.options.filterControls.length; i++) {
  1887. if (that.options.filterControls[i].field === field) {
  1888. that.options.filterControls[i].text = text;
  1889. isNewField = false;
  1890. break;
  1891. }
  1892. }
  1893. if (isNewField) {
  1894. that.options.filterControls.push({
  1895. field: field,
  1896. text: text
  1897. });
  1898. }
  1899. UtilsCookie.setCookie(that, UtilsCookie.cookieIds.filterControl, JSON.stringify(that.options.filterControls));
  1900. }).on('created-controls.bs.table', UtilsCookie.initCookieFilters(that));
  1901. }
  1902. }
  1903. _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
  1904. }
  1905. }, {
  1906. key: "initServer",
  1907. value: function initServer() {
  1908. var _get2;
  1909. if (this.options.cookie && this.options.filterControl && !this.options.filterControlValuesLoaded) {
  1910. var cookie = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterControl));
  1911. if (cookie) {
  1912. return;
  1913. }
  1914. }
  1915. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1916. args[_key] = arguments[_key];
  1917. }
  1918. (_get2 = _get(_getPrototypeOf(_class.prototype), "initServer", this)).call.apply(_get2, [this].concat(args));
  1919. }
  1920. }, {
  1921. key: "initTable",
  1922. value: function initTable() {
  1923. var _get3;
  1924. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1925. args[_key2] = arguments[_key2];
  1926. }
  1927. (_get3 = _get(_getPrototypeOf(_class.prototype), "initTable", this)).call.apply(_get3, [this].concat(args));
  1928. this.initCookie();
  1929. }
  1930. }, {
  1931. key: "onSort",
  1932. value: function onSort() {
  1933. var _get4;
  1934. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  1935. args[_key3] = arguments[_key3];
  1936. }
  1937. (_get4 = _get(_getPrototypeOf(_class.prototype), "onSort", this)).call.apply(_get4, [this].concat(args));
  1938. if (this.options.sortName === undefined || this.options.sortOrder === undefined) {
  1939. UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortName);
  1940. UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortOrder);
  1941. return;
  1942. }
  1943. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder);
  1944. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName);
  1945. }
  1946. }, {
  1947. key: "onPageNumber",
  1948. value: function onPageNumber() {
  1949. var _get5;
  1950. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1951. args[_key4] = arguments[_key4];
  1952. }
  1953. (_get5 = _get(_getPrototypeOf(_class.prototype), "onPageNumber", this)).call.apply(_get5, [this].concat(args));
  1954. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  1955. }
  1956. }, {
  1957. key: "onPageListChange",
  1958. value: function onPageListChange() {
  1959. var _get6;
  1960. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  1961. args[_key5] = arguments[_key5];
  1962. }
  1963. (_get6 = _get(_getPrototypeOf(_class.prototype), "onPageListChange", this)).call.apply(_get6, [this].concat(args));
  1964. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize);
  1965. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  1966. }
  1967. }, {
  1968. key: "onPagePre",
  1969. value: function onPagePre() {
  1970. var _get7;
  1971. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  1972. args[_key6] = arguments[_key6];
  1973. }
  1974. (_get7 = _get(_getPrototypeOf(_class.prototype), "onPagePre", this)).call.apply(_get7, [this].concat(args));
  1975. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  1976. }
  1977. }, {
  1978. key: "onPageNext",
  1979. value: function onPageNext() {
  1980. var _get8;
  1981. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  1982. args[_key7] = arguments[_key7];
  1983. }
  1984. (_get8 = _get(_getPrototypeOf(_class.prototype), "onPageNext", this)).call.apply(_get8, [this].concat(args));
  1985. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  1986. }
  1987. }, {
  1988. key: "_toggleColumn",
  1989. value: function _toggleColumn() {
  1990. var _get9;
  1991. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  1992. args[_key8] = arguments[_key8];
  1993. }
  1994. (_get9 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get9, [this].concat(args));
  1995. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(function (column) {
  1996. return column.field;
  1997. })));
  1998. }
  1999. }, {
  2000. key: "_toggleAllColumns",
  2001. value: function _toggleAllColumns() {
  2002. var _get10;
  2003. for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
  2004. args[_key9] = arguments[_key9];
  2005. }
  2006. (_get10 = _get(_getPrototypeOf(_class.prototype), "_toggleAllColumns", this)).call.apply(_get10, [this].concat(args));
  2007. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(function (column) {
  2008. return column.field;
  2009. })));
  2010. }
  2011. }, {
  2012. key: "selectPage",
  2013. value: function selectPage(page) {
  2014. _get(_getPrototypeOf(_class.prototype), "selectPage", this).call(this, page);
  2015. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page);
  2016. }
  2017. }, {
  2018. key: "onSearch",
  2019. value: function onSearch(event) {
  2020. _get(_getPrototypeOf(_class.prototype), "onSearch", this).call(this, event);
  2021. if (this.options.search) {
  2022. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText);
  2023. }
  2024. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2025. }
  2026. }, {
  2027. key: "initHeader",
  2028. value: function initHeader() {
  2029. var _get11;
  2030. if (this.options.reorderableColumns) {
  2031. this.columnsSortOrder = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.reorderColumns));
  2032. }
  2033. for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
  2034. args[_key10] = arguments[_key10];
  2035. }
  2036. (_get11 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get11, [this].concat(args));
  2037. }
  2038. }, {
  2039. key: "persistReorderColumnsState",
  2040. value: function persistReorderColumnsState(that) {
  2041. UtilsCookie.setCookie(that, UtilsCookie.cookieIds.reorderColumns, JSON.stringify(that.columnsSortOrder));
  2042. }
  2043. }, {
  2044. key: "filterBy",
  2045. value: function filterBy() {
  2046. var _get12;
  2047. for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
  2048. args[_key11] = arguments[_key11];
  2049. }
  2050. (_get12 = _get(_getPrototypeOf(_class.prototype), "filterBy", this)).call.apply(_get12, [this].concat(args));
  2051. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns));
  2052. }
  2053. }, {
  2054. key: "initCookie",
  2055. value: function initCookie() {
  2056. var _this = this;
  2057. if (!this.options.cookie) {
  2058. return;
  2059. }
  2060. if (this.options.cookieIdTable === '' || this.options.cookieExpire === '' || !UtilsCookie.cookieEnabled()) {
  2061. console.error('Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies.');
  2062. this.options.cookie = false; // Make sure that the cookie extension is disabled
  2063. return;
  2064. }
  2065. var sortOrderCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortOrder);
  2066. var sortOrderNameCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortName);
  2067. var pageNumberCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageNumber);
  2068. var pageListCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageList);
  2069. var searchTextCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.searchText);
  2070. var columnsCookieValue = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.columns);
  2071. if (typeof columnsCookieValue === 'boolean' && !columnsCookieValue) {
  2072. throw new Error('The cookie value of filterBy must be a json!');
  2073. }
  2074. var columnsCookie = {};
  2075. try {
  2076. columnsCookie = JSON.parse(columnsCookieValue);
  2077. } catch (e) {
  2078. throw new Error('Could not parse the json of the columns cookie!', columnsCookieValue);
  2079. } // sortOrder
  2080. this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder; // sortName
  2081. this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName; // pageNumber
  2082. this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber; // pageSize
  2083. this.options.pageSize = pageListCookie ? pageListCookie === this.options.formatAllRows() ? pageListCookie : +pageListCookie : this.options.pageSize; // searchText
  2084. this.options.searchText = searchTextCookie ? searchTextCookie : '';
  2085. if (columnsCookie) {
  2086. var _iterator = _createForOfIteratorHelper(this.columns),
  2087. _step;
  2088. try {
  2089. var _loop = function _loop() {
  2090. var column = _step.value;
  2091. column.visible = columnsCookie.filter(function (columnField) {
  2092. if (_this.isSelectionColumn(column)) {
  2093. return true;
  2094. }
  2095. /**
  2096. * This is needed for the old saved cookies or the table will show no columns!
  2097. * It can be removed in 2-3 Versions Later!!
  2098. * TODO: Remove this part some versions later e.g. 1.17.3
  2099. */
  2100. if (columnField instanceof Object) {
  2101. return columnField.field === column.field;
  2102. }
  2103. return columnField === column.field;
  2104. }).length > 0 || !column.switchable;
  2105. };
  2106. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  2107. _loop();
  2108. }
  2109. } catch (err) {
  2110. _iterator.e(err);
  2111. } finally {
  2112. _iterator.f();
  2113. }
  2114. }
  2115. }
  2116. }, {
  2117. key: "getCookies",
  2118. value: function getCookies() {
  2119. var bootstrapTable = this;
  2120. var cookies = {};
  2121. $__default['default'].each(UtilsCookie.cookieIds, function (key, value) {
  2122. cookies[key] = UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, value);
  2123. if (key === 'columns') {
  2124. cookies[key] = JSON.parse(cookies[key]);
  2125. }
  2126. });
  2127. return cookies;
  2128. }
  2129. }, {
  2130. key: "deleteCookie",
  2131. value: function deleteCookie(cookieName) {
  2132. if (cookieName === '' || !UtilsCookie.cookieEnabled()) {
  2133. return;
  2134. }
  2135. UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds[cookieName]);
  2136. }
  2137. }]);
  2138. return _class;
  2139. }($__default['default'].BootstrapTable);
  2140. })));