bootstrap-table-cookie.js 106 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073
  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. Object.defineProperty(Constructor, "prototype", {
  26. writable: false
  27. });
  28. return Constructor;
  29. }
  30. function _inherits(subClass, superClass) {
  31. if (typeof superClass !== "function" && superClass !== null) {
  32. throw new TypeError("Super expression must either be null or a function");
  33. }
  34. subClass.prototype = Object.create(superClass && superClass.prototype, {
  35. constructor: {
  36. value: subClass,
  37. writable: true,
  38. configurable: true
  39. }
  40. });
  41. Object.defineProperty(subClass, "prototype", {
  42. writable: false
  43. });
  44. if (superClass) _setPrototypeOf(subClass, superClass);
  45. }
  46. function _getPrototypeOf(o) {
  47. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  48. return o.__proto__ || Object.getPrototypeOf(o);
  49. };
  50. return _getPrototypeOf(o);
  51. }
  52. function _setPrototypeOf(o, p) {
  53. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  54. o.__proto__ = p;
  55. return o;
  56. };
  57. return _setPrototypeOf(o, p);
  58. }
  59. function _isNativeReflectConstruct() {
  60. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  61. if (Reflect.construct.sham) return false;
  62. if (typeof Proxy === "function") return true;
  63. try {
  64. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  65. return true;
  66. } catch (e) {
  67. return false;
  68. }
  69. }
  70. function _assertThisInitialized(self) {
  71. if (self === void 0) {
  72. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  73. }
  74. return self;
  75. }
  76. function _possibleConstructorReturn(self, call) {
  77. if (call && (typeof call === "object" || typeof call === "function")) {
  78. return call;
  79. } else if (call !== void 0) {
  80. throw new TypeError("Derived constructors may only return object or undefined");
  81. }
  82. return _assertThisInitialized(self);
  83. }
  84. function _createSuper(Derived) {
  85. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  86. return function _createSuperInternal() {
  87. var Super = _getPrototypeOf(Derived),
  88. result;
  89. if (hasNativeReflectConstruct) {
  90. var NewTarget = _getPrototypeOf(this).constructor;
  91. result = Reflect.construct(Super, arguments, NewTarget);
  92. } else {
  93. result = Super.apply(this, arguments);
  94. }
  95. return _possibleConstructorReturn(this, result);
  96. };
  97. }
  98. function _superPropBase(object, property) {
  99. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  100. object = _getPrototypeOf(object);
  101. if (object === null) break;
  102. }
  103. return object;
  104. }
  105. function _get() {
  106. if (typeof Reflect !== "undefined" && Reflect.get) {
  107. _get = Reflect.get;
  108. } else {
  109. _get = function _get(target, property, receiver) {
  110. var base = _superPropBase(target, property);
  111. if (!base) return;
  112. var desc = Object.getOwnPropertyDescriptor(base, property);
  113. if (desc.get) {
  114. return desc.get.call(arguments.length < 3 ? target : receiver);
  115. }
  116. return desc.value;
  117. };
  118. }
  119. return _get.apply(this, arguments);
  120. }
  121. function _unsupportedIterableToArray(o, minLen) {
  122. if (!o) return;
  123. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  124. var n = Object.prototype.toString.call(o).slice(8, -1);
  125. if (n === "Object" && o.constructor) n = o.constructor.name;
  126. if (n === "Map" || n === "Set") return Array.from(o);
  127. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  128. }
  129. function _arrayLikeToArray(arr, len) {
  130. if (len == null || len > arr.length) len = arr.length;
  131. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  132. return arr2;
  133. }
  134. function _createForOfIteratorHelper(o, allowArrayLike) {
  135. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  136. if (!it) {
  137. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  138. if (it) o = it;
  139. var i = 0;
  140. var F = function () {};
  141. return {
  142. s: F,
  143. n: function () {
  144. if (i >= o.length) return {
  145. done: true
  146. };
  147. return {
  148. done: false,
  149. value: o[i++]
  150. };
  151. },
  152. e: function (e) {
  153. throw e;
  154. },
  155. f: F
  156. };
  157. }
  158. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  159. }
  160. var normalCompletion = true,
  161. didErr = false,
  162. err;
  163. return {
  164. s: function () {
  165. it = it.call(o);
  166. },
  167. n: function () {
  168. var step = it.next();
  169. normalCompletion = step.done;
  170. return step;
  171. },
  172. e: function (e) {
  173. didErr = true;
  174. err = e;
  175. },
  176. f: function () {
  177. try {
  178. if (!normalCompletion && it.return != null) it.return();
  179. } finally {
  180. if (didErr) throw err;
  181. }
  182. }
  183. };
  184. }
  185. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  186. function createCommonjsModule(fn, module) {
  187. return module = { exports: {} }, fn(module, module.exports), module.exports;
  188. }
  189. var check = function (it) {
  190. return it && it.Math == Math && it;
  191. };
  192. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  193. var global_1 =
  194. // eslint-disable-next-line es/no-global-this -- safe
  195. check(typeof globalThis == 'object' && globalThis) ||
  196. check(typeof window == 'object' && window) ||
  197. // eslint-disable-next-line no-restricted-globals -- safe
  198. check(typeof self == 'object' && self) ||
  199. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  200. // eslint-disable-next-line no-new-func -- fallback
  201. (function () { return this; })() || Function('return this')();
  202. var fails = function (exec) {
  203. try {
  204. return !!exec();
  205. } catch (error) {
  206. return true;
  207. }
  208. };
  209. // Detect IE8's incomplete defineProperty implementation
  210. var descriptors = !fails(function () {
  211. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  212. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  213. });
  214. var functionBindNative = !fails(function () {
  215. var test = (function () { /* empty */ }).bind();
  216. // eslint-disable-next-line no-prototype-builtins -- safe
  217. return typeof test != 'function' || test.hasOwnProperty('prototype');
  218. });
  219. var call$2 = Function.prototype.call;
  220. var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
  221. return call$2.apply(call$2, arguments);
  222. };
  223. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  224. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  225. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  226. // Nashorn ~ JDK8 bug
  227. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  228. // `Object.prototype.propertyIsEnumerable` method implementation
  229. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  230. var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  231. var descriptor = getOwnPropertyDescriptor$1(this, V);
  232. return !!descriptor && descriptor.enumerable;
  233. } : $propertyIsEnumerable;
  234. var objectPropertyIsEnumerable = {
  235. f: f$5
  236. };
  237. var createPropertyDescriptor = function (bitmap, value) {
  238. return {
  239. enumerable: !(bitmap & 1),
  240. configurable: !(bitmap & 2),
  241. writable: !(bitmap & 4),
  242. value: value
  243. };
  244. };
  245. var FunctionPrototype$2 = Function.prototype;
  246. var bind$1 = FunctionPrototype$2.bind;
  247. var call$1 = FunctionPrototype$2.call;
  248. var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
  249. var functionUncurryThis = functionBindNative ? function (fn) {
  250. return fn && uncurryThis(fn);
  251. } : function (fn) {
  252. return fn && function () {
  253. return call$1.apply(fn, arguments);
  254. };
  255. };
  256. var toString$1 = functionUncurryThis({}.toString);
  257. var stringSlice$5 = functionUncurryThis(''.slice);
  258. var classofRaw = function (it) {
  259. return stringSlice$5(toString$1(it), 8, -1);
  260. };
  261. var Object$4 = global_1.Object;
  262. var split = functionUncurryThis(''.split);
  263. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  264. var indexedObject = fails(function () {
  265. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  266. // eslint-disable-next-line no-prototype-builtins -- safe
  267. return !Object$4('z').propertyIsEnumerable(0);
  268. }) ? function (it) {
  269. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  270. } : Object$4;
  271. var TypeError$b = global_1.TypeError;
  272. // `RequireObjectCoercible` abstract operation
  273. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  274. var requireObjectCoercible = function (it) {
  275. if (it == undefined) throw TypeError$b("Can't call method on " + it);
  276. return it;
  277. };
  278. // toObject with fallback for non-array-like ES3 strings
  279. var toIndexedObject = function (it) {
  280. return indexedObject(requireObjectCoercible(it));
  281. };
  282. // `IsCallable` abstract operation
  283. // https://tc39.es/ecma262/#sec-iscallable
  284. var isCallable = function (argument) {
  285. return typeof argument == 'function';
  286. };
  287. var isObject = function (it) {
  288. return typeof it == 'object' ? it !== null : isCallable(it);
  289. };
  290. var aFunction = function (argument) {
  291. return isCallable(argument) ? argument : undefined;
  292. };
  293. var getBuiltIn = function (namespace, method) {
  294. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  295. };
  296. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  297. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  298. var process = global_1.process;
  299. var Deno = global_1.Deno;
  300. var versions = process && process.versions || Deno && Deno.version;
  301. var v8 = versions && versions.v8;
  302. var match, version;
  303. if (v8) {
  304. match = v8.split('.');
  305. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  306. // but their correct versions are not interesting for us
  307. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  308. }
  309. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  310. // so check `userAgent` even if `.v8` exists, but 0
  311. if (!version && engineUserAgent) {
  312. match = engineUserAgent.match(/Edge\/(\d+)/);
  313. if (!match || match[1] >= 74) {
  314. match = engineUserAgent.match(/Chrome\/(\d+)/);
  315. if (match) version = +match[1];
  316. }
  317. }
  318. var engineV8Version = version;
  319. /* eslint-disable es/no-symbol -- required for testing */
  320. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  321. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  322. var symbol = Symbol();
  323. // Chrome 38 Symbol has incorrect toString conversion
  324. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  325. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  326. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  327. !Symbol.sham && engineV8Version && engineV8Version < 41;
  328. });
  329. /* eslint-disable es/no-symbol -- required for testing */
  330. var useSymbolAsUid = nativeSymbol
  331. && !Symbol.sham
  332. && typeof Symbol.iterator == 'symbol';
  333. var Object$3 = global_1.Object;
  334. var isSymbol = useSymbolAsUid ? function (it) {
  335. return typeof it == 'symbol';
  336. } : function (it) {
  337. var $Symbol = getBuiltIn('Symbol');
  338. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  339. };
  340. var String$3 = global_1.String;
  341. var tryToString = function (argument) {
  342. try {
  343. return String$3(argument);
  344. } catch (error) {
  345. return 'Object';
  346. }
  347. };
  348. var TypeError$a = global_1.TypeError;
  349. // `Assert: IsCallable(argument) is true`
  350. var aCallable = function (argument) {
  351. if (isCallable(argument)) return argument;
  352. throw TypeError$a(tryToString(argument) + ' is not a function');
  353. };
  354. // `GetMethod` abstract operation
  355. // https://tc39.es/ecma262/#sec-getmethod
  356. var getMethod = function (V, P) {
  357. var func = V[P];
  358. return func == null ? undefined : aCallable(func);
  359. };
  360. var TypeError$9 = global_1.TypeError;
  361. // `OrdinaryToPrimitive` abstract operation
  362. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  363. var ordinaryToPrimitive = function (input, pref) {
  364. var fn, val;
  365. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  366. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  367. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  368. throw TypeError$9("Can't convert object to primitive value");
  369. };
  370. // eslint-disable-next-line es/no-object-defineproperty -- safe
  371. var defineProperty = Object.defineProperty;
  372. var setGlobal = function (key, value) {
  373. try {
  374. defineProperty(global_1, key, { value: value, configurable: true, writable: true });
  375. } catch (error) {
  376. global_1[key] = value;
  377. } return value;
  378. };
  379. var SHARED = '__core-js_shared__';
  380. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  381. var sharedStore = store$1;
  382. var shared = createCommonjsModule(function (module) {
  383. (module.exports = function (key, value) {
  384. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  385. })('versions', []).push({
  386. version: '3.21.1',
  387. mode: 'global',
  388. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  389. license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
  390. source: 'https://github.com/zloirock/core-js'
  391. });
  392. });
  393. var Object$2 = global_1.Object;
  394. // `ToObject` abstract operation
  395. // https://tc39.es/ecma262/#sec-toobject
  396. var toObject = function (argument) {
  397. return Object$2(requireObjectCoercible(argument));
  398. };
  399. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  400. // `HasOwnProperty` abstract operation
  401. // https://tc39.es/ecma262/#sec-hasownproperty
  402. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  403. return hasOwnProperty(toObject(it), key);
  404. };
  405. var id = 0;
  406. var postfix = Math.random();
  407. var toString = functionUncurryThis(1.0.toString);
  408. var uid = function (key) {
  409. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  410. };
  411. var WellKnownSymbolsStore = shared('wks');
  412. var Symbol$1 = global_1.Symbol;
  413. var symbolFor = Symbol$1 && Symbol$1['for'];
  414. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  415. var wellKnownSymbol = function (name) {
  416. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  417. var description = 'Symbol.' + name;
  418. if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
  419. WellKnownSymbolsStore[name] = Symbol$1[name];
  420. } else if (useSymbolAsUid && symbolFor) {
  421. WellKnownSymbolsStore[name] = symbolFor(description);
  422. } else {
  423. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  424. }
  425. } return WellKnownSymbolsStore[name];
  426. };
  427. var TypeError$8 = global_1.TypeError;
  428. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  429. // `ToPrimitive` abstract operation
  430. // https://tc39.es/ecma262/#sec-toprimitive
  431. var toPrimitive = function (input, pref) {
  432. if (!isObject(input) || isSymbol(input)) return input;
  433. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  434. var result;
  435. if (exoticToPrim) {
  436. if (pref === undefined) pref = 'default';
  437. result = functionCall(exoticToPrim, input, pref);
  438. if (!isObject(result) || isSymbol(result)) return result;
  439. throw TypeError$8("Can't convert object to primitive value");
  440. }
  441. if (pref === undefined) pref = 'number';
  442. return ordinaryToPrimitive(input, pref);
  443. };
  444. // `ToPropertyKey` abstract operation
  445. // https://tc39.es/ecma262/#sec-topropertykey
  446. var toPropertyKey = function (argument) {
  447. var key = toPrimitive(argument, 'string');
  448. return isSymbol(key) ? key : key + '';
  449. };
  450. var document$1 = global_1.document;
  451. // typeof document.createElement is 'object' in old IE
  452. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  453. var documentCreateElement = function (it) {
  454. return EXISTS$1 ? document$1.createElement(it) : {};
  455. };
  456. // Thanks to IE8 for its funny defineProperty
  457. var ie8DomDefine = !descriptors && !fails(function () {
  458. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  459. return Object.defineProperty(documentCreateElement('div'), 'a', {
  460. get: function () { return 7; }
  461. }).a != 7;
  462. });
  463. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  464. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  465. // `Object.getOwnPropertyDescriptor` method
  466. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  467. var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  468. O = toIndexedObject(O);
  469. P = toPropertyKey(P);
  470. if (ie8DomDefine) try {
  471. return $getOwnPropertyDescriptor$1(O, P);
  472. } catch (error) { /* empty */ }
  473. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  474. };
  475. var objectGetOwnPropertyDescriptor = {
  476. f: f$4
  477. };
  478. // V8 ~ Chrome 36-
  479. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  480. var v8PrototypeDefineBug = descriptors && fails(function () {
  481. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  482. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  483. value: 42,
  484. writable: false
  485. }).prototype != 42;
  486. });
  487. var String$2 = global_1.String;
  488. var TypeError$7 = global_1.TypeError;
  489. // `Assert: Type(argument) is Object`
  490. var anObject = function (argument) {
  491. if (isObject(argument)) return argument;
  492. throw TypeError$7(String$2(argument) + ' is not an object');
  493. };
  494. var TypeError$6 = global_1.TypeError;
  495. // eslint-disable-next-line es/no-object-defineproperty -- safe
  496. var $defineProperty = Object.defineProperty;
  497. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  498. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  499. var ENUMERABLE = 'enumerable';
  500. var CONFIGURABLE$1 = 'configurable';
  501. var WRITABLE = 'writable';
  502. // `Object.defineProperty` method
  503. // https://tc39.es/ecma262/#sec-object.defineproperty
  504. var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  505. anObject(O);
  506. P = toPropertyKey(P);
  507. anObject(Attributes);
  508. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  509. var current = $getOwnPropertyDescriptor(O, P);
  510. if (current && current[WRITABLE]) {
  511. O[P] = Attributes.value;
  512. Attributes = {
  513. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  514. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  515. writable: false
  516. };
  517. }
  518. } return $defineProperty(O, P, Attributes);
  519. } : $defineProperty : function defineProperty(O, P, Attributes) {
  520. anObject(O);
  521. P = toPropertyKey(P);
  522. anObject(Attributes);
  523. if (ie8DomDefine) try {
  524. return $defineProperty(O, P, Attributes);
  525. } catch (error) { /* empty */ }
  526. if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
  527. if ('value' in Attributes) O[P] = Attributes.value;
  528. return O;
  529. };
  530. var objectDefineProperty = {
  531. f: f$3
  532. };
  533. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  534. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  535. } : function (object, key, value) {
  536. object[key] = value;
  537. return object;
  538. };
  539. var functionToString = functionUncurryThis(Function.toString);
  540. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  541. if (!isCallable(sharedStore.inspectSource)) {
  542. sharedStore.inspectSource = function (it) {
  543. return functionToString(it);
  544. };
  545. }
  546. var inspectSource = sharedStore.inspectSource;
  547. var WeakMap$1 = global_1.WeakMap;
  548. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  549. var keys = shared('keys');
  550. var sharedKey = function (key) {
  551. return keys[key] || (keys[key] = uid(key));
  552. };
  553. var hiddenKeys$1 = {};
  554. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  555. var TypeError$5 = global_1.TypeError;
  556. var WeakMap = global_1.WeakMap;
  557. var set, get, has;
  558. var enforce = function (it) {
  559. return has(it) ? get(it) : set(it, {});
  560. };
  561. var getterFor = function (TYPE) {
  562. return function (it) {
  563. var state;
  564. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  565. throw TypeError$5('Incompatible receiver, ' + TYPE + ' required');
  566. } return state;
  567. };
  568. };
  569. if (nativeWeakMap || sharedStore.state) {
  570. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  571. var wmget = functionUncurryThis(store.get);
  572. var wmhas = functionUncurryThis(store.has);
  573. var wmset = functionUncurryThis(store.set);
  574. set = function (it, metadata) {
  575. if (wmhas(store, it)) throw new TypeError$5(OBJECT_ALREADY_INITIALIZED);
  576. metadata.facade = it;
  577. wmset(store, it, metadata);
  578. return metadata;
  579. };
  580. get = function (it) {
  581. return wmget(store, it) || {};
  582. };
  583. has = function (it) {
  584. return wmhas(store, it);
  585. };
  586. } else {
  587. var STATE = sharedKey('state');
  588. hiddenKeys$1[STATE] = true;
  589. set = function (it, metadata) {
  590. if (hasOwnProperty_1(it, STATE)) throw new TypeError$5(OBJECT_ALREADY_INITIALIZED);
  591. metadata.facade = it;
  592. createNonEnumerableProperty(it, STATE, metadata);
  593. return metadata;
  594. };
  595. get = function (it) {
  596. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  597. };
  598. has = function (it) {
  599. return hasOwnProperty_1(it, STATE);
  600. };
  601. }
  602. var internalState = {
  603. set: set,
  604. get: get,
  605. has: has,
  606. enforce: enforce,
  607. getterFor: getterFor
  608. };
  609. var FunctionPrototype$1 = Function.prototype;
  610. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  611. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  612. var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
  613. // additional protection from minified / mangled / dropped function names
  614. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  615. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
  616. var functionName = {
  617. EXISTS: EXISTS,
  618. PROPER: PROPER,
  619. CONFIGURABLE: CONFIGURABLE
  620. };
  621. var redefine = createCommonjsModule(function (module) {
  622. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  623. var getInternalState = internalState.get;
  624. var enforceInternalState = internalState.enforce;
  625. var TEMPLATE = String(String).split('String');
  626. (module.exports = function (O, key, value, options) {
  627. var unsafe = options ? !!options.unsafe : false;
  628. var simple = options ? !!options.enumerable : false;
  629. var noTargetGet = options ? !!options.noTargetGet : false;
  630. var name = options && options.name !== undefined ? options.name : key;
  631. var state;
  632. if (isCallable(value)) {
  633. if (String(name).slice(0, 7) === 'Symbol(') {
  634. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  635. }
  636. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  637. createNonEnumerableProperty(value, 'name', name);
  638. }
  639. state = enforceInternalState(value);
  640. if (!state.source) {
  641. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  642. }
  643. }
  644. if (O === global_1) {
  645. if (simple) O[key] = value;
  646. else setGlobal(key, value);
  647. return;
  648. } else if (!unsafe) {
  649. delete O[key];
  650. } else if (!noTargetGet && O[key]) {
  651. simple = true;
  652. }
  653. if (simple) O[key] = value;
  654. else createNonEnumerableProperty(O, key, value);
  655. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  656. })(Function.prototype, 'toString', function toString() {
  657. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  658. });
  659. });
  660. var ceil = Math.ceil;
  661. var floor$1 = Math.floor;
  662. // `ToIntegerOrInfinity` abstract operation
  663. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  664. var toIntegerOrInfinity = function (argument) {
  665. var number = +argument;
  666. // eslint-disable-next-line no-self-compare -- safe
  667. return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
  668. };
  669. var max$2 = Math.max;
  670. var min$3 = Math.min;
  671. // Helper for a popular repeating case of the spec:
  672. // Let integer be ? ToInteger(index).
  673. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  674. var toAbsoluteIndex = function (index, length) {
  675. var integer = toIntegerOrInfinity(index);
  676. return integer < 0 ? max$2(integer + length, 0) : min$3(integer, length);
  677. };
  678. var min$2 = Math.min;
  679. // `ToLength` abstract operation
  680. // https://tc39.es/ecma262/#sec-tolength
  681. var toLength = function (argument) {
  682. return argument > 0 ? min$2(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  683. };
  684. // `LengthOfArrayLike` abstract operation
  685. // https://tc39.es/ecma262/#sec-lengthofarraylike
  686. var lengthOfArrayLike = function (obj) {
  687. return toLength(obj.length);
  688. };
  689. // `Array.prototype.{ indexOf, includes }` methods implementation
  690. var createMethod$2 = function (IS_INCLUDES) {
  691. return function ($this, el, fromIndex) {
  692. var O = toIndexedObject($this);
  693. var length = lengthOfArrayLike(O);
  694. var index = toAbsoluteIndex(fromIndex, length);
  695. var value;
  696. // Array#includes uses SameValueZero equality algorithm
  697. // eslint-disable-next-line no-self-compare -- NaN check
  698. if (IS_INCLUDES && el != el) while (length > index) {
  699. value = O[index++];
  700. // eslint-disable-next-line no-self-compare -- NaN check
  701. if (value != value) return true;
  702. // Array#indexOf ignores holes, Array#includes - not
  703. } else for (;length > index; index++) {
  704. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  705. } return !IS_INCLUDES && -1;
  706. };
  707. };
  708. var arrayIncludes = {
  709. // `Array.prototype.includes` method
  710. // https://tc39.es/ecma262/#sec-array.prototype.includes
  711. includes: createMethod$2(true),
  712. // `Array.prototype.indexOf` method
  713. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  714. indexOf: createMethod$2(false)
  715. };
  716. var indexOf$1 = arrayIncludes.indexOf;
  717. var push$3 = functionUncurryThis([].push);
  718. var objectKeysInternal = function (object, names) {
  719. var O = toIndexedObject(object);
  720. var i = 0;
  721. var result = [];
  722. var key;
  723. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$3(result, key);
  724. // Don't enum bug & hidden keys
  725. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  726. ~indexOf$1(result, key) || push$3(result, key);
  727. }
  728. return result;
  729. };
  730. // IE8- don't enum bug keys
  731. var enumBugKeys = [
  732. 'constructor',
  733. 'hasOwnProperty',
  734. 'isPrototypeOf',
  735. 'propertyIsEnumerable',
  736. 'toLocaleString',
  737. 'toString',
  738. 'valueOf'
  739. ];
  740. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  741. // `Object.getOwnPropertyNames` method
  742. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  743. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  744. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  745. return objectKeysInternal(O, hiddenKeys);
  746. };
  747. var objectGetOwnPropertyNames = {
  748. f: f$2
  749. };
  750. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  751. var f$1 = Object.getOwnPropertySymbols;
  752. var objectGetOwnPropertySymbols = {
  753. f: f$1
  754. };
  755. var concat$1 = functionUncurryThis([].concat);
  756. // all object keys, includes non-enumerable and symbols
  757. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  758. var keys = objectGetOwnPropertyNames.f(anObject(it));
  759. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  760. return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
  761. };
  762. var copyConstructorProperties = function (target, source, exceptions) {
  763. var keys = ownKeys(source);
  764. var defineProperty = objectDefineProperty.f;
  765. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  766. for (var i = 0; i < keys.length; i++) {
  767. var key = keys[i];
  768. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  769. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  770. }
  771. }
  772. };
  773. var replacement = /#|\.prototype\./;
  774. var isForced = function (feature, detection) {
  775. var value = data[normalize(feature)];
  776. return value == POLYFILL ? true
  777. : value == NATIVE ? false
  778. : isCallable(detection) ? fails(detection)
  779. : !!detection;
  780. };
  781. var normalize = isForced.normalize = function (string) {
  782. return String(string).replace(replacement, '.').toLowerCase();
  783. };
  784. var data = isForced.data = {};
  785. var NATIVE = isForced.NATIVE = 'N';
  786. var POLYFILL = isForced.POLYFILL = 'P';
  787. var isForced_1 = isForced;
  788. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  789. /*
  790. options.target - name of the target object
  791. options.global - target is the global object
  792. options.stat - export as static methods of target
  793. options.proto - export as prototype methods of target
  794. options.real - real prototype method for the `pure` version
  795. options.forced - export even if the native feature is available
  796. options.bind - bind methods to the target, required for the `pure` version
  797. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  798. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  799. options.sham - add a flag to not completely full polyfills
  800. options.enumerable - export as enumerable property
  801. options.noTargetGet - prevent calling a getter on target
  802. options.name - the .name of the function if it does not match the key
  803. */
  804. var _export = function (options, source) {
  805. var TARGET = options.target;
  806. var GLOBAL = options.global;
  807. var STATIC = options.stat;
  808. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  809. if (GLOBAL) {
  810. target = global_1;
  811. } else if (STATIC) {
  812. target = global_1[TARGET] || setGlobal(TARGET, {});
  813. } else {
  814. target = (global_1[TARGET] || {}).prototype;
  815. }
  816. if (target) for (key in source) {
  817. sourceProperty = source[key];
  818. if (options.noTargetGet) {
  819. descriptor = getOwnPropertyDescriptor(target, key);
  820. targetProperty = descriptor && descriptor.value;
  821. } else targetProperty = target[key];
  822. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  823. // contained in target
  824. if (!FORCED && targetProperty !== undefined) {
  825. if (typeof sourceProperty == typeof targetProperty) continue;
  826. copyConstructorProperties(sourceProperty, targetProperty);
  827. }
  828. // add a flag to not completely full polyfills
  829. if (options.sham || (targetProperty && targetProperty.sham)) {
  830. createNonEnumerableProperty(sourceProperty, 'sham', true);
  831. }
  832. // extend global
  833. redefine(target, key, sourceProperty, options);
  834. }
  835. };
  836. // `Object.keys` method
  837. // https://tc39.es/ecma262/#sec-object.keys
  838. // eslint-disable-next-line es/no-object-keys -- safe
  839. var objectKeys = Object.keys || function keys(O) {
  840. return objectKeysInternal(O, enumBugKeys);
  841. };
  842. // `Object.defineProperties` method
  843. // https://tc39.es/ecma262/#sec-object.defineproperties
  844. // eslint-disable-next-line es/no-object-defineproperties -- safe
  845. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  846. anObject(O);
  847. var props = toIndexedObject(Properties);
  848. var keys = objectKeys(Properties);
  849. var length = keys.length;
  850. var index = 0;
  851. var key;
  852. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  853. return O;
  854. };
  855. var objectDefineProperties = {
  856. f: f
  857. };
  858. var html = getBuiltIn('document', 'documentElement');
  859. /* global ActiveXObject -- old IE, WSH */
  860. var GT = '>';
  861. var LT = '<';
  862. var PROTOTYPE = 'prototype';
  863. var SCRIPT = 'script';
  864. var IE_PROTO = sharedKey('IE_PROTO');
  865. var EmptyConstructor = function () { /* empty */ };
  866. var scriptTag = function (content) {
  867. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  868. };
  869. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  870. var NullProtoObjectViaActiveX = function (activeXDocument) {
  871. activeXDocument.write(scriptTag(''));
  872. activeXDocument.close();
  873. var temp = activeXDocument.parentWindow.Object;
  874. activeXDocument = null; // avoid memory leak
  875. return temp;
  876. };
  877. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  878. var NullProtoObjectViaIFrame = function () {
  879. // Thrash, waste and sodomy: IE GC bug
  880. var iframe = documentCreateElement('iframe');
  881. var JS = 'java' + SCRIPT + ':';
  882. var iframeDocument;
  883. iframe.style.display = 'none';
  884. html.appendChild(iframe);
  885. // https://github.com/zloirock/core-js/issues/475
  886. iframe.src = String(JS);
  887. iframeDocument = iframe.contentWindow.document;
  888. iframeDocument.open();
  889. iframeDocument.write(scriptTag('document.F=Object'));
  890. iframeDocument.close();
  891. return iframeDocument.F;
  892. };
  893. // Check for document.domain and active x support
  894. // No need to use active x approach when document.domain is not set
  895. // see https://github.com/es-shims/es5-shim/issues/150
  896. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  897. // avoid IE GC bug
  898. var activeXDocument;
  899. var NullProtoObject = function () {
  900. try {
  901. activeXDocument = new ActiveXObject('htmlfile');
  902. } catch (error) { /* ignore */ }
  903. NullProtoObject = typeof document != 'undefined'
  904. ? document.domain && activeXDocument
  905. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  906. : NullProtoObjectViaIFrame()
  907. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  908. var length = enumBugKeys.length;
  909. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  910. return NullProtoObject();
  911. };
  912. hiddenKeys$1[IE_PROTO] = true;
  913. // `Object.create` method
  914. // https://tc39.es/ecma262/#sec-object.create
  915. var objectCreate = Object.create || function create(O, Properties) {
  916. var result;
  917. if (O !== null) {
  918. EmptyConstructor[PROTOTYPE] = anObject(O);
  919. result = new EmptyConstructor();
  920. EmptyConstructor[PROTOTYPE] = null;
  921. // add "__proto__" for Object.getPrototypeOf polyfill
  922. result[IE_PROTO] = O;
  923. } else result = NullProtoObject();
  924. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  925. };
  926. var UNSCOPABLES = wellKnownSymbol('unscopables');
  927. var ArrayPrototype = Array.prototype;
  928. // Array.prototype[@@unscopables]
  929. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  930. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  931. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  932. configurable: true,
  933. value: objectCreate(null)
  934. });
  935. }
  936. // add a key to Array.prototype[@@unscopables]
  937. var addToUnscopables = function (key) {
  938. ArrayPrototype[UNSCOPABLES][key] = true;
  939. };
  940. var $includes = arrayIncludes.includes;
  941. // `Array.prototype.includes` method
  942. // https://tc39.es/ecma262/#sec-array.prototype.includes
  943. _export({ target: 'Array', proto: true }, {
  944. includes: function includes(el /* , fromIndex = 0 */) {
  945. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  946. }
  947. });
  948. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  949. addToUnscopables('includes');
  950. var MATCH$1 = wellKnownSymbol('match');
  951. // `IsRegExp` abstract operation
  952. // https://tc39.es/ecma262/#sec-isregexp
  953. var isRegexp = function (it) {
  954. var isRegExp;
  955. return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  956. };
  957. var TypeError$4 = global_1.TypeError;
  958. var notARegexp = function (it) {
  959. if (isRegexp(it)) {
  960. throw TypeError$4("The method doesn't accept regular expressions");
  961. } return it;
  962. };
  963. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  964. var test = {};
  965. test[TO_STRING_TAG$1] = 'z';
  966. var toStringTagSupport = String(test) === '[object z]';
  967. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  968. var Object$1 = global_1.Object;
  969. // ES3 wrong here
  970. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  971. // fallback for IE11 Script Access Denied error
  972. var tryGet = function (it, key) {
  973. try {
  974. return it[key];
  975. } catch (error) { /* empty */ }
  976. };
  977. // getting tag from ES6+ `Object.prototype.toString`
  978. var classof = toStringTagSupport ? classofRaw : function (it) {
  979. var O, tag, result;
  980. return it === undefined ? 'Undefined' : it === null ? 'Null'
  981. // @@toStringTag case
  982. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  983. // builtinTag case
  984. : CORRECT_ARGUMENTS ? classofRaw(O)
  985. // ES3 arguments fallback
  986. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  987. };
  988. var String$1 = global_1.String;
  989. var toString_1 = function (argument) {
  990. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  991. return String$1(argument);
  992. };
  993. var MATCH = wellKnownSymbol('match');
  994. var correctIsRegexpLogic = function (METHOD_NAME) {
  995. var regexp = /./;
  996. try {
  997. '/./'[METHOD_NAME](regexp);
  998. } catch (error1) {
  999. try {
  1000. regexp[MATCH] = false;
  1001. return '/./'[METHOD_NAME](regexp);
  1002. } catch (error2) { /* empty */ }
  1003. } return false;
  1004. };
  1005. var stringIndexOf$1 = functionUncurryThis(''.indexOf);
  1006. // `String.prototype.includes` method
  1007. // https://tc39.es/ecma262/#sec-string.prototype.includes
  1008. _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
  1009. includes: function includes(searchString /* , position = 0 */) {
  1010. return !!~stringIndexOf$1(
  1011. toString_1(requireObjectCoercible(this)),
  1012. toString_1(notARegexp(searchString)),
  1013. arguments.length > 1 ? arguments[1] : undefined
  1014. );
  1015. }
  1016. });
  1017. // `IsArray` abstract operation
  1018. // https://tc39.es/ecma262/#sec-isarray
  1019. // eslint-disable-next-line es/no-array-isarray -- safe
  1020. var isArray = Array.isArray || function isArray(argument) {
  1021. return classofRaw(argument) == 'Array';
  1022. };
  1023. var createProperty = function (object, key, value) {
  1024. var propertyKey = toPropertyKey(key);
  1025. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1026. else object[propertyKey] = value;
  1027. };
  1028. var noop = function () { /* empty */ };
  1029. var empty = [];
  1030. var construct = getBuiltIn('Reflect', 'construct');
  1031. var constructorRegExp = /^\s*(?:class|function)\b/;
  1032. var exec$1 = functionUncurryThis(constructorRegExp.exec);
  1033. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  1034. var isConstructorModern = function isConstructor(argument) {
  1035. if (!isCallable(argument)) return false;
  1036. try {
  1037. construct(noop, empty, argument);
  1038. return true;
  1039. } catch (error) {
  1040. return false;
  1041. }
  1042. };
  1043. var isConstructorLegacy = function isConstructor(argument) {
  1044. if (!isCallable(argument)) return false;
  1045. switch (classof(argument)) {
  1046. case 'AsyncFunction':
  1047. case 'GeneratorFunction':
  1048. case 'AsyncGeneratorFunction': return false;
  1049. }
  1050. try {
  1051. // we can't check .prototype since constructors produced by .bind haven't it
  1052. // `Function#toString` throws on some built-it function in some legacy engines
  1053. // (for example, `DOMQuad` and similar in FF41-)
  1054. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  1055. } catch (error) {
  1056. return true;
  1057. }
  1058. };
  1059. isConstructorLegacy.sham = true;
  1060. // `IsConstructor` abstract operation
  1061. // https://tc39.es/ecma262/#sec-isconstructor
  1062. var isConstructor = !construct || fails(function () {
  1063. var called;
  1064. return isConstructorModern(isConstructorModern.call)
  1065. || !isConstructorModern(Object)
  1066. || !isConstructorModern(function () { called = true; })
  1067. || called;
  1068. }) ? isConstructorLegacy : isConstructorModern;
  1069. var SPECIES$3 = wellKnownSymbol('species');
  1070. var Array$2 = global_1.Array;
  1071. // a part of `ArraySpeciesCreate` abstract operation
  1072. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1073. var arraySpeciesConstructor = function (originalArray) {
  1074. var C;
  1075. if (isArray(originalArray)) {
  1076. C = originalArray.constructor;
  1077. // cross-realm fallback
  1078. if (isConstructor(C) && (C === Array$2 || isArray(C.prototype))) C = undefined;
  1079. else if (isObject(C)) {
  1080. C = C[SPECIES$3];
  1081. if (C === null) C = undefined;
  1082. }
  1083. } return C === undefined ? Array$2 : C;
  1084. };
  1085. // `ArraySpeciesCreate` abstract operation
  1086. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1087. var arraySpeciesCreate = function (originalArray, length) {
  1088. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1089. };
  1090. var SPECIES$2 = wellKnownSymbol('species');
  1091. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1092. // We can't use this feature detection in V8 since it causes
  1093. // deoptimization and serious performance degradation
  1094. // https://github.com/zloirock/core-js/issues/677
  1095. return engineV8Version >= 51 || !fails(function () {
  1096. var array = [];
  1097. var constructor = array.constructor = {};
  1098. constructor[SPECIES$2] = function () {
  1099. return { foo: 1 };
  1100. };
  1101. return array[METHOD_NAME](Boolean).foo !== 1;
  1102. });
  1103. };
  1104. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1105. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1106. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1107. var TypeError$3 = global_1.TypeError;
  1108. // We can't use this feature detection in V8 since it causes
  1109. // deoptimization and serious performance degradation
  1110. // https://github.com/zloirock/core-js/issues/679
  1111. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1112. var array = [];
  1113. array[IS_CONCAT_SPREADABLE] = false;
  1114. return array.concat()[0] !== array;
  1115. });
  1116. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1117. var isConcatSpreadable = function (O) {
  1118. if (!isObject(O)) return false;
  1119. var spreadable = O[IS_CONCAT_SPREADABLE];
  1120. return spreadable !== undefined ? !!spreadable : isArray(O);
  1121. };
  1122. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1123. // `Array.prototype.concat` method
  1124. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1125. // with adding support of @@isConcatSpreadable and @@species
  1126. _export({ target: 'Array', proto: true, forced: FORCED }, {
  1127. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1128. concat: function concat(arg) {
  1129. var O = toObject(this);
  1130. var A = arraySpeciesCreate(O, 0);
  1131. var n = 0;
  1132. var i, k, length, len, E;
  1133. for (i = -1, length = arguments.length; i < length; i++) {
  1134. E = i === -1 ? O : arguments[i];
  1135. if (isConcatSpreadable(E)) {
  1136. len = lengthOfArrayLike(E);
  1137. if (n + len > MAX_SAFE_INTEGER) throw TypeError$3(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1138. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1139. } else {
  1140. if (n >= MAX_SAFE_INTEGER) throw TypeError$3(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1141. createProperty(A, n++, E);
  1142. }
  1143. }
  1144. A.length = n;
  1145. return A;
  1146. }
  1147. });
  1148. // `RegExp.prototype.flags` getter implementation
  1149. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1150. var regexpFlags = function () {
  1151. var that = anObject(this);
  1152. var result = '';
  1153. if (that.global) result += 'g';
  1154. if (that.ignoreCase) result += 'i';
  1155. if (that.multiline) result += 'm';
  1156. if (that.dotAll) result += 's';
  1157. if (that.unicode) result += 'u';
  1158. if (that.sticky) result += 'y';
  1159. return result;
  1160. };
  1161. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  1162. var $RegExp$2 = global_1.RegExp;
  1163. var UNSUPPORTED_Y$2 = fails(function () {
  1164. var re = $RegExp$2('a', 'y');
  1165. re.lastIndex = 2;
  1166. return re.exec('abcd') != null;
  1167. });
  1168. // UC Browser bug
  1169. // https://github.com/zloirock/core-js/issues/1008
  1170. var MISSED_STICKY = UNSUPPORTED_Y$2 || fails(function () {
  1171. return !$RegExp$2('a', 'y').sticky;
  1172. });
  1173. var BROKEN_CARET = UNSUPPORTED_Y$2 || fails(function () {
  1174. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  1175. var re = $RegExp$2('^r', 'gy');
  1176. re.lastIndex = 2;
  1177. return re.exec('str') != null;
  1178. });
  1179. var regexpStickyHelpers = {
  1180. BROKEN_CARET: BROKEN_CARET,
  1181. MISSED_STICKY: MISSED_STICKY,
  1182. UNSUPPORTED_Y: UNSUPPORTED_Y$2
  1183. };
  1184. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  1185. var $RegExp$1 = global_1.RegExp;
  1186. var regexpUnsupportedDotAll = fails(function () {
  1187. var re = $RegExp$1('.', 's');
  1188. return !(re.dotAll && re.exec('\n') && re.flags === 's');
  1189. });
  1190. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  1191. var $RegExp = global_1.RegExp;
  1192. var regexpUnsupportedNcg = fails(function () {
  1193. var re = $RegExp('(?<a>b)', 'g');
  1194. return re.exec('b').groups.a !== 'b' ||
  1195. 'b'.replace(re, '$<a>c') !== 'bc';
  1196. });
  1197. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  1198. /* eslint-disable regexp/no-useless-quantifier -- testing */
  1199. var getInternalState = internalState.get;
  1200. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  1201. var nativeExec = RegExp.prototype.exec;
  1202. var patchedExec = nativeExec;
  1203. var charAt$3 = functionUncurryThis(''.charAt);
  1204. var indexOf = functionUncurryThis(''.indexOf);
  1205. var replace$1 = functionUncurryThis(''.replace);
  1206. var stringSlice$4 = functionUncurryThis(''.slice);
  1207. var UPDATES_LAST_INDEX_WRONG = (function () {
  1208. var re1 = /a/;
  1209. var re2 = /b*/g;
  1210. functionCall(nativeExec, re1, 'a');
  1211. functionCall(nativeExec, re2, 'a');
  1212. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1213. })();
  1214. var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
  1215. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1216. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1217. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
  1218. if (PATCH) {
  1219. patchedExec = function exec(string) {
  1220. var re = this;
  1221. var state = getInternalState(re);
  1222. var str = toString_1(string);
  1223. var raw = state.raw;
  1224. var result, reCopy, lastIndex, match, i, object, group;
  1225. if (raw) {
  1226. raw.lastIndex = re.lastIndex;
  1227. result = functionCall(patchedExec, raw, str);
  1228. re.lastIndex = raw.lastIndex;
  1229. return result;
  1230. }
  1231. var groups = state.groups;
  1232. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  1233. var flags = functionCall(regexpFlags, re);
  1234. var source = re.source;
  1235. var charsAdded = 0;
  1236. var strCopy = str;
  1237. if (sticky) {
  1238. flags = replace$1(flags, 'y', '');
  1239. if (indexOf(flags, 'g') === -1) {
  1240. flags += 'g';
  1241. }
  1242. strCopy = stringSlice$4(str, re.lastIndex);
  1243. // Support anchored sticky behavior.
  1244. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
  1245. source = '(?: ' + source + ')';
  1246. strCopy = ' ' + strCopy;
  1247. charsAdded++;
  1248. }
  1249. // ^(? + rx + ) is needed, in combination with some str slicing, to
  1250. // simulate the 'y' flag.
  1251. reCopy = new RegExp('^(?:' + source + ')', flags);
  1252. }
  1253. if (NPCG_INCLUDED) {
  1254. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1255. }
  1256. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1257. match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
  1258. if (sticky) {
  1259. if (match) {
  1260. match.input = stringSlice$4(match.input, charsAdded);
  1261. match[0] = stringSlice$4(match[0], charsAdded);
  1262. match.index = re.lastIndex;
  1263. re.lastIndex += match[0].length;
  1264. } else re.lastIndex = 0;
  1265. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1266. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1267. }
  1268. if (NPCG_INCLUDED && match && match.length > 1) {
  1269. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1270. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1271. functionCall(nativeReplace, match[0], reCopy, function () {
  1272. for (i = 1; i < arguments.length - 2; i++) {
  1273. if (arguments[i] === undefined) match[i] = undefined;
  1274. }
  1275. });
  1276. }
  1277. if (match && groups) {
  1278. match.groups = object = objectCreate(null);
  1279. for (i = 0; i < groups.length; i++) {
  1280. group = groups[i];
  1281. object[group[0]] = match[group[1]];
  1282. }
  1283. }
  1284. return match;
  1285. };
  1286. }
  1287. var regexpExec = patchedExec;
  1288. // `RegExp.prototype.exec` method
  1289. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  1290. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1291. exec: regexpExec
  1292. });
  1293. var FunctionPrototype = Function.prototype;
  1294. var apply = FunctionPrototype.apply;
  1295. var call = FunctionPrototype.call;
  1296. // eslint-disable-next-line es/no-reflect -- safe
  1297. var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
  1298. return call.apply(apply, arguments);
  1299. });
  1300. // TODO: Remove from `core-js@4` since it's moved to entry points
  1301. var SPECIES$1 = wellKnownSymbol('species');
  1302. var RegExpPrototype$1 = RegExp.prototype;
  1303. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  1304. var SYMBOL = wellKnownSymbol(KEY);
  1305. var DELEGATES_TO_SYMBOL = !fails(function () {
  1306. // String methods call symbol-named RegEp methods
  1307. var O = {};
  1308. O[SYMBOL] = function () { return 7; };
  1309. return ''[KEY](O) != 7;
  1310. });
  1311. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1312. // Symbol-named RegExp methods call .exec
  1313. var execCalled = false;
  1314. var re = /a/;
  1315. if (KEY === 'split') {
  1316. // We can't use real regex here since it causes deoptimization
  1317. // and serious performance degradation in V8
  1318. // https://github.com/zloirock/core-js/issues/306
  1319. re = {};
  1320. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1321. // a new one. We need to return the patched regex when creating the new one.
  1322. re.constructor = {};
  1323. re.constructor[SPECIES$1] = function () { return re; };
  1324. re.flags = '';
  1325. re[SYMBOL] = /./[SYMBOL];
  1326. }
  1327. re.exec = function () { execCalled = true; return null; };
  1328. re[SYMBOL]('');
  1329. return !execCalled;
  1330. });
  1331. if (
  1332. !DELEGATES_TO_SYMBOL ||
  1333. !DELEGATES_TO_EXEC ||
  1334. FORCED
  1335. ) {
  1336. var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
  1337. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1338. var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
  1339. var $exec = regexp.exec;
  1340. if ($exec === regexpExec || $exec === RegExpPrototype$1.exec) {
  1341. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1342. // The native String method already delegates to @@method (this
  1343. // polyfilled function), leasing to infinite recursion.
  1344. // We avoid it by directly calling the native @@method method.
  1345. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
  1346. }
  1347. return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
  1348. }
  1349. return { done: false };
  1350. });
  1351. redefine(String.prototype, KEY, methods[0]);
  1352. redefine(RegExpPrototype$1, SYMBOL, methods[1]);
  1353. }
  1354. if (SHAM) createNonEnumerableProperty(RegExpPrototype$1[SYMBOL], 'sham', true);
  1355. };
  1356. var charAt$2 = functionUncurryThis(''.charAt);
  1357. var charCodeAt = functionUncurryThis(''.charCodeAt);
  1358. var stringSlice$3 = functionUncurryThis(''.slice);
  1359. var createMethod$1 = function (CONVERT_TO_STRING) {
  1360. return function ($this, pos) {
  1361. var S = toString_1(requireObjectCoercible($this));
  1362. var position = toIntegerOrInfinity(pos);
  1363. var size = S.length;
  1364. var first, second;
  1365. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1366. first = charCodeAt(S, position);
  1367. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1368. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  1369. ? CONVERT_TO_STRING
  1370. ? charAt$2(S, position)
  1371. : first
  1372. : CONVERT_TO_STRING
  1373. ? stringSlice$3(S, position, position + 2)
  1374. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1375. };
  1376. };
  1377. var stringMultibyte = {
  1378. // `String.prototype.codePointAt` method
  1379. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  1380. codeAt: createMethod$1(false),
  1381. // `String.prototype.at` method
  1382. // https://github.com/mathiasbynens/String.prototype.at
  1383. charAt: createMethod$1(true)
  1384. };
  1385. var charAt$1 = stringMultibyte.charAt;
  1386. // `AdvanceStringIndex` abstract operation
  1387. // https://tc39.es/ecma262/#sec-advancestringindex
  1388. var advanceStringIndex = function (S, index, unicode) {
  1389. return index + (unicode ? charAt$1(S, index).length : 1);
  1390. };
  1391. var floor = Math.floor;
  1392. var charAt = functionUncurryThis(''.charAt);
  1393. var replace = functionUncurryThis(''.replace);
  1394. var stringSlice$2 = functionUncurryThis(''.slice);
  1395. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  1396. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  1397. // `GetSubstitution` abstract operation
  1398. // https://tc39.es/ecma262/#sec-getsubstitution
  1399. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  1400. var tailPos = position + matched.length;
  1401. var m = captures.length;
  1402. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1403. if (namedCaptures !== undefined) {
  1404. namedCaptures = toObject(namedCaptures);
  1405. symbols = SUBSTITUTION_SYMBOLS;
  1406. }
  1407. return replace(replacement, symbols, function (match, ch) {
  1408. var capture;
  1409. switch (charAt(ch, 0)) {
  1410. case '$': return '$';
  1411. case '&': return matched;
  1412. case '`': return stringSlice$2(str, 0, position);
  1413. case "'": return stringSlice$2(str, tailPos);
  1414. case '<':
  1415. capture = namedCaptures[stringSlice$2(ch, 1, -1)];
  1416. break;
  1417. default: // \d\d?
  1418. var n = +ch;
  1419. if (n === 0) return match;
  1420. if (n > m) {
  1421. var f = floor(n / 10);
  1422. if (f === 0) return match;
  1423. if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  1424. return match;
  1425. }
  1426. capture = captures[n - 1];
  1427. }
  1428. return capture === undefined ? '' : capture;
  1429. });
  1430. };
  1431. var TypeError$2 = global_1.TypeError;
  1432. // `RegExpExec` abstract operation
  1433. // https://tc39.es/ecma262/#sec-regexpexec
  1434. var regexpExecAbstract = function (R, S) {
  1435. var exec = R.exec;
  1436. if (isCallable(exec)) {
  1437. var result = functionCall(exec, R, S);
  1438. if (result !== null) anObject(result);
  1439. return result;
  1440. }
  1441. if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
  1442. throw TypeError$2('RegExp#exec called on incompatible receiver');
  1443. };
  1444. var REPLACE = wellKnownSymbol('replace');
  1445. var max$1 = Math.max;
  1446. var min$1 = Math.min;
  1447. var concat = functionUncurryThis([].concat);
  1448. var push$2 = functionUncurryThis([].push);
  1449. var stringIndexOf = functionUncurryThis(''.indexOf);
  1450. var stringSlice$1 = functionUncurryThis(''.slice);
  1451. var maybeToString = function (it) {
  1452. return it === undefined ? it : String(it);
  1453. };
  1454. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1455. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1456. var REPLACE_KEEPS_$0 = (function () {
  1457. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  1458. return 'a'.replace(/./, '$0') === '$0';
  1459. })();
  1460. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  1461. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  1462. if (/./[REPLACE]) {
  1463. return /./[REPLACE]('a', '$0') === '';
  1464. }
  1465. return false;
  1466. })();
  1467. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1468. var re = /./;
  1469. re.exec = function () {
  1470. var result = [];
  1471. result.groups = { a: '7' };
  1472. return result;
  1473. };
  1474. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  1475. return ''.replace(re, '$<a>') !== '7';
  1476. });
  1477. // @@replace logic
  1478. fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
  1479. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1480. return [
  1481. // `String.prototype.replace` method
  1482. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1483. function replace(searchValue, replaceValue) {
  1484. var O = requireObjectCoercible(this);
  1485. var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
  1486. return replacer
  1487. ? functionCall(replacer, searchValue, O, replaceValue)
  1488. : functionCall(nativeReplace, toString_1(O), searchValue, replaceValue);
  1489. },
  1490. // `RegExp.prototype[@@replace]` method
  1491. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1492. function (string, replaceValue) {
  1493. var rx = anObject(this);
  1494. var S = toString_1(string);
  1495. if (
  1496. typeof replaceValue == 'string' &&
  1497. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  1498. stringIndexOf(replaceValue, '$<') === -1
  1499. ) {
  1500. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  1501. if (res.done) return res.value;
  1502. }
  1503. var functionalReplace = isCallable(replaceValue);
  1504. if (!functionalReplace) replaceValue = toString_1(replaceValue);
  1505. var global = rx.global;
  1506. if (global) {
  1507. var fullUnicode = rx.unicode;
  1508. rx.lastIndex = 0;
  1509. }
  1510. var results = [];
  1511. while (true) {
  1512. var result = regexpExecAbstract(rx, S);
  1513. if (result === null) break;
  1514. push$2(results, result);
  1515. if (!global) break;
  1516. var matchStr = toString_1(result[0]);
  1517. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1518. }
  1519. var accumulatedResult = '';
  1520. var nextSourcePosition = 0;
  1521. for (var i = 0; i < results.length; i++) {
  1522. result = results[i];
  1523. var matched = toString_1(result[0]);
  1524. var position = max$1(min$1(toIntegerOrInfinity(result.index), S.length), 0);
  1525. var captures = [];
  1526. // NOTE: This is equivalent to
  1527. // captures = result.slice(1).map(maybeToString)
  1528. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1529. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1530. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1531. for (var j = 1; j < result.length; j++) push$2(captures, maybeToString(result[j]));
  1532. var namedCaptures = result.groups;
  1533. if (functionalReplace) {
  1534. var replacerArgs = concat([matched], captures, position, S);
  1535. if (namedCaptures !== undefined) push$2(replacerArgs, namedCaptures);
  1536. var replacement = toString_1(functionApply(replaceValue, undefined, replacerArgs));
  1537. } else {
  1538. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1539. }
  1540. if (position >= nextSourcePosition) {
  1541. accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
  1542. nextSourcePosition = position + matched.length;
  1543. }
  1544. }
  1545. return accumulatedResult + stringSlice$1(S, nextSourcePosition);
  1546. }
  1547. ];
  1548. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  1549. // `Object.prototype.toString` method implementation
  1550. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1551. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  1552. return '[object ' + classof(this) + ']';
  1553. };
  1554. // `Object.prototype.toString` method
  1555. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1556. if (!toStringTagSupport) {
  1557. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  1558. }
  1559. // iterable DOM collections
  1560. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1561. var domIterables = {
  1562. CSSRuleList: 0,
  1563. CSSStyleDeclaration: 0,
  1564. CSSValueList: 0,
  1565. ClientRectList: 0,
  1566. DOMRectList: 0,
  1567. DOMStringList: 0,
  1568. DOMTokenList: 1,
  1569. DataTransferItemList: 0,
  1570. FileList: 0,
  1571. HTMLAllCollection: 0,
  1572. HTMLCollection: 0,
  1573. HTMLFormElement: 0,
  1574. HTMLSelectElement: 0,
  1575. MediaList: 0,
  1576. MimeTypeArray: 0,
  1577. NamedNodeMap: 0,
  1578. NodeList: 1,
  1579. PaintRequestList: 0,
  1580. Plugin: 0,
  1581. PluginArray: 0,
  1582. SVGLengthList: 0,
  1583. SVGNumberList: 0,
  1584. SVGPathSegList: 0,
  1585. SVGPointList: 0,
  1586. SVGStringList: 0,
  1587. SVGTransformList: 0,
  1588. SourceBufferList: 0,
  1589. StyleSheetList: 0,
  1590. TextTrackCueList: 0,
  1591. TextTrackList: 0,
  1592. TouchList: 0
  1593. };
  1594. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  1595. var classList = documentCreateElement('span').classList;
  1596. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  1597. var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  1598. var bind = functionUncurryThis(functionUncurryThis.bind);
  1599. // optional / simple context binding
  1600. var functionBindContext = function (fn, that) {
  1601. aCallable(fn);
  1602. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  1603. return fn.apply(that, arguments);
  1604. };
  1605. };
  1606. var push$1 = functionUncurryThis([].push);
  1607. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  1608. var createMethod = function (TYPE) {
  1609. var IS_MAP = TYPE == 1;
  1610. var IS_FILTER = TYPE == 2;
  1611. var IS_SOME = TYPE == 3;
  1612. var IS_EVERY = TYPE == 4;
  1613. var IS_FIND_INDEX = TYPE == 6;
  1614. var IS_FILTER_REJECT = TYPE == 7;
  1615. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1616. return function ($this, callbackfn, that, specificCreate) {
  1617. var O = toObject($this);
  1618. var self = indexedObject(O);
  1619. var boundFunction = functionBindContext(callbackfn, that);
  1620. var length = lengthOfArrayLike(self);
  1621. var index = 0;
  1622. var create = specificCreate || arraySpeciesCreate;
  1623. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  1624. var value, result;
  1625. for (;length > index; index++) if (NO_HOLES || index in self) {
  1626. value = self[index];
  1627. result = boundFunction(value, index, O);
  1628. if (TYPE) {
  1629. if (IS_MAP) target[index] = result; // map
  1630. else if (result) switch (TYPE) {
  1631. case 3: return true; // some
  1632. case 5: return value; // find
  1633. case 6: return index; // findIndex
  1634. case 2: push$1(target, value); // filter
  1635. } else switch (TYPE) {
  1636. case 4: return false; // every
  1637. case 7: push$1(target, value); // filterReject
  1638. }
  1639. }
  1640. }
  1641. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1642. };
  1643. };
  1644. var arrayIteration = {
  1645. // `Array.prototype.forEach` method
  1646. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1647. forEach: createMethod(0),
  1648. // `Array.prototype.map` method
  1649. // https://tc39.es/ecma262/#sec-array.prototype.map
  1650. map: createMethod(1),
  1651. // `Array.prototype.filter` method
  1652. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1653. filter: createMethod(2),
  1654. // `Array.prototype.some` method
  1655. // https://tc39.es/ecma262/#sec-array.prototype.some
  1656. some: createMethod(3),
  1657. // `Array.prototype.every` method
  1658. // https://tc39.es/ecma262/#sec-array.prototype.every
  1659. every: createMethod(4),
  1660. // `Array.prototype.find` method
  1661. // https://tc39.es/ecma262/#sec-array.prototype.find
  1662. find: createMethod(5),
  1663. // `Array.prototype.findIndex` method
  1664. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1665. findIndex: createMethod(6),
  1666. // `Array.prototype.filterReject` method
  1667. // https://github.com/tc39/proposal-array-filtering
  1668. filterReject: createMethod(7)
  1669. };
  1670. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1671. var method = [][METHOD_NAME];
  1672. return !!method && fails(function () {
  1673. // eslint-disable-next-line no-useless-call -- required for testing
  1674. method.call(null, argument || function () { return 1; }, 1);
  1675. });
  1676. };
  1677. var $forEach = arrayIteration.forEach;
  1678. var STRICT_METHOD$1 = arrayMethodIsStrict('forEach');
  1679. // `Array.prototype.forEach` method implementation
  1680. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1681. var arrayForEach = !STRICT_METHOD$1 ? function forEach(callbackfn /* , thisArg */) {
  1682. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1683. // eslint-disable-next-line es/no-array-prototype-foreach -- safe
  1684. } : [].forEach;
  1685. var handlePrototype = function (CollectionPrototype) {
  1686. // some Chrome versions have non-configurable methods on DOMTokenList
  1687. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1688. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1689. } catch (error) {
  1690. CollectionPrototype.forEach = arrayForEach;
  1691. }
  1692. };
  1693. for (var COLLECTION_NAME in domIterables) {
  1694. if (domIterables[COLLECTION_NAME]) {
  1695. handlePrototype(global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype);
  1696. }
  1697. }
  1698. handlePrototype(domTokenListPrototype);
  1699. var PROPER_FUNCTION_NAME = functionName.PROPER;
  1700. var TO_STRING = 'toString';
  1701. var RegExpPrototype = RegExp.prototype;
  1702. var n$ToString = RegExpPrototype[TO_STRING];
  1703. var getFlags = functionUncurryThis(regexpFlags);
  1704. var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1705. // FF44- RegExp#toString has a wrong name
  1706. var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
  1707. // `RegExp.prototype.toString` method
  1708. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  1709. if (NOT_GENERIC || INCORRECT_NAME) {
  1710. redefine(RegExp.prototype, TO_STRING, function toString() {
  1711. var R = anObject(this);
  1712. var p = toString_1(R.source);
  1713. var rf = R.flags;
  1714. var f = toString_1(rf === undefined && objectIsPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype) ? getFlags(R) : rf);
  1715. return '/' + p + '/' + f;
  1716. }, { unsafe: true });
  1717. }
  1718. var $find = arrayIteration.find;
  1719. var FIND = 'find';
  1720. var SKIPS_HOLES = true;
  1721. // Shouldn't skip holes
  1722. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1723. // `Array.prototype.find` method
  1724. // https://tc39.es/ecma262/#sec-array.prototype.find
  1725. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1726. find: function find(callbackfn /* , that = undefined */) {
  1727. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1728. }
  1729. });
  1730. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1731. addToUnscopables(FIND);
  1732. var $filter = arrayIteration.filter;
  1733. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('filter');
  1734. // `Array.prototype.filter` method
  1735. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1736. // with adding support of @@species
  1737. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1738. filter: function filter(callbackfn /* , thisArg */) {
  1739. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1740. }
  1741. });
  1742. var TypeError$1 = global_1.TypeError;
  1743. // `Assert: IsConstructor(argument) is true`
  1744. var aConstructor = function (argument) {
  1745. if (isConstructor(argument)) return argument;
  1746. throw TypeError$1(tryToString(argument) + ' is not a constructor');
  1747. };
  1748. var SPECIES = wellKnownSymbol('species');
  1749. // `SpeciesConstructor` abstract operation
  1750. // https://tc39.es/ecma262/#sec-speciesconstructor
  1751. var speciesConstructor = function (O, defaultConstructor) {
  1752. var C = anObject(O).constructor;
  1753. var S;
  1754. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
  1755. };
  1756. var Array$1 = global_1.Array;
  1757. var max = Math.max;
  1758. var arraySliceSimple = function (O, start, end) {
  1759. var length = lengthOfArrayLike(O);
  1760. var k = toAbsoluteIndex(start, length);
  1761. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1762. var result = Array$1(max(fin - k, 0));
  1763. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  1764. result.length = n;
  1765. return result;
  1766. };
  1767. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
  1768. var MAX_UINT32 = 0xFFFFFFFF;
  1769. var min = Math.min;
  1770. var $push = [].push;
  1771. var exec = functionUncurryThis(/./.exec);
  1772. var push = functionUncurryThis($push);
  1773. var stringSlice = functionUncurryThis(''.slice);
  1774. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1775. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1776. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1777. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1778. var re = /(?:)/;
  1779. var originalExec = re.exec;
  1780. re.exec = function () { return originalExec.apply(this, arguments); };
  1781. var result = 'ab'.split(re);
  1782. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1783. });
  1784. // @@split logic
  1785. fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  1786. var internalSplit;
  1787. if (
  1788. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1789. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1790. 'test'.split(/(?:)/, -1).length != 4 ||
  1791. 'ab'.split(/(?:ab)*/).length != 2 ||
  1792. '.'.split(/(.?)(.?)/).length != 4 ||
  1793. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  1794. '.'.split(/()()/).length > 1 ||
  1795. ''.split(/.?/).length
  1796. ) {
  1797. // based on es5-shim implementation, need to rework it
  1798. internalSplit = function (separator, limit) {
  1799. var string = toString_1(requireObjectCoercible(this));
  1800. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1801. if (lim === 0) return [];
  1802. if (separator === undefined) return [string];
  1803. // If `separator` is not a regex, use native split
  1804. if (!isRegexp(separator)) {
  1805. return functionCall(nativeSplit, string, separator, lim);
  1806. }
  1807. var output = [];
  1808. var flags = (separator.ignoreCase ? 'i' : '') +
  1809. (separator.multiline ? 'm' : '') +
  1810. (separator.unicode ? 'u' : '') +
  1811. (separator.sticky ? 'y' : '');
  1812. var lastLastIndex = 0;
  1813. // Make `global` and avoid `lastIndex` issues by working with a copy
  1814. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1815. var match, lastIndex, lastLength;
  1816. while (match = functionCall(regexpExec, separatorCopy, string)) {
  1817. lastIndex = separatorCopy.lastIndex;
  1818. if (lastIndex > lastLastIndex) {
  1819. push(output, stringSlice(string, lastLastIndex, match.index));
  1820. if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
  1821. lastLength = match[0].length;
  1822. lastLastIndex = lastIndex;
  1823. if (output.length >= lim) break;
  1824. }
  1825. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1826. }
  1827. if (lastLastIndex === string.length) {
  1828. if (lastLength || !exec(separatorCopy, '')) push(output, '');
  1829. } else push(output, stringSlice(string, lastLastIndex));
  1830. return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
  1831. };
  1832. // Chakra, V8
  1833. } else if ('0'.split(undefined, 0).length) {
  1834. internalSplit = function (separator, limit) {
  1835. return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
  1836. };
  1837. } else internalSplit = nativeSplit;
  1838. return [
  1839. // `String.prototype.split` method
  1840. // https://tc39.es/ecma262/#sec-string.prototype.split
  1841. function split(separator, limit) {
  1842. var O = requireObjectCoercible(this);
  1843. var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
  1844. return splitter
  1845. ? functionCall(splitter, separator, O, limit)
  1846. : functionCall(internalSplit, toString_1(O), separator, limit);
  1847. },
  1848. // `RegExp.prototype[@@split]` method
  1849. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1850. //
  1851. // NOTE: This cannot be properly polyfilled in engines that don't support
  1852. // the 'y' flag.
  1853. function (string, limit) {
  1854. var rx = anObject(this);
  1855. var S = toString_1(string);
  1856. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  1857. if (res.done) return res.value;
  1858. var C = speciesConstructor(rx, RegExp);
  1859. var unicodeMatching = rx.unicode;
  1860. var flags = (rx.ignoreCase ? 'i' : '') +
  1861. (rx.multiline ? 'm' : '') +
  1862. (rx.unicode ? 'u' : '') +
  1863. (UNSUPPORTED_Y ? 'g' : 'y');
  1864. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1865. // simulate the 'y' flag.
  1866. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  1867. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1868. if (lim === 0) return [];
  1869. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1870. var p = 0;
  1871. var q = 0;
  1872. var A = [];
  1873. while (q < S.length) {
  1874. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  1875. var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
  1876. var e;
  1877. if (
  1878. z === null ||
  1879. (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  1880. ) {
  1881. q = advanceStringIndex(S, q, unicodeMatching);
  1882. } else {
  1883. push(A, stringSlice(S, p, q));
  1884. if (A.length === lim) return A;
  1885. for (var i = 1; i <= z.length - 1; i++) {
  1886. push(A, z[i]);
  1887. if (A.length === lim) return A;
  1888. }
  1889. q = p = e;
  1890. }
  1891. }
  1892. push(A, stringSlice(S, p));
  1893. return A;
  1894. }
  1895. ];
  1896. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  1897. var $map = arrayIteration.map;
  1898. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  1899. // `Array.prototype.map` method
  1900. // https://tc39.es/ecma262/#sec-array.prototype.map
  1901. // with adding support of @@species
  1902. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1903. map: function map(callbackfn /* , thisArg */) {
  1904. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1905. }
  1906. });
  1907. // `SameValue` abstract operation
  1908. // https://tc39.es/ecma262/#sec-samevalue
  1909. // eslint-disable-next-line es/no-object-is -- safe
  1910. var sameValue = Object.is || function is(x, y) {
  1911. // eslint-disable-next-line no-self-compare -- NaN check
  1912. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1913. };
  1914. // @@search logic
  1915. fixRegexpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
  1916. return [
  1917. // `String.prototype.search` method
  1918. // https://tc39.es/ecma262/#sec-string.prototype.search
  1919. function search(regexp) {
  1920. var O = requireObjectCoercible(this);
  1921. var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
  1922. return searcher ? functionCall(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString_1(O));
  1923. },
  1924. // `RegExp.prototype[@@search]` method
  1925. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  1926. function (string) {
  1927. var rx = anObject(this);
  1928. var S = toString_1(string);
  1929. var res = maybeCallNative(nativeSearch, rx, S);
  1930. if (res.done) return res.value;
  1931. var previousLastIndex = rx.lastIndex;
  1932. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  1933. var result = regexpExecAbstract(rx, S);
  1934. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  1935. return result === null ? -1 : result.index;
  1936. }
  1937. ];
  1938. });
  1939. var un$Join = functionUncurryThis([].join);
  1940. var ES3_STRINGS = indexedObject != Object;
  1941. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  1942. // `Array.prototype.join` method
  1943. // https://tc39.es/ecma262/#sec-array.prototype.join
  1944. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  1945. join: function join(separator) {
  1946. return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
  1947. }
  1948. });
  1949. /**
  1950. * @author: Dennis Hernández
  1951. * @webSite: http://djhvscf.github.io/Blog
  1952. * @update zhixin wen <wenzhixin2010@gmail.com>
  1953. */
  1954. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1955. var UtilsCookie = {
  1956. cookieIds: {
  1957. sortOrder: 'bs.table.sortOrder',
  1958. sortName: 'bs.table.sortName',
  1959. sortPriority: 'bs.table.sortPriority',
  1960. pageNumber: 'bs.table.pageNumber',
  1961. pageList: 'bs.table.pageList',
  1962. columns: 'bs.table.columns',
  1963. cardView: 'bs.table.cardView',
  1964. searchText: 'bs.table.searchText',
  1965. reorderColumns: 'bs.table.reorderColumns',
  1966. filterControl: 'bs.table.filterControl',
  1967. filterBy: 'bs.table.filterBy'
  1968. },
  1969. getCurrentHeader: function getCurrentHeader(that) {
  1970. return that.options.height ? that.$tableHeader : that.$header;
  1971. },
  1972. getCurrentSearchControls: function getCurrentSearchControls(that) {
  1973. return that.options.height ? 'table select, table input' : 'select, input';
  1974. },
  1975. isCookieSupportedByBrowser: function isCookieSupportedByBrowser() {
  1976. return navigator.cookieEnabled;
  1977. },
  1978. isCookieEnabled: function isCookieEnabled(that, cookieName) {
  1979. return that.options.cookiesEnabled.includes(cookieName);
  1980. },
  1981. setCookie: function setCookie(that, cookieName, cookieValue) {
  1982. if (!that.options.cookie || !UtilsCookie.isCookieEnabled(that, cookieName)) {
  1983. return;
  1984. }
  1985. return that._storage.setItem("".concat(that.options.cookieIdTable, ".").concat(cookieName), cookieValue);
  1986. },
  1987. getCookie: function getCookie(that, cookieName) {
  1988. if (!cookieName || !UtilsCookie.isCookieEnabled(that, cookieName)) {
  1989. return null;
  1990. }
  1991. return that._storage.getItem("".concat(that.options.cookieIdTable, ".").concat(cookieName));
  1992. },
  1993. deleteCookie: function deleteCookie(that, cookieName) {
  1994. return that._storage.removeItem("".concat(that.options.cookieIdTable, ".").concat(cookieName));
  1995. },
  1996. calculateExpiration: function calculateExpiration(cookieExpire) {
  1997. var time = cookieExpire.replace(/[0-9]*/, ''); // s,mi,h,d,m,y
  1998. cookieExpire = cookieExpire.replace(/[A-Za-z]{1,2}/, ''); // number
  1999. switch (time.toLowerCase()) {
  2000. case 's':
  2001. cookieExpire = +cookieExpire;
  2002. break;
  2003. case 'mi':
  2004. cookieExpire *= 60;
  2005. break;
  2006. case 'h':
  2007. cookieExpire = cookieExpire * 60 * 60;
  2008. break;
  2009. case 'd':
  2010. cookieExpire = cookieExpire * 24 * 60 * 60;
  2011. break;
  2012. case 'm':
  2013. cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
  2014. break;
  2015. case 'y':
  2016. cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
  2017. break;
  2018. default:
  2019. cookieExpire = undefined;
  2020. break;
  2021. }
  2022. if (!cookieExpire) {
  2023. return '';
  2024. }
  2025. var d = new Date();
  2026. d.setTime(d.getTime() + cookieExpire * 1000);
  2027. return d.toGMTString();
  2028. },
  2029. initCookieFilters: function initCookieFilters(bootstrapTable) {
  2030. setTimeout(function () {
  2031. var parsedCookieFilters = JSON.parse(UtilsCookie.getCookie(bootstrapTable, UtilsCookie.cookieIds.filterControl));
  2032. if (!bootstrapTable._filterControlValuesLoaded && parsedCookieFilters) {
  2033. var cachedFilters = {};
  2034. var header = UtilsCookie.getCurrentHeader(bootstrapTable);
  2035. var searchControls = UtilsCookie.getCurrentSearchControls(bootstrapTable);
  2036. var applyCookieFilters = function applyCookieFilters(element, filteredCookies) {
  2037. filteredCookies.forEach(function (cookie) {
  2038. var value = element.value.toString();
  2039. var text = cookie.text;
  2040. if (text === '' || element.type === 'radio' && value !== text) {
  2041. return;
  2042. }
  2043. if (element.tagName === 'INPUT' && element.type === 'radio' && value === text) {
  2044. element.checked = true;
  2045. cachedFilters[cookie.field] = text;
  2046. } else if (element.tagName === 'INPUT') {
  2047. element.value = text;
  2048. cachedFilters[cookie.field] = text;
  2049. } else if (element.tagName === 'SELECT' && bootstrapTable.options.filterControlContainer) {
  2050. element.value = text;
  2051. cachedFilters[cookie.field] = text;
  2052. } else if (text !== '' && element.tagName === 'SELECT') {
  2053. cachedFilters[cookie.field] = text;
  2054. var _iterator = _createForOfIteratorHelper(element),
  2055. _step;
  2056. try {
  2057. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  2058. var currentElement = _step.value;
  2059. if (currentElement.value === text) {
  2060. currentElement.selected = true;
  2061. return;
  2062. }
  2063. }
  2064. } catch (err) {
  2065. _iterator.e(err);
  2066. } finally {
  2067. _iterator.f();
  2068. }
  2069. var option = document.createElement('option');
  2070. option.value = text;
  2071. option.text = text;
  2072. element.add(option, element[1]);
  2073. element.selectedIndex = 1;
  2074. }
  2075. });
  2076. };
  2077. var filterContainer = header;
  2078. if (bootstrapTable.options.filterControlContainer) {
  2079. filterContainer = $__default["default"]("".concat(bootstrapTable.options.filterControlContainer));
  2080. }
  2081. filterContainer.find(searchControls).each(function () {
  2082. var field = $__default["default"](this).closest('[data-field]').data('field');
  2083. var filteredCookies = parsedCookieFilters.filter(function (cookie) {
  2084. return cookie.field === field;
  2085. });
  2086. applyCookieFilters(this, filteredCookies);
  2087. });
  2088. bootstrapTable.initColumnSearch(cachedFilters);
  2089. bootstrapTable._filterControlValuesLoaded = true;
  2090. bootstrapTable.initServer();
  2091. }
  2092. }, 250);
  2093. }
  2094. };
  2095. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  2096. cookie: false,
  2097. cookieExpire: '2h',
  2098. cookiePath: null,
  2099. cookieDomain: null,
  2100. cookieSecure: null,
  2101. cookieSameSite: 'Lax',
  2102. cookieIdTable: '',
  2103. cookiesEnabled: ['bs.table.sortOrder', 'bs.table.sortName', 'bs.table.sortPriority', 'bs.table.pageNumber', 'bs.table.pageList', 'bs.table.columns', 'bs.table.searchText', 'bs.table.filterControl', 'bs.table.filterBy', 'bs.table.reorderColumns', 'bs.table.cardView'],
  2104. cookieStorage: 'cookieStorage',
  2105. // localStorage, sessionStorage, customStorage
  2106. cookieCustomStorageGet: null,
  2107. cookieCustomStorageSet: null,
  2108. cookieCustomStorageDelete: null,
  2109. // internal variable
  2110. _filterControls: [],
  2111. _filterControlValuesLoaded: false,
  2112. _storage: {
  2113. setItem: undefined,
  2114. getItem: undefined,
  2115. removeItem: undefined
  2116. }
  2117. });
  2118. $__default["default"].fn.bootstrapTable.methods.push('getCookies');
  2119. $__default["default"].fn.bootstrapTable.methods.push('deleteCookie');
  2120. $__default["default"].extend($__default["default"].fn.bootstrapTable.utils, {
  2121. setCookie: UtilsCookie.setCookie,
  2122. getCookie: UtilsCookie.getCookie
  2123. });
  2124. $__default["default"].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  2125. _inherits(_class, _$$BootstrapTable);
  2126. var _super = _createSuper(_class);
  2127. function _class() {
  2128. _classCallCheck(this, _class);
  2129. return _super.apply(this, arguments);
  2130. }
  2131. _createClass(_class, [{
  2132. key: "init",
  2133. value: function init() {
  2134. if (this.options.cookie) {
  2135. if (this.options.cookieStorage === 'cookieStorage' && !UtilsCookie.isCookieSupportedByBrowser()) {
  2136. throw new Error('Cookies are not enabled in this browser.');
  2137. }
  2138. this.configureStorage(); // FilterBy logic
  2139. var filterByCookieValue = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.filterBy);
  2140. if (typeof filterByCookieValue === 'boolean' && !filterByCookieValue) {
  2141. throw new Error('The cookie value of filterBy must be a json!');
  2142. }
  2143. var filterByCookie = {};
  2144. try {
  2145. filterByCookie = JSON.parse(filterByCookieValue);
  2146. } catch (e) {
  2147. throw new Error('Could not parse the json of the filterBy cookie!');
  2148. }
  2149. this.filterColumns = filterByCookie ? filterByCookie : {}; // FilterControl logic
  2150. this._filterControls = [];
  2151. this._filterControlValuesLoaded = false;
  2152. this.options.cookiesEnabled = typeof this.options.cookiesEnabled === 'string' ? this.options.cookiesEnabled.replace('[', '').replace(']', '').replace(/'/g, '').replace(/ /g, '').toLowerCase().split(',') : this.options.cookiesEnabled;
  2153. if (this.options.filterControl) {
  2154. var that = this;
  2155. this.$el.on('column-search.bs.table', function (e, field, text) {
  2156. var isNewField = true;
  2157. for (var i = 0; i < that._filterControls.length; i++) {
  2158. if (that._filterControls[i].field === field) {
  2159. that._filterControls[i].text = text;
  2160. isNewField = false;
  2161. break;
  2162. }
  2163. }
  2164. if (isNewField) {
  2165. that._filterControls.push({
  2166. field: field,
  2167. text: text
  2168. });
  2169. }
  2170. UtilsCookie.setCookie(that, UtilsCookie.cookieIds.filterControl, JSON.stringify(that._filterControls));
  2171. }).on('created-controls.bs.table', UtilsCookie.initCookieFilters(that));
  2172. }
  2173. }
  2174. _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
  2175. }
  2176. }, {
  2177. key: "initServer",
  2178. value: function initServer() {
  2179. var _get2;
  2180. if (this.options.cookie && this.options.filterControl && !this._filterControlValuesLoaded) {
  2181. var cookie = JSON.parse(UtilsCookie.getCookie(this, UtilsCookie.cookieIds.filterControl));
  2182. if (cookie) {
  2183. return;
  2184. }
  2185. }
  2186. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2187. args[_key] = arguments[_key];
  2188. }
  2189. (_get2 = _get(_getPrototypeOf(_class.prototype), "initServer", this)).call.apply(_get2, [this].concat(args));
  2190. }
  2191. }, {
  2192. key: "initTable",
  2193. value: function initTable() {
  2194. var _get3;
  2195. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  2196. args[_key2] = arguments[_key2];
  2197. }
  2198. (_get3 = _get(_getPrototypeOf(_class.prototype), "initTable", this)).call.apply(_get3, [this].concat(args));
  2199. this.initCookie();
  2200. }
  2201. }, {
  2202. key: "onSort",
  2203. value: function onSort() {
  2204. var _get4;
  2205. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  2206. args[_key3] = arguments[_key3];
  2207. }
  2208. (_get4 = _get(_getPrototypeOf(_class.prototype), "onSort", this)).call.apply(_get4, [this].concat(args));
  2209. if (!this.options.cookie) {
  2210. return;
  2211. }
  2212. if (this.options.sortName === undefined || this.options.sortOrder === undefined) {
  2213. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortName);
  2214. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortOrder);
  2215. } else {
  2216. this.options.sortPriority = null;
  2217. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortPriority);
  2218. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder);
  2219. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName);
  2220. }
  2221. }
  2222. }, {
  2223. key: "onMultipleSort",
  2224. value: function onMultipleSort() {
  2225. var _get5;
  2226. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2227. args[_key4] = arguments[_key4];
  2228. }
  2229. (_get5 = _get(_getPrototypeOf(_class.prototype), "onMultipleSort", this)).call.apply(_get5, [this].concat(args));
  2230. if (this.options.sortPriority === undefined) {
  2231. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortPriority);
  2232. } else {
  2233. this.options.sortName = undefined;
  2234. this.options.sortOrder = undefined;
  2235. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortName);
  2236. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortOrder);
  2237. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortPriority, JSON.stringify(this.options.sortPriority));
  2238. }
  2239. }
  2240. }, {
  2241. key: "onPageNumber",
  2242. value: function onPageNumber() {
  2243. var _get6;
  2244. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2245. args[_key5] = arguments[_key5];
  2246. }
  2247. (_get6 = _get(_getPrototypeOf(_class.prototype), "onPageNumber", this)).call.apply(_get6, [this].concat(args));
  2248. if (!this.options.cookie) {
  2249. return;
  2250. }
  2251. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2252. }
  2253. }, {
  2254. key: "onPageListChange",
  2255. value: function onPageListChange() {
  2256. var _get7;
  2257. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2258. args[_key6] = arguments[_key6];
  2259. }
  2260. (_get7 = _get(_getPrototypeOf(_class.prototype), "onPageListChange", this)).call.apply(_get7, [this].concat(args));
  2261. if (!this.options.cookie) {
  2262. return;
  2263. }
  2264. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize);
  2265. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2266. }
  2267. }, {
  2268. key: "onPagePre",
  2269. value: function onPagePre() {
  2270. var _get8;
  2271. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2272. args[_key7] = arguments[_key7];
  2273. }
  2274. (_get8 = _get(_getPrototypeOf(_class.prototype), "onPagePre", this)).call.apply(_get8, [this].concat(args));
  2275. if (!this.options.cookie) {
  2276. return;
  2277. }
  2278. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2279. }
  2280. }, {
  2281. key: "onPageNext",
  2282. value: function onPageNext() {
  2283. var _get9;
  2284. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2285. args[_key8] = arguments[_key8];
  2286. }
  2287. (_get9 = _get(_getPrototypeOf(_class.prototype), "onPageNext", this)).call.apply(_get9, [this].concat(args));
  2288. if (!this.options.cookie) {
  2289. return;
  2290. }
  2291. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2292. }
  2293. }, {
  2294. key: "_toggleColumn",
  2295. value: function _toggleColumn() {
  2296. var _get10;
  2297. for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
  2298. args[_key9] = arguments[_key9];
  2299. }
  2300. (_get10 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get10, [this].concat(args));
  2301. if (!this.options.cookie) {
  2302. return;
  2303. }
  2304. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(function (column) {
  2305. return column.field;
  2306. })));
  2307. }
  2308. }, {
  2309. key: "_toggleAllColumns",
  2310. value: function _toggleAllColumns() {
  2311. var _get11;
  2312. for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
  2313. args[_key10] = arguments[_key10];
  2314. }
  2315. (_get11 = _get(_getPrototypeOf(_class.prototype), "_toggleAllColumns", this)).call.apply(_get11, [this].concat(args));
  2316. if (!this.options.cookie) {
  2317. return;
  2318. }
  2319. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(function (column) {
  2320. return column.field;
  2321. })));
  2322. }
  2323. }, {
  2324. key: "toggleView",
  2325. value: function toggleView() {
  2326. _get(_getPrototypeOf(_class.prototype), "toggleView", this).call(this);
  2327. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.cardView, this.options.cardView);
  2328. }
  2329. }, {
  2330. key: "selectPage",
  2331. value: function selectPage(page) {
  2332. _get(_getPrototypeOf(_class.prototype), "selectPage", this).call(this, page);
  2333. if (!this.options.cookie) {
  2334. return;
  2335. }
  2336. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page);
  2337. }
  2338. }, {
  2339. key: "onSearch",
  2340. value: function onSearch(event) {
  2341. _get(_getPrototypeOf(_class.prototype), "onSearch", this).call(this, event, arguments.length > 1 ? arguments[1] : true);
  2342. if (!this.options.cookie) {
  2343. return;
  2344. }
  2345. if (this.options.search) {
  2346. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText);
  2347. }
  2348. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2349. }
  2350. }, {
  2351. key: "initHeader",
  2352. value: function initHeader() {
  2353. var _get12;
  2354. if (this.options.reorderableColumns && this.options.cookie) {
  2355. this.columnsSortOrder = JSON.parse(UtilsCookie.getCookie(this, UtilsCookie.cookieIds.reorderColumns));
  2356. }
  2357. for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
  2358. args[_key11] = arguments[_key11];
  2359. }
  2360. (_get12 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get12, [this].concat(args));
  2361. }
  2362. }, {
  2363. key: "persistReorderColumnsState",
  2364. value: function persistReorderColumnsState(that) {
  2365. UtilsCookie.setCookie(that, UtilsCookie.cookieIds.reorderColumns, JSON.stringify(that.columnsSortOrder));
  2366. }
  2367. }, {
  2368. key: "filterBy",
  2369. value: function filterBy() {
  2370. var _get13;
  2371. for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
  2372. args[_key12] = arguments[_key12];
  2373. }
  2374. (_get13 = _get(_getPrototypeOf(_class.prototype), "filterBy", this)).call.apply(_get13, [this].concat(args));
  2375. if (!this.options.cookie) {
  2376. return;
  2377. }
  2378. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns));
  2379. }
  2380. }, {
  2381. key: "initCookie",
  2382. value: function initCookie() {
  2383. var _this = this;
  2384. if (!this.options.cookie) {
  2385. return;
  2386. }
  2387. if (this.options.cookieIdTable === '' || this.options.cookieExpire === '') {
  2388. console.error('Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies.');
  2389. this.options.cookie = false; // Make sure that the cookie extension is disabled
  2390. return;
  2391. }
  2392. var sortOrderCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortOrder);
  2393. var sortOrderNameCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortName);
  2394. var sortPriorityCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortPriority);
  2395. var pageNumberCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.pageNumber);
  2396. var pageListCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.pageList);
  2397. var searchTextCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.searchText);
  2398. var cardViewCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.cardView);
  2399. var columnsCookieValue = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.columns);
  2400. if (typeof columnsCookieValue === 'boolean' && !columnsCookieValue) {
  2401. throw new Error('The cookie value of filterBy must be a json!');
  2402. }
  2403. var columnsCookie = {};
  2404. try {
  2405. columnsCookie = JSON.parse(columnsCookieValue);
  2406. } catch (e) {
  2407. throw new Error('Could not parse the json of the columns cookie!', columnsCookieValue);
  2408. }
  2409. try {
  2410. sortPriorityCookie = JSON.parse(sortPriorityCookie);
  2411. } catch (e) {
  2412. throw new Error('Could not parse the json of the sortPriority cookie!', sortPriorityCookie);
  2413. }
  2414. if (!sortPriorityCookie) {
  2415. // sortOrder
  2416. this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder; // sortName
  2417. this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName;
  2418. } else {
  2419. this.options.sortOrder = undefined;
  2420. this.options.sortName = undefined;
  2421. } // sortPriority
  2422. this.options.sortPriority = sortPriorityCookie ? sortPriorityCookie : this.options.sortPriority;
  2423. if (this.options.sortOrder || this.options.sortName) {
  2424. // sortPriority
  2425. this.options.sortPriority = null;
  2426. } // pageNumber
  2427. this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber; // pageSize
  2428. this.options.pageSize = pageListCookie ? pageListCookie === this.options.formatAllRows() ? pageListCookie : +pageListCookie : this.options.pageSize; // searchText
  2429. if (UtilsCookie.isCookieEnabled(this, 'bs.table.searchText') && this.options.searchText === '') {
  2430. this.options.searchText = searchTextCookie ? searchTextCookie : '';
  2431. } // cardView
  2432. this.options.cardView = cardViewCookie === 'true' ? cardViewCookie : false;
  2433. if (columnsCookie) {
  2434. var _iterator2 = _createForOfIteratorHelper(this.columns),
  2435. _step2;
  2436. try {
  2437. var _loop = function _loop() {
  2438. var column = _step2.value;
  2439. if (!column.switchable) {
  2440. return "continue";
  2441. }
  2442. column.visible = columnsCookie.filter(function (columnField) {
  2443. if (_this.isSelectionColumn(column)) {
  2444. return true;
  2445. }
  2446. /**
  2447. * This is needed for the old saved cookies or the table will show no columns!
  2448. * It can be removed in 2-3 Versions Later!!
  2449. * TODO: Remove this part some versions later e.g. 1.17.3
  2450. */
  2451. if (columnField instanceof Object) {
  2452. return columnField.field === column.field;
  2453. }
  2454. return columnField === column.field;
  2455. }).length > 0;
  2456. };
  2457. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  2458. var _ret = _loop();
  2459. if (_ret === "continue") continue;
  2460. }
  2461. } catch (err) {
  2462. _iterator2.e(err);
  2463. } finally {
  2464. _iterator2.f();
  2465. }
  2466. }
  2467. }
  2468. }, {
  2469. key: "getCookies",
  2470. value: function getCookies() {
  2471. var bootstrapTable = this;
  2472. var cookies = {};
  2473. $__default["default"].each(UtilsCookie.cookieIds, function (key, value) {
  2474. cookies[key] = UtilsCookie.getCookie(bootstrapTable, value);
  2475. if (key === 'columns') {
  2476. cookies[key] = JSON.parse(cookies[key]);
  2477. }
  2478. });
  2479. return cookies;
  2480. }
  2481. }, {
  2482. key: "deleteCookie",
  2483. value: function deleteCookie(cookieName) {
  2484. if (!cookieName) {
  2485. return;
  2486. }
  2487. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds[cookieName]);
  2488. }
  2489. }, {
  2490. key: "configureStorage",
  2491. value: function configureStorage() {
  2492. var that = this;
  2493. this._storage = {};
  2494. switch (this.options.cookieStorage) {
  2495. case 'cookieStorage':
  2496. this._storage.setItem = function (cookieName, cookieValue) {
  2497. 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('');
  2498. };
  2499. this._storage.getItem = function (cookieName) {
  2500. var value = "; ".concat(document.cookie);
  2501. var parts = value.split("; ".concat(cookieName, "="));
  2502. return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null;
  2503. };
  2504. this._storage.removeItem = function (cookieName) {
  2505. 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('');
  2506. };
  2507. break;
  2508. case 'localStorage':
  2509. this._storage.setItem = function (cookieName, cookieValue) {
  2510. localStorage.setItem(cookieName, cookieValue);
  2511. };
  2512. this._storage.getItem = function (cookieName) {
  2513. return localStorage.getItem(cookieName);
  2514. };
  2515. this._storage.removeItem = function (cookieName) {
  2516. localStorage.removeItem(cookieName);
  2517. };
  2518. break;
  2519. case 'sessionStorage':
  2520. this._storage.setItem = function (cookieName, cookieValue) {
  2521. sessionStorage.setItem(cookieName, cookieValue);
  2522. };
  2523. this._storage.getItem = function (cookieName) {
  2524. return sessionStorage.getItem(cookieName);
  2525. };
  2526. this._storage.removeItem = function (cookieName) {
  2527. sessionStorage.removeItem(cookieName);
  2528. };
  2529. break;
  2530. case 'customStorage':
  2531. if (!this.options.cookieCustomStorageSet || !this.options.cookieCustomStorageGet || !this.options.cookieCustomStorageDelete) {
  2532. throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
  2533. }
  2534. this._storage.setItem = function (cookieName, cookieValue) {
  2535. Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageSet, [cookieName, cookieValue], '');
  2536. };
  2537. this._storage.getItem = function (cookieName) {
  2538. return Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageGet, [cookieName], '');
  2539. };
  2540. this._storage.removeItem = function (cookieName) {
  2541. Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageDelete, [cookieName], '');
  2542. };
  2543. break;
  2544. default:
  2545. throw new Error('Storage method not supported.');
  2546. }
  2547. }
  2548. }]);
  2549. return _class;
  2550. }($__default["default"].BootstrapTable);
  2551. }));