· 5 years ago · Mar 05, 2020, 03:48 AM
1/******/ (function(modules) { // webpackBootstrap
2/******/ // The module cache
3/******/ var installedModules = {};
4/******/
5/******/ // The require function
6/******/ function __webpack_require__(moduleId) {
7/******/
8/******/ // Check if module is in cache
9/******/ if(installedModules[moduleId]) {
10/******/ return installedModules[moduleId].exports;
11/******/ }
12/******/ // Create a new module (and put it into the cache)
13/******/ var module = installedModules[moduleId] = {
14/******/ i: moduleId,
15/******/ l: false,
16/******/ exports: {}
17/******/ };
18/******/
19/******/ // Execute the module function
20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ // Flag the module as loaded
23/******/ module.l = true;
24/******/
25/******/ // Return the exports of the module
26/******/ return module.exports;
27/******/ }
28/******/
29/******/
30/******/ // expose the modules object (__webpack_modules__)
31/******/ __webpack_require__.m = modules;
32/******/
33/******/ // expose the module cache
34/******/ __webpack_require__.c = installedModules;
35/******/
36/******/ // define getter function for harmony exports
37/******/ __webpack_require__.d = function(exports, name, getter) {
38/******/ if(!__webpack_require__.o(exports, name)) {
39/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
40/******/ }
41/******/ };
42/******/
43/******/ // define __esModule on exports
44/******/ __webpack_require__.r = function(exports) {
45/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
46/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47/******/ }
48/******/ Object.defineProperty(exports, '__esModule', { value: true });
49/******/ };
50/******/
51/******/ // create a fake namespace object
52/******/ // mode & 1: value is a module id, require it
53/******/ // mode & 2: merge all properties of value into the ns
54/******/ // mode & 4: return value when already ns object
55/******/ // mode & 8|1: behave like require
56/******/ __webpack_require__.t = function(value, mode) {
57/******/ if(mode & 1) value = __webpack_require__(value);
58/******/ if(mode & 8) return value;
59/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
60/******/ var ns = Object.create(null);
61/******/ __webpack_require__.r(ns);
62/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
63/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
64/******/ return ns;
65/******/ };
66/******/
67/******/ // getDefaultExport function for compatibility with non-harmony modules
68/******/ __webpack_require__.n = function(module) {
69/******/ var getter = module && module.__esModule ?
70/******/ function getDefault() { return module['default']; } :
71/******/ function getModuleExports() { return module; };
72/******/ __webpack_require__.d(getter, 'a', getter);
73/******/ return getter;
74/******/ };
75/******/
76/******/ // Object.prototype.hasOwnProperty.call
77/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
78/******/
79/******/ // __webpack_public_path__
80/******/ __webpack_require__.p = "/";
81/******/
82/******/
83/******/ // Load entry module and return exports
84/******/ return __webpack_require__(__webpack_require__.s = 0);
85/******/ })
86/************************************************************************/
87/******/ ({
88
89/***/ "./node_modules/jquery/dist/jquery.js":
90/*!********************************************!*\
91 !*** ./node_modules/jquery/dist/jquery.js ***!
92 \********************************************/
93/*! no static exports found */
94/***/ (function(module, exports, __webpack_require__) {
95
96var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
97 * jQuery JavaScript Library v3.4.1
98 * https://jquery.com/
99 *
100 * Includes Sizzle.js
101 * https://sizzlejs.com/
102 *
103 * Copyright JS Foundation and other contributors
104 * Released under the MIT license
105 * https://jquery.org/license
106 *
107 * Date: 2019-05-01T21:04Z
108 */
109( function( global, factory ) {
110
111 "use strict";
112
113 if ( true && typeof module.exports === "object" ) {
114
115 // For CommonJS and CommonJS-like environments where a proper `window`
116 // is present, execute the factory and get jQuery.
117 // For environments that do not have a `window` with a `document`
118 // (such as Node.js), expose a factory as module.exports.
119 // This accentuates the need for the creation of a real `window`.
120 // e.g. var jQuery = require("jquery")(window);
121 // See ticket #14549 for more info.
122 module.exports = global.document ?
123 factory( global, true ) :
124 function( w ) {
125 if ( !w.document ) {
126 throw new Error( "jQuery requires a window with a document" );
127 }
128 return factory( w );
129 };
130 } else {
131 factory( global );
132 }
133
134// Pass this if window is not defined yet
135} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
136
137// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
138// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
139// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
140// enough that all such attempts are guarded in a try block.
141"use strict";
142
143var arr = [];
144
145var document = window.document;
146
147var getProto = Object.getPrototypeOf;
148
149var slice = arr.slice;
150
151var concat = arr.concat;
152
153var push = arr.push;
154
155var indexOf = arr.indexOf;
156
157var class2type = {};
158
159var toString = class2type.toString;
160
161var hasOwn = class2type.hasOwnProperty;
162
163var fnToString = hasOwn.toString;
164
165var ObjectFunctionString = fnToString.call( Object );
166
167var support = {};
168
169var isFunction = function isFunction( obj ) {
170
171 // Support: Chrome <=57, Firefox <=52
172 // In some browsers, typeof returns "function" for HTML <object> elements
173 // (i.e., `typeof document.createElement( "object" ) === "function"`).
174 // We don't want to classify *any* DOM node as a function.
175 return typeof obj === "function" && typeof obj.nodeType !== "number";
176 };
177
178
179var isWindow = function isWindow( obj ) {
180 return obj != null && obj === obj.window;
181 };
182
183
184
185
186 var preservedScriptAttributes = {
187 type: true,
188 src: true,
189 nonce: true,
190 noModule: true
191 };
192
193 function DOMEval( code, node, doc ) {
194 doc = doc || document;
195
196 var i, val,
197 script = doc.createElement( "script" );
198
199 script.text = code;
200 if ( node ) {
201 for ( i in preservedScriptAttributes ) {
202
203 // Support: Firefox 64+, Edge 18+
204 // Some browsers don't support the "nonce" property on scripts.
205 // On the other hand, just using `getAttribute` is not enough as
206 // the `nonce` attribute is reset to an empty string whenever it
207 // becomes browsing-context connected.
208 // See https://github.com/whatwg/html/issues/2369
209 // See https://html.spec.whatwg.org/#nonce-attributes
210 // The `node.getAttribute` check was added for the sake of
211 // `jQuery.globalEval` so that it can fake a nonce-containing node
212 // via an object.
213 val = node[ i ] || node.getAttribute && node.getAttribute( i );
214 if ( val ) {
215 script.setAttribute( i, val );
216 }
217 }
218 }
219 doc.head.appendChild( script ).parentNode.removeChild( script );
220 }
221
222
223function toType( obj ) {
224 if ( obj == null ) {
225 return obj + "";
226 }
227
228 // Support: Android <=2.3 only (functionish RegExp)
229 return typeof obj === "object" || typeof obj === "function" ?
230 class2type[ toString.call( obj ) ] || "object" :
231 typeof obj;
232}
233/* global Symbol */
234// Defining this global in .eslintrc.json would create a danger of using the global
235// unguarded in another place, it seems safer to define global only for this module
236
237
238
239var
240 version = "3.4.1",
241
242 // Define a local copy of jQuery
243 jQuery = function( selector, context ) {
244
245 // The jQuery object is actually just the init constructor 'enhanced'
246 // Need init if jQuery is called (just allow error to be thrown if not included)
247 return new jQuery.fn.init( selector, context );
248 },
249
250 // Support: Android <=4.0 only
251 // Make sure we trim BOM and NBSP
252 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
253
254jQuery.fn = jQuery.prototype = {
255
256 // The current version of jQuery being used
257 jquery: version,
258
259 constructor: jQuery,
260
261 // The default length of a jQuery object is 0
262 length: 0,
263
264 toArray: function() {
265 return slice.call( this );
266 },
267
268 // Get the Nth element in the matched element set OR
269 // Get the whole matched element set as a clean array
270 get: function( num ) {
271
272 // Return all the elements in a clean array
273 if ( num == null ) {
274 return slice.call( this );
275 }
276
277 // Return just the one element from the set
278 return num < 0 ? this[ num + this.length ] : this[ num ];
279 },
280
281 // Take an array of elements and push it onto the stack
282 // (returning the new matched element set)
283 pushStack: function( elems ) {
284
285 // Build a new jQuery matched element set
286 var ret = jQuery.merge( this.constructor(), elems );
287
288 // Add the old object onto the stack (as a reference)
289 ret.prevObject = this;
290
291 // Return the newly-formed element set
292 return ret;
293 },
294
295 // Execute a callback for every element in the matched set.
296 each: function( callback ) {
297 return jQuery.each( this, callback );
298 },
299
300 map: function( callback ) {
301 return this.pushStack( jQuery.map( this, function( elem, i ) {
302 return callback.call( elem, i, elem );
303 } ) );
304 },
305
306 slice: function() {
307 return this.pushStack( slice.apply( this, arguments ) );
308 },
309
310 first: function() {
311 return this.eq( 0 );
312 },
313
314 last: function() {
315 return this.eq( -1 );
316 },
317
318 eq: function( i ) {
319 var len = this.length,
320 j = +i + ( i < 0 ? len : 0 );
321 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
322 },
323
324 end: function() {
325 return this.prevObject || this.constructor();
326 },
327
328 // For internal use only.
329 // Behaves like an Array's method, not like a jQuery method.
330 push: push,
331 sort: arr.sort,
332 splice: arr.splice
333};
334
335jQuery.extend = jQuery.fn.extend = function() {
336 var options, name, src, copy, copyIsArray, clone,
337 target = arguments[ 0 ] || {},
338 i = 1,
339 length = arguments.length,
340 deep = false;
341
342 // Handle a deep copy situation
343 if ( typeof target === "boolean" ) {
344 deep = target;
345
346 // Skip the boolean and the target
347 target = arguments[ i ] || {};
348 i++;
349 }
350
351 // Handle case when target is a string or something (possible in deep copy)
352 if ( typeof target !== "object" && !isFunction( target ) ) {
353 target = {};
354 }
355
356 // Extend jQuery itself if only one argument is passed
357 if ( i === length ) {
358 target = this;
359 i--;
360 }
361
362 for ( ; i < length; i++ ) {
363
364 // Only deal with non-null/undefined values
365 if ( ( options = arguments[ i ] ) != null ) {
366
367 // Extend the base object
368 for ( name in options ) {
369 copy = options[ name ];
370
371 // Prevent Object.prototype pollution
372 // Prevent never-ending loop
373 if ( name === "__proto__" || target === copy ) {
374 continue;
375 }
376
377 // Recurse if we're merging plain objects or arrays
378 if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
379 ( copyIsArray = Array.isArray( copy ) ) ) ) {
380 src = target[ name ];
381
382 // Ensure proper type for the source value
383 if ( copyIsArray && !Array.isArray( src ) ) {
384 clone = [];
385 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
386 clone = {};
387 } else {
388 clone = src;
389 }
390 copyIsArray = false;
391
392 // Never move original objects, clone them
393 target[ name ] = jQuery.extend( deep, clone, copy );
394
395 // Don't bring in undefined values
396 } else if ( copy !== undefined ) {
397 target[ name ] = copy;
398 }
399 }
400 }
401 }
402
403 // Return the modified object
404 return target;
405};
406
407jQuery.extend( {
408
409 // Unique for each copy of jQuery on the page
410 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
411
412 // Assume jQuery is ready without the ready module
413 isReady: true,
414
415 error: function( msg ) {
416 throw new Error( msg );
417 },
418
419 noop: function() {},
420
421 isPlainObject: function( obj ) {
422 var proto, Ctor;
423
424 // Detect obvious negatives
425 // Use toString instead of jQuery.type to catch host objects
426 if ( !obj || toString.call( obj ) !== "[object Object]" ) {
427 return false;
428 }
429
430 proto = getProto( obj );
431
432 // Objects with no prototype (e.g., `Object.create( null )`) are plain
433 if ( !proto ) {
434 return true;
435 }
436
437 // Objects with prototype are plain iff they were constructed by a global Object function
438 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
439 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
440 },
441
442 isEmptyObject: function( obj ) {
443 var name;
444
445 for ( name in obj ) {
446 return false;
447 }
448 return true;
449 },
450
451 // Evaluates a script in a global context
452 globalEval: function( code, options ) {
453 DOMEval( code, { nonce: options && options.nonce } );
454 },
455
456 each: function( obj, callback ) {
457 var length, i = 0;
458
459 if ( isArrayLike( obj ) ) {
460 length = obj.length;
461 for ( ; i < length; i++ ) {
462 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
463 break;
464 }
465 }
466 } else {
467 for ( i in obj ) {
468 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
469 break;
470 }
471 }
472 }
473
474 return obj;
475 },
476
477 // Support: Android <=4.0 only
478 trim: function( text ) {
479 return text == null ?
480 "" :
481 ( text + "" ).replace( rtrim, "" );
482 },
483
484 // results is for internal usage only
485 makeArray: function( arr, results ) {
486 var ret = results || [];
487
488 if ( arr != null ) {
489 if ( isArrayLike( Object( arr ) ) ) {
490 jQuery.merge( ret,
491 typeof arr === "string" ?
492 [ arr ] : arr
493 );
494 } else {
495 push.call( ret, arr );
496 }
497 }
498
499 return ret;
500 },
501
502 inArray: function( elem, arr, i ) {
503 return arr == null ? -1 : indexOf.call( arr, elem, i );
504 },
505
506 // Support: Android <=4.0 only, PhantomJS 1 only
507 // push.apply(_, arraylike) throws on ancient WebKit
508 merge: function( first, second ) {
509 var len = +second.length,
510 j = 0,
511 i = first.length;
512
513 for ( ; j < len; j++ ) {
514 first[ i++ ] = second[ j ];
515 }
516
517 first.length = i;
518
519 return first;
520 },
521
522 grep: function( elems, callback, invert ) {
523 var callbackInverse,
524 matches = [],
525 i = 0,
526 length = elems.length,
527 callbackExpect = !invert;
528
529 // Go through the array, only saving the items
530 // that pass the validator function
531 for ( ; i < length; i++ ) {
532 callbackInverse = !callback( elems[ i ], i );
533 if ( callbackInverse !== callbackExpect ) {
534 matches.push( elems[ i ] );
535 }
536 }
537
538 return matches;
539 },
540
541 // arg is for internal usage only
542 map: function( elems, callback, arg ) {
543 var length, value,
544 i = 0,
545 ret = [];
546
547 // Go through the array, translating each of the items to their new values
548 if ( isArrayLike( elems ) ) {
549 length = elems.length;
550 for ( ; i < length; i++ ) {
551 value = callback( elems[ i ], i, arg );
552
553 if ( value != null ) {
554 ret.push( value );
555 }
556 }
557
558 // Go through every key on the object,
559 } else {
560 for ( i in elems ) {
561 value = callback( elems[ i ], i, arg );
562
563 if ( value != null ) {
564 ret.push( value );
565 }
566 }
567 }
568
569 // Flatten any nested arrays
570 return concat.apply( [], ret );
571 },
572
573 // A global GUID counter for objects
574 guid: 1,
575
576 // jQuery.support is not used in Core but other projects attach their
577 // properties to it so it needs to exist.
578 support: support
579} );
580
581if ( typeof Symbol === "function" ) {
582 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
583}
584
585// Populate the class2type map
586jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
587function( i, name ) {
588 class2type[ "[object " + name + "]" ] = name.toLowerCase();
589} );
590
591function isArrayLike( obj ) {
592
593 // Support: real iOS 8.2 only (not reproducible in simulator)
594 // `in` check used to prevent JIT error (gh-2145)
595 // hasOwn isn't used here due to false negatives
596 // regarding Nodelist length in IE
597 var length = !!obj && "length" in obj && obj.length,
598 type = toType( obj );
599
600 if ( isFunction( obj ) || isWindow( obj ) ) {
601 return false;
602 }
603
604 return type === "array" || length === 0 ||
605 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
606}
607var Sizzle =
608/*!
609 * Sizzle CSS Selector Engine v2.3.4
610 * https://sizzlejs.com/
611 *
612 * Copyright JS Foundation and other contributors
613 * Released under the MIT license
614 * https://js.foundation/
615 *
616 * Date: 2019-04-08
617 */
618(function( window ) {
619
620var i,
621 support,
622 Expr,
623 getText,
624 isXML,
625 tokenize,
626 compile,
627 select,
628 outermostContext,
629 sortInput,
630 hasDuplicate,
631
632 // Local document vars
633 setDocument,
634 document,
635 docElem,
636 documentIsHTML,
637 rbuggyQSA,
638 rbuggyMatches,
639 matches,
640 contains,
641
642 // Instance-specific data
643 expando = "sizzle" + 1 * new Date(),
644 preferredDoc = window.document,
645 dirruns = 0,
646 done = 0,
647 classCache = createCache(),
648 tokenCache = createCache(),
649 compilerCache = createCache(),
650 nonnativeSelectorCache = createCache(),
651 sortOrder = function( a, b ) {
652 if ( a === b ) {
653 hasDuplicate = true;
654 }
655 return 0;
656 },
657
658 // Instance methods
659 hasOwn = ({}).hasOwnProperty,
660 arr = [],
661 pop = arr.pop,
662 push_native = arr.push,
663 push = arr.push,
664 slice = arr.slice,
665 // Use a stripped-down indexOf as it's faster than native
666 // https://jsperf.com/thor-indexof-vs-for/5
667 indexOf = function( list, elem ) {
668 var i = 0,
669 len = list.length;
670 for ( ; i < len; i++ ) {
671 if ( list[i] === elem ) {
672 return i;
673 }
674 }
675 return -1;
676 },
677
678 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
679
680 // Regular expressions
681
682 // http://www.w3.org/TR/css3-selectors/#whitespace
683 whitespace = "[\\x20\\t\\r\\n\\f]",
684
685 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
686 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
687
688 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
689 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
690 // Operator (capture 2)
691 "*([*^$|!~]?=)" + whitespace +
692 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
693 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
694 "*\\]",
695
696 pseudos = ":(" + identifier + ")(?:\\((" +
697 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
698 // 1. quoted (capture 3; capture 4 or capture 5)
699 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
700 // 2. simple (capture 6)
701 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
702 // 3. anything else (capture 2)
703 ".*" +
704 ")\\)|)",
705
706 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
707 rwhitespace = new RegExp( whitespace + "+", "g" ),
708 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
709
710 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
711 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
712 rdescend = new RegExp( whitespace + "|>" ),
713
714 rpseudo = new RegExp( pseudos ),
715 ridentifier = new RegExp( "^" + identifier + "$" ),
716
717 matchExpr = {
718 "ID": new RegExp( "^#(" + identifier + ")" ),
719 "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
720 "TAG": new RegExp( "^(" + identifier + "|[*])" ),
721 "ATTR": new RegExp( "^" + attributes ),
722 "PSEUDO": new RegExp( "^" + pseudos ),
723 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
724 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
725 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
726 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
727 // For use in libraries implementing .is()
728 // We use this for POS matching in `select`
729 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
730 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
731 },
732
733 rhtml = /HTML$/i,
734 rinputs = /^(?:input|select|textarea|button)$/i,
735 rheader = /^h\d$/i,
736
737 rnative = /^[^{]+\{\s*\[native \w/,
738
739 // Easily-parseable/retrievable ID or TAG or CLASS selectors
740 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
741
742 rsibling = /[+~]/,
743
744 // CSS escapes
745 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
746 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
747 funescape = function( _, escaped, escapedWhitespace ) {
748 var high = "0x" + escaped - 0x10000;
749 // NaN means non-codepoint
750 // Support: Firefox<24
751 // Workaround erroneous numeric interpretation of +"0x"
752 return high !== high || escapedWhitespace ?
753 escaped :
754 high < 0 ?
755 // BMP codepoint
756 String.fromCharCode( high + 0x10000 ) :
757 // Supplemental Plane codepoint (surrogate pair)
758 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
759 },
760
761 // CSS string/identifier serialization
762 // https://drafts.csswg.org/cssom/#common-serializing-idioms
763 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
764 fcssescape = function( ch, asCodePoint ) {
765 if ( asCodePoint ) {
766
767 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
768 if ( ch === "\0" ) {
769 return "\uFFFD";
770 }
771
772 // Control characters and (dependent upon position) numbers get escaped as code points
773 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
774 }
775
776 // Other potentially-special ASCII characters get backslash-escaped
777 return "\\" + ch;
778 },
779
780 // Used for iframes
781 // See setDocument()
782 // Removing the function wrapper causes a "Permission Denied"
783 // error in IE
784 unloadHandler = function() {
785 setDocument();
786 },
787
788 inDisabledFieldset = addCombinator(
789 function( elem ) {
790 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
791 },
792 { dir: "parentNode", next: "legend" }
793 );
794
795// Optimize for push.apply( _, NodeList )
796try {
797 push.apply(
798 (arr = slice.call( preferredDoc.childNodes )),
799 preferredDoc.childNodes
800 );
801 // Support: Android<4.0
802 // Detect silently failing push.apply
803 arr[ preferredDoc.childNodes.length ].nodeType;
804} catch ( e ) {
805 push = { apply: arr.length ?
806
807 // Leverage slice if possible
808 function( target, els ) {
809 push_native.apply( target, slice.call(els) );
810 } :
811
812 // Support: IE<9
813 // Otherwise append directly
814 function( target, els ) {
815 var j = target.length,
816 i = 0;
817 // Can't trust NodeList.length
818 while ( (target[j++] = els[i++]) ) {}
819 target.length = j - 1;
820 }
821 };
822}
823
824function Sizzle( selector, context, results, seed ) {
825 var m, i, elem, nid, match, groups, newSelector,
826 newContext = context && context.ownerDocument,
827
828 // nodeType defaults to 9, since context defaults to document
829 nodeType = context ? context.nodeType : 9;
830
831 results = results || [];
832
833 // Return early from calls with invalid selector or context
834 if ( typeof selector !== "string" || !selector ||
835 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
836
837 return results;
838 }
839
840 // Try to shortcut find operations (as opposed to filters) in HTML documents
841 if ( !seed ) {
842
843 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
844 setDocument( context );
845 }
846 context = context || document;
847
848 if ( documentIsHTML ) {
849
850 // If the selector is sufficiently simple, try using a "get*By*" DOM method
851 // (excepting DocumentFragment context, where the methods don't exist)
852 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
853
854 // ID selector
855 if ( (m = match[1]) ) {
856
857 // Document context
858 if ( nodeType === 9 ) {
859 if ( (elem = context.getElementById( m )) ) {
860
861 // Support: IE, Opera, Webkit
862 // TODO: identify versions
863 // getElementById can match elements by name instead of ID
864 if ( elem.id === m ) {
865 results.push( elem );
866 return results;
867 }
868 } else {
869 return results;
870 }
871
872 // Element context
873 } else {
874
875 // Support: IE, Opera, Webkit
876 // TODO: identify versions
877 // getElementById can match elements by name instead of ID
878 if ( newContext && (elem = newContext.getElementById( m )) &&
879 contains( context, elem ) &&
880 elem.id === m ) {
881
882 results.push( elem );
883 return results;
884 }
885 }
886
887 // Type selector
888 } else if ( match[2] ) {
889 push.apply( results, context.getElementsByTagName( selector ) );
890 return results;
891
892 // Class selector
893 } else if ( (m = match[3]) && support.getElementsByClassName &&
894 context.getElementsByClassName ) {
895
896 push.apply( results, context.getElementsByClassName( m ) );
897 return results;
898 }
899 }
900
901 // Take advantage of querySelectorAll
902 if ( support.qsa &&
903 !nonnativeSelectorCache[ selector + " " ] &&
904 (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
905
906 // Support: IE 8 only
907 // Exclude object elements
908 (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
909
910 newSelector = selector;
911 newContext = context;
912
913 // qSA considers elements outside a scoping root when evaluating child or
914 // descendant combinators, which is not what we want.
915 // In such cases, we work around the behavior by prefixing every selector in the
916 // list with an ID selector referencing the scope context.
917 // Thanks to Andrew Dupont for this technique.
918 if ( nodeType === 1 && rdescend.test( selector ) ) {
919
920 // Capture the context ID, setting it first if necessary
921 if ( (nid = context.getAttribute( "id" )) ) {
922 nid = nid.replace( rcssescape, fcssescape );
923 } else {
924 context.setAttribute( "id", (nid = expando) );
925 }
926
927 // Prefix every selector in the list
928 groups = tokenize( selector );
929 i = groups.length;
930 while ( i-- ) {
931 groups[i] = "#" + nid + " " + toSelector( groups[i] );
932 }
933 newSelector = groups.join( "," );
934
935 // Expand context for sibling selectors
936 newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
937 context;
938 }
939
940 try {
941 push.apply( results,
942 newContext.querySelectorAll( newSelector )
943 );
944 return results;
945 } catch ( qsaError ) {
946 nonnativeSelectorCache( selector, true );
947 } finally {
948 if ( nid === expando ) {
949 context.removeAttribute( "id" );
950 }
951 }
952 }
953 }
954 }
955
956 // All others
957 return select( selector.replace( rtrim, "$1" ), context, results, seed );
958}
959
960/**
961 * Create key-value caches of limited size
962 * @returns {function(string, object)} Returns the Object data after storing it on itself with
963 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
964 * deleting the oldest entry
965 */
966function createCache() {
967 var keys = [];
968
969 function cache( key, value ) {
970 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
971 if ( keys.push( key + " " ) > Expr.cacheLength ) {
972 // Only keep the most recent entries
973 delete cache[ keys.shift() ];
974 }
975 return (cache[ key + " " ] = value);
976 }
977 return cache;
978}
979
980/**
981 * Mark a function for special use by Sizzle
982 * @param {Function} fn The function to mark
983 */
984function markFunction( fn ) {
985 fn[ expando ] = true;
986 return fn;
987}
988
989/**
990 * Support testing using an element
991 * @param {Function} fn Passed the created element and returns a boolean result
992 */
993function assert( fn ) {
994 var el = document.createElement("fieldset");
995
996 try {
997 return !!fn( el );
998 } catch (e) {
999 return false;
1000 } finally {
1001 // Remove from its parent by default
1002 if ( el.parentNode ) {
1003 el.parentNode.removeChild( el );
1004 }
1005 // release memory in IE
1006 el = null;
1007 }
1008}
1009
1010/**
1011 * Adds the same handler for all of the specified attrs
1012 * @param {String} attrs Pipe-separated list of attributes
1013 * @param {Function} handler The method that will be applied
1014 */
1015function addHandle( attrs, handler ) {
1016 var arr = attrs.split("|"),
1017 i = arr.length;
1018
1019 while ( i-- ) {
1020 Expr.attrHandle[ arr[i] ] = handler;
1021 }
1022}
1023
1024/**
1025 * Checks document order of two siblings
1026 * @param {Element} a
1027 * @param {Element} b
1028 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
1029 */
1030function siblingCheck( a, b ) {
1031 var cur = b && a,
1032 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
1033 a.sourceIndex - b.sourceIndex;
1034
1035 // Use IE sourceIndex if available on both nodes
1036 if ( diff ) {
1037 return diff;
1038 }
1039
1040 // Check if b follows a
1041 if ( cur ) {
1042 while ( (cur = cur.nextSibling) ) {
1043 if ( cur === b ) {
1044 return -1;
1045 }
1046 }
1047 }
1048
1049 return a ? 1 : -1;
1050}
1051
1052/**
1053 * Returns a function to use in pseudos for input types
1054 * @param {String} type
1055 */
1056function createInputPseudo( type ) {
1057 return function( elem ) {
1058 var name = elem.nodeName.toLowerCase();
1059 return name === "input" && elem.type === type;
1060 };
1061}
1062
1063/**
1064 * Returns a function to use in pseudos for buttons
1065 * @param {String} type
1066 */
1067function createButtonPseudo( type ) {
1068 return function( elem ) {
1069 var name = elem.nodeName.toLowerCase();
1070 return (name === "input" || name === "button") && elem.type === type;
1071 };
1072}
1073
1074/**
1075 * Returns a function to use in pseudos for :enabled/:disabled
1076 * @param {Boolean} disabled true for :disabled; false for :enabled
1077 */
1078function createDisabledPseudo( disabled ) {
1079
1080 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
1081 return function( elem ) {
1082
1083 // Only certain elements can match :enabled or :disabled
1084 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
1085 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
1086 if ( "form" in elem ) {
1087
1088 // Check for inherited disabledness on relevant non-disabled elements:
1089 // * listed form-associated elements in a disabled fieldset
1090 // https://html.spec.whatwg.org/multipage/forms.html#category-listed
1091 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
1092 // * option elements in a disabled optgroup
1093 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
1094 // All such elements have a "form" property.
1095 if ( elem.parentNode && elem.disabled === false ) {
1096
1097 // Option elements defer to a parent optgroup if present
1098 if ( "label" in elem ) {
1099 if ( "label" in elem.parentNode ) {
1100 return elem.parentNode.disabled === disabled;
1101 } else {
1102 return elem.disabled === disabled;
1103 }
1104 }
1105
1106 // Support: IE 6 - 11
1107 // Use the isDisabled shortcut property to check for disabled fieldset ancestors
1108 return elem.isDisabled === disabled ||
1109
1110 // Where there is no isDisabled, check manually
1111 /* jshint -W018 */
1112 elem.isDisabled !== !disabled &&
1113 inDisabledFieldset( elem ) === disabled;
1114 }
1115
1116 return elem.disabled === disabled;
1117
1118 // Try to winnow out elements that can't be disabled before trusting the disabled property.
1119 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
1120 // even exist on them, let alone have a boolean value.
1121 } else if ( "label" in elem ) {
1122 return elem.disabled === disabled;
1123 }
1124
1125 // Remaining elements are neither :enabled nor :disabled
1126 return false;
1127 };
1128}
1129
1130/**
1131 * Returns a function to use in pseudos for positionals
1132 * @param {Function} fn
1133 */
1134function createPositionalPseudo( fn ) {
1135 return markFunction(function( argument ) {
1136 argument = +argument;
1137 return markFunction(function( seed, matches ) {
1138 var j,
1139 matchIndexes = fn( [], seed.length, argument ),
1140 i = matchIndexes.length;
1141
1142 // Match elements found at the specified indexes
1143 while ( i-- ) {
1144 if ( seed[ (j = matchIndexes[i]) ] ) {
1145 seed[j] = !(matches[j] = seed[j]);
1146 }
1147 }
1148 });
1149 });
1150}
1151
1152/**
1153 * Checks a node for validity as a Sizzle context
1154 * @param {Element|Object=} context
1155 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1156 */
1157function testContext( context ) {
1158 return context && typeof context.getElementsByTagName !== "undefined" && context;
1159}
1160
1161// Expose support vars for convenience
1162support = Sizzle.support = {};
1163
1164/**
1165 * Detects XML nodes
1166 * @param {Element|Object} elem An element or a document
1167 * @returns {Boolean} True iff elem is a non-HTML XML node
1168 */
1169isXML = Sizzle.isXML = function( elem ) {
1170 var namespace = elem.namespaceURI,
1171 docElem = (elem.ownerDocument || elem).documentElement;
1172
1173 // Support: IE <=8
1174 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
1175 // https://bugs.jquery.com/ticket/4833
1176 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
1177};
1178
1179/**
1180 * Sets document-related variables once based on the current document
1181 * @param {Element|Object} [doc] An element or document object to use to set the document
1182 * @returns {Object} Returns the current document
1183 */
1184setDocument = Sizzle.setDocument = function( node ) {
1185 var hasCompare, subWindow,
1186 doc = node ? node.ownerDocument || node : preferredDoc;
1187
1188 // Return early if doc is invalid or already selected
1189 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1190 return document;
1191 }
1192
1193 // Update global variables
1194 document = doc;
1195 docElem = document.documentElement;
1196 documentIsHTML = !isXML( document );
1197
1198 // Support: IE 9-11, Edge
1199 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1200 if ( preferredDoc !== document &&
1201 (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
1202
1203 // Support: IE 11, Edge
1204 if ( subWindow.addEventListener ) {
1205 subWindow.addEventListener( "unload", unloadHandler, false );
1206
1207 // Support: IE 9 - 10 only
1208 } else if ( subWindow.attachEvent ) {
1209 subWindow.attachEvent( "onunload", unloadHandler );
1210 }
1211 }
1212
1213 /* Attributes
1214 ---------------------------------------------------------------------- */
1215
1216 // Support: IE<8
1217 // Verify that getAttribute really returns attributes and not properties
1218 // (excepting IE8 booleans)
1219 support.attributes = assert(function( el ) {
1220 el.className = "i";
1221 return !el.getAttribute("className");
1222 });
1223
1224 /* getElement(s)By*
1225 ---------------------------------------------------------------------- */
1226
1227 // Check if getElementsByTagName("*") returns only elements
1228 support.getElementsByTagName = assert(function( el ) {
1229 el.appendChild( document.createComment("") );
1230 return !el.getElementsByTagName("*").length;
1231 });
1232
1233 // Support: IE<9
1234 support.getElementsByClassName = rnative.test( document.getElementsByClassName );
1235
1236 // Support: IE<10
1237 // Check if getElementById returns elements by name
1238 // The broken getElementById methods don't pick up programmatically-set names,
1239 // so use a roundabout getElementsByName test
1240 support.getById = assert(function( el ) {
1241 docElem.appendChild( el ).id = expando;
1242 return !document.getElementsByName || !document.getElementsByName( expando ).length;
1243 });
1244
1245 // ID filter and find
1246 if ( support.getById ) {
1247 Expr.filter["ID"] = function( id ) {
1248 var attrId = id.replace( runescape, funescape );
1249 return function( elem ) {
1250 return elem.getAttribute("id") === attrId;
1251 };
1252 };
1253 Expr.find["ID"] = function( id, context ) {
1254 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1255 var elem = context.getElementById( id );
1256 return elem ? [ elem ] : [];
1257 }
1258 };
1259 } else {
1260 Expr.filter["ID"] = function( id ) {
1261 var attrId = id.replace( runescape, funescape );
1262 return function( elem ) {
1263 var node = typeof elem.getAttributeNode !== "undefined" &&
1264 elem.getAttributeNode("id");
1265 return node && node.value === attrId;
1266 };
1267 };
1268
1269 // Support: IE 6 - 7 only
1270 // getElementById is not reliable as a find shortcut
1271 Expr.find["ID"] = function( id, context ) {
1272 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1273 var node, i, elems,
1274 elem = context.getElementById( id );
1275
1276 if ( elem ) {
1277
1278 // Verify the id attribute
1279 node = elem.getAttributeNode("id");
1280 if ( node && node.value === id ) {
1281 return [ elem ];
1282 }
1283
1284 // Fall back on getElementsByName
1285 elems = context.getElementsByName( id );
1286 i = 0;
1287 while ( (elem = elems[i++]) ) {
1288 node = elem.getAttributeNode("id");
1289 if ( node && node.value === id ) {
1290 return [ elem ];
1291 }
1292 }
1293 }
1294
1295 return [];
1296 }
1297 };
1298 }
1299
1300 // Tag
1301 Expr.find["TAG"] = support.getElementsByTagName ?
1302 function( tag, context ) {
1303 if ( typeof context.getElementsByTagName !== "undefined" ) {
1304 return context.getElementsByTagName( tag );
1305
1306 // DocumentFragment nodes don't have gEBTN
1307 } else if ( support.qsa ) {
1308 return context.querySelectorAll( tag );
1309 }
1310 } :
1311
1312 function( tag, context ) {
1313 var elem,
1314 tmp = [],
1315 i = 0,
1316 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1317 results = context.getElementsByTagName( tag );
1318
1319 // Filter out possible comments
1320 if ( tag === "*" ) {
1321 while ( (elem = results[i++]) ) {
1322 if ( elem.nodeType === 1 ) {
1323 tmp.push( elem );
1324 }
1325 }
1326
1327 return tmp;
1328 }
1329 return results;
1330 };
1331
1332 // Class
1333 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1334 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
1335 return context.getElementsByClassName( className );
1336 }
1337 };
1338
1339 /* QSA/matchesSelector
1340 ---------------------------------------------------------------------- */
1341
1342 // QSA and matchesSelector support
1343
1344 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1345 rbuggyMatches = [];
1346
1347 // qSa(:focus) reports false when true (Chrome 21)
1348 // We allow this because of a bug in IE8/9 that throws an error
1349 // whenever `document.activeElement` is accessed on an iframe
1350 // So, we allow :focus to pass through QSA all the time to avoid the IE error
1351 // See https://bugs.jquery.com/ticket/13378
1352 rbuggyQSA = [];
1353
1354 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
1355 // Build QSA regex
1356 // Regex strategy adopted from Diego Perini
1357 assert(function( el ) {
1358 // Select is set to empty string on purpose
1359 // This is to test IE's treatment of not explicitly
1360 // setting a boolean content attribute,
1361 // since its presence should be enough
1362 // https://bugs.jquery.com/ticket/12359
1363 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
1364 "<select id='" + expando + "-\r\\' msallowcapture=''>" +
1365 "<option selected=''></option></select>";
1366
1367 // Support: IE8, Opera 11-12.16
1368 // Nothing should be selected when empty strings follow ^= or $= or *=
1369 // The test attribute must be unknown in Opera but "safe" for WinRT
1370 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1371 if ( el.querySelectorAll("[msallowcapture^='']").length ) {
1372 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1373 }
1374
1375 // Support: IE8
1376 // Boolean attributes and "value" are not treated correctly
1377 if ( !el.querySelectorAll("[selected]").length ) {
1378 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1379 }
1380
1381 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1382 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1383 rbuggyQSA.push("~=");
1384 }
1385
1386 // Webkit/Opera - :checked should return selected option elements
1387 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1388 // IE8 throws error here and will not see later tests
1389 if ( !el.querySelectorAll(":checked").length ) {
1390 rbuggyQSA.push(":checked");
1391 }
1392
1393 // Support: Safari 8+, iOS 8+
1394 // https://bugs.webkit.org/show_bug.cgi?id=136851
1395 // In-page `selector#id sibling-combinator selector` fails
1396 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
1397 rbuggyQSA.push(".#.+[+~]");
1398 }
1399 });
1400
1401 assert(function( el ) {
1402 el.innerHTML = "<a href='' disabled='disabled'></a>" +
1403 "<select disabled='disabled'><option/></select>";
1404
1405 // Support: Windows 8 Native Apps
1406 // The type and name attributes are restricted during .innerHTML assignment
1407 var input = document.createElement("input");
1408 input.setAttribute( "type", "hidden" );
1409 el.appendChild( input ).setAttribute( "name", "D" );
1410
1411 // Support: IE8
1412 // Enforce case-sensitivity of name attribute
1413 if ( el.querySelectorAll("[name=d]").length ) {
1414 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1415 }
1416
1417 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1418 // IE8 throws error here and will not see later tests
1419 if ( el.querySelectorAll(":enabled").length !== 2 ) {
1420 rbuggyQSA.push( ":enabled", ":disabled" );
1421 }
1422
1423 // Support: IE9-11+
1424 // IE's :disabled selector does not pick up the children of disabled fieldsets
1425 docElem.appendChild( el ).disabled = true;
1426 if ( el.querySelectorAll(":disabled").length !== 2 ) {
1427 rbuggyQSA.push( ":enabled", ":disabled" );
1428 }
1429
1430 // Opera 10-11 does not throw on post-comma invalid pseudos
1431 el.querySelectorAll("*,:x");
1432 rbuggyQSA.push(",.*:");
1433 });
1434 }
1435
1436 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1437 docElem.webkitMatchesSelector ||
1438 docElem.mozMatchesSelector ||
1439 docElem.oMatchesSelector ||
1440 docElem.msMatchesSelector) )) ) {
1441
1442 assert(function( el ) {
1443 // Check to see if it's possible to do matchesSelector
1444 // on a disconnected node (IE 9)
1445 support.disconnectedMatch = matches.call( el, "*" );
1446
1447 // This should fail with an exception
1448 // Gecko does not error, returns false instead
1449 matches.call( el, "[s!='']:x" );
1450 rbuggyMatches.push( "!=", pseudos );
1451 });
1452 }
1453
1454 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1455 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1456
1457 /* Contains
1458 ---------------------------------------------------------------------- */
1459 hasCompare = rnative.test( docElem.compareDocumentPosition );
1460
1461 // Element contains another
1462 // Purposefully self-exclusive
1463 // As in, an element does not contain itself
1464 contains = hasCompare || rnative.test( docElem.contains ) ?
1465 function( a, b ) {
1466 var adown = a.nodeType === 9 ? a.documentElement : a,
1467 bup = b && b.parentNode;
1468 return a === bup || !!( bup && bup.nodeType === 1 && (
1469 adown.contains ?
1470 adown.contains( bup ) :
1471 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1472 ));
1473 } :
1474 function( a, b ) {
1475 if ( b ) {
1476 while ( (b = b.parentNode) ) {
1477 if ( b === a ) {
1478 return true;
1479 }
1480 }
1481 }
1482 return false;
1483 };
1484
1485 /* Sorting
1486 ---------------------------------------------------------------------- */
1487
1488 // Document order sorting
1489 sortOrder = hasCompare ?
1490 function( a, b ) {
1491
1492 // Flag for duplicate removal
1493 if ( a === b ) {
1494 hasDuplicate = true;
1495 return 0;
1496 }
1497
1498 // Sort on method existence if only one input has compareDocumentPosition
1499 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1500 if ( compare ) {
1501 return compare;
1502 }
1503
1504 // Calculate position if both inputs belong to the same document
1505 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1506 a.compareDocumentPosition( b ) :
1507
1508 // Otherwise we know they are disconnected
1509 1;
1510
1511 // Disconnected nodes
1512 if ( compare & 1 ||
1513 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1514
1515 // Choose the first element that is related to our preferred document
1516 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1517 return -1;
1518 }
1519 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1520 return 1;
1521 }
1522
1523 // Maintain original order
1524 return sortInput ?
1525 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1526 0;
1527 }
1528
1529 return compare & 4 ? -1 : 1;
1530 } :
1531 function( a, b ) {
1532 // Exit early if the nodes are identical
1533 if ( a === b ) {
1534 hasDuplicate = true;
1535 return 0;
1536 }
1537
1538 var cur,
1539 i = 0,
1540 aup = a.parentNode,
1541 bup = b.parentNode,
1542 ap = [ a ],
1543 bp = [ b ];
1544
1545 // Parentless nodes are either documents or disconnected
1546 if ( !aup || !bup ) {
1547 return a === document ? -1 :
1548 b === document ? 1 :
1549 aup ? -1 :
1550 bup ? 1 :
1551 sortInput ?
1552 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1553 0;
1554
1555 // If the nodes are siblings, we can do a quick check
1556 } else if ( aup === bup ) {
1557 return siblingCheck( a, b );
1558 }
1559
1560 // Otherwise we need full lists of their ancestors for comparison
1561 cur = a;
1562 while ( (cur = cur.parentNode) ) {
1563 ap.unshift( cur );
1564 }
1565 cur = b;
1566 while ( (cur = cur.parentNode) ) {
1567 bp.unshift( cur );
1568 }
1569
1570 // Walk down the tree looking for a discrepancy
1571 while ( ap[i] === bp[i] ) {
1572 i++;
1573 }
1574
1575 return i ?
1576 // Do a sibling check if the nodes have a common ancestor
1577 siblingCheck( ap[i], bp[i] ) :
1578
1579 // Otherwise nodes in our document sort first
1580 ap[i] === preferredDoc ? -1 :
1581 bp[i] === preferredDoc ? 1 :
1582 0;
1583 };
1584
1585 return document;
1586};
1587
1588Sizzle.matches = function( expr, elements ) {
1589 return Sizzle( expr, null, null, elements );
1590};
1591
1592Sizzle.matchesSelector = function( elem, expr ) {
1593 // Set document vars if needed
1594 if ( ( elem.ownerDocument || elem ) !== document ) {
1595 setDocument( elem );
1596 }
1597
1598 if ( support.matchesSelector && documentIsHTML &&
1599 !nonnativeSelectorCache[ expr + " " ] &&
1600 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1601 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1602
1603 try {
1604 var ret = matches.call( elem, expr );
1605
1606 // IE 9's matchesSelector returns false on disconnected nodes
1607 if ( ret || support.disconnectedMatch ||
1608 // As well, disconnected nodes are said to be in a document
1609 // fragment in IE 9
1610 elem.document && elem.document.nodeType !== 11 ) {
1611 return ret;
1612 }
1613 } catch (e) {
1614 nonnativeSelectorCache( expr, true );
1615 }
1616 }
1617
1618 return Sizzle( expr, document, null, [ elem ] ).length > 0;
1619};
1620
1621Sizzle.contains = function( context, elem ) {
1622 // Set document vars if needed
1623 if ( ( context.ownerDocument || context ) !== document ) {
1624 setDocument( context );
1625 }
1626 return contains( context, elem );
1627};
1628
1629Sizzle.attr = function( elem, name ) {
1630 // Set document vars if needed
1631 if ( ( elem.ownerDocument || elem ) !== document ) {
1632 setDocument( elem );
1633 }
1634
1635 var fn = Expr.attrHandle[ name.toLowerCase() ],
1636 // Don't get fooled by Object.prototype properties (jQuery #13807)
1637 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1638 fn( elem, name, !documentIsHTML ) :
1639 undefined;
1640
1641 return val !== undefined ?
1642 val :
1643 support.attributes || !documentIsHTML ?
1644 elem.getAttribute( name ) :
1645 (val = elem.getAttributeNode(name)) && val.specified ?
1646 val.value :
1647 null;
1648};
1649
1650Sizzle.escape = function( sel ) {
1651 return (sel + "").replace( rcssescape, fcssescape );
1652};
1653
1654Sizzle.error = function( msg ) {
1655 throw new Error( "Syntax error, unrecognized expression: " + msg );
1656};
1657
1658/**
1659 * Document sorting and removing duplicates
1660 * @param {ArrayLike} results
1661 */
1662Sizzle.uniqueSort = function( results ) {
1663 var elem,
1664 duplicates = [],
1665 j = 0,
1666 i = 0;
1667
1668 // Unless we *know* we can detect duplicates, assume their presence
1669 hasDuplicate = !support.detectDuplicates;
1670 sortInput = !support.sortStable && results.slice( 0 );
1671 results.sort( sortOrder );
1672
1673 if ( hasDuplicate ) {
1674 while ( (elem = results[i++]) ) {
1675 if ( elem === results[ i ] ) {
1676 j = duplicates.push( i );
1677 }
1678 }
1679 while ( j-- ) {
1680 results.splice( duplicates[ j ], 1 );
1681 }
1682 }
1683
1684 // Clear input after sorting to release objects
1685 // See https://github.com/jquery/sizzle/pull/225
1686 sortInput = null;
1687
1688 return results;
1689};
1690
1691/**
1692 * Utility function for retrieving the text value of an array of DOM nodes
1693 * @param {Array|Element} elem
1694 */
1695getText = Sizzle.getText = function( elem ) {
1696 var node,
1697 ret = "",
1698 i = 0,
1699 nodeType = elem.nodeType;
1700
1701 if ( !nodeType ) {
1702 // If no nodeType, this is expected to be an array
1703 while ( (node = elem[i++]) ) {
1704 // Do not traverse comment nodes
1705 ret += getText( node );
1706 }
1707 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1708 // Use textContent for elements
1709 // innerText usage removed for consistency of new lines (jQuery #11153)
1710 if ( typeof elem.textContent === "string" ) {
1711 return elem.textContent;
1712 } else {
1713 // Traverse its children
1714 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1715 ret += getText( elem );
1716 }
1717 }
1718 } else if ( nodeType === 3 || nodeType === 4 ) {
1719 return elem.nodeValue;
1720 }
1721 // Do not include comment or processing instruction nodes
1722
1723 return ret;
1724};
1725
1726Expr = Sizzle.selectors = {
1727
1728 // Can be adjusted by the user
1729 cacheLength: 50,
1730
1731 createPseudo: markFunction,
1732
1733 match: matchExpr,
1734
1735 attrHandle: {},
1736
1737 find: {},
1738
1739 relative: {
1740 ">": { dir: "parentNode", first: true },
1741 " ": { dir: "parentNode" },
1742 "+": { dir: "previousSibling", first: true },
1743 "~": { dir: "previousSibling" }
1744 },
1745
1746 preFilter: {
1747 "ATTR": function( match ) {
1748 match[1] = match[1].replace( runescape, funescape );
1749
1750 // Move the given value to match[3] whether quoted or unquoted
1751 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1752
1753 if ( match[2] === "~=" ) {
1754 match[3] = " " + match[3] + " ";
1755 }
1756
1757 return match.slice( 0, 4 );
1758 },
1759
1760 "CHILD": function( match ) {
1761 /* matches from matchExpr["CHILD"]
1762 1 type (only|nth|...)
1763 2 what (child|of-type)
1764 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1765 4 xn-component of xn+y argument ([+-]?\d*n|)
1766 5 sign of xn-component
1767 6 x of xn-component
1768 7 sign of y-component
1769 8 y of y-component
1770 */
1771 match[1] = match[1].toLowerCase();
1772
1773 if ( match[1].slice( 0, 3 ) === "nth" ) {
1774 // nth-* requires argument
1775 if ( !match[3] ) {
1776 Sizzle.error( match[0] );
1777 }
1778
1779 // numeric x and y parameters for Expr.filter.CHILD
1780 // remember that false/true cast respectively to 0/1
1781 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1782 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1783
1784 // other types prohibit arguments
1785 } else if ( match[3] ) {
1786 Sizzle.error( match[0] );
1787 }
1788
1789 return match;
1790 },
1791
1792 "PSEUDO": function( match ) {
1793 var excess,
1794 unquoted = !match[6] && match[2];
1795
1796 if ( matchExpr["CHILD"].test( match[0] ) ) {
1797 return null;
1798 }
1799
1800 // Accept quoted arguments as-is
1801 if ( match[3] ) {
1802 match[2] = match[4] || match[5] || "";
1803
1804 // Strip excess characters from unquoted arguments
1805 } else if ( unquoted && rpseudo.test( unquoted ) &&
1806 // Get excess from tokenize (recursively)
1807 (excess = tokenize( unquoted, true )) &&
1808 // advance to the next closing parenthesis
1809 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1810
1811 // excess is a negative index
1812 match[0] = match[0].slice( 0, excess );
1813 match[2] = unquoted.slice( 0, excess );
1814 }
1815
1816 // Return only captures needed by the pseudo filter method (type and argument)
1817 return match.slice( 0, 3 );
1818 }
1819 },
1820
1821 filter: {
1822
1823 "TAG": function( nodeNameSelector ) {
1824 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1825 return nodeNameSelector === "*" ?
1826 function() { return true; } :
1827 function( elem ) {
1828 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1829 };
1830 },
1831
1832 "CLASS": function( className ) {
1833 var pattern = classCache[ className + " " ];
1834
1835 return pattern ||
1836 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1837 classCache( className, function( elem ) {
1838 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1839 });
1840 },
1841
1842 "ATTR": function( name, operator, check ) {
1843 return function( elem ) {
1844 var result = Sizzle.attr( elem, name );
1845
1846 if ( result == null ) {
1847 return operator === "!=";
1848 }
1849 if ( !operator ) {
1850 return true;
1851 }
1852
1853 result += "";
1854
1855 return operator === "=" ? result === check :
1856 operator === "!=" ? result !== check :
1857 operator === "^=" ? check && result.indexOf( check ) === 0 :
1858 operator === "*=" ? check && result.indexOf( check ) > -1 :
1859 operator === "$=" ? check && result.slice( -check.length ) === check :
1860 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1861 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1862 false;
1863 };
1864 },
1865
1866 "CHILD": function( type, what, argument, first, last ) {
1867 var simple = type.slice( 0, 3 ) !== "nth",
1868 forward = type.slice( -4 ) !== "last",
1869 ofType = what === "of-type";
1870
1871 return first === 1 && last === 0 ?
1872
1873 // Shortcut for :nth-*(n)
1874 function( elem ) {
1875 return !!elem.parentNode;
1876 } :
1877
1878 function( elem, context, xml ) {
1879 var cache, uniqueCache, outerCache, node, nodeIndex, start,
1880 dir = simple !== forward ? "nextSibling" : "previousSibling",
1881 parent = elem.parentNode,
1882 name = ofType && elem.nodeName.toLowerCase(),
1883 useCache = !xml && !ofType,
1884 diff = false;
1885
1886 if ( parent ) {
1887
1888 // :(first|last|only)-(child|of-type)
1889 if ( simple ) {
1890 while ( dir ) {
1891 node = elem;
1892 while ( (node = node[ dir ]) ) {
1893 if ( ofType ?
1894 node.nodeName.toLowerCase() === name :
1895 node.nodeType === 1 ) {
1896
1897 return false;
1898 }
1899 }
1900 // Reverse direction for :only-* (if we haven't yet done so)
1901 start = dir = type === "only" && !start && "nextSibling";
1902 }
1903 return true;
1904 }
1905
1906 start = [ forward ? parent.firstChild : parent.lastChild ];
1907
1908 // non-xml :nth-child(...) stores cache data on `parent`
1909 if ( forward && useCache ) {
1910
1911 // Seek `elem` from a previously-cached index
1912
1913 // ...in a gzip-friendly way
1914 node = parent;
1915 outerCache = node[ expando ] || (node[ expando ] = {});
1916
1917 // Support: IE <9 only
1918 // Defend against cloned attroperties (jQuery gh-1709)
1919 uniqueCache = outerCache[ node.uniqueID ] ||
1920 (outerCache[ node.uniqueID ] = {});
1921
1922 cache = uniqueCache[ type ] || [];
1923 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1924 diff = nodeIndex && cache[ 2 ];
1925 node = nodeIndex && parent.childNodes[ nodeIndex ];
1926
1927 while ( (node = ++nodeIndex && node && node[ dir ] ||
1928
1929 // Fallback to seeking `elem` from the start
1930 (diff = nodeIndex = 0) || start.pop()) ) {
1931
1932 // When found, cache indexes on `parent` and break
1933 if ( node.nodeType === 1 && ++diff && node === elem ) {
1934 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
1935 break;
1936 }
1937 }
1938
1939 } else {
1940 // Use previously-cached element index if available
1941 if ( useCache ) {
1942 // ...in a gzip-friendly way
1943 node = elem;
1944 outerCache = node[ expando ] || (node[ expando ] = {});
1945
1946 // Support: IE <9 only
1947 // Defend against cloned attroperties (jQuery gh-1709)
1948 uniqueCache = outerCache[ node.uniqueID ] ||
1949 (outerCache[ node.uniqueID ] = {});
1950
1951 cache = uniqueCache[ type ] || [];
1952 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1953 diff = nodeIndex;
1954 }
1955
1956 // xml :nth-child(...)
1957 // or :nth-last-child(...) or :nth(-last)?-of-type(...)
1958 if ( diff === false ) {
1959 // Use the same loop as above to seek `elem` from the start
1960 while ( (node = ++nodeIndex && node && node[ dir ] ||
1961 (diff = nodeIndex = 0) || start.pop()) ) {
1962
1963 if ( ( ofType ?
1964 node.nodeName.toLowerCase() === name :
1965 node.nodeType === 1 ) &&
1966 ++diff ) {
1967
1968 // Cache the index of each encountered element
1969 if ( useCache ) {
1970 outerCache = node[ expando ] || (node[ expando ] = {});
1971
1972 // Support: IE <9 only
1973 // Defend against cloned attroperties (jQuery gh-1709)
1974 uniqueCache = outerCache[ node.uniqueID ] ||
1975 (outerCache[ node.uniqueID ] = {});
1976
1977 uniqueCache[ type ] = [ dirruns, diff ];
1978 }
1979
1980 if ( node === elem ) {
1981 break;
1982 }
1983 }
1984 }
1985 }
1986 }
1987
1988 // Incorporate the offset, then check against cycle size
1989 diff -= last;
1990 return diff === first || ( diff % first === 0 && diff / first >= 0 );
1991 }
1992 };
1993 },
1994
1995 "PSEUDO": function( pseudo, argument ) {
1996 // pseudo-class names are case-insensitive
1997 // http://www.w3.org/TR/selectors/#pseudo-classes
1998 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1999 // Remember that setFilters inherits from pseudos
2000 var args,
2001 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
2002 Sizzle.error( "unsupported pseudo: " + pseudo );
2003
2004 // The user may use createPseudo to indicate that
2005 // arguments are needed to create the filter function
2006 // just as Sizzle does
2007 if ( fn[ expando ] ) {
2008 return fn( argument );
2009 }
2010
2011 // But maintain support for old signatures
2012 if ( fn.length > 1 ) {
2013 args = [ pseudo, pseudo, "", argument ];
2014 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
2015 markFunction(function( seed, matches ) {
2016 var idx,
2017 matched = fn( seed, argument ),
2018 i = matched.length;
2019 while ( i-- ) {
2020 idx = indexOf( seed, matched[i] );
2021 seed[ idx ] = !( matches[ idx ] = matched[i] );
2022 }
2023 }) :
2024 function( elem ) {
2025 return fn( elem, 0, args );
2026 };
2027 }
2028
2029 return fn;
2030 }
2031 },
2032
2033 pseudos: {
2034 // Potentially complex pseudos
2035 "not": markFunction(function( selector ) {
2036 // Trim the selector passed to compile
2037 // to avoid treating leading and trailing
2038 // spaces as combinators
2039 var input = [],
2040 results = [],
2041 matcher = compile( selector.replace( rtrim, "$1" ) );
2042
2043 return matcher[ expando ] ?
2044 markFunction(function( seed, matches, context, xml ) {
2045 var elem,
2046 unmatched = matcher( seed, null, xml, [] ),
2047 i = seed.length;
2048
2049 // Match elements unmatched by `matcher`
2050 while ( i-- ) {
2051 if ( (elem = unmatched[i]) ) {
2052 seed[i] = !(matches[i] = elem);
2053 }
2054 }
2055 }) :
2056 function( elem, context, xml ) {
2057 input[0] = elem;
2058 matcher( input, null, xml, results );
2059 // Don't keep the element (issue #299)
2060 input[0] = null;
2061 return !results.pop();
2062 };
2063 }),
2064
2065 "has": markFunction(function( selector ) {
2066 return function( elem ) {
2067 return Sizzle( selector, elem ).length > 0;
2068 };
2069 }),
2070
2071 "contains": markFunction(function( text ) {
2072 text = text.replace( runescape, funescape );
2073 return function( elem ) {
2074 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
2075 };
2076 }),
2077
2078 // "Whether an element is represented by a :lang() selector
2079 // is based solely on the element's language value
2080 // being equal to the identifier C,
2081 // or beginning with the identifier C immediately followed by "-".
2082 // The matching of C against the element's language value is performed case-insensitively.
2083 // The identifier C does not have to be a valid language name."
2084 // http://www.w3.org/TR/selectors/#lang-pseudo
2085 "lang": markFunction( function( lang ) {
2086 // lang value must be a valid identifier
2087 if ( !ridentifier.test(lang || "") ) {
2088 Sizzle.error( "unsupported lang: " + lang );
2089 }
2090 lang = lang.replace( runescape, funescape ).toLowerCase();
2091 return function( elem ) {
2092 var elemLang;
2093 do {
2094 if ( (elemLang = documentIsHTML ?
2095 elem.lang :
2096 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
2097
2098 elemLang = elemLang.toLowerCase();
2099 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
2100 }
2101 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
2102 return false;
2103 };
2104 }),
2105
2106 // Miscellaneous
2107 "target": function( elem ) {
2108 var hash = window.location && window.location.hash;
2109 return hash && hash.slice( 1 ) === elem.id;
2110 },
2111
2112 "root": function( elem ) {
2113 return elem === docElem;
2114 },
2115
2116 "focus": function( elem ) {
2117 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
2118 },
2119
2120 // Boolean properties
2121 "enabled": createDisabledPseudo( false ),
2122 "disabled": createDisabledPseudo( true ),
2123
2124 "checked": function( elem ) {
2125 // In CSS3, :checked should return both checked and selected elements
2126 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2127 var nodeName = elem.nodeName.toLowerCase();
2128 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
2129 },
2130
2131 "selected": function( elem ) {
2132 // Accessing this property makes selected-by-default
2133 // options in Safari work properly
2134 if ( elem.parentNode ) {
2135 elem.parentNode.selectedIndex;
2136 }
2137
2138 return elem.selected === true;
2139 },
2140
2141 // Contents
2142 "empty": function( elem ) {
2143 // http://www.w3.org/TR/selectors/#empty-pseudo
2144 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
2145 // but not by others (comment: 8; processing instruction: 7; etc.)
2146 // nodeType < 6 works because attributes (2) do not appear as children
2147 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2148 if ( elem.nodeType < 6 ) {
2149 return false;
2150 }
2151 }
2152 return true;
2153 },
2154
2155 "parent": function( elem ) {
2156 return !Expr.pseudos["empty"]( elem );
2157 },
2158
2159 // Element/input types
2160 "header": function( elem ) {
2161 return rheader.test( elem.nodeName );
2162 },
2163
2164 "input": function( elem ) {
2165 return rinputs.test( elem.nodeName );
2166 },
2167
2168 "button": function( elem ) {
2169 var name = elem.nodeName.toLowerCase();
2170 return name === "input" && elem.type === "button" || name === "button";
2171 },
2172
2173 "text": function( elem ) {
2174 var attr;
2175 return elem.nodeName.toLowerCase() === "input" &&
2176 elem.type === "text" &&
2177
2178 // Support: IE<8
2179 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2180 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
2181 },
2182
2183 // Position-in-collection
2184 "first": createPositionalPseudo(function() {
2185 return [ 0 ];
2186 }),
2187
2188 "last": createPositionalPseudo(function( matchIndexes, length ) {
2189 return [ length - 1 ];
2190 }),
2191
2192 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2193 return [ argument < 0 ? argument + length : argument ];
2194 }),
2195
2196 "even": createPositionalPseudo(function( matchIndexes, length ) {
2197 var i = 0;
2198 for ( ; i < length; i += 2 ) {
2199 matchIndexes.push( i );
2200 }
2201 return matchIndexes;
2202 }),
2203
2204 "odd": createPositionalPseudo(function( matchIndexes, length ) {
2205 var i = 1;
2206 for ( ; i < length; i += 2 ) {
2207 matchIndexes.push( i );
2208 }
2209 return matchIndexes;
2210 }),
2211
2212 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2213 var i = argument < 0 ?
2214 argument + length :
2215 argument > length ?
2216 length :
2217 argument;
2218 for ( ; --i >= 0; ) {
2219 matchIndexes.push( i );
2220 }
2221 return matchIndexes;
2222 }),
2223
2224 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2225 var i = argument < 0 ? argument + length : argument;
2226 for ( ; ++i < length; ) {
2227 matchIndexes.push( i );
2228 }
2229 return matchIndexes;
2230 })
2231 }
2232};
2233
2234Expr.pseudos["nth"] = Expr.pseudos["eq"];
2235
2236// Add button/input type pseudos
2237for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2238 Expr.pseudos[ i ] = createInputPseudo( i );
2239}
2240for ( i in { submit: true, reset: true } ) {
2241 Expr.pseudos[ i ] = createButtonPseudo( i );
2242}
2243
2244// Easy API for creating new setFilters
2245function setFilters() {}
2246setFilters.prototype = Expr.filters = Expr.pseudos;
2247Expr.setFilters = new setFilters();
2248
2249tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2250 var matched, match, tokens, type,
2251 soFar, groups, preFilters,
2252 cached = tokenCache[ selector + " " ];
2253
2254 if ( cached ) {
2255 return parseOnly ? 0 : cached.slice( 0 );
2256 }
2257
2258 soFar = selector;
2259 groups = [];
2260 preFilters = Expr.preFilter;
2261
2262 while ( soFar ) {
2263
2264 // Comma and first run
2265 if ( !matched || (match = rcomma.exec( soFar )) ) {
2266 if ( match ) {
2267 // Don't consume trailing commas as valid
2268 soFar = soFar.slice( match[0].length ) || soFar;
2269 }
2270 groups.push( (tokens = []) );
2271 }
2272
2273 matched = false;
2274
2275 // Combinators
2276 if ( (match = rcombinators.exec( soFar )) ) {
2277 matched = match.shift();
2278 tokens.push({
2279 value: matched,
2280 // Cast descendant combinators to space
2281 type: match[0].replace( rtrim, " " )
2282 });
2283 soFar = soFar.slice( matched.length );
2284 }
2285
2286 // Filters
2287 for ( type in Expr.filter ) {
2288 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2289 (match = preFilters[ type ]( match ))) ) {
2290 matched = match.shift();
2291 tokens.push({
2292 value: matched,
2293 type: type,
2294 matches: match
2295 });
2296 soFar = soFar.slice( matched.length );
2297 }
2298 }
2299
2300 if ( !matched ) {
2301 break;
2302 }
2303 }
2304
2305 // Return the length of the invalid excess
2306 // if we're just parsing
2307 // Otherwise, throw an error or return tokens
2308 return parseOnly ?
2309 soFar.length :
2310 soFar ?
2311 Sizzle.error( selector ) :
2312 // Cache the tokens
2313 tokenCache( selector, groups ).slice( 0 );
2314};
2315
2316function toSelector( tokens ) {
2317 var i = 0,
2318 len = tokens.length,
2319 selector = "";
2320 for ( ; i < len; i++ ) {
2321 selector += tokens[i].value;
2322 }
2323 return selector;
2324}
2325
2326function addCombinator( matcher, combinator, base ) {
2327 var dir = combinator.dir,
2328 skip = combinator.next,
2329 key = skip || dir,
2330 checkNonElements = base && key === "parentNode",
2331 doneName = done++;
2332
2333 return combinator.first ?
2334 // Check against closest ancestor/preceding element
2335 function( elem, context, xml ) {
2336 while ( (elem = elem[ dir ]) ) {
2337 if ( elem.nodeType === 1 || checkNonElements ) {
2338 return matcher( elem, context, xml );
2339 }
2340 }
2341 return false;
2342 } :
2343
2344 // Check against all ancestor/preceding elements
2345 function( elem, context, xml ) {
2346 var oldCache, uniqueCache, outerCache,
2347 newCache = [ dirruns, doneName ];
2348
2349 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2350 if ( xml ) {
2351 while ( (elem = elem[ dir ]) ) {
2352 if ( elem.nodeType === 1 || checkNonElements ) {
2353 if ( matcher( elem, context, xml ) ) {
2354 return true;
2355 }
2356 }
2357 }
2358 } else {
2359 while ( (elem = elem[ dir ]) ) {
2360 if ( elem.nodeType === 1 || checkNonElements ) {
2361 outerCache = elem[ expando ] || (elem[ expando ] = {});
2362
2363 // Support: IE <9 only
2364 // Defend against cloned attroperties (jQuery gh-1709)
2365 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
2366
2367 if ( skip && skip === elem.nodeName.toLowerCase() ) {
2368 elem = elem[ dir ] || elem;
2369 } else if ( (oldCache = uniqueCache[ key ]) &&
2370 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2371
2372 // Assign to newCache so results back-propagate to previous elements
2373 return (newCache[ 2 ] = oldCache[ 2 ]);
2374 } else {
2375 // Reuse newcache so results back-propagate to previous elements
2376 uniqueCache[ key ] = newCache;
2377
2378 // A match means we're done; a fail means we have to keep checking
2379 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2380 return true;
2381 }
2382 }
2383 }
2384 }
2385 }
2386 return false;
2387 };
2388}
2389
2390function elementMatcher( matchers ) {
2391 return matchers.length > 1 ?
2392 function( elem, context, xml ) {
2393 var i = matchers.length;
2394 while ( i-- ) {
2395 if ( !matchers[i]( elem, context, xml ) ) {
2396 return false;
2397 }
2398 }
2399 return true;
2400 } :
2401 matchers[0];
2402}
2403
2404function multipleContexts( selector, contexts, results ) {
2405 var i = 0,
2406 len = contexts.length;
2407 for ( ; i < len; i++ ) {
2408 Sizzle( selector, contexts[i], results );
2409 }
2410 return results;
2411}
2412
2413function condense( unmatched, map, filter, context, xml ) {
2414 var elem,
2415 newUnmatched = [],
2416 i = 0,
2417 len = unmatched.length,
2418 mapped = map != null;
2419
2420 for ( ; i < len; i++ ) {
2421 if ( (elem = unmatched[i]) ) {
2422 if ( !filter || filter( elem, context, xml ) ) {
2423 newUnmatched.push( elem );
2424 if ( mapped ) {
2425 map.push( i );
2426 }
2427 }
2428 }
2429 }
2430
2431 return newUnmatched;
2432}
2433
2434function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2435 if ( postFilter && !postFilter[ expando ] ) {
2436 postFilter = setMatcher( postFilter );
2437 }
2438 if ( postFinder && !postFinder[ expando ] ) {
2439 postFinder = setMatcher( postFinder, postSelector );
2440 }
2441 return markFunction(function( seed, results, context, xml ) {
2442 var temp, i, elem,
2443 preMap = [],
2444 postMap = [],
2445 preexisting = results.length,
2446
2447 // Get initial elements from seed or context
2448 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2449
2450 // Prefilter to get matcher input, preserving a map for seed-results synchronization
2451 matcherIn = preFilter && ( seed || !selector ) ?
2452 condense( elems, preMap, preFilter, context, xml ) :
2453 elems,
2454
2455 matcherOut = matcher ?
2456 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2457 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2458
2459 // ...intermediate processing is necessary
2460 [] :
2461
2462 // ...otherwise use results directly
2463 results :
2464 matcherIn;
2465
2466 // Find primary matches
2467 if ( matcher ) {
2468 matcher( matcherIn, matcherOut, context, xml );
2469 }
2470
2471 // Apply postFilter
2472 if ( postFilter ) {
2473 temp = condense( matcherOut, postMap );
2474 postFilter( temp, [], context, xml );
2475
2476 // Un-match failing elements by moving them back to matcherIn
2477 i = temp.length;
2478 while ( i-- ) {
2479 if ( (elem = temp[i]) ) {
2480 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2481 }
2482 }
2483 }
2484
2485 if ( seed ) {
2486 if ( postFinder || preFilter ) {
2487 if ( postFinder ) {
2488 // Get the final matcherOut by condensing this intermediate into postFinder contexts
2489 temp = [];
2490 i = matcherOut.length;
2491 while ( i-- ) {
2492 if ( (elem = matcherOut[i]) ) {
2493 // Restore matcherIn since elem is not yet a final match
2494 temp.push( (matcherIn[i] = elem) );
2495 }
2496 }
2497 postFinder( null, (matcherOut = []), temp, xml );
2498 }
2499
2500 // Move matched elements from seed to results to keep them synchronized
2501 i = matcherOut.length;
2502 while ( i-- ) {
2503 if ( (elem = matcherOut[i]) &&
2504 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2505
2506 seed[temp] = !(results[temp] = elem);
2507 }
2508 }
2509 }
2510
2511 // Add elements to results, through postFinder if defined
2512 } else {
2513 matcherOut = condense(
2514 matcherOut === results ?
2515 matcherOut.splice( preexisting, matcherOut.length ) :
2516 matcherOut
2517 );
2518 if ( postFinder ) {
2519 postFinder( null, results, matcherOut, xml );
2520 } else {
2521 push.apply( results, matcherOut );
2522 }
2523 }
2524 });
2525}
2526
2527function matcherFromTokens( tokens ) {
2528 var checkContext, matcher, j,
2529 len = tokens.length,
2530 leadingRelative = Expr.relative[ tokens[0].type ],
2531 implicitRelative = leadingRelative || Expr.relative[" "],
2532 i = leadingRelative ? 1 : 0,
2533
2534 // The foundational matcher ensures that elements are reachable from top-level context(s)
2535 matchContext = addCombinator( function( elem ) {
2536 return elem === checkContext;
2537 }, implicitRelative, true ),
2538 matchAnyContext = addCombinator( function( elem ) {
2539 return indexOf( checkContext, elem ) > -1;
2540 }, implicitRelative, true ),
2541 matchers = [ function( elem, context, xml ) {
2542 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2543 (checkContext = context).nodeType ?
2544 matchContext( elem, context, xml ) :
2545 matchAnyContext( elem, context, xml ) );
2546 // Avoid hanging onto element (issue #299)
2547 checkContext = null;
2548 return ret;
2549 } ];
2550
2551 for ( ; i < len; i++ ) {
2552 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2553 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2554 } else {
2555 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2556
2557 // Return special upon seeing a positional matcher
2558 if ( matcher[ expando ] ) {
2559 // Find the next relative operator (if any) for proper handling
2560 j = ++i;
2561 for ( ; j < len; j++ ) {
2562 if ( Expr.relative[ tokens[j].type ] ) {
2563 break;
2564 }
2565 }
2566 return setMatcher(
2567 i > 1 && elementMatcher( matchers ),
2568 i > 1 && toSelector(
2569 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2570 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2571 ).replace( rtrim, "$1" ),
2572 matcher,
2573 i < j && matcherFromTokens( tokens.slice( i, j ) ),
2574 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2575 j < len && toSelector( tokens )
2576 );
2577 }
2578 matchers.push( matcher );
2579 }
2580 }
2581
2582 return elementMatcher( matchers );
2583}
2584
2585function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2586 var bySet = setMatchers.length > 0,
2587 byElement = elementMatchers.length > 0,
2588 superMatcher = function( seed, context, xml, results, outermost ) {
2589 var elem, j, matcher,
2590 matchedCount = 0,
2591 i = "0",
2592 unmatched = seed && [],
2593 setMatched = [],
2594 contextBackup = outermostContext,
2595 // We must always have either seed elements or outermost context
2596 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2597 // Use integer dirruns iff this is the outermost matcher
2598 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2599 len = elems.length;
2600
2601 if ( outermost ) {
2602 outermostContext = context === document || context || outermost;
2603 }
2604
2605 // Add elements passing elementMatchers directly to results
2606 // Support: IE<9, Safari
2607 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2608 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2609 if ( byElement && elem ) {
2610 j = 0;
2611 if ( !context && elem.ownerDocument !== document ) {
2612 setDocument( elem );
2613 xml = !documentIsHTML;
2614 }
2615 while ( (matcher = elementMatchers[j++]) ) {
2616 if ( matcher( elem, context || document, xml) ) {
2617 results.push( elem );
2618 break;
2619 }
2620 }
2621 if ( outermost ) {
2622 dirruns = dirrunsUnique;
2623 }
2624 }
2625
2626 // Track unmatched elements for set filters
2627 if ( bySet ) {
2628 // They will have gone through all possible matchers
2629 if ( (elem = !matcher && elem) ) {
2630 matchedCount--;
2631 }
2632
2633 // Lengthen the array for every element, matched or not
2634 if ( seed ) {
2635 unmatched.push( elem );
2636 }
2637 }
2638 }
2639
2640 // `i` is now the count of elements visited above, and adding it to `matchedCount`
2641 // makes the latter nonnegative.
2642 matchedCount += i;
2643
2644 // Apply set filters to unmatched elements
2645 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
2646 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
2647 // no element matchers and no seed.
2648 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
2649 // case, which will result in a "00" `matchedCount` that differs from `i` but is also
2650 // numerically zero.
2651 if ( bySet && i !== matchedCount ) {
2652 j = 0;
2653 while ( (matcher = setMatchers[j++]) ) {
2654 matcher( unmatched, setMatched, context, xml );
2655 }
2656
2657 if ( seed ) {
2658 // Reintegrate element matches to eliminate the need for sorting
2659 if ( matchedCount > 0 ) {
2660 while ( i-- ) {
2661 if ( !(unmatched[i] || setMatched[i]) ) {
2662 setMatched[i] = pop.call( results );
2663 }
2664 }
2665 }
2666
2667 // Discard index placeholder values to get only actual matches
2668 setMatched = condense( setMatched );
2669 }
2670
2671 // Add matches to results
2672 push.apply( results, setMatched );
2673
2674 // Seedless set matches succeeding multiple successful matchers stipulate sorting
2675 if ( outermost && !seed && setMatched.length > 0 &&
2676 ( matchedCount + setMatchers.length ) > 1 ) {
2677
2678 Sizzle.uniqueSort( results );
2679 }
2680 }
2681
2682 // Override manipulation of globals by nested matchers
2683 if ( outermost ) {
2684 dirruns = dirrunsUnique;
2685 outermostContext = contextBackup;
2686 }
2687
2688 return unmatched;
2689 };
2690
2691 return bySet ?
2692 markFunction( superMatcher ) :
2693 superMatcher;
2694}
2695
2696compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2697 var i,
2698 setMatchers = [],
2699 elementMatchers = [],
2700 cached = compilerCache[ selector + " " ];
2701
2702 if ( !cached ) {
2703 // Generate a function of recursive functions that can be used to check each element
2704 if ( !match ) {
2705 match = tokenize( selector );
2706 }
2707 i = match.length;
2708 while ( i-- ) {
2709 cached = matcherFromTokens( match[i] );
2710 if ( cached[ expando ] ) {
2711 setMatchers.push( cached );
2712 } else {
2713 elementMatchers.push( cached );
2714 }
2715 }
2716
2717 // Cache the compiled function
2718 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2719
2720 // Save selector and tokenization
2721 cached.selector = selector;
2722 }
2723 return cached;
2724};
2725
2726/**
2727 * A low-level selection function that works with Sizzle's compiled
2728 * selector functions
2729 * @param {String|Function} selector A selector or a pre-compiled
2730 * selector function built with Sizzle.compile
2731 * @param {Element} context
2732 * @param {Array} [results]
2733 * @param {Array} [seed] A set of elements to match against
2734 */
2735select = Sizzle.select = function( selector, context, results, seed ) {
2736 var i, tokens, token, type, find,
2737 compiled = typeof selector === "function" && selector,
2738 match = !seed && tokenize( (selector = compiled.selector || selector) );
2739
2740 results = results || [];
2741
2742 // Try to minimize operations if there is only one selector in the list and no seed
2743 // (the latter of which guarantees us context)
2744 if ( match.length === 1 ) {
2745
2746 // Reduce context if the leading compound selector is an ID
2747 tokens = match[0] = match[0].slice( 0 );
2748 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2749 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
2750
2751 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2752 if ( !context ) {
2753 return results;
2754
2755 // Precompiled matchers will still verify ancestry, so step up a level
2756 } else if ( compiled ) {
2757 context = context.parentNode;
2758 }
2759
2760 selector = selector.slice( tokens.shift().value.length );
2761 }
2762
2763 // Fetch a seed set for right-to-left matching
2764 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2765 while ( i-- ) {
2766 token = tokens[i];
2767
2768 // Abort if we hit a combinator
2769 if ( Expr.relative[ (type = token.type) ] ) {
2770 break;
2771 }
2772 if ( (find = Expr.find[ type ]) ) {
2773 // Search, expanding context for leading sibling combinators
2774 if ( (seed = find(
2775 token.matches[0].replace( runescape, funescape ),
2776 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2777 )) ) {
2778
2779 // If seed is empty or no tokens remain, we can return early
2780 tokens.splice( i, 1 );
2781 selector = seed.length && toSelector( tokens );
2782 if ( !selector ) {
2783 push.apply( results, seed );
2784 return results;
2785 }
2786
2787 break;
2788 }
2789 }
2790 }
2791 }
2792
2793 // Compile and execute a filtering function if one is not provided
2794 // Provide `match` to avoid retokenization if we modified the selector above
2795 ( compiled || compile( selector, match ) )(
2796 seed,
2797 context,
2798 !documentIsHTML,
2799 results,
2800 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
2801 );
2802 return results;
2803};
2804
2805// One-time assignments
2806
2807// Sort stability
2808support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2809
2810// Support: Chrome 14-35+
2811// Always assume duplicates if they aren't passed to the comparison function
2812support.detectDuplicates = !!hasDuplicate;
2813
2814// Initialize against the default document
2815setDocument();
2816
2817// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2818// Detached nodes confoundingly follow *each other*
2819support.sortDetached = assert(function( el ) {
2820 // Should return 1, but returns 4 (following)
2821 return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
2822});
2823
2824// Support: IE<8
2825// Prevent attribute/property "interpolation"
2826// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2827if ( !assert(function( el ) {
2828 el.innerHTML = "<a href='#'></a>";
2829 return el.firstChild.getAttribute("href") === "#" ;
2830}) ) {
2831 addHandle( "type|href|height|width", function( elem, name, isXML ) {
2832 if ( !isXML ) {
2833 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2834 }
2835 });
2836}
2837
2838// Support: IE<9
2839// Use defaultValue in place of getAttribute("value")
2840if ( !support.attributes || !assert(function( el ) {
2841 el.innerHTML = "<input/>";
2842 el.firstChild.setAttribute( "value", "" );
2843 return el.firstChild.getAttribute( "value" ) === "";
2844}) ) {
2845 addHandle( "value", function( elem, name, isXML ) {
2846 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2847 return elem.defaultValue;
2848 }
2849 });
2850}
2851
2852// Support: IE<9
2853// Use getAttributeNode to fetch booleans when getAttribute lies
2854if ( !assert(function( el ) {
2855 return el.getAttribute("disabled") == null;
2856}) ) {
2857 addHandle( booleans, function( elem, name, isXML ) {
2858 var val;
2859 if ( !isXML ) {
2860 return elem[ name ] === true ? name.toLowerCase() :
2861 (val = elem.getAttributeNode( name )) && val.specified ?
2862 val.value :
2863 null;
2864 }
2865 });
2866}
2867
2868return Sizzle;
2869
2870})( window );
2871
2872
2873
2874jQuery.find = Sizzle;
2875jQuery.expr = Sizzle.selectors;
2876
2877// Deprecated
2878jQuery.expr[ ":" ] = jQuery.expr.pseudos;
2879jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
2880jQuery.text = Sizzle.getText;
2881jQuery.isXMLDoc = Sizzle.isXML;
2882jQuery.contains = Sizzle.contains;
2883jQuery.escapeSelector = Sizzle.escape;
2884
2885
2886
2887
2888var dir = function( elem, dir, until ) {
2889 var matched = [],
2890 truncate = until !== undefined;
2891
2892 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
2893 if ( elem.nodeType === 1 ) {
2894 if ( truncate && jQuery( elem ).is( until ) ) {
2895 break;
2896 }
2897 matched.push( elem );
2898 }
2899 }
2900 return matched;
2901};
2902
2903
2904var siblings = function( n, elem ) {
2905 var matched = [];
2906
2907 for ( ; n; n = n.nextSibling ) {
2908 if ( n.nodeType === 1 && n !== elem ) {
2909 matched.push( n );
2910 }
2911 }
2912
2913 return matched;
2914};
2915
2916
2917var rneedsContext = jQuery.expr.match.needsContext;
2918
2919
2920
2921function nodeName( elem, name ) {
2922
2923 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
2924
2925};
2926var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
2927
2928
2929
2930// Implement the identical functionality for filter and not
2931function winnow( elements, qualifier, not ) {
2932 if ( isFunction( qualifier ) ) {
2933 return jQuery.grep( elements, function( elem, i ) {
2934 return !!qualifier.call( elem, i, elem ) !== not;
2935 } );
2936 }
2937
2938 // Single element
2939 if ( qualifier.nodeType ) {
2940 return jQuery.grep( elements, function( elem ) {
2941 return ( elem === qualifier ) !== not;
2942 } );
2943 }
2944
2945 // Arraylike of elements (jQuery, arguments, Array)
2946 if ( typeof qualifier !== "string" ) {
2947 return jQuery.grep( elements, function( elem ) {
2948 return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
2949 } );
2950 }
2951
2952 // Filtered directly for both simple and complex selectors
2953 return jQuery.filter( qualifier, elements, not );
2954}
2955
2956jQuery.filter = function( expr, elems, not ) {
2957 var elem = elems[ 0 ];
2958
2959 if ( not ) {
2960 expr = ":not(" + expr + ")";
2961 }
2962
2963 if ( elems.length === 1 && elem.nodeType === 1 ) {
2964 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
2965 }
2966
2967 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2968 return elem.nodeType === 1;
2969 } ) );
2970};
2971
2972jQuery.fn.extend( {
2973 find: function( selector ) {
2974 var i, ret,
2975 len = this.length,
2976 self = this;
2977
2978 if ( typeof selector !== "string" ) {
2979 return this.pushStack( jQuery( selector ).filter( function() {
2980 for ( i = 0; i < len; i++ ) {
2981 if ( jQuery.contains( self[ i ], this ) ) {
2982 return true;
2983 }
2984 }
2985 } ) );
2986 }
2987
2988 ret = this.pushStack( [] );
2989
2990 for ( i = 0; i < len; i++ ) {
2991 jQuery.find( selector, self[ i ], ret );
2992 }
2993
2994 return len > 1 ? jQuery.uniqueSort( ret ) : ret;
2995 },
2996 filter: function( selector ) {
2997 return this.pushStack( winnow( this, selector || [], false ) );
2998 },
2999 not: function( selector ) {
3000 return this.pushStack( winnow( this, selector || [], true ) );
3001 },
3002 is: function( selector ) {
3003 return !!winnow(
3004 this,
3005
3006 // If this is a positional/relative selector, check membership in the returned set
3007 // so $("p:first").is("p:last") won't return true for a doc with two "p".
3008 typeof selector === "string" && rneedsContext.test( selector ) ?
3009 jQuery( selector ) :
3010 selector || [],
3011 false
3012 ).length;
3013 }
3014} );
3015
3016
3017// Initialize a jQuery object
3018
3019
3020// A central reference to the root jQuery(document)
3021var rootjQuery,
3022
3023 // A simple way to check for HTML strings
3024 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
3025 // Strict HTML recognition (#11290: must start with <)
3026 // Shortcut simple #id case for speed
3027 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
3028
3029 init = jQuery.fn.init = function( selector, context, root ) {
3030 var match, elem;
3031
3032 // HANDLE: $(""), $(null), $(undefined), $(false)
3033 if ( !selector ) {
3034 return this;
3035 }
3036
3037 // Method init() accepts an alternate rootjQuery
3038 // so migrate can support jQuery.sub (gh-2101)
3039 root = root || rootjQuery;
3040
3041 // Handle HTML strings
3042 if ( typeof selector === "string" ) {
3043 if ( selector[ 0 ] === "<" &&
3044 selector[ selector.length - 1 ] === ">" &&
3045 selector.length >= 3 ) {
3046
3047 // Assume that strings that start and end with <> are HTML and skip the regex check
3048 match = [ null, selector, null ];
3049
3050 } else {
3051 match = rquickExpr.exec( selector );
3052 }
3053
3054 // Match html or make sure no context is specified for #id
3055 if ( match && ( match[ 1 ] || !context ) ) {
3056
3057 // HANDLE: $(html) -> $(array)
3058 if ( match[ 1 ] ) {
3059 context = context instanceof jQuery ? context[ 0 ] : context;
3060
3061 // Option to run scripts is true for back-compat
3062 // Intentionally let the error be thrown if parseHTML is not present
3063 jQuery.merge( this, jQuery.parseHTML(
3064 match[ 1 ],
3065 context && context.nodeType ? context.ownerDocument || context : document,
3066 true
3067 ) );
3068
3069 // HANDLE: $(html, props)
3070 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
3071 for ( match in context ) {
3072
3073 // Properties of context are called as methods if possible
3074 if ( isFunction( this[ match ] ) ) {
3075 this[ match ]( context[ match ] );
3076
3077 // ...and otherwise set as attributes
3078 } else {
3079 this.attr( match, context[ match ] );
3080 }
3081 }
3082 }
3083
3084 return this;
3085
3086 // HANDLE: $(#id)
3087 } else {
3088 elem = document.getElementById( match[ 2 ] );
3089
3090 if ( elem ) {
3091
3092 // Inject the element directly into the jQuery object
3093 this[ 0 ] = elem;
3094 this.length = 1;
3095 }
3096 return this;
3097 }
3098
3099 // HANDLE: $(expr, $(...))
3100 } else if ( !context || context.jquery ) {
3101 return ( context || root ).find( selector );
3102
3103 // HANDLE: $(expr, context)
3104 // (which is just equivalent to: $(context).find(expr)
3105 } else {
3106 return this.constructor( context ).find( selector );
3107 }
3108
3109 // HANDLE: $(DOMElement)
3110 } else if ( selector.nodeType ) {
3111 this[ 0 ] = selector;
3112 this.length = 1;
3113 return this;
3114
3115 // HANDLE: $(function)
3116 // Shortcut for document ready
3117 } else if ( isFunction( selector ) ) {
3118 return root.ready !== undefined ?
3119 root.ready( selector ) :
3120
3121 // Execute immediately if ready is not present
3122 selector( jQuery );
3123 }
3124
3125 return jQuery.makeArray( selector, this );
3126 };
3127
3128// Give the init function the jQuery prototype for later instantiation
3129init.prototype = jQuery.fn;
3130
3131// Initialize central reference
3132rootjQuery = jQuery( document );
3133
3134
3135var rparentsprev = /^(?:parents|prev(?:Until|All))/,
3136
3137 // Methods guaranteed to produce a unique set when starting from a unique set
3138 guaranteedUnique = {
3139 children: true,
3140 contents: true,
3141 next: true,
3142 prev: true
3143 };
3144
3145jQuery.fn.extend( {
3146 has: function( target ) {
3147 var targets = jQuery( target, this ),
3148 l = targets.length;
3149
3150 return this.filter( function() {
3151 var i = 0;
3152 for ( ; i < l; i++ ) {
3153 if ( jQuery.contains( this, targets[ i ] ) ) {
3154 return true;
3155 }
3156 }
3157 } );
3158 },
3159
3160 closest: function( selectors, context ) {
3161 var cur,
3162 i = 0,
3163 l = this.length,
3164 matched = [],
3165 targets = typeof selectors !== "string" && jQuery( selectors );
3166
3167 // Positional selectors never match, since there's no _selection_ context
3168 if ( !rneedsContext.test( selectors ) ) {
3169 for ( ; i < l; i++ ) {
3170 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
3171
3172 // Always skip document fragments
3173 if ( cur.nodeType < 11 && ( targets ?
3174 targets.index( cur ) > -1 :
3175
3176 // Don't pass non-elements to Sizzle
3177 cur.nodeType === 1 &&
3178 jQuery.find.matchesSelector( cur, selectors ) ) ) {
3179
3180 matched.push( cur );
3181 break;
3182 }
3183 }
3184 }
3185 }
3186
3187 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
3188 },
3189
3190 // Determine the position of an element within the set
3191 index: function( elem ) {
3192
3193 // No argument, return index in parent
3194 if ( !elem ) {
3195 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
3196 }
3197
3198 // Index in selector
3199 if ( typeof elem === "string" ) {
3200 return indexOf.call( jQuery( elem ), this[ 0 ] );
3201 }
3202
3203 // Locate the position of the desired element
3204 return indexOf.call( this,
3205
3206 // If it receives a jQuery object, the first element is used
3207 elem.jquery ? elem[ 0 ] : elem
3208 );
3209 },
3210
3211 add: function( selector, context ) {
3212 return this.pushStack(
3213 jQuery.uniqueSort(
3214 jQuery.merge( this.get(), jQuery( selector, context ) )
3215 )
3216 );
3217 },
3218
3219 addBack: function( selector ) {
3220 return this.add( selector == null ?
3221 this.prevObject : this.prevObject.filter( selector )
3222 );
3223 }
3224} );
3225
3226function sibling( cur, dir ) {
3227 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
3228 return cur;
3229}
3230
3231jQuery.each( {
3232 parent: function( elem ) {
3233 var parent = elem.parentNode;
3234 return parent && parent.nodeType !== 11 ? parent : null;
3235 },
3236 parents: function( elem ) {
3237 return dir( elem, "parentNode" );
3238 },
3239 parentsUntil: function( elem, i, until ) {
3240 return dir( elem, "parentNode", until );
3241 },
3242 next: function( elem ) {
3243 return sibling( elem, "nextSibling" );
3244 },
3245 prev: function( elem ) {
3246 return sibling( elem, "previousSibling" );
3247 },
3248 nextAll: function( elem ) {
3249 return dir( elem, "nextSibling" );
3250 },
3251 prevAll: function( elem ) {
3252 return dir( elem, "previousSibling" );
3253 },
3254 nextUntil: function( elem, i, until ) {
3255 return dir( elem, "nextSibling", until );
3256 },
3257 prevUntil: function( elem, i, until ) {
3258 return dir( elem, "previousSibling", until );
3259 },
3260 siblings: function( elem ) {
3261 return siblings( ( elem.parentNode || {} ).firstChild, elem );
3262 },
3263 children: function( elem ) {
3264 return siblings( elem.firstChild );
3265 },
3266 contents: function( elem ) {
3267 if ( typeof elem.contentDocument !== "undefined" ) {
3268 return elem.contentDocument;
3269 }
3270
3271 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
3272 // Treat the template element as a regular one in browsers that
3273 // don't support it.
3274 if ( nodeName( elem, "template" ) ) {
3275 elem = elem.content || elem;
3276 }
3277
3278 return jQuery.merge( [], elem.childNodes );
3279 }
3280}, function( name, fn ) {
3281 jQuery.fn[ name ] = function( until, selector ) {
3282 var matched = jQuery.map( this, fn, until );
3283
3284 if ( name.slice( -5 ) !== "Until" ) {
3285 selector = until;
3286 }
3287
3288 if ( selector && typeof selector === "string" ) {
3289 matched = jQuery.filter( selector, matched );
3290 }
3291
3292 if ( this.length > 1 ) {
3293
3294 // Remove duplicates
3295 if ( !guaranteedUnique[ name ] ) {
3296 jQuery.uniqueSort( matched );
3297 }
3298
3299 // Reverse order for parents* and prev-derivatives
3300 if ( rparentsprev.test( name ) ) {
3301 matched.reverse();
3302 }
3303 }
3304
3305 return this.pushStack( matched );
3306 };
3307} );
3308var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
3309
3310
3311
3312// Convert String-formatted options into Object-formatted ones
3313function createOptions( options ) {
3314 var object = {};
3315 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
3316 object[ flag ] = true;
3317 } );
3318 return object;
3319}
3320
3321/*
3322 * Create a callback list using the following parameters:
3323 *
3324 * options: an optional list of space-separated options that will change how
3325 * the callback list behaves or a more traditional option object
3326 *
3327 * By default a callback list will act like an event callback list and can be
3328 * "fired" multiple times.
3329 *
3330 * Possible options:
3331 *
3332 * once: will ensure the callback list can only be fired once (like a Deferred)
3333 *
3334 * memory: will keep track of previous values and will call any callback added
3335 * after the list has been fired right away with the latest "memorized"
3336 * values (like a Deferred)
3337 *
3338 * unique: will ensure a callback can only be added once (no duplicate in the list)
3339 *
3340 * stopOnFalse: interrupt callings when a callback returns false
3341 *
3342 */
3343jQuery.Callbacks = function( options ) {
3344
3345 // Convert options from String-formatted to Object-formatted if needed
3346 // (we check in cache first)
3347 options = typeof options === "string" ?
3348 createOptions( options ) :
3349 jQuery.extend( {}, options );
3350
3351 var // Flag to know if list is currently firing
3352 firing,
3353
3354 // Last fire value for non-forgettable lists
3355 memory,
3356
3357 // Flag to know if list was already fired
3358 fired,
3359
3360 // Flag to prevent firing
3361 locked,
3362
3363 // Actual callback list
3364 list = [],
3365
3366 // Queue of execution data for repeatable lists
3367 queue = [],
3368
3369 // Index of currently firing callback (modified by add/remove as needed)
3370 firingIndex = -1,
3371
3372 // Fire callbacks
3373 fire = function() {
3374
3375 // Enforce single-firing
3376 locked = locked || options.once;
3377
3378 // Execute callbacks for all pending executions,
3379 // respecting firingIndex overrides and runtime changes
3380 fired = firing = true;
3381 for ( ; queue.length; firingIndex = -1 ) {
3382 memory = queue.shift();
3383 while ( ++firingIndex < list.length ) {
3384
3385 // Run callback and check for early termination
3386 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
3387 options.stopOnFalse ) {
3388
3389 // Jump to end and forget the data so .add doesn't re-fire
3390 firingIndex = list.length;
3391 memory = false;
3392 }
3393 }
3394 }
3395
3396 // Forget the data if we're done with it
3397 if ( !options.memory ) {
3398 memory = false;
3399 }
3400
3401 firing = false;
3402
3403 // Clean up if we're done firing for good
3404 if ( locked ) {
3405
3406 // Keep an empty list if we have data for future add calls
3407 if ( memory ) {
3408 list = [];
3409
3410 // Otherwise, this object is spent
3411 } else {
3412 list = "";
3413 }
3414 }
3415 },
3416
3417 // Actual Callbacks object
3418 self = {
3419
3420 // Add a callback or a collection of callbacks to the list
3421 add: function() {
3422 if ( list ) {
3423
3424 // If we have memory from a past run, we should fire after adding
3425 if ( memory && !firing ) {
3426 firingIndex = list.length - 1;
3427 queue.push( memory );
3428 }
3429
3430 ( function add( args ) {
3431 jQuery.each( args, function( _, arg ) {
3432 if ( isFunction( arg ) ) {
3433 if ( !options.unique || !self.has( arg ) ) {
3434 list.push( arg );
3435 }
3436 } else if ( arg && arg.length && toType( arg ) !== "string" ) {
3437
3438 // Inspect recursively
3439 add( arg );
3440 }
3441 } );
3442 } )( arguments );
3443
3444 if ( memory && !firing ) {
3445 fire();
3446 }
3447 }
3448 return this;
3449 },
3450
3451 // Remove a callback from the list
3452 remove: function() {
3453 jQuery.each( arguments, function( _, arg ) {
3454 var index;
3455 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3456 list.splice( index, 1 );
3457
3458 // Handle firing indexes
3459 if ( index <= firingIndex ) {
3460 firingIndex--;
3461 }
3462 }
3463 } );
3464 return this;
3465 },
3466
3467 // Check if a given callback is in the list.
3468 // If no argument is given, return whether or not list has callbacks attached.
3469 has: function( fn ) {
3470 return fn ?
3471 jQuery.inArray( fn, list ) > -1 :
3472 list.length > 0;
3473 },
3474
3475 // Remove all callbacks from the list
3476 empty: function() {
3477 if ( list ) {
3478 list = [];
3479 }
3480 return this;
3481 },
3482
3483 // Disable .fire and .add
3484 // Abort any current/pending executions
3485 // Clear all callbacks and values
3486 disable: function() {
3487 locked = queue = [];
3488 list = memory = "";
3489 return this;
3490 },
3491 disabled: function() {
3492 return !list;
3493 },
3494
3495 // Disable .fire
3496 // Also disable .add unless we have memory (since it would have no effect)
3497 // Abort any pending executions
3498 lock: function() {
3499 locked = queue = [];
3500 if ( !memory && !firing ) {
3501 list = memory = "";
3502 }
3503 return this;
3504 },
3505 locked: function() {
3506 return !!locked;
3507 },
3508
3509 // Call all callbacks with the given context and arguments
3510 fireWith: function( context, args ) {
3511 if ( !locked ) {
3512 args = args || [];
3513 args = [ context, args.slice ? args.slice() : args ];
3514 queue.push( args );
3515 if ( !firing ) {
3516 fire();
3517 }
3518 }
3519 return this;
3520 },
3521
3522 // Call all the callbacks with the given arguments
3523 fire: function() {
3524 self.fireWith( this, arguments );
3525 return this;
3526 },
3527
3528 // To know if the callbacks have already been called at least once
3529 fired: function() {
3530 return !!fired;
3531 }
3532 };
3533
3534 return self;
3535};
3536
3537
3538function Identity( v ) {
3539 return v;
3540}
3541function Thrower( ex ) {
3542 throw ex;
3543}
3544
3545function adoptValue( value, resolve, reject, noValue ) {
3546 var method;
3547
3548 try {
3549
3550 // Check for promise aspect first to privilege synchronous behavior
3551 if ( value && isFunction( ( method = value.promise ) ) ) {
3552 method.call( value ).done( resolve ).fail( reject );
3553
3554 // Other thenables
3555 } else if ( value && isFunction( ( method = value.then ) ) ) {
3556 method.call( value, resolve, reject );
3557
3558 // Other non-thenables
3559 } else {
3560
3561 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
3562 // * false: [ value ].slice( 0 ) => resolve( value )
3563 // * true: [ value ].slice( 1 ) => resolve()
3564 resolve.apply( undefined, [ value ].slice( noValue ) );
3565 }
3566
3567 // For Promises/A+, convert exceptions into rejections
3568 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
3569 // Deferred#then to conditionally suppress rejection.
3570 } catch ( value ) {
3571
3572 // Support: Android 4.0 only
3573 // Strict mode functions invoked without .call/.apply get global-object context
3574 reject.apply( undefined, [ value ] );
3575 }
3576}
3577
3578jQuery.extend( {
3579
3580 Deferred: function( func ) {
3581 var tuples = [
3582
3583 // action, add listener, callbacks,
3584 // ... .then handlers, argument index, [final state]
3585 [ "notify", "progress", jQuery.Callbacks( "memory" ),
3586 jQuery.Callbacks( "memory" ), 2 ],
3587 [ "resolve", "done", jQuery.Callbacks( "once memory" ),
3588 jQuery.Callbacks( "once memory" ), 0, "resolved" ],
3589 [ "reject", "fail", jQuery.Callbacks( "once memory" ),
3590 jQuery.Callbacks( "once memory" ), 1, "rejected" ]
3591 ],
3592 state = "pending",
3593 promise = {
3594 state: function() {
3595 return state;
3596 },
3597 always: function() {
3598 deferred.done( arguments ).fail( arguments );
3599 return this;
3600 },
3601 "catch": function( fn ) {
3602 return promise.then( null, fn );
3603 },
3604
3605 // Keep pipe for back-compat
3606 pipe: function( /* fnDone, fnFail, fnProgress */ ) {
3607 var fns = arguments;
3608
3609 return jQuery.Deferred( function( newDefer ) {
3610 jQuery.each( tuples, function( i, tuple ) {
3611
3612 // Map tuples (progress, done, fail) to arguments (done, fail, progress)
3613 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
3614
3615 // deferred.progress(function() { bind to newDefer or newDefer.notify })
3616 // deferred.done(function() { bind to newDefer or newDefer.resolve })
3617 // deferred.fail(function() { bind to newDefer or newDefer.reject })
3618 deferred[ tuple[ 1 ] ]( function() {
3619 var returned = fn && fn.apply( this, arguments );
3620 if ( returned && isFunction( returned.promise ) ) {
3621 returned.promise()
3622 .progress( newDefer.notify )
3623 .done( newDefer.resolve )
3624 .fail( newDefer.reject );
3625 } else {
3626 newDefer[ tuple[ 0 ] + "With" ](
3627 this,
3628 fn ? [ returned ] : arguments
3629 );
3630 }
3631 } );
3632 } );
3633 fns = null;
3634 } ).promise();
3635 },
3636 then: function( onFulfilled, onRejected, onProgress ) {
3637 var maxDepth = 0;
3638 function resolve( depth, deferred, handler, special ) {
3639 return function() {
3640 var that = this,
3641 args = arguments,
3642 mightThrow = function() {
3643 var returned, then;
3644
3645 // Support: Promises/A+ section 2.3.3.3.3
3646 // https://promisesaplus.com/#point-59
3647 // Ignore double-resolution attempts
3648 if ( depth < maxDepth ) {
3649 return;
3650 }
3651
3652 returned = handler.apply( that, args );
3653
3654 // Support: Promises/A+ section 2.3.1
3655 // https://promisesaplus.com/#point-48
3656 if ( returned === deferred.promise() ) {
3657 throw new TypeError( "Thenable self-resolution" );
3658 }
3659
3660 // Support: Promises/A+ sections 2.3.3.1, 3.5
3661 // https://promisesaplus.com/#point-54
3662 // https://promisesaplus.com/#point-75
3663 // Retrieve `then` only once
3664 then = returned &&
3665
3666 // Support: Promises/A+ section 2.3.4
3667 // https://promisesaplus.com/#point-64
3668 // Only check objects and functions for thenability
3669 ( typeof returned === "object" ||
3670 typeof returned === "function" ) &&
3671 returned.then;
3672
3673 // Handle a returned thenable
3674 if ( isFunction( then ) ) {
3675
3676 // Special processors (notify) just wait for resolution
3677 if ( special ) {
3678 then.call(
3679 returned,
3680 resolve( maxDepth, deferred, Identity, special ),
3681 resolve( maxDepth, deferred, Thrower, special )
3682 );
3683
3684 // Normal processors (resolve) also hook into progress
3685 } else {
3686
3687 // ...and disregard older resolution values
3688 maxDepth++;
3689
3690 then.call(
3691 returned,
3692 resolve( maxDepth, deferred, Identity, special ),
3693 resolve( maxDepth, deferred, Thrower, special ),
3694 resolve( maxDepth, deferred, Identity,
3695 deferred.notifyWith )
3696 );
3697 }
3698
3699 // Handle all other returned values
3700 } else {
3701
3702 // Only substitute handlers pass on context
3703 // and multiple values (non-spec behavior)
3704 if ( handler !== Identity ) {
3705 that = undefined;
3706 args = [ returned ];
3707 }
3708
3709 // Process the value(s)
3710 // Default process is resolve
3711 ( special || deferred.resolveWith )( that, args );
3712 }
3713 },
3714
3715 // Only normal processors (resolve) catch and reject exceptions
3716 process = special ?
3717 mightThrow :
3718 function() {
3719 try {
3720 mightThrow();
3721 } catch ( e ) {
3722
3723 if ( jQuery.Deferred.exceptionHook ) {
3724 jQuery.Deferred.exceptionHook( e,
3725 process.stackTrace );
3726 }
3727
3728 // Support: Promises/A+ section 2.3.3.3.4.1
3729 // https://promisesaplus.com/#point-61
3730 // Ignore post-resolution exceptions
3731 if ( depth + 1 >= maxDepth ) {
3732
3733 // Only substitute handlers pass on context
3734 // and multiple values (non-spec behavior)
3735 if ( handler !== Thrower ) {
3736 that = undefined;
3737 args = [ e ];
3738 }
3739
3740 deferred.rejectWith( that, args );
3741 }
3742 }
3743 };
3744
3745 // Support: Promises/A+ section 2.3.3.3.1
3746 // https://promisesaplus.com/#point-57
3747 // Re-resolve promises immediately to dodge false rejection from
3748 // subsequent errors
3749 if ( depth ) {
3750 process();
3751 } else {
3752
3753 // Call an optional hook to record the stack, in case of exception
3754 // since it's otherwise lost when execution goes async
3755 if ( jQuery.Deferred.getStackHook ) {
3756 process.stackTrace = jQuery.Deferred.getStackHook();
3757 }
3758 window.setTimeout( process );
3759 }
3760 };
3761 }
3762
3763 return jQuery.Deferred( function( newDefer ) {
3764
3765 // progress_handlers.add( ... )
3766 tuples[ 0 ][ 3 ].add(
3767 resolve(
3768 0,
3769 newDefer,
3770 isFunction( onProgress ) ?
3771 onProgress :
3772 Identity,
3773 newDefer.notifyWith
3774 )
3775 );
3776
3777 // fulfilled_handlers.add( ... )
3778 tuples[ 1 ][ 3 ].add(
3779 resolve(
3780 0,
3781 newDefer,
3782 isFunction( onFulfilled ) ?
3783 onFulfilled :
3784 Identity
3785 )
3786 );
3787
3788 // rejected_handlers.add( ... )
3789 tuples[ 2 ][ 3 ].add(
3790 resolve(
3791 0,
3792 newDefer,
3793 isFunction( onRejected ) ?
3794 onRejected :
3795 Thrower
3796 )
3797 );
3798 } ).promise();
3799 },
3800
3801 // Get a promise for this deferred
3802 // If obj is provided, the promise aspect is added to the object
3803 promise: function( obj ) {
3804 return obj != null ? jQuery.extend( obj, promise ) : promise;
3805 }
3806 },
3807 deferred = {};
3808
3809 // Add list-specific methods
3810 jQuery.each( tuples, function( i, tuple ) {
3811 var list = tuple[ 2 ],
3812 stateString = tuple[ 5 ];
3813
3814 // promise.progress = list.add
3815 // promise.done = list.add
3816 // promise.fail = list.add
3817 promise[ tuple[ 1 ] ] = list.add;
3818
3819 // Handle state
3820 if ( stateString ) {
3821 list.add(
3822 function() {
3823
3824 // state = "resolved" (i.e., fulfilled)
3825 // state = "rejected"
3826 state = stateString;
3827 },
3828
3829 // rejected_callbacks.disable
3830 // fulfilled_callbacks.disable
3831 tuples[ 3 - i ][ 2 ].disable,
3832
3833 // rejected_handlers.disable
3834 // fulfilled_handlers.disable
3835 tuples[ 3 - i ][ 3 ].disable,
3836
3837 // progress_callbacks.lock
3838 tuples[ 0 ][ 2 ].lock,
3839
3840 // progress_handlers.lock
3841 tuples[ 0 ][ 3 ].lock
3842 );
3843 }
3844
3845 // progress_handlers.fire
3846 // fulfilled_handlers.fire
3847 // rejected_handlers.fire
3848 list.add( tuple[ 3 ].fire );
3849
3850 // deferred.notify = function() { deferred.notifyWith(...) }
3851 // deferred.resolve = function() { deferred.resolveWith(...) }
3852 // deferred.reject = function() { deferred.rejectWith(...) }
3853 deferred[ tuple[ 0 ] ] = function() {
3854 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
3855 return this;
3856 };
3857
3858 // deferred.notifyWith = list.fireWith
3859 // deferred.resolveWith = list.fireWith
3860 // deferred.rejectWith = list.fireWith
3861 deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
3862 } );
3863
3864 // Make the deferred a promise
3865 promise.promise( deferred );
3866
3867 // Call given func if any
3868 if ( func ) {
3869 func.call( deferred, deferred );
3870 }
3871
3872 // All done!
3873 return deferred;
3874 },
3875
3876 // Deferred helper
3877 when: function( singleValue ) {
3878 var
3879
3880 // count of uncompleted subordinates
3881 remaining = arguments.length,
3882
3883 // count of unprocessed arguments
3884 i = remaining,
3885
3886 // subordinate fulfillment data
3887 resolveContexts = Array( i ),
3888 resolveValues = slice.call( arguments ),
3889
3890 // the master Deferred
3891 master = jQuery.Deferred(),
3892
3893 // subordinate callback factory
3894 updateFunc = function( i ) {
3895 return function( value ) {
3896 resolveContexts[ i ] = this;
3897 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3898 if ( !( --remaining ) ) {
3899 master.resolveWith( resolveContexts, resolveValues );
3900 }
3901 };
3902 };
3903
3904 // Single- and empty arguments are adopted like Promise.resolve
3905 if ( remaining <= 1 ) {
3906 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
3907 !remaining );
3908
3909 // Use .then() to unwrap secondary thenables (cf. gh-3000)
3910 if ( master.state() === "pending" ||
3911 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
3912
3913 return master.then();
3914 }
3915 }
3916
3917 // Multiple arguments are aggregated like Promise.all array elements
3918 while ( i-- ) {
3919 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
3920 }
3921
3922 return master.promise();
3923 }
3924} );
3925
3926
3927// These usually indicate a programmer mistake during development,
3928// warn about them ASAP rather than swallowing them by default.
3929var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
3930
3931jQuery.Deferred.exceptionHook = function( error, stack ) {
3932
3933 // Support: IE 8 - 9 only
3934 // Console exists when dev tools are open, which can happen at any time
3935 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
3936 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
3937 }
3938};
3939
3940
3941
3942
3943jQuery.readyException = function( error ) {
3944 window.setTimeout( function() {
3945 throw error;
3946 } );
3947};
3948
3949
3950
3951
3952// The deferred used on DOM ready
3953var readyList = jQuery.Deferred();
3954
3955jQuery.fn.ready = function( fn ) {
3956
3957 readyList
3958 .then( fn )
3959
3960 // Wrap jQuery.readyException in a function so that the lookup
3961 // happens at the time of error handling instead of callback
3962 // registration.
3963 .catch( function( error ) {
3964 jQuery.readyException( error );
3965 } );
3966
3967 return this;
3968};
3969
3970jQuery.extend( {
3971
3972 // Is the DOM ready to be used? Set to true once it occurs.
3973 isReady: false,
3974
3975 // A counter to track how many items to wait for before
3976 // the ready event fires. See #6781
3977 readyWait: 1,
3978
3979 // Handle when the DOM is ready
3980 ready: function( wait ) {
3981
3982 // Abort if there are pending holds or we're already ready
3983 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3984 return;
3985 }
3986
3987 // Remember that the DOM is ready
3988 jQuery.isReady = true;
3989
3990 // If a normal DOM Ready event fired, decrement, and wait if need be
3991 if ( wait !== true && --jQuery.readyWait > 0 ) {
3992 return;
3993 }
3994
3995 // If there are functions bound, to execute
3996 readyList.resolveWith( document, [ jQuery ] );
3997 }
3998} );
3999
4000jQuery.ready.then = readyList.then;
4001
4002// The ready event handler and self cleanup method
4003function completed() {
4004 document.removeEventListener( "DOMContentLoaded", completed );
4005 window.removeEventListener( "load", completed );
4006 jQuery.ready();
4007}
4008
4009// Catch cases where $(document).ready() is called
4010// after the browser event has already occurred.
4011// Support: IE <=9 - 10 only
4012// Older IE sometimes signals "interactive" too soon
4013if ( document.readyState === "complete" ||
4014 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
4015
4016 // Handle it asynchronously to allow scripts the opportunity to delay ready
4017 window.setTimeout( jQuery.ready );
4018
4019} else {
4020
4021 // Use the handy event callback
4022 document.addEventListener( "DOMContentLoaded", completed );
4023
4024 // A fallback to window.onload, that will always work
4025 window.addEventListener( "load", completed );
4026}
4027
4028
4029
4030
4031// Multifunctional method to get and set values of a collection
4032// The value/s can optionally be executed if it's a function
4033var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4034 var i = 0,
4035 len = elems.length,
4036 bulk = key == null;
4037
4038 // Sets many values
4039 if ( toType( key ) === "object" ) {
4040 chainable = true;
4041 for ( i in key ) {
4042 access( elems, fn, i, key[ i ], true, emptyGet, raw );
4043 }
4044
4045 // Sets one value
4046 } else if ( value !== undefined ) {
4047 chainable = true;
4048
4049 if ( !isFunction( value ) ) {
4050 raw = true;
4051 }
4052
4053 if ( bulk ) {
4054
4055 // Bulk operations run against the entire set
4056 if ( raw ) {
4057 fn.call( elems, value );
4058 fn = null;
4059
4060 // ...except when executing function values
4061 } else {
4062 bulk = fn;
4063 fn = function( elem, key, value ) {
4064 return bulk.call( jQuery( elem ), value );
4065 };
4066 }
4067 }
4068
4069 if ( fn ) {
4070 for ( ; i < len; i++ ) {
4071 fn(
4072 elems[ i ], key, raw ?
4073 value :
4074 value.call( elems[ i ], i, fn( elems[ i ], key ) )
4075 );
4076 }
4077 }
4078 }
4079
4080 if ( chainable ) {
4081 return elems;
4082 }
4083
4084 // Gets
4085 if ( bulk ) {
4086 return fn.call( elems );
4087 }
4088
4089 return len ? fn( elems[ 0 ], key ) : emptyGet;
4090};
4091
4092
4093// Matches dashed string for camelizing
4094var rmsPrefix = /^-ms-/,
4095 rdashAlpha = /-([a-z])/g;
4096
4097// Used by camelCase as callback to replace()
4098function fcamelCase( all, letter ) {
4099 return letter.toUpperCase();
4100}
4101
4102// Convert dashed to camelCase; used by the css and data modules
4103// Support: IE <=9 - 11, Edge 12 - 15
4104// Microsoft forgot to hump their vendor prefix (#9572)
4105function camelCase( string ) {
4106 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4107}
4108var acceptData = function( owner ) {
4109
4110 // Accepts only:
4111 // - Node
4112 // - Node.ELEMENT_NODE
4113 // - Node.DOCUMENT_NODE
4114 // - Object
4115 // - Any
4116 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
4117};
4118
4119
4120
4121
4122function Data() {
4123 this.expando = jQuery.expando + Data.uid++;
4124}
4125
4126Data.uid = 1;
4127
4128Data.prototype = {
4129
4130 cache: function( owner ) {
4131
4132 // Check if the owner object already has a cache
4133 var value = owner[ this.expando ];
4134
4135 // If not, create one
4136 if ( !value ) {
4137 value = {};
4138
4139 // We can accept data for non-element nodes in modern browsers,
4140 // but we should not, see #8335.
4141 // Always return an empty object.
4142 if ( acceptData( owner ) ) {
4143
4144 // If it is a node unlikely to be stringify-ed or looped over
4145 // use plain assignment
4146 if ( owner.nodeType ) {
4147 owner[ this.expando ] = value;
4148
4149 // Otherwise secure it in a non-enumerable property
4150 // configurable must be true to allow the property to be
4151 // deleted when data is removed
4152 } else {
4153 Object.defineProperty( owner, this.expando, {
4154 value: value,
4155 configurable: true
4156 } );
4157 }
4158 }
4159 }
4160
4161 return value;
4162 },
4163 set: function( owner, data, value ) {
4164 var prop,
4165 cache = this.cache( owner );
4166
4167 // Handle: [ owner, key, value ] args
4168 // Always use camelCase key (gh-2257)
4169 if ( typeof data === "string" ) {
4170 cache[ camelCase( data ) ] = value;
4171
4172 // Handle: [ owner, { properties } ] args
4173 } else {
4174
4175 // Copy the properties one-by-one to the cache object
4176 for ( prop in data ) {
4177 cache[ camelCase( prop ) ] = data[ prop ];
4178 }
4179 }
4180 return cache;
4181 },
4182 get: function( owner, key ) {
4183 return key === undefined ?
4184 this.cache( owner ) :
4185
4186 // Always use camelCase key (gh-2257)
4187 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
4188 },
4189 access: function( owner, key, value ) {
4190
4191 // In cases where either:
4192 //
4193 // 1. No key was specified
4194 // 2. A string key was specified, but no value provided
4195 //
4196 // Take the "read" path and allow the get method to determine
4197 // which value to return, respectively either:
4198 //
4199 // 1. The entire cache object
4200 // 2. The data stored at the key
4201 //
4202 if ( key === undefined ||
4203 ( ( key && typeof key === "string" ) && value === undefined ) ) {
4204
4205 return this.get( owner, key );
4206 }
4207
4208 // When the key is not a string, or both a key and value
4209 // are specified, set or extend (existing objects) with either:
4210 //
4211 // 1. An object of properties
4212 // 2. A key and value
4213 //
4214 this.set( owner, key, value );
4215
4216 // Since the "set" path can have two possible entry points
4217 // return the expected data based on which path was taken[*]
4218 return value !== undefined ? value : key;
4219 },
4220 remove: function( owner, key ) {
4221 var i,
4222 cache = owner[ this.expando ];
4223
4224 if ( cache === undefined ) {
4225 return;
4226 }
4227
4228 if ( key !== undefined ) {
4229
4230 // Support array or space separated string of keys
4231 if ( Array.isArray( key ) ) {
4232
4233 // If key is an array of keys...
4234 // We always set camelCase keys, so remove that.
4235 key = key.map( camelCase );
4236 } else {
4237 key = camelCase( key );
4238
4239 // If a key with the spaces exists, use it.
4240 // Otherwise, create an array by matching non-whitespace
4241 key = key in cache ?
4242 [ key ] :
4243 ( key.match( rnothtmlwhite ) || [] );
4244 }
4245
4246 i = key.length;
4247
4248 while ( i-- ) {
4249 delete cache[ key[ i ] ];
4250 }
4251 }
4252
4253 // Remove the expando if there's no more data
4254 if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
4255
4256 // Support: Chrome <=35 - 45
4257 // Webkit & Blink performance suffers when deleting properties
4258 // from DOM nodes, so set to undefined instead
4259 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
4260 if ( owner.nodeType ) {
4261 owner[ this.expando ] = undefined;
4262 } else {
4263 delete owner[ this.expando ];
4264 }
4265 }
4266 },
4267 hasData: function( owner ) {
4268 var cache = owner[ this.expando ];
4269 return cache !== undefined && !jQuery.isEmptyObject( cache );
4270 }
4271};
4272var dataPriv = new Data();
4273
4274var dataUser = new Data();
4275
4276
4277
4278// Implementation Summary
4279//
4280// 1. Enforce API surface and semantic compatibility with 1.9.x branch
4281// 2. Improve the module's maintainability by reducing the storage
4282// paths to a single mechanism.
4283// 3. Use the same single mechanism to support "private" and "user" data.
4284// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
4285// 5. Avoid exposing implementation details on user objects (eg. expando properties)
4286// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
4287
4288var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
4289 rmultiDash = /[A-Z]/g;
4290
4291function getData( data ) {
4292 if ( data === "true" ) {
4293 return true;
4294 }
4295
4296 if ( data === "false" ) {
4297 return false;
4298 }
4299
4300 if ( data === "null" ) {
4301 return null;
4302 }
4303
4304 // Only convert to a number if it doesn't change the string
4305 if ( data === +data + "" ) {
4306 return +data;
4307 }
4308
4309 if ( rbrace.test( data ) ) {
4310 return JSON.parse( data );
4311 }
4312
4313 return data;
4314}
4315
4316function dataAttr( elem, key, data ) {
4317 var name;
4318
4319 // If nothing was found internally, try to fetch any
4320 // data from the HTML5 data-* attribute
4321 if ( data === undefined && elem.nodeType === 1 ) {
4322 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
4323 data = elem.getAttribute( name );
4324
4325 if ( typeof data === "string" ) {
4326 try {
4327 data = getData( data );
4328 } catch ( e ) {}
4329
4330 // Make sure we set the data so it isn't changed later
4331 dataUser.set( elem, key, data );
4332 } else {
4333 data = undefined;
4334 }
4335 }
4336 return data;
4337}
4338
4339jQuery.extend( {
4340 hasData: function( elem ) {
4341 return dataUser.hasData( elem ) || dataPriv.hasData( elem );
4342 },
4343
4344 data: function( elem, name, data ) {
4345 return dataUser.access( elem, name, data );
4346 },
4347
4348 removeData: function( elem, name ) {
4349 dataUser.remove( elem, name );
4350 },
4351
4352 // TODO: Now that all calls to _data and _removeData have been replaced
4353 // with direct calls to dataPriv methods, these can be deprecated.
4354 _data: function( elem, name, data ) {
4355 return dataPriv.access( elem, name, data );
4356 },
4357
4358 _removeData: function( elem, name ) {
4359 dataPriv.remove( elem, name );
4360 }
4361} );
4362
4363jQuery.fn.extend( {
4364 data: function( key, value ) {
4365 var i, name, data,
4366 elem = this[ 0 ],
4367 attrs = elem && elem.attributes;
4368
4369 // Gets all values
4370 if ( key === undefined ) {
4371 if ( this.length ) {
4372 data = dataUser.get( elem );
4373
4374 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
4375 i = attrs.length;
4376 while ( i-- ) {
4377
4378 // Support: IE 11 only
4379 // The attrs elements can be null (#14894)
4380 if ( attrs[ i ] ) {
4381 name = attrs[ i ].name;
4382 if ( name.indexOf( "data-" ) === 0 ) {
4383 name = camelCase( name.slice( 5 ) );
4384 dataAttr( elem, name, data[ name ] );
4385 }
4386 }
4387 }
4388 dataPriv.set( elem, "hasDataAttrs", true );
4389 }
4390 }
4391
4392 return data;
4393 }
4394
4395 // Sets multiple values
4396 if ( typeof key === "object" ) {
4397 return this.each( function() {
4398 dataUser.set( this, key );
4399 } );
4400 }
4401
4402 return access( this, function( value ) {
4403 var data;
4404
4405 // The calling jQuery object (element matches) is not empty
4406 // (and therefore has an element appears at this[ 0 ]) and the
4407 // `value` parameter was not undefined. An empty jQuery object
4408 // will result in `undefined` for elem = this[ 0 ] which will
4409 // throw an exception if an attempt to read a data cache is made.
4410 if ( elem && value === undefined ) {
4411
4412 // Attempt to get data from the cache
4413 // The key will always be camelCased in Data
4414 data = dataUser.get( elem, key );
4415 if ( data !== undefined ) {
4416 return data;
4417 }
4418
4419 // Attempt to "discover" the data in
4420 // HTML5 custom data-* attrs
4421 data = dataAttr( elem, key );
4422 if ( data !== undefined ) {
4423 return data;
4424 }
4425
4426 // We tried really hard, but the data doesn't exist.
4427 return;
4428 }
4429
4430 // Set the data...
4431 this.each( function() {
4432
4433 // We always store the camelCased key
4434 dataUser.set( this, key, value );
4435 } );
4436 }, null, value, arguments.length > 1, null, true );
4437 },
4438
4439 removeData: function( key ) {
4440 return this.each( function() {
4441 dataUser.remove( this, key );
4442 } );
4443 }
4444} );
4445
4446
4447jQuery.extend( {
4448 queue: function( elem, type, data ) {
4449 var queue;
4450
4451 if ( elem ) {
4452 type = ( type || "fx" ) + "queue";
4453 queue = dataPriv.get( elem, type );
4454
4455 // Speed up dequeue by getting out quickly if this is just a lookup
4456 if ( data ) {
4457 if ( !queue || Array.isArray( data ) ) {
4458 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
4459 } else {
4460 queue.push( data );
4461 }
4462 }
4463 return queue || [];
4464 }
4465 },
4466
4467 dequeue: function( elem, type ) {
4468 type = type || "fx";
4469
4470 var queue = jQuery.queue( elem, type ),
4471 startLength = queue.length,
4472 fn = queue.shift(),
4473 hooks = jQuery._queueHooks( elem, type ),
4474 next = function() {
4475 jQuery.dequeue( elem, type );
4476 };
4477
4478 // If the fx queue is dequeued, always remove the progress sentinel
4479 if ( fn === "inprogress" ) {
4480 fn = queue.shift();
4481 startLength--;
4482 }
4483
4484 if ( fn ) {
4485
4486 // Add a progress sentinel to prevent the fx queue from being
4487 // automatically dequeued
4488 if ( type === "fx" ) {
4489 queue.unshift( "inprogress" );
4490 }
4491
4492 // Clear up the last queue stop function
4493 delete hooks.stop;
4494 fn.call( elem, next, hooks );
4495 }
4496
4497 if ( !startLength && hooks ) {
4498 hooks.empty.fire();
4499 }
4500 },
4501
4502 // Not public - generate a queueHooks object, or return the current one
4503 _queueHooks: function( elem, type ) {
4504 var key = type + "queueHooks";
4505 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
4506 empty: jQuery.Callbacks( "once memory" ).add( function() {
4507 dataPriv.remove( elem, [ type + "queue", key ] );
4508 } )
4509 } );
4510 }
4511} );
4512
4513jQuery.fn.extend( {
4514 queue: function( type, data ) {
4515 var setter = 2;
4516
4517 if ( typeof type !== "string" ) {
4518 data = type;
4519 type = "fx";
4520 setter--;
4521 }
4522
4523 if ( arguments.length < setter ) {
4524 return jQuery.queue( this[ 0 ], type );
4525 }
4526
4527 return data === undefined ?
4528 this :
4529 this.each( function() {
4530 var queue = jQuery.queue( this, type, data );
4531
4532 // Ensure a hooks for this queue
4533 jQuery._queueHooks( this, type );
4534
4535 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
4536 jQuery.dequeue( this, type );
4537 }
4538 } );
4539 },
4540 dequeue: function( type ) {
4541 return this.each( function() {
4542 jQuery.dequeue( this, type );
4543 } );
4544 },
4545 clearQueue: function( type ) {
4546 return this.queue( type || "fx", [] );
4547 },
4548
4549 // Get a promise resolved when queues of a certain type
4550 // are emptied (fx is the type by default)
4551 promise: function( type, obj ) {
4552 var tmp,
4553 count = 1,
4554 defer = jQuery.Deferred(),
4555 elements = this,
4556 i = this.length,
4557 resolve = function() {
4558 if ( !( --count ) ) {
4559 defer.resolveWith( elements, [ elements ] );
4560 }
4561 };
4562
4563 if ( typeof type !== "string" ) {
4564 obj = type;
4565 type = undefined;
4566 }
4567 type = type || "fx";
4568
4569 while ( i-- ) {
4570 tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
4571 if ( tmp && tmp.empty ) {
4572 count++;
4573 tmp.empty.add( resolve );
4574 }
4575 }
4576 resolve();
4577 return defer.promise( obj );
4578 }
4579} );
4580var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
4581
4582var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
4583
4584
4585var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4586
4587var documentElement = document.documentElement;
4588
4589
4590
4591 var isAttached = function( elem ) {
4592 return jQuery.contains( elem.ownerDocument, elem );
4593 },
4594 composed = { composed: true };
4595
4596 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
4597 // Check attachment across shadow DOM boundaries when possible (gh-3504)
4598 // Support: iOS 10.0-10.2 only
4599 // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
4600 // leading to errors. We need to check for `getRootNode`.
4601 if ( documentElement.getRootNode ) {
4602 isAttached = function( elem ) {
4603 return jQuery.contains( elem.ownerDocument, elem ) ||
4604 elem.getRootNode( composed ) === elem.ownerDocument;
4605 };
4606 }
4607var isHiddenWithinTree = function( elem, el ) {
4608
4609 // isHiddenWithinTree might be called from jQuery#filter function;
4610 // in that case, element will be second argument
4611 elem = el || elem;
4612
4613 // Inline style trumps all
4614 return elem.style.display === "none" ||
4615 elem.style.display === "" &&
4616
4617 // Otherwise, check computed style
4618 // Support: Firefox <=43 - 45
4619 // Disconnected elements can have computed display: none, so first confirm that elem is
4620 // in the document.
4621 isAttached( elem ) &&
4622
4623 jQuery.css( elem, "display" ) === "none";
4624 };
4625
4626var swap = function( elem, options, callback, args ) {
4627 var ret, name,
4628 old = {};
4629
4630 // Remember the old values, and insert the new ones
4631 for ( name in options ) {
4632 old[ name ] = elem.style[ name ];
4633 elem.style[ name ] = options[ name ];
4634 }
4635
4636 ret = callback.apply( elem, args || [] );
4637
4638 // Revert the old values
4639 for ( name in options ) {
4640 elem.style[ name ] = old[ name ];
4641 }
4642
4643 return ret;
4644};
4645
4646
4647
4648
4649function adjustCSS( elem, prop, valueParts, tween ) {
4650 var adjusted, scale,
4651 maxIterations = 20,
4652 currentValue = tween ?
4653 function() {
4654 return tween.cur();
4655 } :
4656 function() {
4657 return jQuery.css( elem, prop, "" );
4658 },
4659 initial = currentValue(),
4660 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
4661
4662 // Starting value computation is required for potential unit mismatches
4663 initialInUnit = elem.nodeType &&
4664 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
4665 rcssNum.exec( jQuery.css( elem, prop ) );
4666
4667 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
4668
4669 // Support: Firefox <=54
4670 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
4671 initial = initial / 2;
4672
4673 // Trust units reported by jQuery.css
4674 unit = unit || initialInUnit[ 3 ];
4675
4676 // Iteratively approximate from a nonzero starting point
4677 initialInUnit = +initial || 1;
4678
4679 while ( maxIterations-- ) {
4680
4681 // Evaluate and update our best guess (doubling guesses that zero out).
4682 // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
4683 jQuery.style( elem, prop, initialInUnit + unit );
4684 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
4685 maxIterations = 0;
4686 }
4687 initialInUnit = initialInUnit / scale;
4688
4689 }
4690
4691 initialInUnit = initialInUnit * 2;
4692 jQuery.style( elem, prop, initialInUnit + unit );
4693
4694 // Make sure we update the tween properties later on
4695 valueParts = valueParts || [];
4696 }
4697
4698 if ( valueParts ) {
4699 initialInUnit = +initialInUnit || +initial || 0;
4700
4701 // Apply relative offset (+=/-=) if specified
4702 adjusted = valueParts[ 1 ] ?
4703 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
4704 +valueParts[ 2 ];
4705 if ( tween ) {
4706 tween.unit = unit;
4707 tween.start = initialInUnit;
4708 tween.end = adjusted;
4709 }
4710 }
4711 return adjusted;
4712}
4713
4714
4715var defaultDisplayMap = {};
4716
4717function getDefaultDisplay( elem ) {
4718 var temp,
4719 doc = elem.ownerDocument,
4720 nodeName = elem.nodeName,
4721 display = defaultDisplayMap[ nodeName ];
4722
4723 if ( display ) {
4724 return display;
4725 }
4726
4727 temp = doc.body.appendChild( doc.createElement( nodeName ) );
4728 display = jQuery.css( temp, "display" );
4729
4730 temp.parentNode.removeChild( temp );
4731
4732 if ( display === "none" ) {
4733 display = "block";
4734 }
4735 defaultDisplayMap[ nodeName ] = display;
4736
4737 return display;
4738}
4739
4740function showHide( elements, show ) {
4741 var display, elem,
4742 values = [],
4743 index = 0,
4744 length = elements.length;
4745
4746 // Determine new display value for elements that need to change
4747 for ( ; index < length; index++ ) {
4748 elem = elements[ index ];
4749 if ( !elem.style ) {
4750 continue;
4751 }
4752
4753 display = elem.style.display;
4754 if ( show ) {
4755
4756 // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
4757 // check is required in this first loop unless we have a nonempty display value (either
4758 // inline or about-to-be-restored)
4759 if ( display === "none" ) {
4760 values[ index ] = dataPriv.get( elem, "display" ) || null;
4761 if ( !values[ index ] ) {
4762 elem.style.display = "";
4763 }
4764 }
4765 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
4766 values[ index ] = getDefaultDisplay( elem );
4767 }
4768 } else {
4769 if ( display !== "none" ) {
4770 values[ index ] = "none";
4771
4772 // Remember what we're overwriting
4773 dataPriv.set( elem, "display", display );
4774 }
4775 }
4776 }
4777
4778 // Set the display of the elements in a second loop to avoid constant reflow
4779 for ( index = 0; index < length; index++ ) {
4780 if ( values[ index ] != null ) {
4781 elements[ index ].style.display = values[ index ];
4782 }
4783 }
4784
4785 return elements;
4786}
4787
4788jQuery.fn.extend( {
4789 show: function() {
4790 return showHide( this, true );
4791 },
4792 hide: function() {
4793 return showHide( this );
4794 },
4795 toggle: function( state ) {
4796 if ( typeof state === "boolean" ) {
4797 return state ? this.show() : this.hide();
4798 }
4799
4800 return this.each( function() {
4801 if ( isHiddenWithinTree( this ) ) {
4802 jQuery( this ).show();
4803 } else {
4804 jQuery( this ).hide();
4805 }
4806 } );
4807 }
4808} );
4809var rcheckableType = ( /^(?:checkbox|radio)$/i );
4810
4811var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
4812
4813var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4814
4815
4816
4817// We have to close these tags to support XHTML (#13200)
4818var wrapMap = {
4819
4820 // Support: IE <=9 only
4821 option: [ 1, "<select multiple='multiple'>", "</select>" ],
4822
4823 // XHTML parsers do not magically insert elements in the
4824 // same way that tag soup parsers do. So we cannot shorten
4825 // this by omitting <tbody> or other required elements.
4826 thead: [ 1, "<table>", "</table>" ],
4827 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
4828 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4829 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4830
4831 _default: [ 0, "", "" ]
4832};
4833
4834// Support: IE <=9 only
4835wrapMap.optgroup = wrapMap.option;
4836
4837wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4838wrapMap.th = wrapMap.td;
4839
4840
4841function getAll( context, tag ) {
4842
4843 // Support: IE <=9 - 11 only
4844 // Use typeof to avoid zero-argument method invocation on host objects (#15151)
4845 var ret;
4846
4847 if ( typeof context.getElementsByTagName !== "undefined" ) {
4848 ret = context.getElementsByTagName( tag || "*" );
4849
4850 } else if ( typeof context.querySelectorAll !== "undefined" ) {
4851 ret = context.querySelectorAll( tag || "*" );
4852
4853 } else {
4854 ret = [];
4855 }
4856
4857 if ( tag === undefined || tag && nodeName( context, tag ) ) {
4858 return jQuery.merge( [ context ], ret );
4859 }
4860
4861 return ret;
4862}
4863
4864
4865// Mark scripts as having already been evaluated
4866function setGlobalEval( elems, refElements ) {
4867 var i = 0,
4868 l = elems.length;
4869
4870 for ( ; i < l; i++ ) {
4871 dataPriv.set(
4872 elems[ i ],
4873 "globalEval",
4874 !refElements || dataPriv.get( refElements[ i ], "globalEval" )
4875 );
4876 }
4877}
4878
4879
4880var rhtml = /<|&#?\w+;/;
4881
4882function buildFragment( elems, context, scripts, selection, ignored ) {
4883 var elem, tmp, tag, wrap, attached, j,
4884 fragment = context.createDocumentFragment(),
4885 nodes = [],
4886 i = 0,
4887 l = elems.length;
4888
4889 for ( ; i < l; i++ ) {
4890 elem = elems[ i ];
4891
4892 if ( elem || elem === 0 ) {
4893
4894 // Add nodes directly
4895 if ( toType( elem ) === "object" ) {
4896
4897 // Support: Android <=4.0 only, PhantomJS 1 only
4898 // push.apply(_, arraylike) throws on ancient WebKit
4899 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
4900
4901 // Convert non-html into a text node
4902 } else if ( !rhtml.test( elem ) ) {
4903 nodes.push( context.createTextNode( elem ) );
4904
4905 // Convert html into DOM nodes
4906 } else {
4907 tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
4908
4909 // Deserialize a standard representation
4910 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
4911 wrap = wrapMap[ tag ] || wrapMap._default;
4912 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
4913
4914 // Descend through wrappers to the right content
4915 j = wrap[ 0 ];
4916 while ( j-- ) {
4917 tmp = tmp.lastChild;
4918 }
4919
4920 // Support: Android <=4.0 only, PhantomJS 1 only
4921 // push.apply(_, arraylike) throws on ancient WebKit
4922 jQuery.merge( nodes, tmp.childNodes );
4923
4924 // Remember the top-level container
4925 tmp = fragment.firstChild;
4926
4927 // Ensure the created nodes are orphaned (#12392)
4928 tmp.textContent = "";
4929 }
4930 }
4931 }
4932
4933 // Remove wrapper from fragment
4934 fragment.textContent = "";
4935
4936 i = 0;
4937 while ( ( elem = nodes[ i++ ] ) ) {
4938
4939 // Skip elements already in the context collection (trac-4087)
4940 if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
4941 if ( ignored ) {
4942 ignored.push( elem );
4943 }
4944 continue;
4945 }
4946
4947 attached = isAttached( elem );
4948
4949 // Append to fragment
4950 tmp = getAll( fragment.appendChild( elem ), "script" );
4951
4952 // Preserve script evaluation history
4953 if ( attached ) {
4954 setGlobalEval( tmp );
4955 }
4956
4957 // Capture executables
4958 if ( scripts ) {
4959 j = 0;
4960 while ( ( elem = tmp[ j++ ] ) ) {
4961 if ( rscriptType.test( elem.type || "" ) ) {
4962 scripts.push( elem );
4963 }
4964 }
4965 }
4966 }
4967
4968 return fragment;
4969}
4970
4971
4972( function() {
4973 var fragment = document.createDocumentFragment(),
4974 div = fragment.appendChild( document.createElement( "div" ) ),
4975 input = document.createElement( "input" );
4976
4977 // Support: Android 4.0 - 4.3 only
4978 // Check state lost if the name is set (#11217)
4979 // Support: Windows Web Apps (WWA)
4980 // `name` and `type` must use .setAttribute for WWA (#14901)
4981 input.setAttribute( "type", "radio" );
4982 input.setAttribute( "checked", "checked" );
4983 input.setAttribute( "name", "t" );
4984
4985 div.appendChild( input );
4986
4987 // Support: Android <=4.1 only
4988 // Older WebKit doesn't clone checked state correctly in fragments
4989 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4990
4991 // Support: IE <=11 only
4992 // Make sure textarea (and checkbox) defaultValue is properly cloned
4993 div.innerHTML = "<textarea>x</textarea>";
4994 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4995} )();
4996
4997
4998var
4999 rkeyEvent = /^key/,
5000 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
5001 rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5002
5003function returnTrue() {
5004 return true;
5005}
5006
5007function returnFalse() {
5008 return false;
5009}
5010
5011// Support: IE <=9 - 11+
5012// focus() and blur() are asynchronous, except when they are no-op.
5013// So expect focus to be synchronous when the element is already active,
5014// and blur to be synchronous when the element is not already active.
5015// (focus and blur are always synchronous in other supported browsers,
5016// this just defines when we can count on it).
5017function expectSync( elem, type ) {
5018 return ( elem === safeActiveElement() ) === ( type === "focus" );
5019}
5020
5021// Support: IE <=9 only
5022// Accessing document.activeElement can throw unexpectedly
5023// https://bugs.jquery.com/ticket/13393
5024function safeActiveElement() {
5025 try {
5026 return document.activeElement;
5027 } catch ( err ) { }
5028}
5029
5030function on( elem, types, selector, data, fn, one ) {
5031 var origFn, type;
5032
5033 // Types can be a map of types/handlers
5034 if ( typeof types === "object" ) {
5035
5036 // ( types-Object, selector, data )
5037 if ( typeof selector !== "string" ) {
5038
5039 // ( types-Object, data )
5040 data = data || selector;
5041 selector = undefined;
5042 }
5043 for ( type in types ) {
5044 on( elem, type, selector, data, types[ type ], one );
5045 }
5046 return elem;
5047 }
5048
5049 if ( data == null && fn == null ) {
5050
5051 // ( types, fn )
5052 fn = selector;
5053 data = selector = undefined;
5054 } else if ( fn == null ) {
5055 if ( typeof selector === "string" ) {
5056
5057 // ( types, selector, fn )
5058 fn = data;
5059 data = undefined;
5060 } else {
5061
5062 // ( types, data, fn )
5063 fn = data;
5064 data = selector;
5065 selector = undefined;
5066 }
5067 }
5068 if ( fn === false ) {
5069 fn = returnFalse;
5070 } else if ( !fn ) {
5071 return elem;
5072 }
5073
5074 if ( one === 1 ) {
5075 origFn = fn;
5076 fn = function( event ) {
5077
5078 // Can use an empty set, since event contains the info
5079 jQuery().off( event );
5080 return origFn.apply( this, arguments );
5081 };
5082
5083 // Use same guid so caller can remove using origFn
5084 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5085 }
5086 return elem.each( function() {
5087 jQuery.event.add( this, types, fn, data, selector );
5088 } );
5089}
5090
5091/*
5092 * Helper functions for managing events -- not part of the public interface.
5093 * Props to Dean Edwards' addEvent library for many of the ideas.
5094 */
5095jQuery.event = {
5096
5097 global: {},
5098
5099 add: function( elem, types, handler, data, selector ) {
5100
5101 var handleObjIn, eventHandle, tmp,
5102 events, t, handleObj,
5103 special, handlers, type, namespaces, origType,
5104 elemData = dataPriv.get( elem );
5105
5106 // Don't attach events to noData or text/comment nodes (but allow plain objects)
5107 if ( !elemData ) {
5108 return;
5109 }
5110
5111 // Caller can pass in an object of custom data in lieu of the handler
5112 if ( handler.handler ) {
5113 handleObjIn = handler;
5114 handler = handleObjIn.handler;
5115 selector = handleObjIn.selector;
5116 }
5117
5118 // Ensure that invalid selectors throw exceptions at attach time
5119 // Evaluate against documentElement in case elem is a non-element node (e.g., document)
5120 if ( selector ) {
5121 jQuery.find.matchesSelector( documentElement, selector );
5122 }
5123
5124 // Make sure that the handler has a unique ID, used to find/remove it later
5125 if ( !handler.guid ) {
5126 handler.guid = jQuery.guid++;
5127 }
5128
5129 // Init the element's event structure and main handler, if this is the first
5130 if ( !( events = elemData.events ) ) {
5131 events = elemData.events = {};
5132 }
5133 if ( !( eventHandle = elemData.handle ) ) {
5134 eventHandle = elemData.handle = function( e ) {
5135
5136 // Discard the second event of a jQuery.event.trigger() and
5137 // when an event is called after a page has unloaded
5138 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
5139 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
5140 };
5141 }
5142
5143 // Handle multiple events separated by a space
5144 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5145 t = types.length;
5146 while ( t-- ) {
5147 tmp = rtypenamespace.exec( types[ t ] ) || [];
5148 type = origType = tmp[ 1 ];
5149 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5150
5151 // There *must* be a type, no attaching namespace-only handlers
5152 if ( !type ) {
5153 continue;
5154 }
5155
5156 // If event changes its type, use the special event handlers for the changed type
5157 special = jQuery.event.special[ type ] || {};
5158
5159 // If selector defined, determine special event api type, otherwise given type
5160 type = ( selector ? special.delegateType : special.bindType ) || type;
5161
5162 // Update special based on newly reset type
5163 special = jQuery.event.special[ type ] || {};
5164
5165 // handleObj is passed to all event handlers
5166 handleObj = jQuery.extend( {
5167 type: type,
5168 origType: origType,
5169 data: data,
5170 handler: handler,
5171 guid: handler.guid,
5172 selector: selector,
5173 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
5174 namespace: namespaces.join( "." )
5175 }, handleObjIn );
5176
5177 // Init the event handler queue if we're the first
5178 if ( !( handlers = events[ type ] ) ) {
5179 handlers = events[ type ] = [];
5180 handlers.delegateCount = 0;
5181
5182 // Only use addEventListener if the special events handler returns false
5183 if ( !special.setup ||
5184 special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
5185
5186 if ( elem.addEventListener ) {
5187 elem.addEventListener( type, eventHandle );
5188 }
5189 }
5190 }
5191
5192 if ( special.add ) {
5193 special.add.call( elem, handleObj );
5194
5195 if ( !handleObj.handler.guid ) {
5196 handleObj.handler.guid = handler.guid;
5197 }
5198 }
5199
5200 // Add to the element's handler list, delegates in front
5201 if ( selector ) {
5202 handlers.splice( handlers.delegateCount++, 0, handleObj );
5203 } else {
5204 handlers.push( handleObj );
5205 }
5206
5207 // Keep track of which events have ever been used, for event optimization
5208 jQuery.event.global[ type ] = true;
5209 }
5210
5211 },
5212
5213 // Detach an event or set of events from an element
5214 remove: function( elem, types, handler, selector, mappedTypes ) {
5215
5216 var j, origCount, tmp,
5217 events, t, handleObj,
5218 special, handlers, type, namespaces, origType,
5219 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
5220
5221 if ( !elemData || !( events = elemData.events ) ) {
5222 return;
5223 }
5224
5225 // Once for each type.namespace in types; type may be omitted
5226 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5227 t = types.length;
5228 while ( t-- ) {
5229 tmp = rtypenamespace.exec( types[ t ] ) || [];
5230 type = origType = tmp[ 1 ];
5231 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5232
5233 // Unbind all events (on this namespace, if provided) for the element
5234 if ( !type ) {
5235 for ( type in events ) {
5236 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
5237 }
5238 continue;
5239 }
5240
5241 special = jQuery.event.special[ type ] || {};
5242 type = ( selector ? special.delegateType : special.bindType ) || type;
5243 handlers = events[ type ] || [];
5244 tmp = tmp[ 2 ] &&
5245 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
5246
5247 // Remove matching events
5248 origCount = j = handlers.length;
5249 while ( j-- ) {
5250 handleObj = handlers[ j ];
5251
5252 if ( ( mappedTypes || origType === handleObj.origType ) &&
5253 ( !handler || handler.guid === handleObj.guid ) &&
5254 ( !tmp || tmp.test( handleObj.namespace ) ) &&
5255 ( !selector || selector === handleObj.selector ||
5256 selector === "**" && handleObj.selector ) ) {
5257 handlers.splice( j, 1 );
5258
5259 if ( handleObj.selector ) {
5260 handlers.delegateCount--;
5261 }
5262 if ( special.remove ) {
5263 special.remove.call( elem, handleObj );
5264 }
5265 }
5266 }
5267
5268 // Remove generic event handler if we removed something and no more handlers exist
5269 // (avoids potential for endless recursion during removal of special event handlers)
5270 if ( origCount && !handlers.length ) {
5271 if ( !special.teardown ||
5272 special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
5273
5274 jQuery.removeEvent( elem, type, elemData.handle );
5275 }
5276
5277 delete events[ type ];
5278 }
5279 }
5280
5281 // Remove data and the expando if it's no longer used
5282 if ( jQuery.isEmptyObject( events ) ) {
5283 dataPriv.remove( elem, "handle events" );
5284 }
5285 },
5286
5287 dispatch: function( nativeEvent ) {
5288
5289 // Make a writable jQuery.Event from the native event object
5290 var event = jQuery.event.fix( nativeEvent );
5291
5292 var i, j, ret, matched, handleObj, handlerQueue,
5293 args = new Array( arguments.length ),
5294 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
5295 special = jQuery.event.special[ event.type ] || {};
5296
5297 // Use the fix-ed jQuery.Event rather than the (read-only) native event
5298 args[ 0 ] = event;
5299
5300 for ( i = 1; i < arguments.length; i++ ) {
5301 args[ i ] = arguments[ i ];
5302 }
5303
5304 event.delegateTarget = this;
5305
5306 // Call the preDispatch hook for the mapped type, and let it bail if desired
5307 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5308 return;
5309 }
5310
5311 // Determine handlers
5312 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5313
5314 // Run delegates first; they may want to stop propagation beneath us
5315 i = 0;
5316 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
5317 event.currentTarget = matched.elem;
5318
5319 j = 0;
5320 while ( ( handleObj = matched.handlers[ j++ ] ) &&
5321 !event.isImmediatePropagationStopped() ) {
5322
5323 // If the event is namespaced, then each handler is only invoked if it is
5324 // specially universal or its namespaces are a superset of the event's.
5325 if ( !event.rnamespace || handleObj.namespace === false ||
5326 event.rnamespace.test( handleObj.namespace ) ) {
5327
5328 event.handleObj = handleObj;
5329 event.data = handleObj.data;
5330
5331 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
5332 handleObj.handler ).apply( matched.elem, args );
5333
5334 if ( ret !== undefined ) {
5335 if ( ( event.result = ret ) === false ) {
5336 event.preventDefault();
5337 event.stopPropagation();
5338 }
5339 }
5340 }
5341 }
5342 }
5343
5344 // Call the postDispatch hook for the mapped type
5345 if ( special.postDispatch ) {
5346 special.postDispatch.call( this, event );
5347 }
5348
5349 return event.result;
5350 },
5351
5352 handlers: function( event, handlers ) {
5353 var i, handleObj, sel, matchedHandlers, matchedSelectors,
5354 handlerQueue = [],
5355 delegateCount = handlers.delegateCount,
5356 cur = event.target;
5357
5358 // Find delegate handlers
5359 if ( delegateCount &&
5360
5361 // Support: IE <=9
5362 // Black-hole SVG <use> instance trees (trac-13180)
5363 cur.nodeType &&
5364
5365 // Support: Firefox <=42
5366 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
5367 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
5368 // Support: IE 11 only
5369 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
5370 !( event.type === "click" && event.button >= 1 ) ) {
5371
5372 for ( ; cur !== this; cur = cur.parentNode || this ) {
5373
5374 // Don't check non-elements (#13208)
5375 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5376 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5377 matchedHandlers = [];
5378 matchedSelectors = {};
5379 for ( i = 0; i < delegateCount; i++ ) {
5380 handleObj = handlers[ i ];
5381
5382 // Don't conflict with Object.prototype properties (#13203)
5383 sel = handleObj.selector + " ";
5384
5385 if ( matchedSelectors[ sel ] === undefined ) {
5386 matchedSelectors[ sel ] = handleObj.needsContext ?
5387 jQuery( sel, this ).index( cur ) > -1 :
5388 jQuery.find( sel, this, null, [ cur ] ).length;
5389 }
5390 if ( matchedSelectors[ sel ] ) {
5391 matchedHandlers.push( handleObj );
5392 }
5393 }
5394 if ( matchedHandlers.length ) {
5395 handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
5396 }
5397 }
5398 }
5399 }
5400
5401 // Add the remaining (directly-bound) handlers
5402 cur = this;
5403 if ( delegateCount < handlers.length ) {
5404 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
5405 }
5406
5407 return handlerQueue;
5408 },
5409
5410 addProp: function( name, hook ) {
5411 Object.defineProperty( jQuery.Event.prototype, name, {
5412 enumerable: true,
5413 configurable: true,
5414
5415 get: isFunction( hook ) ?
5416 function() {
5417 if ( this.originalEvent ) {
5418 return hook( this.originalEvent );
5419 }
5420 } :
5421 function() {
5422 if ( this.originalEvent ) {
5423 return this.originalEvent[ name ];
5424 }
5425 },
5426
5427 set: function( value ) {
5428 Object.defineProperty( this, name, {
5429 enumerable: true,
5430 configurable: true,
5431 writable: true,
5432 value: value
5433 } );
5434 }
5435 } );
5436 },
5437
5438 fix: function( originalEvent ) {
5439 return originalEvent[ jQuery.expando ] ?
5440 originalEvent :
5441 new jQuery.Event( originalEvent );
5442 },
5443
5444 special: {
5445 load: {
5446
5447 // Prevent triggered image.load events from bubbling to window.load
5448 noBubble: true
5449 },
5450 click: {
5451
5452 // Utilize native event to ensure correct state for checkable inputs
5453 setup: function( data ) {
5454
5455 // For mutual compressibility with _default, replace `this` access with a local var.
5456 // `|| data` is dead code meant only to preserve the variable through minification.
5457 var el = this || data;
5458
5459 // Claim the first handler
5460 if ( rcheckableType.test( el.type ) &&
5461 el.click && nodeName( el, "input" ) ) {
5462
5463 // dataPriv.set( el, "click", ... )
5464 leverageNative( el, "click", returnTrue );
5465 }
5466
5467 // Return false to allow normal processing in the caller
5468 return false;
5469 },
5470 trigger: function( data ) {
5471
5472 // For mutual compressibility with _default, replace `this` access with a local var.
5473 // `|| data` is dead code meant only to preserve the variable through minification.
5474 var el = this || data;
5475
5476 // Force setup before triggering a click
5477 if ( rcheckableType.test( el.type ) &&
5478 el.click && nodeName( el, "input" ) ) {
5479
5480 leverageNative( el, "click" );
5481 }
5482
5483 // Return non-false to allow normal event-path propagation
5484 return true;
5485 },
5486
5487 // For cross-browser consistency, suppress native .click() on links
5488 // Also prevent it if we're currently inside a leveraged native-event stack
5489 _default: function( event ) {
5490 var target = event.target;
5491 return rcheckableType.test( target.type ) &&
5492 target.click && nodeName( target, "input" ) &&
5493 dataPriv.get( target, "click" ) ||
5494 nodeName( target, "a" );
5495 }
5496 },
5497
5498 beforeunload: {
5499 postDispatch: function( event ) {
5500
5501 // Support: Firefox 20+
5502 // Firefox doesn't alert if the returnValue field is not set.
5503 if ( event.result !== undefined && event.originalEvent ) {
5504 event.originalEvent.returnValue = event.result;
5505 }
5506 }
5507 }
5508 }
5509};
5510
5511// Ensure the presence of an event listener that handles manually-triggered
5512// synthetic events by interrupting progress until reinvoked in response to
5513// *native* events that it fires directly, ensuring that state changes have
5514// already occurred before other listeners are invoked.
5515function leverageNative( el, type, expectSync ) {
5516
5517 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
5518 if ( !expectSync ) {
5519 if ( dataPriv.get( el, type ) === undefined ) {
5520 jQuery.event.add( el, type, returnTrue );
5521 }
5522 return;
5523 }
5524
5525 // Register the controller as a special universal handler for all event namespaces
5526 dataPriv.set( el, type, false );
5527 jQuery.event.add( el, type, {
5528 namespace: false,
5529 handler: function( event ) {
5530 var notAsync, result,
5531 saved = dataPriv.get( this, type );
5532
5533 if ( ( event.isTrigger & 1 ) && this[ type ] ) {
5534
5535 // Interrupt processing of the outer synthetic .trigger()ed event
5536 // Saved data should be false in such cases, but might be a leftover capture object
5537 // from an async native handler (gh-4350)
5538 if ( !saved.length ) {
5539
5540 // Store arguments for use when handling the inner native event
5541 // There will always be at least one argument (an event object), so this array
5542 // will not be confused with a leftover capture object.
5543 saved = slice.call( arguments );
5544 dataPriv.set( this, type, saved );
5545
5546 // Trigger the native event and capture its result
5547 // Support: IE <=9 - 11+
5548 // focus() and blur() are asynchronous
5549 notAsync = expectSync( this, type );
5550 this[ type ]();
5551 result = dataPriv.get( this, type );
5552 if ( saved !== result || notAsync ) {
5553 dataPriv.set( this, type, false );
5554 } else {
5555 result = {};
5556 }
5557 if ( saved !== result ) {
5558
5559 // Cancel the outer synthetic event
5560 event.stopImmediatePropagation();
5561 event.preventDefault();
5562 return result.value;
5563 }
5564
5565 // If this is an inner synthetic event for an event with a bubbling surrogate
5566 // (focus or blur), assume that the surrogate already propagated from triggering the
5567 // native event and prevent that from happening again here.
5568 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
5569 // bubbling surrogate propagates *after* the non-bubbling base), but that seems
5570 // less bad than duplication.
5571 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
5572 event.stopPropagation();
5573 }
5574
5575 // If this is a native event triggered above, everything is now in order
5576 // Fire an inner synthetic event with the original arguments
5577 } else if ( saved.length ) {
5578
5579 // ...and capture the result
5580 dataPriv.set( this, type, {
5581 value: jQuery.event.trigger(
5582
5583 // Support: IE <=9 - 11+
5584 // Extend with the prototype to reset the above stopImmediatePropagation()
5585 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
5586 saved.slice( 1 ),
5587 this
5588 )
5589 } );
5590
5591 // Abort handling of the native event
5592 event.stopImmediatePropagation();
5593 }
5594 }
5595 } );
5596}
5597
5598jQuery.removeEvent = function( elem, type, handle ) {
5599
5600 // This "if" is needed for plain objects
5601 if ( elem.removeEventListener ) {
5602 elem.removeEventListener( type, handle );
5603 }
5604};
5605
5606jQuery.Event = function( src, props ) {
5607
5608 // Allow instantiation without the 'new' keyword
5609 if ( !( this instanceof jQuery.Event ) ) {
5610 return new jQuery.Event( src, props );
5611 }
5612
5613 // Event object
5614 if ( src && src.type ) {
5615 this.originalEvent = src;
5616 this.type = src.type;
5617
5618 // Events bubbling up the document may have been marked as prevented
5619 // by a handler lower down the tree; reflect the correct value.
5620 this.isDefaultPrevented = src.defaultPrevented ||
5621 src.defaultPrevented === undefined &&
5622
5623 // Support: Android <=2.3 only
5624 src.returnValue === false ?
5625 returnTrue :
5626 returnFalse;
5627
5628 // Create target properties
5629 // Support: Safari <=6 - 7 only
5630 // Target should not be a text node (#504, #13143)
5631 this.target = ( src.target && src.target.nodeType === 3 ) ?
5632 src.target.parentNode :
5633 src.target;
5634
5635 this.currentTarget = src.currentTarget;
5636 this.relatedTarget = src.relatedTarget;
5637
5638 // Event type
5639 } else {
5640 this.type = src;
5641 }
5642
5643 // Put explicitly provided properties onto the event object
5644 if ( props ) {
5645 jQuery.extend( this, props );
5646 }
5647
5648 // Create a timestamp if incoming event doesn't have one
5649 this.timeStamp = src && src.timeStamp || Date.now();
5650
5651 // Mark it as fixed
5652 this[ jQuery.expando ] = true;
5653};
5654
5655// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5656// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5657jQuery.Event.prototype = {
5658 constructor: jQuery.Event,
5659 isDefaultPrevented: returnFalse,
5660 isPropagationStopped: returnFalse,
5661 isImmediatePropagationStopped: returnFalse,
5662 isSimulated: false,
5663
5664 preventDefault: function() {
5665 var e = this.originalEvent;
5666
5667 this.isDefaultPrevented = returnTrue;
5668
5669 if ( e && !this.isSimulated ) {
5670 e.preventDefault();
5671 }
5672 },
5673 stopPropagation: function() {
5674 var e = this.originalEvent;
5675
5676 this.isPropagationStopped = returnTrue;
5677
5678 if ( e && !this.isSimulated ) {
5679 e.stopPropagation();
5680 }
5681 },
5682 stopImmediatePropagation: function() {
5683 var e = this.originalEvent;
5684
5685 this.isImmediatePropagationStopped = returnTrue;
5686
5687 if ( e && !this.isSimulated ) {
5688 e.stopImmediatePropagation();
5689 }
5690
5691 this.stopPropagation();
5692 }
5693};
5694
5695// Includes all common event props including KeyEvent and MouseEvent specific props
5696jQuery.each( {
5697 altKey: true,
5698 bubbles: true,
5699 cancelable: true,
5700 changedTouches: true,
5701 ctrlKey: true,
5702 detail: true,
5703 eventPhase: true,
5704 metaKey: true,
5705 pageX: true,
5706 pageY: true,
5707 shiftKey: true,
5708 view: true,
5709 "char": true,
5710 code: true,
5711 charCode: true,
5712 key: true,
5713 keyCode: true,
5714 button: true,
5715 buttons: true,
5716 clientX: true,
5717 clientY: true,
5718 offsetX: true,
5719 offsetY: true,
5720 pointerId: true,
5721 pointerType: true,
5722 screenX: true,
5723 screenY: true,
5724 targetTouches: true,
5725 toElement: true,
5726 touches: true,
5727
5728 which: function( event ) {
5729 var button = event.button;
5730
5731 // Add which for key events
5732 if ( event.which == null && rkeyEvent.test( event.type ) ) {
5733 return event.charCode != null ? event.charCode : event.keyCode;
5734 }
5735
5736 // Add which for click: 1 === left; 2 === middle; 3 === right
5737 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
5738 if ( button & 1 ) {
5739 return 1;
5740 }
5741
5742 if ( button & 2 ) {
5743 return 3;
5744 }
5745
5746 if ( button & 4 ) {
5747 return 2;
5748 }
5749
5750 return 0;
5751 }
5752
5753 return event.which;
5754 }
5755}, jQuery.event.addProp );
5756
5757jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
5758 jQuery.event.special[ type ] = {
5759
5760 // Utilize native event if possible so blur/focus sequence is correct
5761 setup: function() {
5762
5763 // Claim the first handler
5764 // dataPriv.set( this, "focus", ... )
5765 // dataPriv.set( this, "blur", ... )
5766 leverageNative( this, type, expectSync );
5767
5768 // Return false to allow normal processing in the caller
5769 return false;
5770 },
5771 trigger: function() {
5772
5773 // Force setup before trigger
5774 leverageNative( this, type );
5775
5776 // Return non-false to allow normal event-path propagation
5777 return true;
5778 },
5779
5780 delegateType: delegateType
5781 };
5782} );
5783
5784// Create mouseenter/leave events using mouseover/out and event-time checks
5785// so that event delegation works in jQuery.
5786// Do the same for pointerenter/pointerleave and pointerover/pointerout
5787//
5788// Support: Safari 7 only
5789// Safari sends mouseenter too often; see:
5790// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
5791// for the description of the bug (it existed in older Chrome versions as well).
5792jQuery.each( {
5793 mouseenter: "mouseover",
5794 mouseleave: "mouseout",
5795 pointerenter: "pointerover",
5796 pointerleave: "pointerout"
5797}, function( orig, fix ) {
5798 jQuery.event.special[ orig ] = {
5799 delegateType: fix,
5800 bindType: fix,
5801
5802 handle: function( event ) {
5803 var ret,
5804 target = this,
5805 related = event.relatedTarget,
5806 handleObj = event.handleObj;
5807
5808 // For mouseenter/leave call the handler if related is outside the target.
5809 // NB: No relatedTarget if the mouse left/entered the browser window
5810 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
5811 event.type = handleObj.origType;
5812 ret = handleObj.handler.apply( this, arguments );
5813 event.type = fix;
5814 }
5815 return ret;
5816 }
5817 };
5818} );
5819
5820jQuery.fn.extend( {
5821
5822 on: function( types, selector, data, fn ) {
5823 return on( this, types, selector, data, fn );
5824 },
5825 one: function( types, selector, data, fn ) {
5826 return on( this, types, selector, data, fn, 1 );
5827 },
5828 off: function( types, selector, fn ) {
5829 var handleObj, type;
5830 if ( types && types.preventDefault && types.handleObj ) {
5831
5832 // ( event ) dispatched jQuery.Event
5833 handleObj = types.handleObj;
5834 jQuery( types.delegateTarget ).off(
5835 handleObj.namespace ?
5836 handleObj.origType + "." + handleObj.namespace :
5837 handleObj.origType,
5838 handleObj.selector,
5839 handleObj.handler
5840 );
5841 return this;
5842 }
5843 if ( typeof types === "object" ) {
5844
5845 // ( types-object [, selector] )
5846 for ( type in types ) {
5847 this.off( type, selector, types[ type ] );
5848 }
5849 return this;
5850 }
5851 if ( selector === false || typeof selector === "function" ) {
5852
5853 // ( types [, fn] )
5854 fn = selector;
5855 selector = undefined;
5856 }
5857 if ( fn === false ) {
5858 fn = returnFalse;
5859 }
5860 return this.each( function() {
5861 jQuery.event.remove( this, types, fn, selector );
5862 } );
5863 }
5864} );
5865
5866
5867var
5868
5869 /* eslint-disable max-len */
5870
5871 // See https://github.com/eslint/eslint/issues/3229
5872 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
5873
5874 /* eslint-enable */
5875
5876 // Support: IE <=10 - 11, Edge 12 - 13 only
5877 // In IE/Edge using regex groups here causes severe slowdowns.
5878 // See https://connect.microsoft.com/IE/feedback/details/1736512/
5879 rnoInnerhtml = /<script|<style|<link/i,
5880
5881 // checked="checked" or checked
5882 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5883 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5884
5885// Prefer a tbody over its parent table for containing new rows
5886function manipulationTarget( elem, content ) {
5887 if ( nodeName( elem, "table" ) &&
5888 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
5889
5890 return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
5891 }
5892
5893 return elem;
5894}
5895
5896// Replace/restore the type attribute of script elements for safe DOM manipulation
5897function disableScript( elem ) {
5898 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
5899 return elem;
5900}
5901function restoreScript( elem ) {
5902 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
5903 elem.type = elem.type.slice( 5 );
5904 } else {
5905 elem.removeAttribute( "type" );
5906 }
5907
5908 return elem;
5909}
5910
5911function cloneCopyEvent( src, dest ) {
5912 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
5913
5914 if ( dest.nodeType !== 1 ) {
5915 return;
5916 }
5917
5918 // 1. Copy private data: events, handlers, etc.
5919 if ( dataPriv.hasData( src ) ) {
5920 pdataOld = dataPriv.access( src );
5921 pdataCur = dataPriv.set( dest, pdataOld );
5922 events = pdataOld.events;
5923
5924 if ( events ) {
5925 delete pdataCur.handle;
5926 pdataCur.events = {};
5927
5928 for ( type in events ) {
5929 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5930 jQuery.event.add( dest, type, events[ type ][ i ] );
5931 }
5932 }
5933 }
5934 }
5935
5936 // 2. Copy user data
5937 if ( dataUser.hasData( src ) ) {
5938 udataOld = dataUser.access( src );
5939 udataCur = jQuery.extend( {}, udataOld );
5940
5941 dataUser.set( dest, udataCur );
5942 }
5943}
5944
5945// Fix IE bugs, see support tests
5946function fixInput( src, dest ) {
5947 var nodeName = dest.nodeName.toLowerCase();
5948
5949 // Fails to persist the checked state of a cloned checkbox or radio button.
5950 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5951 dest.checked = src.checked;
5952
5953 // Fails to return the selected option to the default selected state when cloning options
5954 } else if ( nodeName === "input" || nodeName === "textarea" ) {
5955 dest.defaultValue = src.defaultValue;
5956 }
5957}
5958
5959function domManip( collection, args, callback, ignored ) {
5960
5961 // Flatten any nested arrays
5962 args = concat.apply( [], args );
5963
5964 var fragment, first, scripts, hasScripts, node, doc,
5965 i = 0,
5966 l = collection.length,
5967 iNoClone = l - 1,
5968 value = args[ 0 ],
5969 valueIsFunction = isFunction( value );
5970
5971 // We can't cloneNode fragments that contain checked, in WebKit
5972 if ( valueIsFunction ||
5973 ( l > 1 && typeof value === "string" &&
5974 !support.checkClone && rchecked.test( value ) ) ) {
5975 return collection.each( function( index ) {
5976 var self = collection.eq( index );
5977 if ( valueIsFunction ) {
5978 args[ 0 ] = value.call( this, index, self.html() );
5979 }
5980 domManip( self, args, callback, ignored );
5981 } );
5982 }
5983
5984 if ( l ) {
5985 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
5986 first = fragment.firstChild;
5987
5988 if ( fragment.childNodes.length === 1 ) {
5989 fragment = first;
5990 }
5991
5992 // Require either new content or an interest in ignored elements to invoke the callback
5993 if ( first || ignored ) {
5994 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5995 hasScripts = scripts.length;
5996
5997 // Use the original fragment for the last item
5998 // instead of the first because it can end up
5999 // being emptied incorrectly in certain situations (#8070).
6000 for ( ; i < l; i++ ) {
6001 node = fragment;
6002
6003 if ( i !== iNoClone ) {
6004 node = jQuery.clone( node, true, true );
6005
6006 // Keep references to cloned scripts for later restoration
6007 if ( hasScripts ) {
6008
6009 // Support: Android <=4.0 only, PhantomJS 1 only
6010 // push.apply(_, arraylike) throws on ancient WebKit
6011 jQuery.merge( scripts, getAll( node, "script" ) );
6012 }
6013 }
6014
6015 callback.call( collection[ i ], node, i );
6016 }
6017
6018 if ( hasScripts ) {
6019 doc = scripts[ scripts.length - 1 ].ownerDocument;
6020
6021 // Reenable scripts
6022 jQuery.map( scripts, restoreScript );
6023
6024 // Evaluate executable scripts on first document insertion
6025 for ( i = 0; i < hasScripts; i++ ) {
6026 node = scripts[ i ];
6027 if ( rscriptType.test( node.type || "" ) &&
6028 !dataPriv.access( node, "globalEval" ) &&
6029 jQuery.contains( doc, node ) ) {
6030
6031 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
6032
6033 // Optional AJAX dependency, but won't run scripts if not present
6034 if ( jQuery._evalUrl && !node.noModule ) {
6035 jQuery._evalUrl( node.src, {
6036 nonce: node.nonce || node.getAttribute( "nonce" )
6037 } );
6038 }
6039 } else {
6040 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
6041 }
6042 }
6043 }
6044 }
6045 }
6046 }
6047
6048 return collection;
6049}
6050
6051function remove( elem, selector, keepData ) {
6052 var node,
6053 nodes = selector ? jQuery.filter( selector, elem ) : elem,
6054 i = 0;
6055
6056 for ( ; ( node = nodes[ i ] ) != null; i++ ) {
6057 if ( !keepData && node.nodeType === 1 ) {
6058 jQuery.cleanData( getAll( node ) );
6059 }
6060
6061 if ( node.parentNode ) {
6062 if ( keepData && isAttached( node ) ) {
6063 setGlobalEval( getAll( node, "script" ) );
6064 }
6065 node.parentNode.removeChild( node );
6066 }
6067 }
6068
6069 return elem;
6070}
6071
6072jQuery.extend( {
6073 htmlPrefilter: function( html ) {
6074 return html.replace( rxhtmlTag, "<$1></$2>" );
6075 },
6076
6077 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6078 var i, l, srcElements, destElements,
6079 clone = elem.cloneNode( true ),
6080 inPage = isAttached( elem );
6081
6082 // Fix IE cloning issues
6083 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
6084 !jQuery.isXMLDoc( elem ) ) {
6085
6086 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
6087 destElements = getAll( clone );
6088 srcElements = getAll( elem );
6089
6090 for ( i = 0, l = srcElements.length; i < l; i++ ) {
6091 fixInput( srcElements[ i ], destElements[ i ] );
6092 }
6093 }
6094
6095 // Copy the events from the original to the clone
6096 if ( dataAndEvents ) {
6097 if ( deepDataAndEvents ) {
6098 srcElements = srcElements || getAll( elem );
6099 destElements = destElements || getAll( clone );
6100
6101 for ( i = 0, l = srcElements.length; i < l; i++ ) {
6102 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
6103 }
6104 } else {
6105 cloneCopyEvent( elem, clone );
6106 }
6107 }
6108
6109 // Preserve script evaluation history
6110 destElements = getAll( clone, "script" );
6111 if ( destElements.length > 0 ) {
6112 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
6113 }
6114
6115 // Return the cloned set
6116 return clone;
6117 },
6118
6119 cleanData: function( elems ) {
6120 var data, elem, type,
6121 special = jQuery.event.special,
6122 i = 0;
6123
6124 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
6125 if ( acceptData( elem ) ) {
6126 if ( ( data = elem[ dataPriv.expando ] ) ) {
6127 if ( data.events ) {
6128 for ( type in data.events ) {
6129 if ( special[ type ] ) {
6130 jQuery.event.remove( elem, type );
6131
6132 // This is a shortcut to avoid jQuery.event.remove's overhead
6133 } else {
6134 jQuery.removeEvent( elem, type, data.handle );
6135 }
6136 }
6137 }
6138
6139 // Support: Chrome <=35 - 45+
6140 // Assign undefined instead of using delete, see Data#remove
6141 elem[ dataPriv.expando ] = undefined;
6142 }
6143 if ( elem[ dataUser.expando ] ) {
6144
6145 // Support: Chrome <=35 - 45+
6146 // Assign undefined instead of using delete, see Data#remove
6147 elem[ dataUser.expando ] = undefined;
6148 }
6149 }
6150 }
6151 }
6152} );
6153
6154jQuery.fn.extend( {
6155 detach: function( selector ) {
6156 return remove( this, selector, true );
6157 },
6158
6159 remove: function( selector ) {
6160 return remove( this, selector );
6161 },
6162
6163 text: function( value ) {
6164 return access( this, function( value ) {
6165 return value === undefined ?
6166 jQuery.text( this ) :
6167 this.empty().each( function() {
6168 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6169 this.textContent = value;
6170 }
6171 } );
6172 }, null, value, arguments.length );
6173 },
6174
6175 append: function() {
6176 return domManip( this, arguments, function( elem ) {
6177 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6178 var target = manipulationTarget( this, elem );
6179 target.appendChild( elem );
6180 }
6181 } );
6182 },
6183
6184 prepend: function() {
6185 return domManip( this, arguments, function( elem ) {
6186 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6187 var target = manipulationTarget( this, elem );
6188 target.insertBefore( elem, target.firstChild );
6189 }
6190 } );
6191 },
6192
6193 before: function() {
6194 return domManip( this, arguments, function( elem ) {
6195 if ( this.parentNode ) {
6196 this.parentNode.insertBefore( elem, this );
6197 }
6198 } );
6199 },
6200
6201 after: function() {
6202 return domManip( this, arguments, function( elem ) {
6203 if ( this.parentNode ) {
6204 this.parentNode.insertBefore( elem, this.nextSibling );
6205 }
6206 } );
6207 },
6208
6209 empty: function() {
6210 var elem,
6211 i = 0;
6212
6213 for ( ; ( elem = this[ i ] ) != null; i++ ) {
6214 if ( elem.nodeType === 1 ) {
6215
6216 // Prevent memory leaks
6217 jQuery.cleanData( getAll( elem, false ) );
6218
6219 // Remove any remaining nodes
6220 elem.textContent = "";
6221 }
6222 }
6223
6224 return this;
6225 },
6226
6227 clone: function( dataAndEvents, deepDataAndEvents ) {
6228 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6229 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6230
6231 return this.map( function() {
6232 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
6233 } );
6234 },
6235
6236 html: function( value ) {
6237 return access( this, function( value ) {
6238 var elem = this[ 0 ] || {},
6239 i = 0,
6240 l = this.length;
6241
6242 if ( value === undefined && elem.nodeType === 1 ) {
6243 return elem.innerHTML;
6244 }
6245
6246 // See if we can take a shortcut and just use innerHTML
6247 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
6248 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
6249
6250 value = jQuery.htmlPrefilter( value );
6251
6252 try {
6253 for ( ; i < l; i++ ) {
6254 elem = this[ i ] || {};
6255
6256 // Remove element nodes and prevent memory leaks
6257 if ( elem.nodeType === 1 ) {
6258 jQuery.cleanData( getAll( elem, false ) );
6259 elem.innerHTML = value;
6260 }
6261 }
6262
6263 elem = 0;
6264
6265 // If using innerHTML throws an exception, use the fallback method
6266 } catch ( e ) {}
6267 }
6268
6269 if ( elem ) {
6270 this.empty().append( value );
6271 }
6272 }, null, value, arguments.length );
6273 },
6274
6275 replaceWith: function() {
6276 var ignored = [];
6277
6278 // Make the changes, replacing each non-ignored context element with the new content
6279 return domManip( this, arguments, function( elem ) {
6280 var parent = this.parentNode;
6281
6282 if ( jQuery.inArray( this, ignored ) < 0 ) {
6283 jQuery.cleanData( getAll( this ) );
6284 if ( parent ) {
6285 parent.replaceChild( elem, this );
6286 }
6287 }
6288
6289 // Force callback invocation
6290 }, ignored );
6291 }
6292} );
6293
6294jQuery.each( {
6295 appendTo: "append",
6296 prependTo: "prepend",
6297 insertBefore: "before",
6298 insertAfter: "after",
6299 replaceAll: "replaceWith"
6300}, function( name, original ) {
6301 jQuery.fn[ name ] = function( selector ) {
6302 var elems,
6303 ret = [],
6304 insert = jQuery( selector ),
6305 last = insert.length - 1,
6306 i = 0;
6307
6308 for ( ; i <= last; i++ ) {
6309 elems = i === last ? this : this.clone( true );
6310 jQuery( insert[ i ] )[ original ]( elems );
6311
6312 // Support: Android <=4.0 only, PhantomJS 1 only
6313 // .get() because push.apply(_, arraylike) throws on ancient WebKit
6314 push.apply( ret, elems.get() );
6315 }
6316
6317 return this.pushStack( ret );
6318 };
6319} );
6320var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6321
6322var getStyles = function( elem ) {
6323
6324 // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6325 // IE throws on elements created in popups
6326 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6327 var view = elem.ownerDocument.defaultView;
6328
6329 if ( !view || !view.opener ) {
6330 view = window;
6331 }
6332
6333 return view.getComputedStyle( elem );
6334 };
6335
6336var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6337
6338
6339
6340( function() {
6341
6342 // Executing both pixelPosition & boxSizingReliable tests require only one layout
6343 // so they're executed at the same time to save the second computation.
6344 function computeStyleTests() {
6345
6346 // This is a singleton, we need to execute it only once
6347 if ( !div ) {
6348 return;
6349 }
6350
6351 container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
6352 "margin-top:1px;padding:0;border:0";
6353 div.style.cssText =
6354 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
6355 "margin:auto;border:1px;padding:1px;" +
6356 "width:60%;top:1%";
6357 documentElement.appendChild( container ).appendChild( div );
6358
6359 var divStyle = window.getComputedStyle( div );
6360 pixelPositionVal = divStyle.top !== "1%";
6361
6362 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
6363 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
6364
6365 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
6366 // Some styles come back with percentage values, even though they shouldn't
6367 div.style.right = "60%";
6368 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
6369
6370 // Support: IE 9 - 11 only
6371 // Detect misreporting of content dimensions for box-sizing:border-box elements
6372 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
6373
6374 // Support: IE 9 only
6375 // Detect overflow:scroll screwiness (gh-3699)
6376 // Support: Chrome <=64
6377 // Don't get tricked when zoom affects offsetWidth (gh-4029)
6378 div.style.position = "absolute";
6379 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
6380
6381 documentElement.removeChild( container );
6382
6383 // Nullify the div so it wouldn't be stored in the memory and
6384 // it will also be a sign that checks already performed
6385 div = null;
6386 }
6387
6388 function roundPixelMeasures( measure ) {
6389 return Math.round( parseFloat( measure ) );
6390 }
6391
6392 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
6393 reliableMarginLeftVal,
6394 container = document.createElement( "div" ),
6395 div = document.createElement( "div" );
6396
6397 // Finish early in limited (non-browser) environments
6398 if ( !div.style ) {
6399 return;
6400 }
6401
6402 // Support: IE <=9 - 11 only
6403 // Style of cloned element affects source element cloned (#8908)
6404 div.style.backgroundClip = "content-box";
6405 div.cloneNode( true ).style.backgroundClip = "";
6406 support.clearCloneStyle = div.style.backgroundClip === "content-box";
6407
6408 jQuery.extend( support, {
6409 boxSizingReliable: function() {
6410 computeStyleTests();
6411 return boxSizingReliableVal;
6412 },
6413 pixelBoxStyles: function() {
6414 computeStyleTests();
6415 return pixelBoxStylesVal;
6416 },
6417 pixelPosition: function() {
6418 computeStyleTests();
6419 return pixelPositionVal;
6420 },
6421 reliableMarginLeft: function() {
6422 computeStyleTests();
6423 return reliableMarginLeftVal;
6424 },
6425 scrollboxSize: function() {
6426 computeStyleTests();
6427 return scrollboxSizeVal;
6428 }
6429 } );
6430} )();
6431
6432
6433function curCSS( elem, name, computed ) {
6434 var width, minWidth, maxWidth, ret,
6435
6436 // Support: Firefox 51+
6437 // Retrieving style before computed somehow
6438 // fixes an issue with getting wrong values
6439 // on detached elements
6440 style = elem.style;
6441
6442 computed = computed || getStyles( elem );
6443
6444 // getPropertyValue is needed for:
6445 // .css('filter') (IE 9 only, #12537)
6446 // .css('--customProperty) (#3144)
6447 if ( computed ) {
6448 ret = computed.getPropertyValue( name ) || computed[ name ];
6449
6450 if ( ret === "" && !isAttached( elem ) ) {
6451 ret = jQuery.style( elem, name );
6452 }
6453
6454 // A tribute to the "awesome hack by Dean Edwards"
6455 // Android Browser returns percentage for some values,
6456 // but width seems to be reliably pixels.
6457 // This is against the CSSOM draft spec:
6458 // https://drafts.csswg.org/cssom/#resolved-values
6459 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
6460
6461 // Remember the original values
6462 width = style.width;
6463 minWidth = style.minWidth;
6464 maxWidth = style.maxWidth;
6465
6466 // Put in the new values to get a computed value out
6467 style.minWidth = style.maxWidth = style.width = ret;
6468 ret = computed.width;
6469
6470 // Revert the changed values
6471 style.width = width;
6472 style.minWidth = minWidth;
6473 style.maxWidth = maxWidth;
6474 }
6475 }
6476
6477 return ret !== undefined ?
6478
6479 // Support: IE <=9 - 11 only
6480 // IE returns zIndex value as an integer.
6481 ret + "" :
6482 ret;
6483}
6484
6485
6486function addGetHookIf( conditionFn, hookFn ) {
6487
6488 // Define the hook, we'll check on the first run if it's really needed.
6489 return {
6490 get: function() {
6491 if ( conditionFn() ) {
6492
6493 // Hook not needed (or it's not possible to use it due
6494 // to missing dependency), remove it.
6495 delete this.get;
6496 return;
6497 }
6498
6499 // Hook needed; redefine it so that the support test is not executed again.
6500 return ( this.get = hookFn ).apply( this, arguments );
6501 }
6502 };
6503}
6504
6505
6506var cssPrefixes = [ "Webkit", "Moz", "ms" ],
6507 emptyStyle = document.createElement( "div" ).style,
6508 vendorProps = {};
6509
6510// Return a vendor-prefixed property or undefined
6511function vendorPropName( name ) {
6512
6513 // Check for vendor prefixed names
6514 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
6515 i = cssPrefixes.length;
6516
6517 while ( i-- ) {
6518 name = cssPrefixes[ i ] + capName;
6519 if ( name in emptyStyle ) {
6520 return name;
6521 }
6522 }
6523}
6524
6525// Return a potentially-mapped jQuery.cssProps or vendor prefixed property
6526function finalPropName( name ) {
6527 var final = jQuery.cssProps[ name ] || vendorProps[ name ];
6528
6529 if ( final ) {
6530 return final;
6531 }
6532 if ( name in emptyStyle ) {
6533 return name;
6534 }
6535 return vendorProps[ name ] = vendorPropName( name ) || name;
6536}
6537
6538
6539var
6540
6541 // Swappable if display is none or starts with table
6542 // except "table", "table-cell", or "table-caption"
6543 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6544 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6545 rcustomProp = /^--/,
6546 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6547 cssNormalTransform = {
6548 letterSpacing: "0",
6549 fontWeight: "400"
6550 };
6551
6552function setPositiveNumber( elem, value, subtract ) {
6553
6554 // Any relative (+/-) values have already been
6555 // normalized at this point
6556 var matches = rcssNum.exec( value );
6557 return matches ?
6558
6559 // Guard against undefined "subtract", e.g., when used as in cssHooks
6560 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
6561 value;
6562}
6563
6564function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
6565 var i = dimension === "width" ? 1 : 0,
6566 extra = 0,
6567 delta = 0;
6568
6569 // Adjustment may not be necessary
6570 if ( box === ( isBorderBox ? "border" : "content" ) ) {
6571 return 0;
6572 }
6573
6574 for ( ; i < 4; i += 2 ) {
6575
6576 // Both box models exclude margin
6577 if ( box === "margin" ) {
6578 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
6579 }
6580
6581 // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
6582 if ( !isBorderBox ) {
6583
6584 // Add padding
6585 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6586
6587 // For "border" or "margin", add border
6588 if ( box !== "padding" ) {
6589 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6590
6591 // But still keep track of it otherwise
6592 } else {
6593 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6594 }
6595
6596 // If we get here with a border-box (content + padding + border), we're seeking "content" or
6597 // "padding" or "margin"
6598 } else {
6599
6600 // For "content", subtract padding
6601 if ( box === "content" ) {
6602 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6603 }
6604
6605 // For "content" or "padding", subtract border
6606 if ( box !== "margin" ) {
6607 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6608 }
6609 }
6610 }
6611
6612 // Account for positive content-box scroll gutter when requested by providing computedVal
6613 if ( !isBorderBox && computedVal >= 0 ) {
6614
6615 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
6616 // Assuming integer scroll gutter, subtract the rest and round down
6617 delta += Math.max( 0, Math.ceil(
6618 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
6619 computedVal -
6620 delta -
6621 extra -
6622 0.5
6623
6624 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
6625 // Use an explicit zero to avoid NaN (gh-3964)
6626 ) ) || 0;
6627 }
6628
6629 return delta;
6630}
6631
6632function getWidthOrHeight( elem, dimension, extra ) {
6633
6634 // Start with computed style
6635 var styles = getStyles( elem ),
6636
6637 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
6638 // Fake content-box until we know it's needed to know the true value.
6639 boxSizingNeeded = !support.boxSizingReliable() || extra,
6640 isBorderBox = boxSizingNeeded &&
6641 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6642 valueIsBorderBox = isBorderBox,
6643
6644 val = curCSS( elem, dimension, styles ),
6645 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
6646
6647 // Support: Firefox <=54
6648 // Return a confounding non-pixel value or feign ignorance, as appropriate.
6649 if ( rnumnonpx.test( val ) ) {
6650 if ( !extra ) {
6651 return val;
6652 }
6653 val = "auto";
6654 }
6655
6656
6657 // Fall back to offsetWidth/offsetHeight when value is "auto"
6658 // This happens for inline elements with no explicit setting (gh-3571)
6659 // Support: Android <=4.1 - 4.3 only
6660 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
6661 // Support: IE 9-11 only
6662 // Also use offsetWidth/offsetHeight for when box sizing is unreliable
6663 // We use getClientRects() to check for hidden/disconnected.
6664 // In those cases, the computed value can be trusted to be border-box
6665 if ( ( !support.boxSizingReliable() && isBorderBox ||
6666 val === "auto" ||
6667 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
6668 elem.getClientRects().length ) {
6669
6670 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6671
6672 // Where available, offsetWidth/offsetHeight approximate border box dimensions.
6673 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
6674 // retrieved value as a content box dimension.
6675 valueIsBorderBox = offsetProp in elem;
6676 if ( valueIsBorderBox ) {
6677 val = elem[ offsetProp ];
6678 }
6679 }
6680
6681 // Normalize "" and auto
6682 val = parseFloat( val ) || 0;
6683
6684 // Adjust for the element's box model
6685 return ( val +
6686 boxModelAdjustment(
6687 elem,
6688 dimension,
6689 extra || ( isBorderBox ? "border" : "content" ),
6690 valueIsBorderBox,
6691 styles,
6692
6693 // Provide the current computed size to request scroll gutter calculation (gh-3589)
6694 val
6695 )
6696 ) + "px";
6697}
6698
6699jQuery.extend( {
6700
6701 // Add in style property hooks for overriding the default
6702 // behavior of getting and setting a style property
6703 cssHooks: {
6704 opacity: {
6705 get: function( elem, computed ) {
6706 if ( computed ) {
6707
6708 // We should always get a number back from opacity
6709 var ret = curCSS( elem, "opacity" );
6710 return ret === "" ? "1" : ret;
6711 }
6712 }
6713 }
6714 },
6715
6716 // Don't automatically add "px" to these possibly-unitless properties
6717 cssNumber: {
6718 "animationIterationCount": true,
6719 "columnCount": true,
6720 "fillOpacity": true,
6721 "flexGrow": true,
6722 "flexShrink": true,
6723 "fontWeight": true,
6724 "gridArea": true,
6725 "gridColumn": true,
6726 "gridColumnEnd": true,
6727 "gridColumnStart": true,
6728 "gridRow": true,
6729 "gridRowEnd": true,
6730 "gridRowStart": true,
6731 "lineHeight": true,
6732 "opacity": true,
6733 "order": true,
6734 "orphans": true,
6735 "widows": true,
6736 "zIndex": true,
6737 "zoom": true
6738 },
6739
6740 // Add in properties whose names you wish to fix before
6741 // setting or getting the value
6742 cssProps: {},
6743
6744 // Get and set the style property on a DOM Node
6745 style: function( elem, name, value, extra ) {
6746
6747 // Don't set styles on text and comment nodes
6748 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6749 return;
6750 }
6751
6752 // Make sure that we're working with the right name
6753 var ret, type, hooks,
6754 origName = camelCase( name ),
6755 isCustomProp = rcustomProp.test( name ),
6756 style = elem.style;
6757
6758 // Make sure that we're working with the right name. We don't
6759 // want to query the value if it is a CSS custom property
6760 // since they are user-defined.
6761 if ( !isCustomProp ) {
6762 name = finalPropName( origName );
6763 }
6764
6765 // Gets hook for the prefixed version, then unprefixed version
6766 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6767
6768 // Check if we're setting a value
6769 if ( value !== undefined ) {
6770 type = typeof value;
6771
6772 // Convert "+=" or "-=" to relative numbers (#7345)
6773 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6774 value = adjustCSS( elem, name, ret );
6775
6776 // Fixes bug #9237
6777 type = "number";
6778 }
6779
6780 // Make sure that null and NaN values aren't set (#7116)
6781 if ( value == null || value !== value ) {
6782 return;
6783 }
6784
6785 // If a number was passed in, add the unit (except for certain CSS properties)
6786 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
6787 // "px" to a few hardcoded values.
6788 if ( type === "number" && !isCustomProp ) {
6789 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
6790 }
6791
6792 // background-* props affect original clone's values
6793 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
6794 style[ name ] = "inherit";
6795 }
6796
6797 // If a hook was provided, use that value, otherwise just set the specified value
6798 if ( !hooks || !( "set" in hooks ) ||
6799 ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
6800
6801 if ( isCustomProp ) {
6802 style.setProperty( name, value );
6803 } else {
6804 style[ name ] = value;
6805 }
6806 }
6807
6808 } else {
6809
6810 // If a hook was provided get the non-computed value from there
6811 if ( hooks && "get" in hooks &&
6812 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
6813
6814 return ret;
6815 }
6816
6817 // Otherwise just get the value from the style object
6818 return style[ name ];
6819 }
6820 },
6821
6822 css: function( elem, name, extra, styles ) {
6823 var val, num, hooks,
6824 origName = camelCase( name ),
6825 isCustomProp = rcustomProp.test( name );
6826
6827 // Make sure that we're working with the right name. We don't
6828 // want to modify the value if it is a CSS custom property
6829 // since they are user-defined.
6830 if ( !isCustomProp ) {
6831 name = finalPropName( origName );
6832 }
6833
6834 // Try prefixed name followed by the unprefixed name
6835 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6836
6837 // If a hook was provided get the computed value from there
6838 if ( hooks && "get" in hooks ) {
6839 val = hooks.get( elem, true, extra );
6840 }
6841
6842 // Otherwise, if a way to get the computed value exists, use that
6843 if ( val === undefined ) {
6844 val = curCSS( elem, name, styles );
6845 }
6846
6847 // Convert "normal" to computed value
6848 if ( val === "normal" && name in cssNormalTransform ) {
6849 val = cssNormalTransform[ name ];
6850 }
6851
6852 // Make numeric if forced or a qualifier was provided and val looks numeric
6853 if ( extra === "" || extra ) {
6854 num = parseFloat( val );
6855 return extra === true || isFinite( num ) ? num || 0 : val;
6856 }
6857
6858 return val;
6859 }
6860} );
6861
6862jQuery.each( [ "height", "width" ], function( i, dimension ) {
6863 jQuery.cssHooks[ dimension ] = {
6864 get: function( elem, computed, extra ) {
6865 if ( computed ) {
6866
6867 // Certain elements can have dimension info if we invisibly show them
6868 // but it must have a current display style that would benefit
6869 return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
6870
6871 // Support: Safari 8+
6872 // Table columns in Safari have non-zero offsetWidth & zero
6873 // getBoundingClientRect().width unless display is changed.
6874 // Support: IE <=11 only
6875 // Running getBoundingClientRect on a disconnected node
6876 // in IE throws an error.
6877 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
6878 swap( elem, cssShow, function() {
6879 return getWidthOrHeight( elem, dimension, extra );
6880 } ) :
6881 getWidthOrHeight( elem, dimension, extra );
6882 }
6883 },
6884
6885 set: function( elem, value, extra ) {
6886 var matches,
6887 styles = getStyles( elem ),
6888
6889 // Only read styles.position if the test has a chance to fail
6890 // to avoid forcing a reflow.
6891 scrollboxSizeBuggy = !support.scrollboxSize() &&
6892 styles.position === "absolute",
6893
6894 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
6895 boxSizingNeeded = scrollboxSizeBuggy || extra,
6896 isBorderBox = boxSizingNeeded &&
6897 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6898 subtract = extra ?
6899 boxModelAdjustment(
6900 elem,
6901 dimension,
6902 extra,
6903 isBorderBox,
6904 styles
6905 ) :
6906 0;
6907
6908 // Account for unreliable border-box dimensions by comparing offset* to computed and
6909 // faking a content-box to get border and padding (gh-3699)
6910 if ( isBorderBox && scrollboxSizeBuggy ) {
6911 subtract -= Math.ceil(
6912 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
6913 parseFloat( styles[ dimension ] ) -
6914 boxModelAdjustment( elem, dimension, "border", false, styles ) -
6915 0.5
6916 );
6917 }
6918
6919 // Convert to pixels if value adjustment is needed
6920 if ( subtract && ( matches = rcssNum.exec( value ) ) &&
6921 ( matches[ 3 ] || "px" ) !== "px" ) {
6922
6923 elem.style[ dimension ] = value;
6924 value = jQuery.css( elem, dimension );
6925 }
6926
6927 return setPositiveNumber( elem, value, subtract );
6928 }
6929 };
6930} );
6931
6932jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
6933 function( elem, computed ) {
6934 if ( computed ) {
6935 return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
6936 elem.getBoundingClientRect().left -
6937 swap( elem, { marginLeft: 0 }, function() {
6938 return elem.getBoundingClientRect().left;
6939 } )
6940 ) + "px";
6941 }
6942 }
6943);
6944
6945// These hooks are used by animate to expand properties
6946jQuery.each( {
6947 margin: "",
6948 padding: "",
6949 border: "Width"
6950}, function( prefix, suffix ) {
6951 jQuery.cssHooks[ prefix + suffix ] = {
6952 expand: function( value ) {
6953 var i = 0,
6954 expanded = {},
6955
6956 // Assumes a single number if not a string
6957 parts = typeof value === "string" ? value.split( " " ) : [ value ];
6958
6959 for ( ; i < 4; i++ ) {
6960 expanded[ prefix + cssExpand[ i ] + suffix ] =
6961 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6962 }
6963
6964 return expanded;
6965 }
6966 };
6967
6968 if ( prefix !== "margin" ) {
6969 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6970 }
6971} );
6972
6973jQuery.fn.extend( {
6974 css: function( name, value ) {
6975 return access( this, function( elem, name, value ) {
6976 var styles, len,
6977 map = {},
6978 i = 0;
6979
6980 if ( Array.isArray( name ) ) {
6981 styles = getStyles( elem );
6982 len = name.length;
6983
6984 for ( ; i < len; i++ ) {
6985 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6986 }
6987
6988 return map;
6989 }
6990
6991 return value !== undefined ?
6992 jQuery.style( elem, name, value ) :
6993 jQuery.css( elem, name );
6994 }, name, value, arguments.length > 1 );
6995 }
6996} );
6997
6998
6999function Tween( elem, options, prop, end, easing ) {
7000 return new Tween.prototype.init( elem, options, prop, end, easing );
7001}
7002jQuery.Tween = Tween;
7003
7004Tween.prototype = {
7005 constructor: Tween,
7006 init: function( elem, options, prop, end, easing, unit ) {
7007 this.elem = elem;
7008 this.prop = prop;
7009 this.easing = easing || jQuery.easing._default;
7010 this.options = options;
7011 this.start = this.now = this.cur();
7012 this.end = end;
7013 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
7014 },
7015 cur: function() {
7016 var hooks = Tween.propHooks[ this.prop ];
7017
7018 return hooks && hooks.get ?
7019 hooks.get( this ) :
7020 Tween.propHooks._default.get( this );
7021 },
7022 run: function( percent ) {
7023 var eased,
7024 hooks = Tween.propHooks[ this.prop ];
7025
7026 if ( this.options.duration ) {
7027 this.pos = eased = jQuery.easing[ this.easing ](
7028 percent, this.options.duration * percent, 0, 1, this.options.duration
7029 );
7030 } else {
7031 this.pos = eased = percent;
7032 }
7033 this.now = ( this.end - this.start ) * eased + this.start;
7034
7035 if ( this.options.step ) {
7036 this.options.step.call( this.elem, this.now, this );
7037 }
7038
7039 if ( hooks && hooks.set ) {
7040 hooks.set( this );
7041 } else {
7042 Tween.propHooks._default.set( this );
7043 }
7044 return this;
7045 }
7046};
7047
7048Tween.prototype.init.prototype = Tween.prototype;
7049
7050Tween.propHooks = {
7051 _default: {
7052 get: function( tween ) {
7053 var result;
7054
7055 // Use a property on the element directly when it is not a DOM element,
7056 // or when there is no matching style property that exists.
7057 if ( tween.elem.nodeType !== 1 ||
7058 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
7059 return tween.elem[ tween.prop ];
7060 }
7061
7062 // Passing an empty string as a 3rd parameter to .css will automatically
7063 // attempt a parseFloat and fallback to a string if the parse fails.
7064 // Simple values such as "10px" are parsed to Float;
7065 // complex values such as "rotate(1rad)" are returned as-is.
7066 result = jQuery.css( tween.elem, tween.prop, "" );
7067
7068 // Empty strings, null, undefined and "auto" are converted to 0.
7069 return !result || result === "auto" ? 0 : result;
7070 },
7071 set: function( tween ) {
7072
7073 // Use step hook for back compat.
7074 // Use cssHook if its there.
7075 // Use .style if available and use plain properties where available.
7076 if ( jQuery.fx.step[ tween.prop ] ) {
7077 jQuery.fx.step[ tween.prop ]( tween );
7078 } else if ( tween.elem.nodeType === 1 && (
7079 jQuery.cssHooks[ tween.prop ] ||
7080 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
7081 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7082 } else {
7083 tween.elem[ tween.prop ] = tween.now;
7084 }
7085 }
7086 }
7087};
7088
7089// Support: IE <=9 only
7090// Panic based approach to setting things on disconnected nodes
7091Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
7092 set: function( tween ) {
7093 if ( tween.elem.nodeType && tween.elem.parentNode ) {
7094 tween.elem[ tween.prop ] = tween.now;
7095 }
7096 }
7097};
7098
7099jQuery.easing = {
7100 linear: function( p ) {
7101 return p;
7102 },
7103 swing: function( p ) {
7104 return 0.5 - Math.cos( p * Math.PI ) / 2;
7105 },
7106 _default: "swing"
7107};
7108
7109jQuery.fx = Tween.prototype.init;
7110
7111// Back compat <1.8 extension point
7112jQuery.fx.step = {};
7113
7114
7115
7116
7117var
7118 fxNow, inProgress,
7119 rfxtypes = /^(?:toggle|show|hide)$/,
7120 rrun = /queueHooks$/;
7121
7122function schedule() {
7123 if ( inProgress ) {
7124 if ( document.hidden === false && window.requestAnimationFrame ) {
7125 window.requestAnimationFrame( schedule );
7126 } else {
7127 window.setTimeout( schedule, jQuery.fx.interval );
7128 }
7129
7130 jQuery.fx.tick();
7131 }
7132}
7133
7134// Animations created synchronously will run synchronously
7135function createFxNow() {
7136 window.setTimeout( function() {
7137 fxNow = undefined;
7138 } );
7139 return ( fxNow = Date.now() );
7140}
7141
7142// Generate parameters to create a standard animation
7143function genFx( type, includeWidth ) {
7144 var which,
7145 i = 0,
7146 attrs = { height: type };
7147
7148 // If we include width, step value is 1 to do all cssExpand values,
7149 // otherwise step value is 2 to skip over Left and Right
7150 includeWidth = includeWidth ? 1 : 0;
7151 for ( ; i < 4; i += 2 - includeWidth ) {
7152 which = cssExpand[ i ];
7153 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7154 }
7155
7156 if ( includeWidth ) {
7157 attrs.opacity = attrs.width = type;
7158 }
7159
7160 return attrs;
7161}
7162
7163function createTween( value, prop, animation ) {
7164 var tween,
7165 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
7166 index = 0,
7167 length = collection.length;
7168 for ( ; index < length; index++ ) {
7169 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
7170
7171 // We're done with this property
7172 return tween;
7173 }
7174 }
7175}
7176
7177function defaultPrefilter( elem, props, opts ) {
7178 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
7179 isBox = "width" in props || "height" in props,
7180 anim = this,
7181 orig = {},
7182 style = elem.style,
7183 hidden = elem.nodeType && isHiddenWithinTree( elem ),
7184 dataShow = dataPriv.get( elem, "fxshow" );
7185
7186 // Queue-skipping animations hijack the fx hooks
7187 if ( !opts.queue ) {
7188 hooks = jQuery._queueHooks( elem, "fx" );
7189 if ( hooks.unqueued == null ) {
7190 hooks.unqueued = 0;
7191 oldfire = hooks.empty.fire;
7192 hooks.empty.fire = function() {
7193 if ( !hooks.unqueued ) {
7194 oldfire();
7195 }
7196 };
7197 }
7198 hooks.unqueued++;
7199
7200 anim.always( function() {
7201
7202 // Ensure the complete handler is called before this completes
7203 anim.always( function() {
7204 hooks.unqueued--;
7205 if ( !jQuery.queue( elem, "fx" ).length ) {
7206 hooks.empty.fire();
7207 }
7208 } );
7209 } );
7210 }
7211
7212 // Detect show/hide animations
7213 for ( prop in props ) {
7214 value = props[ prop ];
7215 if ( rfxtypes.test( value ) ) {
7216 delete props[ prop ];
7217 toggle = toggle || value === "toggle";
7218 if ( value === ( hidden ? "hide" : "show" ) ) {
7219
7220 // Pretend to be hidden if this is a "show" and
7221 // there is still data from a stopped show/hide
7222 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
7223 hidden = true;
7224
7225 // Ignore all other no-op show/hide data
7226 } else {
7227 continue;
7228 }
7229 }
7230 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
7231 }
7232 }
7233
7234 // Bail out if this is a no-op like .hide().hide()
7235 propTween = !jQuery.isEmptyObject( props );
7236 if ( !propTween && jQuery.isEmptyObject( orig ) ) {
7237 return;
7238 }
7239
7240 // Restrict "overflow" and "display" styles during box animations
7241 if ( isBox && elem.nodeType === 1 ) {
7242
7243 // Support: IE <=9 - 11, Edge 12 - 15
7244 // Record all 3 overflow attributes because IE does not infer the shorthand
7245 // from identically-valued overflowX and overflowY and Edge just mirrors
7246 // the overflowX value there.
7247 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7248
7249 // Identify a display type, preferring old show/hide data over the CSS cascade
7250 restoreDisplay = dataShow && dataShow.display;
7251 if ( restoreDisplay == null ) {
7252 restoreDisplay = dataPriv.get( elem, "display" );
7253 }
7254 display = jQuery.css( elem, "display" );
7255 if ( display === "none" ) {
7256 if ( restoreDisplay ) {
7257 display = restoreDisplay;
7258 } else {
7259
7260 // Get nonempty value(s) by temporarily forcing visibility
7261 showHide( [ elem ], true );
7262 restoreDisplay = elem.style.display || restoreDisplay;
7263 display = jQuery.css( elem, "display" );
7264 showHide( [ elem ] );
7265 }
7266 }
7267
7268 // Animate inline elements as inline-block
7269 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
7270 if ( jQuery.css( elem, "float" ) === "none" ) {
7271
7272 // Restore the original display value at the end of pure show/hide animations
7273 if ( !propTween ) {
7274 anim.done( function() {
7275 style.display = restoreDisplay;
7276 } );
7277 if ( restoreDisplay == null ) {
7278 display = style.display;
7279 restoreDisplay = display === "none" ? "" : display;
7280 }
7281 }
7282 style.display = "inline-block";
7283 }
7284 }
7285 }
7286
7287 if ( opts.overflow ) {
7288 style.overflow = "hidden";
7289 anim.always( function() {
7290 style.overflow = opts.overflow[ 0 ];
7291 style.overflowX = opts.overflow[ 1 ];
7292 style.overflowY = opts.overflow[ 2 ];
7293 } );
7294 }
7295
7296 // Implement show/hide animations
7297 propTween = false;
7298 for ( prop in orig ) {
7299
7300 // General show/hide setup for this element animation
7301 if ( !propTween ) {
7302 if ( dataShow ) {
7303 if ( "hidden" in dataShow ) {
7304 hidden = dataShow.hidden;
7305 }
7306 } else {
7307 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
7308 }
7309
7310 // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
7311 if ( toggle ) {
7312 dataShow.hidden = !hidden;
7313 }
7314
7315 // Show elements before animating them
7316 if ( hidden ) {
7317 showHide( [ elem ], true );
7318 }
7319
7320 /* eslint-disable no-loop-func */
7321
7322 anim.done( function() {
7323
7324 /* eslint-enable no-loop-func */
7325
7326 // The final step of a "hide" animation is actually hiding the element
7327 if ( !hidden ) {
7328 showHide( [ elem ] );
7329 }
7330 dataPriv.remove( elem, "fxshow" );
7331 for ( prop in orig ) {
7332 jQuery.style( elem, prop, orig[ prop ] );
7333 }
7334 } );
7335 }
7336
7337 // Per-property setup
7338 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
7339 if ( !( prop in dataShow ) ) {
7340 dataShow[ prop ] = propTween.start;
7341 if ( hidden ) {
7342 propTween.end = propTween.start;
7343 propTween.start = 0;
7344 }
7345 }
7346 }
7347}
7348
7349function propFilter( props, specialEasing ) {
7350 var index, name, easing, value, hooks;
7351
7352 // camelCase, specialEasing and expand cssHook pass
7353 for ( index in props ) {
7354 name = camelCase( index );
7355 easing = specialEasing[ name ];
7356 value = props[ index ];
7357 if ( Array.isArray( value ) ) {
7358 easing = value[ 1 ];
7359 value = props[ index ] = value[ 0 ];
7360 }
7361
7362 if ( index !== name ) {
7363 props[ name ] = value;
7364 delete props[ index ];
7365 }
7366
7367 hooks = jQuery.cssHooks[ name ];
7368 if ( hooks && "expand" in hooks ) {
7369 value = hooks.expand( value );
7370 delete props[ name ];
7371
7372 // Not quite $.extend, this won't overwrite existing keys.
7373 // Reusing 'index' because we have the correct "name"
7374 for ( index in value ) {
7375 if ( !( index in props ) ) {
7376 props[ index ] = value[ index ];
7377 specialEasing[ index ] = easing;
7378 }
7379 }
7380 } else {
7381 specialEasing[ name ] = easing;
7382 }
7383 }
7384}
7385
7386function Animation( elem, properties, options ) {
7387 var result,
7388 stopped,
7389 index = 0,
7390 length = Animation.prefilters.length,
7391 deferred = jQuery.Deferred().always( function() {
7392
7393 // Don't match elem in the :animated selector
7394 delete tick.elem;
7395 } ),
7396 tick = function() {
7397 if ( stopped ) {
7398 return false;
7399 }
7400 var currentTime = fxNow || createFxNow(),
7401 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7402
7403 // Support: Android 2.3 only
7404 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
7405 temp = remaining / animation.duration || 0,
7406 percent = 1 - temp,
7407 index = 0,
7408 length = animation.tweens.length;
7409
7410 for ( ; index < length; index++ ) {
7411 animation.tweens[ index ].run( percent );
7412 }
7413
7414 deferred.notifyWith( elem, [ animation, percent, remaining ] );
7415
7416 // If there's more to do, yield
7417 if ( percent < 1 && length ) {
7418 return remaining;
7419 }
7420
7421 // If this was an empty animation, synthesize a final progress notification
7422 if ( !length ) {
7423 deferred.notifyWith( elem, [ animation, 1, 0 ] );
7424 }
7425
7426 // Resolve the animation and report its conclusion
7427 deferred.resolveWith( elem, [ animation ] );
7428 return false;
7429 },
7430 animation = deferred.promise( {
7431 elem: elem,
7432 props: jQuery.extend( {}, properties ),
7433 opts: jQuery.extend( true, {
7434 specialEasing: {},
7435 easing: jQuery.easing._default
7436 }, options ),
7437 originalProperties: properties,
7438 originalOptions: options,
7439 startTime: fxNow || createFxNow(),
7440 duration: options.duration,
7441 tweens: [],
7442 createTween: function( prop, end ) {
7443 var tween = jQuery.Tween( elem, animation.opts, prop, end,
7444 animation.opts.specialEasing[ prop ] || animation.opts.easing );
7445 animation.tweens.push( tween );
7446 return tween;
7447 },
7448 stop: function( gotoEnd ) {
7449 var index = 0,
7450
7451 // If we are going to the end, we want to run all the tweens
7452 // otherwise we skip this part
7453 length = gotoEnd ? animation.tweens.length : 0;
7454 if ( stopped ) {
7455 return this;
7456 }
7457 stopped = true;
7458 for ( ; index < length; index++ ) {
7459 animation.tweens[ index ].run( 1 );
7460 }
7461
7462 // Resolve when we played the last frame; otherwise, reject
7463 if ( gotoEnd ) {
7464 deferred.notifyWith( elem, [ animation, 1, 0 ] );
7465 deferred.resolveWith( elem, [ animation, gotoEnd ] );
7466 } else {
7467 deferred.rejectWith( elem, [ animation, gotoEnd ] );
7468 }
7469 return this;
7470 }
7471 } ),
7472 props = animation.props;
7473
7474 propFilter( props, animation.opts.specialEasing );
7475
7476 for ( ; index < length; index++ ) {
7477 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
7478 if ( result ) {
7479 if ( isFunction( result.stop ) ) {
7480 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
7481 result.stop.bind( result );
7482 }
7483 return result;
7484 }
7485 }
7486
7487 jQuery.map( props, createTween, animation );
7488
7489 if ( isFunction( animation.opts.start ) ) {
7490 animation.opts.start.call( elem, animation );
7491 }
7492
7493 // Attach callbacks from options
7494 animation
7495 .progress( animation.opts.progress )
7496 .done( animation.opts.done, animation.opts.complete )
7497 .fail( animation.opts.fail )
7498 .always( animation.opts.always );
7499
7500 jQuery.fx.timer(
7501 jQuery.extend( tick, {
7502 elem: elem,
7503 anim: animation,
7504 queue: animation.opts.queue
7505 } )
7506 );
7507
7508 return animation;
7509}
7510
7511jQuery.Animation = jQuery.extend( Animation, {
7512
7513 tweeners: {
7514 "*": [ function( prop, value ) {
7515 var tween = this.createTween( prop, value );
7516 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
7517 return tween;
7518 } ]
7519 },
7520
7521 tweener: function( props, callback ) {
7522 if ( isFunction( props ) ) {
7523 callback = props;
7524 props = [ "*" ];
7525 } else {
7526 props = props.match( rnothtmlwhite );
7527 }
7528
7529 var prop,
7530 index = 0,
7531 length = props.length;
7532
7533 for ( ; index < length; index++ ) {
7534 prop = props[ index ];
7535 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
7536 Animation.tweeners[ prop ].unshift( callback );
7537 }
7538 },
7539
7540 prefilters: [ defaultPrefilter ],
7541
7542 prefilter: function( callback, prepend ) {
7543 if ( prepend ) {
7544 Animation.prefilters.unshift( callback );
7545 } else {
7546 Animation.prefilters.push( callback );
7547 }
7548 }
7549} );
7550
7551jQuery.speed = function( speed, easing, fn ) {
7552 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7553 complete: fn || !fn && easing ||
7554 isFunction( speed ) && speed,
7555 duration: speed,
7556 easing: fn && easing || easing && !isFunction( easing ) && easing
7557 };
7558
7559 // Go to the end state if fx are off
7560 if ( jQuery.fx.off ) {
7561 opt.duration = 0;
7562
7563 } else {
7564 if ( typeof opt.duration !== "number" ) {
7565 if ( opt.duration in jQuery.fx.speeds ) {
7566 opt.duration = jQuery.fx.speeds[ opt.duration ];
7567
7568 } else {
7569 opt.duration = jQuery.fx.speeds._default;
7570 }
7571 }
7572 }
7573
7574 // Normalize opt.queue - true/undefined/null -> "fx"
7575 if ( opt.queue == null || opt.queue === true ) {
7576 opt.queue = "fx";
7577 }
7578
7579 // Queueing
7580 opt.old = opt.complete;
7581
7582 opt.complete = function() {
7583 if ( isFunction( opt.old ) ) {
7584 opt.old.call( this );
7585 }
7586
7587 if ( opt.queue ) {
7588 jQuery.dequeue( this, opt.queue );
7589 }
7590 };
7591
7592 return opt;
7593};
7594
7595jQuery.fn.extend( {
7596 fadeTo: function( speed, to, easing, callback ) {
7597
7598 // Show any hidden elements after setting opacity to 0
7599 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
7600
7601 // Animate to the value specified
7602 .end().animate( { opacity: to }, speed, easing, callback );
7603 },
7604 animate: function( prop, speed, easing, callback ) {
7605 var empty = jQuery.isEmptyObject( prop ),
7606 optall = jQuery.speed( speed, easing, callback ),
7607 doAnimation = function() {
7608
7609 // Operate on a copy of prop so per-property easing won't be lost
7610 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7611
7612 // Empty animations, or finishing resolves immediately
7613 if ( empty || dataPriv.get( this, "finish" ) ) {
7614 anim.stop( true );
7615 }
7616 };
7617 doAnimation.finish = doAnimation;
7618
7619 return empty || optall.queue === false ?
7620 this.each( doAnimation ) :
7621 this.queue( optall.queue, doAnimation );
7622 },
7623 stop: function( type, clearQueue, gotoEnd ) {
7624 var stopQueue = function( hooks ) {
7625 var stop = hooks.stop;
7626 delete hooks.stop;
7627 stop( gotoEnd );
7628 };
7629
7630 if ( typeof type !== "string" ) {
7631 gotoEnd = clearQueue;
7632 clearQueue = type;
7633 type = undefined;
7634 }
7635 if ( clearQueue && type !== false ) {
7636 this.queue( type || "fx", [] );
7637 }
7638
7639 return this.each( function() {
7640 var dequeue = true,
7641 index = type != null && type + "queueHooks",
7642 timers = jQuery.timers,
7643 data = dataPriv.get( this );
7644
7645 if ( index ) {
7646 if ( data[ index ] && data[ index ].stop ) {
7647 stopQueue( data[ index ] );
7648 }
7649 } else {
7650 for ( index in data ) {
7651 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7652 stopQueue( data[ index ] );
7653 }
7654 }
7655 }
7656
7657 for ( index = timers.length; index--; ) {
7658 if ( timers[ index ].elem === this &&
7659 ( type == null || timers[ index ].queue === type ) ) {
7660
7661 timers[ index ].anim.stop( gotoEnd );
7662 dequeue = false;
7663 timers.splice( index, 1 );
7664 }
7665 }
7666
7667 // Start the next in the queue if the last step wasn't forced.
7668 // Timers currently will call their complete callbacks, which
7669 // will dequeue but only if they were gotoEnd.
7670 if ( dequeue || !gotoEnd ) {
7671 jQuery.dequeue( this, type );
7672 }
7673 } );
7674 },
7675 finish: function( type ) {
7676 if ( type !== false ) {
7677 type = type || "fx";
7678 }
7679 return this.each( function() {
7680 var index,
7681 data = dataPriv.get( this ),
7682 queue = data[ type + "queue" ],
7683 hooks = data[ type + "queueHooks" ],
7684 timers = jQuery.timers,
7685 length = queue ? queue.length : 0;
7686
7687 // Enable finishing flag on private data
7688 data.finish = true;
7689
7690 // Empty the queue first
7691 jQuery.queue( this, type, [] );
7692
7693 if ( hooks && hooks.stop ) {
7694 hooks.stop.call( this, true );
7695 }
7696
7697 // Look for any active animations, and finish them
7698 for ( index = timers.length; index--; ) {
7699 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7700 timers[ index ].anim.stop( true );
7701 timers.splice( index, 1 );
7702 }
7703 }
7704
7705 // Look for any animations in the old queue and finish them
7706 for ( index = 0; index < length; index++ ) {
7707 if ( queue[ index ] && queue[ index ].finish ) {
7708 queue[ index ].finish.call( this );
7709 }
7710 }
7711
7712 // Turn off finishing flag
7713 delete data.finish;
7714 } );
7715 }
7716} );
7717
7718jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
7719 var cssFn = jQuery.fn[ name ];
7720 jQuery.fn[ name ] = function( speed, easing, callback ) {
7721 return speed == null || typeof speed === "boolean" ?
7722 cssFn.apply( this, arguments ) :
7723 this.animate( genFx( name, true ), speed, easing, callback );
7724 };
7725} );
7726
7727// Generate shortcuts for custom animations
7728jQuery.each( {
7729 slideDown: genFx( "show" ),
7730 slideUp: genFx( "hide" ),
7731 slideToggle: genFx( "toggle" ),
7732 fadeIn: { opacity: "show" },
7733 fadeOut: { opacity: "hide" },
7734 fadeToggle: { opacity: "toggle" }
7735}, function( name, props ) {
7736 jQuery.fn[ name ] = function( speed, easing, callback ) {
7737 return this.animate( props, speed, easing, callback );
7738 };
7739} );
7740
7741jQuery.timers = [];
7742jQuery.fx.tick = function() {
7743 var timer,
7744 i = 0,
7745 timers = jQuery.timers;
7746
7747 fxNow = Date.now();
7748
7749 for ( ; i < timers.length; i++ ) {
7750 timer = timers[ i ];
7751
7752 // Run the timer and safely remove it when done (allowing for external removal)
7753 if ( !timer() && timers[ i ] === timer ) {
7754 timers.splice( i--, 1 );
7755 }
7756 }
7757
7758 if ( !timers.length ) {
7759 jQuery.fx.stop();
7760 }
7761 fxNow = undefined;
7762};
7763
7764jQuery.fx.timer = function( timer ) {
7765 jQuery.timers.push( timer );
7766 jQuery.fx.start();
7767};
7768
7769jQuery.fx.interval = 13;
7770jQuery.fx.start = function() {
7771 if ( inProgress ) {
7772 return;
7773 }
7774
7775 inProgress = true;
7776 schedule();
7777};
7778
7779jQuery.fx.stop = function() {
7780 inProgress = null;
7781};
7782
7783jQuery.fx.speeds = {
7784 slow: 600,
7785 fast: 200,
7786
7787 // Default speed
7788 _default: 400
7789};
7790
7791
7792// Based off of the plugin by Clint Helfers, with permission.
7793// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7794jQuery.fn.delay = function( time, type ) {
7795 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7796 type = type || "fx";
7797
7798 return this.queue( type, function( next, hooks ) {
7799 var timeout = window.setTimeout( next, time );
7800 hooks.stop = function() {
7801 window.clearTimeout( timeout );
7802 };
7803 } );
7804};
7805
7806
7807( function() {
7808 var input = document.createElement( "input" ),
7809 select = document.createElement( "select" ),
7810 opt = select.appendChild( document.createElement( "option" ) );
7811
7812 input.type = "checkbox";
7813
7814 // Support: Android <=4.3 only
7815 // Default value for a checkbox should be "on"
7816 support.checkOn = input.value !== "";
7817
7818 // Support: IE <=11 only
7819 // Must access selectedIndex to make default options select
7820 support.optSelected = opt.selected;
7821
7822 // Support: IE <=11 only
7823 // An input loses its value after becoming a radio
7824 input = document.createElement( "input" );
7825 input.value = "t";
7826 input.type = "radio";
7827 support.radioValue = input.value === "t";
7828} )();
7829
7830
7831var boolHook,
7832 attrHandle = jQuery.expr.attrHandle;
7833
7834jQuery.fn.extend( {
7835 attr: function( name, value ) {
7836 return access( this, jQuery.attr, name, value, arguments.length > 1 );
7837 },
7838
7839 removeAttr: function( name ) {
7840 return this.each( function() {
7841 jQuery.removeAttr( this, name );
7842 } );
7843 }
7844} );
7845
7846jQuery.extend( {
7847 attr: function( elem, name, value ) {
7848 var ret, hooks,
7849 nType = elem.nodeType;
7850
7851 // Don't get/set attributes on text, comment and attribute nodes
7852 if ( nType === 3 || nType === 8 || nType === 2 ) {
7853 return;
7854 }
7855
7856 // Fallback to prop when attributes are not supported
7857 if ( typeof elem.getAttribute === "undefined" ) {
7858 return jQuery.prop( elem, name, value );
7859 }
7860
7861 // Attribute hooks are determined by the lowercase version
7862 // Grab necessary hook if one is defined
7863 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7864 hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
7865 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
7866 }
7867
7868 if ( value !== undefined ) {
7869 if ( value === null ) {
7870 jQuery.removeAttr( elem, name );
7871 return;
7872 }
7873
7874 if ( hooks && "set" in hooks &&
7875 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7876 return ret;
7877 }
7878
7879 elem.setAttribute( name, value + "" );
7880 return value;
7881 }
7882
7883 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7884 return ret;
7885 }
7886
7887 ret = jQuery.find.attr( elem, name );
7888
7889 // Non-existent attributes return null, we normalize to undefined
7890 return ret == null ? undefined : ret;
7891 },
7892
7893 attrHooks: {
7894 type: {
7895 set: function( elem, value ) {
7896 if ( !support.radioValue && value === "radio" &&
7897 nodeName( elem, "input" ) ) {
7898 var val = elem.value;
7899 elem.setAttribute( "type", value );
7900 if ( val ) {
7901 elem.value = val;
7902 }
7903 return value;
7904 }
7905 }
7906 }
7907 },
7908
7909 removeAttr: function( elem, value ) {
7910 var name,
7911 i = 0,
7912
7913 // Attribute names can contain non-HTML whitespace characters
7914 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
7915 attrNames = value && value.match( rnothtmlwhite );
7916
7917 if ( attrNames && elem.nodeType === 1 ) {
7918 while ( ( name = attrNames[ i++ ] ) ) {
7919 elem.removeAttribute( name );
7920 }
7921 }
7922 }
7923} );
7924
7925// Hooks for boolean attributes
7926boolHook = {
7927 set: function( elem, value, name ) {
7928 if ( value === false ) {
7929
7930 // Remove boolean attributes when set to false
7931 jQuery.removeAttr( elem, name );
7932 } else {
7933 elem.setAttribute( name, name );
7934 }
7935 return name;
7936 }
7937};
7938
7939jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
7940 var getter = attrHandle[ name ] || jQuery.find.attr;
7941
7942 attrHandle[ name ] = function( elem, name, isXML ) {
7943 var ret, handle,
7944 lowercaseName = name.toLowerCase();
7945
7946 if ( !isXML ) {
7947
7948 // Avoid an infinite loop by temporarily removing this function from the getter
7949 handle = attrHandle[ lowercaseName ];
7950 attrHandle[ lowercaseName ] = ret;
7951 ret = getter( elem, name, isXML ) != null ?
7952 lowercaseName :
7953 null;
7954 attrHandle[ lowercaseName ] = handle;
7955 }
7956 return ret;
7957 };
7958} );
7959
7960
7961
7962
7963var rfocusable = /^(?:input|select|textarea|button)$/i,
7964 rclickable = /^(?:a|area)$/i;
7965
7966jQuery.fn.extend( {
7967 prop: function( name, value ) {
7968 return access( this, jQuery.prop, name, value, arguments.length > 1 );
7969 },
7970
7971 removeProp: function( name ) {
7972 return this.each( function() {
7973 delete this[ jQuery.propFix[ name ] || name ];
7974 } );
7975 }
7976} );
7977
7978jQuery.extend( {
7979 prop: function( elem, name, value ) {
7980 var ret, hooks,
7981 nType = elem.nodeType;
7982
7983 // Don't get/set properties on text, comment and attribute nodes
7984 if ( nType === 3 || nType === 8 || nType === 2 ) {
7985 return;
7986 }
7987
7988 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7989
7990 // Fix name and attach hooks
7991 name = jQuery.propFix[ name ] || name;
7992 hooks = jQuery.propHooks[ name ];
7993 }
7994
7995 if ( value !== undefined ) {
7996 if ( hooks && "set" in hooks &&
7997 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7998 return ret;
7999 }
8000
8001 return ( elem[ name ] = value );
8002 }
8003
8004 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
8005 return ret;
8006 }
8007
8008 return elem[ name ];
8009 },
8010
8011 propHooks: {
8012 tabIndex: {
8013 get: function( elem ) {
8014
8015 // Support: IE <=9 - 11 only
8016 // elem.tabIndex doesn't always return the
8017 // correct value when it hasn't been explicitly set
8018 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8019 // Use proper attribute retrieval(#12072)
8020 var tabindex = jQuery.find.attr( elem, "tabindex" );
8021
8022 if ( tabindex ) {
8023 return parseInt( tabindex, 10 );
8024 }
8025
8026 if (
8027 rfocusable.test( elem.nodeName ) ||
8028 rclickable.test( elem.nodeName ) &&
8029 elem.href
8030 ) {
8031 return 0;
8032 }
8033
8034 return -1;
8035 }
8036 }
8037 },
8038
8039 propFix: {
8040 "for": "htmlFor",
8041 "class": "className"
8042 }
8043} );
8044
8045// Support: IE <=11 only
8046// Accessing the selectedIndex property
8047// forces the browser to respect setting selected
8048// on the option
8049// The getter ensures a default option is selected
8050// when in an optgroup
8051// eslint rule "no-unused-expressions" is disabled for this code
8052// since it considers such accessions noop
8053if ( !support.optSelected ) {
8054 jQuery.propHooks.selected = {
8055 get: function( elem ) {
8056
8057 /* eslint no-unused-expressions: "off" */
8058
8059 var parent = elem.parentNode;
8060 if ( parent && parent.parentNode ) {
8061 parent.parentNode.selectedIndex;
8062 }
8063 return null;
8064 },
8065 set: function( elem ) {
8066
8067 /* eslint no-unused-expressions: "off" */
8068
8069 var parent = elem.parentNode;
8070 if ( parent ) {
8071 parent.selectedIndex;
8072
8073 if ( parent.parentNode ) {
8074 parent.parentNode.selectedIndex;
8075 }
8076 }
8077 }
8078 };
8079}
8080
8081jQuery.each( [
8082 "tabIndex",
8083 "readOnly",
8084 "maxLength",
8085 "cellSpacing",
8086 "cellPadding",
8087 "rowSpan",
8088 "colSpan",
8089 "useMap",
8090 "frameBorder",
8091 "contentEditable"
8092], function() {
8093 jQuery.propFix[ this.toLowerCase() ] = this;
8094} );
8095
8096
8097
8098
8099 // Strip and collapse whitespace according to HTML spec
8100 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
8101 function stripAndCollapse( value ) {
8102 var tokens = value.match( rnothtmlwhite ) || [];
8103 return tokens.join( " " );
8104 }
8105
8106
8107function getClass( elem ) {
8108 return elem.getAttribute && elem.getAttribute( "class" ) || "";
8109}
8110
8111function classesToArray( value ) {
8112 if ( Array.isArray( value ) ) {
8113 return value;
8114 }
8115 if ( typeof value === "string" ) {
8116 return value.match( rnothtmlwhite ) || [];
8117 }
8118 return [];
8119}
8120
8121jQuery.fn.extend( {
8122 addClass: function( value ) {
8123 var classes, elem, cur, curValue, clazz, j, finalValue,
8124 i = 0;
8125
8126 if ( isFunction( value ) ) {
8127 return this.each( function( j ) {
8128 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
8129 } );
8130 }
8131
8132 classes = classesToArray( value );
8133
8134 if ( classes.length ) {
8135 while ( ( elem = this[ i++ ] ) ) {
8136 curValue = getClass( elem );
8137 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8138
8139 if ( cur ) {
8140 j = 0;
8141 while ( ( clazz = classes[ j++ ] ) ) {
8142 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8143 cur += clazz + " ";
8144 }
8145 }
8146
8147 // Only assign if different to avoid unneeded rendering.
8148 finalValue = stripAndCollapse( cur );
8149 if ( curValue !== finalValue ) {
8150 elem.setAttribute( "class", finalValue );
8151 }
8152 }
8153 }
8154 }
8155
8156 return this;
8157 },
8158
8159 removeClass: function( value ) {
8160 var classes, elem, cur, curValue, clazz, j, finalValue,
8161 i = 0;
8162
8163 if ( isFunction( value ) ) {
8164 return this.each( function( j ) {
8165 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
8166 } );
8167 }
8168
8169 if ( !arguments.length ) {
8170 return this.attr( "class", "" );
8171 }
8172
8173 classes = classesToArray( value );
8174
8175 if ( classes.length ) {
8176 while ( ( elem = this[ i++ ] ) ) {
8177 curValue = getClass( elem );
8178
8179 // This expression is here for better compressibility (see addClass)
8180 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8181
8182 if ( cur ) {
8183 j = 0;
8184 while ( ( clazz = classes[ j++ ] ) ) {
8185
8186 // Remove *all* instances
8187 while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
8188 cur = cur.replace( " " + clazz + " ", " " );
8189 }
8190 }
8191
8192 // Only assign if different to avoid unneeded rendering.
8193 finalValue = stripAndCollapse( cur );
8194 if ( curValue !== finalValue ) {
8195 elem.setAttribute( "class", finalValue );
8196 }
8197 }
8198 }
8199 }
8200
8201 return this;
8202 },
8203
8204 toggleClass: function( value, stateVal ) {
8205 var type = typeof value,
8206 isValidValue = type === "string" || Array.isArray( value );
8207
8208 if ( typeof stateVal === "boolean" && isValidValue ) {
8209 return stateVal ? this.addClass( value ) : this.removeClass( value );
8210 }
8211
8212 if ( isFunction( value ) ) {
8213 return this.each( function( i ) {
8214 jQuery( this ).toggleClass(
8215 value.call( this, i, getClass( this ), stateVal ),
8216 stateVal
8217 );
8218 } );
8219 }
8220
8221 return this.each( function() {
8222 var className, i, self, classNames;
8223
8224 if ( isValidValue ) {
8225
8226 // Toggle individual class names
8227 i = 0;
8228 self = jQuery( this );
8229 classNames = classesToArray( value );
8230
8231 while ( ( className = classNames[ i++ ] ) ) {
8232
8233 // Check each className given, space separated list
8234 if ( self.hasClass( className ) ) {
8235 self.removeClass( className );
8236 } else {
8237 self.addClass( className );
8238 }
8239 }
8240
8241 // Toggle whole class name
8242 } else if ( value === undefined || type === "boolean" ) {
8243 className = getClass( this );
8244 if ( className ) {
8245
8246 // Store className if set
8247 dataPriv.set( this, "__className__", className );
8248 }
8249
8250 // If the element has a class name or if we're passed `false`,
8251 // then remove the whole classname (if there was one, the above saved it).
8252 // Otherwise bring back whatever was previously saved (if anything),
8253 // falling back to the empty string if nothing was stored.
8254 if ( this.setAttribute ) {
8255 this.setAttribute( "class",
8256 className || value === false ?
8257 "" :
8258 dataPriv.get( this, "__className__" ) || ""
8259 );
8260 }
8261 }
8262 } );
8263 },
8264
8265 hasClass: function( selector ) {
8266 var className, elem,
8267 i = 0;
8268
8269 className = " " + selector + " ";
8270 while ( ( elem = this[ i++ ] ) ) {
8271 if ( elem.nodeType === 1 &&
8272 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
8273 return true;
8274 }
8275 }
8276
8277 return false;
8278 }
8279} );
8280
8281
8282
8283
8284var rreturn = /\r/g;
8285
8286jQuery.fn.extend( {
8287 val: function( value ) {
8288 var hooks, ret, valueIsFunction,
8289 elem = this[ 0 ];
8290
8291 if ( !arguments.length ) {
8292 if ( elem ) {
8293 hooks = jQuery.valHooks[ elem.type ] ||
8294 jQuery.valHooks[ elem.nodeName.toLowerCase() ];
8295
8296 if ( hooks &&
8297 "get" in hooks &&
8298 ( ret = hooks.get( elem, "value" ) ) !== undefined
8299 ) {
8300 return ret;
8301 }
8302
8303 ret = elem.value;
8304
8305 // Handle most common string cases
8306 if ( typeof ret === "string" ) {
8307 return ret.replace( rreturn, "" );
8308 }
8309
8310 // Handle cases where value is null/undef or number
8311 return ret == null ? "" : ret;
8312 }
8313
8314 return;
8315 }
8316
8317 valueIsFunction = isFunction( value );
8318
8319 return this.each( function( i ) {
8320 var val;
8321
8322 if ( this.nodeType !== 1 ) {
8323 return;
8324 }
8325
8326 if ( valueIsFunction ) {
8327 val = value.call( this, i, jQuery( this ).val() );
8328 } else {
8329 val = value;
8330 }
8331
8332 // Treat null/undefined as ""; convert numbers to string
8333 if ( val == null ) {
8334 val = "";
8335
8336 } else if ( typeof val === "number" ) {
8337 val += "";
8338
8339 } else if ( Array.isArray( val ) ) {
8340 val = jQuery.map( val, function( value ) {
8341 return value == null ? "" : value + "";
8342 } );
8343 }
8344
8345 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
8346
8347 // If set returns undefined, fall back to normal setting
8348 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
8349 this.value = val;
8350 }
8351 } );
8352 }
8353} );
8354
8355jQuery.extend( {
8356 valHooks: {
8357 option: {
8358 get: function( elem ) {
8359
8360 var val = jQuery.find.attr( elem, "value" );
8361 return val != null ?
8362 val :
8363
8364 // Support: IE <=10 - 11 only
8365 // option.text throws exceptions (#14686, #14858)
8366 // Strip and collapse whitespace
8367 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
8368 stripAndCollapse( jQuery.text( elem ) );
8369 }
8370 },
8371 select: {
8372 get: function( elem ) {
8373 var value, option, i,
8374 options = elem.options,
8375 index = elem.selectedIndex,
8376 one = elem.type === "select-one",
8377 values = one ? null : [],
8378 max = one ? index + 1 : options.length;
8379
8380 if ( index < 0 ) {
8381 i = max;
8382
8383 } else {
8384 i = one ? index : 0;
8385 }
8386
8387 // Loop through all the selected options
8388 for ( ; i < max; i++ ) {
8389 option = options[ i ];
8390
8391 // Support: IE <=9 only
8392 // IE8-9 doesn't update selected after form reset (#2551)
8393 if ( ( option.selected || i === index ) &&
8394
8395 // Don't return options that are disabled or in a disabled optgroup
8396 !option.disabled &&
8397 ( !option.parentNode.disabled ||
8398 !nodeName( option.parentNode, "optgroup" ) ) ) {
8399
8400 // Get the specific value for the option
8401 value = jQuery( option ).val();
8402
8403 // We don't need an array for one selects
8404 if ( one ) {
8405 return value;
8406 }
8407
8408 // Multi-Selects return an array
8409 values.push( value );
8410 }
8411 }
8412
8413 return values;
8414 },
8415
8416 set: function( elem, value ) {
8417 var optionSet, option,
8418 options = elem.options,
8419 values = jQuery.makeArray( value ),
8420 i = options.length;
8421
8422 while ( i-- ) {
8423 option = options[ i ];
8424
8425 /* eslint-disable no-cond-assign */
8426
8427 if ( option.selected =
8428 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
8429 ) {
8430 optionSet = true;
8431 }
8432
8433 /* eslint-enable no-cond-assign */
8434 }
8435
8436 // Force browsers to behave consistently when non-matching value is set
8437 if ( !optionSet ) {
8438 elem.selectedIndex = -1;
8439 }
8440 return values;
8441 }
8442 }
8443 }
8444} );
8445
8446// Radios and checkboxes getter/setter
8447jQuery.each( [ "radio", "checkbox" ], function() {
8448 jQuery.valHooks[ this ] = {
8449 set: function( elem, value ) {
8450 if ( Array.isArray( value ) ) {
8451 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
8452 }
8453 }
8454 };
8455 if ( !support.checkOn ) {
8456 jQuery.valHooks[ this ].get = function( elem ) {
8457 return elem.getAttribute( "value" ) === null ? "on" : elem.value;
8458 };
8459 }
8460} );
8461
8462
8463
8464
8465// Return jQuery for attributes-only inclusion
8466
8467
8468support.focusin = "onfocusin" in window;
8469
8470
8471var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
8472 stopPropagationCallback = function( e ) {
8473 e.stopPropagation();
8474 };
8475
8476jQuery.extend( jQuery.event, {
8477
8478 trigger: function( event, data, elem, onlyHandlers ) {
8479
8480 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
8481 eventPath = [ elem || document ],
8482 type = hasOwn.call( event, "type" ) ? event.type : event,
8483 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
8484
8485 cur = lastElement = tmp = elem = elem || document;
8486
8487 // Don't do events on text and comment nodes
8488 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
8489 return;
8490 }
8491
8492 // focus/blur morphs to focusin/out; ensure we're not firing them right now
8493 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
8494 return;
8495 }
8496
8497 if ( type.indexOf( "." ) > -1 ) {
8498
8499 // Namespaced trigger; create a regexp to match event type in handle()
8500 namespaces = type.split( "." );
8501 type = namespaces.shift();
8502 namespaces.sort();
8503 }
8504 ontype = type.indexOf( ":" ) < 0 && "on" + type;
8505
8506 // Caller can pass in a jQuery.Event object, Object, or just an event type string
8507 event = event[ jQuery.expando ] ?
8508 event :
8509 new jQuery.Event( type, typeof event === "object" && event );
8510
8511 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
8512 event.isTrigger = onlyHandlers ? 2 : 3;
8513 event.namespace = namespaces.join( "." );
8514 event.rnamespace = event.namespace ?
8515 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
8516 null;
8517
8518 // Clean up the event in case it is being reused
8519 event.result = undefined;
8520 if ( !event.target ) {
8521 event.target = elem;
8522 }
8523
8524 // Clone any incoming data and prepend the event, creating the handler arg list
8525 data = data == null ?
8526 [ event ] :
8527 jQuery.makeArray( data, [ event ] );
8528
8529 // Allow special events to draw outside the lines
8530 special = jQuery.event.special[ type ] || {};
8531 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
8532 return;
8533 }
8534
8535 // Determine event propagation path in advance, per W3C events spec (#9951)
8536 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
8537 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
8538
8539 bubbleType = special.delegateType || type;
8540 if ( !rfocusMorph.test( bubbleType + type ) ) {
8541 cur = cur.parentNode;
8542 }
8543 for ( ; cur; cur = cur.parentNode ) {
8544 eventPath.push( cur );
8545 tmp = cur;
8546 }
8547
8548 // Only add window if we got to document (e.g., not plain obj or detached DOM)
8549 if ( tmp === ( elem.ownerDocument || document ) ) {
8550 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
8551 }
8552 }
8553
8554 // Fire handlers on the event path
8555 i = 0;
8556 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
8557 lastElement = cur;
8558 event.type = i > 1 ?
8559 bubbleType :
8560 special.bindType || type;
8561
8562 // jQuery handler
8563 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
8564 dataPriv.get( cur, "handle" );
8565 if ( handle ) {
8566 handle.apply( cur, data );
8567 }
8568
8569 // Native handler
8570 handle = ontype && cur[ ontype ];
8571 if ( handle && handle.apply && acceptData( cur ) ) {
8572 event.result = handle.apply( cur, data );
8573 if ( event.result === false ) {
8574 event.preventDefault();
8575 }
8576 }
8577 }
8578 event.type = type;
8579
8580 // If nobody prevented the default action, do it now
8581 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
8582
8583 if ( ( !special._default ||
8584 special._default.apply( eventPath.pop(), data ) === false ) &&
8585 acceptData( elem ) ) {
8586
8587 // Call a native DOM method on the target with the same name as the event.
8588 // Don't do default actions on window, that's where global variables be (#6170)
8589 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
8590
8591 // Don't re-trigger an onFOO event when we call its FOO() method
8592 tmp = elem[ ontype ];
8593
8594 if ( tmp ) {
8595 elem[ ontype ] = null;
8596 }
8597
8598 // Prevent re-triggering of the same event, since we already bubbled it above
8599 jQuery.event.triggered = type;
8600
8601 if ( event.isPropagationStopped() ) {
8602 lastElement.addEventListener( type, stopPropagationCallback );
8603 }
8604
8605 elem[ type ]();
8606
8607 if ( event.isPropagationStopped() ) {
8608 lastElement.removeEventListener( type, stopPropagationCallback );
8609 }
8610
8611 jQuery.event.triggered = undefined;
8612
8613 if ( tmp ) {
8614 elem[ ontype ] = tmp;
8615 }
8616 }
8617 }
8618 }
8619
8620 return event.result;
8621 },
8622
8623 // Piggyback on a donor event to simulate a different one
8624 // Used only for `focus(in | out)` events
8625 simulate: function( type, elem, event ) {
8626 var e = jQuery.extend(
8627 new jQuery.Event(),
8628 event,
8629 {
8630 type: type,
8631 isSimulated: true
8632 }
8633 );
8634
8635 jQuery.event.trigger( e, null, elem );
8636 }
8637
8638} );
8639
8640jQuery.fn.extend( {
8641
8642 trigger: function( type, data ) {
8643 return this.each( function() {
8644 jQuery.event.trigger( type, data, this );
8645 } );
8646 },
8647 triggerHandler: function( type, data ) {
8648 var elem = this[ 0 ];
8649 if ( elem ) {
8650 return jQuery.event.trigger( type, data, elem, true );
8651 }
8652 }
8653} );
8654
8655
8656// Support: Firefox <=44
8657// Firefox doesn't have focus(in | out) events
8658// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
8659//
8660// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
8661// focus(in | out) events fire after focus & blur events,
8662// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
8663// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
8664if ( !support.focusin ) {
8665 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
8666
8667 // Attach a single capturing handler on the document while someone wants focusin/focusout
8668 var handler = function( event ) {
8669 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
8670 };
8671
8672 jQuery.event.special[ fix ] = {
8673 setup: function() {
8674 var doc = this.ownerDocument || this,
8675 attaches = dataPriv.access( doc, fix );
8676
8677 if ( !attaches ) {
8678 doc.addEventListener( orig, handler, true );
8679 }
8680 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
8681 },
8682 teardown: function() {
8683 var doc = this.ownerDocument || this,
8684 attaches = dataPriv.access( doc, fix ) - 1;
8685
8686 if ( !attaches ) {
8687 doc.removeEventListener( orig, handler, true );
8688 dataPriv.remove( doc, fix );
8689
8690 } else {
8691 dataPriv.access( doc, fix, attaches );
8692 }
8693 }
8694 };
8695 } );
8696}
8697var location = window.location;
8698
8699var nonce = Date.now();
8700
8701var rquery = ( /\?/ );
8702
8703
8704
8705// Cross-browser xml parsing
8706jQuery.parseXML = function( data ) {
8707 var xml;
8708 if ( !data || typeof data !== "string" ) {
8709 return null;
8710 }
8711
8712 // Support: IE 9 - 11 only
8713 // IE throws on parseFromString with invalid input.
8714 try {
8715 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8716 } catch ( e ) {
8717 xml = undefined;
8718 }
8719
8720 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
8721 jQuery.error( "Invalid XML: " + data );
8722 }
8723 return xml;
8724};
8725
8726
8727var
8728 rbracket = /\[\]$/,
8729 rCRLF = /\r?\n/g,
8730 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8731 rsubmittable = /^(?:input|select|textarea|keygen)/i;
8732
8733function buildParams( prefix, obj, traditional, add ) {
8734 var name;
8735
8736 if ( Array.isArray( obj ) ) {
8737
8738 // Serialize array item.
8739 jQuery.each( obj, function( i, v ) {
8740 if ( traditional || rbracket.test( prefix ) ) {
8741
8742 // Treat each array item as a scalar.
8743 add( prefix, v );
8744
8745 } else {
8746
8747 // Item is non-scalar (array or object), encode its numeric index.
8748 buildParams(
8749 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
8750 v,
8751 traditional,
8752 add
8753 );
8754 }
8755 } );
8756
8757 } else if ( !traditional && toType( obj ) === "object" ) {
8758
8759 // Serialize object item.
8760 for ( name in obj ) {
8761 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8762 }
8763
8764 } else {
8765
8766 // Serialize scalar item.
8767 add( prefix, obj );
8768 }
8769}
8770
8771// Serialize an array of form elements or a set of
8772// key/values into a query string
8773jQuery.param = function( a, traditional ) {
8774 var prefix,
8775 s = [],
8776 add = function( key, valueOrFunction ) {
8777
8778 // If value is a function, invoke it and use its return value
8779 var value = isFunction( valueOrFunction ) ?
8780 valueOrFunction() :
8781 valueOrFunction;
8782
8783 s[ s.length ] = encodeURIComponent( key ) + "=" +
8784 encodeURIComponent( value == null ? "" : value );
8785 };
8786
8787 if ( a == null ) {
8788 return "";
8789 }
8790
8791 // If an array was passed in, assume that it is an array of form elements.
8792 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
8793
8794 // Serialize the form elements
8795 jQuery.each( a, function() {
8796 add( this.name, this.value );
8797 } );
8798
8799 } else {
8800
8801 // If traditional, encode the "old" way (the way 1.3.2 or older
8802 // did it), otherwise encode params recursively.
8803 for ( prefix in a ) {
8804 buildParams( prefix, a[ prefix ], traditional, add );
8805 }
8806 }
8807
8808 // Return the resulting serialization
8809 return s.join( "&" );
8810};
8811
8812jQuery.fn.extend( {
8813 serialize: function() {
8814 return jQuery.param( this.serializeArray() );
8815 },
8816 serializeArray: function() {
8817 return this.map( function() {
8818
8819 // Can add propHook for "elements" to filter or add form elements
8820 var elements = jQuery.prop( this, "elements" );
8821 return elements ? jQuery.makeArray( elements ) : this;
8822 } )
8823 .filter( function() {
8824 var type = this.type;
8825
8826 // Use .is( ":disabled" ) so that fieldset[disabled] works
8827 return this.name && !jQuery( this ).is( ":disabled" ) &&
8828 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8829 ( this.checked || !rcheckableType.test( type ) );
8830 } )
8831 .map( function( i, elem ) {
8832 var val = jQuery( this ).val();
8833
8834 if ( val == null ) {
8835 return null;
8836 }
8837
8838 if ( Array.isArray( val ) ) {
8839 return jQuery.map( val, function( val ) {
8840 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8841 } );
8842 }
8843
8844 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8845 } ).get();
8846 }
8847} );
8848
8849
8850var
8851 r20 = /%20/g,
8852 rhash = /#.*$/,
8853 rantiCache = /([?&])_=[^&]*/,
8854 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8855
8856 // #7653, #8125, #8152: local protocol detection
8857 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8858 rnoContent = /^(?:GET|HEAD)$/,
8859 rprotocol = /^\/\//,
8860
8861 /* Prefilters
8862 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8863 * 2) These are called:
8864 * - BEFORE asking for a transport
8865 * - AFTER param serialization (s.data is a string if s.processData is true)
8866 * 3) key is the dataType
8867 * 4) the catchall symbol "*" can be used
8868 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8869 */
8870 prefilters = {},
8871
8872 /* Transports bindings
8873 * 1) key is the dataType
8874 * 2) the catchall symbol "*" can be used
8875 * 3) selection will start with transport dataType and THEN go to "*" if needed
8876 */
8877 transports = {},
8878
8879 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8880 allTypes = "*/".concat( "*" ),
8881
8882 // Anchor tag for parsing the document origin
8883 originAnchor = document.createElement( "a" );
8884 originAnchor.href = location.href;
8885
8886// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8887function addToPrefiltersOrTransports( structure ) {
8888
8889 // dataTypeExpression is optional and defaults to "*"
8890 return function( dataTypeExpression, func ) {
8891
8892 if ( typeof dataTypeExpression !== "string" ) {
8893 func = dataTypeExpression;
8894 dataTypeExpression = "*";
8895 }
8896
8897 var dataType,
8898 i = 0,
8899 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
8900
8901 if ( isFunction( func ) ) {
8902
8903 // For each dataType in the dataTypeExpression
8904 while ( ( dataType = dataTypes[ i++ ] ) ) {
8905
8906 // Prepend if requested
8907 if ( dataType[ 0 ] === "+" ) {
8908 dataType = dataType.slice( 1 ) || "*";
8909 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
8910
8911 // Otherwise append
8912 } else {
8913 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
8914 }
8915 }
8916 }
8917 };
8918}
8919
8920// Base inspection function for prefilters and transports
8921function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8922
8923 var inspected = {},
8924 seekingTransport = ( structure === transports );
8925
8926 function inspect( dataType ) {
8927 var selected;
8928 inspected[ dataType ] = true;
8929 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8930 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8931 if ( typeof dataTypeOrTransport === "string" &&
8932 !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8933
8934 options.dataTypes.unshift( dataTypeOrTransport );
8935 inspect( dataTypeOrTransport );
8936 return false;
8937 } else if ( seekingTransport ) {
8938 return !( selected = dataTypeOrTransport );
8939 }
8940 } );
8941 return selected;
8942 }
8943
8944 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8945}
8946
8947// A special extend for ajax options
8948// that takes "flat" options (not to be deep extended)
8949// Fixes #9887
8950function ajaxExtend( target, src ) {
8951 var key, deep,
8952 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8953
8954 for ( key in src ) {
8955 if ( src[ key ] !== undefined ) {
8956 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
8957 }
8958 }
8959 if ( deep ) {
8960 jQuery.extend( true, target, deep );
8961 }
8962
8963 return target;
8964}
8965
8966/* Handles responses to an ajax request:
8967 * - finds the right dataType (mediates between content-type and expected dataType)
8968 * - returns the corresponding response
8969 */
8970function ajaxHandleResponses( s, jqXHR, responses ) {
8971
8972 var ct, type, finalDataType, firstDataType,
8973 contents = s.contents,
8974 dataTypes = s.dataTypes;
8975
8976 // Remove auto dataType and get content-type in the process
8977 while ( dataTypes[ 0 ] === "*" ) {
8978 dataTypes.shift();
8979 if ( ct === undefined ) {
8980 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
8981 }
8982 }
8983
8984 // Check if we're dealing with a known content-type
8985 if ( ct ) {
8986 for ( type in contents ) {
8987 if ( contents[ type ] && contents[ type ].test( ct ) ) {
8988 dataTypes.unshift( type );
8989 break;
8990 }
8991 }
8992 }
8993
8994 // Check to see if we have a response for the expected dataType
8995 if ( dataTypes[ 0 ] in responses ) {
8996 finalDataType = dataTypes[ 0 ];
8997 } else {
8998
8999 // Try convertible dataTypes
9000 for ( type in responses ) {
9001 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
9002 finalDataType = type;
9003 break;
9004 }
9005 if ( !firstDataType ) {
9006 firstDataType = type;
9007 }
9008 }
9009
9010 // Or just use first one
9011 finalDataType = finalDataType || firstDataType;
9012 }
9013
9014 // If we found a dataType
9015 // We add the dataType to the list if needed
9016 // and return the corresponding response
9017 if ( finalDataType ) {
9018 if ( finalDataType !== dataTypes[ 0 ] ) {
9019 dataTypes.unshift( finalDataType );
9020 }
9021 return responses[ finalDataType ];
9022 }
9023}
9024
9025/* Chain conversions given the request and the original response
9026 * Also sets the responseXXX fields on the jqXHR instance
9027 */
9028function ajaxConvert( s, response, jqXHR, isSuccess ) {
9029 var conv2, current, conv, tmp, prev,
9030 converters = {},
9031
9032 // Work with a copy of dataTypes in case we need to modify it for conversion
9033 dataTypes = s.dataTypes.slice();
9034
9035 // Create converters map with lowercased keys
9036 if ( dataTypes[ 1 ] ) {
9037 for ( conv in s.converters ) {
9038 converters[ conv.toLowerCase() ] = s.converters[ conv ];
9039 }
9040 }
9041
9042 current = dataTypes.shift();
9043
9044 // Convert to each sequential dataType
9045 while ( current ) {
9046
9047 if ( s.responseFields[ current ] ) {
9048 jqXHR[ s.responseFields[ current ] ] = response;
9049 }
9050
9051 // Apply the dataFilter if provided
9052 if ( !prev && isSuccess && s.dataFilter ) {
9053 response = s.dataFilter( response, s.dataType );
9054 }
9055
9056 prev = current;
9057 current = dataTypes.shift();
9058
9059 if ( current ) {
9060
9061 // There's only work to do if current dataType is non-auto
9062 if ( current === "*" ) {
9063
9064 current = prev;
9065
9066 // Convert response if prev dataType is non-auto and differs from current
9067 } else if ( prev !== "*" && prev !== current ) {
9068
9069 // Seek a direct converter
9070 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
9071
9072 // If none found, seek a pair
9073 if ( !conv ) {
9074 for ( conv2 in converters ) {
9075
9076 // If conv2 outputs current
9077 tmp = conv2.split( " " );
9078 if ( tmp[ 1 ] === current ) {
9079
9080 // If prev can be converted to accepted input
9081 conv = converters[ prev + " " + tmp[ 0 ] ] ||
9082 converters[ "* " + tmp[ 0 ] ];
9083 if ( conv ) {
9084
9085 // Condense equivalence converters
9086 if ( conv === true ) {
9087 conv = converters[ conv2 ];
9088
9089 // Otherwise, insert the intermediate dataType
9090 } else if ( converters[ conv2 ] !== true ) {
9091 current = tmp[ 0 ];
9092 dataTypes.unshift( tmp[ 1 ] );
9093 }
9094 break;
9095 }
9096 }
9097 }
9098 }
9099
9100 // Apply converter (if not an equivalence)
9101 if ( conv !== true ) {
9102
9103 // Unless errors are allowed to bubble, catch and return them
9104 if ( conv && s.throws ) {
9105 response = conv( response );
9106 } else {
9107 try {
9108 response = conv( response );
9109 } catch ( e ) {
9110 return {
9111 state: "parsererror",
9112 error: conv ? e : "No conversion from " + prev + " to " + current
9113 };
9114 }
9115 }
9116 }
9117 }
9118 }
9119 }
9120
9121 return { state: "success", data: response };
9122}
9123
9124jQuery.extend( {
9125
9126 // Counter for holding the number of active queries
9127 active: 0,
9128
9129 // Last-Modified header cache for next request
9130 lastModified: {},
9131 etag: {},
9132
9133 ajaxSettings: {
9134 url: location.href,
9135 type: "GET",
9136 isLocal: rlocalProtocol.test( location.protocol ),
9137 global: true,
9138 processData: true,
9139 async: true,
9140 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
9141
9142 /*
9143 timeout: 0,
9144 data: null,
9145 dataType: null,
9146 username: null,
9147 password: null,
9148 cache: null,
9149 throws: false,
9150 traditional: false,
9151 headers: {},
9152 */
9153
9154 accepts: {
9155 "*": allTypes,
9156 text: "text/plain",
9157 html: "text/html",
9158 xml: "application/xml, text/xml",
9159 json: "application/json, text/javascript"
9160 },
9161
9162 contents: {
9163 xml: /\bxml\b/,
9164 html: /\bhtml/,
9165 json: /\bjson\b/
9166 },
9167
9168 responseFields: {
9169 xml: "responseXML",
9170 text: "responseText",
9171 json: "responseJSON"
9172 },
9173
9174 // Data converters
9175 // Keys separate source (or catchall "*") and destination types with a single space
9176 converters: {
9177
9178 // Convert anything to text
9179 "* text": String,
9180
9181 // Text to html (true = no transformation)
9182 "text html": true,
9183
9184 // Evaluate text as a json expression
9185 "text json": JSON.parse,
9186
9187 // Parse text as xml
9188 "text xml": jQuery.parseXML
9189 },
9190
9191 // For options that shouldn't be deep extended:
9192 // you can add your own custom options here if
9193 // and when you create one that shouldn't be
9194 // deep extended (see ajaxExtend)
9195 flatOptions: {
9196 url: true,
9197 context: true
9198 }
9199 },
9200
9201 // Creates a full fledged settings object into target
9202 // with both ajaxSettings and settings fields.
9203 // If target is omitted, writes into ajaxSettings.
9204 ajaxSetup: function( target, settings ) {
9205 return settings ?
9206
9207 // Building a settings object
9208 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
9209
9210 // Extending ajaxSettings
9211 ajaxExtend( jQuery.ajaxSettings, target );
9212 },
9213
9214 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
9215 ajaxTransport: addToPrefiltersOrTransports( transports ),
9216
9217 // Main method
9218 ajax: function( url, options ) {
9219
9220 // If url is an object, simulate pre-1.5 signature
9221 if ( typeof url === "object" ) {
9222 options = url;
9223 url = undefined;
9224 }
9225
9226 // Force options to be an object
9227 options = options || {};
9228
9229 var transport,
9230
9231 // URL without anti-cache param
9232 cacheURL,
9233
9234 // Response headers
9235 responseHeadersString,
9236 responseHeaders,
9237
9238 // timeout handle
9239 timeoutTimer,
9240
9241 // Url cleanup var
9242 urlAnchor,
9243
9244 // Request state (becomes false upon send and true upon completion)
9245 completed,
9246
9247 // To know if global events are to be dispatched
9248 fireGlobals,
9249
9250 // Loop variable
9251 i,
9252
9253 // uncached part of the url
9254 uncached,
9255
9256 // Create the final options object
9257 s = jQuery.ajaxSetup( {}, options ),
9258
9259 // Callbacks context
9260 callbackContext = s.context || s,
9261
9262 // Context for global events is callbackContext if it is a DOM node or jQuery collection
9263 globalEventContext = s.context &&
9264 ( callbackContext.nodeType || callbackContext.jquery ) ?
9265 jQuery( callbackContext ) :
9266 jQuery.event,
9267
9268 // Deferreds
9269 deferred = jQuery.Deferred(),
9270 completeDeferred = jQuery.Callbacks( "once memory" ),
9271
9272 // Status-dependent callbacks
9273 statusCode = s.statusCode || {},
9274
9275 // Headers (they are sent all at once)
9276 requestHeaders = {},
9277 requestHeadersNames = {},
9278
9279 // Default abort message
9280 strAbort = "canceled",
9281
9282 // Fake xhr
9283 jqXHR = {
9284 readyState: 0,
9285
9286 // Builds headers hashtable if needed
9287 getResponseHeader: function( key ) {
9288 var match;
9289 if ( completed ) {
9290 if ( !responseHeaders ) {
9291 responseHeaders = {};
9292 while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
9293 responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
9294 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
9295 .concat( match[ 2 ] );
9296 }
9297 }
9298 match = responseHeaders[ key.toLowerCase() + " " ];
9299 }
9300 return match == null ? null : match.join( ", " );
9301 },
9302
9303 // Raw string
9304 getAllResponseHeaders: function() {
9305 return completed ? responseHeadersString : null;
9306 },
9307
9308 // Caches the header
9309 setRequestHeader: function( name, value ) {
9310 if ( completed == null ) {
9311 name = requestHeadersNames[ name.toLowerCase() ] =
9312 requestHeadersNames[ name.toLowerCase() ] || name;
9313 requestHeaders[ name ] = value;
9314 }
9315 return this;
9316 },
9317
9318 // Overrides response content-type header
9319 overrideMimeType: function( type ) {
9320 if ( completed == null ) {
9321 s.mimeType = type;
9322 }
9323 return this;
9324 },
9325
9326 // Status-dependent callbacks
9327 statusCode: function( map ) {
9328 var code;
9329 if ( map ) {
9330 if ( completed ) {
9331
9332 // Execute the appropriate callbacks
9333 jqXHR.always( map[ jqXHR.status ] );
9334 } else {
9335
9336 // Lazy-add the new callbacks in a way that preserves old ones
9337 for ( code in map ) {
9338 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
9339 }
9340 }
9341 }
9342 return this;
9343 },
9344
9345 // Cancel the request
9346 abort: function( statusText ) {
9347 var finalText = statusText || strAbort;
9348 if ( transport ) {
9349 transport.abort( finalText );
9350 }
9351 done( 0, finalText );
9352 return this;
9353 }
9354 };
9355
9356 // Attach deferreds
9357 deferred.promise( jqXHR );
9358
9359 // Add protocol if not provided (prefilters might expect it)
9360 // Handle falsy url in the settings object (#10093: consistency with old signature)
9361 // We also use the url parameter if available
9362 s.url = ( ( url || s.url || location.href ) + "" )
9363 .replace( rprotocol, location.protocol + "//" );
9364
9365 // Alias method option to type as per ticket #12004
9366 s.type = options.method || options.type || s.method || s.type;
9367
9368 // Extract dataTypes list
9369 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
9370
9371 // A cross-domain request is in order when the origin doesn't match the current origin.
9372 if ( s.crossDomain == null ) {
9373 urlAnchor = document.createElement( "a" );
9374
9375 // Support: IE <=8 - 11, Edge 12 - 15
9376 // IE throws exception on accessing the href property if url is malformed,
9377 // e.g. http://example.com:80x/
9378 try {
9379 urlAnchor.href = s.url;
9380
9381 // Support: IE <=8 - 11 only
9382 // Anchor's host property isn't correctly set when s.url is relative
9383 urlAnchor.href = urlAnchor.href;
9384 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
9385 urlAnchor.protocol + "//" + urlAnchor.host;
9386 } catch ( e ) {
9387
9388 // If there is an error parsing the URL, assume it is crossDomain,
9389 // it can be rejected by the transport if it is invalid
9390 s.crossDomain = true;
9391 }
9392 }
9393
9394 // Convert data if not already a string
9395 if ( s.data && s.processData && typeof s.data !== "string" ) {
9396 s.data = jQuery.param( s.data, s.traditional );
9397 }
9398
9399 // Apply prefilters
9400 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
9401
9402 // If request was aborted inside a prefilter, stop there
9403 if ( completed ) {
9404 return jqXHR;
9405 }
9406
9407 // We can fire global events as of now if asked to
9408 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
9409 fireGlobals = jQuery.event && s.global;
9410
9411 // Watch for a new set of requests
9412 if ( fireGlobals && jQuery.active++ === 0 ) {
9413 jQuery.event.trigger( "ajaxStart" );
9414 }
9415
9416 // Uppercase the type
9417 s.type = s.type.toUpperCase();
9418
9419 // Determine if request has content
9420 s.hasContent = !rnoContent.test( s.type );
9421
9422 // Save the URL in case we're toying with the If-Modified-Since
9423 // and/or If-None-Match header later on
9424 // Remove hash to simplify url manipulation
9425 cacheURL = s.url.replace( rhash, "" );
9426
9427 // More options handling for requests with no content
9428 if ( !s.hasContent ) {
9429
9430 // Remember the hash so we can put it back
9431 uncached = s.url.slice( cacheURL.length );
9432
9433 // If data is available and should be processed, append data to url
9434 if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
9435 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
9436
9437 // #9682: remove data so that it's not used in an eventual retry
9438 delete s.data;
9439 }
9440
9441 // Add or update anti-cache param if needed
9442 if ( s.cache === false ) {
9443 cacheURL = cacheURL.replace( rantiCache, "$1" );
9444 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
9445 }
9446
9447 // Put hash and anti-cache on the URL that will be requested (gh-1732)
9448 s.url = cacheURL + uncached;
9449
9450 // Change '%20' to '+' if this is encoded form body content (gh-2658)
9451 } else if ( s.data && s.processData &&
9452 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
9453 s.data = s.data.replace( r20, "+" );
9454 }
9455
9456 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9457 if ( s.ifModified ) {
9458 if ( jQuery.lastModified[ cacheURL ] ) {
9459 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
9460 }
9461 if ( jQuery.etag[ cacheURL ] ) {
9462 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
9463 }
9464 }
9465
9466 // Set the correct header, if data is being sent
9467 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
9468 jqXHR.setRequestHeader( "Content-Type", s.contentType );
9469 }
9470
9471 // Set the Accepts header for the server, depending on the dataType
9472 jqXHR.setRequestHeader(
9473 "Accept",
9474 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
9475 s.accepts[ s.dataTypes[ 0 ] ] +
9476 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
9477 s.accepts[ "*" ]
9478 );
9479
9480 // Check for headers option
9481 for ( i in s.headers ) {
9482 jqXHR.setRequestHeader( i, s.headers[ i ] );
9483 }
9484
9485 // Allow custom headers/mimetypes and early abort
9486 if ( s.beforeSend &&
9487 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
9488
9489 // Abort if not done already and return
9490 return jqXHR.abort();
9491 }
9492
9493 // Aborting is no longer a cancellation
9494 strAbort = "abort";
9495
9496 // Install callbacks on deferreds
9497 completeDeferred.add( s.complete );
9498 jqXHR.done( s.success );
9499 jqXHR.fail( s.error );
9500
9501 // Get transport
9502 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
9503
9504 // If no transport, we auto-abort
9505 if ( !transport ) {
9506 done( -1, "No Transport" );
9507 } else {
9508 jqXHR.readyState = 1;
9509
9510 // Send global event
9511 if ( fireGlobals ) {
9512 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9513 }
9514
9515 // If request was aborted inside ajaxSend, stop there
9516 if ( completed ) {
9517 return jqXHR;
9518 }
9519
9520 // Timeout
9521 if ( s.async && s.timeout > 0 ) {
9522 timeoutTimer = window.setTimeout( function() {
9523 jqXHR.abort( "timeout" );
9524 }, s.timeout );
9525 }
9526
9527 try {
9528 completed = false;
9529 transport.send( requestHeaders, done );
9530 } catch ( e ) {
9531
9532 // Rethrow post-completion exceptions
9533 if ( completed ) {
9534 throw e;
9535 }
9536
9537 // Propagate others as results
9538 done( -1, e );
9539 }
9540 }
9541
9542 // Callback for when everything is done
9543 function done( status, nativeStatusText, responses, headers ) {
9544 var isSuccess, success, error, response, modified,
9545 statusText = nativeStatusText;
9546
9547 // Ignore repeat invocations
9548 if ( completed ) {
9549 return;
9550 }
9551
9552 completed = true;
9553
9554 // Clear timeout if it exists
9555 if ( timeoutTimer ) {
9556 window.clearTimeout( timeoutTimer );
9557 }
9558
9559 // Dereference transport for early garbage collection
9560 // (no matter how long the jqXHR object will be used)
9561 transport = undefined;
9562
9563 // Cache response headers
9564 responseHeadersString = headers || "";
9565
9566 // Set readyState
9567 jqXHR.readyState = status > 0 ? 4 : 0;
9568
9569 // Determine if successful
9570 isSuccess = status >= 200 && status < 300 || status === 304;
9571
9572 // Get response data
9573 if ( responses ) {
9574 response = ajaxHandleResponses( s, jqXHR, responses );
9575 }
9576
9577 // Convert no matter what (that way responseXXX fields are always set)
9578 response = ajaxConvert( s, response, jqXHR, isSuccess );
9579
9580 // If successful, handle type chaining
9581 if ( isSuccess ) {
9582
9583 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9584 if ( s.ifModified ) {
9585 modified = jqXHR.getResponseHeader( "Last-Modified" );
9586 if ( modified ) {
9587 jQuery.lastModified[ cacheURL ] = modified;
9588 }
9589 modified = jqXHR.getResponseHeader( "etag" );
9590 if ( modified ) {
9591 jQuery.etag[ cacheURL ] = modified;
9592 }
9593 }
9594
9595 // if no content
9596 if ( status === 204 || s.type === "HEAD" ) {
9597 statusText = "nocontent";
9598
9599 // if not modified
9600 } else if ( status === 304 ) {
9601 statusText = "notmodified";
9602
9603 // If we have data, let's convert it
9604 } else {
9605 statusText = response.state;
9606 success = response.data;
9607 error = response.error;
9608 isSuccess = !error;
9609 }
9610 } else {
9611
9612 // Extract error from statusText and normalize for non-aborts
9613 error = statusText;
9614 if ( status || !statusText ) {
9615 statusText = "error";
9616 if ( status < 0 ) {
9617 status = 0;
9618 }
9619 }
9620 }
9621
9622 // Set data for the fake xhr object
9623 jqXHR.status = status;
9624 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9625
9626 // Success/Error
9627 if ( isSuccess ) {
9628 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9629 } else {
9630 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9631 }
9632
9633 // Status-dependent callbacks
9634 jqXHR.statusCode( statusCode );
9635 statusCode = undefined;
9636
9637 if ( fireGlobals ) {
9638 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9639 [ jqXHR, s, isSuccess ? success : error ] );
9640 }
9641
9642 // Complete
9643 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9644
9645 if ( fireGlobals ) {
9646 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9647
9648 // Handle the global AJAX counter
9649 if ( !( --jQuery.active ) ) {
9650 jQuery.event.trigger( "ajaxStop" );
9651 }
9652 }
9653 }
9654
9655 return jqXHR;
9656 },
9657
9658 getJSON: function( url, data, callback ) {
9659 return jQuery.get( url, data, callback, "json" );
9660 },
9661
9662 getScript: function( url, callback ) {
9663 return jQuery.get( url, undefined, callback, "script" );
9664 }
9665} );
9666
9667jQuery.each( [ "get", "post" ], function( i, method ) {
9668 jQuery[ method ] = function( url, data, callback, type ) {
9669
9670 // Shift arguments if data argument was omitted
9671 if ( isFunction( data ) ) {
9672 type = type || callback;
9673 callback = data;
9674 data = undefined;
9675 }
9676
9677 // The url can be an options object (which then must have .url)
9678 return jQuery.ajax( jQuery.extend( {
9679 url: url,
9680 type: method,
9681 dataType: type,
9682 data: data,
9683 success: callback
9684 }, jQuery.isPlainObject( url ) && url ) );
9685 };
9686} );
9687
9688
9689jQuery._evalUrl = function( url, options ) {
9690 return jQuery.ajax( {
9691 url: url,
9692
9693 // Make this explicit, since user can override this through ajaxSetup (#11264)
9694 type: "GET",
9695 dataType: "script",
9696 cache: true,
9697 async: false,
9698 global: false,
9699
9700 // Only evaluate the response if it is successful (gh-4126)
9701 // dataFilter is not invoked for failure responses, so using it instead
9702 // of the default converter is kludgy but it works.
9703 converters: {
9704 "text script": function() {}
9705 },
9706 dataFilter: function( response ) {
9707 jQuery.globalEval( response, options );
9708 }
9709 } );
9710};
9711
9712
9713jQuery.fn.extend( {
9714 wrapAll: function( html ) {
9715 var wrap;
9716
9717 if ( this[ 0 ] ) {
9718 if ( isFunction( html ) ) {
9719 html = html.call( this[ 0 ] );
9720 }
9721
9722 // The elements to wrap the target around
9723 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
9724
9725 if ( this[ 0 ].parentNode ) {
9726 wrap.insertBefore( this[ 0 ] );
9727 }
9728
9729 wrap.map( function() {
9730 var elem = this;
9731
9732 while ( elem.firstElementChild ) {
9733 elem = elem.firstElementChild;
9734 }
9735
9736 return elem;
9737 } ).append( this );
9738 }
9739
9740 return this;
9741 },
9742
9743 wrapInner: function( html ) {
9744 if ( isFunction( html ) ) {
9745 return this.each( function( i ) {
9746 jQuery( this ).wrapInner( html.call( this, i ) );
9747 } );
9748 }
9749
9750 return this.each( function() {
9751 var self = jQuery( this ),
9752 contents = self.contents();
9753
9754 if ( contents.length ) {
9755 contents.wrapAll( html );
9756
9757 } else {
9758 self.append( html );
9759 }
9760 } );
9761 },
9762
9763 wrap: function( html ) {
9764 var htmlIsFunction = isFunction( html );
9765
9766 return this.each( function( i ) {
9767 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
9768 } );
9769 },
9770
9771 unwrap: function( selector ) {
9772 this.parent( selector ).not( "body" ).each( function() {
9773 jQuery( this ).replaceWith( this.childNodes );
9774 } );
9775 return this;
9776 }
9777} );
9778
9779
9780jQuery.expr.pseudos.hidden = function( elem ) {
9781 return !jQuery.expr.pseudos.visible( elem );
9782};
9783jQuery.expr.pseudos.visible = function( elem ) {
9784 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
9785};
9786
9787
9788
9789
9790jQuery.ajaxSettings.xhr = function() {
9791 try {
9792 return new window.XMLHttpRequest();
9793 } catch ( e ) {}
9794};
9795
9796var xhrSuccessStatus = {
9797
9798 // File protocol always yields status code 0, assume 200
9799 0: 200,
9800
9801 // Support: IE <=9 only
9802 // #1450: sometimes IE returns 1223 when it should be 204
9803 1223: 204
9804 },
9805 xhrSupported = jQuery.ajaxSettings.xhr();
9806
9807support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9808support.ajax = xhrSupported = !!xhrSupported;
9809
9810jQuery.ajaxTransport( function( options ) {
9811 var callback, errorCallback;
9812
9813 // Cross domain only allowed if supported through XMLHttpRequest
9814 if ( support.cors || xhrSupported && !options.crossDomain ) {
9815 return {
9816 send: function( headers, complete ) {
9817 var i,
9818 xhr = options.xhr();
9819
9820 xhr.open(
9821 options.type,
9822 options.url,
9823 options.async,
9824 options.username,
9825 options.password
9826 );
9827
9828 // Apply custom fields if provided
9829 if ( options.xhrFields ) {
9830 for ( i in options.xhrFields ) {
9831 xhr[ i ] = options.xhrFields[ i ];
9832 }
9833 }
9834
9835 // Override mime type if needed
9836 if ( options.mimeType && xhr.overrideMimeType ) {
9837 xhr.overrideMimeType( options.mimeType );
9838 }
9839
9840 // X-Requested-With header
9841 // For cross-domain requests, seeing as conditions for a preflight are
9842 // akin to a jigsaw puzzle, we simply never set it to be sure.
9843 // (it can always be set on a per-request basis or even using ajaxSetup)
9844 // For same-domain requests, won't change header if already provided.
9845 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
9846 headers[ "X-Requested-With" ] = "XMLHttpRequest";
9847 }
9848
9849 // Set headers
9850 for ( i in headers ) {
9851 xhr.setRequestHeader( i, headers[ i ] );
9852 }
9853
9854 // Callback
9855 callback = function( type ) {
9856 return function() {
9857 if ( callback ) {
9858 callback = errorCallback = xhr.onload =
9859 xhr.onerror = xhr.onabort = xhr.ontimeout =
9860 xhr.onreadystatechange = null;
9861
9862 if ( type === "abort" ) {
9863 xhr.abort();
9864 } else if ( type === "error" ) {
9865
9866 // Support: IE <=9 only
9867 // On a manual native abort, IE9 throws
9868 // errors on any property access that is not readyState
9869 if ( typeof xhr.status !== "number" ) {
9870 complete( 0, "error" );
9871 } else {
9872 complete(
9873
9874 // File: protocol always yields status 0; see #8605, #14207
9875 xhr.status,
9876 xhr.statusText
9877 );
9878 }
9879 } else {
9880 complete(
9881 xhrSuccessStatus[ xhr.status ] || xhr.status,
9882 xhr.statusText,
9883
9884 // Support: IE <=9 only
9885 // IE9 has no XHR2 but throws on binary (trac-11426)
9886 // For XHR2 non-text, let the caller handle it (gh-2498)
9887 ( xhr.responseType || "text" ) !== "text" ||
9888 typeof xhr.responseText !== "string" ?
9889 { binary: xhr.response } :
9890 { text: xhr.responseText },
9891 xhr.getAllResponseHeaders()
9892 );
9893 }
9894 }
9895 };
9896 };
9897
9898 // Listen to events
9899 xhr.onload = callback();
9900 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
9901
9902 // Support: IE 9 only
9903 // Use onreadystatechange to replace onabort
9904 // to handle uncaught aborts
9905 if ( xhr.onabort !== undefined ) {
9906 xhr.onabort = errorCallback;
9907 } else {
9908 xhr.onreadystatechange = function() {
9909
9910 // Check readyState before timeout as it changes
9911 if ( xhr.readyState === 4 ) {
9912
9913 // Allow onerror to be called first,
9914 // but that will not handle a native abort
9915 // Also, save errorCallback to a variable
9916 // as xhr.onerror cannot be accessed
9917 window.setTimeout( function() {
9918 if ( callback ) {
9919 errorCallback();
9920 }
9921 } );
9922 }
9923 };
9924 }
9925
9926 // Create the abort callback
9927 callback = callback( "abort" );
9928
9929 try {
9930
9931 // Do send the request (this may raise an exception)
9932 xhr.send( options.hasContent && options.data || null );
9933 } catch ( e ) {
9934
9935 // #14683: Only rethrow if this hasn't been notified as an error yet
9936 if ( callback ) {
9937 throw e;
9938 }
9939 }
9940 },
9941
9942 abort: function() {
9943 if ( callback ) {
9944 callback();
9945 }
9946 }
9947 };
9948 }
9949} );
9950
9951
9952
9953
9954// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
9955jQuery.ajaxPrefilter( function( s ) {
9956 if ( s.crossDomain ) {
9957 s.contents.script = false;
9958 }
9959} );
9960
9961// Install script dataType
9962jQuery.ajaxSetup( {
9963 accepts: {
9964 script: "text/javascript, application/javascript, " +
9965 "application/ecmascript, application/x-ecmascript"
9966 },
9967 contents: {
9968 script: /\b(?:java|ecma)script\b/
9969 },
9970 converters: {
9971 "text script": function( text ) {
9972 jQuery.globalEval( text );
9973 return text;
9974 }
9975 }
9976} );
9977
9978// Handle cache's special case and crossDomain
9979jQuery.ajaxPrefilter( "script", function( s ) {
9980 if ( s.cache === undefined ) {
9981 s.cache = false;
9982 }
9983 if ( s.crossDomain ) {
9984 s.type = "GET";
9985 }
9986} );
9987
9988// Bind script tag hack transport
9989jQuery.ajaxTransport( "script", function( s ) {
9990
9991 // This transport only deals with cross domain or forced-by-attrs requests
9992 if ( s.crossDomain || s.scriptAttrs ) {
9993 var script, callback;
9994 return {
9995 send: function( _, complete ) {
9996 script = jQuery( "<script>" )
9997 .attr( s.scriptAttrs || {} )
9998 .prop( { charset: s.scriptCharset, src: s.url } )
9999 .on( "load error", callback = function( evt ) {
10000 script.remove();
10001 callback = null;
10002 if ( evt ) {
10003 complete( evt.type === "error" ? 404 : 200, evt.type );
10004 }
10005 } );
10006
10007 // Use native DOM manipulation to avoid our domManip AJAX trickery
10008 document.head.appendChild( script[ 0 ] );
10009 },
10010 abort: function() {
10011 if ( callback ) {
10012 callback();
10013 }
10014 }
10015 };
10016 }
10017} );
10018
10019
10020
10021
10022var oldCallbacks = [],
10023 rjsonp = /(=)\?(?=&|$)|\?\?/;
10024
10025// Default jsonp settings
10026jQuery.ajaxSetup( {
10027 jsonp: "callback",
10028 jsonpCallback: function() {
10029 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
10030 this[ callback ] = true;
10031 return callback;
10032 }
10033} );
10034
10035// Detect, normalize options and install callbacks for jsonp requests
10036jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
10037
10038 var callbackName, overwritten, responseContainer,
10039 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
10040 "url" :
10041 typeof s.data === "string" &&
10042 ( s.contentType || "" )
10043 .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
10044 rjsonp.test( s.data ) && "data"
10045 );
10046
10047 // Handle iff the expected data type is "jsonp" or we have a parameter to set
10048 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
10049
10050 // Get callback name, remembering preexisting value associated with it
10051 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
10052 s.jsonpCallback() :
10053 s.jsonpCallback;
10054
10055 // Insert callback into url or form data
10056 if ( jsonProp ) {
10057 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
10058 } else if ( s.jsonp !== false ) {
10059 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
10060 }
10061
10062 // Use data converter to retrieve json after script execution
10063 s.converters[ "script json" ] = function() {
10064 if ( !responseContainer ) {
10065 jQuery.error( callbackName + " was not called" );
10066 }
10067 return responseContainer[ 0 ];
10068 };
10069
10070 // Force json dataType
10071 s.dataTypes[ 0 ] = "json";
10072
10073 // Install callback
10074 overwritten = window[ callbackName ];
10075 window[ callbackName ] = function() {
10076 responseContainer = arguments;
10077 };
10078
10079 // Clean-up function (fires after converters)
10080 jqXHR.always( function() {
10081
10082 // If previous value didn't exist - remove it
10083 if ( overwritten === undefined ) {
10084 jQuery( window ).removeProp( callbackName );
10085
10086 // Otherwise restore preexisting value
10087 } else {
10088 window[ callbackName ] = overwritten;
10089 }
10090
10091 // Save back as free
10092 if ( s[ callbackName ] ) {
10093
10094 // Make sure that re-using the options doesn't screw things around
10095 s.jsonpCallback = originalSettings.jsonpCallback;
10096
10097 // Save the callback name for future use
10098 oldCallbacks.push( callbackName );
10099 }
10100
10101 // Call if it was a function and we have a response
10102 if ( responseContainer && isFunction( overwritten ) ) {
10103 overwritten( responseContainer[ 0 ] );
10104 }
10105
10106 responseContainer = overwritten = undefined;
10107 } );
10108
10109 // Delegate to script
10110 return "script";
10111 }
10112} );
10113
10114
10115
10116
10117// Support: Safari 8 only
10118// In Safari 8 documents created via document.implementation.createHTMLDocument
10119// collapse sibling forms: the second one becomes a child of the first one.
10120// Because of that, this security measure has to be disabled in Safari 8.
10121// https://bugs.webkit.org/show_bug.cgi?id=137337
10122support.createHTMLDocument = ( function() {
10123 var body = document.implementation.createHTMLDocument( "" ).body;
10124 body.innerHTML = "<form></form><form></form>";
10125 return body.childNodes.length === 2;
10126} )();
10127
10128
10129// Argument "data" should be string of html
10130// context (optional): If specified, the fragment will be created in this context,
10131// defaults to document
10132// keepScripts (optional): If true, will include scripts passed in the html string
10133jQuery.parseHTML = function( data, context, keepScripts ) {
10134 if ( typeof data !== "string" ) {
10135 return [];
10136 }
10137 if ( typeof context === "boolean" ) {
10138 keepScripts = context;
10139 context = false;
10140 }
10141
10142 var base, parsed, scripts;
10143
10144 if ( !context ) {
10145
10146 // Stop scripts or inline event handlers from being executed immediately
10147 // by using document.implementation
10148 if ( support.createHTMLDocument ) {
10149 context = document.implementation.createHTMLDocument( "" );
10150
10151 // Set the base href for the created document
10152 // so any parsed elements with URLs
10153 // are based on the document's URL (gh-2965)
10154 base = context.createElement( "base" );
10155 base.href = document.location.href;
10156 context.head.appendChild( base );
10157 } else {
10158 context = document;
10159 }
10160 }
10161
10162 parsed = rsingleTag.exec( data );
10163 scripts = !keepScripts && [];
10164
10165 // Single tag
10166 if ( parsed ) {
10167 return [ context.createElement( parsed[ 1 ] ) ];
10168 }
10169
10170 parsed = buildFragment( [ data ], context, scripts );
10171
10172 if ( scripts && scripts.length ) {
10173 jQuery( scripts ).remove();
10174 }
10175
10176 return jQuery.merge( [], parsed.childNodes );
10177};
10178
10179
10180/**
10181 * Load a url into a page
10182 */
10183jQuery.fn.load = function( url, params, callback ) {
10184 var selector, type, response,
10185 self = this,
10186 off = url.indexOf( " " );
10187
10188 if ( off > -1 ) {
10189 selector = stripAndCollapse( url.slice( off ) );
10190 url = url.slice( 0, off );
10191 }
10192
10193 // If it's a function
10194 if ( isFunction( params ) ) {
10195
10196 // We assume that it's the callback
10197 callback = params;
10198 params = undefined;
10199
10200 // Otherwise, build a param string
10201 } else if ( params && typeof params === "object" ) {
10202 type = "POST";
10203 }
10204
10205 // If we have elements to modify, make the request
10206 if ( self.length > 0 ) {
10207 jQuery.ajax( {
10208 url: url,
10209
10210 // If "type" variable is undefined, then "GET" method will be used.
10211 // Make value of this field explicit since
10212 // user can override it through ajaxSetup method
10213 type: type || "GET",
10214 dataType: "html",
10215 data: params
10216 } ).done( function( responseText ) {
10217
10218 // Save response for use in complete callback
10219 response = arguments;
10220
10221 self.html( selector ?
10222
10223 // If a selector was specified, locate the right elements in a dummy div
10224 // Exclude scripts to avoid IE 'Permission Denied' errors
10225 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
10226
10227 // Otherwise use the full result
10228 responseText );
10229
10230 // If the request succeeds, this function gets "data", "status", "jqXHR"
10231 // but they are ignored because response was set above.
10232 // If it fails, this function gets "jqXHR", "status", "error"
10233 } ).always( callback && function( jqXHR, status ) {
10234 self.each( function() {
10235 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
10236 } );
10237 } );
10238 }
10239
10240 return this;
10241};
10242
10243
10244
10245
10246// Attach a bunch of functions for handling common AJAX events
10247jQuery.each( [
10248 "ajaxStart",
10249 "ajaxStop",
10250 "ajaxComplete",
10251 "ajaxError",
10252 "ajaxSuccess",
10253 "ajaxSend"
10254], function( i, type ) {
10255 jQuery.fn[ type ] = function( fn ) {
10256 return this.on( type, fn );
10257 };
10258} );
10259
10260
10261
10262
10263jQuery.expr.pseudos.animated = function( elem ) {
10264 return jQuery.grep( jQuery.timers, function( fn ) {
10265 return elem === fn.elem;
10266 } ).length;
10267};
10268
10269
10270
10271
10272jQuery.offset = {
10273 setOffset: function( elem, options, i ) {
10274 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
10275 position = jQuery.css( elem, "position" ),
10276 curElem = jQuery( elem ),
10277 props = {};
10278
10279 // Set position first, in-case top/left are set even on static elem
10280 if ( position === "static" ) {
10281 elem.style.position = "relative";
10282 }
10283
10284 curOffset = curElem.offset();
10285 curCSSTop = jQuery.css( elem, "top" );
10286 curCSSLeft = jQuery.css( elem, "left" );
10287 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
10288 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
10289
10290 // Need to be able to calculate position if either
10291 // top or left is auto and position is either absolute or fixed
10292 if ( calculatePosition ) {
10293 curPosition = curElem.position();
10294 curTop = curPosition.top;
10295 curLeft = curPosition.left;
10296
10297 } else {
10298 curTop = parseFloat( curCSSTop ) || 0;
10299 curLeft = parseFloat( curCSSLeft ) || 0;
10300 }
10301
10302 if ( isFunction( options ) ) {
10303
10304 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
10305 options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
10306 }
10307
10308 if ( options.top != null ) {
10309 props.top = ( options.top - curOffset.top ) + curTop;
10310 }
10311 if ( options.left != null ) {
10312 props.left = ( options.left - curOffset.left ) + curLeft;
10313 }
10314
10315 if ( "using" in options ) {
10316 options.using.call( elem, props );
10317
10318 } else {
10319 curElem.css( props );
10320 }
10321 }
10322};
10323
10324jQuery.fn.extend( {
10325
10326 // offset() relates an element's border box to the document origin
10327 offset: function( options ) {
10328
10329 // Preserve chaining for setter
10330 if ( arguments.length ) {
10331 return options === undefined ?
10332 this :
10333 this.each( function( i ) {
10334 jQuery.offset.setOffset( this, options, i );
10335 } );
10336 }
10337
10338 var rect, win,
10339 elem = this[ 0 ];
10340
10341 if ( !elem ) {
10342 return;
10343 }
10344
10345 // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
10346 // Support: IE <=11 only
10347 // Running getBoundingClientRect on a
10348 // disconnected node in IE throws an error
10349 if ( !elem.getClientRects().length ) {
10350 return { top: 0, left: 0 };
10351 }
10352
10353 // Get document-relative position by adding viewport scroll to viewport-relative gBCR
10354 rect = elem.getBoundingClientRect();
10355 win = elem.ownerDocument.defaultView;
10356 return {
10357 top: rect.top + win.pageYOffset,
10358 left: rect.left + win.pageXOffset
10359 };
10360 },
10361
10362 // position() relates an element's margin box to its offset parent's padding box
10363 // This corresponds to the behavior of CSS absolute positioning
10364 position: function() {
10365 if ( !this[ 0 ] ) {
10366 return;
10367 }
10368
10369 var offsetParent, offset, doc,
10370 elem = this[ 0 ],
10371 parentOffset = { top: 0, left: 0 };
10372
10373 // position:fixed elements are offset from the viewport, which itself always has zero offset
10374 if ( jQuery.css( elem, "position" ) === "fixed" ) {
10375
10376 // Assume position:fixed implies availability of getBoundingClientRect
10377 offset = elem.getBoundingClientRect();
10378
10379 } else {
10380 offset = this.offset();
10381
10382 // Account for the *real* offset parent, which can be the document or its root element
10383 // when a statically positioned element is identified
10384 doc = elem.ownerDocument;
10385 offsetParent = elem.offsetParent || doc.documentElement;
10386 while ( offsetParent &&
10387 ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
10388 jQuery.css( offsetParent, "position" ) === "static" ) {
10389
10390 offsetParent = offsetParent.parentNode;
10391 }
10392 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
10393
10394 // Incorporate borders into its offset, since they are outside its content origin
10395 parentOffset = jQuery( offsetParent ).offset();
10396 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
10397 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
10398 }
10399 }
10400
10401 // Subtract parent offsets and element margins
10402 return {
10403 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10404 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
10405 };
10406 },
10407
10408 // This method will return documentElement in the following cases:
10409 // 1) For the element inside the iframe without offsetParent, this method will return
10410 // documentElement of the parent window
10411 // 2) For the hidden or detached element
10412 // 3) For body or html element, i.e. in case of the html node - it will return itself
10413 //
10414 // but those exceptions were never presented as a real life use-cases
10415 // and might be considered as more preferable results.
10416 //
10417 // This logic, however, is not guaranteed and can change at any point in the future
10418 offsetParent: function() {
10419 return this.map( function() {
10420 var offsetParent = this.offsetParent;
10421
10422 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
10423 offsetParent = offsetParent.offsetParent;
10424 }
10425
10426 return offsetParent || documentElement;
10427 } );
10428 }
10429} );
10430
10431// Create scrollLeft and scrollTop methods
10432jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
10433 var top = "pageYOffset" === prop;
10434
10435 jQuery.fn[ method ] = function( val ) {
10436 return access( this, function( elem, method, val ) {
10437
10438 // Coalesce documents and windows
10439 var win;
10440 if ( isWindow( elem ) ) {
10441 win = elem;
10442 } else if ( elem.nodeType === 9 ) {
10443 win = elem.defaultView;
10444 }
10445
10446 if ( val === undefined ) {
10447 return win ? win[ prop ] : elem[ method ];
10448 }
10449
10450 if ( win ) {
10451 win.scrollTo(
10452 !top ? val : win.pageXOffset,
10453 top ? val : win.pageYOffset
10454 );
10455
10456 } else {
10457 elem[ method ] = val;
10458 }
10459 }, method, val, arguments.length );
10460 };
10461} );
10462
10463// Support: Safari <=7 - 9.1, Chrome <=37 - 49
10464// Add the top/left cssHooks using jQuery.fn.position
10465// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10466// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
10467// getComputedStyle returns percent when specified for top/left/bottom/right;
10468// rather than make the css module depend on the offset module, just check for it here
10469jQuery.each( [ "top", "left" ], function( i, prop ) {
10470 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10471 function( elem, computed ) {
10472 if ( computed ) {
10473 computed = curCSS( elem, prop );
10474
10475 // If curCSS returns percentage, fallback to offset
10476 return rnumnonpx.test( computed ) ?
10477 jQuery( elem ).position()[ prop ] + "px" :
10478 computed;
10479 }
10480 }
10481 );
10482} );
10483
10484
10485// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10486jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10487 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
10488 function( defaultExtra, funcName ) {
10489
10490 // Margin is only for outerHeight, outerWidth
10491 jQuery.fn[ funcName ] = function( margin, value ) {
10492 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10493 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10494
10495 return access( this, function( elem, type, value ) {
10496 var doc;
10497
10498 if ( isWindow( elem ) ) {
10499
10500 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
10501 return funcName.indexOf( "outer" ) === 0 ?
10502 elem[ "inner" + name ] :
10503 elem.document.documentElement[ "client" + name ];
10504 }
10505
10506 // Get document width or height
10507 if ( elem.nodeType === 9 ) {
10508 doc = elem.documentElement;
10509
10510 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
10511 // whichever is greatest
10512 return Math.max(
10513 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10514 elem.body[ "offset" + name ], doc[ "offset" + name ],
10515 doc[ "client" + name ]
10516 );
10517 }
10518
10519 return value === undefined ?
10520
10521 // Get width or height on the element, requesting but not forcing parseFloat
10522 jQuery.css( elem, type, extra ) :
10523
10524 // Set width or height on the element
10525 jQuery.style( elem, type, value, extra );
10526 }, type, chainable ? margin : undefined, chainable );
10527 };
10528 } );
10529} );
10530
10531
10532jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
10533 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
10534 "change select submit keydown keypress keyup contextmenu" ).split( " " ),
10535 function( i, name ) {
10536
10537 // Handle event binding
10538 jQuery.fn[ name ] = function( data, fn ) {
10539 return arguments.length > 0 ?
10540 this.on( name, null, data, fn ) :
10541 this.trigger( name );
10542 };
10543} );
10544
10545jQuery.fn.extend( {
10546 hover: function( fnOver, fnOut ) {
10547 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
10548 }
10549} );
10550
10551
10552
10553
10554jQuery.fn.extend( {
10555
10556 bind: function( types, data, fn ) {
10557 return this.on( types, null, data, fn );
10558 },
10559 unbind: function( types, fn ) {
10560 return this.off( types, null, fn );
10561 },
10562
10563 delegate: function( selector, types, data, fn ) {
10564 return this.on( types, selector, data, fn );
10565 },
10566 undelegate: function( selector, types, fn ) {
10567
10568 // ( namespace ) or ( selector, types [, fn] )
10569 return arguments.length === 1 ?
10570 this.off( selector, "**" ) :
10571 this.off( types, selector || "**", fn );
10572 }
10573} );
10574
10575// Bind a function to a context, optionally partially applying any
10576// arguments.
10577// jQuery.proxy is deprecated to promote standards (specifically Function#bind)
10578// However, it is not slated for removal any time soon
10579jQuery.proxy = function( fn, context ) {
10580 var tmp, args, proxy;
10581
10582 if ( typeof context === "string" ) {
10583 tmp = fn[ context ];
10584 context = fn;
10585 fn = tmp;
10586 }
10587
10588 // Quick check to determine if target is callable, in the spec
10589 // this throws a TypeError, but we will just return undefined.
10590 if ( !isFunction( fn ) ) {
10591 return undefined;
10592 }
10593
10594 // Simulated bind
10595 args = slice.call( arguments, 2 );
10596 proxy = function() {
10597 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
10598 };
10599
10600 // Set the guid of unique handler to the same of original handler, so it can be removed
10601 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
10602
10603 return proxy;
10604};
10605
10606jQuery.holdReady = function( hold ) {
10607 if ( hold ) {
10608 jQuery.readyWait++;
10609 } else {
10610 jQuery.ready( true );
10611 }
10612};
10613jQuery.isArray = Array.isArray;
10614jQuery.parseJSON = JSON.parse;
10615jQuery.nodeName = nodeName;
10616jQuery.isFunction = isFunction;
10617jQuery.isWindow = isWindow;
10618jQuery.camelCase = camelCase;
10619jQuery.type = toType;
10620
10621jQuery.now = Date.now;
10622
10623jQuery.isNumeric = function( obj ) {
10624
10625 // As of jQuery 3.0, isNumeric is limited to
10626 // strings and numbers (primitives or objects)
10627 // that can be coerced to finite numbers (gh-2662)
10628 var type = jQuery.type( obj );
10629 return ( type === "number" || type === "string" ) &&
10630
10631 // parseFloat NaNs numeric-cast false positives ("")
10632 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
10633 // subtraction forces infinities to NaN
10634 !isNaN( obj - parseFloat( obj ) );
10635};
10636
10637
10638
10639
10640// Register as a named AMD module, since jQuery can be concatenated with other
10641// files that may use define, but not via a proper concatenation script that
10642// understands anonymous AMD modules. A named AMD is safest and most robust
10643// way to register. Lowercase jquery is used because AMD module names are
10644// derived from file names, and jQuery is normally delivered in a lowercase
10645// file name. Do this after creating the global so that if an AMD module wants
10646// to call noConflict to hide this version of jQuery, it will work.
10647
10648// Note that for maximum portability, libraries that are not jQuery should
10649// declare themselves as anonymous modules, and avoid setting a global if an
10650// AMD loader is present. jQuery is a special case. For more information, see
10651// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10652
10653if ( true ) {
10654 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
10655 return jQuery;
10656 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
10657 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
10658}
10659
10660
10661
10662
10663var
10664
10665 // Map over jQuery in case of overwrite
10666 _jQuery = window.jQuery,
10667
10668 // Map over the $ in case of overwrite
10669 _$ = window.$;
10670
10671jQuery.noConflict = function( deep ) {
10672 if ( window.$ === jQuery ) {
10673 window.$ = _$;
10674 }
10675
10676 if ( deep && window.jQuery === jQuery ) {
10677 window.jQuery = _jQuery;
10678 }
10679
10680 return jQuery;
10681};
10682
10683// Expose jQuery and $ identifiers, even in AMD
10684// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10685// and CommonJS for browser emulators (#13566)
10686if ( !noGlobal ) {
10687 window.jQuery = window.$ = jQuery;
10688}
10689
10690
10691
10692
10693return jQuery;
10694} );
10695
10696
10697/***/ }),
10698
10699/***/ "./node_modules/webpack/buildin/global.js":
10700/*!***********************************!*\
10701 !*** (webpack)/buildin/global.js ***!
10702 \***********************************/
10703/*! no static exports found */
10704/***/ (function(module, exports) {
10705
10706var g;
10707
10708// This works in non-strict mode
10709g = (function() {
10710 return this;
10711})();
10712
10713try {
10714 // This works if eval is allowed (see CSP)
10715 g = g || new Function("return this")();
10716} catch (e) {
10717 // This works if the window reference is available
10718 if (typeof window === "object") g = window;
10719}
10720
10721// g can still be undefined, but nothing to do about it...
10722// We return undefined, instead of nothing here, so it's
10723// easier to handle this case. if(!global) { ...}
10724
10725module.exports = g;
10726
10727
10728/***/ }),
10729
10730/***/ "./resources/js/app.js":
10731/*!*****************************!*\
10732 !*** ./resources/js/app.js ***!
10733 \*****************************/
10734/*! no exports provided */
10735/***/ (function(module, __webpack_exports__, __webpack_require__) {
10736
10737"use strict";
10738__webpack_require__.r(__webpack_exports__);
10739/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _localscript_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./localscript/menu */ "./resources/js/localscript/menu.js");
10740/* harmony import */ var _localscript_modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localscript/modal */ "./resources/js/localscript/modal.js");
10741global.$ = global.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
10742
10743
10744/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
10745
10746/***/ }),
10747
10748/***/ "./resources/js/localscript/menu.js":
10749/*!******************************************!*\
10750 !*** ./resources/js/localscript/menu.js ***!
10751 \******************************************/
10752/*! exports provided: menu */
10753/***/ (function(module, __webpack_exports__, __webpack_require__) {
10754
10755"use strict";
10756__webpack_require__.r(__webpack_exports__);
10757/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "menu", function() { return menu; });
10758var menu = $(function () {
10759 // ハンバーガー
10760 $('.c-btn__drawer').on('click', function () {
10761 $('.l-sidebar').fadeToggle('fast', function () {
10762 $('.l-main__body').toggleClass('expand');
10763 });
10764 $(this).toggleClass('is-active');
10765 });
10766 $('.l-nav__inner').hover(function () {
10767 $(this).addClass('is-hover');
10768 $(this).find('.list').fadeIn('fast');
10769 }, function () {
10770 $(this).removeClass('is-hover');
10771 $(this).find('.list').fadeOut('fast');
10772 });
10773 $(function () {
10774 var tabHeights = $('.c-tabs').height();
10775 $(window).on('resize', function () {
10776 function heightCheck() {
10777 if (tabHeights > 50) {
10778 $('.c-tabs').children('span:last-child').hide();
10779 heightCheck();
10780 }
10781 }
10782 });
10783 });
10784 $('.popup__ellipsis').bind('mouseenter', function () {
10785 if ($(this)[0].scrollWidth > $(this).innerWidth()) {
10786 $(this).find('.c-tabs__item:nth-child(3)').on({
10787 'mouseenter': function mouseenter() {
10788 $(this).closest('.popup__parent').find('.popup__body').show();
10789 $(this).closest('.popup__parent').find('.popup__wrap').show();
10790 },
10791 'mouseleave': function mouseleave() {
10792 $('.popup__body').on({
10793 'mouseenter': function mouseenter() {
10794 $(this).closest('.popup__parent').find('.popup__wrap').show();
10795 },
10796 'mouseleave': function mouseleave() {
10797 $(this).closest('.popup__parent').find('.popup__wrap').hide();
10798 }
10799 });
10800 }
10801 });
10802 }
10803 });
10804 var timer = 0;
10805 var $obj;
10806 $('.popup__ellipsis_phase').find('span:nth-child(2)').on({
10807 'mouseenter': function mouseenter() {
10808 $(this).closest('.popup__parent').find('.popup__body').show();
10809 $(this).closest('.popup__parent').find('.popup__wrap').show();
10810 $obj = $(this);
10811 timer = setTimeout(function () {
10812 $obj.closest('.popup__parent').find('.popup__wrap').hide();
10813 }, 2000);
10814 },
10815 'mouseleave': function mouseleave() {}
10816 });
10817 $('.popup__body').on({
10818 'mouseenter': function mouseenter() {
10819 clearTimeout(timer);
10820 $(this).closest('.popup__parent').find('.popup__wrap').show();
10821 },
10822 'mouseleave': function mouseleave() {
10823 $(this).closest('.popup__parent').find('.popup__wrap').hide();
10824 }
10825 });
10826});
10827
10828/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")))
10829
10830/***/ }),
10831
10832/***/ "./resources/js/localscript/modal.js":
10833/*!*******************************************!*\
10834 !*** ./resources/js/localscript/modal.js ***!
10835 \*******************************************/
10836/*! exports provided: modal */
10837/***/ (function(module, __webpack_exports__, __webpack_require__) {
10838
10839"use strict";
10840__webpack_require__.r(__webpack_exports__);
10841/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modal", function() { return modal; });
10842var modal = $(function () {
10843 var _ww = $(window).width();
10844
10845 var rightScroll = function rightScroll() {};
10846
10847 var leftScroll = function leftScroll() {};
10848
10849 var tblData = $('.p-table--date');
10850 var tblDataChildrenLen = $('.p-table--date__head').children().length / 2;
10851
10852 if (_ww > 768) {
10853 tblData.width(84 * tblDataChildrenLen);
10854
10855 if ($('.p-table--date__body__item').length <= 7) {
10856 $('.p-table--date__icon.right').addClass('disable');
10857 $('.p-table--date__icon.left').addClass('disable');
10858 }
10859 } else {
10860 tblData.width(200 * tblDataChildrenLen / 2);
10861 }
10862
10863 $(window).resize(function () {
10864 tblDataChildrenLen = $('.p-table--date__head').children().length / 2;
10865 _ww = $(window).width();
10866
10867 if (_ww > 768) {
10868 tblData.width(84 * tblDataChildrenLen);
10869
10870 if ($('.p-table--date__body__item').length <= 7) {
10871 $('.p-table--date__icon.right').addClass('disable');
10872 $('.p-table--date__icon.left').addClass('disable');
10873 } else {
10874 rightScroll();
10875 leftScroll();
10876 }
10877 } else {
10878 tblData.width(200 * tblDataChildrenLen / 2);
10879 }
10880 });
10881 $('.p-table--date__icon.right').on('click', function () {
10882 if ($(this).hasClass('disable')) {
10883 return false;
10884 }
10885
10886 $('.p-table--date__icon.left').removeClass('disable');
10887 $('.p-table--date__wrap').animate({
10888 scrollLeft: $('.p-table--date__wrap').scrollLeft() + $('.p-table--date__body__item').width()
10889 });
10890 rightScroll = $('.p-table--date__wrap').scroll(function () {
10891 if ($(this).scrollLeft() < $('.p-table--date').width() - $('.p-table--date__wrap').width() - 10) {
10892 $('.p-table--date__icon.right').removeClass('disable');
10893 } else {
10894 $('.p-table--date__icon.right').addClass('disable');
10895 }
10896 });
10897 });
10898 $('.p-table--date__icon.left').on('click', function () {
10899 if ($(this).hasClass('disable')) {
10900 return false;
10901 }
10902
10903 $('.p-table--date__wrap').animate({
10904 scrollLeft: $('.p-table--date__wrap').scrollLeft() - $('.p-table--date__body__item').width()
10905 });
10906 leftScroll = $('.p-table--date__wrap').scroll(function () {
10907 if ($(this).scrollLeft() !== 0) {
10908 $('.p-table--date__icon.left').removeClass('disable');
10909 } else {
10910 $('.p-table--date__icon.left').addClass('disable');
10911 }
10912 });
10913 }); // モーダル表示
10914 // ------------------------------------
10915 // ログイン
10916
10917 $('[data=modal]').on('click', function () {
10918 // login
10919 var lid = $('input:text[name=loginId]').val();
10920 var lpass = $('input:text[name=loginId]').val();
10921
10922 if ($(this).val() == 'ログイン') {
10923 // login validate
10924 if (lid == '' || lpass == '') {
10925 $('.err').show();
10926 $('.prompt').hide();
10927 $('.p-modal__header__title').text('ログインエラー');
10928 $('.mbody__title').text('ログインできません。');
10929 $('.p-modal').fadeIn();
10930 return false;
10931 } else if (lid !== '' || lpass !== '') {
10932 $('.prompt').show();
10933 $('.err').hide();
10934 $('.p-modal__header__title').text('利用規約');
10935 $('.mbody__title').text('システムをご利用いただくには以下の利用規約への同意が必要です。');
10936 $('.p-modal').fadeIn();
10937 return false;
10938 }
10939 } else {
10940 $('.p-modal').fadeIn();
10941 return false;
10942 }
10943 }); // システム管理者追加
10944
10945 $('.c-btn--system').on('click', function () {
10946 $(".p-modal").fadeOut();
10947 $(".p-modal.system").fadeIn();
10948 return false;
10949 }); // ユーザー追加
10950
10951 $('.c-btn--user').on('click', function () {
10952 $(".p-modal").fadeOut();
10953 $(".p-modal.user").fadeIn();
10954 return false;
10955 }); // ユーザー編集
10956
10957 $('.c-btn--edit').on('click', function () {
10958 $(".p-modal").fadeOut();
10959 $(".p-modal.edit").fadeIn();
10960 return false;
10961 }); // アカウント編集
10962
10963 $('.c-btn--account').on('click', function () {
10964 $(".p-modal").fadeOut();
10965 $(".p-modal.account").fadeIn();
10966 return false;
10967 }); // 詳細
10968 // - 案件
10969
10970 $('.c-btn--detail.project').on('click', function () {
10971 $(".p-modal").fadeOut();
10972 $(".p-modal.detail.project").fadeIn();
10973 return false;
10974 }); // - リソース
10975
10976 $('.c-btn--detail.resource').on('click', function () {
10977 $(".p-modal").fadeOut();
10978 $(".p-modal.detail.resource").fadeIn();
10979 return false;
10980 }); // - 企業
10981
10982 $('.c-btn--detail.company').on('click', function () {
10983 $(".p-modal").fadeOut();
10984 $(".p-modal.detail.company").fadeIn();
10985 return false;
10986 }); // - メンテナンス
10987
10988 $('.c-btn--detail.mainte').on('click', function () {
10989 $(".p-modal").fadeOut();
10990 $(".p-modal.edit.mainte").fadeIn();
10991 return false;
10992 }); // - キーワード
10993
10994 $('.c-btn--detail.keyword').on('click', function () {
10995 $(".p-modal").fadeOut();
10996 $(".p-modal.edit.keyword").fadeIn();
10997 return false;
10998 }); // 追加
10999 // - 案件
11000
11001 $('.c-btn--add.project').on('click', function () {
11002 $(".p-modal").fadeOut();
11003 $(".p-modal.add.project").fadeIn();
11004 return false;
11005 }); // - リソース
11006
11007 $('.c-btn--add.resource').on('click', function () {
11008 $(".p-modal").fadeOut();
11009 $(".p-modal.add.resource").fadeIn();
11010 return false;
11011 }); // - メンテナンス
11012
11013 $('.c-btn--add.mainte').on('click', function () {
11014 $(".p-modal").fadeOut();
11015 $(".p-modal.add.mainte").fadeIn();
11016 return false;
11017 }); // - 企業
11018
11019 $('.c-btn--add.company').on('click', function () {
11020 $(".p-modal").fadeOut();
11021 $(".p-modal.add.company").fadeIn();
11022 return false;
11023 }); // モーダル 閉じる
11024
11025 $('.p-modal__close').on('click', function () {
11026 if ($(this).hasClass('window__close')) {
11027 window.close();
11028 } else {
11029 $('.p-modal').fadeOut();
11030 }
11031 });
11032 $('.add-more').on('keydown', function (e) {
11033 if (e.keyCode === 13) {
11034 var val = $(this).val();
11035
11036 if ($(this).hasClass('has-skill')) {
11037 $(this).closest('.extend').find('.c-tabs').append("<li class=\"c-tabs__item skill\">".concat(val, "</li>"));
11038 } else {
11039 $(this).closest('.extend').find('.c-tabs').append("<li class=\"c-tabs__item\">".concat(val, "</li>"));
11040 }
11041
11042 $(this).val('');
11043 }
11044 });
11045 $(document).on('click', '.c-tabs__item.add', function () {
11046 $(this).remove();
11047 });
11048 $('.add-more').on('keydown', function (e) {
11049 if (e.keyCode === 13) {
11050 var val = $(this).val();
11051
11052 if ($(this).hasClass('has-skill')) {
11053 $(this).closest('.extend').find('.c-tabs').append("<li class=\"c-tabs__item skill\">".concat(val, "</li>"));
11054 } else {
11055 $(this).closest('.extend').find('.c-tabs').append("<li class=\"c-tabs__item\">".concat(val, "</li>"));
11056 }
11057
11058 $(this).val('');
11059 }
11060 });
11061 $(document).on('click', '.c-tabs__item.add', function () {
11062 $(this).remove();
11063 });
11064 $('[data-btn=pass]').on('click', function () {
11065 if ($(this).prop('checked')) {
11066 if (_ww > 768) {
11067 $(this).next('label').text('非表示');
11068 }
11069
11070 $(this).prev('input').attr('type', 'text');
11071 } else {
11072 if (_ww > 768) {
11073 $(this).next('label').text('表示する');
11074 }
11075
11076 $(this).prev('input').attr('type', 'password');
11077 }
11078 });
11079
11080 if ($('.c-radio').hasClass('fadeIn')) {
11081 $(this).parent('.c-radio__menu--hidden').fadeIn();
11082 }
11083
11084 $('.c-radio.tab').on('click', function () {
11085 if ($(this).hasClass('fadeIn')) {
11086 $('.c-radio__menu--hidden').fadeIn();
11087 } else {
11088 $('.c-radio__menu--hidden').fadeOut();
11089 }
11090 });
11091
11092 if ($('[data-radio=disable]').prop('checked')) {
11093 $('.p-options.radio').hide();
11094 }
11095
11096 $('[data-radio]').on('click', function () {
11097 var $_rs = $(this).attr('data-radio');
11098
11099 if ($_rs === 'disable') {
11100 $('.p-options.radio').fadeOut();
11101 $('.p-options.u-flex__btw').css('margin-right', 0);
11102 } else {
11103 $('.p-options.radio').fadeIn();
11104 }
11105 });
11106 var count = 0;
11107 $('.add--form').on('click', function (event) {
11108 var clone = $(this).closest('tbody.add-target').find('.clone').clone(true);
11109 clone.removeClass('hidden');
11110 var btn = $('.p-table__wrap.btn').clone(true);
11111 $('.p-table__wrap.btn').remove();
11112 $('tbody.add-target').append(clone[0]);
11113 $('tbody.add-target').append(btn[0]);
11114 clone.find('.tagify').each(function (idx, obj) {
11115 $(obj).tagify();
11116 });
11117
11118 if (count === 0) {
11119 count++;
11120 $('.delete--form').last().trigger('click', ['fire']);
11121 $('.add--form').click();
11122 }
11123
11124 return false;
11125 });
11126 $('.delete--form').on('click', function (e, p) {
11127 if ($('.p-table__wrap.form').length > 2) {
11128 $(this).closest('.p-table__wrap.form').fadeOut().remove();
11129 return false;
11130 } else {
11131 alert('1つ以上追加してください');
11132 return false;
11133 }
11134 });
11135 $('form').submit(function (event) {
11136 return false;
11137 });
11138});
11139
11140/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")))
11141
11142/***/ }),
11143
11144/***/ "./resources/sass/pages/mypage.scss":
11145/*!******************************************!*\
11146 !*** ./resources/sass/pages/mypage.scss ***!
11147 \******************************************/
11148/*! no static exports found */
11149/***/ (function(module, exports) {
11150
11151// removed by extract-text-webpack-plugin
11152
11153/***/ }),
11154
11155/***/ "./resources/sass/style.scss":
11156/*!***********************************!*\
11157 !*** ./resources/sass/style.scss ***!
11158 \***********************************/
11159/*! no static exports found */
11160/***/ (function(module, exports) {
11161
11162// removed by extract-text-webpack-plugin
11163
11164/***/ }),
11165
11166/***/ 0:
11167/*!**************************************************************************************************!*\
11168 !*** multi ./resources/js/app.js ./resources/sass/style.scss ./resources/sass/pages/mypage.scss ***!
11169 \**************************************************************************************************/
11170/*! no static exports found */
11171/***/ (function(module, exports, __webpack_require__) {
11172
11173__webpack_require__(/*! /Applications/MAMP/htdocs/sips/resources/js/app.js */"./resources/js/app.js");
11174__webpack_require__(/*! /Applications/MAMP/htdocs/sips/resources/sass/style.scss */"./resources/sass/style.scss");
11175module.exports = __webpack_require__(/*! /Applications/MAMP/htdocs/sips/resources/sass/pages/mypage.scss */"./resources/sass/pages/mypage.scss");
11176
11177
11178/***/ })
11179
11180/******/ });