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