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