bootstrap-table-editable.js 83 KB

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