bootstrap-table-editable.js 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. }(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _inherits(subClass, superClass) {
  28. if (typeof superClass !== "function" && superClass !== null) {
  29. throw new TypeError("Super expression must either be null or a function");
  30. }
  31. subClass.prototype = Object.create(superClass && superClass.prototype, {
  32. constructor: {
  33. value: subClass,
  34. writable: true,
  35. configurable: true
  36. }
  37. });
  38. if (superClass) _setPrototypeOf(subClass, superClass);
  39. }
  40. function _getPrototypeOf(o) {
  41. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  42. return o.__proto__ || Object.getPrototypeOf(o);
  43. };
  44. return _getPrototypeOf(o);
  45. }
  46. function _setPrototypeOf(o, p) {
  47. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  48. o.__proto__ = p;
  49. return o;
  50. };
  51. return _setPrototypeOf(o, p);
  52. }
  53. function _isNativeReflectConstruct() {
  54. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  55. if (Reflect.construct.sham) return false;
  56. if (typeof Proxy === "function") return true;
  57. try {
  58. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  59. return true;
  60. } catch (e) {
  61. return false;
  62. }
  63. }
  64. function _assertThisInitialized(self) {
  65. if (self === void 0) {
  66. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  67. }
  68. return self;
  69. }
  70. function _possibleConstructorReturn(self, call) {
  71. if (call && (typeof call === "object" || typeof call === "function")) {
  72. return call;
  73. }
  74. return _assertThisInitialized(self);
  75. }
  76. function _createSuper(Derived) {
  77. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  78. return function _createSuperInternal() {
  79. var Super = _getPrototypeOf(Derived),
  80. result;
  81. if (hasNativeReflectConstruct) {
  82. var NewTarget = _getPrototypeOf(this).constructor;
  83. result = Reflect.construct(Super, arguments, NewTarget);
  84. } else {
  85. result = Super.apply(this, arguments);
  86. }
  87. return _possibleConstructorReturn(this, result);
  88. };
  89. }
  90. function _superPropBase(object, property) {
  91. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  92. object = _getPrototypeOf(object);
  93. if (object === null) break;
  94. }
  95. return object;
  96. }
  97. function _get(target, property, receiver) {
  98. if (typeof Reflect !== "undefined" && Reflect.get) {
  99. _get = Reflect.get;
  100. } else {
  101. _get = function _get(target, property, receiver) {
  102. var base = _superPropBase(target, property);
  103. if (!base) return;
  104. var desc = Object.getOwnPropertyDescriptor(base, property);
  105. if (desc.get) {
  106. return desc.get.call(receiver);
  107. }
  108. return desc.value;
  109. };
  110. }
  111. return _get(target, property, receiver || target);
  112. }
  113. function _slicedToArray(arr, i) {
  114. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  115. }
  116. function _arrayWithHoles(arr) {
  117. if (Array.isArray(arr)) return arr;
  118. }
  119. function _iterableToArrayLimit(arr, i) {
  120. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  121. var _arr = [];
  122. var _n = true;
  123. var _d = false;
  124. var _e = undefined;
  125. try {
  126. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  127. _arr.push(_s.value);
  128. if (i && _arr.length === i) break;
  129. }
  130. } catch (err) {
  131. _d = true;
  132. _e = err;
  133. } finally {
  134. try {
  135. if (!_n && _i["return"] != null) _i["return"]();
  136. } finally {
  137. if (_d) throw _e;
  138. }
  139. }
  140. return _arr;
  141. }
  142. function _unsupportedIterableToArray(o, minLen) {
  143. if (!o) return;
  144. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  145. var n = Object.prototype.toString.call(o).slice(8, -1);
  146. if (n === "Object" && o.constructor) n = o.constructor.name;
  147. if (n === "Map" || n === "Set") return Array.from(o);
  148. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  149. }
  150. function _arrayLikeToArray(arr, len) {
  151. if (len == null || len > arr.length) len = arr.length;
  152. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  153. return arr2;
  154. }
  155. function _nonIterableRest() {
  156. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  157. }
  158. function _createForOfIteratorHelper(o, allowArrayLike) {
  159. var it;
  160. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  161. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  162. if (it) o = it;
  163. var i = 0;
  164. var F = function () {};
  165. return {
  166. s: F,
  167. n: function () {
  168. if (i >= o.length) return {
  169. done: true
  170. };
  171. return {
  172. done: false,
  173. value: o[i++]
  174. };
  175. },
  176. e: function (e) {
  177. throw e;
  178. },
  179. f: F
  180. };
  181. }
  182. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  183. }
  184. var normalCompletion = true,
  185. didErr = false,
  186. err;
  187. return {
  188. s: function () {
  189. it = o[Symbol.iterator]();
  190. },
  191. n: function () {
  192. var step = it.next();
  193. normalCompletion = step.done;
  194. return step;
  195. },
  196. e: function (e) {
  197. didErr = true;
  198. err = e;
  199. },
  200. f: function () {
  201. try {
  202. if (!normalCompletion && it.return != null) it.return();
  203. } finally {
  204. if (didErr) throw err;
  205. }
  206. }
  207. };
  208. }
  209. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  210. function createCommonjsModule(fn, module) {
  211. return module = { exports: {} }, fn(module, module.exports), module.exports;
  212. }
  213. var check = function (it) {
  214. return it && it.Math == Math && it;
  215. };
  216. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  217. var global_1 =
  218. // eslint-disable-next-line es/no-global-this -- safe
  219. check(typeof globalThis == 'object' && globalThis) ||
  220. check(typeof window == 'object' && window) ||
  221. // eslint-disable-next-line no-restricted-globals -- safe
  222. check(typeof self == 'object' && self) ||
  223. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  224. // eslint-disable-next-line no-new-func -- fallback
  225. (function () { return this; })() || Function('return this')();
  226. var fails = function (exec) {
  227. try {
  228. return !!exec();
  229. } catch (error) {
  230. return true;
  231. }
  232. };
  233. // Detect IE8's incomplete defineProperty implementation
  234. var descriptors = !fails(function () {
  235. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  236. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  237. });
  238. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  239. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  240. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  241. // Nashorn ~ JDK8 bug
  242. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  243. // `Object.prototype.propertyIsEnumerable` method implementation
  244. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  245. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  246. var descriptor = getOwnPropertyDescriptor$1(this, V);
  247. return !!descriptor && descriptor.enumerable;
  248. } : $propertyIsEnumerable;
  249. var objectPropertyIsEnumerable = {
  250. f: f$4
  251. };
  252. var createPropertyDescriptor = function (bitmap, value) {
  253. return {
  254. enumerable: !(bitmap & 1),
  255. configurable: !(bitmap & 2),
  256. writable: !(bitmap & 4),
  257. value: value
  258. };
  259. };
  260. var toString = {}.toString;
  261. var classofRaw = function (it) {
  262. return toString.call(it).slice(8, -1);
  263. };
  264. var split = ''.split;
  265. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  266. var indexedObject = fails(function () {
  267. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  268. // eslint-disable-next-line no-prototype-builtins -- safe
  269. return !Object('z').propertyIsEnumerable(0);
  270. }) ? function (it) {
  271. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  272. } : Object;
  273. // `RequireObjectCoercible` abstract operation
  274. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  275. var requireObjectCoercible = function (it) {
  276. if (it == undefined) throw TypeError("Can't call method on " + it);
  277. return it;
  278. };
  279. // toObject with fallback for non-array-like ES3 strings
  280. var toIndexedObject = function (it) {
  281. return indexedObject(requireObjectCoercible(it));
  282. };
  283. var isObject = function (it) {
  284. return typeof it === 'object' ? it !== null : typeof it === 'function';
  285. };
  286. // `ToPrimitive` abstract operation
  287. // https://tc39.es/ecma262/#sec-toprimitive
  288. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  289. // and the second argument - flag - preferred type is a string
  290. var toPrimitive = function (input, PREFERRED_STRING) {
  291. if (!isObject(input)) return input;
  292. var fn, val;
  293. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  294. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  295. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  296. throw TypeError("Can't convert object to primitive value");
  297. };
  298. var hasOwnProperty = {}.hasOwnProperty;
  299. var has$1 = function (it, key) {
  300. return hasOwnProperty.call(it, key);
  301. };
  302. var document$1 = global_1.document;
  303. // typeof document.createElement is 'object' in old IE
  304. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  305. var documentCreateElement = function (it) {
  306. return EXISTS ? document$1.createElement(it) : {};
  307. };
  308. // Thank's IE8 for his funny defineProperty
  309. var ie8DomDefine = !descriptors && !fails(function () {
  310. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  311. return Object.defineProperty(documentCreateElement('div'), 'a', {
  312. get: function () { return 7; }
  313. }).a != 7;
  314. });
  315. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  316. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  317. // `Object.getOwnPropertyDescriptor` method
  318. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  319. var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  320. O = toIndexedObject(O);
  321. P = toPrimitive(P, true);
  322. if (ie8DomDefine) try {
  323. return $getOwnPropertyDescriptor(O, P);
  324. } catch (error) { /* empty */ }
  325. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  326. };
  327. var objectGetOwnPropertyDescriptor = {
  328. f: f$3
  329. };
  330. var anObject = function (it) {
  331. if (!isObject(it)) {
  332. throw TypeError(String(it) + ' is not an object');
  333. } return it;
  334. };
  335. // eslint-disable-next-line es/no-object-defineproperty -- safe
  336. var $defineProperty = Object.defineProperty;
  337. // `Object.defineProperty` method
  338. // https://tc39.es/ecma262/#sec-object.defineproperty
  339. var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
  340. anObject(O);
  341. P = toPrimitive(P, true);
  342. anObject(Attributes);
  343. if (ie8DomDefine) try {
  344. return $defineProperty(O, P, Attributes);
  345. } catch (error) { /* empty */ }
  346. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  347. if ('value' in Attributes) O[P] = Attributes.value;
  348. return O;
  349. };
  350. var objectDefineProperty = {
  351. f: f$2
  352. };
  353. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  354. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  355. } : function (object, key, value) {
  356. object[key] = value;
  357. return object;
  358. };
  359. var setGlobal = function (key, value) {
  360. try {
  361. createNonEnumerableProperty(global_1, key, value);
  362. } catch (error) {
  363. global_1[key] = value;
  364. } return value;
  365. };
  366. var SHARED = '__core-js_shared__';
  367. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  368. var sharedStore = store$1;
  369. var functionToString = Function.toString;
  370. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  371. if (typeof sharedStore.inspectSource != 'function') {
  372. sharedStore.inspectSource = function (it) {
  373. return functionToString.call(it);
  374. };
  375. }
  376. var inspectSource = sharedStore.inspectSource;
  377. var WeakMap$1 = global_1.WeakMap;
  378. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  379. var shared = createCommonjsModule(function (module) {
  380. (module.exports = function (key, value) {
  381. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  382. })('versions', []).push({
  383. version: '3.10.1',
  384. mode: 'global',
  385. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  386. });
  387. });
  388. var id = 0;
  389. var postfix = Math.random();
  390. var uid = function (key) {
  391. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  392. };
  393. var keys = shared('keys');
  394. var sharedKey = function (key) {
  395. return keys[key] || (keys[key] = uid(key));
  396. };
  397. var hiddenKeys$1 = {};
  398. var WeakMap = global_1.WeakMap;
  399. var set, get, has;
  400. var enforce = function (it) {
  401. return has(it) ? get(it) : set(it, {});
  402. };
  403. var getterFor = function (TYPE) {
  404. return function (it) {
  405. var state;
  406. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  407. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  408. } return state;
  409. };
  410. };
  411. if (nativeWeakMap) {
  412. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  413. var wmget = store.get;
  414. var wmhas = store.has;
  415. var wmset = store.set;
  416. set = function (it, metadata) {
  417. metadata.facade = it;
  418. wmset.call(store, it, metadata);
  419. return metadata;
  420. };
  421. get = function (it) {
  422. return wmget.call(store, it) || {};
  423. };
  424. has = function (it) {
  425. return wmhas.call(store, it);
  426. };
  427. } else {
  428. var STATE = sharedKey('state');
  429. hiddenKeys$1[STATE] = true;
  430. set = function (it, metadata) {
  431. metadata.facade = it;
  432. createNonEnumerableProperty(it, STATE, metadata);
  433. return metadata;
  434. };
  435. get = function (it) {
  436. return has$1(it, STATE) ? it[STATE] : {};
  437. };
  438. has = function (it) {
  439. return has$1(it, STATE);
  440. };
  441. }
  442. var internalState = {
  443. set: set,
  444. get: get,
  445. has: has,
  446. enforce: enforce,
  447. getterFor: getterFor
  448. };
  449. var redefine = createCommonjsModule(function (module) {
  450. var getInternalState = internalState.get;
  451. var enforceInternalState = internalState.enforce;
  452. var TEMPLATE = String(String).split('String');
  453. (module.exports = function (O, key, value, options) {
  454. var unsafe = options ? !!options.unsafe : false;
  455. var simple = options ? !!options.enumerable : false;
  456. var noTargetGet = options ? !!options.noTargetGet : false;
  457. var state;
  458. if (typeof value == 'function') {
  459. if (typeof key == 'string' && !has$1(value, 'name')) {
  460. createNonEnumerableProperty(value, 'name', key);
  461. }
  462. state = enforceInternalState(value);
  463. if (!state.source) {
  464. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  465. }
  466. }
  467. if (O === global_1) {
  468. if (simple) O[key] = value;
  469. else setGlobal(key, value);
  470. return;
  471. } else if (!unsafe) {
  472. delete O[key];
  473. } else if (!noTargetGet && O[key]) {
  474. simple = true;
  475. }
  476. if (simple) O[key] = value;
  477. else createNonEnumerableProperty(O, key, value);
  478. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  479. })(Function.prototype, 'toString', function toString() {
  480. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  481. });
  482. });
  483. var path = global_1;
  484. var aFunction$1 = function (variable) {
  485. return typeof variable == 'function' ? variable : undefined;
  486. };
  487. var getBuiltIn = function (namespace, method) {
  488. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  489. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  490. };
  491. var ceil = Math.ceil;
  492. var floor$1 = Math.floor;
  493. // `ToInteger` abstract operation
  494. // https://tc39.es/ecma262/#sec-tointeger
  495. var toInteger = function (argument) {
  496. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$1 : ceil)(argument);
  497. };
  498. var min$2 = Math.min;
  499. // `ToLength` abstract operation
  500. // https://tc39.es/ecma262/#sec-tolength
  501. var toLength = function (argument) {
  502. return argument > 0 ? min$2(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  503. };
  504. var max$1 = Math.max;
  505. var min$1 = Math.min;
  506. // Helper for a popular repeating case of the spec:
  507. // Let integer be ? ToInteger(index).
  508. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  509. var toAbsoluteIndex = function (index, length) {
  510. var integer = toInteger(index);
  511. return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
  512. };
  513. // `Array.prototype.{ indexOf, includes }` methods implementation
  514. var createMethod$3 = function (IS_INCLUDES) {
  515. return function ($this, el, fromIndex) {
  516. var O = toIndexedObject($this);
  517. var length = toLength(O.length);
  518. var index = toAbsoluteIndex(fromIndex, length);
  519. var value;
  520. // Array#includes uses SameValueZero equality algorithm
  521. // eslint-disable-next-line no-self-compare -- NaN check
  522. if (IS_INCLUDES && el != el) while (length > index) {
  523. value = O[index++];
  524. // eslint-disable-next-line no-self-compare -- NaN check
  525. if (value != value) return true;
  526. // Array#indexOf ignores holes, Array#includes - not
  527. } else for (;length > index; index++) {
  528. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  529. } return !IS_INCLUDES && -1;
  530. };
  531. };
  532. var arrayIncludes = {
  533. // `Array.prototype.includes` method
  534. // https://tc39.es/ecma262/#sec-array.prototype.includes
  535. includes: createMethod$3(true),
  536. // `Array.prototype.indexOf` method
  537. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  538. indexOf: createMethod$3(false)
  539. };
  540. var indexOf = arrayIncludes.indexOf;
  541. var objectKeysInternal = function (object, names) {
  542. var O = toIndexedObject(object);
  543. var i = 0;
  544. var result = [];
  545. var key;
  546. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  547. // Don't enum bug & hidden keys
  548. while (names.length > i) if (has$1(O, key = names[i++])) {
  549. ~indexOf(result, key) || result.push(key);
  550. }
  551. return result;
  552. };
  553. // IE8- don't enum bug keys
  554. var enumBugKeys = [
  555. 'constructor',
  556. 'hasOwnProperty',
  557. 'isPrototypeOf',
  558. 'propertyIsEnumerable',
  559. 'toLocaleString',
  560. 'toString',
  561. 'valueOf'
  562. ];
  563. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  564. // `Object.getOwnPropertyNames` method
  565. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  566. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  567. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  568. return objectKeysInternal(O, hiddenKeys);
  569. };
  570. var objectGetOwnPropertyNames = {
  571. f: f$1
  572. };
  573. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  574. var f = Object.getOwnPropertySymbols;
  575. var objectGetOwnPropertySymbols = {
  576. f: f
  577. };
  578. // all object keys, includes non-enumerable and symbols
  579. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  580. var keys = objectGetOwnPropertyNames.f(anObject(it));
  581. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  582. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  583. };
  584. var copyConstructorProperties = function (target, source) {
  585. var keys = ownKeys(source);
  586. var defineProperty = objectDefineProperty.f;
  587. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  588. for (var i = 0; i < keys.length; i++) {
  589. var key = keys[i];
  590. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  591. }
  592. };
  593. var replacement = /#|\.prototype\./;
  594. var isForced = function (feature, detection) {
  595. var value = data[normalize(feature)];
  596. return value == POLYFILL ? true
  597. : value == NATIVE ? false
  598. : typeof detection == 'function' ? fails(detection)
  599. : !!detection;
  600. };
  601. var normalize = isForced.normalize = function (string) {
  602. return String(string).replace(replacement, '.').toLowerCase();
  603. };
  604. var data = isForced.data = {};
  605. var NATIVE = isForced.NATIVE = 'N';
  606. var POLYFILL = isForced.POLYFILL = 'P';
  607. var isForced_1 = isForced;
  608. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  609. /*
  610. options.target - name of the target object
  611. options.global - target is the global object
  612. options.stat - export as static methods of target
  613. options.proto - export as prototype methods of target
  614. options.real - real prototype method for the `pure` version
  615. options.forced - export even if the native feature is available
  616. options.bind - bind methods to the target, required for the `pure` version
  617. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  618. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  619. options.sham - add a flag to not completely full polyfills
  620. options.enumerable - export as enumerable property
  621. options.noTargetGet - prevent calling a getter on target
  622. */
  623. var _export = function (options, source) {
  624. var TARGET = options.target;
  625. var GLOBAL = options.global;
  626. var STATIC = options.stat;
  627. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  628. if (GLOBAL) {
  629. target = global_1;
  630. } else if (STATIC) {
  631. target = global_1[TARGET] || setGlobal(TARGET, {});
  632. } else {
  633. target = (global_1[TARGET] || {}).prototype;
  634. }
  635. if (target) for (key in source) {
  636. sourceProperty = source[key];
  637. if (options.noTargetGet) {
  638. descriptor = getOwnPropertyDescriptor(target, key);
  639. targetProperty = descriptor && descriptor.value;
  640. } else targetProperty = target[key];
  641. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  642. // contained in target
  643. if (!FORCED && targetProperty !== undefined) {
  644. if (typeof sourceProperty === typeof targetProperty) continue;
  645. copyConstructorProperties(sourceProperty, targetProperty);
  646. }
  647. // add a flag to not completely full polyfills
  648. if (options.sham || (targetProperty && targetProperty.sham)) {
  649. createNonEnumerableProperty(sourceProperty, 'sham', true);
  650. }
  651. // extend global
  652. redefine(target, key, sourceProperty, options);
  653. }
  654. };
  655. // `RegExp.prototype.flags` getter implementation
  656. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  657. var regexpFlags = function () {
  658. var that = anObject(this);
  659. var result = '';
  660. if (that.global) result += 'g';
  661. if (that.ignoreCase) result += 'i';
  662. if (that.multiline) result += 'm';
  663. if (that.dotAll) result += 's';
  664. if (that.unicode) result += 'u';
  665. if (that.sticky) result += 'y';
  666. return result;
  667. };
  668. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  669. // so we use an intermediate function.
  670. function RE(s, f) {
  671. return RegExp(s, f);
  672. }
  673. var UNSUPPORTED_Y$1 = fails(function () {
  674. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  675. var re = RE('a', 'y');
  676. re.lastIndex = 2;
  677. return re.exec('abcd') != null;
  678. });
  679. var BROKEN_CARET = fails(function () {
  680. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  681. var re = RE('^r', 'gy');
  682. re.lastIndex = 2;
  683. return re.exec('str') != null;
  684. });
  685. var regexpStickyHelpers = {
  686. UNSUPPORTED_Y: UNSUPPORTED_Y$1,
  687. BROKEN_CARET: BROKEN_CARET
  688. };
  689. var nativeExec = RegExp.prototype.exec;
  690. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  691. var patchedExec = nativeExec;
  692. var UPDATES_LAST_INDEX_WRONG = (function () {
  693. var re1 = /a/;
  694. var re2 = /b*/g;
  695. nativeExec.call(re1, 'a');
  696. nativeExec.call(re2, 'a');
  697. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  698. })();
  699. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  700. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  701. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  702. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  703. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  704. if (PATCH) {
  705. patchedExec = function exec(str) {
  706. var re = this;
  707. var lastIndex, reCopy, match, i;
  708. var sticky = UNSUPPORTED_Y && re.sticky;
  709. var flags = regexpFlags.call(re);
  710. var source = re.source;
  711. var charsAdded = 0;
  712. var strCopy = str;
  713. if (sticky) {
  714. flags = flags.replace('y', '');
  715. if (flags.indexOf('g') === -1) {
  716. flags += 'g';
  717. }
  718. strCopy = String(str).slice(re.lastIndex);
  719. // Support anchored sticky behavior.
  720. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  721. source = '(?: ' + source + ')';
  722. strCopy = ' ' + strCopy;
  723. charsAdded++;
  724. }
  725. // ^(? + rx + ) is needed, in combination with some str slicing, to
  726. // simulate the 'y' flag.
  727. reCopy = new RegExp('^(?:' + source + ')', flags);
  728. }
  729. if (NPCG_INCLUDED) {
  730. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  731. }
  732. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  733. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  734. if (sticky) {
  735. if (match) {
  736. match.input = match.input.slice(charsAdded);
  737. match[0] = match[0].slice(charsAdded);
  738. match.index = re.lastIndex;
  739. re.lastIndex += match[0].length;
  740. } else re.lastIndex = 0;
  741. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  742. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  743. }
  744. if (NPCG_INCLUDED && match && match.length > 1) {
  745. // Fix browsers whose `exec` methods don't consistently return `undefined`
  746. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  747. nativeReplace.call(match[0], reCopy, function () {
  748. for (i = 1; i < arguments.length - 2; i++) {
  749. if (arguments[i] === undefined) match[i] = undefined;
  750. }
  751. });
  752. }
  753. return match;
  754. };
  755. }
  756. var regexpExec = patchedExec;
  757. // `RegExp.prototype.exec` method
  758. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  759. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  760. exec: regexpExec
  761. });
  762. var engineIsNode = classofRaw(global_1.process) == 'process';
  763. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  764. var process = global_1.process;
  765. var versions = process && process.versions;
  766. var v8 = versions && versions.v8;
  767. var match, version;
  768. if (v8) {
  769. match = v8.split('.');
  770. version = match[0] + match[1];
  771. } else if (engineUserAgent) {
  772. match = engineUserAgent.match(/Edge\/(\d+)/);
  773. if (!match || match[1] >= 74) {
  774. match = engineUserAgent.match(/Chrome\/(\d+)/);
  775. if (match) version = match[1];
  776. }
  777. }
  778. var engineV8Version = version && +version;
  779. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  780. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  781. // eslint-disable-next-line es/no-symbol -- required for testing
  782. return !Symbol.sham &&
  783. // Chrome 38 Symbol has incorrect toString conversion
  784. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  785. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  786. });
  787. /* eslint-disable es/no-symbol -- required for testing */
  788. var useSymbolAsUid = nativeSymbol
  789. && !Symbol.sham
  790. && typeof Symbol.iterator == 'symbol';
  791. var WellKnownSymbolsStore = shared('wks');
  792. var Symbol$1 = global_1.Symbol;
  793. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  794. var wellKnownSymbol = function (name) {
  795. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  796. if (nativeSymbol && has$1(Symbol$1, name)) {
  797. WellKnownSymbolsStore[name] = Symbol$1[name];
  798. } else {
  799. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  800. }
  801. } return WellKnownSymbolsStore[name];
  802. };
  803. // TODO: Remove from `core-js@4` since it's moved to entry points
  804. var SPECIES$2 = wellKnownSymbol('species');
  805. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  806. // #replace needs built-in support for named groups.
  807. // #match works fine because it just return the exec results, even if it has
  808. // a "grops" property.
  809. var re = /./;
  810. re.exec = function () {
  811. var result = [];
  812. result.groups = { a: '7' };
  813. return result;
  814. };
  815. return ''.replace(re, '$<a>') !== '7';
  816. });
  817. // IE <= 11 replaces $0 with the whole match, as if it was $&
  818. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  819. var REPLACE_KEEPS_$0 = (function () {
  820. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  821. return 'a'.replace(/./, '$0') === '$0';
  822. })();
  823. var REPLACE = wellKnownSymbol('replace');
  824. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  825. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  826. if (/./[REPLACE]) {
  827. return /./[REPLACE]('a', '$0') === '';
  828. }
  829. return false;
  830. })();
  831. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  832. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  833. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  834. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  835. var re = /(?:)/;
  836. var originalExec = re.exec;
  837. re.exec = function () { return originalExec.apply(this, arguments); };
  838. var result = 'ab'.split(re);
  839. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  840. });
  841. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  842. var SYMBOL = wellKnownSymbol(KEY);
  843. var DELEGATES_TO_SYMBOL = !fails(function () {
  844. // String methods call symbol-named RegEp methods
  845. var O = {};
  846. O[SYMBOL] = function () { return 7; };
  847. return ''[KEY](O) != 7;
  848. });
  849. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  850. // Symbol-named RegExp methods call .exec
  851. var execCalled = false;
  852. var re = /a/;
  853. if (KEY === 'split') {
  854. // We can't use real regex here since it causes deoptimization
  855. // and serious performance degradation in V8
  856. // https://github.com/zloirock/core-js/issues/306
  857. re = {};
  858. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  859. // a new one. We need to return the patched regex when creating the new one.
  860. re.constructor = {};
  861. re.constructor[SPECIES$2] = function () { return re; };
  862. re.flags = '';
  863. re[SYMBOL] = /./[SYMBOL];
  864. }
  865. re.exec = function () { execCalled = true; return null; };
  866. re[SYMBOL]('');
  867. return !execCalled;
  868. });
  869. if (
  870. !DELEGATES_TO_SYMBOL ||
  871. !DELEGATES_TO_EXEC ||
  872. (KEY === 'replace' && !(
  873. REPLACE_SUPPORTS_NAMED_GROUPS &&
  874. REPLACE_KEEPS_$0 &&
  875. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  876. )) ||
  877. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  878. ) {
  879. var nativeRegExpMethod = /./[SYMBOL];
  880. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  881. if (regexp.exec === RegExp.prototype.exec) {
  882. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  883. // The native String method already delegates to @@method (this
  884. // polyfilled function), leasing to infinite recursion.
  885. // We avoid it by directly calling the native @@method method.
  886. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  887. }
  888. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  889. }
  890. return { done: false };
  891. }, {
  892. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  893. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  894. });
  895. var stringMethod = methods[0];
  896. var regexMethod = methods[1];
  897. redefine(String.prototype, KEY, stringMethod);
  898. redefine(RegExp.prototype, SYMBOL, length == 2
  899. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  900. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  901. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  902. // 21.2.5.6 RegExp.prototype[@@match](string)
  903. // 21.2.5.9 RegExp.prototype[@@search](string)
  904. : function (string) { return regexMethod.call(string, this); }
  905. );
  906. }
  907. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  908. };
  909. // `String.prototype.{ codePointAt, at }` methods implementation
  910. var createMethod$2 = function (CONVERT_TO_STRING) {
  911. return function ($this, pos) {
  912. var S = String(requireObjectCoercible($this));
  913. var position = toInteger(pos);
  914. var size = S.length;
  915. var first, second;
  916. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  917. first = S.charCodeAt(position);
  918. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  919. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  920. ? CONVERT_TO_STRING ? S.charAt(position) : first
  921. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  922. };
  923. };
  924. var stringMultibyte = {
  925. // `String.prototype.codePointAt` method
  926. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  927. codeAt: createMethod$2(false),
  928. // `String.prototype.at` method
  929. // https://github.com/mathiasbynens/String.prototype.at
  930. charAt: createMethod$2(true)
  931. };
  932. var charAt = stringMultibyte.charAt;
  933. // `AdvanceStringIndex` abstract operation
  934. // https://tc39.es/ecma262/#sec-advancestringindex
  935. var advanceStringIndex = function (S, index, unicode) {
  936. return index + (unicode ? charAt(S, index).length : 1);
  937. };
  938. // `ToObject` abstract operation
  939. // https://tc39.es/ecma262/#sec-toobject
  940. var toObject = function (argument) {
  941. return Object(requireObjectCoercible(argument));
  942. };
  943. var floor = Math.floor;
  944. var replace = ''.replace;
  945. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  946. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  947. // https://tc39.es/ecma262/#sec-getsubstitution
  948. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  949. var tailPos = position + matched.length;
  950. var m = captures.length;
  951. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  952. if (namedCaptures !== undefined) {
  953. namedCaptures = toObject(namedCaptures);
  954. symbols = SUBSTITUTION_SYMBOLS;
  955. }
  956. return replace.call(replacement, symbols, function (match, ch) {
  957. var capture;
  958. switch (ch.charAt(0)) {
  959. case '$': return '$';
  960. case '&': return matched;
  961. case '`': return str.slice(0, position);
  962. case "'": return str.slice(tailPos);
  963. case '<':
  964. capture = namedCaptures[ch.slice(1, -1)];
  965. break;
  966. default: // \d\d?
  967. var n = +ch;
  968. if (n === 0) return match;
  969. if (n > m) {
  970. var f = floor(n / 10);
  971. if (f === 0) return match;
  972. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  973. return match;
  974. }
  975. capture = captures[n - 1];
  976. }
  977. return capture === undefined ? '' : capture;
  978. });
  979. };
  980. // `RegExpExec` abstract operation
  981. // https://tc39.es/ecma262/#sec-regexpexec
  982. var regexpExecAbstract = function (R, S) {
  983. var exec = R.exec;
  984. if (typeof exec === 'function') {
  985. var result = exec.call(R, S);
  986. if (typeof result !== 'object') {
  987. throw TypeError('RegExp exec method returned something other than an Object or null');
  988. }
  989. return result;
  990. }
  991. if (classofRaw(R) !== 'RegExp') {
  992. throw TypeError('RegExp#exec called on incompatible receiver');
  993. }
  994. return regexpExec.call(R, S);
  995. };
  996. var max = Math.max;
  997. var min = Math.min;
  998. var maybeToString = function (it) {
  999. return it === undefined ? it : String(it);
  1000. };
  1001. // @@replace logic
  1002. fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  1003. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  1004. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  1005. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1006. return [
  1007. // `String.prototype.replace` method
  1008. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1009. function replace(searchValue, replaceValue) {
  1010. var O = requireObjectCoercible(this);
  1011. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  1012. return replacer !== undefined
  1013. ? replacer.call(searchValue, O, replaceValue)
  1014. : nativeReplace.call(String(O), searchValue, replaceValue);
  1015. },
  1016. // `RegExp.prototype[@@replace]` method
  1017. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1018. function (regexp, replaceValue) {
  1019. if (
  1020. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  1021. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  1022. ) {
  1023. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  1024. if (res.done) return res.value;
  1025. }
  1026. var rx = anObject(regexp);
  1027. var S = String(this);
  1028. var functionalReplace = typeof replaceValue === 'function';
  1029. if (!functionalReplace) replaceValue = String(replaceValue);
  1030. var global = rx.global;
  1031. if (global) {
  1032. var fullUnicode = rx.unicode;
  1033. rx.lastIndex = 0;
  1034. }
  1035. var results = [];
  1036. while (true) {
  1037. var result = regexpExecAbstract(rx, S);
  1038. if (result === null) break;
  1039. results.push(result);
  1040. if (!global) break;
  1041. var matchStr = String(result[0]);
  1042. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1043. }
  1044. var accumulatedResult = '';
  1045. var nextSourcePosition = 0;
  1046. for (var i = 0; i < results.length; i++) {
  1047. result = results[i];
  1048. var matched = String(result[0]);
  1049. var position = max(min(toInteger(result.index), S.length), 0);
  1050. var captures = [];
  1051. // NOTE: This is equivalent to
  1052. // captures = result.slice(1).map(maybeToString)
  1053. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1054. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1055. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1056. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1057. var namedCaptures = result.groups;
  1058. if (functionalReplace) {
  1059. var replacerArgs = [matched].concat(captures, position, S);
  1060. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1061. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1062. } else {
  1063. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1064. }
  1065. if (position >= nextSourcePosition) {
  1066. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1067. nextSourcePosition = position + matched.length;
  1068. }
  1069. }
  1070. return accumulatedResult + S.slice(nextSourcePosition);
  1071. }
  1072. ];
  1073. });
  1074. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1075. var method = [][METHOD_NAME];
  1076. return !!method && fails(function () {
  1077. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  1078. method.call(null, argument || function () { throw 1; }, 1);
  1079. });
  1080. };
  1081. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  1082. var $indexOf = arrayIncludes.indexOf;
  1083. var nativeIndexOf = [].indexOf;
  1084. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  1085. var STRICT_METHOD$1 = arrayMethodIsStrict('indexOf');
  1086. // `Array.prototype.indexOf` method
  1087. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1088. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$1 }, {
  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. // `IsArray` abstract operation
  1097. // https://tc39.es/ecma262/#sec-isarray
  1098. // eslint-disable-next-line es/no-array-isarray -- safe
  1099. var isArray = Array.isArray || function isArray(arg) {
  1100. return classofRaw(arg) == 'Array';
  1101. };
  1102. var createProperty = function (object, key, value) {
  1103. var propertyKey = toPrimitive(key);
  1104. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1105. else object[propertyKey] = value;
  1106. };
  1107. var SPECIES$1 = wellKnownSymbol('species');
  1108. // `ArraySpeciesCreate` abstract operation
  1109. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1110. var arraySpeciesCreate = function (originalArray, length) {
  1111. var C;
  1112. if (isArray(originalArray)) {
  1113. C = originalArray.constructor;
  1114. // cross-realm fallback
  1115. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  1116. else if (isObject(C)) {
  1117. C = C[SPECIES$1];
  1118. if (C === null) C = undefined;
  1119. }
  1120. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  1121. };
  1122. var SPECIES = wellKnownSymbol('species');
  1123. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1124. // We can't use this feature detection in V8 since it causes
  1125. // deoptimization and serious performance degradation
  1126. // https://github.com/zloirock/core-js/issues/677
  1127. return engineV8Version >= 51 || !fails(function () {
  1128. var array = [];
  1129. var constructor = array.constructor = {};
  1130. constructor[SPECIES] = function () {
  1131. return { foo: 1 };
  1132. };
  1133. return array[METHOD_NAME](Boolean).foo !== 1;
  1134. });
  1135. };
  1136. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1137. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1138. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1139. // We can't use this feature detection in V8 since it causes
  1140. // deoptimization and serious performance degradation
  1141. // https://github.com/zloirock/core-js/issues/679
  1142. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1143. var array = [];
  1144. array[IS_CONCAT_SPREADABLE] = false;
  1145. return array.concat()[0] !== array;
  1146. });
  1147. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1148. var isConcatSpreadable = function (O) {
  1149. if (!isObject(O)) return false;
  1150. var spreadable = O[IS_CONCAT_SPREADABLE];
  1151. return spreadable !== undefined ? !!spreadable : isArray(O);
  1152. };
  1153. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1154. // `Array.prototype.concat` method
  1155. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1156. // with adding support of @@isConcatSpreadable and @@species
  1157. _export({ target: 'Array', proto: true, forced: FORCED }, {
  1158. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1159. concat: function concat(arg) {
  1160. var O = toObject(this);
  1161. var A = arraySpeciesCreate(O, 0);
  1162. var n = 0;
  1163. var i, k, length, len, E;
  1164. for (i = -1, length = arguments.length; i < length; i++) {
  1165. E = i === -1 ? O : arguments[i];
  1166. if (isConcatSpreadable(E)) {
  1167. len = toLength(E.length);
  1168. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1169. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1170. } else {
  1171. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1172. createProperty(A, n++, E);
  1173. }
  1174. }
  1175. A.length = n;
  1176. return A;
  1177. }
  1178. });
  1179. var nativeJoin = [].join;
  1180. var ES3_STRINGS = indexedObject != Object;
  1181. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  1182. // `Array.prototype.join` method
  1183. // https://tc39.es/ecma262/#sec-array.prototype.join
  1184. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  1185. join: function join(separator) {
  1186. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1187. }
  1188. });
  1189. var aFunction = function (it) {
  1190. if (typeof it != 'function') {
  1191. throw TypeError(String(it) + ' is not a function');
  1192. } return it;
  1193. };
  1194. // optional / simple context binding
  1195. var functionBindContext = function (fn, that, length) {
  1196. aFunction(fn);
  1197. if (that === undefined) return fn;
  1198. switch (length) {
  1199. case 0: return function () {
  1200. return fn.call(that);
  1201. };
  1202. case 1: return function (a) {
  1203. return fn.call(that, a);
  1204. };
  1205. case 2: return function (a, b) {
  1206. return fn.call(that, a, b);
  1207. };
  1208. case 3: return function (a, b, c) {
  1209. return fn.call(that, a, b, c);
  1210. };
  1211. }
  1212. return function (/* ...args */) {
  1213. return fn.apply(that, arguments);
  1214. };
  1215. };
  1216. var push = [].push;
  1217. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  1218. var createMethod$1 = function (TYPE) {
  1219. var IS_MAP = TYPE == 1;
  1220. var IS_FILTER = TYPE == 2;
  1221. var IS_SOME = TYPE == 3;
  1222. var IS_EVERY = TYPE == 4;
  1223. var IS_FIND_INDEX = TYPE == 6;
  1224. var IS_FILTER_OUT = TYPE == 7;
  1225. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1226. return function ($this, callbackfn, that, specificCreate) {
  1227. var O = toObject($this);
  1228. var self = indexedObject(O);
  1229. var boundFunction = functionBindContext(callbackfn, that, 3);
  1230. var length = toLength(self.length);
  1231. var index = 0;
  1232. var create = specificCreate || arraySpeciesCreate;
  1233. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  1234. var value, result;
  1235. for (;length > index; index++) if (NO_HOLES || index in self) {
  1236. value = self[index];
  1237. result = boundFunction(value, index, O);
  1238. if (TYPE) {
  1239. if (IS_MAP) target[index] = result; // map
  1240. else if (result) switch (TYPE) {
  1241. case 3: return true; // some
  1242. case 5: return value; // find
  1243. case 6: return index; // findIndex
  1244. case 2: push.call(target, value); // filter
  1245. } else switch (TYPE) {
  1246. case 4: return false; // every
  1247. case 7: push.call(target, value); // filterOut
  1248. }
  1249. }
  1250. }
  1251. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1252. };
  1253. };
  1254. var arrayIteration = {
  1255. // `Array.prototype.forEach` method
  1256. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1257. forEach: createMethod$1(0),
  1258. // `Array.prototype.map` method
  1259. // https://tc39.es/ecma262/#sec-array.prototype.map
  1260. map: createMethod$1(1),
  1261. // `Array.prototype.filter` method
  1262. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1263. filter: createMethod$1(2),
  1264. // `Array.prototype.some` method
  1265. // https://tc39.es/ecma262/#sec-array.prototype.some
  1266. some: createMethod$1(3),
  1267. // `Array.prototype.every` method
  1268. // https://tc39.es/ecma262/#sec-array.prototype.every
  1269. every: createMethod$1(4),
  1270. // `Array.prototype.find` method
  1271. // https://tc39.es/ecma262/#sec-array.prototype.find
  1272. find: createMethod$1(5),
  1273. // `Array.prototype.findIndex` method
  1274. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1275. findIndex: createMethod$1(6),
  1276. // `Array.prototype.filterOut` method
  1277. // https://github.com/tc39/proposal-array-filtering
  1278. filterOut: createMethod$1(7)
  1279. };
  1280. // `Object.keys` method
  1281. // https://tc39.es/ecma262/#sec-object.keys
  1282. // eslint-disable-next-line es/no-object-keys -- safe
  1283. var objectKeys = Object.keys || function keys(O) {
  1284. return objectKeysInternal(O, enumBugKeys);
  1285. };
  1286. // `Object.defineProperties` method
  1287. // https://tc39.es/ecma262/#sec-object.defineproperties
  1288. // eslint-disable-next-line es/no-object-defineproperties -- safe
  1289. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  1290. anObject(O);
  1291. var keys = objectKeys(Properties);
  1292. var length = keys.length;
  1293. var index = 0;
  1294. var key;
  1295. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  1296. return O;
  1297. };
  1298. var html = getBuiltIn('document', 'documentElement');
  1299. var GT = '>';
  1300. var LT = '<';
  1301. var PROTOTYPE = 'prototype';
  1302. var SCRIPT = 'script';
  1303. var IE_PROTO = sharedKey('IE_PROTO');
  1304. var EmptyConstructor = function () { /* empty */ };
  1305. var scriptTag = function (content) {
  1306. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1307. };
  1308. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1309. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1310. activeXDocument.write(scriptTag(''));
  1311. activeXDocument.close();
  1312. var temp = activeXDocument.parentWindow.Object;
  1313. activeXDocument = null; // avoid memory leak
  1314. return temp;
  1315. };
  1316. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1317. var NullProtoObjectViaIFrame = function () {
  1318. // Thrash, waste and sodomy: IE GC bug
  1319. var iframe = documentCreateElement('iframe');
  1320. var JS = 'java' + SCRIPT + ':';
  1321. var iframeDocument;
  1322. iframe.style.display = 'none';
  1323. html.appendChild(iframe);
  1324. // https://github.com/zloirock/core-js/issues/475
  1325. iframe.src = String(JS);
  1326. iframeDocument = iframe.contentWindow.document;
  1327. iframeDocument.open();
  1328. iframeDocument.write(scriptTag('document.F=Object'));
  1329. iframeDocument.close();
  1330. return iframeDocument.F;
  1331. };
  1332. // Check for document.domain and active x support
  1333. // No need to use active x approach when document.domain is not set
  1334. // see https://github.com/es-shims/es5-shim/issues/150
  1335. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1336. // avoid IE GC bug
  1337. var activeXDocument;
  1338. var NullProtoObject = function () {
  1339. try {
  1340. /* global ActiveXObject -- old IE */
  1341. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  1342. } catch (error) { /* ignore */ }
  1343. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  1344. var length = enumBugKeys.length;
  1345. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1346. return NullProtoObject();
  1347. };
  1348. hiddenKeys$1[IE_PROTO] = true;
  1349. // `Object.create` method
  1350. // https://tc39.es/ecma262/#sec-object.create
  1351. var objectCreate = Object.create || function create(O, Properties) {
  1352. var result;
  1353. if (O !== null) {
  1354. EmptyConstructor[PROTOTYPE] = anObject(O);
  1355. result = new EmptyConstructor();
  1356. EmptyConstructor[PROTOTYPE] = null;
  1357. // add "__proto__" for Object.getPrototypeOf polyfill
  1358. result[IE_PROTO] = O;
  1359. } else result = NullProtoObject();
  1360. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  1361. };
  1362. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1363. var ArrayPrototype = Array.prototype;
  1364. // Array.prototype[@@unscopables]
  1365. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1366. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1367. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1368. configurable: true,
  1369. value: objectCreate(null)
  1370. });
  1371. }
  1372. // add a key to Array.prototype[@@unscopables]
  1373. var addToUnscopables = function (key) {
  1374. ArrayPrototype[UNSCOPABLES][key] = true;
  1375. };
  1376. var $find = arrayIteration.find;
  1377. var FIND = 'find';
  1378. var SKIPS_HOLES = true;
  1379. // Shouldn't skip holes
  1380. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1381. // `Array.prototype.find` method
  1382. // https://tc39.es/ecma262/#sec-array.prototype.find
  1383. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1384. find: function find(callbackfn /* , that = undefined */) {
  1385. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1386. }
  1387. });
  1388. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1389. addToUnscopables(FIND);
  1390. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1391. // `Object.{ entries, values }` methods implementation
  1392. var createMethod = function (TO_ENTRIES) {
  1393. return function (it) {
  1394. var O = toIndexedObject(it);
  1395. var keys = objectKeys(O);
  1396. var length = keys.length;
  1397. var i = 0;
  1398. var result = [];
  1399. var key;
  1400. while (length > i) {
  1401. key = keys[i++];
  1402. if (!descriptors || propertyIsEnumerable.call(O, key)) {
  1403. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  1404. }
  1405. }
  1406. return result;
  1407. };
  1408. };
  1409. var objectToArray = {
  1410. // `Object.entries` method
  1411. // https://tc39.es/ecma262/#sec-object.entries
  1412. entries: createMethod(true),
  1413. // `Object.values` method
  1414. // https://tc39.es/ecma262/#sec-object.values
  1415. values: createMethod(false)
  1416. };
  1417. var $entries = objectToArray.entries;
  1418. // `Object.entries` method
  1419. // https://tc39.es/ecma262/#sec-object.entries
  1420. _export({ target: 'Object', stat: true }, {
  1421. entries: function entries(O) {
  1422. return $entries(O);
  1423. }
  1424. });
  1425. /* eslint-disable no-unused-vars */
  1426. /**
  1427. * @author zhixin wen <wenzhixin2010@gmail.com>
  1428. * extensions: https://github.com/vitalets/x-editable
  1429. */
  1430. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1431. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1432. editable: true,
  1433. onEditableInit: function onEditableInit() {
  1434. return false;
  1435. },
  1436. onEditableSave: function onEditableSave(field, row, rowIndex, oldValue, $el) {
  1437. return false;
  1438. },
  1439. onEditableShown: function onEditableShown(field, row, $el, editable) {
  1440. return false;
  1441. },
  1442. onEditableHidden: function onEditableHidden(field, row, $el, reason) {
  1443. return false;
  1444. }
  1445. });
  1446. $__default['default'].extend($__default['default'].fn.bootstrapTable.columnDefaults, {
  1447. alwaysUseFormatter: false
  1448. });
  1449. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  1450. 'editable-init.bs.table': 'onEditableInit',
  1451. 'editable-save.bs.table': 'onEditableSave',
  1452. 'editable-shown.bs.table': 'onEditableShown',
  1453. 'editable-hidden.bs.table': 'onEditableHidden'
  1454. });
  1455. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1456. _inherits(_class, _$$BootstrapTable);
  1457. var _super = _createSuper(_class);
  1458. function _class() {
  1459. _classCallCheck(this, _class);
  1460. return _super.apply(this, arguments);
  1461. }
  1462. _createClass(_class, [{
  1463. key: "initTable",
  1464. value: function initTable() {
  1465. var _this = this;
  1466. _get(_getPrototypeOf(_class.prototype), "initTable", this).call(this);
  1467. if (!this.options.editable) {
  1468. return;
  1469. }
  1470. this.editedCells = [];
  1471. $__default['default'].each(this.columns, function (i, column) {
  1472. if (!column.editable) {
  1473. return;
  1474. }
  1475. var editableOptions = {};
  1476. var editableDataMarkup = [];
  1477. var editableDataPrefix = 'editable-';
  1478. var processDataOptions = function processDataOptions(key, value) {
  1479. // Replace camel case with dashes.
  1480. var dashKey = key.replace(/([A-Z])/g, function ($1) {
  1481. return "-".concat($1.toLowerCase());
  1482. });
  1483. if (dashKey.indexOf(editableDataPrefix) === 0) {
  1484. editableOptions[dashKey.replace(editableDataPrefix, 'data-')] = value;
  1485. }
  1486. };
  1487. $__default['default'].each(_this.options, processDataOptions);
  1488. column.formatter = column.formatter || function (value) {
  1489. return value;
  1490. };
  1491. column._formatter = column._formatter ? column._formatter : column.formatter;
  1492. column.formatter = function (value, row, index) {
  1493. var result = Utils.calculateObjectValue(column, column._formatter, [value, row, index], value);
  1494. result = typeof result === 'undefined' || result === null ? _this.options.undefinedText : result;
  1495. if (_this.options.uniqueId !== undefined && !column.alwaysUseFormatter) {
  1496. var uniqueId = Utils.getItemField(row, _this.options.uniqueId, false);
  1497. if ($__default['default'].inArray(column.field + uniqueId, _this.editedCells) !== -1) {
  1498. result = value;
  1499. }
  1500. }
  1501. $__default['default'].each(column, processDataOptions);
  1502. $__default['default'].each(editableOptions, function (key, value) {
  1503. editableDataMarkup.push(" ".concat(key, "=\"").concat(value, "\""));
  1504. });
  1505. var noEditFormatter = false;
  1506. var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row], {});
  1507. if (editableOpts.hasOwnProperty('noEditFormatter')) {
  1508. noEditFormatter = editableOpts.noEditFormatter(value, row, index);
  1509. }
  1510. if (noEditFormatter === false) {
  1511. 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>");
  1512. }
  1513. return noEditFormatter;
  1514. };
  1515. });
  1516. }
  1517. }, {
  1518. key: "initBody",
  1519. value: function initBody(fixedScroll) {
  1520. var _this2 = this;
  1521. _get(_getPrototypeOf(_class.prototype), "initBody", this).call(this, fixedScroll);
  1522. if (!this.options.editable) {
  1523. return;
  1524. }
  1525. $__default['default'].each(this.columns, function (i, column) {
  1526. if (!column.editable) {
  1527. return;
  1528. }
  1529. var data = _this2.getData({
  1530. escape: true
  1531. });
  1532. var $field = _this2.$body.find("a[data-name=\"".concat(column.field, "\"]"));
  1533. $field.each(function (i, element) {
  1534. var $element = $__default['default'](element);
  1535. var $tr = $element.closest('tr');
  1536. var index = $tr.data('index');
  1537. var row = data[index];
  1538. var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row, $element], {});
  1539. $element.editable(editableOpts);
  1540. });
  1541. $field.off('save').on('save', function (_ref, _ref2) {
  1542. var currentTarget = _ref.currentTarget;
  1543. var submitValue = _ref2.submitValue;
  1544. var $this = $__default['default'](currentTarget);
  1545. var data = _this2.getData();
  1546. var rowIndex = $this.parents('tr[data-index]').data('index');
  1547. var row = data[rowIndex];
  1548. var oldValue = row[column.field];
  1549. if (_this2.options.uniqueId !== undefined && !column.alwaysUseFormatter) {
  1550. var uniqueId = Utils.getItemField(row, _this2.options.uniqueId, false);
  1551. if ($__default['default'].inArray(column.field + uniqueId, _this2.editedCells) === -1) {
  1552. _this2.editedCells.push(column.field + uniqueId);
  1553. }
  1554. }
  1555. submitValue = Utils.escapeHTML(submitValue);
  1556. $this.data('value', submitValue);
  1557. row[column.field] = submitValue;
  1558. _this2.trigger('editable-save', column.field, row, rowIndex, oldValue, $this);
  1559. _this2.initBody();
  1560. });
  1561. $field.off('shown').on('shown', function (_ref3, editable) {
  1562. var currentTarget = _ref3.currentTarget;
  1563. var $this = $__default['default'](currentTarget);
  1564. var data = _this2.getData();
  1565. var rowIndex = $this.parents('tr[data-index]').data('index');
  1566. var row = data[rowIndex];
  1567. _this2.trigger('editable-shown', column.field, row, $this, editable);
  1568. });
  1569. $field.off('hidden').on('hidden', function (_ref4, reason) {
  1570. var currentTarget = _ref4.currentTarget;
  1571. var $this = $__default['default'](currentTarget);
  1572. var data = _this2.getData();
  1573. var rowIndex = $this.parents('tr[data-index]').data('index');
  1574. var row = data[rowIndex];
  1575. _this2.trigger('editable-hidden', column.field, row, $this, reason);
  1576. });
  1577. });
  1578. this.trigger('editable-init');
  1579. }
  1580. }, {
  1581. key: "getData",
  1582. value: function getData(params) {
  1583. var data = _get(_getPrototypeOf(_class.prototype), "getData", this).call(this, params);
  1584. if (params && params.escape) {
  1585. var _iterator = _createForOfIteratorHelper(data),
  1586. _step;
  1587. try {
  1588. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1589. var row = _step.value;
  1590. for (var _i = 0, _Object$entries = Object.entries(row); _i < _Object$entries.length; _i++) {
  1591. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  1592. key = _Object$entries$_i[0],
  1593. value = _Object$entries$_i[1];
  1594. row[key] = Utils.unescapeHTML(value);
  1595. }
  1596. }
  1597. } catch (err) {
  1598. _iterator.e(err);
  1599. } finally {
  1600. _iterator.f();
  1601. }
  1602. }
  1603. return data;
  1604. }
  1605. }]);
  1606. return _class;
  1607. }($__default['default'].BootstrapTable);
  1608. })));