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 |
|
7 | $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
8 |
|
9 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
10 |
|
11 | function createCommonjsModule(fn, module) {
|
12 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
13 | }
|
14 |
|
15 | var check = function (it) {
|
16 | return it && it.Math == Math && it;
|
17 | };
|
18 |
|
19 |
|
20 | var global_1 =
|
21 |
|
22 | check(typeof globalThis == 'object' && globalThis) ||
|
23 | check(typeof window == 'object' && window) ||
|
24 | check(typeof self == 'object' && self) ||
|
25 | check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
26 |
|
27 | Function('return this')();
|
28 |
|
29 | var fails = function (exec) {
|
30 | try {
|
31 | return !!exec();
|
32 | } catch (error) {
|
33 | return true;
|
34 | }
|
35 | };
|
36 |
|
37 |
|
38 | var descriptors = !fails(function () {
|
39 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
40 | });
|
41 |
|
42 | var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
43 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
44 |
|
45 |
|
46 | var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
47 |
|
48 |
|
49 |
|
50 | var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
51 | var descriptor = getOwnPropertyDescriptor(this, V);
|
52 | return !!descriptor && descriptor.enumerable;
|
53 | } : nativePropertyIsEnumerable;
|
54 |
|
55 | var objectPropertyIsEnumerable = {
|
56 | f: f
|
57 | };
|
58 |
|
59 | var createPropertyDescriptor = function (bitmap, value) {
|
60 | return {
|
61 | enumerable: !(bitmap & 1),
|
62 | configurable: !(bitmap & 2),
|
63 | writable: !(bitmap & 4),
|
64 | value: value
|
65 | };
|
66 | };
|
67 |
|
68 | var toString = {}.toString;
|
69 |
|
70 | var classofRaw = function (it) {
|
71 | return toString.call(it).slice(8, -1);
|
72 | };
|
73 |
|
74 | var split = ''.split;
|
75 |
|
76 |
|
77 | var indexedObject = fails(function () {
|
78 |
|
79 |
|
80 | return !Object('z').propertyIsEnumerable(0);
|
81 | }) ? function (it) {
|
82 | return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
83 | } : Object;
|
84 |
|
85 |
|
86 |
|
87 | var requireObjectCoercible = function (it) {
|
88 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
89 | return it;
|
90 | };
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 | var toIndexedObject = function (it) {
|
97 | return indexedObject(requireObjectCoercible(it));
|
98 | };
|
99 |
|
100 | var isObject = function (it) {
|
101 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
102 | };
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 | var toPrimitive = function (input, PREFERRED_STRING) {
|
109 | if (!isObject(input)) return input;
|
110 | var fn, val;
|
111 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
112 | if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
113 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
114 | throw TypeError("Can't convert object to primitive value");
|
115 | };
|
116 |
|
117 | var hasOwnProperty = {}.hasOwnProperty;
|
118 |
|
119 | var has = function (it, key) {
|
120 | return hasOwnProperty.call(it, key);
|
121 | };
|
122 |
|
123 | var document$1 = global_1.document;
|
124 |
|
125 | var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
126 |
|
127 | var documentCreateElement = function (it) {
|
128 | return EXISTS ? document$1.createElement(it) : {};
|
129 | };
|
130 |
|
131 |
|
132 | var ie8DomDefine = !descriptors && !fails(function () {
|
133 | return Object.defineProperty(documentCreateElement('div'), 'a', {
|
134 | get: function () { return 7; }
|
135 | }).a != 7;
|
136 | });
|
137 |
|
138 | var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
139 |
|
140 |
|
141 |
|
142 | var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
143 | O = toIndexedObject(O);
|
144 | P = toPrimitive(P, true);
|
145 | if (ie8DomDefine) try {
|
146 | return nativeGetOwnPropertyDescriptor(O, P);
|
147 | } catch (error) { }
|
148 | if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
149 | };
|
150 |
|
151 | var objectGetOwnPropertyDescriptor = {
|
152 | f: f$1
|
153 | };
|
154 |
|
155 | var anObject = function (it) {
|
156 | if (!isObject(it)) {
|
157 | throw TypeError(String(it) + ' is not an object');
|
158 | } return it;
|
159 | };
|
160 |
|
161 | var nativeDefineProperty = Object.defineProperty;
|
162 |
|
163 |
|
164 |
|
165 | var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
166 | anObject(O);
|
167 | P = toPrimitive(P, true);
|
168 | anObject(Attributes);
|
169 | if (ie8DomDefine) try {
|
170 | return nativeDefineProperty(O, P, Attributes);
|
171 | } catch (error) { }
|
172 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
173 | if ('value' in Attributes) O[P] = Attributes.value;
|
174 | return O;
|
175 | };
|
176 |
|
177 | var objectDefineProperty = {
|
178 | f: f$2
|
179 | };
|
180 |
|
181 | var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
182 | return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
183 | } : function (object, key, value) {
|
184 | object[key] = value;
|
185 | return object;
|
186 | };
|
187 |
|
188 | var setGlobal = function (key, value) {
|
189 | try {
|
190 | createNonEnumerableProperty(global_1, key, value);
|
191 | } catch (error) {
|
192 | global_1[key] = value;
|
193 | } return value;
|
194 | };
|
195 |
|
196 | var SHARED = '__core-js_shared__';
|
197 | var store = global_1[SHARED] || setGlobal(SHARED, {});
|
198 |
|
199 | var sharedStore = store;
|
200 |
|
201 | var functionToString = Function.toString;
|
202 |
|
203 |
|
204 | if (typeof sharedStore.inspectSource != 'function') {
|
205 | sharedStore.inspectSource = function (it) {
|
206 | return functionToString.call(it);
|
207 | };
|
208 | }
|
209 |
|
210 | var inspectSource = sharedStore.inspectSource;
|
211 |
|
212 | var WeakMap = global_1.WeakMap;
|
213 |
|
214 | var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
215 |
|
216 | var shared = createCommonjsModule(function (module) {
|
217 | (module.exports = function (key, value) {
|
218 | return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
219 | })('versions', []).push({
|
220 | version: '3.6.0',
|
221 | mode: 'global',
|
222 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
223 | });
|
224 | });
|
225 |
|
226 | var id = 0;
|
227 | var postfix = Math.random();
|
228 |
|
229 | var uid = function (key) {
|
230 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
231 | };
|
232 |
|
233 | var keys = shared('keys');
|
234 |
|
235 | var sharedKey = function (key) {
|
236 | return keys[key] || (keys[key] = uid(key));
|
237 | };
|
238 |
|
239 | var hiddenKeys = {};
|
240 |
|
241 | var WeakMap$1 = global_1.WeakMap;
|
242 | var set, get, has$1;
|
243 |
|
244 | var enforce = function (it) {
|
245 | return has$1(it) ? get(it) : set(it, {});
|
246 | };
|
247 |
|
248 | var getterFor = function (TYPE) {
|
249 | return function (it) {
|
250 | var state;
|
251 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
252 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
253 | } return state;
|
254 | };
|
255 | };
|
256 |
|
257 | if (nativeWeakMap) {
|
258 | var store$1 = new WeakMap$1();
|
259 | var wmget = store$1.get;
|
260 | var wmhas = store$1.has;
|
261 | var wmset = store$1.set;
|
262 | set = function (it, metadata) {
|
263 | wmset.call(store$1, it, metadata);
|
264 | return metadata;
|
265 | };
|
266 | get = function (it) {
|
267 | return wmget.call(store$1, it) || {};
|
268 | };
|
269 | has$1 = function (it) {
|
270 | return wmhas.call(store$1, it);
|
271 | };
|
272 | } else {
|
273 | var STATE = sharedKey('state');
|
274 | hiddenKeys[STATE] = true;
|
275 | set = function (it, metadata) {
|
276 | createNonEnumerableProperty(it, STATE, metadata);
|
277 | return metadata;
|
278 | };
|
279 | get = function (it) {
|
280 | return has(it, STATE) ? it[STATE] : {};
|
281 | };
|
282 | has$1 = function (it) {
|
283 | return has(it, STATE);
|
284 | };
|
285 | }
|
286 |
|
287 | var internalState = {
|
288 | set: set,
|
289 | get: get,
|
290 | has: has$1,
|
291 | enforce: enforce,
|
292 | getterFor: getterFor
|
293 | };
|
294 |
|
295 | var redefine = createCommonjsModule(function (module) {
|
296 | var getInternalState = internalState.get;
|
297 | var enforceInternalState = internalState.enforce;
|
298 | var TEMPLATE = String(String).split('String');
|
299 |
|
300 | (module.exports = function (O, key, value, options) {
|
301 | var unsafe = options ? !!options.unsafe : false;
|
302 | var simple = options ? !!options.enumerable : false;
|
303 | var noTargetGet = options ? !!options.noTargetGet : false;
|
304 | if (typeof value == 'function') {
|
305 | if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
|
306 | enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
307 | }
|
308 | if (O === global_1) {
|
309 | if (simple) O[key] = value;
|
310 | else setGlobal(key, value);
|
311 | return;
|
312 | } else if (!unsafe) {
|
313 | delete O[key];
|
314 | } else if (!noTargetGet && O[key]) {
|
315 | simple = true;
|
316 | }
|
317 | if (simple) O[key] = value;
|
318 | else createNonEnumerableProperty(O, key, value);
|
319 |
|
320 | })(Function.prototype, 'toString', function toString() {
|
321 | return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
|
322 | });
|
323 | });
|
324 |
|
325 | var path = global_1;
|
326 |
|
327 | var aFunction = function (variable) {
|
328 | return typeof variable == 'function' ? variable : undefined;
|
329 | };
|
330 |
|
331 | var getBuiltIn = function (namespace, method) {
|
332 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
|
333 | : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
|
334 | };
|
335 |
|
336 | var ceil = Math.ceil;
|
337 | var floor = Math.floor;
|
338 |
|
339 |
|
340 |
|
341 | var toInteger = function (argument) {
|
342 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
343 | };
|
344 |
|
345 | var min = Math.min;
|
346 |
|
347 |
|
348 |
|
349 | var toLength = function (argument) {
|
350 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0;
|
351 | };
|
352 |
|
353 | var max = Math.max;
|
354 | var min$1 = Math.min;
|
355 |
|
356 |
|
357 |
|
358 |
|
359 | var toAbsoluteIndex = function (index, length) {
|
360 | var integer = toInteger(index);
|
361 | return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
362 | };
|
363 |
|
364 |
|
365 | var createMethod = function (IS_INCLUDES) {
|
366 | return function ($this, el, fromIndex) {
|
367 | var O = toIndexedObject($this);
|
368 | var length = toLength(O.length);
|
369 | var index = toAbsoluteIndex(fromIndex, length);
|
370 | var value;
|
371 |
|
372 |
|
373 | if (IS_INCLUDES && el != el) while (length > index) {
|
374 | value = O[index++];
|
375 |
|
376 | if (value != value) return true;
|
377 |
|
378 | } else for (;length > index; index++) {
|
379 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
380 | } return !IS_INCLUDES && -1;
|
381 | };
|
382 | };
|
383 |
|
384 | var arrayIncludes = {
|
385 |
|
386 |
|
387 | includes: createMethod(true),
|
388 |
|
389 |
|
390 | indexOf: createMethod(false)
|
391 | };
|
392 |
|
393 | var indexOf = arrayIncludes.indexOf;
|
394 |
|
395 |
|
396 | var objectKeysInternal = function (object, names) {
|
397 | var O = toIndexedObject(object);
|
398 | var i = 0;
|
399 | var result = [];
|
400 | var key;
|
401 | for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
402 |
|
403 | while (names.length > i) if (has(O, key = names[i++])) {
|
404 | ~indexOf(result, key) || result.push(key);
|
405 | }
|
406 | return result;
|
407 | };
|
408 |
|
409 |
|
410 | var enumBugKeys = [
|
411 | 'constructor',
|
412 | 'hasOwnProperty',
|
413 | 'isPrototypeOf',
|
414 | 'propertyIsEnumerable',
|
415 | 'toLocaleString',
|
416 | 'toString',
|
417 | 'valueOf'
|
418 | ];
|
419 |
|
420 | var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
421 |
|
422 |
|
423 |
|
424 | var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
425 | return objectKeysInternal(O, hiddenKeys$1);
|
426 | };
|
427 |
|
428 | var objectGetOwnPropertyNames = {
|
429 | f: f$3
|
430 | };
|
431 |
|
432 | var f$4 = Object.getOwnPropertySymbols;
|
433 |
|
434 | var objectGetOwnPropertySymbols = {
|
435 | f: f$4
|
436 | };
|
437 |
|
438 |
|
439 | var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
440 | var keys = objectGetOwnPropertyNames.f(anObject(it));
|
441 | var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
442 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
443 | };
|
444 |
|
445 | var copyConstructorProperties = function (target, source) {
|
446 | var keys = ownKeys(source);
|
447 | var defineProperty = objectDefineProperty.f;
|
448 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
449 | for (var i = 0; i < keys.length; i++) {
|
450 | var key = keys[i];
|
451 | if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
452 | }
|
453 | };
|
454 |
|
455 | var replacement = /#|\.prototype\./;
|
456 |
|
457 | var isForced = function (feature, detection) {
|
458 | var value = data[normalize(feature)];
|
459 | return value == POLYFILL ? true
|
460 | : value == NATIVE ? false
|
461 | : typeof detection == 'function' ? fails(detection)
|
462 | : !!detection;
|
463 | };
|
464 |
|
465 | var normalize = isForced.normalize = function (string) {
|
466 | return String(string).replace(replacement, '.').toLowerCase();
|
467 | };
|
468 |
|
469 | var data = isForced.data = {};
|
470 | var NATIVE = isForced.NATIVE = 'N';
|
471 | var POLYFILL = isForced.POLYFILL = 'P';
|
472 |
|
473 | var isForced_1 = isForced;
|
474 |
|
475 | var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 | |
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 | var _export = function (options, source) {
|
497 | var TARGET = options.target;
|
498 | var GLOBAL = options.global;
|
499 | var STATIC = options.stat;
|
500 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
501 | if (GLOBAL) {
|
502 | target = global_1;
|
503 | } else if (STATIC) {
|
504 | target = global_1[TARGET] || setGlobal(TARGET, {});
|
505 | } else {
|
506 | target = (global_1[TARGET] || {}).prototype;
|
507 | }
|
508 | if (target) for (key in source) {
|
509 | sourceProperty = source[key];
|
510 | if (options.noTargetGet) {
|
511 | descriptor = getOwnPropertyDescriptor$1(target, key);
|
512 | targetProperty = descriptor && descriptor.value;
|
513 | } else targetProperty = target[key];
|
514 | FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
515 |
|
516 | if (!FORCED && targetProperty !== undefined) {
|
517 | if (typeof sourceProperty === typeof targetProperty) continue;
|
518 | copyConstructorProperties(sourceProperty, targetProperty);
|
519 | }
|
520 |
|
521 | if (options.sham || (targetProperty && targetProperty.sham)) {
|
522 | createNonEnumerableProperty(sourceProperty, 'sham', true);
|
523 | }
|
524 |
|
525 | redefine(target, key, sourceProperty, options);
|
526 | }
|
527 | };
|
528 |
|
529 |
|
530 |
|
531 | var isArray = Array.isArray || function isArray(arg) {
|
532 | return classofRaw(arg) == 'Array';
|
533 | };
|
534 |
|
535 |
|
536 |
|
537 | var toObject = function (argument) {
|
538 | return Object(requireObjectCoercible(argument));
|
539 | };
|
540 |
|
541 | var createProperty = function (object, key, value) {
|
542 | var propertyKey = toPrimitive(key);
|
543 | if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
544 | else object[propertyKey] = value;
|
545 | };
|
546 |
|
547 | var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
548 |
|
549 |
|
550 | return !String(Symbol());
|
551 | });
|
552 |
|
553 | var useSymbolAsUid = nativeSymbol
|
554 |
|
555 | && !Symbol.sham
|
556 |
|
557 | && typeof Symbol() == 'symbol';
|
558 |
|
559 | var WellKnownSymbolsStore = shared('wks');
|
560 | var Symbol$1 = global_1.Symbol;
|
561 | var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
|
562 |
|
563 | var wellKnownSymbol = function (name) {
|
564 | if (!has(WellKnownSymbolsStore, name)) {
|
565 | if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
|
566 | else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
567 | } return WellKnownSymbolsStore[name];
|
568 | };
|
569 |
|
570 | var SPECIES = wellKnownSymbol('species');
|
571 |
|
572 |
|
573 |
|
574 | var arraySpeciesCreate = function (originalArray, length) {
|
575 | var C;
|
576 | if (isArray(originalArray)) {
|
577 | C = originalArray.constructor;
|
578 |
|
579 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
580 | else if (isObject(C)) {
|
581 | C = C[SPECIES];
|
582 | if (C === null) C = undefined;
|
583 | }
|
584 | } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
585 | };
|
586 |
|
587 | var userAgent = getBuiltIn('navigator', 'userAgent') || '';
|
588 |
|
589 | var process = global_1.process;
|
590 | var versions = process && process.versions;
|
591 | var v8 = versions && versions.v8;
|
592 | var match, version;
|
593 |
|
594 | if (v8) {
|
595 | match = v8.split('.');
|
596 | version = match[0] + match[1];
|
597 | } else if (userAgent) {
|
598 | match = userAgent.match(/Edge\/(\d+)/);
|
599 | if (!match || match[1] >= 74) {
|
600 | match = userAgent.match(/Chrome\/(\d+)/);
|
601 | if (match) version = match[1];
|
602 | }
|
603 | }
|
604 |
|
605 | var v8Version = version && +version;
|
606 |
|
607 | var SPECIES$1 = wellKnownSymbol('species');
|
608 |
|
609 | var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
610 |
|
611 |
|
612 |
|
613 | return v8Version >= 51 || !fails(function () {
|
614 | var array = [];
|
615 | var constructor = array.constructor = {};
|
616 | constructor[SPECIES$1] = function () {
|
617 | return { foo: 1 };
|
618 | };
|
619 | return array[METHOD_NAME](Boolean).foo !== 1;
|
620 | });
|
621 | };
|
622 |
|
623 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
624 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
625 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
626 |
|
627 |
|
628 |
|
629 |
|
630 | var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
|
631 | var array = [];
|
632 | array[IS_CONCAT_SPREADABLE] = false;
|
633 | return array.concat()[0] !== array;
|
634 | });
|
635 |
|
636 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
637 |
|
638 | var isConcatSpreadable = function (O) {
|
639 | if (!isObject(O)) return false;
|
640 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
641 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
642 | };
|
643 |
|
644 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
645 |
|
646 |
|
647 |
|
648 |
|
649 | _export({ target: 'Array', proto: true, forced: FORCED }, {
|
650 | concat: function concat(arg) {
|
651 | var O = toObject(this);
|
652 | var A = arraySpeciesCreate(O, 0);
|
653 | var n = 0;
|
654 | var i, k, length, len, E;
|
655 | for (i = -1, length = arguments.length; i < length; i++) {
|
656 | E = i === -1 ? O : arguments[i];
|
657 | if (isConcatSpreadable(E)) {
|
658 | len = toLength(E.length);
|
659 | if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
660 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
661 | } else {
|
662 | if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
663 | createProperty(A, n++, E);
|
664 | }
|
665 | }
|
666 | A.length = n;
|
667 | return A;
|
668 | }
|
669 | });
|
670 |
|
671 | var aFunction$1 = function (it) {
|
672 | if (typeof it != 'function') {
|
673 | throw TypeError(String(it) + ' is not a function');
|
674 | } return it;
|
675 | };
|
676 |
|
677 |
|
678 | var bindContext = function (fn, that, length) {
|
679 | aFunction$1(fn);
|
680 | if (that === undefined) return fn;
|
681 | switch (length) {
|
682 | case 0: return function () {
|
683 | return fn.call(that);
|
684 | };
|
685 | case 1: return function (a) {
|
686 | return fn.call(that, a);
|
687 | };
|
688 | case 2: return function (a, b) {
|
689 | return fn.call(that, a, b);
|
690 | };
|
691 | case 3: return function (a, b, c) {
|
692 | return fn.call(that, a, b, c);
|
693 | };
|
694 | }
|
695 | return function (/* ...args */) {
|
696 | return fn.apply(that, arguments);
|
697 | };
|
698 | };
|
699 |
|
700 | var push = [].push;
|
701 |
|
702 |
|
703 | var createMethod$1 = function (TYPE) {
|
704 | var IS_MAP = TYPE == 1;
|
705 | var IS_FILTER = TYPE == 2;
|
706 | var IS_SOME = TYPE == 3;
|
707 | var IS_EVERY = TYPE == 4;
|
708 | var IS_FIND_INDEX = TYPE == 6;
|
709 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
710 | return function ($this, callbackfn, that, specificCreate) {
|
711 | var O = toObject($this);
|
712 | var self = indexedObject(O);
|
713 | var boundFunction = bindContext(callbackfn, that, 3);
|
714 | var length = toLength(self.length);
|
715 | var index = 0;
|
716 | var create = specificCreate || arraySpeciesCreate;
|
717 | var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
718 | var value, result;
|
719 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
720 | value = self[index];
|
721 | result = boundFunction(value, index, O);
|
722 | if (TYPE) {
|
723 | if (IS_MAP) target[index] = result;
|
724 | else if (result) switch (TYPE) {
|
725 | case 3: return true;
|
726 | case 5: return value;
|
727 | case 6: return index;
|
728 | case 2: push.call(target, value);
|
729 | } else if (IS_EVERY) return false;
|
730 | }
|
731 | }
|
732 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
733 | };
|
734 | };
|
735 |
|
736 | var arrayIteration = {
|
737 |
|
738 |
|
739 | forEach: createMethod$1(0),
|
740 |
|
741 |
|
742 | map: createMethod$1(1),
|
743 |
|
744 |
|
745 | filter: createMethod$1(2),
|
746 |
|
747 |
|
748 | some: createMethod$1(3),
|
749 |
|
750 |
|
751 | every: createMethod$1(4),
|
752 |
|
753 |
|
754 | find: createMethod$1(5),
|
755 |
|
756 |
|
757 | findIndex: createMethod$1(6)
|
758 | };
|
759 |
|
760 | var $filter = arrayIteration.filter;
|
761 |
|
762 |
|
763 |
|
764 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
765 |
|
766 | var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
|
767 | [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
|
768 | });
|
769 |
|
770 |
|
771 |
|
772 |
|
773 | _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
774 | filter: function filter(callbackfn /* , thisArg */) {
|
775 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
776 | }
|
777 | });
|
778 |
|
779 |
|
780 |
|
781 | var objectKeys = Object.keys || function keys(O) {
|
782 | return objectKeysInternal(O, enumBugKeys);
|
783 | };
|
784 |
|
785 |
|
786 |
|
787 | var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
788 | anObject(O);
|
789 | var keys = objectKeys(Properties);
|
790 | var length = keys.length;
|
791 | var index = 0;
|
792 | var key;
|
793 | while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
|
794 | return O;
|
795 | };
|
796 |
|
797 | var html = getBuiltIn('document', 'documentElement');
|
798 |
|
799 | var GT = '>';
|
800 | var LT = '<';
|
801 | var PROTOTYPE = 'prototype';
|
802 | var SCRIPT = 'script';
|
803 | var IE_PROTO = sharedKey('IE_PROTO');
|
804 |
|
805 | var EmptyConstructor = function () { };
|
806 |
|
807 | var scriptTag = function (content) {
|
808 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
809 | };
|
810 |
|
811 |
|
812 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
813 | activeXDocument.write(scriptTag(''));
|
814 | activeXDocument.close();
|
815 | var temp = activeXDocument.parentWindow.Object;
|
816 | activeXDocument = null;
|
817 | return temp;
|
818 | };
|
819 |
|
820 |
|
821 | var NullProtoObjectViaIFrame = function () {
|
822 |
|
823 | var iframe = documentCreateElement('iframe');
|
824 | var JS = 'java' + SCRIPT + ':';
|
825 | var iframeDocument;
|
826 | iframe.style.display = 'none';
|
827 | html.appendChild(iframe);
|
828 |
|
829 | iframe.src = String(JS);
|
830 | iframeDocument = iframe.contentWindow.document;
|
831 | iframeDocument.open();
|
832 | iframeDocument.write(scriptTag('document.F=Object'));
|
833 | iframeDocument.close();
|
834 | return iframeDocument.F;
|
835 | };
|
836 |
|
837 |
|
838 |
|
839 |
|
840 |
|
841 |
|
842 | var activeXDocument;
|
843 | var NullProtoObject = function () {
|
844 | try {
|
845 |
|
846 | activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
847 | } catch (error) { }
|
848 | NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
849 | var length = enumBugKeys.length;
|
850 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
851 | return NullProtoObject();
|
852 | };
|
853 |
|
854 | hiddenKeys[IE_PROTO] = true;
|
855 |
|
856 |
|
857 |
|
858 | var objectCreate = Object.create || function create(O, Properties) {
|
859 | var result;
|
860 | if (O !== null) {
|
861 | EmptyConstructor[PROTOTYPE] = anObject(O);
|
862 | result = new EmptyConstructor();
|
863 | EmptyConstructor[PROTOTYPE] = null;
|
864 |
|
865 | result[IE_PROTO] = O;
|
866 | } else result = NullProtoObject();
|
867 | return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
868 | };
|
869 |
|
870 | var UNSCOPABLES = wellKnownSymbol('unscopables');
|
871 | var ArrayPrototype = Array.prototype;
|
872 |
|
873 |
|
874 |
|
875 | if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
876 | objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
|
877 | configurable: true,
|
878 | value: objectCreate(null)
|
879 | });
|
880 | }
|
881 |
|
882 |
|
883 | var addToUnscopables = function (key) {
|
884 | ArrayPrototype[UNSCOPABLES][key] = true;
|
885 | };
|
886 |
|
887 | var $find = arrayIteration.find;
|
888 |
|
889 |
|
890 | var FIND = 'find';
|
891 | var SKIPS_HOLES = true;
|
892 |
|
893 |
|
894 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
895 |
|
896 |
|
897 |
|
898 | _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
899 | find: function find(callbackfn /* , that = undefined */) {
|
900 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
901 | }
|
902 | });
|
903 |
|
904 |
|
905 | addToUnscopables(FIND);
|
906 |
|
907 | var sloppyArrayMethod = function (METHOD_NAME, argument) {
|
908 | var method = [][METHOD_NAME];
|
909 | return !method || !fails(function () {
|
910 |
|
911 | method.call(null, argument || function () { throw 1; }, 1);
|
912 | });
|
913 | };
|
914 |
|
915 | var nativeJoin = [].join;
|
916 |
|
917 | var ES3_STRINGS = indexedObject != Object;
|
918 | var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
|
919 |
|
920 |
|
921 |
|
922 | _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
|
923 | join: function join(separator) {
|
924 | return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
|
925 | }
|
926 | });
|
927 |
|
928 |
|
929 |
|
930 | var regexpFlags = function () {
|
931 | var that = anObject(this);
|
932 | var result = '';
|
933 | if (that.global) result += 'g';
|
934 | if (that.ignoreCase) result += 'i';
|
935 | if (that.multiline) result += 'm';
|
936 | if (that.dotAll) result += 's';
|
937 | if (that.unicode) result += 'u';
|
938 | if (that.sticky) result += 'y';
|
939 | return result;
|
940 | };
|
941 |
|
942 |
|
943 |
|
944 | function RE(s, f) {
|
945 | return RegExp(s, f);
|
946 | }
|
947 |
|
948 | var UNSUPPORTED_Y = fails(function () {
|
949 |
|
950 | var re = RE('a', 'y');
|
951 | re.lastIndex = 2;
|
952 | return re.exec('abcd') != null;
|
953 | });
|
954 |
|
955 | var BROKEN_CARET = fails(function () {
|
956 |
|
957 | var re = RE('^r', 'gy');
|
958 | re.lastIndex = 2;
|
959 | return re.exec('str') != null;
|
960 | });
|
961 |
|
962 | var regexpStickyHelpers = {
|
963 | UNSUPPORTED_Y: UNSUPPORTED_Y,
|
964 | BROKEN_CARET: BROKEN_CARET
|
965 | };
|
966 |
|
967 | var nativeExec = RegExp.prototype.exec;
|
968 |
|
969 |
|
970 |
|
971 | var nativeReplace = String.prototype.replace;
|
972 |
|
973 | var patchedExec = nativeExec;
|
974 |
|
975 | var UPDATES_LAST_INDEX_WRONG = (function () {
|
976 | var re1 = /a/;
|
977 | var re2 = /b*/g;
|
978 | nativeExec.call(re1, 'a');
|
979 | nativeExec.call(re2, 'a');
|
980 | return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
981 | })();
|
982 |
|
983 | var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
|
984 |
|
985 |
|
986 | var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
987 |
|
988 | var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
|
989 |
|
990 | if (PATCH) {
|
991 | patchedExec = function exec(str) {
|
992 | var re = this;
|
993 | var lastIndex, reCopy, match, i;
|
994 | var sticky = UNSUPPORTED_Y$1 && re.sticky;
|
995 | var flags = regexpFlags.call(re);
|
996 | var source = re.source;
|
997 | var charsAdded = 0;
|
998 | var strCopy = str;
|
999 |
|
1000 | if (sticky) {
|
1001 | flags = flags.replace('y', '');
|
1002 | if (flags.indexOf('g') === -1) {
|
1003 | flags += 'g';
|
1004 | }
|
1005 |
|
1006 | strCopy = String(str).slice(re.lastIndex);
|
1007 |
|
1008 | if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
|
1009 | source = '(?: ' + source + ')';
|
1010 | strCopy = ' ' + strCopy;
|
1011 | charsAdded++;
|
1012 | }
|
1013 |
|
1014 |
|
1015 | reCopy = new RegExp('^(?:' + source + ')', flags);
|
1016 | }
|
1017 |
|
1018 | if (NPCG_INCLUDED) {
|
1019 | reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
1020 | }
|
1021 | if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
1022 |
|
1023 | match = nativeExec.call(sticky ? reCopy : re, strCopy);
|
1024 |
|
1025 | if (sticky) {
|
1026 | if (match) {
|
1027 | match.input = match.input.slice(charsAdded);
|
1028 | match[0] = match[0].slice(charsAdded);
|
1029 | match.index = re.lastIndex;
|
1030 | re.lastIndex += match[0].length;
|
1031 | } else re.lastIndex = 0;
|
1032 | } else if (UPDATES_LAST_INDEX_WRONG && match) {
|
1033 | re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
1034 | }
|
1035 | if (NPCG_INCLUDED && match && match.length > 1) {
|
1036 |
|
1037 |
|
1038 | nativeReplace.call(match[0], reCopy, function () {
|
1039 | for (i = 1; i < arguments.length - 2; i++) {
|
1040 | if (arguments[i] === undefined) match[i] = undefined;
|
1041 | }
|
1042 | });
|
1043 | }
|
1044 |
|
1045 | return match;
|
1046 | };
|
1047 | }
|
1048 |
|
1049 | var regexpExec = patchedExec;
|
1050 |
|
1051 | _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
1052 | exec: regexpExec
|
1053 | });
|
1054 |
|
1055 | var SPECIES$2 = wellKnownSymbol('species');
|
1056 |
|
1057 | var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
1058 |
|
1059 |
|
1060 |
|
1061 | var re = /./;
|
1062 | re.exec = function () {
|
1063 | var result = [];
|
1064 | result.groups = { a: '7' };
|
1065 | return result;
|
1066 | };
|
1067 | return ''.replace(re, '$<a>') !== '7';
|
1068 | });
|
1069 |
|
1070 |
|
1071 |
|
1072 | var REPLACE_KEEPS_$0 = (function () {
|
1073 | return 'a'.replace(/./, '$0') === '$0';
|
1074 | })();
|
1075 |
|
1076 |
|
1077 |
|
1078 | var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
1079 | var re = /(?:)/;
|
1080 | var originalExec = re.exec;
|
1081 | re.exec = function () { return originalExec.apply(this, arguments); };
|
1082 | var result = 'ab'.split(re);
|
1083 | return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
1084 | });
|
1085 |
|
1086 | var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
|
1087 | var SYMBOL = wellKnownSymbol(KEY);
|
1088 |
|
1089 | var DELEGATES_TO_SYMBOL = !fails(function () {
|
1090 |
|
1091 | var O = {};
|
1092 | O[SYMBOL] = function () { return 7; };
|
1093 | return ''[KEY](O) != 7;
|
1094 | });
|
1095 |
|
1096 | var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
1097 |
|
1098 | var execCalled = false;
|
1099 | var re = /a/;
|
1100 |
|
1101 | if (KEY === 'split') {
|
1102 |
|
1103 |
|
1104 |
|
1105 | re = {};
|
1106 |
|
1107 |
|
1108 | re.constructor = {};
|
1109 | re.constructor[SPECIES$2] = function () { return re; };
|
1110 | re.flags = '';
|
1111 | re[SYMBOL] = /./[SYMBOL];
|
1112 | }
|
1113 |
|
1114 | re.exec = function () { execCalled = true; return null; };
|
1115 |
|
1116 | re[SYMBOL]('');
|
1117 | return !execCalled;
|
1118 | });
|
1119 |
|
1120 | if (
|
1121 | !DELEGATES_TO_SYMBOL ||
|
1122 | !DELEGATES_TO_EXEC ||
|
1123 | (KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
|
1124 | (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
1125 | ) {
|
1126 | var nativeRegExpMethod = /./[SYMBOL];
|
1127 | var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
1128 | if (regexp.exec === regexpExec) {
|
1129 | if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
1130 |
|
1131 |
|
1132 |
|
1133 | return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
1134 | }
|
1135 | return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
1136 | }
|
1137 | return { done: false };
|
1138 | }, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
|
1139 | var stringMethod = methods[0];
|
1140 | var regexMethod = methods[1];
|
1141 |
|
1142 | redefine(String.prototype, KEY, stringMethod);
|
1143 | redefine(RegExp.prototype, SYMBOL, length == 2
|
1144 |
|
1145 |
|
1146 | ? function (string, arg) { return regexMethod.call(string, this, arg); }
|
1147 |
|
1148 |
|
1149 | : function (string) { return regexMethod.call(string, this); }
|
1150 | );
|
1151 | }
|
1152 |
|
1153 | if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
|
1154 | };
|
1155 |
|
1156 |
|
1157 | var createMethod$2 = function (CONVERT_TO_STRING) {
|
1158 | return function ($this, pos) {
|
1159 | var S = String(requireObjectCoercible($this));
|
1160 | var position = toInteger(pos);
|
1161 | var size = S.length;
|
1162 | var first, second;
|
1163 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1164 | first = S.charCodeAt(position);
|
1165 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
1166 | || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
1167 | ? CONVERT_TO_STRING ? S.charAt(position) : first
|
1168 | : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1169 | };
|
1170 | };
|
1171 |
|
1172 | var stringMultibyte = {
|
1173 |
|
1174 |
|
1175 | codeAt: createMethod$2(false),
|
1176 |
|
1177 |
|
1178 | charAt: createMethod$2(true)
|
1179 | };
|
1180 |
|
1181 | var charAt = stringMultibyte.charAt;
|
1182 |
|
1183 |
|
1184 |
|
1185 | var advanceStringIndex = function (S, index, unicode) {
|
1186 | return index + (unicode ? charAt(S, index).length : 1);
|
1187 | };
|
1188 |
|
1189 |
|
1190 |
|
1191 | var regexpExecAbstract = function (R, S) {
|
1192 | var exec = R.exec;
|
1193 | if (typeof exec === 'function') {
|
1194 | var result = exec.call(R, S);
|
1195 | if (typeof result !== 'object') {
|
1196 | throw TypeError('RegExp exec method returned something other than an Object or null');
|
1197 | }
|
1198 | return result;
|
1199 | }
|
1200 |
|
1201 | if (classofRaw(R) !== 'RegExp') {
|
1202 | throw TypeError('RegExp#exec called on incompatible receiver');
|
1203 | }
|
1204 |
|
1205 | return regexpExec.call(R, S);
|
1206 | };
|
1207 |
|
1208 | var max$1 = Math.max;
|
1209 | var min$2 = Math.min;
|
1210 | var floor$1 = Math.floor;
|
1211 | var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
1212 | var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
|
1213 |
|
1214 | var maybeToString = function (it) {
|
1215 | return it === undefined ? it : String(it);
|
1216 | };
|
1217 |
|
1218 |
|
1219 | fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
|
1220 | return [
|
1221 |
|
1222 |
|
1223 | function replace(searchValue, replaceValue) {
|
1224 | var O = requireObjectCoercible(this);
|
1225 | var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
|
1226 | return replacer !== undefined
|
1227 | ? replacer.call(searchValue, O, replaceValue)
|
1228 | : nativeReplace.call(String(O), searchValue, replaceValue);
|
1229 | },
|
1230 |
|
1231 |
|
1232 | function (regexp, replaceValue) {
|
1233 | if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
|
1234 | var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
1235 | if (res.done) return res.value;
|
1236 | }
|
1237 |
|
1238 | var rx = anObject(regexp);
|
1239 | var S = String(this);
|
1240 |
|
1241 | var functionalReplace = typeof replaceValue === 'function';
|
1242 | if (!functionalReplace) replaceValue = String(replaceValue);
|
1243 |
|
1244 | var global = rx.global;
|
1245 | if (global) {
|
1246 | var fullUnicode = rx.unicode;
|
1247 | rx.lastIndex = 0;
|
1248 | }
|
1249 | var results = [];
|
1250 | while (true) {
|
1251 | var result = regexpExecAbstract(rx, S);
|
1252 | if (result === null) break;
|
1253 |
|
1254 | results.push(result);
|
1255 | if (!global) break;
|
1256 |
|
1257 | var matchStr = String(result[0]);
|
1258 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
1259 | }
|
1260 |
|
1261 | var accumulatedResult = '';
|
1262 | var nextSourcePosition = 0;
|
1263 | for (var i = 0; i < results.length; i++) {
|
1264 | result = results[i];
|
1265 |
|
1266 | var matched = String(result[0]);
|
1267 | var position = max$1(min$2(toInteger(result.index), S.length), 0);
|
1268 | var captures = [];
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 | for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
|
1275 | var namedCaptures = result.groups;
|
1276 | if (functionalReplace) {
|
1277 | var replacerArgs = [matched].concat(captures, position, S);
|
1278 | if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
|
1279 | var replacement = String(replaceValue.apply(undefined, replacerArgs));
|
1280 | } else {
|
1281 | replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
1282 | }
|
1283 | if (position >= nextSourcePosition) {
|
1284 | accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
|
1285 | nextSourcePosition = position + matched.length;
|
1286 | }
|
1287 | }
|
1288 | return accumulatedResult + S.slice(nextSourcePosition);
|
1289 | }
|
1290 | ];
|
1291 |
|
1292 |
|
1293 | function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
|
1294 | var tailPos = position + matched.length;
|
1295 | var m = captures.length;
|
1296 | var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
1297 | if (namedCaptures !== undefined) {
|
1298 | namedCaptures = toObject(namedCaptures);
|
1299 | symbols = SUBSTITUTION_SYMBOLS;
|
1300 | }
|
1301 | return nativeReplace.call(replacement, symbols, function (match, ch) {
|
1302 | var capture;
|
1303 | switch (ch.charAt(0)) {
|
1304 | case '$': return '$';
|
1305 | case '&': return matched;
|
1306 | case '`': return str.slice(0, position);
|
1307 | case "'": return str.slice(tailPos);
|
1308 | case '<':
|
1309 | capture = namedCaptures[ch.slice(1, -1)];
|
1310 | break;
|
1311 | default:
|
1312 | var n = +ch;
|
1313 | if (n === 0) return match;
|
1314 | if (n > m) {
|
1315 | var f = floor$1(n / 10);
|
1316 | if (f === 0) return match;
|
1317 | if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
1318 | return match;
|
1319 | }
|
1320 | capture = captures[n - 1];
|
1321 | }
|
1322 | return capture === undefined ? '' : capture;
|
1323 | });
|
1324 | }
|
1325 | });
|
1326 |
|
1327 |
|
1328 |
|
1329 | var sameValue = Object.is || function is(x, y) {
|
1330 |
|
1331 | return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
1332 | };
|
1333 |
|
1334 |
|
1335 | fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
1336 | return [
|
1337 |
|
1338 |
|
1339 | function search(regexp) {
|
1340 | var O = requireObjectCoercible(this);
|
1341 | var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
1342 | return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
1343 | },
|
1344 |
|
1345 |
|
1346 | function (regexp) {
|
1347 | var res = maybeCallNative(nativeSearch, regexp, this);
|
1348 | if (res.done) return res.value;
|
1349 |
|
1350 | var rx = anObject(regexp);
|
1351 | var S = String(this);
|
1352 |
|
1353 | var previousLastIndex = rx.lastIndex;
|
1354 | if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
1355 | var result = regexpExecAbstract(rx, S);
|
1356 | if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
1357 | return result === null ? -1 : result.index;
|
1358 | }
|
1359 | ];
|
1360 | });
|
1361 |
|
1362 | var MATCH = wellKnownSymbol('match');
|
1363 |
|
1364 |
|
1365 |
|
1366 | var isRegexp = function (it) {
|
1367 | var isRegExp;
|
1368 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
1369 | };
|
1370 |
|
1371 | var SPECIES$3 = wellKnownSymbol('species');
|
1372 |
|
1373 |
|
1374 |
|
1375 | var speciesConstructor = function (O, defaultConstructor) {
|
1376 | var C = anObject(O).constructor;
|
1377 | var S;
|
1378 | return C === undefined || (S = anObject(C)[SPECIES$3]) == undefined ? defaultConstructor : aFunction$1(S);
|
1379 | };
|
1380 |
|
1381 | var arrayPush = [].push;
|
1382 | var min$3 = Math.min;
|
1383 | var MAX_UINT32 = 0xFFFFFFFF;
|
1384 |
|
1385 |
|
1386 | var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
|
1387 |
|
1388 |
|
1389 | fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
|
1390 | var internalSplit;
|
1391 | if (
|
1392 | 'abbc'.split(/(b)*/)[1] == 'c' ||
|
1393 | 'test'.split(/(?:)/, -1).length != 4 ||
|
1394 | 'ab'.split(/(?:ab)*/).length != 2 ||
|
1395 | '.'.split(/(.?)(.?)/).length != 4 ||
|
1396 | '.'.split(/()()/).length > 1 ||
|
1397 | ''.split(/.?/).length
|
1398 | ) {
|
1399 |
|
1400 | internalSplit = function (separator, limit) {
|
1401 | var string = String(requireObjectCoercible(this));
|
1402 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
1403 | if (lim === 0) return [];
|
1404 | if (separator === undefined) return [string];
|
1405 |
|
1406 | if (!isRegexp(separator)) {
|
1407 | return nativeSplit.call(string, separator, lim);
|
1408 | }
|
1409 | var output = [];
|
1410 | var flags = (separator.ignoreCase ? 'i' : '') +
|
1411 | (separator.multiline ? 'm' : '') +
|
1412 | (separator.unicode ? 'u' : '') +
|
1413 | (separator.sticky ? 'y' : '');
|
1414 | var lastLastIndex = 0;
|
1415 |
|
1416 | var separatorCopy = new RegExp(separator.source, flags + 'g');
|
1417 | var match, lastIndex, lastLength;
|
1418 | while (match = regexpExec.call(separatorCopy, string)) {
|
1419 | lastIndex = separatorCopy.lastIndex;
|
1420 | if (lastIndex > lastLastIndex) {
|
1421 | output.push(string.slice(lastLastIndex, match.index));
|
1422 | if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
|
1423 | lastLength = match[0].length;
|
1424 | lastLastIndex = lastIndex;
|
1425 | if (output.length >= lim) break;
|
1426 | }
|
1427 | if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++;
|
1428 | }
|
1429 | if (lastLastIndex === string.length) {
|
1430 | if (lastLength || !separatorCopy.test('')) output.push('');
|
1431 | } else output.push(string.slice(lastLastIndex));
|
1432 | return output.length > lim ? output.slice(0, lim) : output;
|
1433 | };
|
1434 |
|
1435 | } else if ('0'.split(undefined, 0).length) {
|
1436 | internalSplit = function (separator, limit) {
|
1437 | return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
|
1438 | };
|
1439 | } else internalSplit = nativeSplit;
|
1440 |
|
1441 | return [
|
1442 |
|
1443 |
|
1444 | function split(separator, limit) {
|
1445 | var O = requireObjectCoercible(this);
|
1446 | var splitter = separator == undefined ? undefined : separator[SPLIT];
|
1447 | return splitter !== undefined
|
1448 | ? splitter.call(separator, O, limit)
|
1449 | : internalSplit.call(String(O), separator, limit);
|
1450 | },
|
1451 |
|
1452 |
|
1453 |
|
1454 |
|
1455 |
|
1456 | function (regexp, limit) {
|
1457 | var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
|
1458 | if (res.done) return res.value;
|
1459 |
|
1460 | var rx = anObject(regexp);
|
1461 | var S = String(this);
|
1462 | var C = speciesConstructor(rx, RegExp);
|
1463 |
|
1464 | var unicodeMatching = rx.unicode;
|
1465 | var flags = (rx.ignoreCase ? 'i' : '') +
|
1466 | (rx.multiline ? 'm' : '') +
|
1467 | (rx.unicode ? 'u' : '') +
|
1468 | (SUPPORTS_Y ? 'y' : 'g');
|
1469 |
|
1470 |
|
1471 |
|
1472 | var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
|
1473 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
1474 | if (lim === 0) return [];
|
1475 | if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
|
1476 | var p = 0;
|
1477 | var q = 0;
|
1478 | var A = [];
|
1479 | while (q < S.length) {
|
1480 | splitter.lastIndex = SUPPORTS_Y ? q : 0;
|
1481 | var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
|
1482 | var e;
|
1483 | if (
|
1484 | z === null ||
|
1485 | (e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
|
1486 | ) {
|
1487 | q = advanceStringIndex(S, q, unicodeMatching);
|
1488 | } else {
|
1489 | A.push(S.slice(p, q));
|
1490 | if (A.length === lim) return A;
|
1491 | for (var i = 1; i <= z.length - 1; i++) {
|
1492 | A.push(z[i]);
|
1493 | if (A.length === lim) return A;
|
1494 | }
|
1495 | q = p = e;
|
1496 | }
|
1497 | }
|
1498 | A.push(S.slice(p));
|
1499 | return A;
|
1500 | }
|
1501 | ];
|
1502 | }, !SUPPORTS_Y);
|
1503 |
|
1504 |
|
1505 |
|
1506 | var domIterables = {
|
1507 | CSSRuleList: 0,
|
1508 | CSSStyleDeclaration: 0,
|
1509 | CSSValueList: 0,
|
1510 | ClientRectList: 0,
|
1511 | DOMRectList: 0,
|
1512 | DOMStringList: 0,
|
1513 | DOMTokenList: 1,
|
1514 | DataTransferItemList: 0,
|
1515 | FileList: 0,
|
1516 | HTMLAllCollection: 0,
|
1517 | HTMLCollection: 0,
|
1518 | HTMLFormElement: 0,
|
1519 | HTMLSelectElement: 0,
|
1520 | MediaList: 0,
|
1521 | MimeTypeArray: 0,
|
1522 | NamedNodeMap: 0,
|
1523 | NodeList: 1,
|
1524 | PaintRequestList: 0,
|
1525 | Plugin: 0,
|
1526 | PluginArray: 0,
|
1527 | SVGLengthList: 0,
|
1528 | SVGNumberList: 0,
|
1529 | SVGPathSegList: 0,
|
1530 | SVGPointList: 0,
|
1531 | SVGStringList: 0,
|
1532 | SVGTransformList: 0,
|
1533 | SourceBufferList: 0,
|
1534 | StyleSheetList: 0,
|
1535 | TextTrackCueList: 0,
|
1536 | TextTrackList: 0,
|
1537 | TouchList: 0
|
1538 | };
|
1539 |
|
1540 | var $forEach = arrayIteration.forEach;
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 | var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
|
1546 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
1547 | } : [].forEach;
|
1548 |
|
1549 | for (var COLLECTION_NAME in domIterables) {
|
1550 | var Collection = global_1[COLLECTION_NAME];
|
1551 | var CollectionPrototype = Collection && Collection.prototype;
|
1552 |
|
1553 | if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
1554 | createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
|
1555 | } catch (error) {
|
1556 | CollectionPrototype.forEach = arrayForEach;
|
1557 | }
|
1558 | }
|
1559 |
|
1560 | function _classCallCheck(instance, Constructor) {
|
1561 | if (!(instance instanceof Constructor)) {
|
1562 | throw new TypeError("Cannot call a class as a function");
|
1563 | }
|
1564 | }
|
1565 |
|
1566 | function _defineProperties(target, props) {
|
1567 | for (var i = 0; i < props.length; i++) {
|
1568 | var descriptor = props[i];
|
1569 | descriptor.enumerable = descriptor.enumerable || false;
|
1570 | descriptor.configurable = true;
|
1571 | if ("value" in descriptor) descriptor.writable = true;
|
1572 | Object.defineProperty(target, descriptor.key, descriptor);
|
1573 | }
|
1574 | }
|
1575 |
|
1576 | function _createClass(Constructor, protoProps, staticProps) {
|
1577 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1578 | if (staticProps) _defineProperties(Constructor, staticProps);
|
1579 | return Constructor;
|
1580 | }
|
1581 |
|
1582 | function _inherits(subClass, superClass) {
|
1583 | if (typeof superClass !== "function" && superClass !== null) {
|
1584 | throw new TypeError("Super expression must either be null or a function");
|
1585 | }
|
1586 |
|
1587 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
1588 | constructor: {
|
1589 | value: subClass,
|
1590 | writable: true,
|
1591 | configurable: true
|
1592 | }
|
1593 | });
|
1594 | if (superClass) _setPrototypeOf(subClass, superClass);
|
1595 | }
|
1596 |
|
1597 | function _getPrototypeOf(o) {
|
1598 | _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
1599 | return o.__proto__ || Object.getPrototypeOf(o);
|
1600 | };
|
1601 | return _getPrototypeOf(o);
|
1602 | }
|
1603 |
|
1604 | function _setPrototypeOf(o, p) {
|
1605 | _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
1606 | o.__proto__ = p;
|
1607 | return o;
|
1608 | };
|
1609 |
|
1610 | return _setPrototypeOf(o, p);
|
1611 | }
|
1612 |
|
1613 | function _assertThisInitialized(self) {
|
1614 | if (self === void 0) {
|
1615 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
1616 | }
|
1617 |
|
1618 | return self;
|
1619 | }
|
1620 |
|
1621 | function _possibleConstructorReturn(self, call) {
|
1622 | if (call && (typeof call === "object" || typeof call === "function")) {
|
1623 | return call;
|
1624 | }
|
1625 |
|
1626 | return _assertThisInitialized(self);
|
1627 | }
|
1628 |
|
1629 | function _superPropBase(object, property) {
|
1630 | while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
1631 | object = _getPrototypeOf(object);
|
1632 | if (object === null) break;
|
1633 | }
|
1634 |
|
1635 | return object;
|
1636 | }
|
1637 |
|
1638 | function _get(target, property, receiver) {
|
1639 | if (typeof Reflect !== "undefined" && Reflect.get) {
|
1640 | _get = Reflect.get;
|
1641 | } else {
|
1642 | _get = function _get(target, property, receiver) {
|
1643 | var base = _superPropBase(target, property);
|
1644 |
|
1645 | if (!base) return;
|
1646 | var desc = Object.getOwnPropertyDescriptor(base, property);
|
1647 |
|
1648 | if (desc.get) {
|
1649 | return desc.get.call(receiver);
|
1650 | }
|
1651 |
|
1652 | return desc.value;
|
1653 | };
|
1654 | }
|
1655 |
|
1656 | return _get(target, property, receiver || target);
|
1657 | }
|
1658 |
|
1659 | |
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 | var Utils = $.fn.bootstrapTable.utils;
|
1666 | var UtilsCookie = {
|
1667 | cookieIds: {
|
1668 | sortOrder: 'bs.table.sortOrder',
|
1669 | sortName: 'bs.table.sortName',
|
1670 | pageNumber: 'bs.table.pageNumber',
|
1671 | pageList: 'bs.table.pageList',
|
1672 | columns: 'bs.table.columns',
|
1673 | searchText: 'bs.table.searchText',
|
1674 | reorderColumns: 'bs.table.reorderColumns',
|
1675 | filterControl: 'bs.table.filterControl',
|
1676 | filterBy: 'bs.table.filterBy'
|
1677 | },
|
1678 | getCurrentHeader: function getCurrentHeader(that) {
|
1679 | var header = that.$header;
|
1680 |
|
1681 | if (that.options.height) {
|
1682 | header = that.$tableHeader;
|
1683 | }
|
1684 |
|
1685 | return header;
|
1686 | },
|
1687 | getCurrentSearchControls: function getCurrentSearchControls(that) {
|
1688 | var searchControls = 'select, input';
|
1689 |
|
1690 | if (that.options.height) {
|
1691 | searchControls = 'table select, table input';
|
1692 | }
|
1693 |
|
1694 | return searchControls;
|
1695 | },
|
1696 | cookieEnabled: function cookieEnabled() {
|
1697 | return !!navigator.cookieEnabled;
|
1698 | },
|
1699 | inArrayCookiesEnabled: function inArrayCookiesEnabled(cookieName, cookiesEnabled) {
|
1700 | var index = -1;
|
1701 |
|
1702 | for (var i = 0; i < cookiesEnabled.length; i++) {
|
1703 | if (cookieName.toLowerCase() === cookiesEnabled[i].toLowerCase()) {
|
1704 | index = i;
|
1705 | break;
|
1706 | }
|
1707 | }
|
1708 |
|
1709 | return index;
|
1710 | },
|
1711 | setCookie: function setCookie(that, cookieName, cookieValue) {
|
1712 | if (!that.options.cookie || !UtilsCookie.cookieEnabled() || that.options.cookieIdTable === '') {
|
1713 | return;
|
1714 | }
|
1715 |
|
1716 | if (UtilsCookie.inArrayCookiesEnabled(cookieName, that.options.cookiesEnabled) === -1) {
|
1717 | return;
|
1718 | }
|
1719 |
|
1720 | cookieName = "".concat(that.options.cookieIdTable, ".").concat(cookieName);
|
1721 |
|
1722 | switch (that.options.cookieStorage) {
|
1723 | case 'cookieStorage':
|
1724 | document.cookie = [cookieName, '=', encodeURIComponent(cookieValue), "; expires=".concat(UtilsCookie.calculateExpiration(that.options.cookieExpire)), that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', that.options.cookieSecure ? '; secure' : ''].join('');
|
1725 | break;
|
1726 |
|
1727 | case 'localStorage':
|
1728 | localStorage.setItem(cookieName, cookieValue);
|
1729 | break;
|
1730 |
|
1731 | case 'sessionStorage':
|
1732 | sessionStorage.setItem(cookieName, cookieValue);
|
1733 | break;
|
1734 |
|
1735 | case 'customStorage':
|
1736 | if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
|
1737 | throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
|
1738 | }
|
1739 |
|
1740 | Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageSet, [cookieName, cookieValue], '');
|
1741 | break;
|
1742 |
|
1743 | default:
|
1744 | return false;
|
1745 | }
|
1746 |
|
1747 | return true;
|
1748 | },
|
1749 | getCookie: function getCookie(that, tableName, cookieName) {
|
1750 | if (!cookieName) {
|
1751 | return null;
|
1752 | }
|
1753 |
|
1754 | if (UtilsCookie.inArrayCookiesEnabled(cookieName, that.options.cookiesEnabled) === -1) {
|
1755 | return null;
|
1756 | }
|
1757 |
|
1758 | cookieName = "".concat(tableName, ".").concat(cookieName);
|
1759 |
|
1760 | switch (that.options.cookieStorage) {
|
1761 | case 'cookieStorage':
|
1762 | var value = "; ".concat(document.cookie);
|
1763 | var parts = value.split("; ".concat(cookieName, "="));
|
1764 | return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null;
|
1765 |
|
1766 | case 'localStorage':
|
1767 | return localStorage.getItem(cookieName);
|
1768 |
|
1769 | case 'sessionStorage':
|
1770 | return sessionStorage.getItem(cookieName);
|
1771 |
|
1772 | case 'customStorage':
|
1773 | if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
|
1774 | throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
|
1775 | }
|
1776 |
|
1777 | return Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageGet, [cookieName], '');
|
1778 |
|
1779 | default:
|
1780 | return null;
|
1781 | }
|
1782 | },
|
1783 | deleteCookie: function deleteCookie(that, tableName, cookieName) {
|
1784 | cookieName = "".concat(tableName, ".").concat(cookieName);
|
1785 |
|
1786 | switch (that.options.cookieStorage) {
|
1787 | case 'cookieStorage':
|
1788 | document.cookie = [encodeURIComponent(cookieName), '=', '; expires=Thu, 01 Jan 1970 00:00:00 GMT', that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : ''].join('');
|
1789 | break;
|
1790 |
|
1791 | case 'localStorage':
|
1792 | localStorage.removeItem(cookieName);
|
1793 | break;
|
1794 |
|
1795 | case 'sessionStorage':
|
1796 | sessionStorage.removeItem(cookieName);
|
1797 | break;
|
1798 |
|
1799 | case 'customStorage':
|
1800 | if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
|
1801 | throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
|
1802 | }
|
1803 |
|
1804 | Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageDelete, [cookieName], '');
|
1805 | break;
|
1806 |
|
1807 | default:
|
1808 | return false;
|
1809 | }
|
1810 |
|
1811 | return true;
|
1812 | },
|
1813 | calculateExpiration: function calculateExpiration(cookieExpire) {
|
1814 | var time = cookieExpire.replace(/[0-9]*/, '');
|
1815 |
|
1816 | cookieExpire = cookieExpire.replace(/[A-Za-z]{1,2}/, '');
|
1817 |
|
1818 | switch (time.toLowerCase()) {
|
1819 | case 's':
|
1820 | cookieExpire = +cookieExpire;
|
1821 | break;
|
1822 |
|
1823 | case 'mi':
|
1824 | cookieExpire *= 60;
|
1825 | break;
|
1826 |
|
1827 | case 'h':
|
1828 | cookieExpire = cookieExpire * 60 * 60;
|
1829 | break;
|
1830 |
|
1831 | case 'd':
|
1832 | cookieExpire = cookieExpire * 24 * 60 * 60;
|
1833 | break;
|
1834 |
|
1835 | case 'm':
|
1836 | cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
|
1837 | break;
|
1838 |
|
1839 | case 'y':
|
1840 | cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
|
1841 | break;
|
1842 |
|
1843 | default:
|
1844 | cookieExpire = undefined;
|
1845 | break;
|
1846 | }
|
1847 |
|
1848 | if (!cookieExpire) {
|
1849 | return '';
|
1850 | }
|
1851 |
|
1852 | var d = new Date();
|
1853 | d.setTime(d.getTime() + cookieExpire * 1000);
|
1854 | return d.toGMTString();
|
1855 | },
|
1856 | initCookieFilters: function initCookieFilters(bootstrapTable) {
|
1857 | setTimeout(function () {
|
1858 | var parsedCookieFilters = JSON.parse(UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, UtilsCookie.cookieIds.filterControl));
|
1859 |
|
1860 | if (!bootstrapTable.options.filterControlValuesLoaded && parsedCookieFilters) {
|
1861 | var cachedFilters = {};
|
1862 | var header = UtilsCookie.getCurrentHeader(bootstrapTable);
|
1863 | var searchControls = UtilsCookie.getCurrentSearchControls(bootstrapTable);
|
1864 |
|
1865 | var applyCookieFilters = function applyCookieFilters(element, filteredCookies) {
|
1866 | filteredCookies.forEach(function (cookie) {
|
1867 | if (cookie.text !== '' && element.tagName === 'INPUT') {
|
1868 | element.value = cookie.text;
|
1869 | cachedFilters[cookie.field] = cookie.text;
|
1870 | } else if (cookie.text !== '' && element.tagName === 'SELECT') {
|
1871 | var option = document.createElement('option');
|
1872 | option.value = cookie.text;
|
1873 | option.text = cookie.text;
|
1874 | element.add(option, element[1]);
|
1875 | element.selectedIndex = 1;
|
1876 | cachedFilters[cookie.field] = cookie.text;
|
1877 | }
|
1878 | });
|
1879 | };
|
1880 |
|
1881 | header.find(searchControls).each(function () {
|
1882 | var field = $(this).closest('[data-field]').data('field');
|
1883 | var filteredCookies = parsedCookieFilters.filter(function (cookie) {
|
1884 | return cookie.field === field;
|
1885 | });
|
1886 | applyCookieFilters(this, filteredCookies);
|
1887 | });
|
1888 | bootstrapTable.initColumnSearch(cachedFilters);
|
1889 | bootstrapTable.options.filterControlValuesLoaded = true;
|
1890 | bootstrapTable.initServer();
|
1891 | }
|
1892 | }, 250);
|
1893 | }
|
1894 | };
|
1895 | $.extend($.fn.bootstrapTable.defaults, {
|
1896 | cookie: false,
|
1897 | cookieExpire: '2h',
|
1898 | cookiePath: null,
|
1899 | cookieDomain: null,
|
1900 | cookieSecure: null,
|
1901 | cookieIdTable: '',
|
1902 | cookiesEnabled: ['bs.table.sortOrder', 'bs.table.sortName', 'bs.table.pageNumber', 'bs.table.pageList', 'bs.table.columns', 'bs.table.searchText', 'bs.table.filterControl', 'bs.table.filterBy', 'bs.table.reorderColumns'],
|
1903 | cookieStorage: 'cookieStorage',
|
1904 |
|
1905 |
|
1906 | filterControls: [],
|
1907 | filterControlValuesLoaded: false
|
1908 | });
|
1909 | $.fn.bootstrapTable.methods.push('getCookies');
|
1910 | $.fn.bootstrapTable.methods.push('deleteCookie');
|
1911 | $.extend($.fn.bootstrapTable.utils, {
|
1912 | setCookie: UtilsCookie.setCookie,
|
1913 | getCookie: UtilsCookie.getCookie
|
1914 | });
|
1915 |
|
1916 | $.BootstrapTable =
|
1917 |
|
1918 | function (_$$BootstrapTable) {
|
1919 | _inherits(_class, _$$BootstrapTable);
|
1920 |
|
1921 | function _class() {
|
1922 | _classCallCheck(this, _class);
|
1923 |
|
1924 | return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
|
1925 | }
|
1926 |
|
1927 | _createClass(_class, [{
|
1928 | key: "init",
|
1929 | value: function init() {
|
1930 | if (this.options.cookie) {
|
1931 |
|
1932 | var filterByCookieValue = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterBy);
|
1933 |
|
1934 | if (typeof filterByCookieValue === 'boolean' && !filterByCookieValue) {
|
1935 | throw new Error('The cookie value of filterBy must be a json!');
|
1936 | }
|
1937 |
|
1938 | var filterByCookie = {};
|
1939 |
|
1940 | try {
|
1941 | filterByCookie = JSON.parse(filterByCookieValue);
|
1942 | } catch (e) {
|
1943 | throw new Error('Could not parse the json of the filterBy cookie!');
|
1944 | }
|
1945 |
|
1946 | this.filterColumns = filterByCookie ? filterByCookie : {};
|
1947 |
|
1948 | this.options.filterControls = [];
|
1949 | this.options.filterControlValuesLoaded = false;
|
1950 | this.options.cookiesEnabled = typeof this.options.cookiesEnabled === 'string' ? this.options.cookiesEnabled.replace('[', '').replace(']', '').replace(/'/g, '').replace(/ /g, '').toLowerCase().split(',') : this.options.cookiesEnabled;
|
1951 |
|
1952 | if (this.options.filterControl) {
|
1953 | var that = this;
|
1954 | this.$el.on('column-search.bs.table', function (e, field, text) {
|
1955 | var isNewField = true;
|
1956 |
|
1957 | for (var i = 0; i < that.options.filterControls.length; i++) {
|
1958 | if (that.options.filterControls[i].field === field) {
|
1959 | that.options.filterControls[i].text = text;
|
1960 | isNewField = false;
|
1961 | break;
|
1962 | }
|
1963 | }
|
1964 |
|
1965 | if (isNewField) {
|
1966 | that.options.filterControls.push({
|
1967 | field: field,
|
1968 | text: text
|
1969 | });
|
1970 | }
|
1971 |
|
1972 | UtilsCookie.setCookie(that, UtilsCookie.cookieIds.filterControl, JSON.stringify(that.options.filterControls));
|
1973 | }).on('created-controls.bs.table', UtilsCookie.initCookieFilters(that));
|
1974 | }
|
1975 | }
|
1976 |
|
1977 | _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
|
1978 | }
|
1979 | }, {
|
1980 | key: "initServer",
|
1981 | value: function initServer() {
|
1982 | var _get2;
|
1983 |
|
1984 | if (this.options.cookie && this.options.filterControl && !this.options.filterControlValuesLoaded) {
|
1985 | var cookie = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterControl));
|
1986 |
|
1987 | if (cookie) {
|
1988 | return;
|
1989 | }
|
1990 | }
|
1991 |
|
1992 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
1993 | args[_key] = arguments[_key];
|
1994 | }
|
1995 |
|
1996 | (_get2 = _get(_getPrototypeOf(_class.prototype), "initServer", this)).call.apply(_get2, [this].concat(args));
|
1997 | }
|
1998 | }, {
|
1999 | key: "initTable",
|
2000 | value: function initTable() {
|
2001 | var _get3;
|
2002 |
|
2003 | for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
2004 | args[_key2] = arguments[_key2];
|
2005 | }
|
2006 |
|
2007 | (_get3 = _get(_getPrototypeOf(_class.prototype), "initTable", this)).call.apply(_get3, [this].concat(args));
|
2008 |
|
2009 | this.initCookie();
|
2010 | }
|
2011 | }, {
|
2012 | key: "onSort",
|
2013 | value: function onSort() {
|
2014 | var _get4;
|
2015 |
|
2016 | for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
2017 | args[_key3] = arguments[_key3];
|
2018 | }
|
2019 |
|
2020 | (_get4 = _get(_getPrototypeOf(_class.prototype), "onSort", this)).call.apply(_get4, [this].concat(args));
|
2021 |
|
2022 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder);
|
2023 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName);
|
2024 | }
|
2025 | }, {
|
2026 | key: "onPageNumber",
|
2027 | value: function onPageNumber() {
|
2028 | var _get5;
|
2029 |
|
2030 | for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
2031 | args[_key4] = arguments[_key4];
|
2032 | }
|
2033 |
|
2034 | (_get5 = _get(_getPrototypeOf(_class.prototype), "onPageNumber", this)).call.apply(_get5, [this].concat(args));
|
2035 |
|
2036 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
2037 | }
|
2038 | }, {
|
2039 | key: "onPageListChange",
|
2040 | value: function onPageListChange() {
|
2041 | var _get6;
|
2042 |
|
2043 | for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
2044 | args[_key5] = arguments[_key5];
|
2045 | }
|
2046 |
|
2047 | (_get6 = _get(_getPrototypeOf(_class.prototype), "onPageListChange", this)).call.apply(_get6, [this].concat(args));
|
2048 |
|
2049 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize);
|
2050 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
2051 | }
|
2052 | }, {
|
2053 | key: "onPagePre",
|
2054 | value: function onPagePre() {
|
2055 | var _get7;
|
2056 |
|
2057 | for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
2058 | args[_key6] = arguments[_key6];
|
2059 | }
|
2060 |
|
2061 | (_get7 = _get(_getPrototypeOf(_class.prototype), "onPagePre", this)).call.apply(_get7, [this].concat(args));
|
2062 |
|
2063 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
2064 | }
|
2065 | }, {
|
2066 | key: "onPageNext",
|
2067 | value: function onPageNext() {
|
2068 | var _get8;
|
2069 |
|
2070 | for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
2071 | args[_key7] = arguments[_key7];
|
2072 | }
|
2073 |
|
2074 | (_get8 = _get(_getPrototypeOf(_class.prototype), "onPageNext", this)).call.apply(_get8, [this].concat(args));
|
2075 |
|
2076 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
2077 | }
|
2078 | }, {
|
2079 | key: "_toggleColumn",
|
2080 | value: function _toggleColumn() {
|
2081 | var _get9;
|
2082 |
|
2083 | for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
2084 | args[_key8] = arguments[_key8];
|
2085 | }
|
2086 |
|
2087 | (_get9 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get9, [this].concat(args));
|
2088 |
|
2089 | var visibleColumns = [];
|
2090 | $.each(this.columns, function (i, column) {
|
2091 | if (column.visible) {
|
2092 | visibleColumns.push(column.field);
|
2093 | }
|
2094 | });
|
2095 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(visibleColumns));
|
2096 | }
|
2097 | }, {
|
2098 | key: "selectPage",
|
2099 | value: function selectPage(page) {
|
2100 | _get(_getPrototypeOf(_class.prototype), "selectPage", this).call(this, page);
|
2101 |
|
2102 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page);
|
2103 | }
|
2104 | }, {
|
2105 | key: "onSearch",
|
2106 | value: function onSearch(event) {
|
2107 | _get(_getPrototypeOf(_class.prototype), "onSearch", this).call(this, event);
|
2108 |
|
2109 | if (this.options.search) {
|
2110 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText);
|
2111 | }
|
2112 |
|
2113 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
|
2114 | }
|
2115 | }, {
|
2116 | key: "initHeader",
|
2117 | value: function initHeader() {
|
2118 | var _get10;
|
2119 |
|
2120 | if (this.options.reorderableColumns) {
|
2121 | this.columnsSortOrder = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.reorderColumns));
|
2122 | }
|
2123 |
|
2124 | for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
2125 | args[_key9] = arguments[_key9];
|
2126 | }
|
2127 |
|
2128 | (_get10 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get10, [this].concat(args));
|
2129 | }
|
2130 | }, {
|
2131 | key: "persistReorderColumnsState",
|
2132 | value: function persistReorderColumnsState(that) {
|
2133 | UtilsCookie.setCookie(that, UtilsCookie.cookieIds.reorderColumns, JSON.stringify(that.columnsSortOrder));
|
2134 | }
|
2135 | }, {
|
2136 | key: "filterBy",
|
2137 | value: function filterBy() {
|
2138 | var _get11;
|
2139 |
|
2140 | for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
2141 | args[_key10] = arguments[_key10];
|
2142 | }
|
2143 |
|
2144 | (_get11 = _get(_getPrototypeOf(_class.prototype), "filterBy", this)).call.apply(_get11, [this].concat(args));
|
2145 |
|
2146 | UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns));
|
2147 | }
|
2148 | }, {
|
2149 | key: "initCookie",
|
2150 | value: function initCookie() {
|
2151 | if (!this.options.cookie) {
|
2152 | return;
|
2153 | }
|
2154 |
|
2155 | if (this.options.cookieIdTable === '' || this.options.cookieExpire === '' || !UtilsCookie.cookieEnabled()) {
|
2156 | console.error('Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies.');
|
2157 | this.options.cookie = false;
|
2158 |
|
2159 | return;
|
2160 | }
|
2161 |
|
2162 | var sortOrderCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortOrder);
|
2163 | var sortOrderNameCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortName);
|
2164 | var pageNumberCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageNumber);
|
2165 | var pageListCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageList);
|
2166 | var searchTextCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.searchText);
|
2167 | var columnsCookieValue = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.columns);
|
2168 |
|
2169 | if (typeof columnsCookieValue === 'boolean' && !columnsCookieValue) {
|
2170 | throw new Error('The cookie value of filterBy must be a json!');
|
2171 | }
|
2172 |
|
2173 | var columnsCookie = {};
|
2174 |
|
2175 | try {
|
2176 | columnsCookie = JSON.parse(columnsCookieValue);
|
2177 | } catch (e) {
|
2178 | throw new Error('Could not parse the json of the columns cookie!', columnsCookieValue);
|
2179 | }
|
2180 |
|
2181 |
|
2182 | this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder;
|
2183 |
|
2184 | this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName;
|
2185 |
|
2186 | this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber;
|
2187 |
|
2188 | this.options.pageSize = pageListCookie ? pageListCookie === this.options.formatAllRows() ? pageListCookie : +pageListCookie : this.options.pageSize;
|
2189 |
|
2190 | this.options.searchText = searchTextCookie ? searchTextCookie : '';
|
2191 |
|
2192 | if (columnsCookie) {
|
2193 | $.each(this.columns, function (i, column) {
|
2194 | column.visible = $.inArray(column.field, columnsCookie) !== -1;
|
2195 | });
|
2196 | }
|
2197 | }
|
2198 | }, {
|
2199 | key: "getCookies",
|
2200 | value: function getCookies() {
|
2201 | var bootstrapTable = this;
|
2202 | var cookies = {};
|
2203 | $.each(UtilsCookie.cookieIds, function (key, value) {
|
2204 | cookies[key] = UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, value);
|
2205 |
|
2206 | if (key === 'columns') {
|
2207 | cookies[key] = JSON.parse(cookies[key]);
|
2208 | }
|
2209 | });
|
2210 | return cookies;
|
2211 | }
|
2212 | }, {
|
2213 | key: "deleteCookie",
|
2214 | value: function deleteCookie(cookieName) {
|
2215 | if (cookieName === '' || !UtilsCookie.cookieEnabled()) {
|
2216 | return;
|
2217 | }
|
2218 |
|
2219 | UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds[cookieName]);
|
2220 | }
|
2221 | }]);
|
2222 |
|
2223 | return _class;
|
2224 | }($.BootstrapTable);
|
2225 |
|
2226 | })));
|