518 } |
557 } |
519 |
558 |
520 return type === "array" || length === 0 || |
559 return type === "array" || length === 0 || |
521 typeof length === "number" && length > 0 && ( length - 1 ) in obj; |
560 typeof length === "number" && length > 0 && ( length - 1 ) in obj; |
522 } |
561 } |
523 var Sizzle = |
562 |
524 /*! |
563 |
525 * Sizzle CSS Selector Engine v2.3.9 |
564 function nodeName( elem, name ) { |
526 * https://sizzlejs.com/ |
565 |
527 * |
566 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); |
528 * Copyright JS Foundation and other contributors |
567 |
529 * Released under the MIT license |
568 } |
530 * https://js.foundation/ |
569 var pop = arr.pop; |
531 * |
570 |
532 * Date: 2022-12-19 |
571 |
533 */ |
572 var sort = arr.sort; |
534 ( function( window ) { |
573 |
|
574 |
|
575 var splice = arr.splice; |
|
576 |
|
577 |
|
578 var whitespace = "[\\x20\\t\\r\\n\\f]"; |
|
579 |
|
580 |
|
581 var rtrimCSS = new RegExp( |
|
582 "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", |
|
583 "g" |
|
584 ); |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 // Note: an element does not contain itself |
|
590 jQuery.contains = function( a, b ) { |
|
591 var bup = b && b.parentNode; |
|
592 |
|
593 return a === bup || !!( bup && bup.nodeType === 1 && ( |
|
594 |
|
595 // Support: IE 9 - 11+ |
|
596 // IE doesn't have `contains` on SVG. |
|
597 a.contains ? |
|
598 a.contains( bup ) : |
|
599 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 |
|
600 ) ); |
|
601 }; |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 // CSS string/identifier serialization |
|
607 // https://drafts.csswg.org/cssom/#common-serializing-idioms |
|
608 var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; |
|
609 |
|
610 function fcssescape( ch, asCodePoint ) { |
|
611 if ( asCodePoint ) { |
|
612 |
|
613 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER |
|
614 if ( ch === "\0" ) { |
|
615 return "\uFFFD"; |
|
616 } |
|
617 |
|
618 // Control characters and (dependent upon position) numbers get escaped as code points |
|
619 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; |
|
620 } |
|
621 |
|
622 // Other potentially-special ASCII characters get backslash-escaped |
|
623 return "\\" + ch; |
|
624 } |
|
625 |
|
626 jQuery.escapeSelector = function( sel ) { |
|
627 return ( sel + "" ).replace( rcssescape, fcssescape ); |
|
628 }; |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 var preferredDoc = document, |
|
634 pushNative = push; |
|
635 |
|
636 ( function() { |
|
637 |
535 var i, |
638 var i, |
536 support, |
|
537 Expr, |
639 Expr, |
538 getText, |
|
539 isXML, |
|
540 tokenize, |
|
541 compile, |
|
542 select, |
|
543 outermostContext, |
640 outermostContext, |
544 sortInput, |
641 sortInput, |
545 hasDuplicate, |
642 hasDuplicate, |
|
643 push = pushNative, |
546 |
644 |
547 // Local document vars |
645 // Local document vars |
548 setDocument, |
|
549 document, |
646 document, |
550 docElem, |
647 documentElement, |
551 documentIsHTML, |
648 documentIsHTML, |
552 rbuggyQSA, |
649 rbuggyQSA, |
553 rbuggyMatches, |
|
554 matches, |
650 matches, |
555 contains, |
|
556 |
651 |
557 // Instance-specific data |
652 // Instance-specific data |
558 expando = "sizzle" + 1 * new Date(), |
653 expando = jQuery.expando, |
559 preferredDoc = window.document, |
|
560 dirruns = 0, |
654 dirruns = 0, |
561 done = 0, |
655 done = 0, |
562 classCache = createCache(), |
656 classCache = createCache(), |
563 tokenCache = createCache(), |
657 tokenCache = createCache(), |
564 compilerCache = createCache(), |
658 compilerCache = createCache(), |
627 ".*" + |
696 ".*" + |
628 ")\\)|)", |
697 ")\\)|)", |
629 |
698 |
630 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter |
699 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter |
631 rwhitespace = new RegExp( whitespace + "+", "g" ), |
700 rwhitespace = new RegExp( whitespace + "+", "g" ), |
632 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + |
|
633 whitespace + "+$", "g" ), |
|
634 |
701 |
635 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), |
702 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), |
636 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + |
703 rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + |
637 "*" ), |
704 whitespace + "*" ), |
638 rdescend = new RegExp( whitespace + "|>" ), |
705 rdescend = new RegExp( whitespace + "|>" ), |
639 |
706 |
640 rpseudo = new RegExp( pseudos ), |
707 rpseudo = new RegExp( pseudos ), |
641 ridentifier = new RegExp( "^" + identifier + "$" ), |
708 ridentifier = new RegExp( "^" + identifier + "$" ), |
642 |
709 |
643 matchExpr = { |
710 matchExpr = { |
644 "ID": new RegExp( "^#(" + identifier + ")" ), |
711 ID: new RegExp( "^#(" + identifier + ")" ), |
645 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), |
712 CLASS: new RegExp( "^\\.(" + identifier + ")" ), |
646 "TAG": new RegExp( "^(" + identifier + "|[*])" ), |
713 TAG: new RegExp( "^(" + identifier + "|[*])" ), |
647 "ATTR": new RegExp( "^" + attributes ), |
714 ATTR: new RegExp( "^" + attributes ), |
648 "PSEUDO": new RegExp( "^" + pseudos ), |
715 PSEUDO: new RegExp( "^" + pseudos ), |
649 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + |
716 CHILD: new RegExp( |
650 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + |
717 "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + |
651 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), |
718 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + |
652 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), |
719 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), |
|
720 bool: new RegExp( "^(?:" + booleans + ")$", "i" ), |
653 |
721 |
654 // For use in libraries implementing .is() |
722 // For use in libraries implementing .is() |
655 // We use this for POS matching in `select` |
723 // We use this for POS matching in `select` |
656 "needsContext": new RegExp( "^" + whitespace + |
724 needsContext: new RegExp( "^" + whitespace + |
657 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + |
725 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + |
658 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) |
726 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) |
659 }, |
727 }, |
660 |
728 |
661 rhtml = /HTML$/i, |
|
662 rinputs = /^(?:input|select|textarea|button)$/i, |
729 rinputs = /^(?:input|select|textarea|button)$/i, |
663 rheader = /^h\d$/i, |
730 rheader = /^h\d$/i, |
664 |
731 |
665 rnative = /^[^{]+\{\s*\[native \w/, |
|
666 |
|
667 // Easily-parseable/retrievable ID or TAG or CLASS selectors |
732 // Easily-parseable/retrievable ID or TAG or CLASS selectors |
668 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, |
733 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, |
669 |
734 |
670 rsibling = /[+~]/, |
735 rsibling = /[+~]/, |
671 |
736 |
672 // CSS escapes |
737 // CSS escapes |
673 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters |
738 // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters |
674 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), |
739 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + |
|
740 "?|\\\\([^\\r\\n\\f])", "g" ), |
675 funescape = function( escape, nonHex ) { |
741 funescape = function( escape, nonHex ) { |
676 var high = "0x" + escape.slice( 1 ) - 0x10000; |
742 var high = "0x" + escape.slice( 1 ) - 0x10000; |
677 |
743 |
678 return nonHex ? |
744 if ( nonHex ) { |
679 |
745 |
680 // Strip the backslash prefix from a non-hex escape sequence |
746 // Strip the backslash prefix from a non-hex escape sequence |
681 nonHex : |
747 return nonHex; |
682 |
748 } |
683 // Replace a hexadecimal escape sequence with the encoded Unicode code point |
749 |
684 // Support: IE <=11+ |
750 // Replace a hexadecimal escape sequence with the encoded Unicode code point |
685 // For values outside the Basic Multilingual Plane (BMP), manually construct a |
751 // Support: IE <=11+ |
686 // surrogate pair |
752 // For values outside the Basic Multilingual Plane (BMP), manually construct a |
687 high < 0 ? |
753 // surrogate pair |
688 String.fromCharCode( high + 0x10000 ) : |
754 return high < 0 ? |
689 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); |
755 String.fromCharCode( high + 0x10000 ) : |
690 }, |
756 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); |
691 |
757 }, |
692 // CSS string/identifier serialization |
758 |
693 // https://drafts.csswg.org/cssom/#common-serializing-idioms |
759 // Used for iframes; see `setDocument`. |
694 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, |
760 // Support: IE 9 - 11+, Edge 12 - 18+ |
695 fcssescape = function( ch, asCodePoint ) { |
|
696 if ( asCodePoint ) { |
|
697 |
|
698 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER |
|
699 if ( ch === "\0" ) { |
|
700 return "\uFFFD"; |
|
701 } |
|
702 |
|
703 // Control characters and (dependent upon position) numbers get escaped as code points |
|
704 return ch.slice( 0, -1 ) + "\\" + |
|
705 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; |
|
706 } |
|
707 |
|
708 // Other potentially-special ASCII characters get backslash-escaped |
|
709 return "\\" + ch; |
|
710 }, |
|
711 |
|
712 // Used for iframes |
|
713 // See setDocument() |
|
714 // Removing the function wrapper causes a "Permission Denied" |
761 // Removing the function wrapper causes a "Permission Denied" |
715 // error in IE |
762 // error in IE/Edge. |
716 unloadHandler = function() { |
763 unloadHandler = function() { |
717 setDocument(); |
764 setDocument(); |
718 }, |
765 }, |
719 |
766 |
720 inDisabledFieldset = addCombinator( |
767 inDisabledFieldset = addCombinator( |
721 function( elem ) { |
768 function( elem ) { |
722 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; |
769 return elem.disabled === true && nodeName( elem, "fieldset" ); |
723 }, |
770 }, |
724 { dir: "parentNode", next: "legend" } |
771 { dir: "parentNode", next: "legend" } |
725 ); |
772 ); |
|
773 |
|
774 // Support: IE <=9 only |
|
775 // Accessing document.activeElement can throw unexpectedly |
|
776 // https://bugs.jquery.com/ticket/13393 |
|
777 function safeActiveElement() { |
|
778 try { |
|
779 return document.activeElement; |
|
780 } catch ( err ) { } |
|
781 } |
726 |
782 |
727 // Optimize for push.apply( _, NodeList ) |
783 // Optimize for push.apply( _, NodeList ) |
728 try { |
784 try { |
729 push.apply( |
785 push.apply( |
730 ( arr = slice.call( preferredDoc.childNodes ) ), |
786 ( arr = slice.call( preferredDoc.childNodes ) ), |
731 preferredDoc.childNodes |
787 preferredDoc.childNodes |
732 ); |
788 ); |
733 |
789 |
734 // Support: Android<4.0 |
790 // Support: Android <=4.0 |
735 // Detect silently failing push.apply |
791 // Detect silently failing push.apply |
736 // eslint-disable-next-line no-unused-expressions |
792 // eslint-disable-next-line no-unused-expressions |
737 arr[ preferredDoc.childNodes.length ].nodeType; |
793 arr[ preferredDoc.childNodes.length ].nodeType; |
738 } catch ( e ) { |
794 } catch ( e ) { |
739 push = { apply: arr.length ? |
795 push = { |
740 |
796 apply: function( target, els ) { |
741 // Leverage slice if possible |
|
742 function( target, els ) { |
|
743 pushNative.apply( target, slice.call( els ) ); |
797 pushNative.apply( target, slice.call( els ) ); |
744 } : |
798 }, |
745 |
799 call: function( target ) { |
746 // Support: IE<9 |
800 pushNative.apply( target, slice.call( arguments, 1 ) ); |
747 // Otherwise append directly |
|
748 function( target, els ) { |
|
749 var j = target.length, |
|
750 i = 0; |
|
751 |
|
752 // Can't trust NodeList.length |
|
753 while ( ( target[ j++ ] = els[ i++ ] ) ) {} |
|
754 target.length = j - 1; |
|
755 } |
801 } |
756 }; |
802 }; |
757 } |
803 } |
758 |
804 |
759 function Sizzle( selector, context, results, seed ) { |
805 function find( selector, context, results, seed ) { |
760 var m, i, elem, nid, match, groups, newSelector, |
806 var m, i, elem, nid, match, groups, newSelector, |
761 newContext = context && context.ownerDocument, |
807 newContext = context && context.ownerDocument, |
762 |
808 |
763 // nodeType defaults to 9, since context defaults to document |
809 // nodeType defaults to 9, since context defaults to document |
764 nodeType = context ? context.nodeType : 9; |
810 nodeType = context ? context.nodeType : 9; |
788 |
834 |
789 // Document context |
835 // Document context |
790 if ( nodeType === 9 ) { |
836 if ( nodeType === 9 ) { |
791 if ( ( elem = context.getElementById( m ) ) ) { |
837 if ( ( elem = context.getElementById( m ) ) ) { |
792 |
838 |
793 // Support: IE, Opera, Webkit |
839 // Support: IE 9 only |
794 // TODO: identify versions |
|
795 // getElementById can match elements by name instead of ID |
840 // getElementById can match elements by name instead of ID |
796 if ( elem.id === m ) { |
841 if ( elem.id === m ) { |
797 results.push( elem ); |
842 push.call( results, elem ); |
798 return results; |
843 return results; |
799 } |
844 } |
800 } else { |
845 } else { |
801 return results; |
846 return results; |
802 } |
847 } |
803 |
848 |
804 // Element context |
849 // Element context |
805 } else { |
850 } else { |
806 |
851 |
807 // Support: IE, Opera, Webkit |
852 // Support: IE 9 only |
808 // TODO: identify versions |
|
809 // getElementById can match elements by name instead of ID |
853 // getElementById can match elements by name instead of ID |
810 if ( newContext && ( elem = newContext.getElementById( m ) ) && |
854 if ( newContext && ( elem = newContext.getElementById( m ) ) && |
811 contains( context, elem ) && |
855 find.contains( context, elem ) && |
812 elem.id === m ) { |
856 elem.id === m ) { |
813 |
857 |
814 results.push( elem ); |
858 push.call( results, elem ); |
815 return results; |
859 return results; |
816 } |
860 } |
817 } |
861 } |
818 |
862 |
819 // Type selector |
863 // Type selector |
820 } else if ( match[ 2 ] ) { |
864 } else if ( match[ 2 ] ) { |
821 push.apply( results, context.getElementsByTagName( selector ) ); |
865 push.apply( results, context.getElementsByTagName( selector ) ); |
822 return results; |
866 return results; |
823 |
867 |
824 // Class selector |
868 // Class selector |
825 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && |
869 } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { |
826 context.getElementsByClassName ) { |
|
827 |
|
828 push.apply( results, context.getElementsByClassName( m ) ); |
870 push.apply( results, context.getElementsByClassName( m ) ); |
829 return results; |
871 return results; |
830 } |
872 } |
831 } |
873 } |
832 |
874 |
833 // Take advantage of querySelectorAll |
875 // Take advantage of querySelectorAll |
834 if ( support.qsa && |
876 if ( !nonnativeSelectorCache[ selector + " " ] && |
835 !nonnativeSelectorCache[ selector + " " ] && |
877 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { |
836 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && |
|
837 |
|
838 // Support: IE 8 only |
|
839 // Exclude object elements |
|
840 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { |
|
841 |
878 |
842 newSelector = selector; |
879 newSelector = selector; |
843 newContext = context; |
880 newContext = context; |
844 |
881 |
845 // qSA considers elements outside a scoping root when evaluating child or |
882 // qSA considers elements outside a scoping root when evaluating child or |
1160 return document; |
1119 return document; |
1161 } |
1120 } |
1162 |
1121 |
1163 // Update global variables |
1122 // Update global variables |
1164 document = doc; |
1123 document = doc; |
1165 docElem = document.documentElement; |
1124 documentElement = document.documentElement; |
1166 documentIsHTML = !isXML( document ); |
1125 documentIsHTML = !jQuery.isXMLDoc( document ); |
|
1126 |
|
1127 // Support: iOS 7 only, IE 9 - 11+ |
|
1128 // Older browsers didn't support unprefixed `matches`. |
|
1129 matches = documentElement.matches || |
|
1130 documentElement.webkitMatchesSelector || |
|
1131 documentElement.msMatchesSelector; |
1167 |
1132 |
1168 // Support: IE 9 - 11+, Edge 12 - 18+ |
1133 // Support: IE 9 - 11+, Edge 12 - 18+ |
1169 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) |
1134 // Accessing iframe documents after unload throws "permission denied" errors |
1170 // Support: IE 11+, Edge 17 - 18+ |
1135 // (see trac-13936). |
1171 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1136 // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, |
1172 // two documents; shallow comparisons work. |
1137 // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. |
1173 // eslint-disable-next-line eqeqeq |
1138 if ( documentElement.msMatchesSelector && |
1174 if ( preferredDoc != document && |
1139 |
|
1140 // Support: IE 11+, Edge 17 - 18+ |
|
1141 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
|
1142 // two documents; shallow comparisons work. |
|
1143 // eslint-disable-next-line eqeqeq |
|
1144 preferredDoc != document && |
1175 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { |
1145 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { |
1176 |
1146 |
1177 // Support: IE 11, Edge |
1147 // Support: IE 9 - 11+, Edge 12 - 18+ |
1178 if ( subWindow.addEventListener ) { |
1148 subWindow.addEventListener( "unload", unloadHandler ); |
1179 subWindow.addEventListener( "unload", unloadHandler, false ); |
1149 } |
1180 |
1150 |
1181 // Support: IE 9 - 10 only |
1151 // Support: IE <10 |
1182 } else if ( subWindow.attachEvent ) { |
|
1183 subWindow.attachEvent( "onunload", unloadHandler ); |
|
1184 } |
|
1185 } |
|
1186 |
|
1187 // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, |
|
1188 // Safari 4 - 5 only, Opera <=11.6 - 12.x only |
|
1189 // IE/Edge & older browsers don't support the :scope pseudo-class. |
|
1190 // Support: Safari 6.0 only |
|
1191 // Safari 6.0 supports :scope but it's an alias of :root there. |
|
1192 support.scope = assert( function( el ) { |
|
1193 docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); |
|
1194 return typeof el.querySelectorAll !== "undefined" && |
|
1195 !el.querySelectorAll( ":scope fieldset div" ).length; |
|
1196 } ); |
|
1197 |
|
1198 // Support: Chrome 105+, Firefox 104+, Safari 15.4+ |
|
1199 // Make sure forgiving mode is not used in `CSS.supports( "selector(...)" )`. |
|
1200 // |
|
1201 // `:is()` uses a forgiving selector list as an argument and is widely |
|
1202 // implemented, so it's a good one to test against. |
|
1203 support.cssSupportsSelector = assert( function() { |
|
1204 /* eslint-disable no-undef */ |
|
1205 |
|
1206 return CSS.supports( "selector(*)" ) && |
|
1207 |
|
1208 // Support: Firefox 78-81 only |
|
1209 // In old Firefox, `:is()` didn't use forgiving parsing. In that case, |
|
1210 // fail this test as there's no selector to test against that. |
|
1211 // `CSS.supports` uses unforgiving parsing |
|
1212 document.querySelectorAll( ":is(:jqfake)" ) && |
|
1213 |
|
1214 // `*` is needed as Safari & newer Chrome implemented something in between |
|
1215 // for `:has()` - it throws in `qSA` if it only contains an unsupported |
|
1216 // argument but multiple ones, one of which is supported, are fine. |
|
1217 // We want to play safe in case `:is()` gets the same treatment. |
|
1218 !CSS.supports( "selector(:is(*,:jqfake))" ); |
|
1219 |
|
1220 /* eslint-enable */ |
|
1221 } ); |
|
1222 |
|
1223 /* Attributes |
|
1224 ---------------------------------------------------------------------- */ |
|
1225 |
|
1226 // Support: IE<8 |
|
1227 // Verify that getAttribute really returns attributes and not properties |
|
1228 // (excepting IE8 booleans) |
|
1229 support.attributes = assert( function( el ) { |
|
1230 el.className = "i"; |
|
1231 return !el.getAttribute( "className" ); |
|
1232 } ); |
|
1233 |
|
1234 /* getElement(s)By* |
|
1235 ---------------------------------------------------------------------- */ |
|
1236 |
|
1237 // Check if getElementsByTagName("*") returns only elements |
|
1238 support.getElementsByTagName = assert( function( el ) { |
|
1239 el.appendChild( document.createComment( "" ) ); |
|
1240 return !el.getElementsByTagName( "*" ).length; |
|
1241 } ); |
|
1242 |
|
1243 // Support: IE<9 |
|
1244 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); |
|
1245 |
|
1246 // Support: IE<10 |
|
1247 // Check if getElementById returns elements by name |
1152 // Check if getElementById returns elements by name |
1248 // The broken getElementById methods don't pick up programmatically-set names, |
1153 // The broken getElementById methods don't pick up programmatically-set names, |
1249 // so use a roundabout getElementsByName test |
1154 // so use a roundabout getElementsByName test |
1250 support.getById = assert( function( el ) { |
1155 support.getById = assert( function( el ) { |
1251 docElem.appendChild( el ).id = expando; |
1156 documentElement.appendChild( el ).id = jQuery.expando; |
1252 return !document.getElementsByName || !document.getElementsByName( expando ).length; |
1157 return !document.getElementsByName || |
|
1158 !document.getElementsByName( jQuery.expando ).length; |
|
1159 } ); |
|
1160 |
|
1161 // Support: IE 9 only |
|
1162 // Check to see if it's possible to do matchesSelector |
|
1163 // on a disconnected node. |
|
1164 support.disconnectedMatch = assert( function( el ) { |
|
1165 return matches.call( el, "*" ); |
|
1166 } ); |
|
1167 |
|
1168 // Support: IE 9 - 11+, Edge 12 - 18+ |
|
1169 // IE/Edge don't support the :scope pseudo-class. |
|
1170 support.scope = assert( function() { |
|
1171 return document.querySelectorAll( ":scope" ); |
|
1172 } ); |
|
1173 |
|
1174 // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only |
|
1175 // Make sure the `:has()` argument is parsed unforgivingly. |
|
1176 // We include `*` in the test to detect buggy implementations that are |
|
1177 // _selectively_ forgiving (specifically when the list includes at least |
|
1178 // one valid selector). |
|
1179 // Note that we treat complete lack of support for `:has()` as if it were |
|
1180 // spec-compliant support, which is fine because use of `:has()` in such |
|
1181 // environments will fail in the qSA path and fall back to jQuery traversal |
|
1182 // anyway. |
|
1183 support.cssHas = assert( function() { |
|
1184 try { |
|
1185 document.querySelector( ":has(*,:jqfake)" ); |
|
1186 return false; |
|
1187 } catch ( e ) { |
|
1188 return true; |
|
1189 } |
1253 } ); |
1190 } ); |
1254 |
1191 |
1255 // ID filter and find |
1192 // ID filter and find |
1256 if ( support.getById ) { |
1193 if ( support.getById ) { |
1257 Expr.filter[ "ID" ] = function( id ) { |
1194 Expr.filter.ID = function( id ) { |
1258 var attrId = id.replace( runescape, funescape ); |
1195 var attrId = id.replace( runescape, funescape ); |
1259 return function( elem ) { |
1196 return function( elem ) { |
1260 return elem.getAttribute( "id" ) === attrId; |
1197 return elem.getAttribute( "id" ) === attrId; |
1261 }; |
1198 }; |
1262 }; |
1199 }; |
1263 Expr.find[ "ID" ] = function( id, context ) { |
1200 Expr.find.ID = function( id, context ) { |
1264 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { |
1201 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { |
1265 var elem = context.getElementById( id ); |
1202 var elem = context.getElementById( id ); |
1266 return elem ? [ elem ] : []; |
1203 return elem ? [ elem ] : []; |
1267 } |
1204 } |
1268 }; |
1205 }; |
1269 } else { |
1206 } else { |
1270 Expr.filter[ "ID" ] = function( id ) { |
1207 Expr.filter.ID = function( id ) { |
1271 var attrId = id.replace( runescape, funescape ); |
1208 var attrId = id.replace( runescape, funescape ); |
1272 return function( elem ) { |
1209 return function( elem ) { |
1273 var node = typeof elem.getAttributeNode !== "undefined" && |
1210 var node = typeof elem.getAttributeNode !== "undefined" && |
1274 elem.getAttributeNode( "id" ); |
1211 elem.getAttributeNode( "id" ); |
1275 return node && node.value === attrId; |
1212 return node && node.value === attrId; |
1276 }; |
1213 }; |
1277 }; |
1214 }; |
1278 |
1215 |
1279 // Support: IE 6 - 7 only |
1216 // Support: IE 6 - 7 only |
1280 // getElementById is not reliable as a find shortcut |
1217 // getElementById is not reliable as a find shortcut |
1281 Expr.find[ "ID" ] = function( id, context ) { |
1218 Expr.find.ID = function( id, context ) { |
1282 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { |
1219 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { |
1283 var node, i, elems, |
1220 var node, i, elems, |
1284 elem = context.getElementById( id ); |
1221 elem = context.getElementById( id ); |
1285 |
1222 |
1286 if ( elem ) { |
1223 if ( elem ) { |
1306 } |
1243 } |
1307 }; |
1244 }; |
1308 } |
1245 } |
1309 |
1246 |
1310 // Tag |
1247 // Tag |
1311 Expr.find[ "TAG" ] = support.getElementsByTagName ? |
1248 Expr.find.TAG = function( tag, context ) { |
1312 function( tag, context ) { |
1249 if ( typeof context.getElementsByTagName !== "undefined" ) { |
1313 if ( typeof context.getElementsByTagName !== "undefined" ) { |
1250 return context.getElementsByTagName( tag ); |
1314 return context.getElementsByTagName( tag ); |
1251 |
1315 |
1252 // DocumentFragment nodes don't have gEBTN |
1316 // DocumentFragment nodes don't have gEBTN |
1253 } else { |
1317 } else if ( support.qsa ) { |
1254 return context.querySelectorAll( tag ); |
1318 return context.querySelectorAll( tag ); |
1255 } |
1319 } |
1256 }; |
1320 } : |
|
1321 |
|
1322 function( tag, context ) { |
|
1323 var elem, |
|
1324 tmp = [], |
|
1325 i = 0, |
|
1326 |
|
1327 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too |
|
1328 results = context.getElementsByTagName( tag ); |
|
1329 |
|
1330 // Filter out possible comments |
|
1331 if ( tag === "*" ) { |
|
1332 while ( ( elem = results[ i++ ] ) ) { |
|
1333 if ( elem.nodeType === 1 ) { |
|
1334 tmp.push( elem ); |
|
1335 } |
|
1336 } |
|
1337 |
|
1338 return tmp; |
|
1339 } |
|
1340 return results; |
|
1341 }; |
|
1342 |
1257 |
1343 // Class |
1258 // Class |
1344 Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { |
1259 Expr.find.CLASS = function( className, context ) { |
1345 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { |
1260 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { |
1346 return context.getElementsByClassName( className ); |
1261 return context.getElementsByClassName( className ); |
1347 } |
1262 } |
1348 }; |
1263 }; |
1349 |
1264 |
1350 /* QSA/matchesSelector |
1265 /* QSA/matchesSelector |
1351 ---------------------------------------------------------------------- */ |
1266 ---------------------------------------------------------------------- */ |
1352 |
1267 |
1353 // QSA and matchesSelector support |
1268 // QSA and matchesSelector support |
1354 |
1269 |
1355 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) |
|
1356 rbuggyMatches = []; |
|
1357 |
|
1358 // qSa(:focus) reports false when true (Chrome 21) |
|
1359 // We allow this because of a bug in IE8/9 that throws an error |
|
1360 // whenever `document.activeElement` is accessed on an iframe |
|
1361 // So, we allow :focus to pass through QSA all the time to avoid the IE error |
|
1362 // See https://bugs.jquery.com/ticket/13378 |
|
1363 rbuggyQSA = []; |
1270 rbuggyQSA = []; |
1364 |
1271 |
1365 if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { |
1272 // Build QSA regex |
1366 |
1273 // Regex strategy adopted from Diego Perini |
1367 // Build QSA regex |
1274 assert( function( el ) { |
1368 // Regex strategy adopted from Diego Perini |
1275 |
1369 assert( function( el ) { |
1276 var input; |
1370 |
1277 |
1371 var input; |
1278 documentElement.appendChild( el ).innerHTML = |
1372 |
1279 "<a id='" + expando + "' href='' disabled='disabled'></a>" + |
1373 // Select is set to empty string on purpose |
1280 "<select id='" + expando + "-\r\\' disabled='disabled'>" + |
1374 // This is to test IE's treatment of not explicitly |
1281 "<option selected=''></option></select>"; |
1375 // setting a boolean content attribute, |
1282 |
1376 // since its presence should be enough |
1283 // Support: iOS <=7 - 8 only |
1377 // https://bugs.jquery.com/ticket/12359 |
1284 // Boolean attributes and "value" are not treated correctly in some XML documents |
1378 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + |
1285 if ( !el.querySelectorAll( "[selected]" ).length ) { |
1379 "<select id='" + expando + "-\r\\' msallowcapture=''>" + |
1286 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); |
1380 "<option selected=''></option></select>"; |
1287 } |
1381 |
1288 |
1382 // Support: IE8, Opera 11-12.16 |
1289 // Support: iOS <=7 - 8 only |
1383 // Nothing should be selected when empty strings follow ^= or $= or *= |
1290 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { |
1384 // The test attribute must be unknown in Opera but "safe" for WinRT |
1291 rbuggyQSA.push( "~=" ); |
1385 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section |
1292 } |
1386 if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { |
1293 |
1387 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); |
1294 // Support: iOS 8 only |
1388 } |
1295 // https://bugs.webkit.org/show_bug.cgi?id=136851 |
1389 |
1296 // In-page `selector#id sibling-combinator selector` fails |
1390 // Support: IE8 |
1297 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { |
1391 // Boolean attributes and "value" are not treated correctly |
1298 rbuggyQSA.push( ".#.+[+~]" ); |
1392 if ( !el.querySelectorAll( "[selected]" ).length ) { |
1299 } |
1393 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); |
1300 |
1394 } |
1301 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ |
1395 |
1302 // In some of the document kinds, these selectors wouldn't work natively. |
1396 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ |
1303 // This is probably OK but for backwards compatibility we want to maintain |
1397 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { |
1304 // handling them through jQuery traversal in jQuery 3.x. |
1398 rbuggyQSA.push( "~=" ); |
1305 if ( !el.querySelectorAll( ":checked" ).length ) { |
1399 } |
1306 rbuggyQSA.push( ":checked" ); |
1400 |
1307 } |
1401 // Support: IE 11+, Edge 15 - 18+ |
1308 |
1402 // IE 11/Edge don't find elements on a `[name='']` query in some cases. |
1309 // Support: Windows 8 Native Apps |
1403 // Adding a temporary attribute to the document before the selection works |
1310 // The type and name attributes are restricted during .innerHTML assignment |
1404 // around the issue. |
1311 input = document.createElement( "input" ); |
1405 // Interestingly, IE 10 & older don't seem to have the issue. |
1312 input.setAttribute( "type", "hidden" ); |
1406 input = document.createElement( "input" ); |
1313 el.appendChild( input ).setAttribute( "name", "D" ); |
1407 input.setAttribute( "name", "" ); |
1314 |
1408 el.appendChild( input ); |
1315 // Support: IE 9 - 11+ |
1409 if ( !el.querySelectorAll( "[name='']" ).length ) { |
1316 // IE's :disabled selector does not pick up the children of disabled fieldsets |
1410 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + |
1317 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ |
1411 whitespace + "*(?:''|\"\")" ); |
1318 // In some of the document kinds, these selectors wouldn't work natively. |
1412 } |
1319 // This is probably OK but for backwards compatibility we want to maintain |
1413 |
1320 // handling them through jQuery traversal in jQuery 3.x. |
1414 // Webkit/Opera - :checked should return selected option elements |
1321 documentElement.appendChild( el ).disabled = true; |
1415 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked |
1322 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { |
1416 // IE8 throws error here and will not see later tests |
1323 rbuggyQSA.push( ":enabled", ":disabled" ); |
1417 if ( !el.querySelectorAll( ":checked" ).length ) { |
1324 } |
1418 rbuggyQSA.push( ":checked" ); |
1325 |
1419 } |
1326 // Support: IE 11+, Edge 15 - 18+ |
1420 |
1327 // IE 11/Edge don't find elements on a `[name='']` query in some cases. |
1421 // Support: Safari 8+, iOS 8+ |
1328 // Adding a temporary attribute to the document before the selection works |
1422 // https://bugs.webkit.org/show_bug.cgi?id=136851 |
1329 // around the issue. |
1423 // In-page `selector#id sibling-combinator selector` fails |
1330 // Interestingly, IE 10 & older don't seem to have the issue. |
1424 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { |
1331 input = document.createElement( "input" ); |
1425 rbuggyQSA.push( ".#.+[+~]" ); |
1332 input.setAttribute( "name", "" ); |
1426 } |
1333 el.appendChild( input ); |
1427 |
1334 if ( !el.querySelectorAll( "[name='']" ).length ) { |
1428 // Support: Firefox <=3.6 - 5 only |
1335 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + |
1429 // Old Firefox doesn't throw on a badly-escaped identifier. |
1336 whitespace + "*(?:''|\"\")" ); |
1430 el.querySelectorAll( "\\\f" ); |
1337 } |
1431 rbuggyQSA.push( "[\\r\\n\\f]" ); |
1338 } ); |
1432 } ); |
1339 |
1433 |
1340 if ( !support.cssHas ) { |
1434 assert( function( el ) { |
1341 |
1435 el.innerHTML = "<a href='' disabled='disabled'></a>" + |
1342 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ |
1436 "<select disabled='disabled'><option/></select>"; |
1343 // Our regular `try-catch` mechanism fails to detect natively-unsupported |
1437 |
1344 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) |
1438 // Support: Windows 8 Native Apps |
1345 // in browsers that parse the `:has()` argument as a forgiving selector list. |
1439 // The type and name attributes are restricted during .innerHTML assignment |
1346 // https://drafts.csswg.org/selectors/#relational now requires the argument |
1440 var input = document.createElement( "input" ); |
1347 // to be parsed unforgivingly, but browsers have not yet fully adjusted. |
1441 input.setAttribute( "type", "hidden" ); |
|
1442 el.appendChild( input ).setAttribute( "name", "D" ); |
|
1443 |
|
1444 // Support: IE8 |
|
1445 // Enforce case-sensitivity of name attribute |
|
1446 if ( el.querySelectorAll( "[name=d]" ).length ) { |
|
1447 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); |
|
1448 } |
|
1449 |
|
1450 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) |
|
1451 // IE8 throws error here and will not see later tests |
|
1452 if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { |
|
1453 rbuggyQSA.push( ":enabled", ":disabled" ); |
|
1454 } |
|
1455 |
|
1456 // Support: IE9-11+ |
|
1457 // IE's :disabled selector does not pick up the children of disabled fieldsets |
|
1458 docElem.appendChild( el ).disabled = true; |
|
1459 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { |
|
1460 rbuggyQSA.push( ":enabled", ":disabled" ); |
|
1461 } |
|
1462 |
|
1463 // Support: Opera 10 - 11 only |
|
1464 // Opera 10-11 does not throw on post-comma invalid pseudos |
|
1465 el.querySelectorAll( "*,:x" ); |
|
1466 rbuggyQSA.push( ",.*:" ); |
|
1467 } ); |
|
1468 } |
|
1469 |
|
1470 if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || |
|
1471 docElem.webkitMatchesSelector || |
|
1472 docElem.mozMatchesSelector || |
|
1473 docElem.oMatchesSelector || |
|
1474 docElem.msMatchesSelector ) ) ) ) { |
|
1475 |
|
1476 assert( function( el ) { |
|
1477 |
|
1478 // Check to see if it's possible to do matchesSelector |
|
1479 // on a disconnected node (IE 9) |
|
1480 support.disconnectedMatch = matches.call( el, "*" ); |
|
1481 |
|
1482 // This should fail with an exception |
|
1483 // Gecko does not error, returns false instead |
|
1484 matches.call( el, "[s!='']:x" ); |
|
1485 rbuggyMatches.push( "!=", pseudos ); |
|
1486 } ); |
|
1487 } |
|
1488 |
|
1489 if ( !support.cssSupportsSelector ) { |
|
1490 |
|
1491 // Support: Chrome 105+, Safari 15.4+ |
|
1492 // `:has()` uses a forgiving selector list as an argument so our regular |
|
1493 // `try-catch` mechanism fails to catch `:has()` with arguments not supported |
|
1494 // natively like `:has(:contains("Foo"))`. Where supported & spec-compliant, |
|
1495 // we now use `CSS.supports("selector(:is(SELECTOR_TO_BE_TESTED))")`, but |
|
1496 // outside that we mark `:has` as buggy. |
|
1497 rbuggyQSA.push( ":has" ); |
1348 rbuggyQSA.push( ":has" ); |
1498 } |
1349 } |
1499 |
1350 |
1500 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); |
1351 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); |
1501 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); |
|
1502 |
|
1503 /* Contains |
|
1504 ---------------------------------------------------------------------- */ |
|
1505 hasCompare = rnative.test( docElem.compareDocumentPosition ); |
|
1506 |
|
1507 // Element contains another |
|
1508 // Purposefully self-exclusive |
|
1509 // As in, an element does not contain itself |
|
1510 contains = hasCompare || rnative.test( docElem.contains ) ? |
|
1511 function( a, b ) { |
|
1512 |
|
1513 // Support: IE <9 only |
|
1514 // IE doesn't have `contains` on `document` so we need to check for |
|
1515 // `documentElement` presence. |
|
1516 // We need to fall back to `a` when `documentElement` is missing |
|
1517 // as `ownerDocument` of elements within `<template/>` may have |
|
1518 // a null one - a default behavior of all modern browsers. |
|
1519 var adown = a.nodeType === 9 && a.documentElement || a, |
|
1520 bup = b && b.parentNode; |
|
1521 return a === bup || !!( bup && bup.nodeType === 1 && ( |
|
1522 adown.contains ? |
|
1523 adown.contains( bup ) : |
|
1524 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 |
|
1525 ) ); |
|
1526 } : |
|
1527 function( a, b ) { |
|
1528 if ( b ) { |
|
1529 while ( ( b = b.parentNode ) ) { |
|
1530 if ( b === a ) { |
|
1531 return true; |
|
1532 } |
|
1533 } |
|
1534 } |
|
1535 return false; |
|
1536 }; |
|
1537 |
1352 |
1538 /* Sorting |
1353 /* Sorting |
1539 ---------------------------------------------------------------------- */ |
1354 ---------------------------------------------------------------------- */ |
1540 |
1355 |
1541 // Document order sorting |
1356 // Document order sorting |
1542 sortOrder = hasCompare ? |
1357 sortOrder = function( a, b ) { |
1543 function( a, b ) { |
|
1544 |
1358 |
1545 // Flag for duplicate removal |
1359 // Flag for duplicate removal |
1546 if ( a === b ) { |
1360 if ( a === b ) { |
1547 hasDuplicate = true; |
1361 hasDuplicate = true; |
1548 return 0; |
1362 return 0; |
1572 // Choose the first element that is related to our preferred document |
1386 // Choose the first element that is related to our preferred document |
1573 // Support: IE 11+, Edge 17 - 18+ |
1387 // Support: IE 11+, Edge 17 - 18+ |
1574 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1388 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1575 // two documents; shallow comparisons work. |
1389 // two documents; shallow comparisons work. |
1576 // eslint-disable-next-line eqeqeq |
1390 // eslint-disable-next-line eqeqeq |
1577 if ( a == document || a.ownerDocument == preferredDoc && |
1391 if ( a === document || a.ownerDocument == preferredDoc && |
1578 contains( preferredDoc, a ) ) { |
1392 find.contains( preferredDoc, a ) ) { |
1579 return -1; |
1393 return -1; |
1580 } |
1394 } |
1581 |
1395 |
1582 // Support: IE 11+, Edge 17 - 18+ |
1396 // Support: IE 11+, Edge 17 - 18+ |
1583 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1397 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1584 // two documents; shallow comparisons work. |
1398 // two documents; shallow comparisons work. |
1585 // eslint-disable-next-line eqeqeq |
1399 // eslint-disable-next-line eqeqeq |
1586 if ( b == document || b.ownerDocument == preferredDoc && |
1400 if ( b === document || b.ownerDocument == preferredDoc && |
1587 contains( preferredDoc, b ) ) { |
1401 find.contains( preferredDoc, b ) ) { |
1588 return 1; |
1402 return 1; |
1589 } |
1403 } |
1590 |
1404 |
1591 // Maintain original order |
1405 // Maintain original order |
1592 return sortInput ? |
1406 return sortInput ? |
1593 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : |
1407 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : |
1594 0; |
1408 0; |
1595 } |
1409 } |
1596 |
1410 |
1597 return compare & 4 ? -1 : 1; |
1411 return compare & 4 ? -1 : 1; |
1598 } : |
|
1599 function( a, b ) { |
|
1600 |
|
1601 // Exit early if the nodes are identical |
|
1602 if ( a === b ) { |
|
1603 hasDuplicate = true; |
|
1604 return 0; |
|
1605 } |
|
1606 |
|
1607 var cur, |
|
1608 i = 0, |
|
1609 aup = a.parentNode, |
|
1610 bup = b.parentNode, |
|
1611 ap = [ a ], |
|
1612 bp = [ b ]; |
|
1613 |
|
1614 // Parentless nodes are either documents or disconnected |
|
1615 if ( !aup || !bup ) { |
|
1616 |
|
1617 // Support: IE 11+, Edge 17 - 18+ |
|
1618 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
|
1619 // two documents; shallow comparisons work. |
|
1620 /* eslint-disable eqeqeq */ |
|
1621 return a == document ? -1 : |
|
1622 b == document ? 1 : |
|
1623 /* eslint-enable eqeqeq */ |
|
1624 aup ? -1 : |
|
1625 bup ? 1 : |
|
1626 sortInput ? |
|
1627 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : |
|
1628 0; |
|
1629 |
|
1630 // If the nodes are siblings, we can do a quick check |
|
1631 } else if ( aup === bup ) { |
|
1632 return siblingCheck( a, b ); |
|
1633 } |
|
1634 |
|
1635 // Otherwise we need full lists of their ancestors for comparison |
|
1636 cur = a; |
|
1637 while ( ( cur = cur.parentNode ) ) { |
|
1638 ap.unshift( cur ); |
|
1639 } |
|
1640 cur = b; |
|
1641 while ( ( cur = cur.parentNode ) ) { |
|
1642 bp.unshift( cur ); |
|
1643 } |
|
1644 |
|
1645 // Walk down the tree looking for a discrepancy |
|
1646 while ( ap[ i ] === bp[ i ] ) { |
|
1647 i++; |
|
1648 } |
|
1649 |
|
1650 return i ? |
|
1651 |
|
1652 // Do a sibling check if the nodes have a common ancestor |
|
1653 siblingCheck( ap[ i ], bp[ i ] ) : |
|
1654 |
|
1655 // Otherwise nodes in our document sort first |
|
1656 // Support: IE 11+, Edge 17 - 18+ |
|
1657 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
|
1658 // two documents; shallow comparisons work. |
|
1659 /* eslint-disable eqeqeq */ |
|
1660 ap[ i ] == preferredDoc ? -1 : |
|
1661 bp[ i ] == preferredDoc ? 1 : |
|
1662 /* eslint-enable eqeqeq */ |
|
1663 0; |
|
1664 }; |
1412 }; |
1665 |
1413 |
1666 return document; |
1414 return document; |
|
1415 } |
|
1416 |
|
1417 find.matches = function( expr, elements ) { |
|
1418 return find( expr, null, null, elements ); |
1667 }; |
1419 }; |
1668 |
1420 |
1669 Sizzle.matches = function( expr, elements ) { |
1421 find.matchesSelector = function( elem, expr ) { |
1670 return Sizzle( expr, null, null, elements ); |
|
1671 }; |
|
1672 |
|
1673 Sizzle.matchesSelector = function( elem, expr ) { |
|
1674 setDocument( elem ); |
1422 setDocument( elem ); |
1675 |
1423 |
1676 if ( support.matchesSelector && documentIsHTML && |
1424 if ( documentIsHTML && |
1677 !nonnativeSelectorCache[ expr + " " ] && |
1425 !nonnativeSelectorCache[ expr + " " ] && |
1678 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && |
1426 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { |
1679 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { |
|
1680 |
1427 |
1681 try { |
1428 try { |
1682 var ret = matches.call( elem, expr ); |
1429 var ret = matches.call( elem, expr ); |
1683 |
1430 |
1684 // IE 9's matchesSelector returns false on disconnected nodes |
1431 // IE 9's matchesSelector returns false on disconnected nodes |
1685 if ( ret || support.disconnectedMatch || |
1432 if ( ret || support.disconnectedMatch || |
1686 |
1433 |
1687 // As well, disconnected nodes are said to be in a document |
1434 // As well, disconnected nodes are said to be in a document |
1688 // fragment in IE 9 |
1435 // fragment in IE 9 |
1689 elem.document && elem.document.nodeType !== 11 ) { |
1436 elem.document && elem.document.nodeType !== 11 ) { |
1690 return ret; |
1437 return ret; |
1691 } |
1438 } |
1692 } catch ( e ) { |
1439 } catch ( e ) { |
1693 nonnativeSelectorCache( expr, true ); |
1440 nonnativeSelectorCache( expr, true ); |
1694 } |
1441 } |
1695 } |
1442 } |
1696 |
1443 |
1697 return Sizzle( expr, document, null, [ elem ] ).length > 0; |
1444 return find( expr, document, null, [ elem ] ).length > 0; |
1698 }; |
1445 }; |
1699 |
1446 |
1700 Sizzle.contains = function( context, elem ) { |
1447 find.contains = function( context, elem ) { |
1701 |
1448 |
1702 // Set document vars if needed |
1449 // Set document vars if needed |
1703 // Support: IE 11+, Edge 17 - 18+ |
1450 // Support: IE 11+, Edge 17 - 18+ |
1704 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1451 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1705 // two documents; shallow comparisons work. |
1452 // two documents; shallow comparisons work. |
1706 // eslint-disable-next-line eqeqeq |
1453 // eslint-disable-next-line eqeqeq |
1707 if ( ( context.ownerDocument || context ) != document ) { |
1454 if ( ( context.ownerDocument || context ) != document ) { |
1708 setDocument( context ); |
1455 setDocument( context ); |
1709 } |
1456 } |
1710 return contains( context, elem ); |
1457 return jQuery.contains( context, elem ); |
1711 }; |
1458 }; |
1712 |
1459 |
1713 Sizzle.attr = function( elem, name ) { |
1460 |
|
1461 find.attr = function( elem, name ) { |
1714 |
1462 |
1715 // Set document vars if needed |
1463 // Set document vars if needed |
1716 // Support: IE 11+, Edge 17 - 18+ |
1464 // Support: IE 11+, Edge 17 - 18+ |
1717 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1465 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing |
1718 // two documents; shallow comparisons work. |
1466 // two documents; shallow comparisons work. |
1721 setDocument( elem ); |
1469 setDocument( elem ); |
1722 } |
1470 } |
1723 |
1471 |
1724 var fn = Expr.attrHandle[ name.toLowerCase() ], |
1472 var fn = Expr.attrHandle[ name.toLowerCase() ], |
1725 |
1473 |
1726 // Don't get fooled by Object.prototype properties (jQuery #13807) |
1474 // Don't get fooled by Object.prototype properties (see trac-13807) |
1727 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? |
1475 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? |
1728 fn( elem, name, !documentIsHTML ) : |
1476 fn( elem, name, !documentIsHTML ) : |
1729 undefined; |
1477 undefined; |
1730 |
1478 |
1731 return val !== undefined ? |
1479 if ( val !== undefined ) { |
1732 val : |
1480 return val; |
1733 support.attributes || !documentIsHTML ? |
1481 } |
1734 elem.getAttribute( name ) : |
1482 |
1735 ( val = elem.getAttributeNode( name ) ) && val.specified ? |
1483 return elem.getAttribute( name ); |
1736 val.value : |
|
1737 null; |
|
1738 }; |
1484 }; |
1739 |
1485 |
1740 Sizzle.escape = function( sel ) { |
1486 find.error = function( msg ) { |
1741 return ( sel + "" ).replace( rcssescape, fcssescape ); |
|
1742 }; |
|
1743 |
|
1744 Sizzle.error = function( msg ) { |
|
1745 throw new Error( "Syntax error, unrecognized expression: " + msg ); |
1487 throw new Error( "Syntax error, unrecognized expression: " + msg ); |
1746 }; |
1488 }; |
1747 |
1489 |
1748 /** |
1490 /** |
1749 * Document sorting and removing duplicates |
1491 * Document sorting and removing duplicates |
1750 * @param {ArrayLike} results |
1492 * @param {ArrayLike} results |
1751 */ |
1493 */ |
1752 Sizzle.uniqueSort = function( results ) { |
1494 jQuery.uniqueSort = function( results ) { |
1753 var elem, |
1495 var elem, |
1754 duplicates = [], |
1496 duplicates = [], |
1755 j = 0, |
1497 j = 0, |
1756 i = 0; |
1498 i = 0; |
1757 |
1499 |
1758 // Unless we *know* we can detect duplicates, assume their presence |
1500 // Unless we *know* we can detect duplicates, assume their presence |
1759 hasDuplicate = !support.detectDuplicates; |
1501 // |
1760 sortInput = !support.sortStable && results.slice( 0 ); |
1502 // Support: Android <=4.0+ |
1761 results.sort( sortOrder ); |
1503 // Testing for detecting duplicates is unpredictable so instead assume we can't |
|
1504 // depend on duplicate detection in all browsers without a stable sort. |
|
1505 hasDuplicate = !support.sortStable; |
|
1506 sortInput = !support.sortStable && slice.call( results, 0 ); |
|
1507 sort.call( results, sortOrder ); |
1762 |
1508 |
1763 if ( hasDuplicate ) { |
1509 if ( hasDuplicate ) { |
1764 while ( ( elem = results[ i++ ] ) ) { |
1510 while ( ( elem = results[ i++ ] ) ) { |
1765 if ( elem === results[ i ] ) { |
1511 if ( elem === results[ i ] ) { |
1766 j = duplicates.push( i ); |
1512 j = duplicates.push( i ); |
1767 } |
1513 } |
1768 } |
1514 } |
1769 while ( j-- ) { |
1515 while ( j-- ) { |
1770 results.splice( duplicates[ j ], 1 ); |
1516 splice.call( results, duplicates[ j ], 1 ); |
1771 } |
1517 } |
1772 } |
1518 } |
1773 |
1519 |
1774 // Clear input after sorting to release objects |
1520 // Clear input after sorting to release objects |
1775 // See https://github.com/jquery/sizzle/pull/225 |
1521 // See https://github.com/jquery/sizzle/pull/225 |
1776 sortInput = null; |
1522 sortInput = null; |
1777 |
1523 |
1778 return results; |
1524 return results; |
1779 }; |
1525 }; |
1780 |
1526 |
1781 /** |
1527 jQuery.fn.uniqueSort = function() { |
1782 * Utility function for retrieving the text value of an array of DOM nodes |
1528 return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); |
1783 * @param {Array|Element} elem |
|
1784 */ |
|
1785 getText = Sizzle.getText = function( elem ) { |
|
1786 var node, |
|
1787 ret = "", |
|
1788 i = 0, |
|
1789 nodeType = elem.nodeType; |
|
1790 |
|
1791 if ( !nodeType ) { |
|
1792 |
|
1793 // If no nodeType, this is expected to be an array |
|
1794 while ( ( node = elem[ i++ ] ) ) { |
|
1795 |
|
1796 // Do not traverse comment nodes |
|
1797 ret += getText( node ); |
|
1798 } |
|
1799 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { |
|
1800 |
|
1801 // Use textContent for elements |
|
1802 // innerText usage removed for consistency of new lines (jQuery #11153) |
|
1803 if ( typeof elem.textContent === "string" ) { |
|
1804 return elem.textContent; |
|
1805 } else { |
|
1806 |
|
1807 // Traverse its children |
|
1808 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { |
|
1809 ret += getText( elem ); |
|
1810 } |
|
1811 } |
|
1812 } else if ( nodeType === 3 || nodeType === 4 ) { |
|
1813 return elem.nodeValue; |
|
1814 } |
|
1815 |
|
1816 // Do not include comment or processing instruction nodes |
|
1817 |
|
1818 return ret; |
|
1819 }; |
1529 }; |
1820 |
1530 |
1821 Expr = Sizzle.selectors = { |
1531 Expr = jQuery.expr = { |
1822 |
1532 |
1823 // Can be adjusted by the user |
1533 // Can be adjusted by the user |
1824 cacheLength: 50, |
1534 cacheLength: 50, |
1825 |
1535 |
1826 createPseudo: markFunction, |
1536 createPseudo: markFunction, |
1920 } |
1631 } |
1921 }, |
1632 }, |
1922 |
1633 |
1923 filter: { |
1634 filter: { |
1924 |
1635 |
1925 "TAG": function( nodeNameSelector ) { |
1636 TAG: function( nodeNameSelector ) { |
1926 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); |
1637 var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); |
1927 return nodeNameSelector === "*" ? |
1638 return nodeNameSelector === "*" ? |
1928 function() { |
1639 function() { |
1929 return true; |
1640 return true; |
1930 } : |
1641 } : |
1931 function( elem ) { |
1642 function( elem ) { |
1932 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; |
1643 return nodeName( elem, expectedNodeName ); |
1933 }; |
1644 }; |
1934 }, |
1645 }, |
1935 |
1646 |
1936 "CLASS": function( className ) { |
1647 CLASS: function( className ) { |
1937 var pattern = classCache[ className + " " ]; |
1648 var pattern = classCache[ className + " " ]; |
1938 |
1649 |
1939 return pattern || |
1650 return pattern || |
1940 ( pattern = new RegExp( "(^|" + whitespace + |
1651 ( pattern = new RegExp( "(^|" + whitespace + ")" + className + |
1941 ")" + className + "(" + whitespace + "|$)" ) ) && classCache( |
1652 "(" + whitespace + "|$)" ) ) && |
1942 className, function( elem ) { |
1653 classCache( className, function( elem ) { |
1943 return pattern.test( |
1654 return pattern.test( |
1944 typeof elem.className === "string" && elem.className || |
1655 typeof elem.className === "string" && elem.className || |
1945 typeof elem.getAttribute !== "undefined" && |
1656 typeof elem.getAttribute !== "undefined" && |
1946 elem.getAttribute( "class" ) || |
1657 elem.getAttribute( "class" ) || |
1947 "" |
1658 "" |
1948 ); |
1659 ); |
1949 } ); |
1660 } ); |
1950 }, |
1661 }, |
1951 |
1662 |
1952 "ATTR": function( name, operator, check ) { |
1663 ATTR: function( name, operator, check ) { |
1953 return function( elem ) { |
1664 return function( elem ) { |
1954 var result = Sizzle.attr( elem, name ); |
1665 var result = find.attr( elem, name ); |
1955 |
1666 |
1956 if ( result == null ) { |
1667 if ( result == null ) { |
1957 return operator === "!="; |
1668 return operator === "!="; |
1958 } |
1669 } |
1959 if ( !operator ) { |
1670 if ( !operator ) { |
1960 return true; |
1671 return true; |
1961 } |
1672 } |
1962 |
1673 |
1963 result += ""; |
1674 result += ""; |
1964 |
1675 |
1965 /* eslint-disable max-len */ |
1676 if ( operator === "=" ) { |
1966 |
1677 return result === check; |
1967 return operator === "=" ? result === check : |
1678 } |
1968 operator === "!=" ? result !== check : |
1679 if ( operator === "!=" ) { |
1969 operator === "^=" ? check && result.indexOf( check ) === 0 : |
1680 return result !== check; |
1970 operator === "*=" ? check && result.indexOf( check ) > -1 : |
1681 } |
1971 operator === "$=" ? check && result.slice( -check.length ) === check : |
1682 if ( operator === "^=" ) { |
1972 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : |
1683 return check && result.indexOf( check ) === 0; |
1973 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : |
1684 } |
1974 false; |
1685 if ( operator === "*=" ) { |
1975 /* eslint-enable max-len */ |
1686 return check && result.indexOf( check ) > -1; |
1976 |
1687 } |
|
1688 if ( operator === "$=" ) { |
|
1689 return check && result.slice( -check.length ) === check; |
|
1690 } |
|
1691 if ( operator === "~=" ) { |
|
1692 return ( " " + result.replace( rwhitespace, " " ) + " " ) |
|
1693 .indexOf( check ) > -1; |
|
1694 } |
|
1695 if ( operator === "|=" ) { |
|
1696 return result === check || result.slice( 0, check.length + 1 ) === check + "-"; |
|
1697 } |
|
1698 |
|
1699 return false; |
1977 }; |
1700 }; |
1978 }, |
1701 }, |
1979 |
1702 |
1980 "CHILD": function( type, what, _argument, first, last ) { |
1703 CHILD: function( type, what, _argument, first, last ) { |
1981 var simple = type.slice( 0, 3 ) !== "nth", |
1704 var simple = type.slice( 0, 3 ) !== "nth", |
1982 forward = type.slice( -4 ) !== "last", |
1705 forward = type.slice( -4 ) !== "last", |
1983 ofType = what === "of-type"; |
1706 ofType = what === "of-type"; |
1984 |
1707 |
1985 return first === 1 && last === 0 ? |
1708 return first === 1 && last === 0 ? |
2177 } ) : |
1876 } ) : |
2178 function( elem, _context, xml ) { |
1877 function( elem, _context, xml ) { |
2179 input[ 0 ] = elem; |
1878 input[ 0 ] = elem; |
2180 matcher( input, null, xml, results ); |
1879 matcher( input, null, xml, results ); |
2181 |
1880 |
2182 // Don't keep the element (issue #299) |
1881 // Don't keep the element |
|
1882 // (see https://github.com/jquery/sizzle/issues/299) |
2183 input[ 0 ] = null; |
1883 input[ 0 ] = null; |
2184 return !results.pop(); |
1884 return !results.pop(); |
2185 }; |
1885 }; |
2186 } ), |
1886 } ), |
2187 |
1887 |
2188 "has": markFunction( function( selector ) { |
1888 has: markFunction( function( selector ) { |
2189 return function( elem ) { |
1889 return function( elem ) { |
2190 return Sizzle( selector, elem ).length > 0; |
1890 return find( selector, elem ).length > 0; |
2191 }; |
1891 }; |
2192 } ), |
1892 } ), |
2193 |
1893 |
2194 "contains": markFunction( function( text ) { |
1894 contains: markFunction( function( text ) { |
2195 text = text.replace( runescape, funescape ); |
1895 text = text.replace( runescape, funescape ); |
2196 return function( elem ) { |
1896 return function( elem ) { |
2197 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; |
1897 return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; |
2198 }; |
1898 }; |
2199 } ), |
1899 } ), |
2200 |
1900 |
2201 // "Whether an element is represented by a :lang() selector |
1901 // "Whether an element is represented by a :lang() selector |
2202 // is based solely on the element's language value |
1902 // is based solely on the element's language value |
2203 // being equal to the identifier C, |
1903 // being equal to the identifier C, |
2204 // or beginning with the identifier C immediately followed by "-". |
1904 // or beginning with the identifier C immediately followed by "-". |
2205 // The matching of C against the element's language value is performed case-insensitively. |
1905 // The matching of C against the element's language value is performed case-insensitively. |
2206 // The identifier C does not have to be a valid language name." |
1906 // The identifier C does not have to be a valid language name." |
2207 // http://www.w3.org/TR/selectors/#lang-pseudo |
1907 // https://www.w3.org/TR/selectors/#lang-pseudo |
2208 "lang": markFunction( function( lang ) { |
1908 lang: markFunction( function( lang ) { |
2209 |
1909 |
2210 // lang value must be a valid identifier |
1910 // lang value must be a valid identifier |
2211 if ( !ridentifier.test( lang || "" ) ) { |
1911 if ( !ridentifier.test( lang || "" ) ) { |
2212 Sizzle.error( "unsupported lang: " + lang ); |
1912 find.error( "unsupported lang: " + lang ); |
2213 } |
1913 } |
2214 lang = lang.replace( runescape, funescape ).toLowerCase(); |
1914 lang = lang.replace( runescape, funescape ).toLowerCase(); |
2215 return function( elem ) { |
1915 return function( elem ) { |
2216 var elemLang; |
1916 var elemLang; |
2217 do { |
1917 do { |
2226 return false; |
1926 return false; |
2227 }; |
1927 }; |
2228 } ), |
1928 } ), |
2229 |
1929 |
2230 // Miscellaneous |
1930 // Miscellaneous |
2231 "target": function( elem ) { |
1931 target: function( elem ) { |
2232 var hash = window.location && window.location.hash; |
1932 var hash = window.location && window.location.hash; |
2233 return hash && hash.slice( 1 ) === elem.id; |
1933 return hash && hash.slice( 1 ) === elem.id; |
2234 }, |
1934 }, |
2235 |
1935 |
2236 "root": function( elem ) { |
1936 root: function( elem ) { |
2237 return elem === docElem; |
1937 return elem === documentElement; |
2238 }, |
1938 }, |
2239 |
1939 |
2240 "focus": function( elem ) { |
1940 focus: function( elem ) { |
2241 return elem === document.activeElement && |
1941 return elem === safeActiveElement() && |
2242 ( !document.hasFocus || document.hasFocus() ) && |
1942 document.hasFocus() && |
2243 !!( elem.type || elem.href || ~elem.tabIndex ); |
1943 !!( elem.type || elem.href || ~elem.tabIndex ); |
2244 }, |
1944 }, |
2245 |
1945 |
2246 // Boolean properties |
1946 // Boolean properties |
2247 "enabled": createDisabledPseudo( false ), |
1947 enabled: createDisabledPseudo( false ), |
2248 "disabled": createDisabledPseudo( true ), |
1948 disabled: createDisabledPseudo( true ), |
2249 |
1949 |
2250 "checked": function( elem ) { |
1950 checked: function( elem ) { |
2251 |
1951 |
2252 // In CSS3, :checked should return both checked and selected elements |
1952 // In CSS3, :checked should return both checked and selected elements |
2253 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked |
1953 // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked |
2254 var nodeName = elem.nodeName.toLowerCase(); |
1954 return ( nodeName( elem, "input" ) && !!elem.checked ) || |
2255 return ( nodeName === "input" && !!elem.checked ) || |
1955 ( nodeName( elem, "option" ) && !!elem.selected ); |
2256 ( nodeName === "option" && !!elem.selected ); |
|
2257 }, |
1956 }, |
2258 |
1957 |
2259 "selected": function( elem ) { |
1958 selected: function( elem ) { |
2260 |
1959 |
2261 // Accessing this property makes selected-by-default |
1960 // Support: IE <=11+ |
2262 // options in Safari work properly |
1961 // Accessing the selectedIndex property |
|
1962 // forces the browser to treat the default option as |
|
1963 // selected when in an optgroup. |
2263 if ( elem.parentNode ) { |
1964 if ( elem.parentNode ) { |
2264 // eslint-disable-next-line no-unused-expressions |
1965 // eslint-disable-next-line no-unused-expressions |
2265 elem.parentNode.selectedIndex; |
1966 elem.parentNode.selectedIndex; |
2266 } |
1967 } |
2267 |
1968 |
2268 return elem.selected === true; |
1969 return elem.selected === true; |
2269 }, |
1970 }, |
2270 |
1971 |
2271 // Contents |
1972 // Contents |
2272 "empty": function( elem ) { |
1973 empty: function( elem ) { |
2273 |
1974 |
2274 // http://www.w3.org/TR/selectors/#empty-pseudo |
1975 // https://www.w3.org/TR/selectors/#empty-pseudo |
2275 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), |
1976 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), |
2276 // but not by others (comment: 8; processing instruction: 7; etc.) |
1977 // but not by others (comment: 8; processing instruction: 7; etc.) |
2277 // nodeType < 6 works because attributes (2) do not appear as children |
1978 // nodeType < 6 works because attributes (2) do not appear as children |
2278 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { |
1979 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { |
2279 if ( elem.nodeType < 6 ) { |
1980 if ( elem.nodeType < 6 ) { |
2281 } |
1982 } |
2282 } |
1983 } |
2283 return true; |
1984 return true; |
2284 }, |
1985 }, |
2285 |
1986 |
2286 "parent": function( elem ) { |
1987 parent: function( elem ) { |
2287 return !Expr.pseudos[ "empty" ]( elem ); |
1988 return !Expr.pseudos.empty( elem ); |
2288 }, |
1989 }, |
2289 |
1990 |
2290 // Element/input types |
1991 // Element/input types |
2291 "header": function( elem ) { |
1992 header: function( elem ) { |
2292 return rheader.test( elem.nodeName ); |
1993 return rheader.test( elem.nodeName ); |
2293 }, |
1994 }, |
2294 |
1995 |
2295 "input": function( elem ) { |
1996 input: function( elem ) { |
2296 return rinputs.test( elem.nodeName ); |
1997 return rinputs.test( elem.nodeName ); |
2297 }, |
1998 }, |
2298 |
1999 |
2299 "button": function( elem ) { |
2000 button: function( elem ) { |
2300 var name = elem.nodeName.toLowerCase(); |
2001 return nodeName( elem, "input" ) && elem.type === "button" || |
2301 return name === "input" && elem.type === "button" || name === "button"; |
2002 nodeName( elem, "button" ); |
2302 }, |
2003 }, |
2303 |
2004 |
2304 "text": function( elem ) { |
2005 text: function( elem ) { |
2305 var attr; |
2006 var attr; |
2306 return elem.nodeName.toLowerCase() === "input" && |
2007 return nodeName( elem, "input" ) && elem.type === "text" && |
2307 elem.type === "text" && |
|
2308 |
2008 |
2309 // Support: IE <10 only |
2009 // Support: IE <10 only |
2310 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" |
2010 // New HTML5 attribute values (e.g., "search") appear |
|
2011 // with elem.type === "text" |
2311 ( ( attr = elem.getAttribute( "type" ) ) == null || |
2012 ( ( attr = elem.getAttribute( "type" ) ) == null || |
2312 attr.toLowerCase() === "text" ); |
2013 attr.toLowerCase() === "text" ); |
2313 }, |
2014 }, |
2314 |
2015 |
2315 // Position-in-collection |
2016 // Position-in-collection |
2316 "first": createPositionalPseudo( function() { |
2017 first: createPositionalPseudo( function() { |
2317 return [ 0 ]; |
2018 return [ 0 ]; |
2318 } ), |
2019 } ), |
2319 |
2020 |
2320 "last": createPositionalPseudo( function( _matchIndexes, length ) { |
2021 last: createPositionalPseudo( function( _matchIndexes, length ) { |
2321 return [ length - 1 ]; |
2022 return [ length - 1 ]; |
2322 } ), |
2023 } ), |
2323 |
2024 |
2324 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { |
2025 eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { |
2325 return [ argument < 0 ? argument + length : argument ]; |
2026 return [ argument < 0 ? argument + length : argument ]; |
2326 } ), |
2027 } ), |
2327 |
2028 |
2328 "even": createPositionalPseudo( function( matchIndexes, length ) { |
2029 even: createPositionalPseudo( function( matchIndexes, length ) { |
2329 var i = 0; |
2030 var i = 0; |
2330 for ( ; i < length; i += 2 ) { |
2031 for ( ; i < length; i += 2 ) { |
2331 matchIndexes.push( i ); |
2032 matchIndexes.push( i ); |
2332 } |
2033 } |
2333 return matchIndexes; |
2034 return matchIndexes; |
2334 } ), |
2035 } ), |
2335 |
2036 |
2336 "odd": createPositionalPseudo( function( matchIndexes, length ) { |
2037 odd: createPositionalPseudo( function( matchIndexes, length ) { |
2337 var i = 1; |
2038 var i = 1; |
2338 for ( ; i < length; i += 2 ) { |
2039 for ( ; i < length; i += 2 ) { |
2339 matchIndexes.push( i ); |
2040 matchIndexes.push( i ); |
2340 } |
2041 } |
2341 return matchIndexes; |
2042 return matchIndexes; |
2342 } ), |
2043 } ), |
2343 |
2044 |
2344 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { |
2045 lt: createPositionalPseudo( function( matchIndexes, length, argument ) { |
2345 var i = argument < 0 ? |
2046 var i; |
2346 argument + length : |
2047 |
2347 argument > length ? |
2048 if ( argument < 0 ) { |
2348 length : |
2049 i = argument + length; |
2349 argument; |
2050 } else if ( argument > length ) { |
|
2051 i = length; |
|
2052 } else { |
|
2053 i = argument; |
|
2054 } |
|
2055 |
2350 for ( ; --i >= 0; ) { |
2056 for ( ; --i >= 0; ) { |
2351 matchIndexes.push( i ); |
2057 matchIndexes.push( i ); |
2352 } |
2058 } |
2353 return matchIndexes; |
2059 return matchIndexes; |
2354 } ), |
2060 } ), |
2355 |
2061 |
2356 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { |
2062 gt: createPositionalPseudo( function( matchIndexes, length, argument ) { |
2357 var i = argument < 0 ? argument + length : argument; |
2063 var i = argument < 0 ? argument + length : argument; |
2358 for ( ; ++i < length; ) { |
2064 for ( ; ++i < length; ) { |
2359 matchIndexes.push( i ); |
2065 matchIndexes.push( i ); |
2360 } |
2066 } |
2361 return matchIndexes; |
2067 return matchIndexes; |
2362 } ) |
2068 } ) |
2363 } |
2069 } |
2364 }; |
2070 }; |
2365 |
2071 |
2366 Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; |
2072 Expr.pseudos.nth = Expr.pseudos.eq; |
2367 |
2073 |
2368 // Add button/input type pseudos |
2074 // Add button/input type pseudos |
2369 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { |
2075 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { |
2370 Expr.pseudos[ i ] = createInputPseudo( i ); |
2076 Expr.pseudos[ i ] = createInputPseudo( i ); |
2371 } |
2077 } |
2575 } |
2278 } |
2576 if ( postFinder && !postFinder[ expando ] ) { |
2279 if ( postFinder && !postFinder[ expando ] ) { |
2577 postFinder = setMatcher( postFinder, postSelector ); |
2280 postFinder = setMatcher( postFinder, postSelector ); |
2578 } |
2281 } |
2579 return markFunction( function( seed, results, context, xml ) { |
2282 return markFunction( function( seed, results, context, xml ) { |
2580 var temp, i, elem, |
2283 var temp, i, elem, matcherOut, |
2581 preMap = [], |
2284 preMap = [], |
2582 postMap = [], |
2285 postMap = [], |
2583 preexisting = results.length, |
2286 preexisting = results.length, |
2584 |
2287 |
2585 // Get initial elements from seed or context |
2288 // Get initial elements from seed or context |
2586 elems = seed || multipleContexts( |
2289 elems = seed || |
2587 selector || "*", |
2290 multipleContexts( selector || "*", |
2588 context.nodeType ? [ context ] : context, |
2291 context.nodeType ? [ context ] : context, [] ), |
2589 [] |
|
2590 ), |
|
2591 |
2292 |
2592 // Prefilter to get matcher input, preserving a map for seed-results synchronization |
2293 // Prefilter to get matcher input, preserving a map for seed-results synchronization |
2593 matcherIn = preFilter && ( seed || !selector ) ? |
2294 matcherIn = preFilter && ( seed || !selector ) ? |
2594 condense( elems, preMap, preFilter, context, xml ) : |
2295 condense( elems, preMap, preFilter, context, xml ) : |
2595 elems, |
2296 elems; |
2596 |
2297 |
2597 matcherOut = matcher ? |
|
2598 |
|
2599 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, |
|
2600 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? |
|
2601 |
|
2602 // ...intermediate processing is necessary |
|
2603 [] : |
|
2604 |
|
2605 // ...otherwise use results directly |
|
2606 results : |
|
2607 matcherIn; |
|
2608 |
|
2609 // Find primary matches |
|
2610 if ( matcher ) { |
2298 if ( matcher ) { |
|
2299 |
|
2300 // If we have a postFinder, or filtered seed, or non-seed postFilter |
|
2301 // or preexisting results, |
|
2302 matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? |
|
2303 |
|
2304 // ...intermediate processing is necessary |
|
2305 [] : |
|
2306 |
|
2307 // ...otherwise use results directly |
|
2308 results; |
|
2309 |
|
2310 // Find primary matches |
2611 matcher( matcherIn, matcherOut, context, xml ); |
2311 matcher( matcherIn, matcherOut, context, xml ); |
|
2312 } else { |
|
2313 matcherOut = matcherIn; |
2612 } |
2314 } |
2613 |
2315 |
2614 // Apply postFilter |
2316 // Apply postFilter |
2615 if ( postFilter ) { |
2317 if ( postFilter ) { |
2616 temp = condense( matcherOut, postMap ); |
2318 temp = condense( matcherOut, postMap ); |
2969 !documentIsHTML, |
2677 !documentIsHTML, |
2970 results, |
2678 results, |
2971 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context |
2679 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context |
2972 ); |
2680 ); |
2973 return results; |
2681 return results; |
2974 }; |
2682 } |
2975 |
2683 |
2976 // One-time assignments |
2684 // One-time assignments |
2977 |
2685 |
|
2686 // Support: Android <=4.0 - 4.1+ |
2978 // Sort stability |
2687 // Sort stability |
2979 support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; |
2688 support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; |
2980 |
2689 |
2981 // Support: Chrome 14-35+ |
|
2982 // Always assume duplicates if they aren't passed to the comparison function |
|
2983 support.detectDuplicates = !!hasDuplicate; |
|
2984 |
|
2985 // Initialize against the default document |
2690 // Initialize against the default document |
2986 setDocument(); |
2691 setDocument(); |
2987 |
2692 |
2988 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) |
2693 // Support: Android <=4.0 - 4.1+ |
2989 // Detached nodes confoundingly follow *each other* |
2694 // Detached nodes confoundingly follow *each other* |
2990 support.sortDetached = assert( function( el ) { |
2695 support.sortDetached = assert( function( el ) { |
2991 |
2696 |
2992 // Should return 1, but returns 4 (following) |
2697 // Should return 1, but returns 4 (following) |
2993 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; |
2698 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; |
2994 } ); |
2699 } ); |
2995 |
2700 |
2996 // Support: IE<8 |
2701 jQuery.find = find; |
2997 // Prevent attribute/property "interpolation" |
|
2998 // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx |
|
2999 if ( !assert( function( el ) { |
|
3000 el.innerHTML = "<a href='#'></a>"; |
|
3001 return el.firstChild.getAttribute( "href" ) === "#"; |
|
3002 } ) ) { |
|
3003 addHandle( "type|href|height|width", function( elem, name, isXML ) { |
|
3004 if ( !isXML ) { |
|
3005 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); |
|
3006 } |
|
3007 } ); |
|
3008 } |
|
3009 |
|
3010 // Support: IE<9 |
|
3011 // Use defaultValue in place of getAttribute("value") |
|
3012 if ( !support.attributes || !assert( function( el ) { |
|
3013 el.innerHTML = "<input/>"; |
|
3014 el.firstChild.setAttribute( "value", "" ); |
|
3015 return el.firstChild.getAttribute( "value" ) === ""; |
|
3016 } ) ) { |
|
3017 addHandle( "value", function( elem, _name, isXML ) { |
|
3018 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { |
|
3019 return elem.defaultValue; |
|
3020 } |
|
3021 } ); |
|
3022 } |
|
3023 |
|
3024 // Support: IE<9 |
|
3025 // Use getAttributeNode to fetch booleans when getAttribute lies |
|
3026 if ( !assert( function( el ) { |
|
3027 return el.getAttribute( "disabled" ) == null; |
|
3028 } ) ) { |
|
3029 addHandle( booleans, function( elem, name, isXML ) { |
|
3030 var val; |
|
3031 if ( !isXML ) { |
|
3032 return elem[ name ] === true ? name.toLowerCase() : |
|
3033 ( val = elem.getAttributeNode( name ) ) && val.specified ? |
|
3034 val.value : |
|
3035 null; |
|
3036 } |
|
3037 } ); |
|
3038 } |
|
3039 |
|
3040 return Sizzle; |
|
3041 |
|
3042 } )( window ); |
|
3043 |
|
3044 |
|
3045 |
|
3046 jQuery.find = Sizzle; |
|
3047 jQuery.expr = Sizzle.selectors; |
|
3048 |
2702 |
3049 // Deprecated |
2703 // Deprecated |
3050 jQuery.expr[ ":" ] = jQuery.expr.pseudos; |
2704 jQuery.expr[ ":" ] = jQuery.expr.pseudos; |
3051 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; |
2705 jQuery.unique = jQuery.uniqueSort; |
3052 jQuery.text = Sizzle.getText; |
2706 |
3053 jQuery.isXMLDoc = Sizzle.isXML; |
2707 // These have always been private, but they used to be documented as part of |
3054 jQuery.contains = Sizzle.contains; |
2708 // Sizzle so let's maintain them for now for backwards compatibility purposes. |
3055 jQuery.escapeSelector = Sizzle.escape; |
2709 find.compile = compile; |
3056 |
2710 find.select = select; |
3057 |
2711 find.setDocument = setDocument; |
|
2712 find.tokenize = tokenize; |
|
2713 |
|
2714 find.escape = jQuery.escapeSelector; |
|
2715 find.getText = jQuery.text; |
|
2716 find.isXML = jQuery.isXMLDoc; |
|
2717 find.selectors = jQuery.expr; |
|
2718 find.support = jQuery.support; |
|
2719 find.uniqueSort = jQuery.uniqueSort; |
|
2720 |
|
2721 /* eslint-enable */ |
|
2722 |
|
2723 } )(); |
3058 |
2724 |
3059 |
2725 |
3060 var dir = function( elem, dir, until ) { |
2726 var dir = function( elem, dir, until ) { |
3061 var matched = [], |
2727 var matched = [], |
3062 truncate = until !== undefined; |
2728 truncate = until !== undefined; |
5687 // Register the controller as a special universal handler for all event namespaces |
5338 // Register the controller as a special universal handler for all event namespaces |
5688 dataPriv.set( el, type, false ); |
5339 dataPriv.set( el, type, false ); |
5689 jQuery.event.add( el, type, { |
5340 jQuery.event.add( el, type, { |
5690 namespace: false, |
5341 namespace: false, |
5691 handler: function( event ) { |
5342 handler: function( event ) { |
5692 var notAsync, result, |
5343 var result, |
5693 saved = dataPriv.get( this, type ); |
5344 saved = dataPriv.get( this, type ); |
5694 |
5345 |
5695 if ( ( event.isTrigger & 1 ) && this[ type ] ) { |
5346 if ( ( event.isTrigger & 1 ) && this[ type ] ) { |
5696 |
5347 |
5697 // Interrupt processing of the outer synthetic .trigger()ed event |
5348 // Interrupt processing of the outer synthetic .trigger()ed event |
5698 // Saved data should be false in such cases, but might be a leftover capture object |
5349 if ( !saved ) { |
5699 // from an async native handler (gh-4350) |
|
5700 if ( !saved.length ) { |
|
5701 |
5350 |
5702 // Store arguments for use when handling the inner native event |
5351 // Store arguments for use when handling the inner native event |
5703 // There will always be at least one argument (an event object), so this array |
5352 // There will always be at least one argument (an event object), so this array |
5704 // will not be confused with a leftover capture object. |
5353 // will not be confused with a leftover capture object. |
5705 saved = slice.call( arguments ); |
5354 saved = slice.call( arguments ); |
5706 dataPriv.set( this, type, saved ); |
5355 dataPriv.set( this, type, saved ); |
5707 |
5356 |
5708 // Trigger the native event and capture its result |
5357 // Trigger the native event and capture its result |
5709 // Support: IE <=9 - 11+ |
|
5710 // focus() and blur() are asynchronous |
|
5711 notAsync = expectSync( this, type ); |
|
5712 this[ type ](); |
5358 this[ type ](); |
5713 result = dataPriv.get( this, type ); |
5359 result = dataPriv.get( this, type ); |
5714 if ( saved !== result || notAsync ) { |
5360 dataPriv.set( this, type, false ); |
5715 dataPriv.set( this, type, false ); |
5361 |
5716 } else { |
|
5717 result = {}; |
|
5718 } |
|
5719 if ( saved !== result ) { |
5362 if ( saved !== result ) { |
5720 |
5363 |
5721 // Cancel the outer synthetic event |
5364 // Cancel the outer synthetic event |
5722 event.stopImmediatePropagation(); |
5365 event.stopImmediatePropagation(); |
5723 event.preventDefault(); |
5366 event.preventDefault(); |
5724 |
5367 |
5725 // Support: Chrome 86+ |
5368 return result; |
5726 // In Chrome, if an element having a focusout handler is blurred by |
|
5727 // clicking outside of it, it invokes the handler synchronously. If |
|
5728 // that handler calls `.remove()` on the element, the data is cleared, |
|
5729 // leaving `result` undefined. We need to guard against this. |
|
5730 return result && result.value; |
|
5731 } |
5369 } |
5732 |
5370 |
5733 // If this is an inner synthetic event for an event with a bubbling surrogate |
5371 // If this is an inner synthetic event for an event with a bubbling surrogate |
5734 // (focus or blur), assume that the surrogate already propagated from triggering the |
5372 // (focus or blur), assume that the surrogate already propagated from triggering |
5735 // native event and prevent that from happening again here. |
5373 // the native event and prevent that from happening again here. |
5736 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the |
5374 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the |
5737 // bubbling surrogate propagates *after* the non-bubbling base), but that seems |
5375 // bubbling surrogate propagates *after* the non-bubbling base), but that seems |
5738 // less bad than duplication. |
5376 // less bad than duplication. |
5739 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { |
5377 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { |
5740 event.stopPropagation(); |
5378 event.stopPropagation(); |
5741 } |
5379 } |
5742 |
5380 |
5743 // If this is a native event triggered above, everything is now in order |
5381 // If this is a native event triggered above, everything is now in order |
5744 // Fire an inner synthetic event with the original arguments |
5382 // Fire an inner synthetic event with the original arguments |
5745 } else if ( saved.length ) { |
5383 } else if ( saved ) { |
5746 |
5384 |
5747 // ...and capture the result |
5385 // ...and capture the result |
5748 dataPriv.set( this, type, { |
5386 dataPriv.set( this, type, jQuery.event.trigger( |
5749 value: jQuery.event.trigger( |
5387 saved[ 0 ], |
5750 |
5388 saved.slice( 1 ), |
5751 // Support: IE <=9 - 11+ |
5389 this |
5752 // Extend with the prototype to reset the above stopImmediatePropagation() |
5390 ) ); |
5753 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), |
5391 |
5754 saved.slice( 1 ), |
5392 // Abort handling of the native event by all jQuery handlers while allowing |
5755 this |
5393 // native handlers on the same element to run. On target, this is achieved |
5756 ) |
5394 // by stopping immediate propagation just on the jQuery event. However, |
5757 } ); |
5395 // the native event is re-wrapped by a jQuery one on each level of the |
5758 |
5396 // propagation so the only way to stop it for jQuery is to stop it for |
5759 // Abort handling of the native event |
5397 // everyone via native `stopPropagation()`. This is not a problem for |
5760 event.stopImmediatePropagation(); |
5398 // focus/blur which don't bubble, but it does also stop click on checkboxes |
|
5399 // and radios. We accept this limitation. |
|
5400 event.stopPropagation(); |
|
5401 event.isImmediatePropagationStopped = returnTrue; |
5761 } |
5402 } |
5762 } |
5403 } |
5763 } ); |
5404 } ); |
5764 } |
5405 } |
5765 |
5406 |
5894 touches: true, |
5535 touches: true, |
5895 which: true |
5536 which: true |
5896 }, jQuery.event.addProp ); |
5537 }, jQuery.event.addProp ); |
5897 |
5538 |
5898 jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { |
5539 jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { |
|
5540 |
|
5541 function focusMappedHandler( nativeEvent ) { |
|
5542 if ( document.documentMode ) { |
|
5543 |
|
5544 // Support: IE 11+ |
|
5545 // Attach a single focusin/focusout handler on the document while someone wants |
|
5546 // focus/blur. This is because the former are synchronous in IE while the latter |
|
5547 // are async. In other browsers, all those handlers are invoked synchronously. |
|
5548 |
|
5549 // `handle` from private data would already wrap the event, but we need |
|
5550 // to change the `type` here. |
|
5551 var handle = dataPriv.get( this, "handle" ), |
|
5552 event = jQuery.event.fix( nativeEvent ); |
|
5553 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; |
|
5554 event.isSimulated = true; |
|
5555 |
|
5556 // First, handle focusin/focusout |
|
5557 handle( nativeEvent ); |
|
5558 |
|
5559 // ...then, handle focus/blur |
|
5560 // |
|
5561 // focus/blur don't bubble while focusin/focusout do; simulate the former by only |
|
5562 // invoking the handler at the lower level. |
|
5563 if ( event.target === event.currentTarget ) { |
|
5564 |
|
5565 // The setup part calls `leverageNative`, which, in turn, calls |
|
5566 // `jQuery.event.add`, so event handle will already have been set |
|
5567 // by this point. |
|
5568 handle( event ); |
|
5569 } |
|
5570 } else { |
|
5571 |
|
5572 // For non-IE browsers, attach a single capturing handler on the document |
|
5573 // while someone wants focusin/focusout. |
|
5574 jQuery.event.simulate( delegateType, nativeEvent.target, |
|
5575 jQuery.event.fix( nativeEvent ) ); |
|
5576 } |
|
5577 } |
|
5578 |
5899 jQuery.event.special[ type ] = { |
5579 jQuery.event.special[ type ] = { |
5900 |
5580 |
5901 // Utilize native event if possible so blur/focus sequence is correct |
5581 // Utilize native event if possible so blur/focus sequence is correct |
5902 setup: function() { |
5582 setup: function() { |
|
5583 |
|
5584 var attaches; |
5903 |
5585 |
5904 // Claim the first handler |
5586 // Claim the first handler |
5905 // dataPriv.set( this, "focus", ... ) |
5587 // dataPriv.set( this, "focus", ... ) |
5906 // dataPriv.set( this, "blur", ... ) |
5588 // dataPriv.set( this, "blur", ... ) |
5907 leverageNative( this, type, expectSync ); |
5589 leverageNative( this, type, true ); |
5908 |
5590 |
5909 // Return false to allow normal processing in the caller |
5591 if ( document.documentMode ) { |
5910 return false; |
5592 |
|
5593 // Support: IE 9 - 11+ |
|
5594 // We use the same native handler for focusin & focus (and focusout & blur) |
|
5595 // so we need to coordinate setup & teardown parts between those events. |
|
5596 // Use `delegateType` as the key as `type` is already used by `leverageNative`. |
|
5597 attaches = dataPriv.get( this, delegateType ); |
|
5598 if ( !attaches ) { |
|
5599 this.addEventListener( delegateType, focusMappedHandler ); |
|
5600 } |
|
5601 dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); |
|
5602 } else { |
|
5603 |
|
5604 // Return false to allow normal processing in the caller |
|
5605 return false; |
|
5606 } |
5911 }, |
5607 }, |
5912 trigger: function() { |
5608 trigger: function() { |
5913 |
5609 |
5914 // Force setup before trigger |
5610 // Force setup before trigger |
5915 leverageNative( this, type ); |
5611 leverageNative( this, type ); |
5916 |
5612 |
5917 // Return non-false to allow normal event-path propagation |
5613 // Return non-false to allow normal event-path propagation |
5918 return true; |
5614 return true; |
|
5615 }, |
|
5616 |
|
5617 teardown: function() { |
|
5618 var attaches; |
|
5619 |
|
5620 if ( document.documentMode ) { |
|
5621 attaches = dataPriv.get( this, delegateType ) - 1; |
|
5622 if ( !attaches ) { |
|
5623 this.removeEventListener( delegateType, focusMappedHandler ); |
|
5624 dataPriv.remove( this, delegateType ); |
|
5625 } else { |
|
5626 dataPriv.set( this, delegateType, attaches ); |
|
5627 } |
|
5628 } else { |
|
5629 |
|
5630 // Return false to indicate standard teardown should be applied |
|
5631 return false; |
|
5632 } |
5919 }, |
5633 }, |
5920 |
5634 |
5921 // Suppress native focus or blur if we're currently inside |
5635 // Suppress native focus or blur if we're currently inside |
5922 // a leveraged native-event stack |
5636 // a leveraged native-event stack |
5923 _default: function( event ) { |
5637 _default: function( event ) { |
5924 return dataPriv.get( event.target, type ); |
5638 return dataPriv.get( event.target, type ); |
5925 }, |
5639 }, |
5926 |
5640 |
5927 delegateType: delegateType |
5641 delegateType: delegateType |
|
5642 }; |
|
5643 |
|
5644 // Support: Firefox <=44 |
|
5645 // Firefox doesn't have focus(in | out) events |
|
5646 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 |
|
5647 // |
|
5648 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 |
|
5649 // focus(in | out) events fire after focus & blur events, |
|
5650 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order |
|
5651 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 |
|
5652 // |
|
5653 // Support: IE 9 - 11+ |
|
5654 // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, |
|
5655 // attach a single handler for both events in IE. |
|
5656 jQuery.event.special[ delegateType ] = { |
|
5657 setup: function() { |
|
5658 |
|
5659 // Handle: regular nodes (via `this.ownerDocument`), window |
|
5660 // (via `this.document`) & document (via `this`). |
|
5661 var doc = this.ownerDocument || this.document || this, |
|
5662 dataHolder = document.documentMode ? this : doc, |
|
5663 attaches = dataPriv.get( dataHolder, delegateType ); |
|
5664 |
|
5665 // Support: IE 9 - 11+ |
|
5666 // We use the same native handler for focusin & focus (and focusout & blur) |
|
5667 // so we need to coordinate setup & teardown parts between those events. |
|
5668 // Use `delegateType` as the key as `type` is already used by `leverageNative`. |
|
5669 if ( !attaches ) { |
|
5670 if ( document.documentMode ) { |
|
5671 this.addEventListener( delegateType, focusMappedHandler ); |
|
5672 } else { |
|
5673 doc.addEventListener( type, focusMappedHandler, true ); |
|
5674 } |
|
5675 } |
|
5676 dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); |
|
5677 }, |
|
5678 teardown: function() { |
|
5679 var doc = this.ownerDocument || this.document || this, |
|
5680 dataHolder = document.documentMode ? this : doc, |
|
5681 attaches = dataPriv.get( dataHolder, delegateType ) - 1; |
|
5682 |
|
5683 if ( !attaches ) { |
|
5684 if ( document.documentMode ) { |
|
5685 this.removeEventListener( delegateType, focusMappedHandler ); |
|
5686 } else { |
|
5687 doc.removeEventListener( type, focusMappedHandler, true ); |
|
5688 } |
|
5689 dataPriv.remove( dataHolder, delegateType ); |
|
5690 } else { |
|
5691 dataPriv.set( dataHolder, delegateType, attaches ); |
|
5692 } |
|
5693 } |
5928 }; |
5694 }; |
5929 } ); |
5695 } ); |
5930 |
5696 |
5931 // Create mouseenter/leave events using mouseover/out and event-time checks |
5697 // Create mouseenter/leave events using mouseover/out and event-time checks |
5932 // so that event delegation works in jQuery. |
5698 // so that event delegation works in jQuery. |
8912 if ( elem ) { |
8712 if ( elem ) { |
8913 return jQuery.event.trigger( type, data, elem, true ); |
8713 return jQuery.event.trigger( type, data, elem, true ); |
8914 } |
8714 } |
8915 } |
8715 } |
8916 } ); |
8716 } ); |
8917 |
|
8918 |
|
8919 // Support: Firefox <=44 |
|
8920 // Firefox doesn't have focus(in | out) events |
|
8921 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 |
|
8922 // |
|
8923 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 |
|
8924 // focus(in | out) events fire after focus & blur events, |
|
8925 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order |
|
8926 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 |
|
8927 if ( !support.focusin ) { |
|
8928 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { |
|
8929 |
|
8930 // Attach a single capturing handler on the document while someone wants focusin/focusout |
|
8931 var handler = function( event ) { |
|
8932 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); |
|
8933 }; |
|
8934 |
|
8935 jQuery.event.special[ fix ] = { |
|
8936 setup: function() { |
|
8937 |
|
8938 // Handle: regular nodes (via `this.ownerDocument`), window |
|
8939 // (via `this.document`) & document (via `this`). |
|
8940 var doc = this.ownerDocument || this.document || this, |
|
8941 attaches = dataPriv.access( doc, fix ); |
|
8942 |
|
8943 if ( !attaches ) { |
|
8944 doc.addEventListener( orig, handler, true ); |
|
8945 } |
|
8946 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); |
|
8947 }, |
|
8948 teardown: function() { |
|
8949 var doc = this.ownerDocument || this.document || this, |
|
8950 attaches = dataPriv.access( doc, fix ) - 1; |
|
8951 |
|
8952 if ( !attaches ) { |
|
8953 doc.removeEventListener( orig, handler, true ); |
|
8954 dataPriv.remove( doc, fix ); |
|
8955 |
|
8956 } else { |
|
8957 dataPriv.access( doc, fix, attaches ); |
|
8958 } |
|
8959 } |
|
8960 }; |
|
8961 } ); |
|
8962 } |
|
8963 var location = window.location; |
|
8964 |
|
8965 var nonce = { guid: Date.now() }; |
|
8966 |
|
8967 var rquery = ( /\?/ ); |
|
8968 |
|
8969 |
|
8970 |
|
8971 // Cross-browser xml parsing |
|
8972 jQuery.parseXML = function( data ) { |
|
8973 var xml, parserErrorElem; |
|
8974 if ( !data || typeof data !== "string" ) { |
|
8975 return null; |
|
8976 } |
|
8977 |
|
8978 // Support: IE 9 - 11 only |
|
8979 // IE throws on parseFromString with invalid input. |
|
8980 try { |
|
8981 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); |
|
8982 } catch ( e ) {} |
|
8983 |
|
8984 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; |
|
8985 if ( !xml || parserErrorElem ) { |
|
8986 jQuery.error( "Invalid XML: " + ( |
|
8987 parserErrorElem ? |
|
8988 jQuery.map( parserErrorElem.childNodes, function( el ) { |
|
8989 return el.textContent; |
|
8990 } ).join( "\n" ) : |
|
8991 data |
|
8992 ) ); |
|
8993 } |
|
8994 return xml; |
|
8995 }; |
|
8996 |
8717 |
8997 |
8718 |
8998 var |
8719 var |
8999 rbracket = /\[\]$/, |
8720 rbracket = /\[\]$/, |
9000 rCRLF = /\r?\n/g, |
8721 rCRLF = /\r?\n/g, |