bootstrap-table-cell-input.js 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066
  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. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  7. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  8. var global = typeof window == 'object' && window && window.Math == Math ? window
  9. : typeof self == 'object' && self && self.Math == Math ? self
  10. // eslint-disable-next-line no-new-func
  11. : Function('return this')();
  12. var hasOwnProperty = {}.hasOwnProperty;
  13. var has = function (it, key) {
  14. return hasOwnProperty.call(it, key);
  15. };
  16. var fails = function (exec) {
  17. try {
  18. return !!exec();
  19. } catch (e) {
  20. return true;
  21. }
  22. };
  23. // Thank's IE8 for his funny defineProperty
  24. var descriptors = !fails(function () {
  25. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  26. });
  27. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  28. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  29. // Nashorn ~ JDK8 bug
  30. var NASHORN_BUG = nativeGetOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  31. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  32. var descriptor = nativeGetOwnPropertyDescriptor(this, V);
  33. return !!descriptor && descriptor.enumerable;
  34. } : nativePropertyIsEnumerable;
  35. var objectPropertyIsEnumerable = {
  36. f: f
  37. };
  38. var createPropertyDescriptor = function (bitmap, value) {
  39. return {
  40. enumerable: !(bitmap & 1),
  41. configurable: !(bitmap & 2),
  42. writable: !(bitmap & 4),
  43. value: value
  44. };
  45. };
  46. var toString = {}.toString;
  47. var classofRaw = function (it) {
  48. return toString.call(it).slice(8, -1);
  49. };
  50. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  51. var split = ''.split;
  52. var indexedObject = fails(function () {
  53. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  54. // eslint-disable-next-line no-prototype-builtins
  55. return !Object('z').propertyIsEnumerable(0);
  56. }) ? function (it) {
  57. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  58. } : Object;
  59. // `RequireObjectCoercible` abstract operation
  60. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  61. var requireObjectCoercible = function (it) {
  62. if (it == undefined) throw TypeError("Can't call method on " + it);
  63. return it;
  64. };
  65. // toObject with fallback for non-array-like ES3 strings
  66. var toIndexedObject = function (it) {
  67. return indexedObject(requireObjectCoercible(it));
  68. };
  69. var isObject = function (it) {
  70. return typeof it === 'object' ? it !== null : typeof it === 'function';
  71. };
  72. // 7.1.1 ToPrimitive(input [, PreferredType])
  73. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  74. // and the second argument - flag - preferred type is a string
  75. var toPrimitive = function (it, S) {
  76. if (!isObject(it)) return it;
  77. var fn, val;
  78. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  79. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  80. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  81. throw TypeError("Can't convert object to primitive value");
  82. };
  83. var document = global.document;
  84. // typeof document.createElement is 'object' in old IE
  85. var exist = isObject(document) && isObject(document.createElement);
  86. var documentCreateElement = function (it) {
  87. return exist ? document.createElement(it) : {};
  88. };
  89. // Thank's IE8 for his funny defineProperty
  90. var ie8DomDefine = !descriptors && !fails(function () {
  91. return Object.defineProperty(documentCreateElement('div'), 'a', {
  92. get: function () { return 7; }
  93. }).a != 7;
  94. });
  95. var nativeGetOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  96. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  97. O = toIndexedObject(O);
  98. P = toPrimitive(P, true);
  99. if (ie8DomDefine) try {
  100. return nativeGetOwnPropertyDescriptor$1(O, P);
  101. } catch (e) { /* empty */ }
  102. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  103. };
  104. var objectGetOwnPropertyDescriptor = {
  105. f: f$1
  106. };
  107. var anObject = function (it) {
  108. if (!isObject(it)) {
  109. throw TypeError(String(it) + ' is not an object');
  110. } return it;
  111. };
  112. var nativeDefineProperty = Object.defineProperty;
  113. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  114. anObject(O);
  115. P = toPrimitive(P, true);
  116. anObject(Attributes);
  117. if (ie8DomDefine) try {
  118. return nativeDefineProperty(O, P, Attributes);
  119. } catch (e) { /* empty */ }
  120. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  121. if ('value' in Attributes) O[P] = Attributes.value;
  122. return O;
  123. };
  124. var objectDefineProperty = {
  125. f: f$2
  126. };
  127. var hide = descriptors ? function (object, key, value) {
  128. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  129. } : function (object, key, value) {
  130. object[key] = value;
  131. return object;
  132. };
  133. function createCommonjsModule(fn, module) {
  134. return module = { exports: {} }, fn(module, module.exports), module.exports;
  135. }
  136. var setGlobal = function (key, value) {
  137. try {
  138. hide(global, key, value);
  139. } catch (e) {
  140. global[key] = value;
  141. } return value;
  142. };
  143. var shared = createCommonjsModule(function (module) {
  144. var SHARED = '__core-js_shared__';
  145. var store = global[SHARED] || setGlobal(SHARED, {});
  146. (module.exports = function (key, value) {
  147. return store[key] || (store[key] = value !== undefined ? value : {});
  148. })('versions', []).push({
  149. version: '3.0.0',
  150. mode: 'global',
  151. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  152. });
  153. });
  154. var functionToString = shared('native-function-to-string', Function.toString);
  155. var WeakMap = global.WeakMap;
  156. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
  157. var id = 0;
  158. var postfix = Math.random();
  159. var uid = function (key) {
  160. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + postfix).toString(36));
  161. };
  162. var shared$1 = shared('keys');
  163. var sharedKey = function (key) {
  164. return shared$1[key] || (shared$1[key] = uid(key));
  165. };
  166. var hiddenKeys = {};
  167. var WeakMap$1 = global.WeakMap;
  168. var set, get, has$1;
  169. var enforce = function (it) {
  170. return has$1(it) ? get(it) : set(it, {});
  171. };
  172. var getterFor = function (TYPE) {
  173. return function (it) {
  174. var state;
  175. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  176. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  177. } return state;
  178. };
  179. };
  180. if (nativeWeakMap) {
  181. var store = new WeakMap$1();
  182. var wmget = store.get;
  183. var wmhas = store.has;
  184. var wmset = store.set;
  185. set = function (it, metadata) {
  186. wmset.call(store, it, metadata);
  187. return metadata;
  188. };
  189. get = function (it) {
  190. return wmget.call(store, it) || {};
  191. };
  192. has$1 = function (it) {
  193. return wmhas.call(store, it);
  194. };
  195. } else {
  196. var STATE = sharedKey('state');
  197. hiddenKeys[STATE] = true;
  198. set = function (it, metadata) {
  199. hide(it, STATE, metadata);
  200. return metadata;
  201. };
  202. get = function (it) {
  203. return has(it, STATE) ? it[STATE] : {};
  204. };
  205. has$1 = function (it) {
  206. return has(it, STATE);
  207. };
  208. }
  209. var internalState = {
  210. set: set,
  211. get: get,
  212. has: has$1,
  213. enforce: enforce,
  214. getterFor: getterFor
  215. };
  216. var redefine = createCommonjsModule(function (module) {
  217. var getInternalState = internalState.get;
  218. var enforceInternalState = internalState.enforce;
  219. var TEMPLATE = String(functionToString).split('toString');
  220. shared('inspectSource', function (it) {
  221. return functionToString.call(it);
  222. });
  223. (module.exports = function (O, key, value, options) {
  224. var unsafe = options ? !!options.unsafe : false;
  225. var simple = options ? !!options.enumerable : false;
  226. var noTargetGet = options ? !!options.noTargetGet : false;
  227. if (typeof value == 'function') {
  228. if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
  229. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  230. }
  231. if (O === global) {
  232. if (simple) O[key] = value;
  233. else setGlobal(key, value);
  234. return;
  235. } else if (!unsafe) {
  236. delete O[key];
  237. } else if (!noTargetGet && O[key]) {
  238. simple = true;
  239. }
  240. if (simple) O[key] = value;
  241. else hide(O, key, value);
  242. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  243. })(Function.prototype, 'toString', function toString() {
  244. return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
  245. });
  246. });
  247. var ceil = Math.ceil;
  248. var floor = Math.floor;
  249. // `ToInteger` abstract operation
  250. // https://tc39.github.io/ecma262/#sec-tointeger
  251. var toInteger = function (argument) {
  252. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  253. };
  254. var min = Math.min;
  255. // `ToLength` abstract operation
  256. // https://tc39.github.io/ecma262/#sec-tolength
  257. var toLength = function (argument) {
  258. return argument > 0 ? min(toInteger(argument), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  259. };
  260. var max = Math.max;
  261. var min$1 = Math.min;
  262. // Helper for a popular repeating case of the spec:
  263. // Let integer be ? ToInteger(index).
  264. // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
  265. var toAbsoluteIndex = function (index, length) {
  266. var integer = toInteger(index);
  267. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  268. };
  269. // `Array.prototype.{ indexOf, includes }` methods implementation
  270. // false -> Array#indexOf
  271. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  272. // true -> Array#includes
  273. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  274. var arrayIncludes = function (IS_INCLUDES) {
  275. return function ($this, el, fromIndex) {
  276. var O = toIndexedObject($this);
  277. var length = toLength(O.length);
  278. var index = toAbsoluteIndex(fromIndex, length);
  279. var value;
  280. // Array#includes uses SameValueZero equality algorithm
  281. // eslint-disable-next-line no-self-compare
  282. if (IS_INCLUDES && el != el) while (length > index) {
  283. value = O[index++];
  284. // eslint-disable-next-line no-self-compare
  285. if (value != value) return true;
  286. // Array#indexOf ignores holes, Array#includes - not
  287. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  288. if (O[index] === el) return IS_INCLUDES || index || 0;
  289. } return !IS_INCLUDES && -1;
  290. };
  291. };
  292. var arrayIndexOf = arrayIncludes(false);
  293. var objectKeysInternal = function (object, names) {
  294. var O = toIndexedObject(object);
  295. var i = 0;
  296. var result = [];
  297. var key;
  298. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  299. // Don't enum bug & hidden keys
  300. while (names.length > i) if (has(O, key = names[i++])) {
  301. ~arrayIndexOf(result, key) || result.push(key);
  302. }
  303. return result;
  304. };
  305. // IE8- don't enum bug keys
  306. var enumBugKeys = [
  307. 'constructor',
  308. 'hasOwnProperty',
  309. 'isPrototypeOf',
  310. 'propertyIsEnumerable',
  311. 'toLocaleString',
  312. 'toString',
  313. 'valueOf'
  314. ];
  315. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  316. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  317. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  318. return objectKeysInternal(O, hiddenKeys$1);
  319. };
  320. var objectGetOwnPropertyNames = {
  321. f: f$3
  322. };
  323. var f$4 = Object.getOwnPropertySymbols;
  324. var objectGetOwnPropertySymbols = {
  325. f: f$4
  326. };
  327. var Reflect = global.Reflect;
  328. // all object keys, includes non-enumerable and symbols
  329. var ownKeys = Reflect && Reflect.ownKeys || function ownKeys(it) {
  330. var keys = objectGetOwnPropertyNames.f(anObject(it));
  331. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  332. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  333. };
  334. var copyConstructorProperties = function (target, source) {
  335. var keys = ownKeys(source);
  336. var defineProperty = objectDefineProperty.f;
  337. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  338. for (var i = 0; i < keys.length; i++) {
  339. var key = keys[i];
  340. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  341. }
  342. };
  343. var replacement = /#|\.prototype\./;
  344. var isForced = function (feature, detection) {
  345. var value = data[normalize(feature)];
  346. return value == POLYFILL ? true
  347. : value == NATIVE ? false
  348. : typeof detection == 'function' ? fails(detection)
  349. : !!detection;
  350. };
  351. var normalize = isForced.normalize = function (string) {
  352. return String(string).replace(replacement, '.').toLowerCase();
  353. };
  354. var data = isForced.data = {};
  355. var NATIVE = isForced.NATIVE = 'N';
  356. var POLYFILL = isForced.POLYFILL = 'P';
  357. var isForced_1 = isForced;
  358. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  359. /*
  360. options.target - name of the target object
  361. options.global - target is the global object
  362. options.stat - export as static methods of target
  363. options.proto - export as prototype methods of target
  364. options.real - real prototype method for the `pure` version
  365. options.forced - export even if the native feature is available
  366. options.bind - bind methods to the target, required for the `pure` version
  367. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  368. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  369. options.sham - add a flag to not completely full polyfills
  370. options.enumerable - export as enumerable property
  371. options.noTargetGet - prevent calling a getter on target
  372. */
  373. var _export = function (options, source) {
  374. var TARGET = options.target;
  375. var GLOBAL = options.global;
  376. var STATIC = options.stat;
  377. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  378. if (GLOBAL) {
  379. target = global;
  380. } else if (STATIC) {
  381. target = global[TARGET] || setGlobal(TARGET, {});
  382. } else {
  383. target = (global[TARGET] || {}).prototype;
  384. }
  385. if (target) for (key in source) {
  386. sourceProperty = source[key];
  387. if (options.noTargetGet) {
  388. descriptor = getOwnPropertyDescriptor(target, key);
  389. targetProperty = descriptor && descriptor.value;
  390. } else targetProperty = target[key];
  391. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  392. // contained in target
  393. if (!FORCED && targetProperty !== undefined) {
  394. if (typeof sourceProperty === typeof targetProperty) continue;
  395. copyConstructorProperties(sourceProperty, targetProperty);
  396. }
  397. // add a flag to not completely full polyfills
  398. if (options.sham || (targetProperty && targetProperty.sham)) {
  399. hide(sourceProperty, 'sham', true);
  400. }
  401. // extend global
  402. redefine(target, key, sourceProperty, options);
  403. }
  404. };
  405. // Chrome 38 Symbol has incorrect toString conversion
  406. var nativeSymbol = !fails(function () {
  407. });
  408. var store$1 = shared('wks');
  409. var Symbol$1 = global.Symbol;
  410. var wellKnownSymbol = function (name) {
  411. return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
  412. || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
  413. };
  414. var defineProperty = objectDefineProperty.f;
  415. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  416. var setToStringTag = function (it, TAG, STATIC) {
  417. if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
  418. defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  419. }
  420. };
  421. var f$5 = wellKnownSymbol;
  422. var wrappedWellKnownSymbol = {
  423. f: f$5
  424. };
  425. var path = global;
  426. var defineProperty$1 = objectDefineProperty.f;
  427. var defineWellKnownSymbol = function (NAME) {
  428. var Symbol = path.Symbol || (path.Symbol = {});
  429. if (!has(Symbol, NAME)) defineProperty$1(Symbol, NAME, {
  430. value: wrappedWellKnownSymbol.f(NAME)
  431. });
  432. };
  433. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  434. var objectKeys = Object.keys || function keys(O) {
  435. return objectKeysInternal(O, enumBugKeys);
  436. };
  437. // all enumerable object keys, includes symbols
  438. var enumKeys = function (it) {
  439. var result = objectKeys(it);
  440. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  441. if (getOwnPropertySymbols) {
  442. var symbols = getOwnPropertySymbols(it);
  443. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  444. var i = 0;
  445. var key;
  446. while (symbols.length > i) if (propertyIsEnumerable.call(it, key = symbols[i++])) result.push(key);
  447. } return result;
  448. };
  449. // `IsArray` abstract operation
  450. // https://tc39.github.io/ecma262/#sec-isarray
  451. var isArray = Array.isArray || function isArray(arg) {
  452. return classofRaw(arg) == 'Array';
  453. };
  454. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  455. anObject(O);
  456. var keys = objectKeys(Properties);
  457. var length = keys.length;
  458. var i = 0;
  459. var key;
  460. while (length > i) objectDefineProperty.f(O, key = keys[i++], Properties[key]);
  461. return O;
  462. };
  463. var document$1 = global.document;
  464. var html = document$1 && document$1.documentElement;
  465. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  466. var IE_PROTO = sharedKey('IE_PROTO');
  467. var PROTOTYPE = 'prototype';
  468. var Empty = function () { /* empty */ };
  469. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  470. var createDict = function () {
  471. // Thrash, waste and sodomy: IE GC bug
  472. var iframe = documentCreateElement('iframe');
  473. var length = enumBugKeys.length;
  474. var lt = '<';
  475. var script = 'script';
  476. var gt = '>';
  477. var js = 'java' + script + ':';
  478. var iframeDocument;
  479. iframe.style.display = 'none';
  480. html.appendChild(iframe);
  481. iframe.src = String(js);
  482. iframeDocument = iframe.contentWindow.document;
  483. iframeDocument.open();
  484. iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
  485. iframeDocument.close();
  486. createDict = iframeDocument.F;
  487. while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
  488. return createDict();
  489. };
  490. var objectCreate = Object.create || function create(O, Properties) {
  491. var result;
  492. if (O !== null) {
  493. Empty[PROTOTYPE] = anObject(O);
  494. result = new Empty();
  495. Empty[PROTOTYPE] = null;
  496. // add "__proto__" for Object.getPrototypeOf polyfill
  497. result[IE_PROTO] = O;
  498. } else result = createDict();
  499. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  500. };
  501. hiddenKeys[IE_PROTO] = true;
  502. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  503. var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
  504. var toString$1 = {}.toString;
  505. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  506. ? Object.getOwnPropertyNames(window) : [];
  507. var getWindowNames = function (it) {
  508. try {
  509. return nativeGetOwnPropertyNames(it);
  510. } catch (e) {
  511. return windowNames.slice();
  512. }
  513. };
  514. var f$6 = function getOwnPropertyNames(it) {
  515. return windowNames && toString$1.call(it) == '[object Window]'
  516. ? getWindowNames(it)
  517. : nativeGetOwnPropertyNames(toIndexedObject(it));
  518. };
  519. var objectGetOwnPropertyNamesExternal = {
  520. f: f$6
  521. };
  522. // ECMAScript 6 symbols shim
  523. var HIDDEN = sharedKey('hidden');
  524. var SYMBOL = 'Symbol';
  525. var setInternalState = internalState.set;
  526. var getInternalState = internalState.getterFor(SYMBOL);
  527. var nativeGetOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
  528. var nativeDefineProperty$1 = objectDefineProperty.f;
  529. var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
  530. var $Symbol = global.Symbol;
  531. var JSON = global.JSON;
  532. var nativeJSONStringify = JSON && JSON.stringify;
  533. var PROTOTYPE$1 = 'prototype';
  534. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  535. var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f;
  536. var SymbolRegistry = shared('symbol-registry');
  537. var AllSymbols = shared('symbols');
  538. var ObjectPrototypeSymbols = shared('op-symbols');
  539. var WellKnownSymbolsStore = shared('wks');
  540. var ObjectPrototype = Object[PROTOTYPE$1];
  541. var QObject = global.QObject;
  542. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  543. var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
  544. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  545. var setSymbolDescriptor = descriptors && fails(function () {
  546. return objectCreate(nativeDefineProperty$1({}, 'a', {
  547. get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; }
  548. })).a != 7;
  549. }) ? function (it, key, D) {
  550. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$2(ObjectPrototype, key);
  551. if (ObjectPrototypeDescriptor) delete ObjectPrototype[key];
  552. nativeDefineProperty$1(it, key, D);
  553. if (ObjectPrototypeDescriptor && it !== ObjectPrototype) {
  554. nativeDefineProperty$1(ObjectPrototype, key, ObjectPrototypeDescriptor);
  555. }
  556. } : nativeDefineProperty$1;
  557. var wrap = function (tag, description) {
  558. var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]);
  559. setInternalState(symbol, {
  560. type: SYMBOL,
  561. tag: tag,
  562. description: description
  563. });
  564. if (!descriptors) symbol.description = description;
  565. return symbol;
  566. };
  567. var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) {
  568. return typeof it == 'symbol';
  569. } : function (it) {
  570. return Object(it) instanceof $Symbol;
  571. };
  572. var $defineProperty = function defineProperty(it, key, D) {
  573. if (it === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, key, D);
  574. anObject(it);
  575. key = toPrimitive(key, true);
  576. anObject(D);
  577. if (has(AllSymbols, key)) {
  578. if (!D.enumerable) {
  579. if (!has(it, HIDDEN)) nativeDefineProperty$1(it, HIDDEN, createPropertyDescriptor(1, {}));
  580. it[HIDDEN][key] = true;
  581. } else {
  582. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  583. D = objectCreate(D, { enumerable: createPropertyDescriptor(0, false) });
  584. } return setSymbolDescriptor(it, key, D);
  585. } return nativeDefineProperty$1(it, key, D);
  586. };
  587. var $defineProperties = function defineProperties(it, P) {
  588. anObject(it);
  589. var keys = enumKeys(P = toIndexedObject(P));
  590. var i = 0;
  591. var l = keys.length;
  592. var key;
  593. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  594. return it;
  595. };
  596. var $create = function create(it, P) {
  597. return P === undefined ? objectCreate(it) : $defineProperties(objectCreate(it), P);
  598. };
  599. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  600. var E = nativePropertyIsEnumerable$1.call(this, key = toPrimitive(key, true));
  601. if (this === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return false;
  602. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  603. };
  604. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  605. it = toIndexedObject(it);
  606. key = toPrimitive(key, true);
  607. if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
  608. var D = nativeGetOwnPropertyDescriptor$2(it, key);
  609. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  610. return D;
  611. };
  612. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  613. var names = nativeGetOwnPropertyNames$1(toIndexedObject(it));
  614. var result = [];
  615. var i = 0;
  616. var key;
  617. while (names.length > i) {
  618. if (!has(AllSymbols, key = names[i++]) && !has(hiddenKeys, key)) result.push(key);
  619. } return result;
  620. };
  621. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  622. var IS_OP = it === ObjectPrototype;
  623. var names = nativeGetOwnPropertyNames$1(IS_OP ? ObjectPrototypeSymbols : toIndexedObject(it));
  624. var result = [];
  625. var i = 0;
  626. var key;
  627. while (names.length > i) {
  628. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectPrototype, key) : true)) result.push(AllSymbols[key]);
  629. } return result;
  630. };
  631. // `Symbol` constructor
  632. // https://tc39.github.io/ecma262/#sec-symbol-constructor
  633. if (!nativeSymbol) {
  634. $Symbol = function Symbol() {
  635. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
  636. var description = arguments[0] === undefined ? undefined : String(arguments[0]);
  637. var tag = uid(description);
  638. var setter = function (value) {
  639. if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
  640. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  641. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  642. };
  643. if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  644. return wrap(tag, description);
  645. };
  646. redefine($Symbol[PROTOTYPE$1], 'toString', function toString() {
  647. return getInternalState(this).tag;
  648. });
  649. objectPropertyIsEnumerable.f = $propertyIsEnumerable;
  650. objectDefineProperty.f = $defineProperty;
  651. objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor;
  652. objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  653. objectGetOwnPropertySymbols.f = $getOwnPropertySymbols;
  654. if (descriptors) {
  655. // https://github.com/tc39/proposal-Symbol-description
  656. nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', {
  657. configurable: true,
  658. get: function description() {
  659. return getInternalState(this).description;
  660. }
  661. });
  662. {
  663. redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
  664. }
  665. }
  666. wrappedWellKnownSymbol.f = function (name) {
  667. return wrap(wellKnownSymbol(name), name);
  668. };
  669. }
  670. _export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, { Symbol: $Symbol });
  671. for (var wellKnownSymbols = objectKeys(WellKnownSymbolsStore), k = 0; wellKnownSymbols.length > k;) {
  672. defineWellKnownSymbol(wellKnownSymbols[k++]);
  673. }
  674. _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
  675. // `Symbol.for` method
  676. // https://tc39.github.io/ecma262/#sec-symbol.for
  677. 'for': function (key) {
  678. return has(SymbolRegistry, key += '')
  679. ? SymbolRegistry[key]
  680. : SymbolRegistry[key] = $Symbol(key);
  681. },
  682. // `Symbol.keyFor` method
  683. // https://tc39.github.io/ecma262/#sec-symbol.keyfor
  684. keyFor: function keyFor(sym) {
  685. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
  686. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  687. },
  688. useSetter: function () { USE_SETTER = true; },
  689. useSimple: function () { USE_SETTER = false; }
  690. });
  691. _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
  692. // `Object.create` method
  693. // https://tc39.github.io/ecma262/#sec-object.create
  694. create: $create,
  695. // `Object.defineProperty` method
  696. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  697. defineProperty: $defineProperty,
  698. // `Object.defineProperties` method
  699. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  700. defineProperties: $defineProperties,
  701. // `Object.getOwnPropertyDescriptor` method
  702. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
  703. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  704. });
  705. _export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
  706. // `Object.getOwnPropertyNames` method
  707. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  708. getOwnPropertyNames: $getOwnPropertyNames,
  709. // `Object.getOwnPropertySymbols` method
  710. // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
  711. getOwnPropertySymbols: $getOwnPropertySymbols
  712. });
  713. // `JSON.stringify` method behavior with symbols
  714. // https://tc39.github.io/ecma262/#sec-json.stringify
  715. JSON && _export({ target: 'JSON', stat: true, forced: !nativeSymbol || fails(function () {
  716. var symbol = $Symbol();
  717. // MS Edge converts symbol values to JSON as {}
  718. return nativeJSONStringify([symbol]) != '[null]'
  719. // WebKit converts symbol values to JSON as null
  720. || nativeJSONStringify({ a: symbol }) != '{}'
  721. // V8 throws on boxed symbols
  722. || nativeJSONStringify(Object(symbol)) != '{}';
  723. }) }, {
  724. stringify: function stringify(it) {
  725. var args = [it];
  726. var i = 1;
  727. var replacer, $replacer;
  728. while (arguments.length > i) args.push(arguments[i++]);
  729. $replacer = replacer = args[1];
  730. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  731. if (!isArray(replacer)) replacer = function (key, value) {
  732. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  733. if (!isSymbol(value)) return value;
  734. };
  735. args[1] = replacer;
  736. return nativeJSONStringify.apply(JSON, args);
  737. }
  738. });
  739. // `Symbol.prototype[@@toPrimitive]` method
  740. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
  741. if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
  742. // `Symbol.prototype[@@toStringTag]` property
  743. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
  744. setToStringTag($Symbol, SYMBOL);
  745. hiddenKeys[HIDDEN] = true;
  746. var defineProperty$2 = objectDefineProperty.f;
  747. var NativeSymbol = global.Symbol;
  748. if (descriptors && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
  749. // Safari 12 bug
  750. NativeSymbol().description !== undefined
  751. )) {
  752. var EmptyStringDescriptionStore = {};
  753. // wrap Symbol constructor for correct work with undefined description
  754. var SymbolWrapper = function Symbol() {
  755. var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
  756. var result = this instanceof SymbolWrapper
  757. ? new NativeSymbol(description)
  758. // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
  759. : description === undefined ? NativeSymbol() : NativeSymbol(description);
  760. if (description === '') EmptyStringDescriptionStore[result] = true;
  761. return result;
  762. };
  763. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  764. var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
  765. symbolPrototype.constructor = SymbolWrapper;
  766. var symbolToString = symbolPrototype.toString;
  767. var native = String(NativeSymbol('test')) == 'Symbol(test)';
  768. var regexp = /^Symbol\((.*)\)[^)]+$/;
  769. defineProperty$2(symbolPrototype, 'description', {
  770. configurable: true,
  771. get: function description() {
  772. var symbol = isObject(this) ? this.valueOf() : this;
  773. var string = symbolToString.call(symbol);
  774. if (has(EmptyStringDescriptionStore, symbol)) return '';
  775. var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
  776. return desc === '' ? undefined : desc;
  777. }
  778. });
  779. _export({ global: true, forced: true }, { Symbol: SymbolWrapper });
  780. }
  781. // `Symbol.iterator` well-known symbol
  782. // https://tc39.github.io/ecma262/#sec-symbol.iterator
  783. defineWellKnownSymbol('iterator');
  784. // `ToObject` abstract operation
  785. // https://tc39.github.io/ecma262/#sec-toobject
  786. var toObject = function (argument) {
  787. return Object(requireObjectCoercible(argument));
  788. };
  789. var createProperty = function (object, key, value) {
  790. var propertyKey = toPrimitive(key);
  791. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  792. else object[propertyKey] = value;
  793. };
  794. var SPECIES = wellKnownSymbol('species');
  795. // `ArraySpeciesCreate` abstract operation
  796. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  797. var arraySpeciesCreate = function (originalArray, length) {
  798. var C;
  799. if (isArray(originalArray)) {
  800. C = originalArray.constructor;
  801. // cross-realm fallback
  802. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  803. else if (isObject(C)) {
  804. C = C[SPECIES];
  805. if (C === null) C = undefined;
  806. }
  807. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  808. };
  809. var SPECIES$1 = wellKnownSymbol('species');
  810. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  811. return !fails(function () {
  812. var array = [];
  813. var constructor = array.constructor = {};
  814. constructor[SPECIES$1] = function () {
  815. return { foo: 1 };
  816. };
  817. return array[METHOD_NAME](Boolean).foo !== 1;
  818. });
  819. };
  820. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  821. var MAX_SAFE_INTEGER = 0x1fffffffffffff;
  822. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  823. var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
  824. var array = [];
  825. array[IS_CONCAT_SPREADABLE] = false;
  826. return array.concat()[0] !== array;
  827. });
  828. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  829. var isConcatSpreadable = function (O) {
  830. if (!isObject(O)) return false;
  831. var spreadable = O[IS_CONCAT_SPREADABLE];
  832. return spreadable !== undefined ? !!spreadable : isArray(O);
  833. };
  834. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  835. // `Array.prototype.concat` method
  836. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  837. // with adding support of @@isConcatSpreadable and @@species
  838. _export({ target: 'Array', proto: true, forced: FORCED }, {
  839. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  840. var O = toObject(this);
  841. var A = arraySpeciesCreate(O, 0);
  842. var n = 0;
  843. var i, k, length, len, E;
  844. for (i = -1, length = arguments.length; i < length; i++) {
  845. E = i === -1 ? O : arguments[i];
  846. if (isConcatSpreadable(E)) {
  847. len = toLength(E.length);
  848. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  849. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  850. } else {
  851. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  852. createProperty(A, n++, E);
  853. }
  854. }
  855. A.length = n;
  856. return A;
  857. }
  858. });
  859. var aFunction = function (it) {
  860. if (typeof it != 'function') {
  861. throw TypeError(String(it) + ' is not a function');
  862. } return it;
  863. };
  864. // optional / simple context binding
  865. var bindContext = function (fn, that, length) {
  866. aFunction(fn);
  867. if (that === undefined) return fn;
  868. switch (length) {
  869. case 0: return function () {
  870. return fn.call(that);
  871. };
  872. case 1: return function (a) {
  873. return fn.call(that, a);
  874. };
  875. case 2: return function (a, b) {
  876. return fn.call(that, a, b);
  877. };
  878. case 3: return function (a, b, c) {
  879. return fn.call(that, a, b, c);
  880. };
  881. }
  882. return function (/* ...args */) {
  883. return fn.apply(that, arguments);
  884. };
  885. };
  886. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  887. // 0 -> Array#forEach
  888. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  889. // 1 -> Array#map
  890. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  891. // 2 -> Array#filter
  892. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  893. // 3 -> Array#some
  894. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  895. // 4 -> Array#every
  896. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  897. // 5 -> Array#find
  898. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  899. // 6 -> Array#findIndex
  900. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  901. var arrayMethods = function (TYPE, specificCreate) {
  902. var IS_MAP = TYPE == 1;
  903. var IS_FILTER = TYPE == 2;
  904. var IS_SOME = TYPE == 3;
  905. var IS_EVERY = TYPE == 4;
  906. var IS_FIND_INDEX = TYPE == 6;
  907. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  908. var create = specificCreate || arraySpeciesCreate;
  909. return function ($this, callbackfn, that) {
  910. var O = toObject($this);
  911. var self = indexedObject(O);
  912. var boundFunction = bindContext(callbackfn, that, 3);
  913. var length = toLength(self.length);
  914. var index = 0;
  915. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  916. var value, result;
  917. for (;length > index; index++) if (NO_HOLES || index in self) {
  918. value = self[index];
  919. result = boundFunction(value, index, O);
  920. if (TYPE) {
  921. if (IS_MAP) target[index] = result; // map
  922. else if (result) switch (TYPE) {
  923. case 3: return true; // some
  924. case 5: return value; // find
  925. case 6: return index; // findIndex
  926. case 2: target.push(value); // filter
  927. } else if (IS_EVERY) return false; // every
  928. }
  929. }
  930. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  931. };
  932. };
  933. var UNSCOPABLES = wellKnownSymbol('unscopables');
  934. var ArrayPrototype = Array.prototype;
  935. // Array.prototype[@@unscopables]
  936. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  937. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  938. hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
  939. }
  940. // add a key to Array.prototype[@@unscopables]
  941. var addToUnscopables = function (key) {
  942. ArrayPrototype[UNSCOPABLES][key] = true;
  943. };
  944. var internalFind = arrayMethods(5);
  945. var FIND = 'find';
  946. var SKIPS_HOLES = true;
  947. // Shouldn't skip holes
  948. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  949. // `Array.prototype.find` method
  950. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  951. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  952. find: function find(callbackfn /* , that = undefined */) {
  953. return internalFind(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  954. }
  955. });
  956. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  957. addToUnscopables(FIND);
  958. var correctPrototypeGetter = !fails(function () {
  959. function F() { /* empty */ }
  960. F.prototype.constructor = null;
  961. return Object.getPrototypeOf(new F()) !== F.prototype;
  962. });
  963. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  964. var IE_PROTO$1 = sharedKey('IE_PROTO');
  965. var ObjectPrototype$1 = Object.prototype;
  966. var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
  967. O = toObject(O);
  968. if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
  969. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  970. return O.constructor.prototype;
  971. } return O instanceof Object ? ObjectPrototype$1 : null;
  972. };
  973. var ITERATOR = wellKnownSymbol('iterator');
  974. var BUGGY_SAFARI_ITERATORS = false;
  975. var returnThis = function () { return this; };
  976. // `%IteratorPrototype%` object
  977. // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
  978. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  979. if ([].keys) {
  980. arrayIterator = [].keys();
  981. // Safari 8 has buggy iterators w/o `next`
  982. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  983. else {
  984. PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
  985. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  986. }
  987. }
  988. if (IteratorPrototype == undefined) IteratorPrototype = {};
  989. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  990. if (!has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
  991. var iteratorsCore = {
  992. IteratorPrototype: IteratorPrototype,
  993. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  994. };
  995. var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
  996. var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
  997. var TO_STRING_TAG = NAME + ' Iterator';
  998. IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
  999. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  1000. return IteratorConstructor;
  1001. };
  1002. var validateSetPrototypeOfArguments = function (O, proto) {
  1003. anObject(O);
  1004. if (!isObject(proto) && proto !== null) {
  1005. throw TypeError("Can't set " + String(proto) + ' as a prototype');
  1006. }
  1007. };
  1008. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1009. /* eslint-disable no-proto */
  1010. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { // eslint-disable-line
  1011. var correctSetter = false;
  1012. var test = {};
  1013. var setter;
  1014. try {
  1015. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  1016. setter.call(test, []);
  1017. correctSetter = test instanceof Array;
  1018. } catch (e) { /* empty */ }
  1019. return function setPrototypeOf(O, proto) {
  1020. validateSetPrototypeOfArguments(O, proto);
  1021. if (correctSetter) setter.call(O, proto);
  1022. else O.__proto__ = proto;
  1023. return O;
  1024. };
  1025. }() : undefined);
  1026. var ITERATOR$1 = wellKnownSymbol('iterator');
  1027. var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
  1028. var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
  1029. var KEYS = 'keys';
  1030. var VALUES = 'values';
  1031. var ENTRIES = 'entries';
  1032. var returnThis$1 = function () { return this; };
  1033. var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  1034. createIteratorConstructor(IteratorConstructor, NAME, next);
  1035. var getIterationMethod = function (KIND) {
  1036. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  1037. if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
  1038. switch (KIND) {
  1039. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  1040. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  1041. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  1042. } return function () { return new IteratorConstructor(this); };
  1043. };
  1044. var TO_STRING_TAG = NAME + ' Iterator';
  1045. var INCORRECT_VALUES_NAME = false;
  1046. var IterablePrototype = Iterable.prototype;
  1047. var nativeIterator = IterablePrototype[ITERATOR$1]
  1048. || IterablePrototype['@@iterator']
  1049. || DEFAULT && IterablePrototype[DEFAULT];
  1050. var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
  1051. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  1052. var CurrentIteratorPrototype, methods, KEY;
  1053. // fix native
  1054. if (anyNativeIterator) {
  1055. CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
  1056. if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
  1057. if (objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
  1058. if (objectSetPrototypeOf) {
  1059. objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
  1060. } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
  1061. hide(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
  1062. }
  1063. }
  1064. // Set @@toStringTag to native iterators
  1065. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  1066. }
  1067. }
  1068. // fix Array#{values, @@iterator}.name in V8 / FF
  1069. if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  1070. INCORRECT_VALUES_NAME = true;
  1071. defaultIterator = function values() { return nativeIterator.call(this); };
  1072. }
  1073. // define iterator
  1074. if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
  1075. hide(IterablePrototype, ITERATOR$1, defaultIterator);
  1076. }
  1077. // export additional methods
  1078. if (DEFAULT) {
  1079. methods = {
  1080. values: getIterationMethod(VALUES),
  1081. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  1082. entries: getIterationMethod(ENTRIES)
  1083. };
  1084. if (FORCED) for (KEY in methods) {
  1085. if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  1086. redefine(IterablePrototype, KEY, methods[KEY]);
  1087. }
  1088. } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
  1089. }
  1090. return methods;
  1091. };
  1092. var ARRAY_ITERATOR = 'Array Iterator';
  1093. var setInternalState$1 = internalState.set;
  1094. var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
  1095. // `Array.prototype.entries` method
  1096. // https://tc39.github.io/ecma262/#sec-array.prototype.entries
  1097. // `Array.prototype.keys` method
  1098. // https://tc39.github.io/ecma262/#sec-array.prototype.keys
  1099. // `Array.prototype.values` method
  1100. // https://tc39.github.io/ecma262/#sec-array.prototype.values
  1101. // `Array.prototype[@@iterator]` method
  1102. // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
  1103. // `CreateArrayIterator` internal method
  1104. // https://tc39.github.io/ecma262/#sec-createarrayiterator
  1105. var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
  1106. setInternalState$1(this, {
  1107. type: ARRAY_ITERATOR,
  1108. target: toIndexedObject(iterated), // target
  1109. index: 0, // next index
  1110. kind: kind // kind
  1111. });
  1112. // `%ArrayIteratorPrototype%.next` method
  1113. // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
  1114. }, function () {
  1115. var state = getInternalState$1(this);
  1116. var target = state.target;
  1117. var kind = state.kind;
  1118. var index = state.index++;
  1119. if (!target || index >= target.length) {
  1120. state.target = undefined;
  1121. return { value: undefined, done: true };
  1122. }
  1123. if (kind == 'keys') return { value: index, done: false };
  1124. if (kind == 'values') return { value: target[index], done: false };
  1125. return { value: [index, target[index]], done: false };
  1126. }, 'values');
  1127. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  1128. addToUnscopables('keys');
  1129. addToUnscopables('values');
  1130. addToUnscopables('entries');
  1131. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  1132. var method = [][METHOD_NAME];
  1133. return !method || !fails(function () {
  1134. // eslint-disable-next-line no-useless-call
  1135. method.call(null, argument || function () { throw Error(); }, 1);
  1136. });
  1137. };
  1138. var nativeJoin = [].join;
  1139. var ES3_STRINGS = indexedObject != Object;
  1140. var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
  1141. // `Array.prototype.join` method
  1142. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  1143. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
  1144. join: function join(separator) {
  1145. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1146. }
  1147. });
  1148. var SPECIES$2 = wellKnownSymbol('species');
  1149. var nativeSlice = [].slice;
  1150. var max$1 = Math.max;
  1151. var SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  1152. // `Array.prototype.slice` method
  1153. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  1154. // fallback for not array-like ES3 strings and DOM objects
  1155. _export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT$1 }, {
  1156. slice: function slice(start, end) {
  1157. var O = toIndexedObject(this);
  1158. var length = toLength(O.length);
  1159. var k = toAbsoluteIndex(start, length);
  1160. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1161. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1162. var Constructor, result, n;
  1163. if (isArray(O)) {
  1164. Constructor = O.constructor;
  1165. // cross-realm fallback
  1166. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  1167. Constructor = undefined;
  1168. } else if (isObject(Constructor)) {
  1169. Constructor = Constructor[SPECIES$2];
  1170. if (Constructor === null) Constructor = undefined;
  1171. }
  1172. if (Constructor === Array || Constructor === undefined) {
  1173. return nativeSlice.call(O, k, fin);
  1174. }
  1175. }
  1176. result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
  1177. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  1178. result.length = n;
  1179. return result;
  1180. }
  1181. });
  1182. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  1183. // ES3 wrong here
  1184. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  1185. // fallback for IE11 Script Access Denied error
  1186. var tryGet = function (it, key) {
  1187. try {
  1188. return it[key];
  1189. } catch (e) { /* empty */ }
  1190. };
  1191. // getting tag from ES6+ `Object.prototype.toString`
  1192. var classof = function (it) {
  1193. var O, tag, result;
  1194. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1195. // @@toStringTag case
  1196. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
  1197. // builtinTag case
  1198. : CORRECT_ARGUMENTS ? classofRaw(O)
  1199. // ES3 arguments fallback
  1200. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  1201. };
  1202. var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
  1203. var test = {};
  1204. test[TO_STRING_TAG$2] = 'z';
  1205. // `Object.prototype.toString` method implementation
  1206. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  1207. var objectToString = String(test) !== '[object z]' ? function toString() {
  1208. return '[object ' + classof(this) + ']';
  1209. } : test.toString;
  1210. var ObjectPrototype$2 = Object.prototype;
  1211. // `Object.prototype.toString` method
  1212. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  1213. if (objectToString !== ObjectPrototype$2.toString) {
  1214. redefine(ObjectPrototype$2, 'toString', objectToString, { unsafe: true });
  1215. }
  1216. // CONVERT_TO_STRING: true -> String#at
  1217. // CONVERT_TO_STRING: false -> String#codePointAt
  1218. var stringAt = function (that, pos, CONVERT_TO_STRING) {
  1219. var S = String(requireObjectCoercible(that));
  1220. var position = toInteger(pos);
  1221. var size = S.length;
  1222. var first, second;
  1223. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1224. first = S.charCodeAt(position);
  1225. return first < 0xd800 || first > 0xdbff || position + 1 === size
  1226. || (second = S.charCodeAt(position + 1)) < 0xdc00 || second > 0xdfff
  1227. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1228. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xd800 << 10) + (second - 0xdc00) + 0x10000;
  1229. };
  1230. var STRING_ITERATOR = 'String Iterator';
  1231. var setInternalState$2 = internalState.set;
  1232. var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
  1233. // `String.prototype[@@iterator]` method
  1234. // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
  1235. defineIterator(String, 'String', function (iterated) {
  1236. setInternalState$2(this, {
  1237. type: STRING_ITERATOR,
  1238. string: String(iterated),
  1239. index: 0
  1240. });
  1241. // `%StringIteratorPrototype%.next` method
  1242. // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
  1243. }, function next() {
  1244. var state = getInternalState$2(this);
  1245. var string = state.string;
  1246. var index = state.index;
  1247. var point;
  1248. if (index >= string.length) return { value: undefined, done: true };
  1249. point = stringAt(string, index, true);
  1250. state.index += point.length;
  1251. return { value: point, done: false };
  1252. });
  1253. // `AdvanceStringIndex` abstract operation
  1254. // https://tc39.github.io/ecma262/#sec-advancestringindex
  1255. var advanceStringIndex = function (S, index, unicode) {
  1256. return index + (unicode ? stringAt(S, index, true).length : 1);
  1257. };
  1258. // `RegExp.prototype.flags` getter implementation
  1259. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  1260. var regexpFlags = function () {
  1261. var that = anObject(this);
  1262. var result = '';
  1263. if (that.global) result += 'g';
  1264. if (that.ignoreCase) result += 'i';
  1265. if (that.multiline) result += 'm';
  1266. if (that.unicode) result += 'u';
  1267. if (that.sticky) result += 'y';
  1268. return result;
  1269. };
  1270. var nativeExec = RegExp.prototype.exec;
  1271. // This always refers to the native implementation, because the
  1272. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  1273. // which loads this file before patching the method.
  1274. var nativeReplace = String.prototype.replace;
  1275. var patchedExec = nativeExec;
  1276. var UPDATES_LAST_INDEX_WRONG = (function () {
  1277. var re1 = /a/;
  1278. var re2 = /b*/g;
  1279. nativeExec.call(re1, 'a');
  1280. nativeExec.call(re2, 'a');
  1281. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1282. })();
  1283. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1284. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1285. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  1286. if (PATCH) {
  1287. patchedExec = function exec(str) {
  1288. var re = this;
  1289. var lastIndex, reCopy, match, i;
  1290. if (NPCG_INCLUDED) {
  1291. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  1292. }
  1293. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1294. match = nativeExec.call(re, str);
  1295. if (UPDATES_LAST_INDEX_WRONG && match) {
  1296. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1297. }
  1298. if (NPCG_INCLUDED && match && match.length > 1) {
  1299. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1300. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1301. nativeReplace.call(match[0], reCopy, function () {
  1302. for (i = 1; i < arguments.length - 2; i++) {
  1303. if (arguments[i] === undefined) match[i] = undefined;
  1304. }
  1305. });
  1306. }
  1307. return match;
  1308. };
  1309. }
  1310. var regexpExec = patchedExec;
  1311. // `RegExpExec` abstract operation
  1312. // https://tc39.github.io/ecma262/#sec-regexpexec
  1313. var regexpExecAbstract = function (R, S) {
  1314. var exec = R.exec;
  1315. if (typeof exec === 'function') {
  1316. var result = exec.call(R, S);
  1317. if (typeof result !== 'object') {
  1318. throw TypeError('RegExp exec method returned something other than an Object or null');
  1319. }
  1320. return result;
  1321. }
  1322. if (classofRaw(R) !== 'RegExp') {
  1323. throw TypeError('RegExp#exec called on incompatible receiver');
  1324. }
  1325. return regexpExec.call(R, S);
  1326. };
  1327. var SPECIES$3 = wellKnownSymbol('species');
  1328. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1329. // #replace needs built-in support for named groups.
  1330. // #match works fine because it just return the exec results, even if it has
  1331. // a "grops" property.
  1332. var re = /./;
  1333. re.exec = function () {
  1334. var result = [];
  1335. result.groups = { a: '7' };
  1336. return result;
  1337. };
  1338. return ''.replace(re, '$<a>') !== '7';
  1339. });
  1340. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1341. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1342. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1343. var re = /(?:)/;
  1344. var originalExec = re.exec;
  1345. re.exec = function () { return originalExec.apply(this, arguments); };
  1346. var result = 'ab'.split(re);
  1347. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1348. });
  1349. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  1350. var SYMBOL = wellKnownSymbol(KEY);
  1351. var DELEGATES_TO_SYMBOL = !fails(function () {
  1352. // String methods call symbol-named RegEp methods
  1353. var O = {};
  1354. O[SYMBOL] = function () { return 7; };
  1355. return ''[KEY](O) != 7;
  1356. });
  1357. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1358. // Symbol-named RegExp methods call .exec
  1359. var execCalled = false;
  1360. var re = /a/;
  1361. re.exec = function () { execCalled = true; return null; };
  1362. if (KEY === 'split') {
  1363. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1364. // a new one. We need to return the patched regex when creating the new one.
  1365. re.constructor = {};
  1366. re.constructor[SPECIES$3] = function () { return re; };
  1367. }
  1368. re[SYMBOL]('');
  1369. return !execCalled;
  1370. });
  1371. if (
  1372. !DELEGATES_TO_SYMBOL ||
  1373. !DELEGATES_TO_EXEC ||
  1374. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  1375. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  1376. ) {
  1377. var nativeRegExpMethod = /./[SYMBOL];
  1378. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1379. if (regexp.exec === regexpExec) {
  1380. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1381. // The native String method already delegates to @@method (this
  1382. // polyfilled function), leasing to infinite recursion.
  1383. // We avoid it by directly calling the native @@method method.
  1384. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  1385. }
  1386. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  1387. }
  1388. return { done: false };
  1389. });
  1390. var stringMethod = methods[0];
  1391. var regexMethod = methods[1];
  1392. redefine(String.prototype, KEY, stringMethod);
  1393. redefine(RegExp.prototype, SYMBOL, length == 2
  1394. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  1395. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  1396. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  1397. // 21.2.5.6 RegExp.prototype[@@match](string)
  1398. // 21.2.5.9 RegExp.prototype[@@search](string)
  1399. : function (string) { return regexMethod.call(string, this); }
  1400. );
  1401. if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
  1402. }
  1403. };
  1404. var max$2 = Math.max;
  1405. var min$2 = Math.min;
  1406. var floor$1 = Math.floor;
  1407. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  1408. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  1409. var maybeToString = function (it) {
  1410. return it === undefined ? it : String(it);
  1411. };
  1412. // @@replace logic
  1413. fixRegexpWellKnownSymbolLogic(
  1414. 'replace',
  1415. 2,
  1416. function (REPLACE, nativeReplace, maybeCallNative) {
  1417. return [
  1418. // `String.prototype.replace` method
  1419. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  1420. function replace(searchValue, replaceValue) {
  1421. var O = requireObjectCoercible(this);
  1422. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  1423. return replacer !== undefined
  1424. ? replacer.call(searchValue, O, replaceValue)
  1425. : nativeReplace.call(String(O), searchValue, replaceValue);
  1426. },
  1427. // `RegExp.prototype[@@replace]` method
  1428. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  1429. function (regexp, replaceValue) {
  1430. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  1431. if (res.done) return res.value;
  1432. var rx = anObject(regexp);
  1433. var S = String(this);
  1434. var functionalReplace = typeof replaceValue === 'function';
  1435. if (!functionalReplace) replaceValue = String(replaceValue);
  1436. var global = rx.global;
  1437. if (global) {
  1438. var fullUnicode = rx.unicode;
  1439. rx.lastIndex = 0;
  1440. }
  1441. var results = [];
  1442. while (true) {
  1443. var result = regexpExecAbstract(rx, S);
  1444. if (result === null) break;
  1445. results.push(result);
  1446. if (!global) break;
  1447. var matchStr = String(result[0]);
  1448. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1449. }
  1450. var accumulatedResult = '';
  1451. var nextSourcePosition = 0;
  1452. for (var i = 0; i < results.length; i++) {
  1453. result = results[i];
  1454. var matched = String(result[0]);
  1455. var position = max$2(min$2(toInteger(result.index), S.length), 0);
  1456. var captures = [];
  1457. // NOTE: This is equivalent to
  1458. // captures = result.slice(1).map(maybeToString)
  1459. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1460. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1461. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1462. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1463. var namedCaptures = result.groups;
  1464. if (functionalReplace) {
  1465. var replacerArgs = [matched].concat(captures, position, S);
  1466. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1467. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1468. } else {
  1469. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1470. }
  1471. if (position >= nextSourcePosition) {
  1472. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1473. nextSourcePosition = position + matched.length;
  1474. }
  1475. }
  1476. return accumulatedResult + S.slice(nextSourcePosition);
  1477. }
  1478. ];
  1479. // https://tc39.github.io/ecma262/#sec-getsubstitution
  1480. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  1481. var tailPos = position + matched.length;
  1482. var m = captures.length;
  1483. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1484. if (namedCaptures !== undefined) {
  1485. namedCaptures = toObject(namedCaptures);
  1486. symbols = SUBSTITUTION_SYMBOLS;
  1487. }
  1488. return nativeReplace.call(replacement, symbols, function (match, ch) {
  1489. var capture;
  1490. switch (ch.charAt(0)) {
  1491. case '$': return '$';
  1492. case '&': return matched;
  1493. case '`': return str.slice(0, position);
  1494. case "'": return str.slice(tailPos);
  1495. case '<':
  1496. capture = namedCaptures[ch.slice(1, -1)];
  1497. break;
  1498. default: // \d\d?
  1499. var n = +ch;
  1500. if (n === 0) return match;
  1501. if (n > m) {
  1502. var f = floor$1(n / 10);
  1503. if (f === 0) return match;
  1504. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  1505. return match;
  1506. }
  1507. capture = captures[n - 1];
  1508. }
  1509. return capture === undefined ? '' : capture;
  1510. });
  1511. }
  1512. }
  1513. );
  1514. // iterable DOM collections
  1515. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1516. var domIterables = {
  1517. CSSRuleList: 0,
  1518. CSSStyleDeclaration: 0,
  1519. CSSValueList: 0,
  1520. ClientRectList: 0,
  1521. DOMRectList: 0,
  1522. DOMStringList: 0,
  1523. DOMTokenList: 1,
  1524. DataTransferItemList: 0,
  1525. FileList: 0,
  1526. HTMLAllCollection: 0,
  1527. HTMLCollection: 0,
  1528. HTMLFormElement: 0,
  1529. HTMLSelectElement: 0,
  1530. MediaList: 0,
  1531. MimeTypeArray: 0,
  1532. NamedNodeMap: 0,
  1533. NodeList: 1,
  1534. PaintRequestList: 0,
  1535. Plugin: 0,
  1536. PluginArray: 0,
  1537. SVGLengthList: 0,
  1538. SVGNumberList: 0,
  1539. SVGPathSegList: 0,
  1540. SVGPointList: 0,
  1541. SVGStringList: 0,
  1542. SVGTransformList: 0,
  1543. SourceBufferList: 0,
  1544. StyleSheetList: 0,
  1545. TextTrackCueList: 0,
  1546. TextTrackList: 0,
  1547. TouchList: 0
  1548. };
  1549. var ITERATOR$2 = wellKnownSymbol('iterator');
  1550. var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
  1551. var ArrayValues = es_array_iterator.values;
  1552. for (var COLLECTION_NAME in domIterables) {
  1553. var Collection = global[COLLECTION_NAME];
  1554. var CollectionPrototype = Collection && Collection.prototype;
  1555. if (CollectionPrototype) {
  1556. // some Chrome versions have non-configurable methods on DOMTokenList
  1557. if (CollectionPrototype[ITERATOR$2] !== ArrayValues) try {
  1558. hide(CollectionPrototype, ITERATOR$2, ArrayValues);
  1559. } catch (e) {
  1560. CollectionPrototype[ITERATOR$2] = ArrayValues;
  1561. }
  1562. if (!CollectionPrototype[TO_STRING_TAG$3]) hide(CollectionPrototype, TO_STRING_TAG$3, COLLECTION_NAME);
  1563. if (domIterables[COLLECTION_NAME]) for (var METHOD_NAME in es_array_iterator) {
  1564. // some Chrome versions have non-configurable methods on DOMTokenList
  1565. if (CollectionPrototype[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
  1566. hide(CollectionPrototype, METHOD_NAME, es_array_iterator[METHOD_NAME]);
  1567. } catch (e) {
  1568. CollectionPrototype[METHOD_NAME] = es_array_iterator[METHOD_NAME];
  1569. }
  1570. }
  1571. }
  1572. }
  1573. /**
  1574. * @author andrey matveev <aamatveef@gmail.com>
  1575. * @version: v1.1.0
  1576. * https://github.com/aamatveev/bootstrap-table
  1577. * extensions:
  1578. */
  1579. $.extend($.fn.bootstrapTable.defaults, {
  1580. cellInputEnabled: false,
  1581. cellInputType: 'text',
  1582. // text or select or textarea
  1583. cellInputUniqueId: '',
  1584. cellInputSelectOptinons: [],
  1585. // [{ text: '', value: '', disabled: false, default: true },{}]
  1586. cellInputIsDeciaml: false,
  1587. onCellInputInit: function onCellInputInit() {
  1588. return false;
  1589. },
  1590. onCellInputBlur: function onCellInputBlur(field, row, oldValue, $el) {
  1591. return false;
  1592. },
  1593. onCellInputFocus: function onCellInputFocus(field, row, oldValue, $el) {
  1594. return false;
  1595. },
  1596. onCellInputKeyup: function onCellInputKeyup(field, row, oldValue, $el) {
  1597. return false;
  1598. },
  1599. onCellInputKeydown: function onCellInputKeydown(field, row, oldValue, $el) {
  1600. return false;
  1601. },
  1602. onCellInputSelectChange: function onCellInputSelectChange(field, row, oldValue, $el) {
  1603. return false;
  1604. }
  1605. });
  1606. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  1607. 'cellinput-init.bs.table': 'onCellInputInit',
  1608. 'cellinput-blur.bs.table': 'onCellInputBlur',
  1609. 'cellinput-focus.bs.table': 'onCellInputFocus',
  1610. 'cellinput-keyup.bs.table': 'onCellInputKeyup',
  1611. 'cellinput-keydown.bs.table': 'onCellInputKeydown',
  1612. 'cellinput-selectchange.bs.table': 'onCellInputSelectChange'
  1613. });
  1614. var BootstrapTable = $.fn.bootstrapTable.Constructor;
  1615. var _initTable = BootstrapTable.prototype.initTable;
  1616. var _initBody = BootstrapTable.prototype.initBody;
  1617. BootstrapTable.prototype.initTable = function () {
  1618. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1619. args[_key] = arguments[_key];
  1620. }
  1621. _initTable.apply(this, Array.prototype.slice.apply(args)); // exit if table.options.cellInputEnabled = false
  1622. if (!this.options.cellInputEnabled) {
  1623. return;
  1624. }
  1625. $.each(this.columns, function (i, column) {
  1626. // exit if column.cellInputEnabled = false
  1627. if (!column.cellInputEnabled) {
  1628. return;
  1629. }
  1630. var _formatter = column.formatter;
  1631. if (column.cellInputType === 'text') {
  1632. column.formatter = function (value, row, index) {
  1633. var result = _formatter ? _formatter(value, row, index) : value; // Решает проблему невозможности ввода кавычек &quot;
  1634. result = typeof result === 'string' ? result.replace(/"/g, '&quot;') : result;
  1635. var isSetDataUniqueIdAttr = column.cellInputUniqueId && column.cellInputUniqueId.length > 0;
  1636. var disableCallbackFunc = column.cellInputDisableCallbackFunc;
  1637. return ['<input type="text" class="table-td-textbox form-control"', // ' id="' + column.field + '"',
  1638. isSetDataUniqueIdAttr ? " data-uniqueid=\"".concat(row[column.cellInputUniqueId], "\"") : '', " data-name=\"".concat(column.field, "\""), " data-value=\"".concat(result, "\""), " value=\"".concat(result, "\""), ' autofocus="autofocus"', typeof disableCallbackFunc !== 'undefined' && disableCallbackFunc(row) ? ' disabled="disabled"' : '', '>'].join('');
  1639. };
  1640. } else if (column.cellInputType === 'select') {
  1641. column.formatter = function (value, row, index) {
  1642. var result = _formatter ? _formatter(value, row, index) : value;
  1643. var optionDatas = column.cellInputSelectOptinons !== null ? column.cellInputSelectOptinons : [];
  1644. var selectoptions = [];
  1645. var arrAllowedValues = [];
  1646. for (var k = 0; k < optionDatas.length; k++) {
  1647. arrAllowedValues.push(optionDatas[k].value);
  1648. }
  1649. var allowedVal = $.inArray(value, arrAllowedValues) >= 0;
  1650. var _iteratorNormalCompletion = true;
  1651. var _didIteratorError = false;
  1652. var _iteratorError = undefined;
  1653. try {
  1654. for (var _iterator = optionDatas[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  1655. var optionData = _step.value;
  1656. var isSelected = optionData.value === value;
  1657. if (!allowedVal && optionData.disabled) {
  1658. isSelected = true;
  1659. result = optionData.value;
  1660. }
  1661. selectoptions.push("<option value=\"".concat(optionData.value, "\" ").concat(isSelected ? ' selected="selected" ' : '').concat(optionData.disabled ? ' disabled' : '', ">").concat(optionData.text, "</option>"));
  1662. }
  1663. } catch (err) {
  1664. _didIteratorError = true;
  1665. _iteratorError = err;
  1666. } finally {
  1667. try {
  1668. if (!_iteratorNormalCompletion && _iterator.return != null) {
  1669. _iterator.return();
  1670. }
  1671. } finally {
  1672. if (_didIteratorError) {
  1673. throw _iteratorError;
  1674. }
  1675. }
  1676. }
  1677. var isSetDataUniqueIdAttr = column.cellInputUniqueId && column.cellInputUniqueId.length > 0;
  1678. var disableCallbackFunc = column.disableCallbackFunc;
  1679. return ['<select class="form-control" style="padding: 4px;"', isSetDataUniqueIdAttr ? " data-uniqueid=\"".concat(row[column.cellInputUniqueId], "\"") : '', " data-name=\"".concat(column.field, "\""), " data-value=\"".concat(result, "\""), typeof disableCallbackFunc !== 'undefined' && disableCallbackFunc(row) ? ' disabled="disabled"' : '', '>', selectoptions.join(''), '</select>'].join('');
  1680. };
  1681. }
  1682. });
  1683. };
  1684. BootstrapTable.prototype.initBody = function (fixedScroll) {
  1685. var that = this;
  1686. _initBody.apply(this, Array.prototype.slice.apply(arguments));
  1687. if (!this.options.cellInputEnabled) {
  1688. return;
  1689. }
  1690. $.each(this.columns, function (i, column) {
  1691. if (column.cellInputType === 'text') {
  1692. that.$body.find("input[data-name=\"".concat(column.field, "\"]")).off('blur').on('blur', function (e) {
  1693. var data = that.getData();
  1694. var index = $(this).parents('tr[data-index]').data('index');
  1695. var row = data[index];
  1696. var newValue = $(this).val();
  1697. row[column.field] = newValue;
  1698. that.trigger('cellinput-blur', column.field, row, $(this));
  1699. });
  1700. that.$body.find("input[data-name=\"".concat(column.field, "\"]")).off('keyup').on('keyup', function (e) {
  1701. var data = that.getData();
  1702. var index = $(this).parents('tr[data-index]').data('index');
  1703. var row = data[index];
  1704. var oldValue = row[column.field];
  1705. var newValue = $(this).val();
  1706. row[column.field] = newValue;
  1707. that.trigger('cellinput-keyup', column.field, row, oldValue, index, $(this));
  1708. });
  1709. that.$body.find("input[data-name=\"".concat(column.field, "\"]")).off('keydown').on('keydown', function (e) {
  1710. var data = that.getData();
  1711. var index = $(this).parents('tr[data-index]').data('index');
  1712. var row = data[index];
  1713. var oldValue = row[column.field];
  1714. var newValue = $(this).val();
  1715. if (!column.tdtexboxIsDeciaml) {
  1716. row[column.field] = newValue;
  1717. }
  1718. that.trigger('cellinput-keydown', column.field, row, oldValue, index, $(this));
  1719. });
  1720. that.$body.find("input[data-name=\"".concat(column.field, "\"]")).off('focus').on('focus', function (e) {
  1721. var data = that.getData();
  1722. var index = $(this).parents('tr[data-index]').data('index');
  1723. var row = data[index];
  1724. that.trigger('cellinput-focus', column.field, row, $(this));
  1725. });
  1726. } else if (column.cellInputType === 'select') {
  1727. that.$body.find("select[data-name=\"".concat(column.field, "\"]")).off('change').on('change', function (e) {
  1728. var data = that.getData();
  1729. var index = $(this).parents('tr[data-index]').data('index');
  1730. var row = data[index];
  1731. var oldValue = row[column.field];
  1732. var newValue = $(this).val();
  1733. var isBoolTrue = newValue.toLowerCase() === 'true';
  1734. var isBoolFalse = newValue.toLowerCase() === 'false';
  1735. row[column.field] = isBoolTrue ? true : isBoolFalse ? false : newValue;
  1736. that.trigger('cellinput-selectchange', column.field, row, oldValue, index, $(this));
  1737. });
  1738. }
  1739. });
  1740. this.trigger('cellinput-init');
  1741. };
  1742. }));