vendor: 257,553 bytes, lines 1-9816
1 2/*! 3 * jQuery JavaScript Library v2.2.4 4 * http://jquery.com/ 5 * 6 * Includes Sizzle.js 7 * http://sizzlejs.com/ 8 * 9 * Copyright jQuery Foundation and other contributors 10 * Released under the MIT license 11 * http://jquery.org/license 12 * 13 * Date: 2016-05-20T17:23Z 14 */ 15 16(function( global, factory ) { 17 18 if ( typeof module === "object" && typeof module.exports === "object" ) { 19 // For CommonJS and CommonJS-like environments where a proper `window` 20 // is present, execute the factory and get jQuery. 21 // For environments that do not have a `window` with a `document` 22 // (such as Node.js), expose a factory as module.exports. 23 // This accentuates the need for the creation of a real `window`. 24 // e.g. var jQuery = require("jquery")(window); 25 // See ticket #14549 for more info. 26 module.exports = global.document ? 27 factory( global, true ) : 28 function( w ) { 29 if ( !w.document ) { 30 throw new Error( "jQuery requires a window with a document" ); 31 } 32 return factory( w ); 33 }; 34 } else { 35 factory( global ); 36 } 37 38// Pass this if window is not defined yet 39}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 40 41// Support: Firefox 18+ 42// Can't be in strict mode, several libs including ASP.NET trace 43// the stack via arguments.caller.callee and Firefox dies if 44// you try to trace through "use strict" call chains. (#13335) 45//"use strict"; 46var arr = []; 47 48var document = window.document; 49 50var slice = arr.slice; 51 52var concat = arr.concat; 53 54var push = arr.push; 55 56var indexOf = arr.indexOf; 57 58var class2type = {}; 59 60var toString = class2type.toString; 61 62var hasOwn = class2type.hasOwnProperty; 63 64var support = {}; 65 66 67 68var 69 version = "2.2.4", 70 71 // Define a local copy of jQuery 72 jQuery = function( selector, context ) { 73 74 // The jQuery object is actually just the init constructor 'enhanced' 75 // Need init if jQuery is called (just allow error to be thrown if not included) 76 return new jQuery.fn.init( selector, context ); 77 }, 78 79 // Support: Android<4.1 80 // Make sure we trim BOM and NBSP 81 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 82 83 // Matches dashed string for camelizing 84 rmsPrefix = /^-ms-/, 85 rdashAlpha = /-([\da-z])/gi, 86 87 // Used by jQuery.camelCase as callback to replace() 88 fcamelCase = function( all, letter ) { 89 return letter.toUpperCase(); 90 }; 91 92jQuery.fn = jQuery.prototype = { 93 94 // The current version of jQuery being used 95 jquery: version, 96 97 constructor: jQuery, 98 99 // Start with an empty selector 100 selector: "", 101 102 // The default length of a jQuery object is 0 103 length: 0, 104 105 toArray: function() { 106 return slice.call( this ); 107 }, 108 109 // Get the Nth element in the matched element set OR 110 // Get the whole matched element set as a clean array 111 get: function( num ) { 112 return num != null ? 113 114 // Return just the one element from the set 115 ( num < 0 ? this[ num + this.length ] : this[ num ] ) : 116 117 // Return all the elements in a clean array 118 slice.call( this ); 119 }, 120 121 // Take an array of elements and push it onto the stack 122 // (returning the new matched element set) 123 pushStack: function( elems ) { 124 125 // Build a new jQuery matched element set 126 var ret = jQuery.merge( this.constructor(), elems ); 127 128 // Add the old object onto the stack (as a reference) 129 ret.prevObject = this; 130 ret.context = this.context; 131 132 // Return the newly-formed element set 133 return ret; 134 }, 135 136 // Execute a callback for every element in the matched set. 137 each: function( callback ) { 138 return jQuery.each( this, callback ); 139 }, 140 141 map: function( callback ) { 142 return this.pushStack( jQuery.map( this, function( elem, i ) { 143 return callback.call( elem, i, elem ); 144 } ) ); 145 }, 146 147 slice: function() { 148 return this.pushStack( slice.apply( this, arguments ) ); 149 }, 150 151 first: function() { 152 return this.eq( 0 ); 153 }, 154 155 last: function() { 156 return this.eq( -1 ); 157 }, 158 159 eq: function( i ) { 160 var len = this.length, 161 j = +i + ( i < 0 ? len : 0 ); 162 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 163 }, 164 165 end: function() { 166 return this.prevObject || this.constructor(); 167 }, 168 169 // For internal use only. 170 // Behaves like an Array's method, not like a jQuery method. 171 push: push, 172 sort: arr.sort, 173 splice: arr.splice 174}; 175 176jQuery.extend = jQuery.fn.extend = function() { 177 var options, name, src, copy, copyIsArray, clone, 178 target = arguments[ 0 ] || {}, 179 i = 1, 180 length = arguments.length, 181 deep = false; 182 183 // Handle a deep copy situation 184 if ( typeof target === "boolean" ) { 185 deep = target; 186 187 // Skip the boolean and the target 188 target = arguments[ i ] || {}; 189 i++; 190 } 191 192 // Handle case when target is a string or something (possible in deep copy) 193 if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { 194 target = {}; 195 } 196 197 // Extend jQuery itself if only one argument is passed 198 if ( i === length ) { 199 target = this; 200 i--; 201 } 202 203 for ( ; i < length; i++ ) { 204 205 // Only deal with non-null/undefined values 206 if ( ( options = arguments[ i ] ) != null ) { 207 208 // Extend the base object 209 for ( name in options ) { 210 src = target[ name ]; 211 copy = options[ name ]; 212 213 // Prevent never-ending loop 214 if ( target === copy ) { 215 continue; 216 } 217 218 // Recurse if we're merging plain objects or arrays 219 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 220 ( copyIsArray = jQuery.isArray( copy ) ) ) ) { 221 222 if ( copyIsArray ) { 223 copyIsArray = false; 224 clone = src && jQuery.isArray( src ) ? src : []; 225 226 } else { 227 clone = src && jQuery.isPlainObject( src ) ? src : {}; 228 } 229 230 // Never move original objects, clone them 231 target[ name ] = jQuery.extend( deep, clone, copy ); 232 233 // Don't bring in undefined values 234 } else if ( copy !== undefined ) { 235 target[ name ] = copy; 236 } 237 } 238 } 239 } 240 241 // Return the modified object 242 return target; 243}; 244 245jQuery.extend( { 246 247 // Unique for each copy of jQuery on the page 248 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 249 250 // Assume jQuery is ready without the ready module 251 isReady: true, 252 253 error: function( msg ) { 254 throw new Error( msg ); 255 }, 256 257 noop: function() {}, 258 259 isFunction: function( obj ) { 260 return jQuery.type( obj ) === "function"; 261 }, 262 263 isArray: Array.isArray, 264 265 isWindow: function( obj ) { 266 return obj != null && obj === obj.window; 267 }, 268 269 isNumeric: function( obj ) { 270 271 // parseFloat NaNs numeric-cast false positives (null|true|false|"") 272 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 273 // subtraction forces infinities to NaN 274 // adding 1 corrects loss of precision from parseFloat (#15100) 275 var realStringObj = obj && obj.toString(); 276 return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; 277 }, 278 279 isPlainObject: function( obj ) { 280 var key; 281 282 // Not plain objects: 283 // - Any object or value whose internal [[Class]] property is not "[object Object]" 284 // - DOM nodes 285 // - window 286 if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 287 return false; 288 } 289 290 // Not own constructor property must be Object 291 if ( obj.constructor && 292 !hasOwn.call( obj, "constructor" ) && 293 !hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) { 294 return false; 295 } 296 297 // Own properties are enumerated firstly, so to speed up, 298 // if last one is own, then all properties are own 299 for ( key in obj ) {} 300 301 return key === undefined || hasOwn.call( obj, key ); 302 }, 303 304 isEmptyObject: function( obj ) { 305 var name; 306 for ( name in obj ) { 307 return false; 308 } 309 return true; 310 }, 311 312 type: function( obj ) { 313 if ( obj == null ) { 314 return obj + ""; 315 } 316 317 // Support: Android<4.0, iOS<6 (functionish RegExp) 318 return typeof obj === "object" || typeof obj === "function" ? 319 class2type[ toString.call( obj ) ] || "object" : 320 typeof obj; 321 }, 322 323 // Evaluates a script in a global context 324 globalEval: function( code ) { 325 var script, 326 indirect = eval; 327 328 code = jQuery.trim( code ); 329 330 if ( code ) { 331 332 // If the code includes a valid, prologue position 333 // strict mode pragma, execute code by injecting a 334 // script tag into the document. 335 if ( code.indexOf( "use strict" ) === 1 ) { 336 script = document.createElement( "script" ); 337 script.text = code; 338 document.head.appendChild( script ).parentNode.removeChild( script ); 339 } else { 340 341 // Otherwise, avoid the DOM node creation, insertion 342 // and removal by using an indirect global eval 343 344 indirect( code ); 345 } 346 } 347 }, 348 349 // Convert dashed to camelCase; used by the css and data modules 350 // Support: IE9-11+ 351 // Microsoft forgot to hump their vendor prefix (#9572) 352 camelCase: function( string ) { 353 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 354 }, 355 356 nodeName: function( elem, name ) { 357 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 358 }, 359 360 each: function( obj, callback ) { 361 var length, i = 0; 362 363 if ( isArrayLike( obj ) ) { 364 length = obj.length; 365 for ( ; i < length; i++ ) { 366 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 367 break; 368 } 369 } 370 } else { 371 for ( i in obj ) { 372 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 373 break; 374 } 375 } 376 } 377 378 return obj; 379 }, 380 381 // Support: Android<4.1 382 trim: function( text ) { 383 return text == null ? 384 "" : 385 ( text + "" ).replace( rtrim, "" ); 386 }, 387 388 // results is for internal usage only 389 makeArray: function( arr, results ) { 390 var ret = results || []; 391 392 if ( arr != null ) { 393 if ( isArrayLike( Object( arr ) ) ) { 394 jQuery.merge( ret, 395 typeof arr === "string" ? 396 [ arr ] : arr 397 ); 398 } else { 399 push.call( ret, arr ); 400 } 401 } 402 403 return ret; 404 }, 405 406 inArray: function( elem, arr, i ) { 407 return arr == null ? -1 : indexOf.call( arr, elem, i ); 408 }, 409 410 merge: function( first, second ) { 411 var len = +second.length, 412 j = 0, 413 i = first.length; 414 415 for ( ; j < len; j++ ) { 416 first[ i++ ] = second[ j ]; 417 } 418 419 first.length = i; 420 421 return first; 422 }, 423 424 grep: function( elems, callback, invert ) { 425 var callbackInverse, 426 matches = [], 427 i = 0, 428 length = elems.length, 429 callbackExpect = !invert; 430 431 // Go through the array, only saving the items 432 // that pass the validator function 433 for ( ; i < length; i++ ) { 434 callbackInverse = !callback( elems[ i ], i ); 435 if ( callbackInverse !== callbackExpect ) { 436 matches.push( elems[ i ] ); 437 } 438 } 439 440 return matches; 441 }, 442 443 // arg is for internal usage only 444 map: function( elems, callback, arg ) { 445 var length, value, 446 i = 0, 447 ret = []; 448 449 // Go through the array, translating each of the items to their new values 450 if ( isArrayLike( elems ) ) { 451 length = elems.length; 452 for ( ; i < length; i++ ) { 453 value = callback( elems[ i ], i, arg ); 454 455 if ( value != null ) { 456 ret.push( value ); 457 } 458 } 459 460 // Go through every key on the object, 461 } else { 462 for ( i in elems ) { 463 value = callback( elems[ i ], i, arg ); 464 465 if ( value != null ) { 466 ret.push( value ); 467 } 468 } 469 } 470 471 // Flatten any nested arrays 472 return concat.apply( [], ret ); 473 }, 474 475 // A global GUID counter for objects 476 guid: 1, 477 478 // Bind a function to a context, optionally partially applying any 479 // arguments. 480 proxy: function( fn, context ) { 481 var tmp, args, proxy; 482 483 if ( typeof context === "string" ) { 484 tmp = fn[ context ]; 485 context = fn; 486 fn = tmp; 487 } 488 489 // Quick check to determine if target is callable, in the spec 490 // this throws a TypeError, but we will just return undefined. 491 if ( !jQuery.isFunction( fn ) ) { 492 return undefined; 493 } 494 495 // Simulated bind 496 args = slice.call( arguments, 2 ); 497 proxy = function() { 498 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 499 }; 500 501 // Set the guid of unique handler to the same of original handler, so it can be removed 502 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 503 504 return proxy; 505 }, 506 507 now: Date.now, 508 509 // jQuery.support is not used in Core but other projects attach their 510 // properties to it so it needs to exist. 511 support: support 512} ); 513 514// JSHint would error on this code due to the Symbol not being defined in ES5. 515// Defining this global in .jshintrc would create a danger of using the global 516// unguarded in another place, it seems safer to just disable JSHint for these 517// three lines. 518/* jshint ignore: start */ 519if ( typeof Symbol === "function" ) { 520 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 521} 522/* jshint ignore: end */ 523 524// Populate the class2type map 525jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 526function( i, name ) { 527 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 528} ); 529 530function isArrayLike( obj ) { 531 532 // Support: iOS 8.2 (not reproducible in simulator) 533 // `in` check used to prevent JIT error (gh-2145) 534 // hasOwn isn't used here due to false negatives 535 // regarding Nodelist length in IE 536 var length = !!obj && "length" in obj && obj.length, 537 type = jQuery.type( obj ); 538 539 if ( type === "function" || jQuery.isWindow( obj ) ) { 540 return false; 541 } 542 543 return type === "array" || length === 0 || 544 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 545} 546var Sizzle = 547/*! 548 * Sizzle CSS Selector Engine v2.2.1 549 * http://sizzlejs.com/ 550 * 551 * Copyright jQuery Foundation and other contributors 552 * Released under the MIT license 553 * http://jquery.org/license 554 * 555 * Date: 2015-10-17 556 */ 557(function( window ) { 558 559var i, 560 support, 561 Expr, 562 getText, 563 isXML, 564 tokenize, 565 compile, 566 select, 567 outermostContext, 568 sortInput, 569 hasDuplicate, 570 571 // Local document vars 572 setDocument, 573 document, 574 docElem, 575 documentIsHTML, 576 rbuggyQSA, 577 rbuggyMatches, 578 matches, 579 contains, 580 581 // Instance-specific data 582 expando = "sizzle" + 1 * new Date(), 583 preferredDoc = window.document, 584 dirruns = 0, 585 done = 0, 586 classCache = createCache(), 587 tokenCache = createCache(), 588 compilerCache = createCache(), 589 sortOrder = function( a, b ) { 590 if ( a === b ) { 591 hasDuplicate = true; 592 } 593 return 0; 594 }, 595 596 // General-purpose constants 597 MAX_NEGATIVE = 1 << 31, 598 599 // Instance methods 600 hasOwn = ({}).hasOwnProperty, 601 arr = [], 602 pop = arr.pop, 603 push_native = arr.push, 604 push = arr.push, 605 slice = arr.slice, 606 // Use a stripped-down indexOf as it's faster than native 607 // http://jsperf.com/thor-indexof-vs-for/5 608 indexOf = function( list, elem ) { 609 var i = 0, 610 len = list.length; 611 for ( ; i < len; i++ ) { 612 if ( list[i] === elem ) { 613 return i; 614 } 615 } 616 return -1; 617 }, 618 619 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 620 621 // Regular expressions 622 623 // http://www.w3.org/TR/css3-selectors/#whitespace 624 whitespace = "[\\x20\\t\\r\\n\\f]", 625 626 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 627 identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 628 629 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 630 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 631 // Operator (capture 2) 632 "*([*^$|!~]?=)" + whitespace + 633 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 634 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 635 "*\\]", 636 637 pseudos = ":(" + identifier + ")(?:\\((" + 638 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 639 // 1. quoted (capture 3; capture 4 or capture 5) 640 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 641 // 2. simple (capture 6) 642 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 643 // 3. anything else (capture 2) 644 ".*" + 645 ")\\)|)", 646 647 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 648 rwhitespace = new RegExp( whitespace + "+", "g" ), 649 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 650 651 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 652 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 653 654 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), 655 656 rpseudo = new RegExp( pseudos ), 657 ridentifier = new RegExp( "^" + identifier + "$" ), 658 659 matchExpr = { 660 "ID": new RegExp( "^#(" + identifier + ")" ), 661 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 662 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 663 "ATTR": new RegExp( "^" + attributes ), 664 "PSEUDO": new RegExp( "^" + pseudos ), 665 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 666 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 667 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 668 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 669 // For use in libraries implementing .is() 670 // We use this for POS matching in `select` 671 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 672 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 673 }, 674 675 rinputs = /^(?:input|select|textarea|button)$/i, 676 rheader = /^h\d$/i, 677 678 rnative = /^[^{]+\{\s*\[native \w/, 679 680 // Easily-parseable/retrievable ID or TAG or CLASS selectors 681 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 682 683 rsibling = /[+~]/, 684 rescape = /'|\\/g, 685 686 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 687 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 688 funescape = function( _, escaped, escapedWhitespace ) { 689 var high = "0x" + escaped - 0x10000; 690 // NaN means non-codepoint 691 // Support: Firefox<24 692 // Workaround erroneous numeric interpretation of +"0x" 693 return high !== high || escapedWhitespace ? 694 escaped : 695 high < 0 ? 696 // BMP codepoint 697 String.fromCharCode( high + 0x10000 ) : 698 // Supplemental Plane codepoint (surrogate pair) 699 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 700 }, 701 702 // Used for iframes 703 // See setDocument() 704 // Removing the function wrapper causes a "Permission Denied" 705 // error in IE 706 unloadHandler = function() { 707 setDocument(); 708 }; 709 710// Optimize for push.apply( _, NodeList ) 711try { 712 push.apply( 713 (arr = slice.call( preferredDoc.childNodes )), 714 preferredDoc.childNodes 715 ); 716 // Support: Android<4.0 717 // Detect silently failing push.apply 718 arr[ preferredDoc.childNodes.length ].nodeType; 719} catch ( e ) { 720 push = { apply: arr.length ? 721 722 // Leverage slice if possible 723 function( target, els ) { 724 push_native.apply( target, slice.call(els) ); 725 } : 726 727 // Support: IE<9 728 // Otherwise append directly 729 function( target, els ) { 730 var j = target.length, 731 i = 0; 732 // Can't trust NodeList.length 733 while ( (target[j++] = els[i++]) ) {} 734 target.length = j - 1; 735 } 736 }; 737} 738 739function Sizzle( selector, context, results, seed ) { 740 var m, i, elem, nid, nidselect, match, groups, newSelector, 741 newContext = context && context.ownerDocument, 742 743 // nodeType defaults to 9, since context defaults to document 744 nodeType = context ? context.nodeType : 9; 745 746 results = results || []; 747 748 // Return early from calls with invalid selector or context 749 if ( typeof selector !== "string" || !selector || 750 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 751 752 return results; 753 } 754 755 // Try to shortcut find operations (as opposed to filters) in HTML documents 756 if ( !seed ) { 757 758 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 759 setDocument( context ); 760 } 761 context = context || document; 762 763 if ( documentIsHTML ) { 764 765 // If the selector is sufficiently simple, try using a "get*By*" DOM method 766 // (excepting DocumentFragment context, where the methods don't exist) 767 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 768 769 // ID selector 770 if ( (m = match[1]) ) { 771 772 // Document context 773 if ( nodeType === 9 ) { 774 if ( (elem = context.getElementById( m )) ) { 775 776 // Support: IE, Opera, Webkit 777 // TODO: identify versions 778 // getElementById can match elements by name instead of ID 779 if ( elem.id === m ) { 780 results.push( elem ); 781 return results; 782 } 783 } else { 784 return results; 785 } 786 787 // Element context 788 } else { 789 790 // Support: IE, Opera, Webkit 791 // TODO: identify versions 792 // getElementById can match elements by name instead of ID 793 if ( newContext && (elem = newContext.getElementById( m )) && 794 contains( context, elem ) && 795 elem.id === m ) { 796 797 results.push( elem ); 798 return results; 799 } 800 } 801 802 // Type selector 803 } else if ( match[2] ) { 804 push.apply( results, context.getElementsByTagName( selector ) ); 805 return results; 806 807 // Class selector 808 } else if ( (m = match[3]) && support.getElementsByClassName && 809 context.getElementsByClassName ) { 810 811 push.apply( results, context.getElementsByClassName( m ) ); 812 return results; 813 } 814 } 815 816 // Take advantage of querySelectorAll 817 if ( support.qsa && 818 !compilerCache[ selector + " " ] && 819 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { 820 821 if ( nodeType !== 1 ) { 822 newContext = context; 823 newSelector = selector; 824 825 // qSA looks outside Element context, which is not what we want 826 // Thanks to Andrew Dupont for this workaround technique 827 // Support: IE <=8 828 // Exclude object elements 829 } else if ( context.nodeName.toLowerCase() !== "object" ) { 830 831 // Capture the context ID, setting it first if necessary 832 if ( (nid = context.getAttribute( "id" )) ) { 833 nid = nid.replace( rescape, "\\$&" ); 834 } else { 835 context.setAttribute( "id", (nid = expando) ); 836 } 837 838 // Prefix every selector in the list 839 groups = tokenize( selector ); 840 i = groups.length; 841 nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; 842 while ( i-- ) { 843 groups[i] = nidselect + " " + toSelector( groups[i] ); 844 } 845 newSelector = groups.join( "," ); 846 847 // Expand context for sibling selectors 848 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 849 context; 850 } 851 852 if ( newSelector ) { 853 try { 854 push.apply( results, 855 newContext.querySelectorAll( newSelector ) 856 ); 857 return results; 858 } catch ( qsaError ) { 859 } finally { 860 if ( nid === expando ) { 861 context.removeAttribute( "id" ); 862 } 863 } 864 } 865 } 866 } 867 } 868 869 // All others 870 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 871} 872 873/** 874 * Create key-value caches of limited size 875 * @returns {function(string, object)} Returns the Object data after storing it on itself with 876 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 877 * deleting the oldest entry 878 */ 879function createCache() { 880 var keys = []; 881 882 function cache( key, value ) { 883 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 884 if ( keys.push( key + " " ) > Expr.cacheLength ) { 885 // Only keep the most recent entries 886 delete cache[ keys.shift() ]; 887 } 888 return (cache[ key + " " ] = value); 889 } 890 return cache; 891} 892 893/** 894 * Mark a function for special use by Sizzle 895 * @param {Function} fn The function to mark 896 */ 897function markFunction( fn ) { 898 fn[ expando ] = true; 899 return fn; 900} 901 902/** 903 * Support testing using an element 904 * @param {Function} fn Passed the created div and expects a boolean result 905 */ 906function assert( fn ) { 907 var div = document.createElement("div"); 908 909 try { 910 return !!fn( div ); 911 } catch (e) { 912 return false; 913 } finally { 914 // Remove from its parent by default 915 if ( div.parentNode ) { 916 div.parentNode.removeChild( div ); 917 } 918 // release memory in IE 919 div = null; 920 } 921} 922 923/** 924 * Adds the same handler for all of the specified attrs 925 * @param {String} attrs Pipe-separated list of attributes 926 * @param {Function} handler The method that will be applied 927 */ 928function addHandle( attrs, handler ) { 929 var arr = attrs.split("|"), 930 i = arr.length; 931 932 while ( i-- ) { 933 Expr.attrHandle[ arr[i] ] = handler; 934 } 935} 936 937/** 938 * Checks document order of two siblings 939 * @param {Element} a 940 * @param {Element} b 941 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 942 */ 943function siblingCheck( a, b ) { 944 var cur = b && a, 945 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 946 ( ~b.sourceIndex || MAX_NEGATIVE ) - 947 ( ~a.sourceIndex || MAX_NEGATIVE ); 948 949 // Use IE sourceIndex if available on both nodes 950 if ( diff ) { 951 return diff; 952 } 953 954 // Check if b follows a 955 if ( cur ) { 956 while ( (cur = cur.nextSibling) ) { 957 if ( cur === b ) { 958 return -1; 959 } 960 } 961 } 962 963 return a ? 1 : -1; 964} 965 966/** 967 * Returns a function to use in pseudos for input types 968 * @param {String} type 969 */ 970function createInputPseudo( type ) { 971 return function( elem ) { 972 var name = elem.nodeName.toLowerCase(); 973 return name === "input" && elem.type === type; 974 }; 975} 976 977/** 978 * Returns a function to use in pseudos for buttons 979 * @param {String} type 980 */ 981function createButtonPseudo( type ) { 982 return function( elem ) { 983 var name = elem.nodeName.toLowerCase(); 984 return (name === "input" || name === "button") && elem.type === type; 985 }; 986} 987 988/** 989 * Returns a function to use in pseudos for positionals 990 * @param {Function} fn 991 */ 992function createPositionalPseudo( fn ) { 993 return markFunction(function( argument ) { 994 argument = +argument; 995 return markFunction(function( seed, matches ) { 996 var j, 997 matchIndexes = fn( [], seed.length, argument ), 998 i = matchIndexes.length; 999 1000 // Match elements found at the specified indexes 1001 while ( i-- ) { 1002 if ( seed[ (j = matchIndexes[i]) ] ) { 1003 seed[j] = !(matches[j] = seed[j]); 1004 } 1005 } 1006 }); 1007 }); 1008} 1009 1010/** 1011 * Checks a node for validity as a Sizzle context 1012 * @param {Element|Object=} context 1013 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1014 */ 1015function testContext( context ) { 1016 return context && typeof context.getElementsByTagName !== "undefined" && context; 1017} 1018 1019// Expose support vars for convenience 1020support = Sizzle.support = {}; 1021 1022/** 1023 * Detects XML nodes 1024 * @param {Element|Object} elem An element or a document 1025 * @returns {Boolean} True iff elem is a non-HTML XML node 1026 */ 1027isXML = Sizzle.isXML = function( elem ) { 1028 // documentElement is verified for cases where it doesn't yet exist 1029 // (such as loading iframes in IE - #4833) 1030 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 1031 return documentElement ? documentElement.nodeName !== "HTML" : false; 1032}; 1033 1034/** 1035 * Sets document-related variables once based on the current document 1036 * @param {Element|Object} [doc] An element or document object to use to set the document 1037 * @returns {Object} Returns the current document 1038 */ 1039setDocument = Sizzle.setDocument = function( node ) { 1040 var hasCompare, parent, 1041 doc = node ? node.ownerDocument || node : preferredDoc; 1042 1043 // Return early if doc is invalid or already selected 1044 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 1045 return document; 1046 } 1047 1048 // Update global variables 1049 document = doc; 1050 docElem = document.documentElement; 1051 documentIsHTML = !isXML( document ); 1052 1053 // Support: IE 9-11, Edge 1054 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 1055 if ( (parent = document.defaultView) && parent.top !== parent ) { 1056 // Support: IE 11 1057 if ( parent.addEventListener ) { 1058 parent.addEventListener( "unload", unloadHandler, false ); 1059 1060 // Support: IE 9 - 10 only 1061 } else if ( parent.attachEvent ) { 1062 parent.attachEvent( "onunload", unloadHandler ); 1063 } 1064 } 1065 1066 /* Attributes 1067 ---------------------------------------------------------------------- */ 1068 1069 // Support: IE<8 1070 // Verify that getAttribute really returns attributes and not properties 1071 // (excepting IE8 booleans) 1072 support.attributes = assert(function( div ) { 1073 div.className = "i"; 1074 return !div.getAttribute("className"); 1075 }); 1076 1077 /* getElement(s)By* 1078 ---------------------------------------------------------------------- */ 1079 1080 // Check if getElementsByTagName("*") returns only elements 1081 support.getElementsByTagName = assert(function( div ) { 1082 div.appendChild( document.createComment("") ); 1083 return !div.getElementsByTagName("*").length; 1084 }); 1085 1086 // Support: IE<9 1087 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 1088 1089 // Support: IE<10 1090 // Check if getElementById returns elements by name 1091 // The broken getElementById methods don't pick up programatically-set names, 1092 // so use a roundabout getElementsByName test 1093 support.getById = assert(function( div ) { 1094 docElem.appendChild( div ).id = expando; 1095 return !document.getElementsByName || !document.getElementsByName( expando ).length; 1096 }); 1097 1098 // ID find and filter 1099 if ( support.getById ) { 1100 Expr.find["ID"] = function( id, context ) { 1101 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1102 var m = context.getElementById( id ); 1103 return m ? [ m ] : []; 1104 } 1105 }; 1106 Expr.filter["ID"] = function( id ) { 1107 var attrId = id.replace( runescape, funescape ); 1108 return function( elem ) { 1109 return elem.getAttribute("id") === attrId; 1110 }; 1111 }; 1112 } else { 1113 // Support: IE6/7 1114 // getElementById is not reliable as a find shortcut 1115 delete Expr.find["ID"]; 1116 1117 Expr.filter["ID"] = function( id ) { 1118 var attrId = id.replace( runescape, funescape ); 1119 return function( elem ) { 1120 var node = typeof elem.getAttributeNode !== "undefined" && 1121 elem.getAttributeNode("id"); 1122 return node && node.value === attrId; 1123 }; 1124 }; 1125 } 1126 1127 // Tag 1128 Expr.find["TAG"] = support.getElementsByTagName ? 1129 function( tag, context ) { 1130 if ( typeof context.getElementsByTagName !== "undefined" ) { 1131 return context.getElementsByTagName( tag ); 1132 1133 // DocumentFragment nodes don't have gEBTN 1134 } else if ( support.qsa ) { 1135 return context.querySelectorAll( tag ); 1136 } 1137 } : 1138 1139 function( tag, context ) { 1140 var elem, 1141 tmp = [], 1142 i = 0, 1143 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 1144 results = context.getElementsByTagName( tag ); 1145 1146 // Filter out possible comments 1147 if ( tag === "*" ) { 1148 while ( (elem = results[i++]) ) { 1149 if ( elem.nodeType === 1 ) { 1150 tmp.push( elem ); 1151 } 1152 } 1153 1154 return tmp; 1155 } 1156 return results; 1157 }; 1158 1159 // Class 1160 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 1161 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 1162 return context.getElementsByClassName( className ); 1163 } 1164 }; 1165 1166 /* QSA/matchesSelector 1167 ---------------------------------------------------------------------- */ 1168 1169 // QSA and matchesSelector support 1170 1171 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 1172 rbuggyMatches = []; 1173 1174 // qSa(:focus) reports false when true (Chrome 21) 1175 // We allow this because of a bug in IE8/9 that throws an error 1176 // whenever `document.activeElement` is accessed on an iframe 1177 // So, we allow :focus to pass through QSA all the time to avoid the IE error 1178 // See http://bugs.jquery.com/ticket/13378 1179 rbuggyQSA = []; 1180 1181 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { 1182 // Build QSA regex 1183 // Regex strategy adopted from Diego Perini 1184 assert(function( div ) { 1185 // Select is set to empty string on purpose 1186 // This is to test IE's treatment of not explicitly 1187 // setting a boolean content attribute, 1188 // since its presence should be enough 1189 // http://bugs.jquery.com/ticket/12359 1190 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + 1191 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 1192 "<option selected=''></option></select>"; 1193 1194 // Support: IE8, Opera 11-12.16 1195 // Nothing should be selected when empty strings follow ^= or $= or *= 1196 // The test attribute must be unknown in Opera but "safe" for WinRT 1197 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 1198 if ( div.querySelectorAll("[msallowcapture^='']").length ) { 1199 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 1200 } 1201 1202 // Support: IE8 1203 // Boolean attributes and "value" are not treated correctly 1204 if ( !div.querySelectorAll("[selected]").length ) { 1205 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 1206 } 1207 1208 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 1209 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 1210 rbuggyQSA.push("~="); 1211 } 1212 1213 // Webkit/Opera - :checked should return selected option elements 1214 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1215 // IE8 throws error here and will not see later tests 1216 if ( !div.querySelectorAll(":checked").length ) { 1217 rbuggyQSA.push(":checked"); 1218 } 1219 1220 // Support: Safari 8+, iOS 8+ 1221 // https://bugs.webkit.org/show_bug.cgi?id=136851 1222 // In-page `selector#id sibing-combinator selector` fails 1223 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { 1224 rbuggyQSA.push(".#.+[+~]"); 1225 } 1226 }); 1227 1228 assert(function( div ) { 1229 // Support: Windows 8 Native Apps 1230 // The type and name attributes are restricted during .innerHTML assignment 1231 var input = document.createElement("input"); 1232 input.setAttribute( "type", "hidden" ); 1233 div.appendChild( input ).setAttribute( "name", "D" ); 1234 1235 // Support: IE8 1236 // Enforce case-sensitivity of name attribute 1237 if ( div.querySelectorAll("[name=d]").length ) { 1238 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 1239 } 1240 1241 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 1242 // IE8 throws error here and will not see later tests 1243 if ( !div.querySelectorAll(":enabled").length ) { 1244 rbuggyQSA.push( ":enabled", ":disabled" ); 1245 } 1246 1247 // Opera 10-11 does not throw on post-comma invalid pseudos 1248 div.querySelectorAll("*,:x"); 1249 rbuggyQSA.push(",.*:"); 1250 }); 1251 } 1252 1253 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 1254 docElem.webkitMatchesSelector || 1255 docElem.mozMatchesSelector || 1256 docElem.oMatchesSelector || 1257 docElem.msMatchesSelector) )) ) { 1258 1259 assert(function( div ) { 1260 // Check to see if it's possible to do matchesSelector 1261 // on a disconnected node (IE 9) 1262 support.disconnectedMatch = matches.call( div, "div" ); 1263 1264 // This should fail with an exception 1265 // Gecko does not error, returns false instead 1266 matches.call( div, "[s!='']:x" ); 1267 rbuggyMatches.push( "!=", pseudos ); 1268 }); 1269 } 1270 1271 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 1272 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 1273 1274 /* Contains 1275 ---------------------------------------------------------------------- */ 1276 hasCompare = rnative.test( docElem.compareDocumentPosition ); 1277 1278 // Element contains another 1279 // Purposefully self-exclusive 1280 // As in, an element does not contain itself 1281 contains = hasCompare || rnative.test( docElem.contains ) ? 1282 function( a, b ) { 1283 var adown = a.nodeType === 9 ? a.documentElement : a, 1284 bup = b && b.parentNode; 1285 return a === bup || !!( bup && bup.nodeType === 1 && ( 1286 adown.contains ? 1287 adown.contains( bup ) : 1288 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 1289 )); 1290 } : 1291 function( a, b ) { 1292 if ( b ) { 1293 while ( (b = b.parentNode) ) { 1294 if ( b === a ) { 1295 return true; 1296 } 1297 } 1298 } 1299 return false; 1300 }; 1301 1302 /* Sorting 1303 ---------------------------------------------------------------------- */ 1304 1305 // Document order sorting 1306 sortOrder = hasCompare ? 1307 function( a, b ) { 1308 1309 // Flag for duplicate removal 1310 if ( a === b ) { 1311 hasDuplicate = true; 1312 return 0; 1313 } 1314 1315 // Sort on method existence if only one input has compareDocumentPosition 1316 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1317 if ( compare ) { 1318 return compare; 1319 } 1320 1321 // Calculate position if both inputs belong to the same document 1322 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 1323 a.compareDocumentPosition( b ) : 1324 1325 // Otherwise we know they are disconnected 1326 1; 1327 1328 // Disconnected nodes 1329 if ( compare & 1 || 1330 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 1331 1332 // Choose the first element that is related to our preferred document 1333 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 1334 return -1; 1335 } 1336 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 1337 return 1; 1338 } 1339 1340 // Maintain original order 1341 return sortInput ? 1342 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1343 0; 1344 } 1345 1346 return compare & 4 ? -1 : 1; 1347 } : 1348 function( a, b ) { 1349 // Exit early if the nodes are identical 1350 if ( a === b ) { 1351 hasDuplicate = true; 1352 return 0; 1353 } 1354 1355 var cur, 1356 i = 0, 1357 aup = a.parentNode, 1358 bup = b.parentNode, 1359 ap = [ a ], 1360 bp = [ b ]; 1361 1362 // Parentless nodes are either documents or disconnected 1363 if ( !aup || !bup ) { 1364 return a === document ? -1 : 1365 b === document ? 1 : 1366 aup ? -1 : 1367 bup ? 1 : 1368 sortInput ? 1369 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1370 0; 1371 1372 // If the nodes are siblings, we can do a quick check 1373 } else if ( aup === bup ) { 1374 return siblingCheck( a, b ); 1375 } 1376 1377 // Otherwise we need full lists of their ancestors for comparison 1378 cur = a; 1379 while ( (cur = cur.parentNode) ) { 1380 ap.unshift( cur ); 1381 } 1382 cur = b; 1383 while ( (cur = cur.parentNode) ) { 1384 bp.unshift( cur ); 1385 } 1386 1387 // Walk down the tree looking for a discrepancy 1388 while ( ap[i] === bp[i] ) { 1389 i++; 1390 } 1391 1392 return i ? 1393 // Do a sibling check if the nodes have a common ancestor 1394 siblingCheck( ap[i], bp[i] ) : 1395 1396 // Otherwise nodes in our document sort first 1397 ap[i] === preferredDoc ? -1 : 1398 bp[i] === preferredDoc ? 1 : 1399 0; 1400 }; 1401 1402 return document; 1403}; 1404 1405Sizzle.matches = function( expr, elements ) { 1406 return Sizzle( expr, null, null, elements ); 1407}; 1408 1409Sizzle.matchesSelector = function( elem, expr ) { 1410 // Set document vars if needed 1411 if ( ( elem.ownerDocument || elem ) !== document ) { 1412 setDocument( elem ); 1413 } 1414 1415 // Make sure that attribute selectors are quoted 1416 expr = expr.replace( rattributeQuotes, "='$1']" ); 1417 1418 if ( support.matchesSelector && documentIsHTML && 1419 !compilerCache[ expr + " " ] && 1420 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 1421 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 1422 1423 try { 1424 var ret = matches.call( elem, expr ); 1425 1426 // IE 9's matchesSelector returns false on disconnected nodes 1427 if ( ret || support.disconnectedMatch || 1428 // As well, disconnected nodes are said to be in a document 1429 // fragment in IE 9 1430 elem.document && elem.document.nodeType !== 11 ) { 1431 return ret; 1432 } 1433 } catch (e) {} 1434 } 1435 1436 return Sizzle( expr, document, null, [ elem ] ).length > 0; 1437}; 1438 1439Sizzle.contains = function( context, elem ) { 1440 // Set document vars if needed 1441 if ( ( context.ownerDocument || context ) !== document ) { 1442 setDocument( context ); 1443 } 1444 return contains( context, elem ); 1445}; 1446 1447Sizzle.attr = function( elem, name ) { 1448 // Set document vars if needed 1449 if ( ( elem.ownerDocument || elem ) !== document ) { 1450 setDocument( elem ); 1451 } 1452 1453 var fn = Expr.attrHandle[ name.toLowerCase() ], 1454 // Don't get fooled by Object.prototype properties (jQuery #13807) 1455 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 1456 fn( elem, name, !documentIsHTML ) : 1457 undefined; 1458 1459 return val !== undefined ? 1460 val : 1461 support.attributes || !documentIsHTML ? 1462 elem.getAttribute( name ) : 1463 (val = elem.getAttributeNode(name)) && val.specified ? 1464 val.value : 1465 null; 1466}; 1467 1468Sizzle.error = function( msg ) { 1469 throw new Error( "Syntax error, unrecognized expression: " + msg ); 1470}; 1471 1472/** 1473 * Document sorting and removing duplicates 1474 * @param {ArrayLike} results 1475 */ 1476Sizzle.uniqueSort = function( results ) { 1477 var elem, 1478 duplicates = [], 1479 j = 0, 1480 i = 0; 1481 1482 // Unless we *know* we can detect duplicates, assume their presence 1483 hasDuplicate = !support.detectDuplicates; 1484 sortInput = !support.sortStable && results.slice( 0 ); 1485 results.sort( sortOrder ); 1486 1487 if ( hasDuplicate ) { 1488 while ( (elem = results[i++]) ) { 1489 if ( elem === results[ i ] ) { 1490 j = duplicates.push( i ); 1491 } 1492 } 1493 while ( j-- ) { 1494 results.splice( duplicates[ j ], 1 ); 1495 } 1496 } 1497 1498 // Clear input after sorting to release objects 1499 // See https://github.com/jquery/sizzle/pull/225 1500 sortInput = null; 1501 1502 return results; 1503}; 1504 1505/** 1506 * Utility function for retrieving the text value of an array of DOM nodes 1507 * @param {Array|Element} elem 1508 */ 1509getText = Sizzle.getText = function( elem ) { 1510 var node, 1511 ret = "", 1512 i = 0, 1513 nodeType = elem.nodeType; 1514 1515 if ( !nodeType ) { 1516 // If no nodeType, this is expected to be an array 1517 while ( (node = elem[i++]) ) { 1518 // Do not traverse comment nodes 1519 ret += getText( node ); 1520 } 1521 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 1522 // Use textContent for elements 1523 // innerText usage removed for consistency of new lines (jQuery #11153) 1524 if ( typeof elem.textContent === "string" ) { 1525 return elem.textContent; 1526 } else { 1527 // Traverse its children 1528 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1529 ret += getText( elem ); 1530 } 1531 } 1532 } else if ( nodeType === 3 || nodeType === 4 ) { 1533 return elem.nodeValue; 1534 } 1535 // Do not include comment or processing instruction nodes 1536 1537 return ret; 1538}; 1539 1540Expr = Sizzle.selectors = { 1541 1542 // Can be adjusted by the user 1543 cacheLength: 50, 1544 1545 createPseudo: markFunction, 1546 1547 match: matchExpr, 1548 1549 attrHandle: {}, 1550 1551 find: {}, 1552 1553 relative: { 1554 ">": { dir: "parentNode", first: true }, 1555 " ": { dir: "parentNode" }, 1556 "+": { dir: "previousSibling", first: true }, 1557 "~": { dir: "previousSibling" } 1558 }, 1559 1560 preFilter: { 1561 "ATTR": function( match ) { 1562 match[1] = match[1].replace( runescape, funescape ); 1563 1564 // Move the given value to match[3] whether quoted or unquoted 1565 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 1566 1567 if ( match[2] === "~=" ) { 1568 match[3] = " " + match[3] + " "; 1569 } 1570 1571 return match.slice( 0, 4 ); 1572 }, 1573 1574 "CHILD": function( match ) { 1575 /* matches from matchExpr["CHILD"] 1576 1 type (only|nth|...) 1577 2 what (child|of-type) 1578 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1579 4 xn-component of xn+y argument ([+-]?\d*n|) 1580 5 sign of xn-component 1581 6 x of xn-component 1582 7 sign of y-component 1583 8 y of y-component 1584 */ 1585 match[1] = match[1].toLowerCase(); 1586 1587 if ( match[1].slice( 0, 3 ) === "nth" ) { 1588 // nth-* requires argument 1589 if ( !match[3] ) { 1590 Sizzle.error( match[0] ); 1591 } 1592 1593 // numeric x and y parameters for Expr.filter.CHILD 1594 // remember that false/true cast respectively to 0/1 1595 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 1596 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 1597 1598 // other types prohibit arguments 1599 } else if ( match[3] ) { 1600 Sizzle.error( match[0] ); 1601 } 1602 1603 return match; 1604 }, 1605 1606 "PSEUDO": function( match ) { 1607 var excess, 1608 unquoted = !match[6] && match[2]; 1609 1610 if ( matchExpr["CHILD"].test( match[0] ) ) { 1611 return null; 1612 } 1613 1614 // Accept quoted arguments as-is 1615 if ( match[3] ) { 1616 match[2] = match[4] || match[5] || ""; 1617 1618 // Strip excess characters from unquoted arguments 1619 } else if ( unquoted && rpseudo.test( unquoted ) && 1620 // Get excess from tokenize (recursively) 1621 (excess = tokenize( unquoted, true )) && 1622 // advance to the next closing parenthesis 1623 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 1624 1625 // excess is a negative index 1626 match[0] = match[0].slice( 0, excess ); 1627 match[2] = unquoted.slice( 0, excess ); 1628 } 1629 1630 // Return only captures needed by the pseudo filter method (type and argument) 1631 return match.slice( 0, 3 ); 1632 } 1633 }, 1634 1635 filter: { 1636 1637 "TAG": function( nodeNameSelector ) { 1638 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 1639 return nodeNameSelector === "*" ? 1640 function() { return true; } : 1641 function( elem ) { 1642 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 1643 }; 1644 }, 1645 1646 "CLASS": function( className ) { 1647 var pattern = classCache[ className + " " ]; 1648 1649 return pattern || 1650 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 1651 classCache( className, function( elem ) { 1652 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 1653 }); 1654 }, 1655 1656 "ATTR": function( name, operator, check ) { 1657 return function( elem ) { 1658 var result = Sizzle.attr( elem, name ); 1659 1660 if ( result == null ) { 1661 return operator === "!="; 1662 } 1663 if ( !operator ) { 1664 return true; 1665 } 1666 1667 result += ""; 1668 1669 return operator === "=" ? result === check : 1670 operator === "!=" ? result !== check : 1671 operator === "^=" ? check && result.indexOf( check ) === 0 : 1672 operator === "*=" ? check && result.indexOf( check ) > -1 : 1673 operator === "$=" ? check && result.slice( -check.length ) === check : 1674 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 1675 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 1676 false; 1677 }; 1678 }, 1679 1680 "CHILD": function( type, what, argument, first, last ) { 1681 var simple = type.slice( 0, 3 ) !== "nth", 1682 forward = type.slice( -4 ) !== "last", 1683 ofType = what === "of-type"; 1684 1685 return first === 1 && last === 0 ? 1686 1687 // Shortcut for :nth-*(n) 1688 function( elem ) { 1689 return !!elem.parentNode; 1690 } : 1691 1692 function( elem, context, xml ) { 1693 var cache, uniqueCache, outerCache, node, nodeIndex, start, 1694 dir = simple !== forward ? "nextSibling" : "previousSibling", 1695 parent = elem.parentNode, 1696 name = ofType && elem.nodeName.toLowerCase(), 1697 useCache = !xml && !ofType, 1698 diff = false; 1699 1700 if ( parent ) { 1701 1702 // :(first|last|only)-(child|of-type) 1703 if ( simple ) { 1704 while ( dir ) { 1705 node = elem; 1706 while ( (node = node[ dir ]) ) { 1707 if ( ofType ? 1708 node.nodeName.toLowerCase() === name : 1709 node.nodeType === 1 ) { 1710 1711 return false; 1712 } 1713 } 1714 // Reverse direction for :only-* (if we haven't yet done so) 1715 start = dir = type === "only" && !start && "nextSibling"; 1716 } 1717 return true; 1718 } 1719 1720 start = [ forward ? parent.firstChild : parent.lastChild ]; 1721 1722 // non-xml :nth-child(...) stores cache data on `parent` 1723 if ( forward && useCache ) { 1724 1725 // Seek `elem` from a previously-cached index 1726 1727 // ...in a gzip-friendly way 1728 node = parent; 1729 outerCache = node[ expando ] || (node[ expando ] = {}); 1730 1731 // Support: IE <9 only 1732 // Defend against cloned attroperties (jQuery gh-1709) 1733 uniqueCache = outerCache[ node.uniqueID ] || 1734 (outerCache[ node.uniqueID ] = {}); 1735 1736 cache = uniqueCache[ type ] || []; 1737 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1738 diff = nodeIndex && cache[ 2 ]; 1739 node = nodeIndex && parent.childNodes[ nodeIndex ]; 1740 1741 while ( (node = ++nodeIndex && node && node[ dir ] || 1742 1743 // Fallback to seeking `elem` from the start 1744 (diff = nodeIndex = 0) || start.pop()) ) { 1745 1746 // When found, cache indexes on `parent` and break 1747 if ( node.nodeType === 1 && ++diff && node === elem ) { 1748 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 1749 break; 1750 } 1751 } 1752 1753 } else { 1754 // Use previously-cached element index if available 1755 if ( useCache ) { 1756 // ...in a gzip-friendly way 1757 node = elem; 1758 outerCache = node[ expando ] || (node[ expando ] = {}); 1759 1760 // Support: IE <9 only 1761 // Defend against cloned attroperties (jQuery gh-1709) 1762 uniqueCache = outerCache[ node.uniqueID ] || 1763 (outerCache[ node.uniqueID ] = {}); 1764 1765 cache = uniqueCache[ type ] || []; 1766 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1767 diff = nodeIndex; 1768 } 1769 1770 // xml :nth-child(...) 1771 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 1772 if ( diff === false ) { 1773 // Use the same loop as above to seek `elem` from the start 1774 while ( (node = ++nodeIndex && node && node[ dir ] || 1775 (diff = nodeIndex = 0) || start.pop()) ) { 1776 1777 if ( ( ofType ? 1778 node.nodeName.toLowerCase() === name : 1779 node.nodeType === 1 ) && 1780 ++diff ) { 1781 1782 // Cache the index of each encountered element 1783 if ( useCache ) { 1784 outerCache = node[ expando ] || (node[ expando ] = {}); 1785 1786 // Support: IE <9 only 1787 // Defend against cloned attroperties (jQuery gh-1709) 1788 uniqueCache = outerCache[ node.uniqueID ] || 1789 (outerCache[ node.uniqueID ] = {}); 1790 1791 uniqueCache[ type ] = [ dirruns, diff ]; 1792 } 1793 1794 if ( node === elem ) { 1795 break; 1796 } 1797 } 1798 } 1799 } 1800 } 1801 1802 // Incorporate the offset, then check against cycle size 1803 diff -= last; 1804 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 1805 } 1806 }; 1807 }, 1808 1809 "PSEUDO": function( pseudo, argument ) { 1810 // pseudo-class names are case-insensitive 1811 // http://www.w3.org/TR/selectors/#pseudo-classes 1812 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 1813 // Remember that setFilters inherits from pseudos 1814 var args, 1815 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 1816 Sizzle.error( "unsupported pseudo: " + pseudo ); 1817 1818 // The user may use createPseudo to indicate that 1819 // arguments are needed to create the filter function 1820 // just as Sizzle does 1821 if ( fn[ expando ] ) { 1822 return fn( argument ); 1823 } 1824 1825 // But maintain support for old signatures 1826 if ( fn.length > 1 ) { 1827 args = [ pseudo, pseudo, "", argument ]; 1828 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 1829 markFunction(function( seed, matches ) { 1830 var idx, 1831 matched = fn( seed, argument ), 1832 i = matched.length; 1833 while ( i-- ) { 1834 idx = indexOf( seed, matched[i] ); 1835 seed[ idx ] = !( matches[ idx ] = matched[i] ); 1836 } 1837 }) : 1838 function( elem ) { 1839 return fn( elem, 0, args ); 1840 }; 1841 } 1842 1843 return fn; 1844 } 1845 }, 1846 1847 pseudos: { 1848 // Potentially complex pseudos 1849 "not": markFunction(function( selector ) { 1850 // Trim the selector passed to compile 1851 // to avoid treating leading and trailing 1852 // spaces as combinators 1853 var input = [], 1854 results = [], 1855 matcher = compile( selector.replace( rtrim, "$1" ) ); 1856 1857 return matcher[ expando ] ? 1858 markFunction(function( seed, matches, context, xml ) { 1859 var elem, 1860 unmatched = matcher( seed, null, xml, [] ), 1861 i = seed.length; 1862 1863 // Match elements unmatched by `matcher` 1864 while ( i-- ) { 1865 if ( (elem = unmatched[i]) ) { 1866 seed[i] = !(matches[i] = elem); 1867 } 1868 } 1869 }) : 1870 function( elem, context, xml ) { 1871 input[0] = elem; 1872 matcher( input, null, xml, results ); 1873 // Don't keep the element (issue #299) 1874 input[0] = null; 1875 return !results.pop(); 1876 }; 1877 }), 1878 1879 "has": markFunction(function( selector ) { 1880 return function( elem ) { 1881 return Sizzle( selector, elem ).length > 0; 1882 }; 1883 }), 1884 1885 "contains": markFunction(function( text ) { 1886 text = text.replace( runescape, funescape ); 1887 return function( elem ) { 1888 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 1889 }; 1890 }), 1891 1892 // "Whether an element is represented by a :lang() selector 1893 // is based solely on the element's language value 1894 // being equal to the identifier C, 1895 // or beginning with the identifier C immediately followed by "-". 1896 // The matching of C against the element's language value is performed case-insensitively. 1897 // The identifier C does not have to be a valid language name." 1898 // http://www.w3.org/TR/selectors/#lang-pseudo 1899 "lang": markFunction( function( lang ) { 1900 // lang value must be a valid identifier 1901 if ( !ridentifier.test(lang || "") ) { 1902 Sizzle.error( "unsupported lang: " + lang ); 1903 } 1904 lang = lang.replace( runescape, funescape ).toLowerCase(); 1905 return function( elem ) { 1906 var elemLang; 1907 do { 1908 if ( (elemLang = documentIsHTML ? 1909 elem.lang : 1910 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 1911 1912 elemLang = elemLang.toLowerCase(); 1913 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 1914 } 1915 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 1916 return false; 1917 }; 1918 }), 1919 1920 // Miscellaneous 1921 "target": function( elem ) { 1922 var hash = window.location && window.location.hash; 1923 return hash && hash.slice( 1 ) === elem.id; 1924 }, 1925 1926 "root": function( elem ) { 1927 return elem === docElem; 1928 }, 1929 1930 "focus": function( elem ) { 1931 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 1932 }, 1933 1934 // Boolean properties 1935 "enabled": function( elem ) { 1936 return elem.disabled === false; 1937 }, 1938 1939 "disabled": function( elem ) { 1940 return elem.disabled === true; 1941 }, 1942 1943 "checked": function( elem ) { 1944 // In CSS3, :checked should return both checked and selected elements 1945 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1946 var nodeName = elem.nodeName.toLowerCase(); 1947 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 1948 }, 1949 1950 "selected": function( elem ) { 1951 // Accessing this property makes selected-by-default 1952 // options in Safari work properly 1953 if ( elem.parentNode ) { 1954 elem.parentNode.selectedIndex; 1955 } 1956 1957 return elem.selected === true; 1958 }, 1959 1960 // Contents 1961 "empty": function( elem ) { 1962 // http://www.w3.org/TR/selectors/#empty-pseudo 1963 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 1964 // but not by others (comment: 8; processing instruction: 7; etc.) 1965 // nodeType < 6 works because attributes (2) do not appear as children 1966 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1967 if ( elem.nodeType < 6 ) { 1968 return false; 1969 } 1970 } 1971 return true; 1972 }, 1973 1974 "parent": function( elem ) { 1975 return !Expr.pseudos["empty"]( elem ); 1976 }, 1977 1978 // Element/input types 1979 "header": function( elem ) { 1980 return rheader.test( elem.nodeName ); 1981 }, 1982 1983 "input": function( elem ) { 1984 return rinputs.test( elem.nodeName ); 1985 }, 1986 1987 "button": function( elem ) { 1988 var name = elem.nodeName.toLowerCase(); 1989 return name === "input" && elem.type === "button" || name === "button"; 1990 }, 1991 1992 "text": function( elem ) { 1993 var attr; 1994 return elem.nodeName.toLowerCase() === "input" && 1995 elem.type === "text" && 1996 1997 // Support: IE<8 1998 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 1999 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 2000 }, 2001 2002 // Position-in-collection 2003 "first": createPositionalPseudo(function() { 2004 return [ 0 ]; 2005 }), 2006 2007 "last": createPositionalPseudo(function( matchIndexes, length ) { 2008 return [ length - 1 ]; 2009 }), 2010 2011 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 2012 return [ argument < 0 ? argument + length : argument ]; 2013 }), 2014 2015 "even": createPositionalPseudo(function( matchIndexes, length ) { 2016 var i = 0; 2017 for ( ; i < length; i += 2 ) { 2018 matchIndexes.push( i ); 2019 } 2020 return matchIndexes; 2021 }), 2022 2023 "odd": createPositionalPseudo(function( matchIndexes, length ) { 2024 var i = 1; 2025 for ( ; i < length; i += 2 ) { 2026 matchIndexes.push( i ); 2027 } 2028 return matchIndexes; 2029 }), 2030 2031 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2032 var i = argument < 0 ? argument + length : argument; 2033 for ( ; --i >= 0; ) { 2034 matchIndexes.push( i ); 2035 } 2036 return matchIndexes; 2037 }), 2038 2039 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2040 var i = argument < 0 ? argument + length : argument; 2041 for ( ; ++i < length; ) { 2042 matchIndexes.push( i ); 2043 } 2044 return matchIndexes; 2045 }) 2046 } 2047}; 2048 2049Expr.pseudos["nth"] = Expr.pseudos["eq"]; 2050 2051// Add button/input type pseudos 2052for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 2053 Expr.pseudos[ i ] = createInputPseudo( i ); 2054} 2055for ( i in { submit: true, reset: true } ) { 2056 Expr.pseudos[ i ] = createButtonPseudo( i ); 2057} 2058 2059// Easy API for creating new setFilters 2060function setFilters() {} 2061setFilters.prototype = Expr.filters = Expr.pseudos; 2062Expr.setFilters = new setFilters(); 2063 2064tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 2065 var matched, match, tokens, type, 2066 soFar, groups, preFilters, 2067 cached = tokenCache[ selector + " " ]; 2068 2069 if ( cached ) { 2070 return parseOnly ? 0 : cached.slice( 0 ); 2071 } 2072 2073 soFar = selector; 2074 groups = []; 2075 preFilters = Expr.preFilter; 2076 2077 while ( soFar ) { 2078 2079 // Comma and first run 2080 if ( !matched || (match = rcomma.exec( soFar )) ) { 2081 if ( match ) { 2082 // Don't consume trailing commas as valid 2083 soFar = soFar.slice( match[0].length ) || soFar; 2084 } 2085 groups.push( (tokens = []) ); 2086 } 2087 2088 matched = false; 2089 2090 // Combinators 2091 if ( (match = rcombinators.exec( soFar )) ) { 2092 matched = match.shift(); 2093 tokens.push({ 2094 value: matched, 2095 // Cast descendant combinators to space 2096 type: match[0].replace( rtrim, " " ) 2097 }); 2098 soFar = soFar.slice( matched.length ); 2099 } 2100 2101 // Filters 2102 for ( type in Expr.filter ) { 2103 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 2104 (match = preFilters[ type ]( match ))) ) { 2105 matched = match.shift(); 2106 tokens.push({ 2107 value: matched, 2108 type: type, 2109 matches: match 2110 }); 2111 soFar = soFar.slice( matched.length ); 2112 } 2113 } 2114 2115 if ( !matched ) { 2116 break; 2117 } 2118 } 2119 2120 // Return the length of the invalid excess 2121 // if we're just parsing 2122 // Otherwise, throw an error or return tokens 2123 return parseOnly ? 2124 soFar.length : 2125 soFar ? 2126 Sizzle.error( selector ) : 2127 // Cache the tokens 2128 tokenCache( selector, groups ).slice( 0 ); 2129}; 2130 2131function toSelector( tokens ) { 2132 var i = 0, 2133 len = tokens.length, 2134 selector = ""; 2135 for ( ; i < len; i++ ) { 2136 selector += tokens[i].value; 2137 } 2138 return selector; 2139} 2140 2141function addCombinator( matcher, combinator, base ) { 2142 var dir = combinator.dir, 2143 checkNonElements = base && dir === "parentNode", 2144 doneName = done++; 2145 2146 return combinator.first ? 2147 // Check against closest ancestor/preceding element 2148 function( elem, context, xml ) { 2149 while ( (elem = elem[ dir ]) ) { 2150 if ( elem.nodeType === 1 || checkNonElements ) { 2151 return matcher( elem, context, xml ); 2152 } 2153 } 2154 } : 2155 2156 // Check against all ancestor/preceding elements 2157 function( elem, context, xml ) { 2158 var oldCache, uniqueCache, outerCache, 2159 newCache = [ dirruns, doneName ]; 2160 2161 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 2162 if ( xml ) { 2163 while ( (elem = elem[ dir ]) ) { 2164 if ( elem.nodeType === 1 || checkNonElements ) { 2165 if ( matcher( elem, context, xml ) ) { 2166 return true; 2167 } 2168 } 2169 } 2170 } else { 2171 while ( (elem = elem[ dir ]) ) { 2172 if ( elem.nodeType === 1 || checkNonElements ) { 2173 outerCache = elem[ expando ] || (elem[ expando ] = {}); 2174 2175 // Support: IE <9 only 2176 // Defend against cloned attroperties (jQuery gh-1709) 2177 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); 2178 2179 if ( (oldCache = uniqueCache[ dir ]) && 2180 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 2181 2182 // Assign to newCache so results back-propagate to previous elements 2183 return (newCache[ 2 ] = oldCache[ 2 ]); 2184 } else { 2185 // Reuse newcache so results back-propagate to previous elements 2186 uniqueCache[ dir ] = newCache; 2187 2188 // A match means we're done; a fail means we have to keep checking 2189 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 2190 return true; 2191 } 2192 } 2193 } 2194 } 2195 } 2196 }; 2197} 2198 2199function elementMatcher( matchers ) { 2200 return matchers.length > 1 ? 2201 function( elem, context, xml ) { 2202 var i = matchers.length; 2203 while ( i-- ) { 2204 if ( !matchers[i]( elem, context, xml ) ) { 2205 return false; 2206 } 2207 } 2208 return true; 2209 } : 2210 matchers[0]; 2211} 2212 2213function multipleContexts( selector, contexts, results ) { 2214 var i = 0, 2215 len = contexts.length; 2216 for ( ; i < len; i++ ) { 2217 Sizzle( selector, contexts[i], results ); 2218 } 2219 return results; 2220} 2221 2222function condense( unmatched, map, filter, context, xml ) { 2223 var elem, 2224 newUnmatched = [], 2225 i = 0, 2226 len = unmatched.length, 2227 mapped = map != null; 2228 2229 for ( ; i < len; i++ ) { 2230 if ( (elem = unmatched[i]) ) { 2231 if ( !filter || filter( elem, context, xml ) ) { 2232 newUnmatched.push( elem ); 2233 if ( mapped ) { 2234 map.push( i ); 2235 } 2236 } 2237 } 2238 } 2239 2240 return newUnmatched; 2241} 2242 2243function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 2244 if ( postFilter && !postFilter[ expando ] ) { 2245 postFilter = setMatcher( postFilter ); 2246 } 2247 if ( postFinder && !postFinder[ expando ] ) { 2248 postFinder = setMatcher( postFinder, postSelector ); 2249 } 2250 return markFunction(function( seed, results, context, xml ) { 2251 var temp, i, elem, 2252 preMap = [], 2253 postMap = [], 2254 preexisting = results.length, 2255 2256 // Get initial elements from seed or context 2257 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 2258 2259 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2260 matcherIn = preFilter && ( seed || !selector ) ? 2261 condense( elems, preMap, preFilter, context, xml ) : 2262 elems, 2263 2264 matcherOut = matcher ? 2265 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 2266 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 2267 2268 // ...intermediate processing is necessary 2269 [] : 2270 2271 // ...otherwise use results directly 2272 results : 2273 matcherIn; 2274 2275 // Find primary matches 2276 if ( matcher ) { 2277 matcher( matcherIn, matcherOut, context, xml ); 2278 } 2279 2280 // Apply postFilter 2281 if ( postFilter ) { 2282 temp = condense( matcherOut, postMap ); 2283 postFilter( temp, [], context, xml ); 2284 2285 // Un-match failing elements by moving them back to matcherIn 2286 i = temp.length; 2287 while ( i-- ) { 2288 if ( (elem = temp[i]) ) { 2289 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 2290 } 2291 } 2292 } 2293 2294 if ( seed ) { 2295 if ( postFinder || preFilter ) { 2296 if ( postFinder ) { 2297 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2298 temp = []; 2299 i = matcherOut.length; 2300 while ( i-- ) { 2301 if ( (elem = matcherOut[i]) ) { 2302 // Restore matcherIn since elem is not yet a final match 2303 temp.push( (matcherIn[i] = elem) ); 2304 } 2305 } 2306 postFinder( null, (matcherOut = []), temp, xml ); 2307 } 2308 2309 // Move matched elements from seed to results to keep them synchronized 2310 i = matcherOut.length; 2311 while ( i-- ) { 2312 if ( (elem = matcherOut[i]) && 2313 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 2314 2315 seed[temp] = !(results[temp] = elem); 2316 } 2317 } 2318 } 2319 2320 // Add elements to results, through postFinder if defined 2321 } else { 2322 matcherOut = condense( 2323 matcherOut === results ? 2324 matcherOut.splice( preexisting, matcherOut.length ) : 2325 matcherOut 2326 ); 2327 if ( postFinder ) { 2328 postFinder( null, results, matcherOut, xml ); 2329 } else { 2330 push.apply( results, matcherOut ); 2331 } 2332 } 2333 }); 2334} 2335 2336function matcherFromTokens( tokens ) { 2337 var checkContext, matcher, j, 2338 len = tokens.length, 2339 leadingRelative = Expr.relative[ tokens[0].type ], 2340 implicitRelative = leadingRelative || Expr.relative[" "], 2341 i = leadingRelative ? 1 : 0, 2342 2343 // The foundational matcher ensures that elements are reachable from top-level context(s) 2344 matchContext = addCombinator( function( elem ) { 2345 return elem === checkContext; 2346 }, implicitRelative, true ), 2347 matchAnyContext = addCombinator( function( elem ) { 2348 return indexOf( checkContext, elem ) > -1; 2349 }, implicitRelative, true ), 2350 matchers = [ function( elem, context, xml ) { 2351 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 2352 (checkContext = context).nodeType ? 2353 matchContext( elem, context, xml ) : 2354 matchAnyContext( elem, context, xml ) ); 2355 // Avoid hanging onto element (issue #299) 2356 checkContext = null; 2357 return ret; 2358 } ]; 2359 2360 for ( ; i < len; i++ ) { 2361 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 2362 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 2363 } else { 2364 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 2365 2366 // Return special upon seeing a positional matcher 2367 if ( matcher[ expando ] ) { 2368 // Find the next relative operator (if any) for proper handling 2369 j = ++i; 2370 for ( ; j < len; j++ ) { 2371 if ( Expr.relative[ tokens[j].type ] ) { 2372 break; 2373 } 2374 } 2375 return setMatcher( 2376 i > 1 && elementMatcher( matchers ), 2377 i > 1 && toSelector( 2378 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2379 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 2380 ).replace( rtrim, "$1" ), 2381 matcher, 2382 i < j && matcherFromTokens( tokens.slice( i, j ) ), 2383 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 2384 j < len && toSelector( tokens ) 2385 ); 2386 } 2387 matchers.push( matcher ); 2388 } 2389 } 2390 2391 return elementMatcher( matchers ); 2392} 2393 2394function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 2395 var bySet = setMatchers.length > 0, 2396 byElement = elementMatchers.length > 0, 2397 superMatcher = function( seed, context, xml, results, outermost ) { 2398 var elem, j, matcher, 2399 matchedCount = 0, 2400 i = "0", 2401 unmatched = seed && [], 2402 setMatched = [], 2403 contextBackup = outermostContext, 2404 // We must always have either seed elements or outermost context 2405 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 2406 // Use integer dirruns iff this is the outermost matcher 2407 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 2408 len = elems.length; 2409 2410 if ( outermost ) { 2411 outermostContext = context === document || context || outermost; 2412 } 2413 2414 // Add elements passing elementMatchers directly to results 2415 // Support: IE<9, Safari 2416 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 2417 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 2418 if ( byElement && elem ) { 2419 j = 0; 2420 if ( !context && elem.ownerDocument !== document ) { 2421 setDocument( elem ); 2422 xml = !documentIsHTML; 2423 } 2424 while ( (matcher = elementMatchers[j++]) ) { 2425 if ( matcher( elem, context || document, xml) ) { 2426 results.push( elem ); 2427 break; 2428 } 2429 } 2430 if ( outermost ) { 2431 dirruns = dirrunsUnique; 2432 } 2433 } 2434 2435 // Track unmatched elements for set filters 2436 if ( bySet ) { 2437 // They will have gone through all possible matchers 2438 if ( (elem = !matcher && elem) ) { 2439 matchedCount--; 2440 } 2441 2442 // Lengthen the array for every element, matched or not 2443 if ( seed ) { 2444 unmatched.push( elem ); 2445 } 2446 } 2447 } 2448 2449 // `i` is now the count of elements visited above, and adding it to `matchedCount` 2450 // makes the latter nonnegative. 2451 matchedCount += i; 2452 2453 // Apply set filters to unmatched elements 2454 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 2455 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 2456 // no element matchers and no seed. 2457 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 2458 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 2459 // numerically zero. 2460 if ( bySet && i !== matchedCount ) { 2461 j = 0; 2462 while ( (matcher = setMatchers[j++]) ) { 2463 matcher( unmatched, setMatched, context, xml ); 2464 } 2465 2466 if ( seed ) { 2467 // Reintegrate element matches to eliminate the need for sorting 2468 if ( matchedCount > 0 ) { 2469 while ( i-- ) { 2470 if ( !(unmatched[i] || setMatched[i]) ) { 2471 setMatched[i] = pop.call( results ); 2472 } 2473 } 2474 } 2475 2476 // Discard index placeholder values to get only actual matches 2477 setMatched = condense( setMatched ); 2478 } 2479 2480 // Add matches to results 2481 push.apply( results, setMatched ); 2482 2483 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2484 if ( outermost && !seed && setMatched.length > 0 && 2485 ( matchedCount + setMatchers.length ) > 1 ) { 2486 2487 Sizzle.uniqueSort( results ); 2488 } 2489 } 2490 2491 // Override manipulation of globals by nested matchers 2492 if ( outermost ) { 2493 dirruns = dirrunsUnique; 2494 outermostContext = contextBackup; 2495 } 2496 2497 return unmatched; 2498 }; 2499 2500 return bySet ? 2501 markFunction( superMatcher ) : 2502 superMatcher; 2503} 2504 2505compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 2506 var i, 2507 setMatchers = [], 2508 elementMatchers = [], 2509 cached = compilerCache[ selector + " " ]; 2510 2511 if ( !cached ) { 2512 // Generate a function of recursive functions that can be used to check each element 2513 if ( !match ) { 2514 match = tokenize( selector ); 2515 } 2516 i = match.length; 2517 while ( i-- ) { 2518 cached = matcherFromTokens( match[i] ); 2519 if ( cached[ expando ] ) { 2520 setMatchers.push( cached ); 2521 } else { 2522 elementMatchers.push( cached ); 2523 } 2524 } 2525 2526 // Cache the compiled function 2527 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 2528 2529 // Save selector and tokenization 2530 cached.selector = selector; 2531 } 2532 return cached; 2533}; 2534 2535/** 2536 * A low-level selection function that works with Sizzle's compiled 2537 * selector functions 2538 * @param {String|Function} selector A selector or a pre-compiled 2539 * selector function built with Sizzle.compile 2540 * @param {Element} context 2541 * @param {Array} [results] 2542 * @param {Array} [seed] A set of elements to match against 2543 */ 2544select = Sizzle.select = function( selector, context, results, seed ) { 2545 var i, tokens, token, type, find, 2546 compiled = typeof selector === "function" && selector, 2547 match = !seed && tokenize( (selector = compiled.selector || selector) ); 2548 2549 results = results || []; 2550 2551 // Try to minimize operations if there is only one selector in the list and no seed 2552 // (the latter of which guarantees us context) 2553 if ( match.length === 1 ) { 2554 2555 // Reduce context if the leading compound selector is an ID 2556 tokens = match[0] = match[0].slice( 0 ); 2557 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 2558 support.getById && context.nodeType === 9 && documentIsHTML && 2559 Expr.relative[ tokens[1].type ] ) { 2560 2561 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 2562 if ( !context ) { 2563 return results; 2564 2565 // Precompiled matchers will still verify ancestry, so step up a level 2566 } else if ( compiled ) { 2567 context = context.parentNode; 2568 } 2569 2570 selector = selector.slice( tokens.shift().value.length ); 2571 } 2572 2573 // Fetch a seed set for right-to-left matching 2574 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 2575 while ( i-- ) { 2576 token = tokens[i]; 2577 2578 // Abort if we hit a combinator 2579 if ( Expr.relative[ (type = token.type) ] ) { 2580 break; 2581 } 2582 if ( (find = Expr.find[ type ]) ) { 2583 // Search, expanding context for leading sibling combinators 2584 if ( (seed = find( 2585 token.matches[0].replace( runescape, funescape ), 2586 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 2587 )) ) { 2588 2589 // If seed is empty or no tokens remain, we can return early 2590 tokens.splice( i, 1 ); 2591 selector = seed.length && toSelector( tokens ); 2592 if ( !selector ) { 2593 push.apply( results, seed ); 2594 return results; 2595 } 2596 2597 break; 2598 } 2599 } 2600 } 2601 } 2602 2603 // Compile and execute a filtering function if one is not provided 2604 // Provide `match` to avoid retokenization if we modified the selector above 2605 ( compiled || compile( selector, match ) )( 2606 seed, 2607 context, 2608 !documentIsHTML, 2609 results, 2610 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 2611 ); 2612 return results; 2613}; 2614 2615// One-time assignments 2616 2617// Sort stability 2618support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 2619 2620// Support: Chrome 14-35+ 2621// Always assume duplicates if they aren't passed to the comparison function 2622support.detectDuplicates = !!hasDuplicate; 2623 2624// Initialize against the default document 2625setDocument(); 2626 2627// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 2628// Detached nodes confoundingly follow *each other* 2629support.sortDetached = assert(function( div1 ) { 2630 // Should return 1, but returns 4 (following) 2631 return div1.compareDocumentPosition( document.createElement("div") ) & 1; 2632}); 2633 2634// Support: IE<8 2635// Prevent attribute/property "interpolation" 2636// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 2637if ( !assert(function( div ) { 2638 div.innerHTML = "<a href='#'></a>"; 2639 return div.firstChild.getAttribute("href") === "#" ; 2640}) ) { 2641 addHandle( "type|href|height|width", function( elem, name, isXML ) { 2642 if ( !isXML ) { 2643 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 2644 } 2645 }); 2646} 2647 2648// Support: IE<9 2649// Use defaultValue in place of getAttribute("value") 2650if ( !support.attributes || !assert(function( div ) { 2651 div.innerHTML = "<input/>"; 2652 div.firstChild.setAttribute( "value", "" ); 2653 return div.firstChild.getAttribute( "value" ) === ""; 2654}) ) { 2655 addHandle( "value", function( elem, name, isXML ) { 2656 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 2657 return elem.defaultValue; 2658 } 2659 }); 2660} 2661 2662// Support: IE<9 2663// Use getAttributeNode to fetch booleans when getAttribute lies 2664if ( !assert(function( div ) { 2665 return div.getAttribute("disabled") == null; 2666}) ) { 2667 addHandle( booleans, function( elem, name, isXML ) { 2668 var val; 2669 if ( !isXML ) { 2670 return elem[ name ] === true ? name.toLowerCase() : 2671 (val = elem.getAttributeNode( name )) && val.specified ? 2672 val.value : 2673 null; 2674 } 2675 }); 2676} 2677 2678return Sizzle; 2679 2680})( window ); 2681 2682 2683 2684jQuery.find = Sizzle; 2685jQuery.expr = Sizzle.selectors; 2686jQuery.expr[ ":" ] = jQuery.expr.pseudos; 2687jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 2688jQuery.text = Sizzle.getText; 2689jQuery.isXMLDoc = Sizzle.isXML; 2690jQuery.contains = Sizzle.contains; 2691 2692 2693 2694var dir = function( elem, dir, until ) { 2695 var matched = [], 2696 truncate = until !== undefined; 2697 2698 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 2699 if ( elem.nodeType === 1 ) { 2700 if ( truncate && jQuery( elem ).is( until ) ) { 2701 break; 2702 } 2703 matched.push( elem ); 2704 } 2705 } 2706 return matched; 2707}; 2708 2709 2710var siblings = function( n, elem ) { 2711 var matched = []; 2712 2713 for ( ; n; n = n.nextSibling ) { 2714 if ( n.nodeType === 1 && n !== elem ) { 2715 matched.push( n ); 2716 } 2717 } 2718 2719 return matched; 2720}; 2721 2722 2723var rneedsContext = jQuery.expr.match.needsContext; 2724 2725var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); 2726 2727 2728 2729var risSimple = /^.[^:#\[\.,]*$/; 2730 2731// Implement the identical functionality for filter and not 2732function winnow( elements, qualifier, not ) { 2733 if ( jQuery.isFunction( qualifier ) ) { 2734 return jQuery.grep( elements, function( elem, i ) { 2735 /* jshint -W018 */ 2736 return !!qualifier.call( elem, i, elem ) !== not; 2737 } ); 2738 2739 } 2740 2741 if ( qualifier.nodeType ) { 2742 return jQuery.grep( elements, function( elem ) { 2743 return ( elem === qualifier ) !== not; 2744 } ); 2745 2746 } 2747 2748 if ( typeof qualifier === "string" ) { 2749 if ( risSimple.test( qualifier ) ) { 2750 return jQuery.filter( qualifier, elements, not ); 2751 } 2752 2753 qualifier = jQuery.filter( qualifier, elements ); 2754 } 2755 2756 return jQuery.grep( elements, function( elem ) { 2757 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 2758 } ); 2759} 2760 2761jQuery.filter = function( expr, elems, not ) { 2762 var elem = elems[ 0 ]; 2763 2764 if ( not ) { 2765 expr = ":not(" + expr + ")"; 2766 } 2767 2768 return elems.length === 1 && elem.nodeType === 1 ? 2769 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : 2770 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 2771 return elem.nodeType === 1; 2772 } ) ); 2773}; 2774 2775jQuery.fn.extend( { 2776 find: function( selector ) { 2777 var i, 2778 len = this.length, 2779 ret = [], 2780 self = this; 2781 2782 if ( typeof selector !== "string" ) { 2783 return this.pushStack( jQuery( selector ).filter( function() { 2784 for ( i = 0; i < len; i++ ) { 2785 if ( jQuery.contains( self[ i ], this ) ) { 2786 return true; 2787 } 2788 } 2789 } ) ); 2790 } 2791 2792 for ( i = 0; i < len; i++ ) { 2793 jQuery.find( selector, self[ i ], ret ); 2794 } 2795 2796 // Needed because $( selector, context ) becomes $( context ).find( selector ) 2797 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); 2798 ret.selector = this.selector ? this.selector + " " + selector : selector; 2799 return ret; 2800 }, 2801 filter: function( selector ) { 2802 return this.pushStack( winnow( this, selector || [], false ) ); 2803 }, 2804 not: function( selector ) { 2805 return this.pushStack( winnow( this, selector || [], true ) ); 2806 }, 2807 is: function( selector ) { 2808 return !!winnow( 2809 this, 2810 2811 // If this is a positional/relative selector, check membership in the returned set 2812 // so $("p:first").is("p:last") won't return true for a doc with two "p". 2813 typeof selector === "string" && rneedsContext.test( selector ) ? 2814 jQuery( selector ) : 2815 selector || [], 2816 false 2817 ).length; 2818 } 2819} ); 2820 2821 2822// Initialize a jQuery object 2823 2824 2825// A central reference to the root jQuery(document) 2826var rootjQuery, 2827 2828 // A simple way to check for HTML strings 2829 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 2830 // Strict HTML recognition (#11290: must start with <) 2831 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 2832 2833 init = jQuery.fn.init = function( selector, context, root ) { 2834 var match, elem; 2835 2836 // HANDLE: $(""), $(null), $(undefined), $(false) 2837 if ( !selector ) { 2838 return this; 2839 } 2840 2841 // Method init() accepts an alternate rootjQuery 2842 // so migrate can support jQuery.sub (gh-2101) 2843 root = root || rootjQuery; 2844 2845 // Handle HTML strings 2846 if ( typeof selector === "string" ) { 2847 if ( selector[ 0 ] === "<" && 2848 selector[ selector.length - 1 ] === ">" && 2849 selector.length >= 3 ) { 2850 2851 // Assume that strings that start and end with <> are HTML and skip the regex check 2852 match = [ null, selector, null ]; 2853 2854 } else { 2855 match = rquickExpr.exec( selector ); 2856 } 2857 2858 // Match html or make sure no context is specified for #id 2859 if ( match && ( match[ 1 ] || !context ) ) { 2860 2861 // HANDLE: $(html) -> $(array) 2862 if ( match[ 1 ] ) { 2863 context = context instanceof jQuery ? context[ 0 ] : context; 2864 2865 // Option to run scripts is true for back-compat 2866 // Intentionally let the error be thrown if parseHTML is not present 2867 jQuery.merge( this, jQuery.parseHTML( 2868 match[ 1 ], 2869 context && context.nodeType ? context.ownerDocument || context : document, 2870 true 2871 ) ); 2872 2873 // HANDLE: $(html, props) 2874 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 2875 for ( match in context ) { 2876 2877 // Properties of context are called as methods if possible 2878 if ( jQuery.isFunction( this[ match ] ) ) { 2879 this[ match ]( context[ match ] ); 2880 2881 // ...and otherwise set as attributes 2882 } else { 2883 this.attr( match, context[ match ] ); 2884 } 2885 } 2886 } 2887 2888 return this; 2889 2890 // HANDLE: $(#id) 2891 } else { 2892 elem = document.getElementById( match[ 2 ] ); 2893 2894 // Support: Blackberry 4.6 2895 // gEBID returns nodes no longer in the document (#6963) 2896 if ( elem && elem.parentNode ) { 2897 2898 // Inject the element directly into the jQuery object 2899 this.length = 1; 2900 this[ 0 ] = elem; 2901 } 2902 2903 this.context = document; 2904 this.selector = selector; 2905 return this; 2906 } 2907 2908 // HANDLE: $(expr, $(...)) 2909 } else if ( !context || context.jquery ) { 2910 return ( context || root ).find( selector ); 2911 2912 // HANDLE: $(expr, context) 2913 // (which is just equivalent to: $(context).find(expr) 2914 } else { 2915 return this.constructor( context ).find( selector ); 2916 } 2917 2918 // HANDLE: $(DOMElement) 2919 } else if ( selector.nodeType ) { 2920 this.context = this[ 0 ] = selector; 2921 this.length = 1; 2922 return this; 2923 2924 // HANDLE: $(function) 2925 // Shortcut for document ready 2926 } else if ( jQuery.isFunction( selector ) ) { 2927 return root.ready !== undefined ? 2928 root.ready( selector ) : 2929 2930 // Execute immediately if ready is not present 2931 selector( jQuery ); 2932 } 2933 2934 if ( selector.selector !== undefined ) { 2935 this.selector = selector.selector; 2936 this.context = selector.context; 2937 } 2938 2939 return jQuery.makeArray( selector, this ); 2940 }; 2941 2942// Give the init function the jQuery prototype for later instantiation 2943init.prototype = jQuery.fn; 2944 2945// Initialize central reference 2946rootjQuery = jQuery( document ); 2947 2948 2949var rparentsprev = /^(?:parents|prev(?:Until|All))/, 2950 2951 // Methods guaranteed to produce a unique set when starting from a unique set 2952 guaranteedUnique = { 2953 children: true, 2954 contents: true, 2955 next: true, 2956 prev: true 2957 }; 2958 2959jQuery.fn.extend( { 2960 has: function( target ) { 2961 var targets = jQuery( target, this ), 2962 l = targets.length; 2963 2964 return this.filter( function() { 2965 var i = 0; 2966 for ( ; i < l; i++ ) { 2967 if ( jQuery.contains( this, targets[ i ] ) ) { 2968 return true; 2969 } 2970 } 2971 } ); 2972 }, 2973 2974 closest: function( selectors, context ) { 2975 var cur, 2976 i = 0, 2977 l = this.length, 2978 matched = [], 2979 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? 2980 jQuery( selectors, context || this.context ) : 2981 0; 2982 2983 for ( ; i < l; i++ ) { 2984 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 2985 2986 // Always skip document fragments 2987 if ( cur.nodeType < 11 && ( pos ? 2988 pos.index( cur ) > -1 : 2989 2990 // Don't pass non-elements to Sizzle 2991 cur.nodeType === 1 && 2992 jQuery.find.matchesSelector( cur, selectors ) ) ) { 2993 2994 matched.push( cur ); 2995 break; 2996 } 2997 } 2998 } 2999 3000 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 3001 }, 3002 3003 // Determine the position of an element within the set 3004 index: function( elem ) { 3005 3006 // No argument, return index in parent 3007 if ( !elem ) { 3008 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 3009 } 3010 3011 // Index in selector 3012 if ( typeof elem === "string" ) { 3013 return indexOf.call( jQuery( elem ), this[ 0 ] ); 3014 } 3015 3016 // Locate the position of the desired element 3017 return indexOf.call( this, 3018 3019 // If it receives a jQuery object, the first element is used 3020 elem.jquery ? elem[ 0 ] : elem 3021 ); 3022 }, 3023 3024 add: function( selector, context ) { 3025 return this.pushStack( 3026 jQuery.uniqueSort( 3027 jQuery.merge( this.get(), jQuery( selector, context ) ) 3028 ) 3029 ); 3030 }, 3031 3032 addBack: function( selector ) { 3033 return this.add( selector == null ? 3034 this.prevObject : this.prevObject.filter( selector ) 3035 ); 3036 } 3037} ); 3038 3039function sibling( cur, dir ) { 3040 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 3041 return cur; 3042} 3043 3044jQuery.each( { 3045 parent: function( elem ) { 3046 var parent = elem.parentNode; 3047 return parent && parent.nodeType !== 11 ? parent : null; 3048 }, 3049 parents: function( elem ) { 3050 return dir( elem, "parentNode" ); 3051 }, 3052 parentsUntil: function( elem, i, until ) { 3053 return dir( elem, "parentNode", until ); 3054 }, 3055 next: function( elem ) { 3056 return sibling( elem, "nextSibling" ); 3057 }, 3058 prev: function( elem ) { 3059 return sibling( elem, "previousSibling" ); 3060 }, 3061 nextAll: function( elem ) { 3062 return dir( elem, "nextSibling" ); 3063 }, 3064 prevAll: function( elem ) { 3065 return dir( elem, "previousSibling" ); 3066 }, 3067 nextUntil: function( elem, i, until ) { 3068 return dir( elem, "nextSibling", until ); 3069 }, 3070 prevUntil: function( elem, i, until ) { 3071 return dir( elem, "previousSibling", until ); 3072 }, 3073 siblings: function( elem ) { 3074 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 3075 }, 3076 children: function( elem ) { 3077 return siblings( elem.firstChild ); 3078 }, 3079 contents: function( elem ) { 3080 return elem.contentDocument || jQuery.merge( [], elem.childNodes ); 3081 } 3082}, function( name, fn ) { 3083 jQuery.fn[ name ] = function( until, selector ) { 3084 var matched = jQuery.map( this, fn, until ); 3085 3086 if ( name.slice( -5 ) !== "Until" ) { 3087 selector = until; 3088 } 3089 3090 if ( selector && typeof selector === "string" ) { 3091 matched = jQuery.filter( selector, matched ); 3092 } 3093 3094 if ( this.length > 1 ) { 3095 3096 // Remove duplicates 3097 if ( !guaranteedUnique[ name ] ) { 3098 jQuery.uniqueSort( matched ); 3099 } 3100 3101 // Reverse order for parents* and prev-derivatives 3102 if ( rparentsprev.test( name ) ) { 3103 matched.reverse(); 3104 } 3105 } 3106 3107 return this.pushStack( matched ); 3108 }; 3109} ); 3110var rnotwhite = ( /\S+/g ); 3111 3112 3113 3114// Convert String-formatted options into Object-formatted ones 3115function createOptions( options ) { 3116 var object = {}; 3117 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { 3118 object[ flag ] = true; 3119 } ); 3120 return object; 3121} 3122 3123/* 3124 * Create a callback list using the following parameters: 3125 * 3126 * options: an optional list of space-separated options that will change how 3127 * the callback list behaves or a more traditional option object 3128 * 3129 * By default a callback list will act like an event callback list and can be 3130 * "fired" multiple times. 3131 * 3132 * Possible options: 3133 * 3134 * once: will ensure the callback list can only be fired once (like a Deferred) 3135 * 3136 * memory: will keep track of previous values and will call any callback added 3137 * after the list has been fired right away with the latest "memorized" 3138 * values (like a Deferred) 3139 * 3140 * unique: will ensure a callback can only be added once (no duplicate in the list) 3141 * 3142 * stopOnFalse: interrupt callings when a callback returns false 3143 * 3144 */ 3145jQuery.Callbacks = function( options ) { 3146 3147 // Convert options from String-formatted to Object-formatted if needed 3148 // (we check in cache first) 3149 options = typeof options === "string" ? 3150 createOptions( options ) : 3151 jQuery.extend( {}, options ); 3152 3153 var // Flag to know if list is currently firing 3154 firing, 3155 3156 // Last fire value for non-forgettable lists 3157 memory, 3158 3159 // Flag to know if list was already fired 3160 fired, 3161 3162 // Flag to prevent firing 3163 locked, 3164 3165 // Actual callback list 3166 list = [], 3167 3168 // Queue of execution data for repeatable lists 3169 queue = [], 3170 3171 // Index of currently firing callback (modified by add/remove as needed) 3172 firingIndex = -1, 3173 3174 // Fire callbacks 3175 fire = function() { 3176 3177 // Enforce single-firing 3178 locked = options.once; 3179 3180 // Execute callbacks for all pending executions, 3181 // respecting firingIndex overrides and runtime changes 3182 fired = firing = true; 3183 for ( ; queue.length; firingIndex = -1 ) { 3184 memory = queue.shift(); 3185 while ( ++firingIndex < list.length ) { 3186 3187 // Run callback and check for early termination 3188 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 3189 options.stopOnFalse ) { 3190 3191 // Jump to end and forget the data so .add doesn't re-fire 3192 firingIndex = list.length; 3193 memory = false; 3194 } 3195 } 3196 } 3197 3198 // Forget the data if we're done with it 3199 if ( !options.memory ) { 3200 memory = false; 3201 } 3202 3203 firing = false; 3204 3205 // Clean up if we're done firing for good 3206 if ( locked ) { 3207 3208 // Keep an empty list if we have data for future add calls 3209 if ( memory ) { 3210 list = []; 3211 3212 // Otherwise, this object is spent 3213 } else { 3214 list = ""; 3215 } 3216 } 3217 }, 3218 3219 // Actual Callbacks object 3220 self = { 3221 3222 // Add a callback or a collection of callbacks to the list 3223 add: function() { 3224 if ( list ) { 3225 3226 // If we have memory from a past run, we should fire after adding 3227 if ( memory && !firing ) { 3228 firingIndex = list.length - 1; 3229 queue.push( memory ); 3230 } 3231 3232 ( function add( args ) { 3233 jQuery.each( args, function( _, arg ) { 3234 if ( jQuery.isFunction( arg ) ) { 3235 if ( !options.unique || !self.has( arg ) ) { 3236 list.push( arg ); 3237 } 3238 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { 3239 3240 // Inspect recursively 3241 add( arg ); 3242 } 3243 } ); 3244 } )( arguments ); 3245 3246 if ( memory && !firing ) { 3247 fire(); 3248 } 3249 } 3250 return this; 3251 }, 3252 3253 // Remove a callback from the list 3254 remove: function() { 3255 jQuery.each( arguments, function( _, arg ) { 3256 var index; 3257 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 3258 list.splice( index, 1 ); 3259 3260 // Handle firing indexes 3261 if ( index <= firingIndex ) { 3262 firingIndex--; 3263 } 3264 } 3265 } ); 3266 return this; 3267 }, 3268 3269 // Check if a given callback is in the list. 3270 // If no argument is given, return whether or not list has callbacks attached. 3271 has: function( fn ) { 3272 return fn ? 3273 jQuery.inArray( fn, list ) > -1 : 3274 list.length > 0; 3275 }, 3276 3277 // Remove all callbacks from the list 3278 empty: function() { 3279 if ( list ) { 3280 list = []; 3281 } 3282 return this; 3283 }, 3284 3285 // Disable .fire and .add 3286 // Abort any current/pending executions 3287 // Clear all callbacks and values 3288 disable: function() { 3289 locked = queue = []; 3290 list = memory = ""; 3291 return this; 3292 }, 3293 disabled: function() { 3294 return !list; 3295 }, 3296 3297 // Disable .fire 3298 // Also disable .add unless we have memory (since it would have no effect) 3299 // Abort any pending executions 3300 lock: function() { 3301 locked = queue = []; 3302 if ( !memory ) { 3303 list = memory = ""; 3304 } 3305 return this; 3306 }, 3307 locked: function() { 3308 return !!locked; 3309 }, 3310 3311 // Call all callbacks with the given context and arguments 3312 fireWith: function( context, args ) { 3313 if ( !locked ) { 3314 args = args || []; 3315 args = [ context, args.slice ? args.slice() : args ]; 3316 queue.push( args ); 3317 if ( !firing ) { 3318 fire(); 3319 } 3320 } 3321 return this; 3322 }, 3323 3324 // Call all the callbacks with the given arguments 3325 fire: function() { 3326 self.fireWith( this, arguments ); 3327 return this; 3328 }, 3329 3330 // To know if the callbacks have already been called at least once 3331 fired: function() { 3332 return !!fired; 3333 } 3334 }; 3335 3336 return self; 3337}; 3338 3339 3340jQuery.extend( { 3341 3342 Deferred: function( func ) { 3343 var tuples = [ 3344 3345 // action, add listener, listener list, final state 3346 [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], 3347 [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], 3348 [ "notify", "progress", jQuery.Callbacks( "memory" ) ] 3349 ], 3350 state = "pending", 3351 promise = { 3352 state: function() { 3353 return state; 3354 }, 3355 always: function() { 3356 deferred.done( arguments ).fail( arguments ); 3357 return this; 3358 }, 3359 then: function( /* fnDone, fnFail, fnProgress */ ) { 3360 var fns = arguments; 3361 return jQuery.Deferred( function( newDefer ) { 3362 jQuery.each( tuples, function( i, tuple ) { 3363 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 3364 3365 // deferred[ done | fail | progress ] for forwarding actions to newDefer 3366 deferred[ tuple[ 1 ] ]( function() { 3367 var returned = fn && fn.apply( this, arguments ); 3368 if ( returned && jQuery.isFunction( returned.promise ) ) { 3369 returned.promise() 3370 .progress( newDefer.notify ) 3371 .done( newDefer.resolve ) 3372 .fail( newDefer.reject ); 3373 } else { 3374 newDefer[ tuple[ 0 ] + "With" ]( 3375 this === promise ? newDefer.promise() : this, 3376 fn ? [ returned ] : arguments 3377 ); 3378 } 3379 } ); 3380 } ); 3381 fns = null; 3382 } ).promise(); 3383 }, 3384 3385 // Get a promise for this deferred 3386 // If obj is provided, the promise aspect is added to the object 3387 promise: function( obj ) { 3388 return obj != null ? jQuery.extend( obj, promise ) : promise; 3389 } 3390 }, 3391 deferred = {}; 3392 3393 // Keep pipe for back-compat 3394 promise.pipe = promise.then; 3395 3396 // Add list-specific methods 3397 jQuery.each( tuples, function( i, tuple ) { 3398 var list = tuple[ 2 ], 3399 stateString = tuple[ 3 ]; 3400 3401 // promise[ done | fail | progress ] = list.add 3402 promise[ tuple[ 1 ] ] = list.add; 3403 3404 // Handle state 3405 if ( stateString ) { 3406 list.add( function() { 3407 3408 // state = [ resolved | rejected ] 3409 state = stateString; 3410 3411 // [ reject_list | resolve_list ].disable; progress_list.lock 3412 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 3413 } 3414 3415 // deferred[ resolve | reject | notify ] 3416 deferred[ tuple[ 0 ] ] = function() { 3417 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); 3418 return this; 3419 }; 3420 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 3421 } ); 3422 3423 // Make the deferred a promise 3424 promise.promise( deferred ); 3425 3426 // Call given func if any 3427 if ( func ) { 3428 func.call( deferred, deferred ); 3429 } 3430 3431 // All done! 3432 return deferred; 3433 }, 3434 3435 // Deferred helper 3436 when: function( subordinate /* , ..., subordinateN */ ) { 3437 var i = 0, 3438 resolveValues = slice.call( arguments ), 3439 length = resolveValues.length, 3440 3441 // the count of uncompleted subordinates 3442 remaining = length !== 1 || 3443 ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, 3444 3445 // the master Deferred. 3446 // If resolveValues consist of only a single Deferred, just use that. 3447 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 3448 3449 // Update function for both resolve and progress values 3450 updateFunc = function( i, contexts, values ) { 3451 return function( value ) { 3452 contexts[ i ] = this; 3453 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 3454 if ( values === progressValues ) { 3455 deferred.notifyWith( contexts, values ); 3456 } else if ( !( --remaining ) ) { 3457 deferred.resolveWith( contexts, values ); 3458 } 3459 }; 3460 }, 3461 3462 progressValues, progressContexts, resolveContexts; 3463 3464 // Add listeners to Deferred subordinates; treat others as resolved 3465 if ( length > 1 ) { 3466 progressValues = new Array( length ); 3467 progressContexts = new Array( length ); 3468 resolveContexts = new Array( length ); 3469 for ( ; i < length; i++ ) { 3470 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { 3471 resolveValues[ i ].promise() 3472 .progress( updateFunc( i, progressContexts, progressValues ) ) 3473 .done( updateFunc( i, resolveContexts, resolveValues ) ) 3474 .fail( deferred.reject ); 3475 } else { 3476 --remaining; 3477 } 3478 } 3479 } 3480 3481 // If we're not waiting on anything, resolve the master 3482 if ( !remaining ) { 3483 deferred.resolveWith( resolveContexts, resolveValues ); 3484 } 3485 3486 return deferred.promise(); 3487 } 3488} ); 3489 3490 3491// The deferred used on DOM ready 3492var readyList; 3493 3494jQuery.fn.ready = function( fn ) { 3495 3496 // Add the callback 3497 jQuery.ready.promise().done( fn ); 3498 3499 return this; 3500}; 3501 3502jQuery.extend( { 3503 3504 // Is the DOM ready to be used? Set to true once it occurs. 3505 isReady: false, 3506 3507 // A counter to track how many items to wait for before 3508 // the ready event fires. See #6781 3509 readyWait: 1, 3510 3511 // Hold (or release) the ready event 3512 holdReady: function( hold ) { 3513 if ( hold ) { 3514 jQuery.readyWait++; 3515 } else { 3516 jQuery.ready( true ); 3517 } 3518 }, 3519 3520 // Handle when the DOM is ready 3521 ready: function( wait ) { 3522 3523 // Abort if there are pending holds or we're already ready 3524 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 3525 return; 3526 } 3527 3528 // Remember that the DOM is ready 3529 jQuery.isReady = true; 3530 3531 // If a normal DOM Ready event fired, decrement, and wait if need be 3532 if ( wait !== true && --jQuery.readyWait > 0 ) { 3533 return; 3534 } 3535 3536 // If there are functions bound, to execute 3537 readyList.resolveWith( document, [ jQuery ] ); 3538 3539 // Trigger any bound ready events 3540 if ( jQuery.fn.triggerHandler ) { 3541 jQuery( document ).triggerHandler( "ready" ); 3542 jQuery( document ).off( "ready" ); 3543 } 3544 } 3545} ); 3546 3547/** 3548 * The ready event handler and self cleanup method 3549 */ 3550function completed() { 3551 document.removeEventListener( "DOMContentLoaded", completed ); 3552 window.removeEventListener( "load", completed ); 3553 jQuery.ready(); 3554} 3555 3556jQuery.ready.promise = function( obj ) { 3557 if ( !readyList ) { 3558 3559 readyList = jQuery.Deferred(); 3560 3561 // Catch cases where $(document).ready() is called 3562 // after the browser event has already occurred. 3563 // Support: IE9-10 only 3564 // Older IE sometimes signals "interactive" too soon 3565 if ( document.readyState === "complete" || 3566 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 3567 3568 // Handle it asynchronously to allow scripts the opportunity to delay ready 3569 window.setTimeout( jQuery.ready ); 3570 3571 } else { 3572 3573 // Use the handy event callback 3574 document.addEventListener( "DOMContentLoaded", completed ); 3575 3576 // A fallback to window.onload, that will always work 3577 window.addEventListener( "load", completed ); 3578 } 3579 } 3580 return readyList.promise( obj ); 3581}; 3582 3583// Kick off the DOM ready check even if the user does not 3584jQuery.ready.promise(); 3585 3586 3587 3588 3589// Multifunctional method to get and set values of a collection 3590// The value/s can optionally be executed if it's a function 3591var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 3592 var i = 0, 3593 len = elems.length, 3594 bulk = key == null; 3595 3596 // Sets many values 3597 if ( jQuery.type( key ) === "object" ) { 3598 chainable = true; 3599 for ( i in key ) { 3600 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 3601 } 3602 3603 // Sets one value 3604 } else if ( value !== undefined ) { 3605 chainable = true; 3606 3607 if ( !jQuery.isFunction( value ) ) { 3608 raw = true; 3609 } 3610 3611 if ( bulk ) { 3612 3613 // Bulk operations run against the entire set 3614 if ( raw ) { 3615 fn.call( elems, value ); 3616 fn = null; 3617 3618 // ...except when executing function values 3619 } else { 3620 bulk = fn; 3621 fn = function( elem, key, value ) { 3622 return bulk.call( jQuery( elem ), value ); 3623 }; 3624 } 3625 } 3626 3627 if ( fn ) { 3628 for ( ; i < len; i++ ) { 3629 fn( 3630 elems[ i ], key, raw ? 3631 value : 3632 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 3633 ); 3634 } 3635 } 3636 } 3637 3638 return chainable ? 3639 elems : 3640 3641 // Gets 3642 bulk ? 3643 fn.call( elems ) : 3644 len ? fn( elems[ 0 ], key ) : emptyGet; 3645}; 3646var acceptData = function( owner ) { 3647 3648 // Accepts only: 3649 // - Node 3650 // - Node.ELEMENT_NODE 3651 // - Node.DOCUMENT_NODE 3652 // - Object 3653 // - Any 3654 /* jshint -W018 */ 3655 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 3656}; 3657 3658 3659 3660 3661function Data() { 3662 this.expando = jQuery.expando + Data.uid++; 3663} 3664 3665Data.uid = 1; 3666 3667Data.prototype = { 3668 3669 register: function( owner, initial ) { 3670 var value = initial || {}; 3671 3672 // If it is a node unlikely to be stringify-ed or looped over 3673 // use plain assignment 3674 if ( owner.nodeType ) { 3675 owner[ this.expando ] = value; 3676 3677 // Otherwise secure it in a non-enumerable, non-writable property 3678 // configurability must be true to allow the property to be 3679 // deleted with the delete operator 3680 } else { 3681 Object.defineProperty( owner, this.expando, { 3682 value: value, 3683 writable: true, 3684 configurable: true 3685 } ); 3686 } 3687 return owner[ this.expando ]; 3688 }, 3689 cache: function( owner ) { 3690 3691 // We can accept data for non-element nodes in modern browsers, 3692 // but we should not, see #8335. 3693 // Always return an empty object. 3694 if ( !acceptData( owner ) ) { 3695 return {}; 3696 } 3697 3698 // Check if the owner object already has a cache 3699 var value = owner[ this.expando ]; 3700 3701 // If not, create one 3702 if ( !value ) { 3703 value = {}; 3704 3705 // We can accept data for non-element nodes in modern browsers, 3706 // but we should not, see #8335. 3707 // Always return an empty object. 3708 if ( acceptData( owner ) ) { 3709 3710 // If it is a node unlikely to be stringify-ed or looped over 3711 // use plain assignment 3712 if ( owner.nodeType ) { 3713 owner[ this.expando ] = value; 3714 3715 // Otherwise secure it in a non-enumerable property 3716 // configurable must be true to allow the property to be 3717 // deleted when data is removed 3718 } else { 3719 Object.defineProperty( owner, this.expando, { 3720 value: value, 3721 configurable: true 3722 } ); 3723 } 3724 } 3725 } 3726 3727 return value; 3728 }, 3729 set: function( owner, data, value ) { 3730 var prop, 3731 cache = this.cache( owner ); 3732 3733 // Handle: [ owner, key, value ] args 3734 if ( typeof data === "string" ) { 3735 cache[ data ] = value; 3736 3737 // Handle: [ owner, { properties } ] args 3738 } else { 3739 3740 // Copy the properties one-by-one to the cache object 3741 for ( prop in data ) { 3742 cache[ prop ] = data[ prop ]; 3743 } 3744 } 3745 return cache; 3746 }, 3747 get: function( owner, key ) { 3748 return key === undefined ? 3749 this.cache( owner ) : 3750 owner[ this.expando ] && owner[ this.expando ][ key ]; 3751 }, 3752 access: function( owner, key, value ) { 3753 var stored; 3754 3755 // In cases where either: 3756 // 3757 // 1. No key was specified 3758 // 2. A string key was specified, but no value provided 3759 // 3760 // Take the "read" path and allow the get method to determine 3761 // which value to return, respectively either: 3762 // 3763 // 1. The entire cache object 3764 // 2. The data stored at the key 3765 // 3766 if ( key === undefined || 3767 ( ( key && typeof key === "string" ) && value === undefined ) ) { 3768 3769 stored = this.get( owner, key ); 3770 3771 return stored !== undefined ? 3772 stored : this.get( owner, jQuery.camelCase( key ) ); 3773 } 3774 3775 // When the key is not a string, or both a key and value 3776 // are specified, set or extend (existing objects) with either: 3777 // 3778 // 1. An object of properties 3779 // 2. A key and value 3780 // 3781 this.set( owner, key, value ); 3782 3783 // Since the "set" path can have two possible entry points 3784 // return the expected data based on which path was taken[*] 3785 return value !== undefined ? value : key; 3786 }, 3787 remove: function( owner, key ) { 3788 var i, name, camel, 3789 cache = owner[ this.expando ]; 3790 3791 if ( cache === undefined ) { 3792 return; 3793 } 3794 3795 if ( key === undefined ) { 3796 this.register( owner ); 3797 3798 } else { 3799 3800 // Support array or space separated string of keys 3801 if ( jQuery.isArray( key ) ) { 3802 3803 // If "name" is an array of keys... 3804 // When data is initially created, via ("key", "val") signature, 3805 // keys will be converted to camelCase. 3806 // Since there is no way to tell _how_ a key was added, remove 3807 // both plain key and camelCase key. #12786 3808 // This will only penalize the array argument path. 3809 name = key.concat( key.map( jQuery.camelCase ) ); 3810 } else { 3811 camel = jQuery.camelCase( key ); 3812 3813 // Try the string as a key before any manipulation 3814 if ( key in cache ) { 3815 name = [ key, camel ]; 3816 } else { 3817 3818 // If a key with the spaces exists, use it. 3819 // Otherwise, create an array by matching non-whitespace 3820 name = camel; 3821 name = name in cache ? 3822 [ name ] : ( name.match( rnotwhite ) || [] ); 3823 } 3824 } 3825 3826 i = name.length; 3827 3828 while ( i-- ) { 3829 delete cache[ name[ i ] ]; 3830 } 3831 } 3832 3833 // Remove the expando if there's no more data 3834 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 3835 3836 // Support: Chrome <= 35-45+ 3837 // Webkit & Blink performance suffers when deleting properties 3838 // from DOM nodes, so set to undefined instead 3839 // https://code.google.com/p/chromium/issues/detail?id=378607 3840 if ( owner.nodeType ) { 3841 owner[ this.expando ] = undefined; 3842 } else { 3843 delete owner[ this.expando ]; 3844 } 3845 } 3846 }, 3847 hasData: function( owner ) { 3848 var cache = owner[ this.expando ]; 3849 return cache !== undefined && !jQuery.isEmptyObject( cache ); 3850 } 3851}; 3852var dataPriv = new Data(); 3853 3854var dataUser = new Data(); 3855 3856 3857 3858// Implementation Summary 3859// 3860// 1. Enforce API surface and semantic compatibility with 1.9.x branch 3861// 2. Improve the module's maintainability by reducing the storage 3862// paths to a single mechanism. 3863// 3. Use the same single mechanism to support "private" and "user" data. 3864// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 3865// 5. Avoid exposing implementation details on user objects (eg. expando properties) 3866// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 3867 3868var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 3869 rmultiDash = /[A-Z]/g; 3870 3871function dataAttr( elem, key, data ) { 3872 var name; 3873 3874 // If nothing was found internally, try to fetch any 3875 // data from the HTML5 data-* attribute 3876 if ( data === undefined && elem.nodeType === 1 ) { 3877 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 3878 data = elem.getAttribute( name ); 3879 3880 if ( typeof data === "string" ) { 3881 try { 3882 data = data === "true" ? true : 3883 data === "false" ? false : 3884 data === "null" ? null : 3885 3886 // Only convert to a number if it doesn't change the string 3887 +data + "" === data ? +data : 3888 rbrace.test( data ) ? jQuery.parseJSON( data ) : 3889 data; 3890 } catch ( e ) {} 3891 3892 // Make sure we set the data so it isn't changed later 3893 dataUser.set( elem, key, data ); 3894 } else { 3895 data = undefined; 3896 } 3897 } 3898 return data; 3899} 3900 3901jQuery.extend( { 3902 hasData: function( elem ) { 3903 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 3904 }, 3905 3906 data: function( elem, name, data ) { 3907 return dataUser.access( elem, name, data ); 3908 }, 3909 3910 removeData: function( elem, name ) { 3911 dataUser.remove( elem, name ); 3912 }, 3913 3914 // TODO: Now that all calls to _data and _removeData have been replaced 3915 // with direct calls to dataPriv methods, these can be deprecated. 3916 _data: function( elem, name, data ) { 3917 return dataPriv.access( elem, name, data ); 3918 }, 3919 3920 _removeData: function( elem, name ) { 3921 dataPriv.remove( elem, name ); 3922 } 3923} ); 3924 3925jQuery.fn.extend( { 3926 data: function( key, value ) { 3927 var i, name, data, 3928 elem = this[ 0 ], 3929 attrs = elem && elem.attributes; 3930 3931 // Gets all values 3932 if ( key === undefined ) { 3933 if ( this.length ) { 3934 data = dataUser.get( elem ); 3935 3936 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 3937 i = attrs.length; 3938 while ( i-- ) { 3939 3940 // Support: IE11+ 3941 // The attrs elements can be null (#14894) 3942 if ( attrs[ i ] ) { 3943 name = attrs[ i ].name; 3944 if ( name.indexOf( "data-" ) === 0 ) { 3945 name = jQuery.camelCase( name.slice( 5 ) ); 3946 dataAttr( elem, name, data[ name ] ); 3947 } 3948 } 3949 } 3950 dataPriv.set( elem, "hasDataAttrs", true ); 3951 } 3952 } 3953 3954 return data; 3955 } 3956 3957 // Sets multiple values 3958 if ( typeof key === "object" ) { 3959 return this.each( function() { 3960 dataUser.set( this, key ); 3961 } ); 3962 } 3963 3964 return access( this, function( value ) { 3965 var data, camelKey; 3966 3967 // The calling jQuery object (element matches) is not empty 3968 // (and therefore has an element appears at this[ 0 ]) and the 3969 // `value` parameter was not undefined. An empty jQuery object 3970 // will result in `undefined` for elem = this[ 0 ] which will 3971 // throw an exception if an attempt to read a data cache is made. 3972 if ( elem && value === undefined ) { 3973 3974 // Attempt to get data from the cache 3975 // with the key as-is 3976 data = dataUser.get( elem, key ) || 3977 3978 // Try to find dashed key if it exists (gh-2779) 3979 // This is for 2.2.x only 3980 dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() ); 3981 3982 if ( data !== undefined ) { 3983 return data; 3984 } 3985 3986 camelKey = jQuery.camelCase( key ); 3987 3988 // Attempt to get data from the cache 3989 // with the key camelized 3990 data = dataUser.get( elem, camelKey ); 3991 if ( data !== undefined ) { 3992 return data; 3993 } 3994 3995 // Attempt to "discover" the data in 3996 // HTML5 custom data-* attrs 3997 data = dataAttr( elem, camelKey, undefined ); 3998 if ( data !== undefined ) { 3999 return data; 4000 } 4001 4002 // We tried really hard, but the data doesn't exist. 4003 return; 4004 } 4005 4006 // Set the data... 4007 camelKey = jQuery.camelCase( key ); 4008 this.each( function() { 4009 4010 // First, attempt to store a copy or reference of any 4011 // data that might've been store with a camelCased key. 4012 var data = dataUser.get( this, camelKey ); 4013 4014 // For HTML5 data-* attribute interop, we have to 4015 // store property names with dashes in a camelCase form. 4016 // This might not apply to all properties...* 4017 dataUser.set( this, camelKey, value ); 4018 4019 // *... In the case of properties that might _actually_ 4020 // have dashes, we need to also store a copy of that 4021 // unchanged property. 4022 if ( key.indexOf( "-" ) > -1 && data !== undefined ) { 4023 dataUser.set( this, key, value ); 4024 } 4025 } ); 4026 }, null, value, arguments.length > 1, null, true ); 4027 }, 4028 4029 removeData: function( key ) { 4030 return this.each( function() { 4031 dataUser.remove( this, key ); 4032 } ); 4033 } 4034} ); 4035 4036 4037jQuery.extend( { 4038 queue: function( elem, type, data ) { 4039 var queue; 4040 4041 if ( elem ) { 4042 type = ( type || "fx" ) + "queue"; 4043 queue = dataPriv.get( elem, type ); 4044 4045 // Speed up dequeue by getting out quickly if this is just a lookup 4046 if ( data ) { 4047 if ( !queue || jQuery.isArray( data ) ) { 4048 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 4049 } else { 4050 queue.push( data ); 4051 } 4052 } 4053 return queue || []; 4054 } 4055 }, 4056 4057 dequeue: function( elem, type ) { 4058 type = type || "fx"; 4059 4060 var queue = jQuery.queue( elem, type ), 4061 startLength = queue.length, 4062 fn = queue.shift(), 4063 hooks = jQuery._queueHooks( elem, type ), 4064 next = function() { 4065 jQuery.dequeue( elem, type ); 4066 }; 4067 4068 // If the fx queue is dequeued, always remove the progress sentinel 4069 if ( fn === "inprogress" ) { 4070 fn = queue.shift(); 4071 startLength--; 4072 } 4073 4074 if ( fn ) { 4075 4076 // Add a progress sentinel to prevent the fx queue from being 4077 // automatically dequeued 4078 if ( type === "fx" ) { 4079 queue.unshift( "inprogress" ); 4080 } 4081 4082 // Clear up the last queue stop function 4083 delete hooks.stop; 4084 fn.call( elem, next, hooks ); 4085 } 4086 4087 if ( !startLength && hooks ) { 4088 hooks.empty.fire(); 4089 } 4090 }, 4091 4092 // Not public - generate a queueHooks object, or return the current one 4093 _queueHooks: function( elem, type ) { 4094 var key = type + "queueHooks"; 4095 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 4096 empty: jQuery.Callbacks( "once memory" ).add( function() { 4097 dataPriv.remove( elem, [ type + "queue", key ] ); 4098 } ) 4099 } ); 4100 } 4101} ); 4102 4103jQuery.fn.extend( { 4104 queue: function( type, data ) { 4105 var setter = 2; 4106 4107 if ( typeof type !== "string" ) { 4108 data = type; 4109 type = "fx"; 4110 setter--; 4111 } 4112 4113 if ( arguments.length < setter ) { 4114 return jQuery.queue( this[ 0 ], type ); 4115 } 4116 4117 return data === undefined ? 4118 this : 4119 this.each( function() { 4120 var queue = jQuery.queue( this, type, data ); 4121 4122 // Ensure a hooks for this queue 4123 jQuery._queueHooks( this, type ); 4124 4125 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 4126 jQuery.dequeue( this, type ); 4127 } 4128 } ); 4129 }, 4130 dequeue: function( type ) { 4131 return this.each( function() { 4132 jQuery.dequeue( this, type ); 4133 } ); 4134 }, 4135 clearQueue: function( type ) { 4136 return this.queue( type || "fx", [] ); 4137 }, 4138 4139 // Get a promise resolved when queues of a certain type 4140 // are emptied (fx is the type by default) 4141 promise: function( type, obj ) { 4142 var tmp, 4143 count = 1, 4144 defer = jQuery.Deferred(), 4145 elements = this, 4146 i = this.length, 4147 resolve = function() { 4148 if ( !( --count ) ) { 4149 defer.resolveWith( elements, [ elements ] ); 4150 } 4151 }; 4152 4153 if ( typeof type !== "string" ) { 4154 obj = type; 4155 type = undefined; 4156 } 4157 type = type || "fx"; 4158 4159 while ( i-- ) { 4160 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 4161 if ( tmp && tmp.empty ) { 4162 count++; 4163 tmp.empty.add( resolve ); 4164 } 4165 } 4166 resolve(); 4167 return defer.promise( obj ); 4168 } 4169} ); 4170var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 4171 4172var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 4173 4174 4175var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 4176 4177var isHidden = function( elem, el ) { 4178 4179 // isHidden might be called from jQuery#filter function; 4180 // in that case, element will be second argument 4181 elem = el || elem; 4182 return jQuery.css( elem, "display" ) === "none" || 4183 !jQuery.contains( elem.ownerDocument, elem ); 4184 }; 4185 4186 4187 4188function adjustCSS( elem, prop, valueParts, tween ) { 4189 var adjusted, 4190 scale = 1, 4191 maxIterations = 20, 4192 currentValue = tween ? 4193 function() { return tween.cur(); } : 4194 function() { return jQuery.css( elem, prop, "" ); }, 4195 initial = currentValue(), 4196 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 4197 4198 // Starting value computation is required for potential unit mismatches 4199 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 4200 rcssNum.exec( jQuery.css( elem, prop ) ); 4201 4202 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 4203 4204 // Trust units reported by jQuery.css 4205 unit = unit || initialInUnit[ 3 ]; 4206 4207 // Make sure we update the tween properties later on 4208 valueParts = valueParts || []; 4209 4210 // Iteratively approximate from a nonzero starting point 4211 initialInUnit = +initial || 1; 4212 4213 do { 4214 4215 // If previous iteration zeroed out, double until we get *something*. 4216 // Use string for doubling so we don't accidentally see scale as unchanged below 4217 scale = scale || ".5"; 4218 4219 // Adjust and apply 4220 initialInUnit = initialInUnit / scale; 4221 jQuery.style( elem, prop, initialInUnit + unit ); 4222 4223 // Update scale, tolerating zero or NaN from tween.cur() 4224 // Break the loop if scale is unchanged or perfect, or if we've just had enough. 4225 } while ( 4226 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations 4227 ); 4228 } 4229 4230 if ( valueParts ) { 4231 initialInUnit = +initialInUnit || +initial || 0; 4232 4233 // Apply relative offset (+=/-=) if specified 4234 adjusted = valueParts[ 1 ] ? 4235 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 4236 +valueParts[ 2 ]; 4237 if ( tween ) { 4238 tween.unit = unit; 4239 tween.start = initialInUnit; 4240 tween.end = adjusted; 4241 } 4242 } 4243 return adjusted; 4244} 4245var rcheckableType = ( /^(?:checkbox|radio)$/i ); 4246 4247var rtagName = ( /<([\w:-]+)/ ); 4248 4249var rscriptType = ( /^$|\/(?:java|ecma)script/i ); 4250 4251 4252 4253// We have to close these tags to support XHTML (#13200) 4254var wrapMap = { 4255 4256 // Support: IE9 4257 option: [ 1, "<select multiple='multiple'>", "</select>" ], 4258 4259 // XHTML parsers do not magically insert elements in the 4260 // same way that tag soup parsers do. So we cannot shorten 4261 // this by omitting <tbody> or other required elements. 4262 thead: [ 1, "<table>", "</table>" ], 4263 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 4264 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4265 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4266 4267 _default: [ 0, "", "" ] 4268}; 4269 4270// Support: IE9 4271wrapMap.optgroup = wrapMap.option; 4272 4273wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4274wrapMap.th = wrapMap.td; 4275 4276 4277function getAll( context, tag ) { 4278 4279 // Support: IE9-11+ 4280 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 4281 var ret = typeof context.getElementsByTagName !== "undefined" ? 4282 context.getElementsByTagName( tag || "*" ) : 4283 typeof context.querySelectorAll !== "undefined" ? 4284 context.querySelectorAll( tag || "*" ) : 4285 []; 4286 4287 return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 4288 jQuery.merge( [ context ], ret ) : 4289 ret; 4290} 4291 4292 4293// Mark scripts as having already been evaluated 4294function setGlobalEval( elems, refElements ) { 4295 var i = 0, 4296 l = elems.length; 4297 4298 for ( ; i < l; i++ ) { 4299 dataPriv.set( 4300 elems[ i ], 4301 "globalEval", 4302 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 4303 ); 4304 } 4305} 4306 4307 4308var rhtml = /<|&#?\w+;/; 4309 4310function buildFragment( elems, context, scripts, selection, ignored ) { 4311 var elem, tmp, tag, wrap, contains, j, 4312 fragment = context.createDocumentFragment(), 4313 nodes = [], 4314 i = 0, 4315 l = elems.length; 4316 4317 for ( ; i < l; i++ ) { 4318 elem = elems[ i ]; 4319 4320 if ( elem || elem === 0 ) { 4321 4322 // Add nodes directly 4323 if ( jQuery.type( elem ) === "object" ) { 4324 4325 // Support: Android<4.1, PhantomJS<2 4326 // push.apply(_, arraylike) throws on ancient WebKit 4327 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 4328 4329 // Convert non-html into a text node 4330 } else if ( !rhtml.test( elem ) ) { 4331 nodes.push( context.createTextNode( elem ) ); 4332 4333 // Convert html into DOM nodes 4334 } else { 4335 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 4336 4337 // Deserialize a standard representation 4338 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 4339 wrap = wrapMap[ tag ] || wrapMap._default; 4340 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 4341 4342 // Descend through wrappers to the right content 4343 j = wrap[ 0 ]; 4344 while ( j-- ) { 4345 tmp = tmp.lastChild; 4346 } 4347 4348 // Support: Android<4.1, PhantomJS<2 4349 // push.apply(_, arraylike) throws on ancient WebKit 4350 jQuery.merge( nodes, tmp.childNodes ); 4351 4352 // Remember the top-level container 4353 tmp = fragment.firstChild; 4354 4355 // Ensure the created nodes are orphaned (#12392) 4356 tmp.textContent = ""; 4357 } 4358 } 4359 } 4360 4361 // Remove wrapper from fragment 4362 fragment.textContent = ""; 4363 4364 i = 0; 4365 while ( ( elem = nodes[ i++ ] ) ) { 4366 4367 // Skip elements already in the context collection (trac-4087) 4368 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 4369 if ( ignored ) { 4370 ignored.push( elem ); 4371 } 4372 continue; 4373 } 4374 4375 contains = jQuery.contains( elem.ownerDocument, elem ); 4376 4377 // Append to fragment 4378 tmp = getAll( fragment.appendChild( elem ), "script" ); 4379 4380 // Preserve script evaluation history 4381 if ( contains ) { 4382 setGlobalEval( tmp ); 4383 } 4384 4385 // Capture executables 4386 if ( scripts ) { 4387 j = 0; 4388 while ( ( elem = tmp[ j++ ] ) ) { 4389 if ( rscriptType.test( elem.type || "" ) ) { 4390 scripts.push( elem ); 4391 } 4392 } 4393 } 4394 } 4395 4396 return fragment; 4397} 4398 4399 4400( function() { 4401 var fragment = document.createDocumentFragment(), 4402 div = fragment.appendChild( document.createElement( "div" ) ), 4403 input = document.createElement( "input" ); 4404 4405 // Support: Android 4.0-4.3, Safari<=5.1 4406 // Check state lost if the name is set (#11217) 4407 // Support: Windows Web Apps (WWA) 4408 // `name` and `type` must use .setAttribute for WWA (#14901) 4409 input.setAttribute( "type", "radio" ); 4410 input.setAttribute( "checked", "checked" ); 4411 input.setAttribute( "name", "t" ); 4412 4413 div.appendChild( input ); 4414 4415 // Support: Safari<=5.1, Android<4.2 4416 // Older WebKit doesn't clone checked state correctly in fragments 4417 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 4418 4419 // Support: IE<=11+ 4420 // Make sure textarea (and checkbox) defaultValue is properly cloned 4421 div.innerHTML = "<textarea>x</textarea>"; 4422 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 4423} )(); 4424 4425 4426var 4427 rkeyEvent = /^key/, 4428 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 4429 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 4430 4431function returnTrue() { 4432 return true; 4433} 4434 4435function returnFalse() { 4436 return false; 4437} 4438 4439// Support: IE9 4440// See #13393 for more info 4441function safeActiveElement() { 4442 try { 4443 return document.activeElement; 4444 } catch ( err ) { } 4445} 4446 4447function on( elem, types, selector, data, fn, one ) { 4448 var origFn, type; 4449 4450 // Types can be a map of types/handlers 4451 if ( typeof types === "object" ) { 4452 4453 // ( types-Object, selector, data ) 4454 if ( typeof selector !== "string" ) { 4455 4456 // ( types-Object, data ) 4457 data = data || selector; 4458 selector = undefined; 4459 } 4460 for ( type in types ) { 4461 on( elem, type, selector, data, types[ type ], one ); 4462 } 4463 return elem; 4464 } 4465 4466 if ( data == null && fn == null ) { 4467 4468 // ( types, fn ) 4469 fn = selector; 4470 data = selector = undefined; 4471 } else if ( fn == null ) { 4472 if ( typeof selector === "string" ) { 4473 4474 // ( types, selector, fn ) 4475 fn = data; 4476 data = undefined; 4477 } else { 4478 4479 // ( types, data, fn ) 4480 fn = data; 4481 data = selector; 4482 selector = undefined; 4483 } 4484 } 4485 if ( fn === false ) { 4486 fn = returnFalse; 4487 } else if ( !fn ) { 4488 return elem; 4489 } 4490 4491 if ( one === 1 ) { 4492 origFn = fn; 4493 fn = function( event ) { 4494 4495 // Can use an empty set, since event contains the info 4496 jQuery().off( event ); 4497 return origFn.apply( this, arguments ); 4498 }; 4499 4500 // Use same guid so caller can remove using origFn 4501 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 4502 } 4503 return elem.each( function() { 4504 jQuery.event.add( this, types, fn, data, selector ); 4505 } ); 4506} 4507 4508/* 4509 * Helper functions for managing events -- not part of the public interface. 4510 * Props to Dean Edwards' addEvent library for many of the ideas. 4511 */ 4512jQuery.event = { 4513 4514 global: {}, 4515 4516 add: function( elem, types, handler, data, selector ) { 4517 4518 var handleObjIn, eventHandle, tmp, 4519 events, t, handleObj, 4520 special, handlers, type, namespaces, origType, 4521 elemData = dataPriv.get( elem ); 4522 4523 // Don't attach events to noData or text/comment nodes (but allow plain objects) 4524 if ( !elemData ) { 4525 return; 4526 } 4527 4528 // Caller can pass in an object of custom data in lieu of the handler 4529 if ( handler.handler ) { 4530 handleObjIn = handler; 4531 handler = handleObjIn.handler; 4532 selector = handleObjIn.selector; 4533 } 4534 4535 // Make sure that the handler has a unique ID, used to find/remove it later 4536 if ( !handler.guid ) { 4537 handler.guid = jQuery.guid++; 4538 } 4539 4540 // Init the element's event structure and main handler, if this is the first 4541 if ( !( events = elemData.events ) ) { 4542 events = elemData.events = {}; 4543 } 4544 if ( !( eventHandle = elemData.handle ) ) { 4545 eventHandle = elemData.handle = function( e ) { 4546 4547 // Discard the second event of a jQuery.event.trigger() and 4548 // when an event is called after a page has unloaded 4549 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 4550 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 4551 }; 4552 } 4553 4554 // Handle multiple events separated by a space 4555 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4556 t = types.length; 4557 while ( t-- ) { 4558 tmp = rtypenamespace.exec( types[ t ] ) || []; 4559 type = origType = tmp[ 1 ]; 4560 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4561 4562 // There *must* be a type, no attaching namespace-only handlers 4563 if ( !type ) { 4564 continue; 4565 } 4566 4567 // If event changes its type, use the special event handlers for the changed type 4568 special = jQuery.event.special[ type ] || {}; 4569 4570 // If selector defined, determine special event api type, otherwise given type 4571 type = ( selector ? special.delegateType : special.bindType ) || type; 4572 4573 // Update special based on newly reset type 4574 special = jQuery.event.special[ type ] || {}; 4575 4576 // handleObj is passed to all event handlers 4577 handleObj = jQuery.extend( { 4578 type: type, 4579 origType: origType, 4580 data: data, 4581 handler: handler, 4582 guid: handler.guid, 4583 selector: selector, 4584 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 4585 namespace: namespaces.join( "." ) 4586 }, handleObjIn ); 4587 4588 // Init the event handler queue if we're the first 4589 if ( !( handlers = events[ type ] ) ) { 4590 handlers = events[ type ] = []; 4591 handlers.delegateCount = 0; 4592 4593 // Only use addEventListener if the special events handler returns false 4594 if ( !special.setup || 4595 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 4596 4597 if ( elem.addEventListener ) { 4598 elem.addEventListener( type, eventHandle ); 4599 } 4600 } 4601 } 4602 4603 if ( special.add ) { 4604 special.add.call( elem, handleObj ); 4605 4606 if ( !handleObj.handler.guid ) { 4607 handleObj.handler.guid = handler.guid; 4608 } 4609 } 4610 4611 // Add to the element's handler list, delegates in front 4612 if ( selector ) { 4613 handlers.splice( handlers.delegateCount++, 0, handleObj ); 4614 } else { 4615 handlers.push( handleObj ); 4616 } 4617 4618 // Keep track of which events have ever been used, for event optimization 4619 jQuery.event.global[ type ] = true; 4620 } 4621 4622 }, 4623 4624 // Detach an event or set of events from an element 4625 remove: function( elem, types, handler, selector, mappedTypes ) { 4626 4627 var j, origCount, tmp, 4628 events, t, handleObj, 4629 special, handlers, type, namespaces, origType, 4630 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 4631 4632 if ( !elemData || !( events = elemData.events ) ) { 4633 return; 4634 } 4635 4636 // Once for each type.namespace in types; type may be omitted 4637 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4638 t = types.length; 4639 while ( t-- ) { 4640 tmp = rtypenamespace.exec( types[ t ] ) || []; 4641 type = origType = tmp[ 1 ]; 4642 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4643 4644 // Unbind all events (on this namespace, if provided) for the element 4645 if ( !type ) { 4646 for ( type in events ) { 4647 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 4648 } 4649 continue; 4650 } 4651 4652 special = jQuery.event.special[ type ] || {}; 4653 type = ( selector ? special.delegateType : special.bindType ) || type; 4654 handlers = events[ type ] || []; 4655 tmp = tmp[ 2 ] && 4656 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 4657 4658 // Remove matching events 4659 origCount = j = handlers.length; 4660 while ( j-- ) { 4661 handleObj = handlers[ j ]; 4662 4663 if ( ( mappedTypes || origType === handleObj.origType ) && 4664 ( !handler || handler.guid === handleObj.guid ) && 4665 ( !tmp || tmp.test( handleObj.namespace ) ) && 4666 ( !selector || selector === handleObj.selector || 4667 selector === "**" && handleObj.selector ) ) { 4668 handlers.splice( j, 1 ); 4669 4670 if ( handleObj.selector ) { 4671 handlers.delegateCount--; 4672 } 4673 if ( special.remove ) { 4674 special.remove.call( elem, handleObj ); 4675 } 4676 } 4677 } 4678 4679 // Remove generic event handler if we removed something and no more handlers exist 4680 // (avoids potential for endless recursion during removal of special event handlers) 4681 if ( origCount && !handlers.length ) { 4682 if ( !special.teardown || 4683 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 4684 4685 jQuery.removeEvent( elem, type, elemData.handle ); 4686 } 4687 4688 delete events[ type ]; 4689 } 4690 } 4691 4692 // Remove data and the expando if it's no longer used 4693 if ( jQuery.isEmptyObject( events ) ) { 4694 dataPriv.remove( elem, "handle events" ); 4695 } 4696 }, 4697 4698 dispatch: function( event ) { 4699 4700 // Make a writable jQuery.Event from the native event object 4701 event = jQuery.event.fix( event ); 4702 4703 var i, j, ret, matched, handleObj, 4704 handlerQueue = [], 4705 args = slice.call( arguments ), 4706 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], 4707 special = jQuery.event.special[ event.type ] || {}; 4708 4709 // Use the fix-ed jQuery.Event rather than the (read-only) native event 4710 args[ 0 ] = event; 4711 event.delegateTarget = this; 4712 4713 // Call the preDispatch hook for the mapped type, and let it bail if desired 4714 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 4715 return; 4716 } 4717 4718 // Determine handlers 4719 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 4720 4721 // Run delegates first; they may want to stop propagation beneath us 4722 i = 0; 4723 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 4724 event.currentTarget = matched.elem; 4725 4726 j = 0; 4727 while ( ( handleObj = matched.handlers[ j++ ] ) && 4728 !event.isImmediatePropagationStopped() ) { 4729 4730 // Triggered event must either 1) have no namespace, or 2) have namespace(s) 4731 // a subset or equal to those in the bound event (both can have no namespace). 4732 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { 4733 4734 event.handleObj = handleObj; 4735 event.data = handleObj.data; 4736 4737 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 4738 handleObj.handler ).apply( matched.elem, args ); 4739 4740 if ( ret !== undefined ) { 4741 if ( ( event.result = ret ) === false ) { 4742 event.preventDefault(); 4743 event.stopPropagation(); 4744 } 4745 } 4746 } 4747 } 4748 } 4749 4750 // Call the postDispatch hook for the mapped type 4751 if ( special.postDispatch ) { 4752 special.postDispatch.call( this, event ); 4753 } 4754 4755 return event.result; 4756 }, 4757 4758 handlers: function( event, handlers ) { 4759 var i, matches, sel, handleObj, 4760 handlerQueue = [], 4761 delegateCount = handlers.delegateCount, 4762 cur = event.target; 4763 4764 // Support (at least): Chrome, IE9 4765 // Find delegate handlers 4766 // Black-hole SVG <use> instance trees (#13180) 4767 // 4768 // Support: Firefox<=42+ 4769 // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) 4770 if ( delegateCount && cur.nodeType && 4771 ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { 4772 4773 for ( ; cur !== this; cur = cur.parentNode || this ) { 4774 4775 // Don't check non-elements (#13208) 4776 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 4777 if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { 4778 matches = []; 4779 for ( i = 0; i < delegateCount; i++ ) { 4780 handleObj = handlers[ i ]; 4781 4782 // Don't conflict with Object.prototype properties (#13203) 4783 sel = handleObj.selector + " "; 4784 4785 if ( matches[ sel ] === undefined ) { 4786 matches[ sel ] = handleObj.needsContext ? 4787 jQuery( sel, this ).index( cur ) > -1 : 4788 jQuery.find( sel, this, null, [ cur ] ).length; 4789 } 4790 if ( matches[ sel ] ) { 4791 matches.push( handleObj ); 4792 } 4793 } 4794 if ( matches.length ) { 4795 handlerQueue.push( { elem: cur, handlers: matches } ); 4796 } 4797 } 4798 } 4799 } 4800 4801 // Add the remaining (directly-bound) handlers 4802 if ( delegateCount < handlers.length ) { 4803 handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); 4804 } 4805 4806 return handlerQueue; 4807 }, 4808 4809 // Includes some event props shared by KeyEvent and MouseEvent 4810 props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + 4811 "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), 4812 4813 fixHooks: {}, 4814 4815 keyHooks: { 4816 props: "char charCode key keyCode".split( " " ), 4817 filter: function( event, original ) { 4818 4819 // Add which for key events 4820 if ( event.which == null ) { 4821 event.which = original.charCode != null ? original.charCode : original.keyCode; 4822 } 4823 4824 return event; 4825 } 4826 }, 4827 4828 mouseHooks: { 4829 props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " + 4830 "screenX screenY toElement" ).split( " " ), 4831 filter: function( event, original ) { 4832 var eventDoc, doc, body, 4833 button = original.button; 4834 4835 // Calculate pageX/Y if missing and clientX/Y available 4836 if ( event.pageX == null && original.clientX != null ) { 4837 eventDoc = event.target.ownerDocument || document; 4838 doc = eventDoc.documentElement; 4839 body = eventDoc.body; 4840 4841 event.pageX = original.clientX + 4842 ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - 4843 ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 4844 event.pageY = original.clientY + 4845 ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - 4846 ( doc && doc.clientTop || body && body.clientTop || 0 ); 4847 } 4848 4849 // Add which for click: 1 === left; 2 === middle; 3 === right 4850 // Note: button is not normalized, so don't use it 4851 if ( !event.which && button !== undefined ) { 4852 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 4853 } 4854 4855 return event; 4856 } 4857 }, 4858 4859 fix: function( event ) { 4860 if ( event[ jQuery.expando ] ) { 4861 return event; 4862 } 4863 4864 // Create a writable copy of the event object and normalize some properties 4865 var i, prop, copy, 4866 type = event.type, 4867 originalEvent = event, 4868 fixHook = this.fixHooks[ type ]; 4869 4870 if ( !fixHook ) { 4871 this.fixHooks[ type ] = fixHook = 4872 rmouseEvent.test( type ) ? this.mouseHooks : 4873 rkeyEvent.test( type ) ? this.keyHooks : 4874 {}; 4875 } 4876 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 4877 4878 event = new jQuery.Event( originalEvent ); 4879 4880 i = copy.length; 4881 while ( i-- ) { 4882 prop = copy[ i ]; 4883 event[ prop ] = originalEvent[ prop ]; 4884 } 4885 4886 // Support: Cordova 2.5 (WebKit) (#13255) 4887 // All events should have a target; Cordova deviceready doesn't 4888 if ( !event.target ) { 4889 event.target = document; 4890 } 4891 4892 // Support: Safari 6.0+, Chrome<28 4893 // Target should not be a text node (#504, #13143) 4894 if ( event.target.nodeType === 3 ) { 4895 event.target = event.target.parentNode; 4896 } 4897 4898 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 4899 }, 4900 4901 special: { 4902 load: { 4903 4904 // Prevent triggered image.load events from bubbling to window.load 4905 noBubble: true 4906 }, 4907 focus: { 4908 4909 // Fire native event if possible so blur/focus sequence is correct 4910 trigger: function() { 4911 if ( this !== safeActiveElement() && this.focus ) { 4912 this.focus(); 4913 return false; 4914 } 4915 }, 4916 delegateType: "focusin" 4917 }, 4918 blur: { 4919 trigger: function() { 4920 if ( this === safeActiveElement() && this.blur ) { 4921 this.blur(); 4922 return false; 4923 } 4924 }, 4925 delegateType: "focusout" 4926 }, 4927 click: { 4928 4929 // For checkbox, fire native event so checked state will be right 4930 trigger: function() { 4931 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { 4932 this.click(); 4933 return false; 4934 } 4935 }, 4936 4937 // For cross-browser consistency, don't fire native .click() on links 4938 _default: function( event ) { 4939 return jQuery.nodeName( event.target, "a" ); 4940 } 4941 }, 4942 4943 beforeunload: { 4944 postDispatch: function( event ) { 4945 4946 // Support: Firefox 20+ 4947 // Firefox doesn't alert if the returnValue field is not set. 4948 if ( event.result !== undefined && event.originalEvent ) { 4949 event.originalEvent.returnValue = event.result; 4950 } 4951 } 4952 } 4953 } 4954}; 4955 4956jQuery.removeEvent = function( elem, type, handle ) { 4957 4958 // This "if" is needed for plain objects 4959 if ( elem.removeEventListener ) { 4960 elem.removeEventListener( type, handle ); 4961 } 4962}; 4963 4964jQuery.Event = function( src, props ) { 4965 4966 // Allow instantiation without the 'new' keyword 4967 if ( !( this instanceof jQuery.Event ) ) { 4968 return new jQuery.Event( src, props ); 4969 } 4970 4971 // Event object 4972 if ( src && src.type ) { 4973 this.originalEvent = src; 4974 this.type = src.type; 4975 4976 // Events bubbling up the document may have been marked as prevented 4977 // by a handler lower down the tree; reflect the correct value. 4978 this.isDefaultPrevented = src.defaultPrevented || 4979 src.defaultPrevented === undefined && 4980 4981 // Support: Android<4.0 4982 src.returnValue === false ? 4983 returnTrue : 4984 returnFalse; 4985 4986 // Event type 4987 } else { 4988 this.type = src; 4989 } 4990 4991 // Put explicitly provided properties onto the event object 4992 if ( props ) { 4993 jQuery.extend( this, props ); 4994 } 4995 4996 // Create a timestamp if incoming event doesn't have one 4997 this.timeStamp = src && src.timeStamp || jQuery.now(); 4998 4999 // Mark it as fixed 5000 this[ jQuery.expando ] = true; 5001}; 5002 5003// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 5004// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 5005jQuery.Event.prototype = { 5006 constructor: jQuery.Event, 5007 isDefaultPrevented: returnFalse, 5008 isPropagationStopped: returnFalse, 5009 isImmediatePropagationStopped: returnFalse, 5010 isSimulated: false, 5011 5012 preventDefault: function() { 5013 var e = this.originalEvent; 5014 5015 this.isDefaultPrevented = returnTrue; 5016 5017 if ( e && !this.isSimulated ) { 5018 e.preventDefault(); 5019 } 5020 }, 5021 stopPropagation: function() { 5022 var e = this.originalEvent; 5023 5024 this.isPropagationStopped = returnTrue; 5025 5026 if ( e && !this.isSimulated ) { 5027 e.stopPropagation(); 5028 } 5029 }, 5030 stopImmediatePropagation: function() { 5031 var e = this.originalEvent; 5032 5033 this.isImmediatePropagationStopped = returnTrue; 5034 5035 if ( e && !this.isSimulated ) { 5036 e.stopImmediatePropagation(); 5037 } 5038 5039 this.stopPropagation(); 5040 } 5041}; 5042 5043// Create mouseenter/leave events using mouseover/out and event-time checks 5044// so that event delegation works in jQuery. 5045// Do the same for pointerenter/pointerleave and pointerover/pointerout 5046// 5047// Support: Safari 7 only 5048// Safari sends mouseenter too often; see: 5049// https://code.google.com/p/chromium/issues/detail?id=470258 5050// for the description of the bug (it existed in older Chrome versions as well). 5051jQuery.each( { 5052 mouseenter: "mouseover", 5053 mouseleave: "mouseout", 5054 pointerenter: "pointerover", 5055 pointerleave: "pointerout" 5056}, function( orig, fix ) { 5057 jQuery.event.special[ orig ] = { 5058 delegateType: fix, 5059 bindType: fix, 5060 5061 handle: function( event ) { 5062 var ret, 5063 target = this, 5064 related = event.relatedTarget, 5065 handleObj = event.handleObj; 5066 5067 // For mouseenter/leave call the handler if related is outside the target. 5068 // NB: No relatedTarget if the mouse left/entered the browser window 5069 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 5070 event.type = handleObj.origType; 5071 ret = handleObj.handler.apply( this, arguments ); 5072 event.type = fix; 5073 } 5074 return ret; 5075 } 5076 }; 5077} ); 5078 5079jQuery.fn.extend( { 5080 on: function( types, selector, data, fn ) { 5081 return on( this, types, selector, data, fn ); 5082 }, 5083 one: function( types, selector, data, fn ) { 5084 return on( this, types, selector, data, fn, 1 ); 5085 }, 5086 off: function( types, selector, fn ) { 5087 var handleObj, type; 5088 if ( types && types.preventDefault && types.handleObj ) { 5089 5090 // ( event ) dispatched jQuery.Event 5091 handleObj = types.handleObj; 5092 jQuery( types.delegateTarget ).off( 5093 handleObj.namespace ? 5094 handleObj.origType + "." + handleObj.namespace : 5095 handleObj.origType, 5096 handleObj.selector, 5097 handleObj.handler 5098 ); 5099 return this; 5100 } 5101 if ( typeof types === "object" ) { 5102 5103 // ( types-object [, selector] ) 5104 for ( type in types ) { 5105 this.off( type, selector, types[ type ] ); 5106 } 5107 return this; 5108 } 5109 if ( selector === false || typeof selector === "function" ) { 5110 5111 // ( types [, fn] ) 5112 fn = selector; 5113 selector = undefined; 5114 } 5115 if ( fn === false ) { 5116 fn = returnFalse; 5117 } 5118 return this.each( function() { 5119 jQuery.event.remove( this, types, fn, selector ); 5120 } ); 5121 } 5122} ); 5123 5124 5125var 5126 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, 5127 5128 // Support: IE 10-11, Edge 10240+ 5129 // In IE/Edge using regex groups here causes severe slowdowns. 5130 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 5131 rnoInnerhtml = /<script|<style|<link/i, 5132 5133 // checked="checked" or checked 5134 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5135 rscriptTypeMasked = /^true\/(.*)/, 5136 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 5137 5138// Manipulating tables requires a tbody 5139function manipulationTarget( elem, content ) { 5140 return jQuery.nodeName( elem, "table" ) && 5141 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? 5142 5143 elem.getElementsByTagName( "tbody" )[ 0 ] || 5144 elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : 5145 elem; 5146} 5147 5148// Replace/restore the type attribute of script elements for safe DOM manipulation 5149function disableScript( elem ) { 5150 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 5151 return elem; 5152} 5153function restoreScript( elem ) { 5154 var match = rscriptTypeMasked.exec( elem.type ); 5155 5156 if ( match ) { 5157 elem.type = match[ 1 ]; 5158 } else { 5159 elem.removeAttribute( "type" ); 5160 } 5161 5162 return elem; 5163} 5164 5165function cloneCopyEvent( src, dest ) { 5166 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; 5167 5168 if ( dest.nodeType !== 1 ) { 5169 return; 5170 } 5171 5172 // 1. Copy private data: events, handlers, etc. 5173 if ( dataPriv.hasData( src ) ) { 5174 pdataOld = dataPriv.access( src ); 5175 pdataCur = dataPriv.set( dest, pdataOld ); 5176 events = pdataOld.events; 5177 5178 if ( events ) { 5179 delete pdataCur.handle; 5180 pdataCur.events = {}; 5181 5182 for ( type in events ) { 5183 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 5184 jQuery.event.add( dest, type, events[ type ][ i ] ); 5185 } 5186 } 5187 } 5188 } 5189 5190 // 2. Copy user data 5191 if ( dataUser.hasData( src ) ) { 5192 udataOld = dataUser.access( src ); 5193 udataCur = jQuery.extend( {}, udataOld ); 5194 5195 dataUser.set( dest, udataCur ); 5196 } 5197} 5198 5199// Fix IE bugs, see support tests 5200function fixInput( src, dest ) { 5201 var nodeName = dest.nodeName.toLowerCase(); 5202 5203 // Fails to persist the checked state of a cloned checkbox or radio button. 5204 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 5205 dest.checked = src.checked; 5206 5207 // Fails to return the selected option to the default selected state when cloning options 5208 } else if ( nodeName === "input" || nodeName === "textarea" ) { 5209 dest.defaultValue = src.defaultValue; 5210 } 5211} 5212 5213function domManip( collection, args, callback, ignored ) { 5214 5215 // Flatten any nested arrays 5216 args = concat.apply( [], args ); 5217 5218 var fragment, first, scripts, hasScripts, node, doc, 5219 i = 0, 5220 l = collection.length, 5221 iNoClone = l - 1, 5222 value = args[ 0 ], 5223 isFunction = jQuery.isFunction( value ); 5224 5225 // We can't cloneNode fragments that contain checked, in WebKit 5226 if ( isFunction || 5227 ( l > 1 && typeof value === "string" && 5228 !support.checkClone && rchecked.test( value ) ) ) { 5229 return collection.each( function( index ) { 5230 var self = collection.eq( index ); 5231 if ( isFunction ) { 5232 args[ 0 ] = value.call( this, index, self.html() ); 5233 } 5234 domManip( self, args, callback, ignored ); 5235 } ); 5236 } 5237 5238 if ( l ) { 5239 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 5240 first = fragment.firstChild; 5241 5242 if ( fragment.childNodes.length === 1 ) { 5243 fragment = first; 5244 } 5245 5246 // Require either new content or an interest in ignored elements to invoke the callback 5247 if ( first || ignored ) { 5248 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 5249 hasScripts = scripts.length; 5250 5251 // Use the original fragment for the last item 5252 // instead of the first because it can end up 5253 // being emptied incorrectly in certain situations (#8070). 5254 for ( ; i < l; i++ ) { 5255 node = fragment; 5256 5257 if ( i !== iNoClone ) { 5258 node = jQuery.clone( node, true, true ); 5259 5260 // Keep references to cloned scripts for later restoration 5261 if ( hasScripts ) { 5262 5263 // Support: Android<4.1, PhantomJS<2 5264 // push.apply(_, arraylike) throws on ancient WebKit 5265 jQuery.merge( scripts, getAll( node, "script" ) ); 5266 } 5267 } 5268 5269 callback.call( collection[ i ], node, i ); 5270 } 5271 5272 if ( hasScripts ) { 5273 doc = scripts[ scripts.length - 1 ].ownerDocument; 5274 5275 // Reenable scripts 5276 jQuery.map( scripts, restoreScript ); 5277 5278 // Evaluate executable scripts on first document insertion 5279 for ( i = 0; i < hasScripts; i++ ) { 5280 node = scripts[ i ]; 5281 if ( rscriptType.test( node.type || "" ) && 5282 !dataPriv.access( node, "globalEval" ) && 5283 jQuery.contains( doc, node ) ) { 5284 5285 if ( node.src ) { 5286 5287 // Optional AJAX dependency, but won't run scripts if not present 5288 if ( jQuery._evalUrl ) { 5289 jQuery._evalUrl( node.src ); 5290 } 5291 } else { 5292 jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); 5293 } 5294 } 5295 } 5296 } 5297 } 5298 } 5299 5300 return collection; 5301} 5302 5303function remove( elem, selector, keepData ) { 5304 var node, 5305 nodes = selector ? jQuery.filter( selector, elem ) : elem, 5306 i = 0; 5307 5308 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 5309 if ( !keepData && node.nodeType === 1 ) { 5310 jQuery.cleanData( getAll( node ) ); 5311 } 5312 5313 if ( node.parentNode ) { 5314 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { 5315 setGlobalEval( getAll( node, "script" ) ); 5316 } 5317 node.parentNode.removeChild( node ); 5318 } 5319 } 5320 5321 return elem; 5322} 5323 5324jQuery.extend( { 5325 htmlPrefilter: function( html ) { 5326 return html.replace( rxhtmlTag, "<$1></$2>" ); 5327 }, 5328 5329 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 5330 var i, l, srcElements, destElements, 5331 clone = elem.cloneNode( true ), 5332 inPage = jQuery.contains( elem.ownerDocument, elem ); 5333 5334 // Fix IE cloning issues 5335 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 5336 !jQuery.isXMLDoc( elem ) ) { 5337 5338 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 5339 destElements = getAll( clone ); 5340 srcElements = getAll( elem ); 5341 5342 for ( i = 0, l = srcElements.length; i < l; i++ ) { 5343 fixInput( srcElements[ i ], destElements[ i ] ); 5344 } 5345 } 5346 5347 // Copy the events from the original to the clone 5348 if ( dataAndEvents ) { 5349 if ( deepDataAndEvents ) { 5350 srcElements = srcElements || getAll( elem ); 5351 destElements = destElements || getAll( clone ); 5352 5353 for ( i = 0, l = srcElements.length; i < l; i++ ) { 5354 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 5355 } 5356 } else { 5357 cloneCopyEvent( elem, clone ); 5358 } 5359 } 5360 5361 // Preserve script evaluation history 5362 destElements = getAll( clone, "script" ); 5363 if ( destElements.length > 0 ) { 5364 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 5365 } 5366 5367 // Return the cloned set 5368 return clone; 5369 }, 5370 5371 cleanData: function( elems ) { 5372 var data, elem, type, 5373 special = jQuery.event.special, 5374 i = 0; 5375 5376 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 5377 if ( acceptData( elem ) ) { 5378 if ( ( data = elem[ dataPriv.expando ] ) ) { 5379 if ( data.events ) { 5380 for ( type in data.events ) { 5381 if ( special[ type ] ) { 5382 jQuery.event.remove( elem, type ); 5383 5384 // This is a shortcut to avoid jQuery.event.remove's overhead 5385 } else { 5386 jQuery.removeEvent( elem, type, data.handle ); 5387 } 5388 } 5389 } 5390 5391 // Support: Chrome <= 35-45+ 5392 // Assign undefined instead of using delete, see Data#remove 5393 elem[ dataPriv.expando ] = undefined; 5394 } 5395 if ( elem[ dataUser.expando ] ) { 5396 5397 // Support: Chrome <= 35-45+ 5398 // Assign undefined instead of using delete, see Data#remove 5399 elem[ dataUser.expando ] = undefined; 5400 } 5401 } 5402 } 5403 } 5404} ); 5405 5406jQuery.fn.extend( { 5407 5408 // Keep domManip exposed until 3.0 (gh-2225) 5409 domManip: domManip, 5410 5411 detach: function( selector ) { 5412 return remove( this, selector, true ); 5413 }, 5414 5415 remove: function( selector ) { 5416 return remove( this, selector ); 5417 }, 5418 5419 text: function( value ) { 5420 return access( this, function( value ) { 5421 return value === undefined ? 5422 jQuery.text( this ) : 5423 this.empty().each( function() { 5424 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5425 this.textContent = value; 5426 } 5427 } ); 5428 }, null, value, arguments.length ); 5429 }, 5430 5431 append: function() { 5432 return domManip( this, arguments, function( elem ) { 5433 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5434 var target = manipulationTarget( this, elem ); 5435 target.appendChild( elem ); 5436 } 5437 } ); 5438 }, 5439 5440 prepend: function() { 5441 return domManip( this, arguments, function( elem ) { 5442 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5443 var target = manipulationTarget( this, elem ); 5444 target.insertBefore( elem, target.firstChild ); 5445 } 5446 } ); 5447 }, 5448 5449 before: function() { 5450 return domManip( this, arguments, function( elem ) { 5451 if ( this.parentNode ) { 5452 this.parentNode.insertBefore( elem, this ); 5453 } 5454 } ); 5455 }, 5456 5457 after: function() { 5458 return domManip( this, arguments, function( elem ) { 5459 if ( this.parentNode ) { 5460 this.parentNode.insertBefore( elem, this.nextSibling ); 5461 } 5462 } ); 5463 }, 5464 5465 empty: function() { 5466 var elem, 5467 i = 0; 5468 5469 for ( ; ( elem = this[ i ] ) != null; i++ ) { 5470 if ( elem.nodeType === 1 ) { 5471 5472 // Prevent memory leaks 5473 jQuery.cleanData( getAll( elem, false ) ); 5474 5475 // Remove any remaining nodes 5476 elem.textContent = ""; 5477 } 5478 } 5479 5480 return this; 5481 }, 5482 5483 clone: function( dataAndEvents, deepDataAndEvents ) { 5484 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 5485 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 5486 5487 return this.map( function() { 5488 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 5489 } ); 5490 }, 5491 5492 html: function( value ) { 5493 return access( this, function( value ) { 5494 var elem = this[ 0 ] || {}, 5495 i = 0, 5496 l = this.length; 5497 5498 if ( value === undefined && elem.nodeType === 1 ) { 5499 return elem.innerHTML; 5500 } 5501 5502 // See if we can take a shortcut and just use innerHTML 5503 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 5504 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 5505 5506 value = jQuery.htmlPrefilter( value ); 5507 5508 try { 5509 for ( ; i < l; i++ ) { 5510 elem = this[ i ] || {}; 5511 5512 // Remove element nodes and prevent memory leaks 5513 if ( elem.nodeType === 1 ) { 5514 jQuery.cleanData( getAll( elem, false ) ); 5515 elem.innerHTML = value; 5516 } 5517 } 5518 5519 elem = 0; 5520 5521 // If using innerHTML throws an exception, use the fallback method 5522 } catch ( e ) {} 5523 } 5524 5525 if ( elem ) { 5526 this.empty().append( value ); 5527 } 5528 }, null, value, arguments.length ); 5529 }, 5530 5531 replaceWith: function() { 5532 var ignored = []; 5533 5534 // Make the changes, replacing each non-ignored context element with the new content 5535 return domManip( this, arguments, function( elem ) { 5536 var parent = this.parentNode; 5537 5538 if ( jQuery.inArray( this, ignored ) < 0 ) { 5539 jQuery.cleanData( getAll( this ) ); 5540 if ( parent ) { 5541 parent.replaceChild( elem, this ); 5542 } 5543 } 5544 5545 // Force callback invocation 5546 }, ignored ); 5547 } 5548} ); 5549 5550jQuery.each( { 5551 appendTo: "append", 5552 prependTo: "prepend", 5553 insertBefore: "before", 5554 insertAfter: "after", 5555 replaceAll: "replaceWith" 5556}, function( name, original ) { 5557 jQuery.fn[ name ] = function( selector ) { 5558 var elems, 5559 ret = [], 5560 insert = jQuery( selector ), 5561 last = insert.length - 1, 5562 i = 0; 5563 5564 for ( ; i <= last; i++ ) { 5565 elems = i === last ? this : this.clone( true ); 5566 jQuery( insert[ i ] )[ original ]( elems ); 5567 5568 // Support: QtWebKit 5569 // .get() because push.apply(_, arraylike) throws 5570 push.apply( ret, elems.get() ); 5571 } 5572 5573 return this.pushStack( ret ); 5574 }; 5575} ); 5576 5577 5578var iframe, 5579 elemdisplay = { 5580 5581 // Support: Firefox 5582 // We have to pre-define these values for FF (#10227) 5583 HTML: "block", 5584 BODY: "block" 5585 }; 5586 5587/** 5588 * Retrieve the actual display of a element 5589 * @param {String} name nodeName of the element 5590 * @param {Object} doc Document object 5591 */ 5592 5593// Called only from within defaultDisplay 5594function actualDisplay( name, doc ) { 5595 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 5596 5597 display = jQuery.css( elem[ 0 ], "display" ); 5598 5599 // We don't have any data stored on the element, 5600 // so use "detach" method as fast way to get rid of the element 5601 elem.detach(); 5602 5603 return display; 5604} 5605 5606/** 5607 * Try to determine the default display value of an element 5608 * @param {String} nodeName 5609 */ 5610function defaultDisplay( nodeName ) { 5611 var doc = document, 5612 display = elemdisplay[ nodeName ]; 5613 5614 if ( !display ) { 5615 display = actualDisplay( nodeName, doc ); 5616 5617 // If the simple way fails, read from inside an iframe 5618 if ( display === "none" || !display ) { 5619 5620 // Use the already-created iframe if possible 5621 iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) 5622 .appendTo( doc.documentElement ); 5623 5624 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 5625 doc = iframe[ 0 ].contentDocument; 5626 5627 // Support: IE 5628 doc.write(); 5629 doc.close(); 5630 5631 display = actualDisplay( nodeName, doc ); 5632 iframe.detach(); 5633 } 5634 5635 // Store the correct default display 5636 elemdisplay[ nodeName ] = display; 5637 } 5638 5639 return display; 5640} 5641var rmargin = ( /^margin/ ); 5642 5643var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 5644 5645var getStyles = function( elem ) { 5646 5647 // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 5648 // IE throws on elements created in popups 5649 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 5650 var view = elem.ownerDocument.defaultView; 5651 5652 if ( !view || !view.opener ) { 5653 view = window; 5654 } 5655 5656 return view.getComputedStyle( elem ); 5657 }; 5658 5659var swap = function( elem, options, callback, args ) { 5660 var ret, name, 5661 old = {}; 5662 5663 // Remember the old values, and insert the new ones 5664 for ( name in options ) { 5665 old[ name ] = elem.style[ name ]; 5666 elem.style[ name ] = options[ name ]; 5667 } 5668 5669 ret = callback.apply( elem, args || [] ); 5670 5671 // Revert the old values 5672 for ( name in options ) { 5673 elem.style[ name ] = old[ name ]; 5674 } 5675 5676 return ret; 5677}; 5678 5679 5680var documentElement = document.documentElement; 5681 5682 5683 5684( function() { 5685 var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, 5686 container = document.createElement( "div" ), 5687 div = document.createElement( "div" ); 5688 5689 // Finish early in limited (non-browser) environments 5690 if ( !div.style ) { 5691 return; 5692 } 5693 5694 // Support: IE9-11+ 5695 // Style of cloned element affects source element cloned (#8908) 5696 div.style.backgroundClip = "content-box"; 5697 div.cloneNode( true ).style.backgroundClip = ""; 5698 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 5699 5700 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + 5701 "padding:0;margin-top:1px;position:absolute"; 5702 container.appendChild( div ); 5703 5704 // Executing both pixelPosition & boxSizingReliable tests require only one layout 5705 // so they're executed at the same time to save the second computation. 5706 function computeStyleTests() { 5707 div.style.cssText = 5708 5709 // Support: Firefox<29, Android 2.3 5710 // Vendor-prefix box-sizing 5711 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" + 5712 "position:relative;display:block;" + 5713 "margin:auto;border:1px;padding:1px;" + 5714 "top:1%;width:50%"; 5715 div.innerHTML = ""; 5716 documentElement.appendChild( container ); 5717 5718 var divStyle = window.getComputedStyle( div ); 5719 pixelPositionVal = divStyle.top !== "1%"; 5720 reliableMarginLeftVal = divStyle.marginLeft === "2px"; 5721 boxSizingReliableVal = divStyle.width === "4px"; 5722 5723 // Support: Android 4.0 - 4.3 only 5724 // Some styles come back with percentage values, even though they shouldn't 5725 div.style.marginRight = "50%"; 5726 pixelMarginRightVal = divStyle.marginRight === "4px"; 5727 5728 documentElement.removeChild( container ); 5729 } 5730 5731 jQuery.extend( support, { 5732 pixelPosition: function() { 5733 5734 // This test is executed only once but we still do memoizing 5735 // since we can use the boxSizingReliable pre-computing. 5736 // No need to check if the test was already performed, though. 5737 computeStyleTests(); 5738 return pixelPositionVal; 5739 }, 5740 boxSizingReliable: function() { 5741 if ( boxSizingReliableVal == null ) { 5742 computeStyleTests(); 5743 } 5744 return boxSizingReliableVal; 5745 }, 5746 pixelMarginRight: function() { 5747 5748 // Support: Android 4.0-4.3 5749 // We're checking for boxSizingReliableVal here instead of pixelMarginRightVal 5750 // since that compresses better and they're computed together anyway. 5751 if ( boxSizingReliableVal == null ) { 5752 computeStyleTests(); 5753 } 5754 return pixelMarginRightVal; 5755 }, 5756 reliableMarginLeft: function() { 5757 5758 // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 5759 if ( boxSizingReliableVal == null ) { 5760 computeStyleTests(); 5761 } 5762 return reliableMarginLeftVal; 5763 }, 5764 reliableMarginRight: function() { 5765 5766 // Support: Android 2.3 5767 // Check if div with explicit width and no margin-right incorrectly 5768 // gets computed margin-right based on width of container. (#3333) 5769 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 5770 // This support function is only executed once so no memoizing is needed. 5771 var ret, 5772 marginDiv = div.appendChild( document.createElement( "div" ) ); 5773 5774 // Reset CSS: box-sizing; display; margin; border; padding 5775 marginDiv.style.cssText = div.style.cssText = 5776 5777 // Support: Android 2.3 5778 // Vendor-prefix box-sizing 5779 "-webkit-box-sizing:content-box;box-sizing:content-box;" + 5780 "display:block;margin:0;border:0;padding:0"; 5781 marginDiv.style.marginRight = marginDiv.style.width = "0"; 5782 div.style.width = "1px"; 5783 documentElement.appendChild( container ); 5784 5785 ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight ); 5786 5787 documentElement.removeChild( container ); 5788 div.removeChild( marginDiv ); 5789 5790 return ret; 5791 } 5792 } ); 5793} )(); 5794 5795 5796function curCSS( elem, name, computed ) { 5797 var width, minWidth, maxWidth, ret, 5798 style = elem.style; 5799 5800 computed = computed || getStyles( elem ); 5801 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; 5802 5803 // Support: Opera 12.1x only 5804 // Fall back to style even without computed 5805 // computed is undefined for elems on document fragments 5806 if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { 5807 ret = jQuery.style( elem, name ); 5808 } 5809 5810 // Support: IE9 5811 // getPropertyValue is only needed for .css('filter') (#12537) 5812 if ( computed ) { 5813 5814 // A tribute to the "awesome hack by Dean Edwards" 5815 // Android Browser returns percentage for some values, 5816 // but width seems to be reliably pixels. 5817 // This is against the CSSOM draft spec: 5818 // http://dev.w3.org/csswg/cssom/#resolved-values 5819 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { 5820 5821 // Remember the original values 5822 width = style.width; 5823 minWidth = style.minWidth; 5824 maxWidth = style.maxWidth; 5825 5826 // Put in the new values to get a computed value out 5827 style.minWidth = style.maxWidth = style.width = ret; 5828 ret = computed.width; 5829 5830 // Revert the changed values 5831 style.width = width; 5832 style.minWidth = minWidth; 5833 style.maxWidth = maxWidth; 5834 } 5835 } 5836 5837 return ret !== undefined ? 5838 5839 // Support: IE9-11+ 5840 // IE returns zIndex value as an integer. 5841 ret + "" : 5842 ret; 5843} 5844 5845 5846function addGetHookIf( conditionFn, hookFn ) { 5847 5848 // Define the hook, we'll check on the first run if it's really needed. 5849 return { 5850 get: function() { 5851 if ( conditionFn() ) { 5852 5853 // Hook not needed (or it's not possible to use it due 5854 // to missing dependency), remove it. 5855 delete this.get; 5856 return; 5857 } 5858 5859 // Hook needed; redefine it so that the support test is not executed again. 5860 return ( this.get = hookFn ).apply( this, arguments ); 5861 } 5862 }; 5863} 5864 5865 5866var 5867 5868 // Swappable if display is none or starts with table 5869 // except "table", "table-cell", or "table-caption" 5870 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 5871 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 5872 5873 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 5874 cssNormalTransform = { 5875 letterSpacing: "0", 5876 fontWeight: "400" 5877 }, 5878 5879 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], 5880 emptyStyle = document.createElement( "div" ).style; 5881 5882// Return a css property mapped to a potentially vendor prefixed property 5883function vendorPropName( name ) { 5884 5885 // Shortcut for names that are not vendor prefixed 5886 if ( name in emptyStyle ) { 5887 return name; 5888 } 5889 5890 // Check for vendor prefixed names 5891 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 5892 i = cssPrefixes.length; 5893 5894 while ( i-- ) { 5895 name = cssPrefixes[ i ] + capName; 5896 if ( name in emptyStyle ) { 5897 return name; 5898 } 5899 } 5900} 5901 5902function setPositiveNumber( elem, value, subtract ) { 5903 5904 // Any relative (+/-) values have already been 5905 // normalized at this point 5906 var matches = rcssNum.exec( value ); 5907 return matches ? 5908 5909 // Guard against undefined "subtract", e.g., when used as in cssHooks 5910 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 5911 value; 5912} 5913 5914function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 5915 var i = extra === ( isBorderBox ? "border" : "content" ) ? 5916 5917 // If we already have the right measurement, avoid augmentation 5918 4 : 5919 5920 // Otherwise initialize for horizontal or vertical properties 5921 name === "width" ? 1 : 0, 5922 5923 val = 0; 5924 5925 for ( ; i < 4; i += 2 ) { 5926 5927 // Both box models exclude margin, so add it if we want it 5928 if ( extra === "margin" ) { 5929 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 5930 } 5931 5932 if ( isBorderBox ) { 5933 5934 // border-box includes padding, so remove it if we want content 5935 if ( extra === "content" ) { 5936 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 5937 } 5938 5939 // At this point, extra isn't border nor margin, so remove border 5940 if ( extra !== "margin" ) { 5941 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 5942 } 5943 } else { 5944 5945 // At this point, extra isn't content, so add padding 5946 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 5947 5948 // At this point, extra isn't content nor padding, so add border 5949 if ( extra !== "padding" ) { 5950 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 5951 } 5952 } 5953 } 5954 5955 return val; 5956} 5957 5958function getWidthOrHeight( elem, name, extra ) { 5959 5960 // Start with offset property, which is equivalent to the border-box value 5961 var valueIsBorderBox = true, 5962 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 5963 styles = getStyles( elem ), 5964 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 5965 5966 // Some non-html elements return undefined for offsetWidth, so check for null/undefined 5967 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 5968 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 5969 if ( val <= 0 || val == null ) { 5970 5971 // Fall back to computed then uncomputed css if necessary 5972 val = curCSS( elem, name, styles ); 5973 if ( val < 0 || val == null ) { 5974 val = elem.style[ name ]; 5975 } 5976 5977 // Computed unit is not pixels. Stop here and return. 5978 if ( rnumnonpx.test( val ) ) { 5979 return val; 5980 } 5981 5982 // Check for style in case a browser which returns unreliable values 5983 // for getComputedStyle silently falls back to the reliable elem.style 5984 valueIsBorderBox = isBorderBox && 5985 ( support.boxSizingReliable() || val === elem.style[ name ] ); 5986 5987 // Normalize "", auto, and prepare for extra 5988 val = parseFloat( val ) || 0; 5989 } 5990 5991 // Use the active box-sizing model to add/subtract irrelevant styles 5992 return ( val + 5993 augmentWidthOrHeight( 5994 elem, 5995 name, 5996 extra || ( isBorderBox ? "border" : "content" ), 5997 valueIsBorderBox, 5998 styles 5999 ) 6000 ) + "px"; 6001} 6002 6003function showHide( elements, show ) { 6004 var display, elem, hidden, 6005 values = [], 6006 index = 0, 6007 length = elements.length; 6008 6009 for ( ; index < length; index++ ) { 6010 elem = elements[ index ]; 6011 if ( !elem.style ) { 6012 continue; 6013 } 6014 6015 values[ index ] = dataPriv.get( elem, "olddisplay" ); 6016 display = elem.style.display; 6017 if ( show ) { 6018 6019 // Reset the inline display of this element to learn if it is 6020 // being hidden by cascaded rules or not 6021 if ( !values[ index ] && display === "none" ) { 6022 elem.style.display = ""; 6023 } 6024 6025 // Set elements which have been overridden with display: none 6026 // in a stylesheet to whatever the default browser style is 6027 // for such an element 6028 if ( elem.style.display === "" && isHidden( elem ) ) { 6029 values[ index ] = dataPriv.access( 6030 elem, 6031 "olddisplay", 6032 defaultDisplay( elem.nodeName ) 6033 ); 6034 } 6035 } else { 6036 hidden = isHidden( elem ); 6037 6038 if ( display !== "none" || !hidden ) { 6039 dataPriv.set( 6040 elem, 6041 "olddisplay", 6042 hidden ? display : jQuery.css( elem, "display" ) 6043 ); 6044 } 6045 } 6046 } 6047 6048 // Set the display of most of the elements in a second loop 6049 // to avoid the constant reflow 6050 for ( index = 0; index < length; index++ ) { 6051 elem = elements[ index ]; 6052 if ( !elem.style ) { 6053 continue; 6054 } 6055 if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 6056 elem.style.display = show ? values[ index ] || "" : "none"; 6057 } 6058 } 6059 6060 return elements; 6061} 6062 6063jQuery.extend( { 6064 6065 // Add in style property hooks for overriding the default 6066 // behavior of getting and setting a style property 6067 cssHooks: { 6068 opacity: { 6069 get: function( elem, computed ) { 6070 if ( computed ) { 6071 6072 // We should always get a number back from opacity 6073 var ret = curCSS( elem, "opacity" ); 6074 return ret === "" ? "1" : ret; 6075 } 6076 } 6077 } 6078 }, 6079 6080 // Don't automatically add "px" to these possibly-unitless properties 6081 cssNumber: { 6082 "animationIterationCount": true, 6083 "columnCount": true, 6084 "fillOpacity": true, 6085 "flexGrow": true, 6086 "flexShrink": true, 6087 "fontWeight": true, 6088 "lineHeight": true, 6089 "opacity": true, 6090 "order": true, 6091 "orphans": true, 6092 "widows": true, 6093 "zIndex": true, 6094 "zoom": true 6095 }, 6096 6097 // Add in properties whose names you wish to fix before 6098 // setting or getting the value 6099 cssProps: { 6100 "float": "cssFloat" 6101 }, 6102 6103 // Get and set the style property on a DOM Node 6104 style: function( elem, name, value, extra ) { 6105 6106 // Don't set styles on text and comment nodes 6107 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 6108 return; 6109 } 6110 6111 // Make sure that we're working with the right name 6112 var ret, type, hooks, 6113 origName = jQuery.camelCase( name ), 6114 style = elem.style; 6115 6116 name = jQuery.cssProps[ origName ] || 6117 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 6118 6119 // Gets hook for the prefixed version, then unprefixed version 6120 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6121 6122 // Check if we're setting a value 6123 if ( value !== undefined ) { 6124 type = typeof value; 6125 6126 // Convert "+=" or "-=" to relative numbers (#7345) 6127 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 6128 value = adjustCSS( elem, name, ret ); 6129 6130 // Fixes bug #9237 6131 type = "number"; 6132 } 6133 6134 // Make sure that null and NaN values aren't set (#7116) 6135 if ( value == null || value !== value ) { 6136 return; 6137 } 6138 6139 // If a number was passed in, add the unit (except for certain CSS properties) 6140 if ( type === "number" ) { 6141 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 6142 } 6143 6144 // Support: IE9-11+ 6145 // background-* props affect original clone's values 6146 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 6147 style[ name ] = "inherit"; 6148 } 6149 6150 // If a hook was provided, use that value, otherwise just set the specified value 6151 if ( !hooks || !( "set" in hooks ) || 6152 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 6153 6154 style[ name ] = value; 6155 } 6156 6157 } else { 6158 6159 // If a hook was provided get the non-computed value from there 6160 if ( hooks && "get" in hooks && 6161 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 6162 6163 return ret; 6164 } 6165 6166 // Otherwise just get the value from the style object 6167 return style[ name ]; 6168 } 6169 }, 6170 6171 css: function( elem, name, extra, styles ) { 6172 var val, num, hooks, 6173 origName = jQuery.camelCase( name ); 6174 6175 // Make sure that we're working with the right name 6176 name = jQuery.cssProps[ origName ] || 6177 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 6178 6179 // Try prefixed name followed by the unprefixed name 6180 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6181 6182 // If a hook was provided get the computed value from there 6183 if ( hooks && "get" in hooks ) { 6184 val = hooks.get( elem, true, extra ); 6185 } 6186 6187 // Otherwise, if a way to get the computed value exists, use that 6188 if ( val === undefined ) { 6189 val = curCSS( elem, name, styles ); 6190 } 6191 6192 // Convert "normal" to computed value 6193 if ( val === "normal" && name in cssNormalTransform ) { 6194 val = cssNormalTransform[ name ]; 6195 } 6196 6197 // Make numeric if forced or a qualifier was provided and val looks numeric 6198 if ( extra === "" || extra ) { 6199 num = parseFloat( val ); 6200 return extra === true || isFinite( num ) ? num || 0 : val; 6201 } 6202 return val; 6203 } 6204} ); 6205 6206jQuery.each( [ "height", "width" ], function( i, name ) { 6207 jQuery.cssHooks[ name ] = { 6208 get: function( elem, computed, extra ) { 6209 if ( computed ) { 6210 6211 // Certain elements can have dimension info if we invisibly show them 6212 // but it must have a current display style that would benefit 6213 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 6214 elem.offsetWidth === 0 ? 6215 swap( elem, cssShow, function() { 6216 return getWidthOrHeight( elem, name, extra ); 6217 } ) : 6218 getWidthOrHeight( elem, name, extra ); 6219 } 6220 }, 6221 6222 set: function( elem, value, extra ) { 6223 var matches, 6224 styles = extra && getStyles( elem ), 6225 subtract = extra && augmentWidthOrHeight( 6226 elem, 6227 name, 6228 extra, 6229 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 6230 styles 6231 ); 6232 6233 // Convert to pixels if value adjustment is needed 6234 if ( subtract && ( matches = rcssNum.exec( value ) ) && 6235 ( matches[ 3 ] || "px" ) !== "px" ) { 6236 6237 elem.style[ name ] = value; 6238 value = jQuery.css( elem, name ); 6239 } 6240 6241 return setPositiveNumber( elem, value, subtract ); 6242 } 6243 }; 6244} ); 6245 6246jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 6247 function( elem, computed ) { 6248 if ( computed ) { 6249 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 6250 elem.getBoundingClientRect().left - 6251 swap( elem, { marginLeft: 0 }, function() { 6252 return elem.getBoundingClientRect().left; 6253 } ) 6254 ) + "px"; 6255 } 6256 } 6257); 6258 6259// Support: Android 2.3 6260jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, 6261 function( elem, computed ) { 6262 if ( computed ) { 6263 return swap( elem, { "display": "inline-block" }, 6264 curCSS, [ elem, "marginRight" ] ); 6265 } 6266 } 6267); 6268 6269// These hooks are used by animate to expand properties 6270jQuery.each( { 6271 margin: "", 6272 padding: "", 6273 border: "Width" 6274}, function( prefix, suffix ) { 6275 jQuery.cssHooks[ prefix + suffix ] = { 6276 expand: function( value ) { 6277 var i = 0, 6278 expanded = {}, 6279 6280 // Assumes a single number if not a string 6281 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 6282 6283 for ( ; i < 4; i++ ) { 6284 expanded[ prefix + cssExpand[ i ] + suffix ] = 6285 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 6286 } 6287 6288 return expanded; 6289 } 6290 }; 6291 6292 if ( !rmargin.test( prefix ) ) { 6293 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 6294 } 6295} ); 6296 6297jQuery.fn.extend( { 6298 css: function( name, value ) { 6299 return access( this, function( elem, name, value ) { 6300 var styles, len, 6301 map = {}, 6302 i = 0; 6303 6304 if ( jQuery.isArray( name ) ) { 6305 styles = getStyles( elem ); 6306 len = name.length; 6307 6308 for ( ; i < len; i++ ) { 6309 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 6310 } 6311 6312 return map; 6313 } 6314 6315 return value !== undefined ? 6316 jQuery.style( elem, name, value ) : 6317 jQuery.css( elem, name ); 6318 }, name, value, arguments.length > 1 ); 6319 }, 6320 show: function() { 6321 return showHide( this, true ); 6322 }, 6323 hide: function() { 6324 return showHide( this ); 6325 }, 6326 toggle: function( state ) { 6327 if ( typeof state === "boolean" ) { 6328 return state ? this.show() : this.hide(); 6329 } 6330 6331 return this.each( function() { 6332 if ( isHidden( this ) ) { 6333 jQuery( this ).show(); 6334 } else { 6335 jQuery( this ).hide(); 6336 } 6337 } ); 6338 } 6339} ); 6340 6341 6342function Tween( elem, options, prop, end, easing ) { 6343 return new Tween.prototype.init( elem, options, prop, end, easing ); 6344} 6345jQuery.Tween = Tween; 6346 6347Tween.prototype = { 6348 constructor: Tween, 6349 init: function( elem, options, prop, end, easing, unit ) { 6350 this.elem = elem; 6351 this.prop = prop; 6352 this.easing = easing || jQuery.easing._default; 6353 this.options = options; 6354 this.start = this.now = this.cur(); 6355 this.end = end; 6356 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 6357 }, 6358 cur: function() { 6359 var hooks = Tween.propHooks[ this.prop ]; 6360 6361 return hooks && hooks.get ? 6362 hooks.get( this ) : 6363 Tween.propHooks._default.get( this ); 6364 }, 6365 run: function( percent ) { 6366 var eased, 6367 hooks = Tween.propHooks[ this.prop ]; 6368 6369 if ( this.options.duration ) { 6370 this.pos = eased = jQuery.easing[ this.easing ]( 6371 percent, this.options.duration * percent, 0, 1, this.options.duration 6372 ); 6373 } else { 6374 this.pos = eased = percent; 6375 } 6376 this.now = ( this.end - this.start ) * eased + this.start; 6377 6378 if ( this.options.step ) { 6379 this.options.step.call( this.elem, this.now, this ); 6380 } 6381 6382 if ( hooks && hooks.set ) { 6383 hooks.set( this ); 6384 } else { 6385 Tween.propHooks._default.set( this ); 6386 } 6387 return this; 6388 } 6389}; 6390 6391Tween.prototype.init.prototype = Tween.prototype; 6392 6393Tween.propHooks = { 6394 _default: { 6395 get: function( tween ) { 6396 var result; 6397 6398 // Use a property on the element directly when it is not a DOM element, 6399 // or when there is no matching style property that exists. 6400 if ( tween.elem.nodeType !== 1 || 6401 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 6402 return tween.elem[ tween.prop ]; 6403 } 6404 6405 // Passing an empty string as a 3rd parameter to .css will automatically 6406 // attempt a parseFloat and fallback to a string if the parse fails. 6407 // Simple values such as "10px" are parsed to Float; 6408 // complex values such as "rotate(1rad)" are returned as-is. 6409 result = jQuery.css( tween.elem, tween.prop, "" ); 6410 6411 // Empty strings, null, undefined and "auto" are converted to 0. 6412 return !result || result === "auto" ? 0 : result; 6413 }, 6414 set: function( tween ) { 6415 6416 // Use step hook for back compat. 6417 // Use cssHook if its there. 6418 // Use .style if available and use plain properties where available. 6419 if ( jQuery.fx.step[ tween.prop ] ) { 6420 jQuery.fx.step[ tween.prop ]( tween ); 6421 } else if ( tween.elem.nodeType === 1 && 6422 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || 6423 jQuery.cssHooks[ tween.prop ] ) ) { 6424 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 6425 } else { 6426 tween.elem[ tween.prop ] = tween.now; 6427 } 6428 } 6429 } 6430}; 6431 6432// Support: IE9 6433// Panic based approach to setting things on disconnected nodes 6434Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 6435 set: function( tween ) { 6436 if ( tween.elem.nodeType && tween.elem.parentNode ) { 6437 tween.elem[ tween.prop ] = tween.now; 6438 } 6439 } 6440}; 6441 6442jQuery.easing = { 6443 linear: function( p ) { 6444 return p; 6445 }, 6446 swing: function( p ) { 6447 return 0.5 - Math.cos( p * Math.PI ) / 2; 6448 }, 6449 _default: "swing" 6450}; 6451 6452jQuery.fx = Tween.prototype.init; 6453 6454// Back Compat <1.8 extension point 6455jQuery.fx.step = {}; 6456 6457 6458 6459 6460var 6461 fxNow, timerId, 6462 rfxtypes = /^(?:toggle|show|hide)$/, 6463 rrun = /queueHooks$/; 6464 6465// Animations created synchronously will run synchronously 6466function createFxNow() { 6467 window.setTimeout( function() { 6468 fxNow = undefined; 6469 } ); 6470 return ( fxNow = jQuery.now() ); 6471} 6472 6473// Generate parameters to create a standard animation 6474function genFx( type, includeWidth ) { 6475 var which, 6476 i = 0, 6477 attrs = { height: type }; 6478 6479 // If we include width, step value is 1 to do all cssExpand values, 6480 // otherwise step value is 2 to skip over Left and Right 6481 includeWidth = includeWidth ? 1 : 0; 6482 for ( ; i < 4 ; i += 2 - includeWidth ) { 6483 which = cssExpand[ i ]; 6484 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 6485 } 6486 6487 if ( includeWidth ) { 6488 attrs.opacity = attrs.width = type; 6489 } 6490 6491 return attrs; 6492} 6493 6494function createTween( value, prop, animation ) { 6495 var tween, 6496 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 6497 index = 0, 6498 length = collection.length; 6499 for ( ; index < length; index++ ) { 6500 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 6501 6502 // We're done with this property 6503 return tween; 6504 } 6505 } 6506} 6507 6508function defaultPrefilter( elem, props, opts ) { 6509 /* jshint validthis: true */ 6510 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, 6511 anim = this, 6512 orig = {}, 6513 style = elem.style, 6514 hidden = elem.nodeType && isHidden( elem ), 6515 dataShow = dataPriv.get( elem, "fxshow" ); 6516 6517 // Handle queue: false promises 6518 if ( !opts.queue ) { 6519 hooks = jQuery._queueHooks( elem, "fx" ); 6520 if ( hooks.unqueued == null ) { 6521 hooks.unqueued = 0; 6522 oldfire = hooks.empty.fire; 6523 hooks.empty.fire = function() { 6524 if ( !hooks.unqueued ) { 6525 oldfire(); 6526 } 6527 }; 6528 } 6529 hooks.unqueued++; 6530 6531 anim.always( function() { 6532 6533 // Ensure the complete handler is called before this completes 6534 anim.always( function() { 6535 hooks.unqueued--; 6536 if ( !jQuery.queue( elem, "fx" ).length ) { 6537 hooks.empty.fire(); 6538 } 6539 } ); 6540 } ); 6541 } 6542 6543 // Height/width overflow pass 6544 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { 6545 6546 // Make sure that nothing sneaks out 6547 // Record all 3 overflow attributes because IE9-10 do not 6548 // change the overflow attribute when overflowX and 6549 // overflowY are set to the same value 6550 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 6551 6552 // Set display property to inline-block for height/width 6553 // animations on inline elements that are having width/height animated 6554 display = jQuery.css( elem, "display" ); 6555 6556 // Test default display if display is currently "none" 6557 checkDisplay = display === "none" ? 6558 dataPriv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; 6559 6560 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { 6561 style.display = "inline-block"; 6562 } 6563 } 6564 6565 if ( opts.overflow ) { 6566 style.overflow = "hidden"; 6567 anim.always( function() { 6568 style.overflow = opts.overflow[ 0 ]; 6569 style.overflowX = opts.overflow[ 1 ]; 6570 style.overflowY = opts.overflow[ 2 ]; 6571 } ); 6572 } 6573 6574 // show/hide pass 6575 for ( prop in props ) { 6576 value = props[ prop ]; 6577 if ( rfxtypes.exec( value ) ) { 6578 delete props[ prop ]; 6579 toggle = toggle || value === "toggle"; 6580 if ( value === ( hidden ? "hide" : "show" ) ) { 6581 6582 // If there is dataShow left over from a stopped hide or show 6583 // and we are going to proceed with show, we should pretend to be hidden 6584 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 6585 hidden = true; 6586 } else { 6587 continue; 6588 } 6589 } 6590 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 6591 6592 // Any non-fx value stops us from restoring the original display value 6593 } else { 6594 display = undefined; 6595 } 6596 } 6597 6598 if ( !jQuery.isEmptyObject( orig ) ) { 6599 if ( dataShow ) { 6600 if ( "hidden" in dataShow ) { 6601 hidden = dataShow.hidden; 6602 } 6603 } else { 6604 dataShow = dataPriv.access( elem, "fxshow", {} ); 6605 } 6606 6607 // Store state if its toggle - enables .stop().toggle() to "reverse" 6608 if ( toggle ) { 6609 dataShow.hidden = !hidden; 6610 } 6611 if ( hidden ) { 6612 jQuery( elem ).show(); 6613 } else { 6614 anim.done( function() { 6615 jQuery( elem ).hide(); 6616 } ); 6617 } 6618 anim.done( function() { 6619 var prop; 6620 6621 dataPriv.remove( elem, "fxshow" ); 6622 for ( prop in orig ) { 6623 jQuery.style( elem, prop, orig[ prop ] ); 6624 } 6625 } ); 6626 for ( prop in orig ) { 6627 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 6628 6629 if ( !( prop in dataShow ) ) { 6630 dataShow[ prop ] = tween.start; 6631 if ( hidden ) { 6632 tween.end = tween.start; 6633 tween.start = prop === "width" || prop === "height" ? 1 : 0; 6634 } 6635 } 6636 } 6637 6638 // If this is a noop like .hide().hide(), restore an overwritten display value 6639 } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) { 6640 style.display = display; 6641 } 6642} 6643 6644function propFilter( props, specialEasing ) { 6645 var index, name, easing, value, hooks; 6646 6647 // camelCase, specialEasing and expand cssHook pass 6648 for ( index in props ) { 6649 name = jQuery.camelCase( index ); 6650 easing = specialEasing[ name ]; 6651 value = props[ index ]; 6652 if ( jQuery.isArray( value ) ) { 6653 easing = value[ 1 ]; 6654 value = props[ index ] = value[ 0 ]; 6655 } 6656 6657 if ( index !== name ) { 6658 props[ name ] = value; 6659 delete props[ index ]; 6660 } 6661 6662 hooks = jQuery.cssHooks[ name ]; 6663 if ( hooks && "expand" in hooks ) { 6664 value = hooks.expand( value ); 6665 delete props[ name ]; 6666 6667 // Not quite $.extend, this won't overwrite existing keys. 6668 // Reusing 'index' because we have the correct "name" 6669 for ( index in value ) { 6670 if ( !( index in props ) ) { 6671 props[ index ] = value[ index ]; 6672 specialEasing[ index ] = easing; 6673 } 6674 } 6675 } else { 6676 specialEasing[ name ] = easing; 6677 } 6678 } 6679} 6680 6681function Animation( elem, properties, options ) { 6682 var result, 6683 stopped, 6684 index = 0, 6685 length = Animation.prefilters.length, 6686 deferred = jQuery.Deferred().always( function() { 6687 6688 // Don't match elem in the :animated selector 6689 delete tick.elem; 6690 } ), 6691 tick = function() { 6692 if ( stopped ) { 6693 return false; 6694 } 6695 var currentTime = fxNow || createFxNow(), 6696 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 6697 6698 // Support: Android 2.3 6699 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 6700 temp = remaining / animation.duration || 0, 6701 percent = 1 - temp, 6702 index = 0, 6703 length = animation.tweens.length; 6704 6705 for ( ; index < length ; index++ ) { 6706 animation.tweens[ index ].run( percent ); 6707 } 6708 6709 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 6710 6711 if ( percent < 1 && length ) { 6712 return remaining; 6713 } else { 6714 deferred.resolveWith( elem, [ animation ] ); 6715 return false; 6716 } 6717 }, 6718 animation = deferred.promise( { 6719 elem: elem, 6720 props: jQuery.extend( {}, properties ), 6721 opts: jQuery.extend( true, { 6722 specialEasing: {}, 6723 easing: jQuery.easing._default 6724 }, options ), 6725 originalProperties: properties, 6726 originalOptions: options, 6727 startTime: fxNow || createFxNow(), 6728 duration: options.duration, 6729 tweens: [], 6730 createTween: function( prop, end ) { 6731 var tween = jQuery.Tween( elem, animation.opts, prop, end, 6732 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 6733 animation.tweens.push( tween ); 6734 return tween; 6735 }, 6736 stop: function( gotoEnd ) { 6737 var index = 0, 6738 6739 // If we are going to the end, we want to run all the tweens 6740 // otherwise we skip this part 6741 length = gotoEnd ? animation.tweens.length : 0; 6742 if ( stopped ) { 6743 return this; 6744 } 6745 stopped = true; 6746 for ( ; index < length ; index++ ) { 6747 animation.tweens[ index ].run( 1 ); 6748 } 6749 6750 // Resolve when we played the last frame; otherwise, reject 6751 if ( gotoEnd ) { 6752 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 6753 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 6754 } else { 6755 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 6756 } 6757 return this; 6758 } 6759 } ), 6760 props = animation.props; 6761 6762 propFilter( props, animation.opts.specialEasing ); 6763 6764 for ( ; index < length ; index++ ) { 6765 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 6766 if ( result ) { 6767 if ( jQuery.isFunction( result.stop ) ) { 6768 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 6769 jQuery.proxy( result.stop, result ); 6770 } 6771 return result; 6772 } 6773 } 6774 6775 jQuery.map( props, createTween, animation ); 6776 6777 if ( jQuery.isFunction( animation.opts.start ) ) { 6778 animation.opts.start.call( elem, animation ); 6779 } 6780 6781 jQuery.fx.timer( 6782 jQuery.extend( tick, { 6783 elem: elem, 6784 anim: animation, 6785 queue: animation.opts.queue 6786 } ) 6787 ); 6788 6789 // attach callbacks from options 6790 return animation.progress( animation.opts.progress ) 6791 .done( animation.opts.done, animation.opts.complete ) 6792 .fail( animation.opts.fail ) 6793 .always( animation.opts.always ); 6794} 6795 6796jQuery.Animation = jQuery.extend( Animation, { 6797 tweeners: { 6798 "*": [ function( prop, value ) { 6799 var tween = this.createTween( prop, value ); 6800 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 6801 return tween; 6802 } ] 6803 }, 6804 6805 tweener: function( props, callback ) { 6806 if ( jQuery.isFunction( props ) ) { 6807 callback = props; 6808 props = [ "*" ]; 6809 } else { 6810 props = props.match( rnotwhite ); 6811 } 6812 6813 var prop, 6814 index = 0, 6815 length = props.length; 6816 6817 for ( ; index < length ; index++ ) { 6818 prop = props[ index ]; 6819 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 6820 Animation.tweeners[ prop ].unshift( callback ); 6821 } 6822 }, 6823 6824 prefilters: [ defaultPrefilter ], 6825 6826 prefilter: function( callback, prepend ) { 6827 if ( prepend ) { 6828 Animation.prefilters.unshift( callback ); 6829 } else { 6830 Animation.prefilters.push( callback ); 6831 } 6832 } 6833} ); 6834 6835jQuery.speed = function( speed, easing, fn ) { 6836 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 6837 complete: fn || !fn && easing || 6838 jQuery.isFunction( speed ) && speed, 6839 duration: speed, 6840 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing 6841 }; 6842 6843 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? 6844 opt.duration : opt.duration in jQuery.fx.speeds ? 6845 jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; 6846 6847 // Normalize opt.queue - true/undefined/null -> "fx" 6848 if ( opt.queue == null || opt.queue === true ) { 6849 opt.queue = "fx"; 6850 } 6851 6852 // Queueing 6853 opt.old = opt.complete; 6854 6855 opt.complete = function() { 6856 if ( jQuery.isFunction( opt.old ) ) { 6857 opt.old.call( this ); 6858 } 6859 6860 if ( opt.queue ) { 6861 jQuery.dequeue( this, opt.queue ); 6862 } 6863 }; 6864 6865 return opt; 6866}; 6867 6868jQuery.fn.extend( { 6869 fadeTo: function( speed, to, easing, callback ) { 6870 6871 // Show any hidden elements after setting opacity to 0 6872 return this.filter( isHidden ).css( "opacity", 0 ).show() 6873 6874 // Animate to the value specified 6875 .end().animate( { opacity: to }, speed, easing, callback ); 6876 }, 6877 animate: function( prop, speed, easing, callback ) { 6878 var empty = jQuery.isEmptyObject( prop ), 6879 optall = jQuery.speed( speed, easing, callback ), 6880 doAnimation = function() { 6881 6882 // Operate on a copy of prop so per-property easing won't be lost 6883 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 6884 6885 // Empty animations, or finishing resolves immediately 6886 if ( empty || dataPriv.get( this, "finish" ) ) { 6887 anim.stop( true ); 6888 } 6889 }; 6890 doAnimation.finish = doAnimation; 6891 6892 return empty || optall.queue === false ? 6893 this.each( doAnimation ) : 6894 this.queue( optall.queue, doAnimation ); 6895 }, 6896 stop: function( type, clearQueue, gotoEnd ) { 6897 var stopQueue = function( hooks ) { 6898 var stop = hooks.stop; 6899 delete hooks.stop; 6900 stop( gotoEnd ); 6901 }; 6902 6903 if ( typeof type !== "string" ) { 6904 gotoEnd = clearQueue; 6905 clearQueue = type; 6906 type = undefined; 6907 } 6908 if ( clearQueue && type !== false ) { 6909 this.queue( type || "fx", [] ); 6910 } 6911 6912 return this.each( function() { 6913 var dequeue = true, 6914 index = type != null && type + "queueHooks", 6915 timers = jQuery.timers, 6916 data = dataPriv.get( this ); 6917 6918 if ( index ) { 6919 if ( data[ index ] && data[ index ].stop ) { 6920 stopQueue( data[ index ] ); 6921 } 6922 } else { 6923 for ( index in data ) { 6924 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 6925 stopQueue( data[ index ] ); 6926 } 6927 } 6928 } 6929 6930 for ( index = timers.length; index--; ) { 6931 if ( timers[ index ].elem === this && 6932 ( type == null || timers[ index ].queue === type ) ) { 6933 6934 timers[ index ].anim.stop( gotoEnd ); 6935 dequeue = false; 6936 timers.splice( index, 1 ); 6937 } 6938 } 6939 6940 // Start the next in the queue if the last step wasn't forced. 6941 // Timers currently will call their complete callbacks, which 6942 // will dequeue but only if they were gotoEnd. 6943 if ( dequeue || !gotoEnd ) { 6944 jQuery.dequeue( this, type ); 6945 } 6946 } ); 6947 }, 6948 finish: function( type ) { 6949 if ( type !== false ) { 6950 type = type || "fx"; 6951 } 6952 return this.each( function() { 6953 var index, 6954 data = dataPriv.get( this ), 6955 queue = data[ type + "queue" ], 6956 hooks = data[ type + "queueHooks" ], 6957 timers = jQuery.timers, 6958 length = queue ? queue.length : 0; 6959 6960 // Enable finishing flag on private data 6961 data.finish = true; 6962 6963 // Empty the queue first 6964 jQuery.queue( this, type, [] ); 6965 6966 if ( hooks && hooks.stop ) { 6967 hooks.stop.call( this, true ); 6968 } 6969 6970 // Look for any active animations, and finish them 6971 for ( index = timers.length; index--; ) { 6972 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 6973 timers[ index ].anim.stop( true ); 6974 timers.splice( index, 1 ); 6975 } 6976 } 6977 6978 // Look for any animations in the old queue and finish them 6979 for ( index = 0; index < length; index++ ) { 6980 if ( queue[ index ] && queue[ index ].finish ) { 6981 queue[ index ].finish.call( this ); 6982 } 6983 } 6984 6985 // Turn off finishing flag 6986 delete data.finish; 6987 } ); 6988 } 6989} ); 6990 6991jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { 6992 var cssFn = jQuery.fn[ name ]; 6993 jQuery.fn[ name ] = function( speed, easing, callback ) { 6994 return speed == null || typeof speed === "boolean" ? 6995 cssFn.apply( this, arguments ) : 6996 this.animate( genFx( name, true ), speed, easing, callback ); 6997 }; 6998} ); 6999 7000// Generate shortcuts for custom animations 7001jQuery.each( { 7002 slideDown: genFx( "show" ), 7003 slideUp: genFx( "hide" ), 7004 slideToggle: genFx( "toggle" ), 7005 fadeIn: { opacity: "show" }, 7006 fadeOut: { opacity: "hide" }, 7007 fadeToggle: { opacity: "toggle" } 7008}, function( name, props ) { 7009 jQuery.fn[ name ] = function( speed, easing, callback ) { 7010 return this.animate( props, speed, easing, callback ); 7011 }; 7012} ); 7013 7014jQuery.timers = []; 7015jQuery.fx.tick = function() { 7016 var timer, 7017 i = 0, 7018 timers = jQuery.timers; 7019 7020 fxNow = jQuery.now(); 7021 7022 for ( ; i < timers.length; i++ ) { 7023 timer = timers[ i ]; 7024 7025 // Checks the timer has not already been removed 7026 if ( !timer() && timers[ i ] === timer ) { 7027 timers.splice( i--, 1 ); 7028 } 7029 } 7030 7031 if ( !timers.length ) { 7032 jQuery.fx.stop(); 7033 } 7034 fxNow = undefined; 7035}; 7036 7037jQuery.fx.timer = function( timer ) { 7038 jQuery.timers.push( timer ); 7039 if ( timer() ) { 7040 jQuery.fx.start(); 7041 } else { 7042 jQuery.timers.pop(); 7043 } 7044}; 7045 7046jQuery.fx.interval = 13; 7047jQuery.fx.start = function() { 7048 if ( !timerId ) { 7049 timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); 7050 } 7051}; 7052 7053jQuery.fx.stop = function() { 7054 window.clearInterval( timerId ); 7055 7056 timerId = null; 7057}; 7058 7059jQuery.fx.speeds = { 7060 slow: 600, 7061 fast: 200, 7062 7063 // Default speed 7064 _default: 400 7065}; 7066 7067 7068// Based off of the plugin by Clint Helfers, with permission. 7069// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 7070jQuery.fn.delay = function( time, type ) { 7071 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 7072 type = type || "fx"; 7073 7074 return this.queue( type, function( next, hooks ) { 7075 var timeout = window.setTimeout( next, time ); 7076 hooks.stop = function() { 7077 window.clearTimeout( timeout ); 7078 }; 7079 } ); 7080}; 7081 7082 7083( function() { 7084 var input = document.createElement( "input" ), 7085 select = document.createElement( "select" ), 7086 opt = select.appendChild( document.createElement( "option" ) ); 7087 7088 input.type = "checkbox"; 7089 7090 // Support: iOS<=5.1, Android<=4.2+ 7091 // Default value for a checkbox should be "on" 7092 support.checkOn = input.value !== ""; 7093 7094 // Support: IE<=11+ 7095 // Must access selectedIndex to make default options select 7096 support.optSelected = opt.selected; 7097 7098 // Support: Android<=2.3 7099 // Options inside disabled selects are incorrectly marked as disabled 7100 select.disabled = true; 7101 support.optDisabled = !opt.disabled; 7102 7103 // Support: IE<=11+ 7104 // An input loses its value after becoming a radio 7105 input = document.createElement( "input" ); 7106 input.value = "t"; 7107 input.type = "radio"; 7108 support.radioValue = input.value === "t"; 7109} )(); 7110 7111 7112var boolHook, 7113 attrHandle = jQuery.expr.attrHandle; 7114 7115jQuery.fn.extend( { 7116 attr: function( name, value ) { 7117 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 7118 }, 7119 7120 removeAttr: function( name ) { 7121 return this.each( function() { 7122 jQuery.removeAttr( this, name ); 7123 } ); 7124 } 7125} ); 7126 7127jQuery.extend( { 7128 attr: function( elem, name, value ) { 7129 var ret, hooks, 7130 nType = elem.nodeType; 7131 7132 // Don't get/set attributes on text, comment and attribute nodes 7133 if ( nType === 3 || nType === 8 || nType === 2 ) { 7134 return; 7135 } 7136 7137 // Fallback to prop when attributes are not supported 7138 if ( typeof elem.getAttribute === "undefined" ) { 7139 return jQuery.prop( elem, name, value ); 7140 } 7141 7142 // All attributes are lowercase 7143 // Grab necessary hook if one is defined 7144 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 7145 name = name.toLowerCase(); 7146 hooks = jQuery.attrHooks[ name ] || 7147 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 7148 } 7149 7150 if ( value !== undefined ) { 7151 if ( value === null ) { 7152 jQuery.removeAttr( elem, name ); 7153 return; 7154 } 7155 7156 if ( hooks && "set" in hooks && 7157 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 7158 return ret; 7159 } 7160 7161 elem.setAttribute( name, value + "" ); 7162 return value; 7163 } 7164 7165 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 7166 return ret; 7167 } 7168 7169 ret = jQuery.find.attr( elem, name ); 7170 7171 // Non-existent attributes return null, we normalize to undefined 7172 return ret == null ? undefined : ret; 7173 }, 7174 7175 attrHooks: { 7176 type: { 7177 set: function( elem, value ) { 7178 if ( !support.radioValue && value === "radio" && 7179 jQuery.nodeName( elem, "input" ) ) { 7180 var val = elem.value; 7181 elem.setAttribute( "type", value ); 7182 if ( val ) { 7183 elem.value = val; 7184 } 7185 return value; 7186 } 7187 } 7188 } 7189 }, 7190 7191 removeAttr: function( elem, value ) { 7192 var name, propName, 7193 i = 0, 7194 attrNames = value && value.match( rnotwhite ); 7195 7196 if ( attrNames && elem.nodeType === 1 ) { 7197 while ( ( name = attrNames[ i++ ] ) ) { 7198 propName = jQuery.propFix[ name ] || name; 7199 7200 // Boolean attributes get special treatment (#10870) 7201 if ( jQuery.expr.match.bool.test( name ) ) { 7202 7203 // Set corresponding property to false 7204 elem[ propName ] = false; 7205 } 7206 7207 elem.removeAttribute( name ); 7208 } 7209 } 7210 } 7211} ); 7212 7213// Hooks for boolean attributes 7214boolHook = { 7215 set: function( elem, value, name ) { 7216 if ( value === false ) { 7217 7218 // Remove boolean attributes when set to false 7219 jQuery.removeAttr( elem, name ); 7220 } else { 7221 elem.setAttribute( name, name ); 7222 } 7223 return name; 7224 } 7225}; 7226jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 7227 var getter = attrHandle[ name ] || jQuery.find.attr; 7228 7229 attrHandle[ name ] = function( elem, name, isXML ) { 7230 var ret, handle; 7231 if ( !isXML ) { 7232 7233 // Avoid an infinite loop by temporarily removing this function from the getter 7234 handle = attrHandle[ name ]; 7235 attrHandle[ name ] = ret; 7236 ret = getter( elem, name, isXML ) != null ? 7237 name.toLowerCase() : 7238 null; 7239 attrHandle[ name ] = handle; 7240 } 7241 return ret; 7242 }; 7243} ); 7244 7245 7246 7247 7248var rfocusable = /^(?:input|select|textarea|button)$/i, 7249 rclickable = /^(?:a|area)$/i; 7250 7251jQuery.fn.extend( { 7252 prop: function( name, value ) { 7253 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 7254 }, 7255 7256 removeProp: function( name ) { 7257 return this.each( function() { 7258 delete this[ jQuery.propFix[ name ] || name ]; 7259 } ); 7260 } 7261} ); 7262 7263jQuery.extend( { 7264 prop: function( elem, name, value ) { 7265 var ret, hooks, 7266 nType = elem.nodeType; 7267 7268 // Don't get/set properties on text, comment and attribute nodes 7269 if ( nType === 3 || nType === 8 || nType === 2 ) { 7270 return; 7271 } 7272 7273 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 7274 7275 // Fix name and attach hooks 7276 name = jQuery.propFix[ name ] || name; 7277 hooks = jQuery.propHooks[ name ]; 7278 } 7279 7280 if ( value !== undefined ) { 7281 if ( hooks && "set" in hooks && 7282 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 7283 return ret; 7284 } 7285 7286 return ( elem[ name ] = value ); 7287 } 7288 7289 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 7290 return ret; 7291 } 7292 7293 return elem[ name ]; 7294 }, 7295 7296 propHooks: { 7297 tabIndex: { 7298 get: function( elem ) { 7299 7300 // elem.tabIndex doesn't always return the 7301 // correct value when it hasn't been explicitly set 7302 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 7303 // Use proper attribute retrieval(#12072) 7304 var tabindex = jQuery.find.attr( elem, "tabindex" ); 7305 7306 return tabindex ? 7307 parseInt( tabindex, 10 ) : 7308 rfocusable.test( elem.nodeName ) || 7309 rclickable.test( elem.nodeName ) && elem.href ? 7310 0 : 7311 -1; 7312 } 7313 } 7314 }, 7315 7316 propFix: { 7317 "for": "htmlFor", 7318 "class": "className" 7319 } 7320} ); 7321 7322// Support: IE <=11 only 7323// Accessing the selectedIndex property 7324// forces the browser to respect setting selected 7325// on the option 7326// The getter ensures a default option is selected 7327// when in an optgroup 7328if ( !support.optSelected ) { 7329 jQuery.propHooks.selected = { 7330 get: function( elem ) { 7331 var parent = elem.parentNode; 7332 if ( parent && parent.parentNode ) { 7333 parent.parentNode.selectedIndex; 7334 } 7335 return null; 7336 }, 7337 set: function( elem ) { 7338 var parent = elem.parentNode; 7339 if ( parent ) { 7340 parent.selectedIndex; 7341 7342 if ( parent.parentNode ) { 7343 parent.parentNode.selectedIndex; 7344 } 7345 } 7346 } 7347 }; 7348} 7349 7350jQuery.each( [ 7351 "tabIndex", 7352 "readOnly", 7353 "maxLength", 7354 "cellSpacing", 7355 "cellPadding", 7356 "rowSpan", 7357 "colSpan", 7358 "useMap", 7359 "frameBorder", 7360 "contentEditable" 7361], function() { 7362 jQuery.propFix[ this.toLowerCase() ] = this; 7363} ); 7364 7365 7366 7367 7368var rclass = /[\t\r\n\f]/g; 7369 7370function getClass( elem ) { 7371 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 7372} 7373 7374jQuery.fn.extend( { 7375 addClass: function( value ) { 7376 var classes, elem, cur, curValue, clazz, j, finalValue, 7377 i = 0; 7378 7379 if ( jQuery.isFunction( value ) ) { 7380 return this.each( function( j ) { 7381 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 7382 } ); 7383 } 7384 7385 if ( typeof value === "string" && value ) { 7386 classes = value.match( rnotwhite ) || []; 7387 7388 while ( ( elem = this[ i++ ] ) ) { 7389 curValue = getClass( elem ); 7390 cur = elem.nodeType === 1 && 7391 ( " " + curValue + " " ).replace( rclass, " " ); 7392 7393 if ( cur ) { 7394 j = 0; 7395 while ( ( clazz = classes[ j++ ] ) ) { 7396 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 7397 cur += clazz + " "; 7398 } 7399 } 7400 7401 // Only assign if different to avoid unneeded rendering. 7402 finalValue = jQuery.trim( cur ); 7403 if ( curValue !== finalValue ) { 7404 elem.setAttribute( "class", finalValue ); 7405 } 7406 } 7407 } 7408 } 7409 7410 return this; 7411 }, 7412 7413 removeClass: function( value ) { 7414 var classes, elem, cur, curValue, clazz, j, finalValue, 7415 i = 0; 7416 7417 if ( jQuery.isFunction( value ) ) { 7418 return this.each( function( j ) { 7419 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 7420 } ); 7421 } 7422 7423 if ( !arguments.length ) { 7424 return this.attr( "class", "" ); 7425 } 7426 7427 if ( typeof value === "string" && value ) { 7428 classes = value.match( rnotwhite ) || []; 7429 7430 while ( ( elem = this[ i++ ] ) ) { 7431 curValue = getClass( elem ); 7432 7433 // This expression is here for better compressibility (see addClass) 7434 cur = elem.nodeType === 1 && 7435 ( " " + curValue + " " ).replace( rclass, " " ); 7436 7437 if ( cur ) { 7438 j = 0; 7439 while ( ( clazz = classes[ j++ ] ) ) { 7440 7441 // Remove *all* instances 7442 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 7443 cur = cur.replace( " " + clazz + " ", " " ); 7444 } 7445 } 7446 7447 // Only assign if different to avoid unneeded rendering. 7448 finalValue = jQuery.trim( cur ); 7449 if ( curValue !== finalValue ) { 7450 elem.setAttribute( "class", finalValue ); 7451 } 7452 } 7453 } 7454 } 7455 7456 return this; 7457 }, 7458 7459 toggleClass: function( value, stateVal ) { 7460 var type = typeof value; 7461 7462 if ( typeof stateVal === "boolean" && type === "string" ) { 7463 return stateVal ? this.addClass( value ) : this.removeClass( value ); 7464 } 7465 7466 if ( jQuery.isFunction( value ) ) { 7467 return this.each( function( i ) { 7468 jQuery( this ).toggleClass( 7469 value.call( this, i, getClass( this ), stateVal ), 7470 stateVal 7471 ); 7472 } ); 7473 } 7474 7475 return this.each( function() { 7476 var className, i, self, classNames; 7477 7478 if ( type === "string" ) { 7479 7480 // Toggle individual class names 7481 i = 0; 7482 self = jQuery( this ); 7483 classNames = value.match( rnotwhite ) || []; 7484 7485 while ( ( className = classNames[ i++ ] ) ) { 7486 7487 // Check each className given, space separated list 7488 if ( self.hasClass( className ) ) { 7489 self.removeClass( className ); 7490 } else { 7491 self.addClass( className ); 7492 } 7493 } 7494 7495 // Toggle whole class name 7496 } else if ( value === undefined || type === "boolean" ) { 7497 className = getClass( this ); 7498 if ( className ) { 7499 7500 // Store className if set 7501 dataPriv.set( this, "__className__", className ); 7502 } 7503 7504 // If the element has a class name or if we're passed `false`, 7505 // then remove the whole classname (if there was one, the above saved it). 7506 // Otherwise bring back whatever was previously saved (if anything), 7507 // falling back to the empty string if nothing was stored. 7508 if ( this.setAttribute ) { 7509 this.setAttribute( "class", 7510 className || value === false ? 7511 "" : 7512 dataPriv.get( this, "__className__" ) || "" 7513 ); 7514 } 7515 } 7516 } ); 7517 }, 7518 7519 hasClass: function( selector ) { 7520 var className, elem, 7521 i = 0; 7522 7523 className = " " + selector + " "; 7524 while ( ( elem = this[ i++ ] ) ) { 7525 if ( elem.nodeType === 1 && 7526 ( " " + getClass( elem ) + " " ).replace( rclass, " " ) 7527 .indexOf( className ) > -1 7528 ) { 7529 return true; 7530 } 7531 } 7532 7533 return false; 7534 } 7535} ); 7536 7537 7538 7539 7540var rreturn = /\r/g, 7541 rspaces = /[\x20\t\r\n\f]+/g; 7542 7543jQuery.fn.extend( { 7544 val: function( value ) { 7545 var hooks, ret, isFunction, 7546 elem = this[ 0 ]; 7547 7548 if ( !arguments.length ) { 7549 if ( elem ) { 7550 hooks = jQuery.valHooks[ elem.type ] || 7551 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 7552 7553 if ( hooks && 7554 "get" in hooks && 7555 ( ret = hooks.get( elem, "value" ) ) !== undefined 7556 ) { 7557 return ret; 7558 } 7559 7560 ret = elem.value; 7561 7562 return typeof ret === "string" ? 7563 7564 // Handle most common string cases 7565 ret.replace( rreturn, "" ) : 7566 7567 // Handle cases where value is null/undef or number 7568 ret == null ? "" : ret; 7569 } 7570 7571 return; 7572 } 7573 7574 isFunction = jQuery.isFunction( value ); 7575 7576 return this.each( function( i ) { 7577 var val; 7578 7579 if ( this.nodeType !== 1 ) { 7580 return; 7581 } 7582 7583 if ( isFunction ) { 7584 val = value.call( this, i, jQuery( this ).val() ); 7585 } else { 7586 val = value; 7587 } 7588 7589 // Treat null/undefined as ""; convert numbers to string 7590 if ( val == null ) { 7591 val = ""; 7592 7593 } else if ( typeof val === "number" ) { 7594 val += ""; 7595 7596 } else if ( jQuery.isArray( val ) ) { 7597 val = jQuery.map( val, function( value ) { 7598 return value == null ? "" : value + ""; 7599 } ); 7600 } 7601 7602 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 7603 7604 // If set returns undefined, fall back to normal setting 7605 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 7606 this.value = val; 7607 } 7608 } ); 7609 } 7610} ); 7611 7612jQuery.extend( { 7613 valHooks: { 7614 option: { 7615 get: function( elem ) { 7616 7617 var val = jQuery.find.attr( elem, "value" ); 7618 return val != null ? 7619 val : 7620 7621 // Support: IE10-11+ 7622 // option.text throws exceptions (#14686, #14858) 7623 // Strip and collapse whitespace 7624 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 7625 jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); 7626 } 7627 }, 7628 select: { 7629 get: function( elem ) { 7630 var value, option, 7631 options = elem.options, 7632 index = elem.selectedIndex, 7633 one = elem.type === "select-one" || index < 0, 7634 values = one ? null : [], 7635 max = one ? index + 1 : options.length, 7636 i = index < 0 ? 7637 max : 7638 one ? index : 0; 7639 7640 // Loop through all the selected options 7641 for ( ; i < max; i++ ) { 7642 option = options[ i ]; 7643 7644 // IE8-9 doesn't update selected after form reset (#2551) 7645 if ( ( option.selected || i === index ) && 7646 7647 // Don't return options that are disabled or in a disabled optgroup 7648 ( support.optDisabled ? 7649 !option.disabled : option.getAttribute( "disabled" ) === null ) && 7650 ( !option.parentNode.disabled || 7651 !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 7652 7653 // Get the specific value for the option 7654 value = jQuery( option ).val(); 7655 7656 // We don't need an array for one selects 7657 if ( one ) { 7658 return value; 7659 } 7660 7661 // Multi-Selects return an array 7662 values.push( value ); 7663 } 7664 } 7665 7666 return values; 7667 }, 7668 7669 set: function( elem, value ) { 7670 var optionSet, option, 7671 options = elem.options, 7672 values = jQuery.makeArray( value ), 7673 i = options.length; 7674 7675 while ( i-- ) { 7676 option = options[ i ]; 7677 if ( option.selected = 7678 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 7679 ) { 7680 optionSet = true; 7681 } 7682 } 7683 7684 // Force browsers to behave consistently when non-matching value is set 7685 if ( !optionSet ) { 7686 elem.selectedIndex = -1; 7687 } 7688 return values; 7689 } 7690 } 7691 } 7692} ); 7693 7694// Radios and checkboxes getter/setter 7695jQuery.each( [ "radio", "checkbox" ], function() { 7696 jQuery.valHooks[ this ] = { 7697 set: function( elem, value ) { 7698 if ( jQuery.isArray( value ) ) { 7699 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 7700 } 7701 } 7702 }; 7703 if ( !support.checkOn ) { 7704 jQuery.valHooks[ this ].get = function( elem ) { 7705 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 7706 }; 7707 } 7708} ); 7709 7710 7711 7712 7713// Return jQuery for attributes-only inclusion 7714 7715 7716var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; 7717 7718jQuery.extend( jQuery.event, { 7719 7720 trigger: function( event, data, elem, onlyHandlers ) { 7721 7722 var i, cur, tmp, bubbleType, ontype, handle, special, 7723 eventPath = [ elem || document ], 7724 type = hasOwn.call( event, "type" ) ? event.type : event, 7725 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 7726 7727 cur = tmp = elem = elem || document; 7728 7729 // Don't do events on text and comment nodes 7730 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 7731 return; 7732 } 7733 7734 // focus/blur morphs to focusin/out; ensure we're not firing them right now 7735 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 7736 return; 7737 } 7738 7739 if ( type.indexOf( "." ) > -1 ) { 7740 7741 // Namespaced trigger; create a regexp to match event type in handle() 7742 namespaces = type.split( "." ); 7743 type = namespaces.shift(); 7744 namespaces.sort(); 7745 } 7746 ontype = type.indexOf( ":" ) < 0 && "on" + type; 7747 7748 // Caller can pass in a jQuery.Event object, Object, or just an event type string 7749 event = event[ jQuery.expando ] ? 7750 event : 7751 new jQuery.Event( type, typeof event === "object" && event ); 7752 7753 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 7754 event.isTrigger = onlyHandlers ? 2 : 3; 7755 event.namespace = namespaces.join( "." ); 7756 event.rnamespace = event.namespace ? 7757 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 7758 null; 7759 7760 // Clean up the event in case it is being reused 7761 event.result = undefined; 7762 if ( !event.target ) { 7763 event.target = elem; 7764 } 7765 7766 // Clone any incoming data and prepend the event, creating the handler arg list 7767 data = data == null ? 7768 [ event ] : 7769 jQuery.makeArray( data, [ event ] ); 7770 7771 // Allow special events to draw outside the lines 7772 special = jQuery.event.special[ type ] || {}; 7773 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 7774 return; 7775 } 7776 7777 // Determine event propagation path in advance, per W3C events spec (#9951) 7778 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 7779 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 7780 7781 bubbleType = special.delegateType || type; 7782 if ( !rfocusMorph.test( bubbleType + type ) ) { 7783 cur = cur.parentNode; 7784 } 7785 for ( ; cur; cur = cur.parentNode ) { 7786 eventPath.push( cur ); 7787 tmp = cur; 7788 } 7789 7790 // Only add window if we got to document (e.g., not plain obj or detached DOM) 7791 if ( tmp === ( elem.ownerDocument || document ) ) { 7792 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 7793 } 7794 } 7795 7796 // Fire handlers on the event path 7797 i = 0; 7798 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 7799 7800 event.type = i > 1 ? 7801 bubbleType : 7802 special.bindType || type; 7803 7804 // jQuery handler 7805 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && 7806 dataPriv.get( cur, "handle" ); 7807 if ( handle ) { 7808 handle.apply( cur, data ); 7809 } 7810 7811 // Native handler 7812 handle = ontype && cur[ ontype ]; 7813 if ( handle && handle.apply && acceptData( cur ) ) { 7814 event.result = handle.apply( cur, data ); 7815 if ( event.result === false ) { 7816 event.preventDefault(); 7817 } 7818 } 7819 } 7820 event.type = type; 7821 7822 // If nobody prevented the default action, do it now 7823 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 7824 7825 if ( ( !special._default || 7826 special._default.apply( eventPath.pop(), data ) === false ) && 7827 acceptData( elem ) ) { 7828 7829 // Call a native DOM method on the target with the same name name as the event. 7830 // Don't do default actions on window, that's where global variables be (#6170) 7831 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { 7832 7833 // Don't re-trigger an onFOO event when we call its FOO() method 7834 tmp = elem[ ontype ]; 7835 7836 if ( tmp ) { 7837 elem[ ontype ] = null; 7838 } 7839 7840 // Prevent re-triggering of the same event, since we already bubbled it above 7841 jQuery.event.triggered = type; 7842 elem[ type ](); 7843 jQuery.event.triggered = undefined; 7844 7845 if ( tmp ) { 7846 elem[ ontype ] = tmp; 7847 } 7848 } 7849 } 7850 } 7851 7852 return event.result; 7853 }, 7854 7855 // Piggyback on a donor event to simulate a different one 7856 // Used only for `focus(in | out)` events 7857 simulate: function( type, elem, event ) { 7858 var e = jQuery.extend( 7859 new jQuery.Event(), 7860 event, 7861 { 7862 type: type, 7863 isSimulated: true 7864 } 7865 ); 7866 7867 jQuery.event.trigger( e, null, elem ); 7868 } 7869 7870} ); 7871 7872jQuery.fn.extend( { 7873 7874 trigger: function( type, data ) { 7875 return this.each( function() { 7876 jQuery.event.trigger( type, data, this ); 7877 } ); 7878 }, 7879 triggerHandler: function( type, data ) { 7880 var elem = this[ 0 ]; 7881 if ( elem ) { 7882 return jQuery.event.trigger( type, data, elem, true ); 7883 } 7884 } 7885} ); 7886 7887 7888jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + 7889 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 7890 "change select submit keydown keypress keyup error contextmenu" ).split( " " ), 7891 function( i, name ) { 7892 7893 // Handle event binding 7894 jQuery.fn[ name ] = function( data, fn ) { 7895 return arguments.length > 0 ? 7896 this.on( name, null, data, fn ) : 7897 this.trigger( name ); 7898 }; 7899} ); 7900 7901jQuery.fn.extend( { 7902 hover: function( fnOver, fnOut ) { 7903 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 7904 } 7905} ); 7906 7907 7908 7909 7910support.focusin = "onfocusin" in window; 7911 7912 7913// Support: Firefox 7914// Firefox doesn't have focus(in | out) events 7915// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 7916// 7917// Support: Chrome, Safari 7918// focus(in | out) events fire after focus & blur events, 7919// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 7920// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 7921if ( !support.focusin ) { 7922 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 7923 7924 // Attach a single capturing handler on the document while someone wants focusin/focusout 7925 var handler = function( event ) { 7926 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 7927 }; 7928 7929 jQuery.event.special[ fix ] = { 7930 setup: function() { 7931 var doc = this.ownerDocument || this, 7932 attaches = dataPriv.access( doc, fix ); 7933 7934 if ( !attaches ) { 7935 doc.addEventListener( orig, handler, true ); 7936 } 7937 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 7938 }, 7939 teardown: function() { 7940 var doc = this.ownerDocument || this, 7941 attaches = dataPriv.access( doc, fix ) - 1; 7942 7943 if ( !attaches ) { 7944 doc.removeEventListener( orig, handler, true ); 7945 dataPriv.remove( doc, fix ); 7946 7947 } else { 7948 dataPriv.access( doc, fix, attaches ); 7949 } 7950 } 7951 }; 7952 } ); 7953} 7954var location = window.location; 7955 7956var nonce = jQuery.now(); 7957 7958var rquery = ( /\?/ ); 7959 7960 7961 7962// Support: Android 2.3 7963// Workaround failure to string-cast null input 7964jQuery.parseJSON = function( data ) { 7965 return JSON.parse( data + "" ); 7966}; 7967 7968 7969// Cross-browser xml parsing 7970jQuery.parseXML = function( data ) { 7971 var xml; 7972 if ( !data || typeof data !== "string" ) { 7973 return null; 7974 } 7975 7976 // Support: IE9 7977 try { 7978 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 7979 } catch ( e ) { 7980 xml = undefined; 7981 } 7982 7983 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 7984 jQuery.error( "Invalid XML: " + data ); 7985 } 7986 return xml; 7987}; 7988 7989 7990var 7991 rhash = /#.*$/, 7992 rts = /([?&])_=[^&]*/, 7993 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 7994 7995 // #7653, #8125, #8152: local protocol detection 7996 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 7997 rnoContent = /^(?:GET|HEAD)$/, 7998 rprotocol = /^\/\//, 7999 8000 /* Prefilters 8001 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 8002 * 2) These are called: 8003 * - BEFORE asking for a transport 8004 * - AFTER param serialization (s.data is a string if s.processData is true) 8005 * 3) key is the dataType 8006 * 4) the catchall symbol "*" can be used 8007 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 8008 */ 8009 prefilters = {}, 8010 8011 /* Transports bindings 8012 * 1) key is the dataType 8013 * 2) the catchall symbol "*" can be used 8014 * 3) selection will start with transport dataType and THEN go to "*" if needed 8015 */ 8016 transports = {}, 8017 8018 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 8019 allTypes = "*/".concat( "*" ), 8020 8021 // Anchor tag for parsing the document origin 8022 originAnchor = document.createElement( "a" ); 8023 originAnchor.href = location.href; 8024 8025// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 8026function addToPrefiltersOrTransports( structure ) { 8027 8028 // dataTypeExpression is optional and defaults to "*" 8029 return function( dataTypeExpression, func ) { 8030 8031 if ( typeof dataTypeExpression !== "string" ) { 8032 func = dataTypeExpression; 8033 dataTypeExpression = "*"; 8034 } 8035 8036 var dataType, 8037 i = 0, 8038 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; 8039 8040 if ( jQuery.isFunction( func ) ) { 8041 8042 // For each dataType in the dataTypeExpression 8043 while ( ( dataType = dataTypes[ i++ ] ) ) { 8044 8045 // Prepend if requested 8046 if ( dataType[ 0 ] === "+" ) { 8047 dataType = dataType.slice( 1 ) || "*"; 8048 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 8049 8050 // Otherwise append 8051 } else { 8052 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 8053 } 8054 } 8055 } 8056 }; 8057} 8058 8059// Base inspection function for prefilters and transports 8060function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 8061 8062 var inspected = {}, 8063 seekingTransport = ( structure === transports ); 8064 8065 function inspect( dataType ) { 8066 var selected; 8067 inspected[ dataType ] = true; 8068 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 8069 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 8070 if ( typeof dataTypeOrTransport === "string" && 8071 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 8072 8073 options.dataTypes.unshift( dataTypeOrTransport ); 8074 inspect( dataTypeOrTransport ); 8075 return false; 8076 } else if ( seekingTransport ) { 8077 return !( selected = dataTypeOrTransport ); 8078 } 8079 } ); 8080 return selected; 8081 } 8082 8083 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 8084} 8085 8086// A special extend for ajax options 8087// that takes "flat" options (not to be deep extended) 8088// Fixes #9887 8089function ajaxExtend( target, src ) { 8090 var key, deep, 8091 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 8092 8093 for ( key in src ) { 8094 if ( src[ key ] !== undefined ) { 8095 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 8096 } 8097 } 8098 if ( deep ) { 8099 jQuery.extend( true, target, deep ); 8100 } 8101 8102 return target; 8103} 8104 8105/* Handles responses to an ajax request: 8106 * - finds the right dataType (mediates between content-type and expected dataType) 8107 * - returns the corresponding response 8108 */ 8109function ajaxHandleResponses( s, jqXHR, responses ) { 8110 8111 var ct, type, finalDataType, firstDataType, 8112 contents = s.contents, 8113 dataTypes = s.dataTypes; 8114 8115 // Remove auto dataType and get content-type in the process 8116 while ( dataTypes[ 0 ] === "*" ) { 8117 dataTypes.shift(); 8118 if ( ct === undefined ) { 8119 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 8120 } 8121 } 8122 8123 // Check if we're dealing with a known content-type 8124 if ( ct ) { 8125 for ( type in contents ) { 8126 if ( contents[ type ] && contents[ type ].test( ct ) ) { 8127 dataTypes.unshift( type ); 8128 break; 8129 } 8130 } 8131 } 8132 8133 // Check to see if we have a response for the expected dataType 8134 if ( dataTypes[ 0 ] in responses ) { 8135 finalDataType = dataTypes[ 0 ]; 8136 } else { 8137 8138 // Try convertible dataTypes 8139 for ( type in responses ) { 8140 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 8141 finalDataType = type; 8142 break; 8143 } 8144 if ( !firstDataType ) { 8145 firstDataType = type; 8146 } 8147 } 8148 8149 // Or just use first one 8150 finalDataType = finalDataType || firstDataType; 8151 } 8152 8153 // If we found a dataType 8154 // We add the dataType to the list if needed 8155 // and return the corresponding response 8156 if ( finalDataType ) { 8157 if ( finalDataType !== dataTypes[ 0 ] ) { 8158 dataTypes.unshift( finalDataType ); 8159 } 8160 return responses[ finalDataType ]; 8161 } 8162} 8163 8164/* Chain conversions given the request and the original response 8165 * Also sets the responseXXX fields on the jqXHR instance 8166 */ 8167function ajaxConvert( s, response, jqXHR, isSuccess ) { 8168 var conv2, current, conv, tmp, prev, 8169 converters = {}, 8170 8171 // Work with a copy of dataTypes in case we need to modify it for conversion 8172 dataTypes = s.dataTypes.slice(); 8173 8174 // Create converters map with lowercased keys 8175 if ( dataTypes[ 1 ] ) { 8176 for ( conv in s.converters ) { 8177 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 8178 } 8179 } 8180 8181 current = dataTypes.shift(); 8182 8183 // Convert to each sequential dataType 8184 while ( current ) { 8185 8186 if ( s.responseFields[ current ] ) { 8187 jqXHR[ s.responseFields[ current ] ] = response; 8188 } 8189 8190 // Apply the dataFilter if provided 8191 if ( !prev && isSuccess && s.dataFilter ) { 8192 response = s.dataFilter( response, s.dataType ); 8193 } 8194 8195 prev = current; 8196 current = dataTypes.shift(); 8197 8198 if ( current ) { 8199 8200 // There's only work to do if current dataType is non-auto 8201 if ( current === "*" ) { 8202 8203 current = prev; 8204 8205 // Convert response if prev dataType is non-auto and differs from current 8206 } else if ( prev !== "*" && prev !== current ) { 8207 8208 // Seek a direct converter 8209 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 8210 8211 // If none found, seek a pair 8212 if ( !conv ) { 8213 for ( conv2 in converters ) { 8214 8215 // If conv2 outputs current 8216 tmp = conv2.split( " " ); 8217 if ( tmp[ 1 ] === current ) { 8218 8219 // If prev can be converted to accepted input 8220 conv = converters[ prev + " " + tmp[ 0 ] ] || 8221 converters[ "* " + tmp[ 0 ] ]; 8222 if ( conv ) { 8223 8224 // Condense equivalence converters 8225 if ( conv === true ) { 8226 conv = converters[ conv2 ]; 8227 8228 // Otherwise, insert the intermediate dataType 8229 } else if ( converters[ conv2 ] !== true ) { 8230 current = tmp[ 0 ]; 8231 dataTypes.unshift( tmp[ 1 ] ); 8232 } 8233 break; 8234 } 8235 } 8236 } 8237 } 8238 8239 // Apply converter (if not an equivalence) 8240 if ( conv !== true ) { 8241 8242 // Unless errors are allowed to bubble, catch and return them 8243 if ( conv && s.throws ) { 8244 response = conv( response ); 8245 } else { 8246 try { 8247 response = conv( response ); 8248 } catch ( e ) { 8249 return { 8250 state: "parsererror", 8251 error: conv ? e : "No conversion from " + prev + " to " + current 8252 }; 8253 } 8254 } 8255 } 8256 } 8257 } 8258 } 8259 8260 return { state: "success", data: response }; 8261} 8262 8263jQuery.extend( { 8264 8265 // Counter for holding the number of active queries 8266 active: 0, 8267 8268 // Last-Modified header cache for next request 8269 lastModified: {}, 8270 etag: {}, 8271 8272 ajaxSettings: { 8273 url: location.href, 8274 type: "GET", 8275 isLocal: rlocalProtocol.test( location.protocol ), 8276 global: true, 8277 processData: true, 8278 async: true, 8279 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 8280 /* 8281 timeout: 0, 8282 data: null, 8283 dataType: null, 8284 username: null, 8285 password: null, 8286 cache: null, 8287 throws: false, 8288 traditional: false, 8289 headers: {}, 8290 */ 8291 8292 accepts: { 8293 "*": allTypes, 8294 text: "text/plain", 8295 html: "text/html", 8296 xml: "application/xml, text/xml", 8297 json: "application/json, text/javascript" 8298 }, 8299 8300 contents: { 8301 xml: /\bxml\b/, 8302 html: /\bhtml/, 8303 json: /\bjson\b/ 8304 }, 8305 8306 responseFields: { 8307 xml: "responseXML", 8308 text: "responseText", 8309 json: "responseJSON" 8310 }, 8311 8312 // Data converters 8313 // Keys separate source (or catchall "*") and destination types with a single space 8314 converters: { 8315 8316 // Convert anything to text 8317 "* text": String, 8318 8319 // Text to html (true = no transformation) 8320 "text html": true, 8321 8322 // Evaluate text as a json expression 8323 "text json": jQuery.parseJSON, 8324 8325 // Parse text as xml 8326 "text xml": jQuery.parseXML 8327 }, 8328 8329 // For options that shouldn't be deep extended: 8330 // you can add your own custom options here if 8331 // and when you create one that shouldn't be 8332 // deep extended (see ajaxExtend) 8333 flatOptions: { 8334 url: true, 8335 context: true 8336 } 8337 }, 8338 8339 // Creates a full fledged settings object into target 8340 // with both ajaxSettings and settings fields. 8341 // If target is omitted, writes into ajaxSettings. 8342 ajaxSetup: function( target, settings ) { 8343 return settings ? 8344 8345 // Building a settings object 8346 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 8347 8348 // Extending ajaxSettings 8349 ajaxExtend( jQuery.ajaxSettings, target ); 8350 }, 8351 8352 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 8353 ajaxTransport: addToPrefiltersOrTransports( transports ), 8354 8355 // Main method 8356 ajax: function( url, options ) { 8357 8358 // If url is an object, simulate pre-1.5 signature 8359 if ( typeof url === "object" ) { 8360 options = url; 8361 url = undefined; 8362 } 8363 8364 // Force options to be an object 8365 options = options || {}; 8366 8367 var transport, 8368 8369 // URL without anti-cache param 8370 cacheURL, 8371 8372 // Response headers 8373 responseHeadersString, 8374 responseHeaders, 8375 8376 // timeout handle 8377 timeoutTimer, 8378 8379 // Url cleanup var 8380 urlAnchor, 8381 8382 // To know if global events are to be dispatched 8383 fireGlobals, 8384 8385 // Loop variable 8386 i, 8387 8388 // Create the final options object 8389 s = jQuery.ajaxSetup( {}, options ), 8390 8391 // Callbacks context 8392 callbackContext = s.context || s, 8393 8394 // Context for global events is callbackContext if it is a DOM node or jQuery collection 8395 globalEventContext = s.context && 8396 ( callbackContext.nodeType || callbackContext.jquery ) ? 8397 jQuery( callbackContext ) : 8398 jQuery.event, 8399 8400 // Deferreds 8401 deferred = jQuery.Deferred(), 8402 completeDeferred = jQuery.Callbacks( "once memory" ), 8403 8404 // Status-dependent callbacks 8405 statusCode = s.statusCode || {}, 8406 8407 // Headers (they are sent all at once) 8408 requestHeaders = {}, 8409 requestHeadersNames = {}, 8410 8411 // The jqXHR state 8412 state = 0, 8413 8414 // Default abort message 8415 strAbort = "canceled", 8416 8417 // Fake xhr 8418 jqXHR = { 8419 readyState: 0, 8420 8421 // Builds headers hashtable if needed 8422 getResponseHeader: function( key ) { 8423 var match; 8424 if ( state === 2 ) { 8425 if ( !responseHeaders ) { 8426 responseHeaders = {}; 8427 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 8428 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; 8429 } 8430 } 8431 match = responseHeaders[ key.toLowerCase() ]; 8432 } 8433 return match == null ? null : match; 8434 }, 8435 8436 // Raw string 8437 getAllResponseHeaders: function() { 8438 return state === 2 ? responseHeadersString : null; 8439 }, 8440 8441 // Caches the header 8442 setRequestHeader: function( name, value ) { 8443 var lname = name.toLowerCase(); 8444 if ( !state ) { 8445 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 8446 requestHeaders[ name ] = value; 8447 } 8448 return this; 8449 }, 8450 8451 // Overrides response content-type header 8452 overrideMimeType: function( type ) { 8453 if ( !state ) { 8454 s.mimeType = type; 8455 } 8456 return this; 8457 }, 8458 8459 // Status-dependent callbacks 8460 statusCode: function( map ) { 8461 var code; 8462 if ( map ) { 8463 if ( state < 2 ) { 8464 for ( code in map ) { 8465 8466 // Lazy-add the new callback in a way that preserves old ones 8467 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 8468 } 8469 } else { 8470 8471 // Execute the appropriate callbacks 8472 jqXHR.always( map[ jqXHR.status ] ); 8473 } 8474 } 8475 return this; 8476 }, 8477 8478 // Cancel the request 8479 abort: function( statusText ) { 8480 var finalText = statusText || strAbort; 8481 if ( transport ) { 8482 transport.abort( finalText ); 8483 } 8484 done( 0, finalText ); 8485 return this; 8486 } 8487 }; 8488 8489 // Attach deferreds 8490 deferred.promise( jqXHR ).complete = completeDeferred.add; 8491 jqXHR.success = jqXHR.done; 8492 jqXHR.error = jqXHR.fail; 8493 8494 // Remove hash character (#7531: and string promotion) 8495 // Add protocol if not provided (prefilters might expect it) 8496 // Handle falsy url in the settings object (#10093: consistency with old signature) 8497 // We also use the url parameter if available 8498 s.url = ( ( url || s.url || location.href ) + "" ).replace( rhash, "" ) 8499 .replace( rprotocol, location.protocol + "//" ); 8500 8501 // Alias method option to type as per ticket #12004 8502 s.type = options.method || options.type || s.method || s.type; 8503 8504 // Extract dataTypes list 8505 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; 8506 8507 // A cross-domain request is in order when the origin doesn't match the current origin. 8508 if ( s.crossDomain == null ) { 8509 urlAnchor = document.createElement( "a" ); 8510 8511 // Support: IE8-11+ 8512 // IE throws exception if url is malformed, e.g. http://example.com:80x/ 8513 try { 8514 urlAnchor.href = s.url; 8515 8516 // Support: IE8-11+ 8517 // Anchor's host property isn't correctly set when s.url is relative 8518 urlAnchor.href = urlAnchor.href; 8519 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 8520 urlAnchor.protocol + "//" + urlAnchor.host; 8521 } catch ( e ) { 8522 8523 // If there is an error parsing the URL, assume it is crossDomain, 8524 // it can be rejected by the transport if it is invalid 8525 s.crossDomain = true; 8526 } 8527 } 8528 8529 // Convert data if not already a string 8530 if ( s.data && s.processData && typeof s.data !== "string" ) { 8531 s.data = jQuery.param( s.data, s.traditional ); 8532 } 8533 8534 // Apply prefilters 8535 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 8536 8537 // If request was aborted inside a prefilter, stop there 8538 if ( state === 2 ) { 8539 return jqXHR; 8540 } 8541 8542 // We can fire global events as of now if asked to 8543 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 8544 fireGlobals = jQuery.event && s.global; 8545 8546 // Watch for a new set of requests 8547 if ( fireGlobals && jQuery.active++ === 0 ) { 8548 jQuery.event.trigger( "ajaxStart" ); 8549 } 8550 8551 // Uppercase the type 8552 s.type = s.type.toUpperCase(); 8553 8554 // Determine if request has content 8555 s.hasContent = !rnoContent.test( s.type ); 8556 8557 // Save the URL in case we're toying with the If-Modified-Since 8558 // and/or If-None-Match header later on 8559 cacheURL = s.url; 8560 8561 // More options handling for requests with no content 8562 if ( !s.hasContent ) { 8563 8564 // If data is available, append data to url 8565 if ( s.data ) { 8566 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); 8567 8568 // #9682: remove data so that it's not used in an eventual retry 8569 delete s.data; 8570 } 8571 8572 // Add anti-cache in url if needed 8573 if ( s.cache === false ) { 8574 s.url = rts.test( cacheURL ) ? 8575 8576 // If there is already a '_' parameter, set its value 8577 cacheURL.replace( rts, "$1_=" + nonce++ ) : 8578 8579 // Otherwise add one to the end 8580 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; 8581 } 8582 } 8583 8584 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 8585 if ( s.ifModified ) { 8586 if ( jQuery.lastModified[ cacheURL ] ) { 8587 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 8588 } 8589 if ( jQuery.etag[ cacheURL ] ) { 8590 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 8591 } 8592 } 8593 8594 // Set the correct header, if data is being sent 8595 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 8596 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 8597 } 8598 8599 // Set the Accepts header for the server, depending on the dataType 8600 jqXHR.setRequestHeader( 8601 "Accept", 8602 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 8603 s.accepts[ s.dataTypes[ 0 ] ] + 8604 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 8605 s.accepts[ "*" ] 8606 ); 8607 8608 // Check for headers option 8609 for ( i in s.headers ) { 8610 jqXHR.setRequestHeader( i, s.headers[ i ] ); 8611 } 8612 8613 // Allow custom headers/mimetypes and early abort 8614 if ( s.beforeSend && 8615 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 8616 8617 // Abort if not done already and return 8618 return jqXHR.abort(); 8619 } 8620 8621 // Aborting is no longer a cancellation 8622 strAbort = "abort"; 8623 8624 // Install callbacks on deferreds 8625 for ( i in { success: 1, error: 1, complete: 1 } ) { 8626 jqXHR[ i ]( s[ i ] ); 8627 } 8628 8629 // Get transport 8630 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 8631 8632 // If no transport, we auto-abort 8633 if ( !transport ) { 8634 done( -1, "No Transport" ); 8635 } else { 8636 jqXHR.readyState = 1; 8637 8638 // Send global event 8639 if ( fireGlobals ) { 8640 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 8641 } 8642 8643 // If request was aborted inside ajaxSend, stop there 8644 if ( state === 2 ) { 8645 return jqXHR; 8646 } 8647 8648 // Timeout 8649 if ( s.async && s.timeout > 0 ) { 8650 timeoutTimer = window.setTimeout( function() { 8651 jqXHR.abort( "timeout" ); 8652 }, s.timeout ); 8653 } 8654 8655 try { 8656 state = 1; 8657 transport.send( requestHeaders, done ); 8658 } catch ( e ) { 8659 8660 // Propagate exception as error if not done 8661 if ( state < 2 ) { 8662 done( -1, e ); 8663 8664 // Simply rethrow otherwise 8665 } else { 8666 throw e; 8667 } 8668 } 8669 } 8670 8671 // Callback for when everything is done 8672 function done( status, nativeStatusText, responses, headers ) { 8673 var isSuccess, success, error, response, modified, 8674 statusText = nativeStatusText; 8675 8676 // Called once 8677 if ( state === 2 ) { 8678 return; 8679 } 8680 8681 // State is "done" now 8682 state = 2; 8683 8684 // Clear timeout if it exists 8685 if ( timeoutTimer ) { 8686 window.clearTimeout( timeoutTimer ); 8687 } 8688 8689 // Dereference transport for early garbage collection 8690 // (no matter how long the jqXHR object will be used) 8691 transport = undefined; 8692 8693 // Cache response headers 8694 responseHeadersString = headers || ""; 8695 8696 // Set readyState 8697 jqXHR.readyState = status > 0 ? 4 : 0; 8698 8699 // Determine if successful 8700 isSuccess = status >= 200 && status < 300 || status === 304; 8701 8702 // Get response data 8703 if ( responses ) { 8704 response = ajaxHandleResponses( s, jqXHR, responses ); 8705 } 8706 8707 // Convert no matter what (that way responseXXX fields are always set) 8708 response = ajaxConvert( s, response, jqXHR, isSuccess ); 8709 8710 // If successful, handle type chaining 8711 if ( isSuccess ) { 8712 8713 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 8714 if ( s.ifModified ) { 8715 modified = jqXHR.getResponseHeader( "Last-Modified" ); 8716 if ( modified ) { 8717 jQuery.lastModified[ cacheURL ] = modified; 8718 } 8719 modified = jqXHR.getResponseHeader( "etag" ); 8720 if ( modified ) { 8721 jQuery.etag[ cacheURL ] = modified; 8722 } 8723 } 8724 8725 // if no content 8726 if ( status === 204 || s.type === "HEAD" ) { 8727 statusText = "nocontent"; 8728 8729 // if not modified 8730 } else if ( status === 304 ) { 8731 statusText = "notmodified"; 8732 8733 // If we have data, let's convert it 8734 } else { 8735 statusText = response.state; 8736 success = response.data; 8737 error = response.error; 8738 isSuccess = !error; 8739 } 8740 } else { 8741 8742 // Extract error from statusText and normalize for non-aborts 8743 error = statusText; 8744 if ( status || !statusText ) { 8745 statusText = "error"; 8746 if ( status < 0 ) { 8747 status = 0; 8748 } 8749 } 8750 } 8751 8752 // Set data for the fake xhr object 8753 jqXHR.status = status; 8754 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 8755 8756 // Success/Error 8757 if ( isSuccess ) { 8758 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 8759 } else { 8760 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 8761 } 8762 8763 // Status-dependent callbacks 8764 jqXHR.statusCode( statusCode ); 8765 statusCode = undefined; 8766 8767 if ( fireGlobals ) { 8768 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 8769 [ jqXHR, s, isSuccess ? success : error ] ); 8770 } 8771 8772 // Complete 8773 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 8774 8775 if ( fireGlobals ) { 8776 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 8777 8778 // Handle the global AJAX counter 8779 if ( !( --jQuery.active ) ) { 8780 jQuery.event.trigger( "ajaxStop" ); 8781 } 8782 } 8783 } 8784 8785 return jqXHR; 8786 }, 8787 8788 getJSON: function( url, data, callback ) { 8789 return jQuery.get( url, data, callback, "json" ); 8790 }, 8791 8792 getScript: function( url, callback ) { 8793 return jQuery.get( url, undefined, callback, "script" ); 8794 } 8795} ); 8796 8797jQuery.each( [ "get", "post" ], function( i, method ) { 8798 jQuery[ method ] = function( url, data, callback, type ) { 8799 8800 // Shift arguments if data argument was omitted 8801 if ( jQuery.isFunction( data ) ) { 8802 type = type || callback; 8803 callback = data; 8804 data = undefined; 8805 } 8806 8807 // The url can be an options object (which then must have .url) 8808 return jQuery.ajax( jQuery.extend( { 8809 url: url, 8810 type: method, 8811 dataType: type, 8812 data: data, 8813 success: callback 8814 }, jQuery.isPlainObject( url ) && url ) ); 8815 }; 8816} ); 8817 8818 8819jQuery._evalUrl = function( url ) { 8820 return jQuery.ajax( { 8821 url: url, 8822 8823 // Make this explicit, since user can override this through ajaxSetup (#11264) 8824 type: "GET", 8825 dataType: "script", 8826 async: false, 8827 global: false, 8828 "throws": true 8829 } ); 8830}; 8831 8832 8833jQuery.fn.extend( { 8834 wrapAll: function( html ) { 8835 var wrap; 8836 8837 if ( jQuery.isFunction( html ) ) { 8838 return this.each( function( i ) { 8839 jQuery( this ).wrapAll( html.call( this, i ) ); 8840 } ); 8841 } 8842 8843 if ( this[ 0 ] ) { 8844 8845 // The elements to wrap the target around 8846 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 8847 8848 if ( this[ 0 ].parentNode ) { 8849 wrap.insertBefore( this[ 0 ] ); 8850 } 8851 8852 wrap.map( function() { 8853 var elem = this; 8854 8855 while ( elem.firstElementChild ) { 8856 elem = elem.firstElementChild; 8857 } 8858 8859 return elem; 8860 } ).append( this ); 8861 } 8862 8863 return this; 8864 }, 8865 8866 wrapInner: function( html ) { 8867 if ( jQuery.isFunction( html ) ) { 8868 return this.each( function( i ) { 8869 jQuery( this ).wrapInner( html.call( this, i ) ); 8870 } ); 8871 } 8872 8873 return this.each( function() { 8874 var self = jQuery( this ), 8875 contents = self.contents(); 8876 8877 if ( contents.length ) { 8878 contents.wrapAll( html ); 8879 8880 } else { 8881 self.append( html ); 8882 } 8883 } ); 8884 }, 8885 8886 wrap: function( html ) { 8887 var isFunction = jQuery.isFunction( html ); 8888 8889 return this.each( function( i ) { 8890 jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); 8891 } ); 8892 }, 8893 8894 unwrap: function() { 8895 return this.parent().each( function() { 8896 if ( !jQuery.nodeName( this, "body" ) ) { 8897 jQuery( this ).replaceWith( this.childNodes ); 8898 } 8899 } ).end(); 8900 } 8901} ); 8902 8903 8904jQuery.expr.filters.hidden = function( elem ) { 8905 return !jQuery.expr.filters.visible( elem ); 8906}; 8907jQuery.expr.filters.visible = function( elem ) { 8908 8909 // Support: Opera <= 12.12 8910 // Opera reports offsetWidths and offsetHeights less than zero on some elements 8911 // Use OR instead of AND as the element is not visible if either is true 8912 // See tickets #10406 and #13132 8913 return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0; 8914}; 8915 8916 8917 8918 8919var r20 = /%20/g, 8920 rbracket = /\[\]$/, 8921 rCRLF = /\r?\n/g, 8922 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 8923 rsubmittable = /^(?:input|select|textarea|keygen)/i; 8924 8925function buildParams( prefix, obj, traditional, add ) { 8926 var name; 8927 8928 if ( jQuery.isArray( obj ) ) { 8929 8930 // Serialize array item. 8931 jQuery.each( obj, function( i, v ) { 8932 if ( traditional || rbracket.test( prefix ) ) { 8933 8934 // Treat each array item as a scalar. 8935 add( prefix, v ); 8936 8937 } else { 8938 8939 // Item is non-scalar (array or object), encode its numeric index. 8940 buildParams( 8941 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 8942 v, 8943 traditional, 8944 add 8945 ); 8946 } 8947 } ); 8948 8949 } else if ( !traditional && jQuery.type( obj ) === "object" ) { 8950 8951 // Serialize object item. 8952 for ( name in obj ) { 8953 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 8954 } 8955 8956 } else { 8957 8958 // Serialize scalar item. 8959 add( prefix, obj ); 8960 } 8961} 8962 8963// Serialize an array of form elements or a set of 8964// key/values into a query string 8965jQuery.param = function( a, traditional ) { 8966 var prefix, 8967 s = [], 8968 add = function( key, value ) { 8969 8970 // If value is a function, invoke it and return its value 8971 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); 8972 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 8973 }; 8974 8975 // Set traditional to true for jQuery <= 1.3.2 behavior. 8976 if ( traditional === undefined ) { 8977 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 8978 } 8979 8980 // If an array was passed in, assume that it is an array of form elements. 8981 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 8982 8983 // Serialize the form elements 8984 jQuery.each( a, function() { 8985 add( this.name, this.value ); 8986 } ); 8987 8988 } else { 8989 8990 // If traditional, encode the "old" way (the way 1.3.2 or older 8991 // did it), otherwise encode params recursively. 8992 for ( prefix in a ) { 8993 buildParams( prefix, a[ prefix ], traditional, add ); 8994 } 8995 } 8996 8997 // Return the resulting serialization 8998 return s.join( "&" ).replace( r20, "+" ); 8999}; 9000 9001jQuery.fn.extend( { 9002 serialize: function() { 9003 return jQuery.param( this.serializeArray() ); 9004 }, 9005 serializeArray: function() { 9006 return this.map( function() { 9007 9008 // Can add propHook for "elements" to filter or add form elements 9009 var elements = jQuery.prop( this, "elements" ); 9010 return elements ? jQuery.makeArray( elements ) : this; 9011 } ) 9012 .filter( function() { 9013 var type = this.type; 9014 9015 // Use .is( ":disabled" ) so that fieldset[disabled] works 9016 return this.name && !jQuery( this ).is( ":disabled" ) && 9017 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 9018 ( this.checked || !rcheckableType.test( type ) ); 9019 } ) 9020 .map( function( i, elem ) { 9021 var val = jQuery( this ).val(); 9022 9023 return val == null ? 9024 null : 9025 jQuery.isArray( val ) ? 9026 jQuery.map( val, function( val ) { 9027 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 9028 } ) : 9029 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 9030 } ).get(); 9031 } 9032} ); 9033 9034 9035jQuery.ajaxSettings.xhr = function() { 9036 try { 9037 return new window.XMLHttpRequest(); 9038 } catch ( e ) {} 9039}; 9040 9041var xhrSuccessStatus = { 9042 9043 // File protocol always yields status code 0, assume 200 9044 0: 200, 9045 9046 // Support: IE9 9047 // #1450: sometimes IE returns 1223 when it should be 204 9048 1223: 204 9049 }, 9050 xhrSupported = jQuery.ajaxSettings.xhr(); 9051 9052support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 9053support.ajax = xhrSupported = !!xhrSupported; 9054 9055jQuery.ajaxTransport( function( options ) { 9056 var callback, errorCallback; 9057 9058 // Cross domain only allowed if supported through XMLHttpRequest 9059 if ( support.cors || xhrSupported && !options.crossDomain ) { 9060 return { 9061 send: function( headers, complete ) { 9062 var i, 9063 xhr = options.xhr(); 9064 9065 xhr.open( 9066 options.type, 9067 options.url, 9068 options.async, 9069 options.username, 9070 options.password 9071 ); 9072 9073 // Apply custom fields if provided 9074 if ( options.xhrFields ) { 9075 for ( i in options.xhrFields ) { 9076 xhr[ i ] = options.xhrFields[ i ]; 9077 } 9078 } 9079 9080 // Override mime type if needed 9081 if ( options.mimeType && xhr.overrideMimeType ) { 9082 xhr.overrideMimeType( options.mimeType ); 9083 } 9084 9085 // X-Requested-With header 9086 // For cross-domain requests, seeing as conditions for a preflight are 9087 // akin to a jigsaw puzzle, we simply never set it to be sure. 9088 // (it can always be set on a per-request basis or even using ajaxSetup) 9089 // For same-domain requests, won't change header if already provided. 9090 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 9091 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 9092 } 9093 9094 // Set headers 9095 for ( i in headers ) { 9096 xhr.setRequestHeader( i, headers[ i ] ); 9097 } 9098 9099 // Callback 9100 callback = function( type ) { 9101 return function() { 9102 if ( callback ) { 9103 callback = errorCallback = xhr.onload = 9104 xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; 9105 9106 if ( type === "abort" ) { 9107 xhr.abort(); 9108 } else if ( type === "error" ) { 9109 9110 // Support: IE9 9111 // On a manual native abort, IE9 throws 9112 // errors on any property access that is not readyState 9113 if ( typeof xhr.status !== "number" ) { 9114 complete( 0, "error" ); 9115 } else { 9116 complete( 9117 9118 // File: protocol always yields status 0; see #8605, #14207 9119 xhr.status, 9120 xhr.statusText 9121 ); 9122 } 9123 } else { 9124 complete( 9125 xhrSuccessStatus[ xhr.status ] || xhr.status, 9126 xhr.statusText, 9127 9128 // Support: IE9 only 9129 // IE9 has no XHR2 but throws on binary (trac-11426) 9130 // For XHR2 non-text, let the caller handle it (gh-2498) 9131 ( xhr.responseType || "text" ) !== "text" || 9132 typeof xhr.responseText !== "string" ? 9133 { binary: xhr.response } : 9134 { text: xhr.responseText }, 9135 xhr.getAllResponseHeaders() 9136 ); 9137 } 9138 } 9139 }; 9140 }; 9141 9142 // Listen to events 9143 xhr.onload = callback(); 9144 errorCallback = xhr.onerror = callback( "error" ); 9145 9146 // Support: IE9 9147 // Use onreadystatechange to replace onabort 9148 // to handle uncaught aborts 9149 if ( xhr.onabort !== undefined ) { 9150 xhr.onabort = errorCallback; 9151 } else { 9152 xhr.onreadystatechange = function() { 9153 9154 // Check readyState before timeout as it changes 9155 if ( xhr.readyState === 4 ) { 9156 9157 // Allow onerror to be called first, 9158 // but that will not handle a native abort 9159 // Also, save errorCallback to a variable 9160 // as xhr.onerror cannot be accessed 9161 window.setTimeout( function() { 9162 if ( callback ) { 9163 errorCallback(); 9164 } 9165 } ); 9166 } 9167 }; 9168 } 9169 9170 // Create the abort callback 9171 callback = callback( "abort" ); 9172 9173 try { 9174 9175 // Do send the request (this may raise an exception) 9176 xhr.send( options.hasContent && options.data || null ); 9177 } catch ( e ) { 9178 9179 // #14683: Only rethrow if this hasn't been notified as an error yet 9180 if ( callback ) { 9181 throw e; 9182 } 9183 } 9184 }, 9185 9186 abort: function() { 9187 if ( callback ) { 9188 callback(); 9189 } 9190 } 9191 }; 9192 } 9193} ); 9194 9195 9196 9197 9198// Install script dataType 9199jQuery.ajaxSetup( { 9200 accepts: { 9201 script: "text/javascript, application/javascript, " + 9202 "application/ecmascript, application/x-ecmascript" 9203 }, 9204 contents: { 9205 script: /\b(?:java|ecma)script\b/ 9206 }, 9207 converters: { 9208 "text script": function( text ) { 9209 jQuery.globalEval( text ); 9210 return text; 9211 } 9212 } 9213} ); 9214 9215// Handle cache's special case and crossDomain 9216jQuery.ajaxPrefilter( "script", function( s ) { 9217 if ( s.cache === undefined ) { 9218 s.cache = false; 9219 } 9220 if ( s.crossDomain ) { 9221 s.type = "GET"; 9222 } 9223} ); 9224 9225// Bind script tag hack transport 9226jQuery.ajaxTransport( "script", function( s ) { 9227 9228 // This transport only deals with cross domain requests 9229 if ( s.crossDomain ) { 9230 var script, callback; 9231 return { 9232 send: function( _, complete ) { 9233 script = jQuery( "<script>" ).prop( { 9234 charset: s.scriptCharset, 9235 src: s.url 9236 } ).on( 9237 "load error", 9238 callback = function( evt ) { 9239 script.remove(); 9240 callback = null; 9241 if ( evt ) { 9242 complete( evt.type === "error" ? 404 : 200, evt.type ); 9243 } 9244 } 9245 ); 9246 9247 // Use native DOM manipulation to avoid our domManip AJAX trickery 9248 document.head.appendChild( script[ 0 ] ); 9249 }, 9250 abort: function() { 9251 if ( callback ) { 9252 callback(); 9253 } 9254 } 9255 }; 9256 } 9257} ); 9258 9259 9260 9261 9262var oldCallbacks = [], 9263 rjsonp = /(=)\?(?=&|$)|\?\?/; 9264 9265// Default jsonp settings 9266jQuery.ajaxSetup( { 9267 jsonp: "callback", 9268 jsonpCallback: function() { 9269 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 9270 this[ callback ] = true; 9271 return callback; 9272 } 9273} ); 9274 9275// Detect, normalize options and install callbacks for jsonp requests 9276jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 9277 9278 var callbackName, overwritten, responseContainer, 9279 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 9280 "url" : 9281 typeof s.data === "string" && 9282 ( s.contentType || "" ) 9283 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 9284 rjsonp.test( s.data ) && "data" 9285 ); 9286 9287 // Handle iff the expected data type is "jsonp" or we have a parameter to set 9288 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 9289 9290 // Get callback name, remembering preexisting value associated with it 9291 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 9292 s.jsonpCallback() : 9293 s.jsonpCallback; 9294 9295 // Insert callback into url or form data 9296 if ( jsonProp ) { 9297 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 9298 } else if ( s.jsonp !== false ) { 9299 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 9300 } 9301 9302 // Use data converter to retrieve json after script execution 9303 s.converters[ "script json" ] = function() { 9304 if ( !responseContainer ) { 9305 jQuery.error( callbackName + " was not called" ); 9306 } 9307 return responseContainer[ 0 ]; 9308 }; 9309 9310 // Force json dataType 9311 s.dataTypes[ 0 ] = "json"; 9312 9313 // Install callback 9314 overwritten = window[ callbackName ]; 9315 window[ callbackName ] = function() { 9316 responseContainer = arguments; 9317 }; 9318 9319 // Clean-up function (fires after converters) 9320 jqXHR.always( function() { 9321 9322 // If previous value didn't exist - remove it 9323 if ( overwritten === undefined ) { 9324 jQuery( window ).removeProp( callbackName ); 9325 9326 // Otherwise restore preexisting value 9327 } else { 9328 window[ callbackName ] = overwritten; 9329 } 9330 9331 // Save back as free 9332 if ( s[ callbackName ] ) { 9333 9334 // Make sure that re-using the options doesn't screw things around 9335 s.jsonpCallback = originalSettings.jsonpCallback; 9336 9337 // Save the callback name for future use 9338 oldCallbacks.push( callbackName ); 9339 } 9340 9341 // Call if it was a function and we have a response 9342 if ( responseContainer && jQuery.isFunction( overwritten ) ) { 9343 overwritten( responseContainer[ 0 ] ); 9344 } 9345 9346 responseContainer = overwritten = undefined; 9347 } ); 9348 9349 // Delegate to script 9350 return "script"; 9351 } 9352} ); 9353 9354 9355 9356 9357// Argument "data" should be string of html 9358// context (optional): If specified, the fragment will be created in this context, 9359// defaults to document 9360// keepScripts (optional): If true, will include scripts passed in the html string 9361jQuery.parseHTML = function( data, context, keepScripts ) { 9362 if ( !data || typeof data !== "string" ) { 9363 return null; 9364 } 9365 if ( typeof context === "boolean" ) { 9366 keepScripts = context; 9367 context = false; 9368 } 9369 context = context || document; 9370 9371 var parsed = rsingleTag.exec( data ), 9372 scripts = !keepScripts && []; 9373 9374 // Single tag 9375 if ( parsed ) { 9376 return [ context.createElement( parsed[ 1 ] ) ]; 9377 } 9378 9379 parsed = buildFragment( [ data ], context, scripts ); 9380 9381 if ( scripts && scripts.length ) { 9382 jQuery( scripts ).remove(); 9383 } 9384 9385 return jQuery.merge( [], parsed.childNodes ); 9386}; 9387 9388 9389// Keep a copy of the old load method 9390var _load = jQuery.fn.load; 9391 9392/** 9393 * Load a url into a page 9394 */ 9395jQuery.fn.load = function( url, params, callback ) { 9396 if ( typeof url !== "string" && _load ) { 9397 return _load.apply( this, arguments ); 9398 } 9399 9400 var selector, type, response, 9401 self = this, 9402 off = url.indexOf( " " ); 9403 9404 if ( off > -1 ) { 9405 selector = jQuery.trim( url.slice( off ) ); 9406 url = url.slice( 0, off ); 9407 } 9408 9409 // If it's a function 9410 if ( jQuery.isFunction( params ) ) { 9411 9412 // We assume that it's the callback 9413 callback = params; 9414 params = undefined; 9415 9416 // Otherwise, build a param string 9417 } else if ( params && typeof params === "object" ) { 9418 type = "POST"; 9419 } 9420 9421 // If we have elements to modify, make the request 9422 if ( self.length > 0 ) { 9423 jQuery.ajax( { 9424 url: url, 9425 9426 // If "type" variable is undefined, then "GET" method will be used. 9427 // Make value of this field explicit since 9428 // user can override it through ajaxSetup method 9429 type: type || "GET", 9430 dataType: "html", 9431 data: params 9432 } ).done( function( responseText ) { 9433 9434 // Save response for use in complete callback 9435 response = arguments; 9436 9437 self.html( selector ? 9438 9439 // If a selector was specified, locate the right elements in a dummy div 9440 // Exclude scripts to avoid IE 'Permission Denied' errors 9441 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 9442 9443 // Otherwise use the full result 9444 responseText ); 9445 9446 // If the request succeeds, this function gets "data", "status", "jqXHR" 9447 // but they are ignored because response was set above. 9448 // If it fails, this function gets "jqXHR", "status", "error" 9449 } ).always( callback && function( jqXHR, status ) { 9450 self.each( function() { 9451 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 9452 } ); 9453 } ); 9454 } 9455 9456 return this; 9457}; 9458 9459 9460 9461 9462// Attach a bunch of functions for handling common AJAX events 9463jQuery.each( [ 9464 "ajaxStart", 9465 "ajaxStop", 9466 "ajaxComplete", 9467 "ajaxError", 9468 "ajaxSuccess", 9469 "ajaxSend" 9470], function( i, type ) { 9471 jQuery.fn[ type ] = function( fn ) { 9472 return this.on( type, fn ); 9473 }; 9474} ); 9475 9476 9477 9478 9479jQuery.expr.filters.animated = function( elem ) { 9480 return jQuery.grep( jQuery.timers, function( fn ) { 9481 return elem === fn.elem; 9482 } ).length; 9483}; 9484 9485 9486 9487 9488/** 9489 * Gets a window from an element 9490 */ 9491function getWindow( elem ) { 9492 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; 9493} 9494 9495jQuery.offset = { 9496 setOffset: function( elem, options, i ) { 9497 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 9498 position = jQuery.css( elem, "position" ), 9499 curElem = jQuery( elem ), 9500 props = {}; 9501 9502 // Set position first, in-case top/left are set even on static elem 9503 if ( position === "static" ) { 9504 elem.style.position = "relative"; 9505 } 9506 9507 curOffset = curElem.offset(); 9508 curCSSTop = jQuery.css( elem, "top" ); 9509 curCSSLeft = jQuery.css( elem, "left" ); 9510 calculatePosition = ( position === "absolute" || position === "fixed" ) && 9511 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 9512 9513 // Need to be able to calculate position if either 9514 // top or left is auto and position is either absolute or fixed 9515 if ( calculatePosition ) { 9516 curPosition = curElem.position(); 9517 curTop = curPosition.top; 9518 curLeft = curPosition.left; 9519 9520 } else { 9521 curTop = parseFloat( curCSSTop ) || 0; 9522 curLeft = parseFloat( curCSSLeft ) || 0; 9523 } 9524 9525 if ( jQuery.isFunction( options ) ) { 9526 9527 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 9528 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 9529 } 9530 9531 if ( options.top != null ) { 9532 props.top = ( options.top - curOffset.top ) + curTop; 9533 } 9534 if ( options.left != null ) { 9535 props.left = ( options.left - curOffset.left ) + curLeft; 9536 } 9537 9538 if ( "using" in options ) { 9539 options.using.call( elem, props ); 9540 9541 } else { 9542 curElem.css( props ); 9543 } 9544 } 9545}; 9546 9547jQuery.fn.extend( { 9548 offset: function( options ) { 9549 if ( arguments.length ) { 9550 return options === undefined ? 9551 this : 9552 this.each( function( i ) { 9553 jQuery.offset.setOffset( this, options, i ); 9554 } ); 9555 } 9556 9557 var docElem, win, 9558 elem = this[ 0 ], 9559 box = { top: 0, left: 0 }, 9560 doc = elem && elem.ownerDocument; 9561 9562 if ( !doc ) { 9563 return; 9564 } 9565 9566 docElem = doc.documentElement; 9567 9568 // Make sure it's not a disconnected DOM node 9569 if ( !jQuery.contains( docElem, elem ) ) { 9570 return box; 9571 } 9572 9573 box = elem.getBoundingClientRect(); 9574 win = getWindow( doc ); 9575 return { 9576 top: box.top + win.pageYOffset - docElem.clientTop, 9577 left: box.left + win.pageXOffset - docElem.clientLeft 9578 }; 9579 }, 9580 9581 position: function() { 9582 if ( !this[ 0 ] ) { 9583 return; 9584 } 9585 9586 var offsetParent, offset, 9587 elem = this[ 0 ], 9588 parentOffset = { top: 0, left: 0 }; 9589 9590 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, 9591 // because it is its only offset parent 9592 if ( jQuery.css( elem, "position" ) === "fixed" ) { 9593 9594 // Assume getBoundingClientRect is there when computed position is fixed 9595 offset = elem.getBoundingClientRect(); 9596 9597 } else { 9598 9599 // Get *real* offsetParent 9600 offsetParent = this.offsetParent(); 9601 9602 // Get correct offsets 9603 offset = this.offset(); 9604 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 9605 parentOffset = offsetParent.offset(); 9606 } 9607 9608 // Add offsetParent borders 9609 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); 9610 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); 9611 } 9612 9613 // Subtract parent offsets and element margins 9614 return { 9615 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 9616 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 9617 }; 9618 }, 9619 9620 // This method will return documentElement in the following cases: 9621 // 1) For the element inside the iframe without offsetParent, this method will return 9622 // documentElement of the parent window 9623 // 2) For the hidden or detached element 9624 // 3) For body or html element, i.e. in case of the html node - it will return itself 9625 // 9626 // but those exceptions were never presented as a real life use-cases 9627 // and might be considered as more preferable results. 9628 // 9629 // This logic, however, is not guaranteed and can change at any point in the future 9630 offsetParent: function() { 9631 return this.map( function() { 9632 var offsetParent = this.offsetParent; 9633 9634 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 9635 offsetParent = offsetParent.offsetParent; 9636 } 9637 9638 return offsetParent || documentElement; 9639 } ); 9640 } 9641} ); 9642 9643// Create scrollLeft and scrollTop methods 9644jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 9645 var top = "pageYOffset" === prop; 9646 9647 jQuery.fn[ method ] = function( val ) { 9648 return access( this, function( elem, method, val ) { 9649 var win = getWindow( elem ); 9650 9651 if ( val === undefined ) { 9652 return win ? win[ prop ] : elem[ method ]; 9653 } 9654 9655 if ( win ) { 9656 win.scrollTo( 9657 !top ? val : win.pageXOffset, 9658 top ? val : win.pageYOffset 9659 ); 9660 9661 } else { 9662 elem[ method ] = val; 9663 } 9664 }, method, val, arguments.length ); 9665 }; 9666} ); 9667 9668// Support: Safari<7-8+, Chrome<37-44+ 9669// Add the top/left cssHooks using jQuery.fn.position 9670// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 9671// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280 9672// getComputedStyle returns percent when specified for top/left/bottom/right; 9673// rather than make the css module depend on the offset module, just check for it here 9674jQuery.each( [ "top", "left" ], function( i, prop ) { 9675 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 9676 function( elem, computed ) { 9677 if ( computed ) { 9678 computed = curCSS( elem, prop ); 9679 9680 // If curCSS returns percentage, fallback to offset 9681 return rnumnonpx.test( computed ) ? 9682 jQuery( elem ).position()[ prop ] + "px" : 9683 computed; 9684 } 9685 } 9686 ); 9687} ); 9688 9689 9690// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 9691jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 9692 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 9693 function( defaultExtra, funcName ) { 9694 9695 // Margin is only for outerHeight, outerWidth 9696 jQuery.fn[ funcName ] = function( margin, value ) { 9697 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 9698 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 9699 9700 return access( this, function( elem, type, value ) { 9701 var doc; 9702 9703 if ( jQuery.isWindow( elem ) ) { 9704 9705 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 9706 // isn't a whole lot we can do. See pull request at this URL for discussion: 9707 // https://github.com/jquery/jquery/pull/764 9708 return elem.document.documentElement[ "client" + name ]; 9709 } 9710 9711 // Get document width or height 9712 if ( elem.nodeType === 9 ) { 9713 doc = elem.documentElement; 9714 9715 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 9716 // whichever is greatest 9717 return Math.max( 9718 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 9719 elem.body[ "offset" + name ], doc[ "offset" + name ], 9720 doc[ "client" + name ] 9721 ); 9722 } 9723 9724 return value === undefined ? 9725 9726 // Get width or height on the element, requesting but not forcing parseFloat 9727 jQuery.css( elem, type, extra ) : 9728 9729 // Set width or height on the element 9730 jQuery.style( elem, type, value, extra ); 9731 }, type, chainable ? margin : undefined, chainable, null ); 9732 }; 9733 } ); 9734} ); 9735 9736 9737jQuery.fn.extend( { 9738 9739 bind: function( types, data, fn ) { 9740 return this.on( types, null, data, fn ); 9741 }, 9742 unbind: function( types, fn ) { 9743 return this.off( types, null, fn ); 9744 }, 9745 9746 delegate: function( selector, types, data, fn ) { 9747 return this.on( types, selector, data, fn ); 9748 }, 9749 undelegate: function( selector, types, fn ) { 9750 9751 // ( namespace ) or ( selector, types [, fn] ) 9752 return arguments.length === 1 ? 9753 this.off( selector, "**" ) : 9754 this.off( types, selector || "**", fn ); 9755 }, 9756 size: function() { 9757 return this.length; 9758 } 9759} ); 9760 9761jQuery.fn.andSelf = jQuery.fn.addBack; 9762 9763 9764 9765 9766// Register as a named AMD module, since jQuery can be concatenated with other 9767// files that may use define, but not via a proper concatenation script that 9768// understands anonymous AMD modules. A named AMD is safest and most robust 9769// way to register. Lowercase jquery is used because AMD module names are 9770// derived from file names, and jQuery is normally delivered in a lowercase 9771// file name. Do this after creating the global so that if an AMD module wants 9772// to call noConflict to hide this version of jQuery, it will work. 9773 9774// Note that for maximum portability, libraries that are not jQuery should 9775// declare themselves as anonymous modules, and avoid setting a global if an 9776// AMD loader is present. jQuery is a special case. For more information, see 9777// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 9778 9779if ( typeof define === "function" && define.amd ) { 9780 define( "jquery", [], function() { 9781 return jQuery; 9782 } ); 9783} 9784 9785 9786 9787var 9788 9789 // Map over jQuery in case of overwrite 9790 _jQuery = window.jQuery, 9791 9792 // Map over the $ in case of overwrite 9793 _$ = window.$; 9794 9795jQuery.noConflict = function( deep ) { 9796 if ( window.$ === jQuery ) { 9797 window.$ = _$; 9798 } 9799 9800 if ( deep && window.jQuery === jQuery ) { 9801 window.jQuery = _jQuery; 9802 } 9803 9804 return jQuery; 9805}; 9806 9807// Expose jQuery and $ identifiers, even in AMD 9808// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 9809// and CommonJS for browser emulators (#13566) 9810if ( !noGlobal ) { 9811 window.jQuery = window.$ = jQuery; 9812} 9813 9814return jQuery; 9815})); 9816
vendor: 26,490 bytes, lines 9817-10660
9817/*! 9818 * Bootstrap v4.6.2 (https://getbootstrap.com/) 9819 * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 9820 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 9821 */ 9822(function (global, factory) { 9823 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) : 9824 typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) : 9825 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bootstrap = {}, global.jQuery)); 9826})(this, (function (exports, $) { 'use strict'; 9827 9828 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 9829 9830 var $__default = /*#__PURE__*/_interopDefaultLegacy($); 9831 9832 function _defineProperties(target, props) { 9833 for (var i = 0; i < props.length; i++) { 9834 var descriptor = props[i]; 9835 descriptor.enumerable = descriptor.enumerable || false; 9836 descriptor.configurable = true; 9837 if ("value" in descriptor) descriptor.writable = true; 9838 Object.defineProperty(target, descriptor.key, descriptor); 9839 } 9840 } 9841 9842 function _createClass(Constructor, protoProps, staticProps) { 9843 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 9844 if (staticProps) _defineProperties(Constructor, staticProps); 9845 Object.defineProperty(Constructor, "prototype", { 9846 writable: false 9847 }); 9848 return Constructor; 9849 } 9850 9851 function _extends$1() { 9852 _extends$1 = Object.assign ? Object.assign.bind() : function (target) { 9853 for (var i = 1; i < arguments.length; i++) { 9854 var source = arguments[i]; 9855 9856 for (var key in source) { 9857 if (Object.prototype.hasOwnProperty.call(source, key)) { 9858 target[key] = source[key]; 9859 } 9860 } 9861 } 9862 9863 return target; 9864 }; 9865 return _extends$1.apply(this, arguments); 9866 } 9867 9868 function _inheritsLoose(subClass, superClass) { 9869 subClass.prototype = Object.create(superClass.prototype); 9870 subClass.prototype.constructor = subClass; 9871 9872 _setPrototypeOf(subClass, superClass); 9873 } 9874 9875 function _setPrototypeOf(o, p) { 9876 _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { 9877 o.__proto__ = p; 9878 return o; 9879 }; 9880 return _setPrototypeOf(o, p); 9881 } 9882 9883 /** 9884 * -------------------------------------------------------------------------- 9885 * Bootstrap (v4.6.2): util.js 9886 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 9887 * -------------------------------------------------------------------------- 9888 */ 9889 /** 9890 * Private TransitionEnd Helpers 9891 */ 9892 9893 var TRANSITION_END = 'transitionend'; 9894 var MAX_UID = 1000000; 9895 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 9896 9897 function toType(obj) { 9898 if (obj === null || typeof obj === 'undefined') { 9899 return "" + obj; 9900 } 9901 9902 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 9903 } 9904 9905 function getSpecialTransitionEndEvent() { 9906 return { 9907 bindType: TRANSITION_END, 9908 delegateType: TRANSITION_END, 9909 handle: function handle(event) { 9910 if ($__default["default"](event.target).is(this)) { 9911 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 9912 } 9913 9914 return undefined; 9915 } 9916 }; 9917 } 9918 9919 function transitionEndEmulator(duration) { 9920 var _this = this; 9921 9922 var called = false; 9923 $__default["default"](this).one(Util.TRANSITION_END, function () { 9924 called = true; 9925 }); 9926 setTimeout(function () { 9927 if (!called) { 9928 Util.triggerTransitionEnd(_this); 9929 } 9930 }, duration); 9931 return this; 9932 } 9933 9934 function setTransitionEndSupport() { 9935 $__default["default"].fn.emulateTransitionEnd = transitionEndEmulator; 9936 $__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 9937 } 9938 /** 9939 * Public Util API 9940 */ 9941 9942 9943 var Util = { 9944 TRANSITION_END: 'bsTransitionEnd', 9945 getUID: function getUID(prefix) { 9946 do { 9947 // eslint-disable-next-line no-bitwise 9948 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 9949 } while (document.getElementById(prefix)); 9950 9951 return prefix; 9952 }, 9953 getSelectorFromElement: function getSelectorFromElement(element) { 9954 var selector = element.getAttribute('data-target'); 9955 9956 if (!selector || selector === '#') { 9957 var hrefAttr = element.getAttribute('href'); 9958 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 9959 } 9960 9961 try { 9962 return document.querySelector(selector) ? selector : null; 9963 } catch (_) { 9964 return null; 9965 } 9966 }, 9967 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 9968 if (!element) { 9969 return 0; 9970 } // Get transition-duration of the element 9971 9972 9973 var transitionDuration = $__default["default"](element).css('transition-duration'); 9974 var transitionDelay = $__default["default"](element).css('transition-delay'); 9975 var floatTransitionDuration = parseFloat(transitionDuration); 9976 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 9977 9978 if (!floatTransitionDuration && !floatTransitionDelay) { 9979 return 0; 9980 } // If multiple durations are defined, take the first 9981 9982 9983 transitionDuration = transitionDuration.split(',')[0]; 9984 transitionDelay = transitionDelay.split(',')[0]; 9985 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 9986 }, 9987 reflow: function reflow(element) { 9988 return element.offsetHeight; 9989 }, 9990 triggerTransitionEnd: function triggerTransitionEnd(element) { 9991 $__default["default"](element).trigger(TRANSITION_END); 9992 }, 9993 supportsTransitionEnd: function supportsTransitionEnd() { 9994 return Boolean(TRANSITION_END); 9995 }, 9996 isElement: function isElement(obj) { 9997 return (obj[0] || obj).nodeType; 9998 }, 9999 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 10000 for (var property in configTypes) { 10001 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 10002 var expectedTypes = configTypes[property]; 10003 var value = config[property]; 10004 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 10005 10006 if (!new RegExp(expectedTypes).test(valueType)) { 10007 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 10008 } 10009 } 10010 } 10011 }, 10012 findShadowRoot: function findShadowRoot(element) { 10013 if (!document.documentElement.attachShadow) { 10014 return null; 10015 } // Can find the shadow root otherwise it'll return the document 10016 10017 10018 if (typeof element.getRootNode === 'function') { 10019 var root = element.getRootNode(); 10020 return root instanceof ShadowRoot ? root : null; 10021 } 10022 10023 if (element instanceof ShadowRoot) { 10024 return element; 10025 } // when we don't find a shadow root 10026 10027 10028 if (!element.parentNode) { 10029 return null; 10030 } 10031 10032 return Util.findShadowRoot(element.parentNode); 10033 }, 10034 jQueryDetection: function jQueryDetection() { 10035 if (typeof $__default["default"] === 'undefined') { 10036 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 10037 } 10038 10039 var version = $__default["default"].fn.jquery.split(' ')[0].split('.'); 10040 var minMajor = 1; 10041 var ltMajor = 2; 10042 var minMinor = 9; 10043 var minPatch = 1; 10044 var maxMajor = 4; 10045 10046 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 10047 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 10048 } 10049 } 10050 }; 10051 Util.jQueryDetection(); 10052 setTransitionEndSupport(); 10053 10054 /** 10055 * Constants 10056 */ 10057 10058 var NAME$a = 'alert'; 10059 var VERSION$a = '4.6.2'; 10060 var DATA_KEY$a = 'bs.alert'; 10061 var EVENT_KEY$a = "." + DATA_KEY$a; 10062 var DATA_API_KEY$7 = '.data-api'; 10063 var JQUERY_NO_CONFLICT$a = $__default["default"].fn[NAME$a]; 10064 var CLASS_NAME_ALERT = 'alert'; 10065 var CLASS_NAME_FADE$5 = 'fade'; 10066 var CLASS_NAME_SHOW$7 = 'show'; 10067 var EVENT_CLOSE = "close" + EVENT_KEY$a; 10068 var EVENT_CLOSED = "closed" + EVENT_KEY$a; 10069 var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$a + DATA_API_KEY$7; 10070 var SELECTOR_DISMISS = '[data-dismiss="alert"]'; 10071 /** 10072 * Class definition 10073 */ 10074 10075 var Alert = /*#__PURE__*/function () { 10076 function Alert(element) { 10077 this._element = element; 10078 } // Getters 10079 10080 10081 var _proto = Alert.prototype; 10082 10083 // Public 10084 _proto.close = function close(element) { 10085 var rootElement = this._element; 10086 10087 if (element) { 10088 rootElement = this._getRootElement(element); 10089 } 10090 10091 var customEvent = this._triggerCloseEvent(rootElement); 10092 10093 if (customEvent.isDefaultPrevented()) { 10094 return; 10095 } 10096 10097 this._removeElement(rootElement); 10098 }; 10099 10100 _proto.dispose = function dispose() { 10101 $__default["default"].removeData(this._element, DATA_KEY$a); 10102 this._element = null; 10103 } // Private 10104 ; 10105 10106 _proto._getRootElement = function _getRootElement(element) { 10107 var selector = Util.getSelectorFromElement(element); 10108 var parent = false; 10109 10110 if (selector) { 10111 parent = document.querySelector(selector); 10112 } 10113 10114 if (!parent) { 10115 parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0]; 10116 } 10117 10118 return parent; 10119 }; 10120 10121 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 10122 var closeEvent = $__default["default"].Event(EVENT_CLOSE); 10123 $__default["default"](element).trigger(closeEvent); 10124 return closeEvent; 10125 }; 10126 10127 _proto._removeElement = function _removeElement(element) { 10128 var _this = this; 10129 10130 $__default["default"](element).removeClass(CLASS_NAME_SHOW$7); 10131 10132 if (!$__default["default"](element).hasClass(CLASS_NAME_FADE$5)) { 10133 this._destroyElement(element); 10134 10135 return; 10136 } 10137 10138 var transitionDuration = Util.getTransitionDurationFromElement(element); 10139 $__default["default"](element).one(Util.TRANSITION_END, function (event) { 10140 return _this._destroyElement(element, event); 10141 }).emulateTransitionEnd(transitionDuration); 10142 }; 10143 10144 _proto._destroyElement = function _destroyElement(element) { 10145 $__default["default"](element).detach().trigger(EVENT_CLOSED).remove(); 10146 } // Static 10147 ; 10148 10149 Alert._jQueryInterface = function _jQueryInterface(config) { 10150 return this.each(function () { 10151 var $element = $__default["default"](this); 10152 var data = $element.data(DATA_KEY$a); 10153 10154 if (!data) { 10155 data = new Alert(this); 10156 $element.data(DATA_KEY$a, data); 10157 } 10158 10159 if (config === 'close') { 10160 data[config](this); 10161 } 10162 }); 10163 }; 10164 10165 Alert._handleDismiss = function _handleDismiss(alertInstance) { 10166 return function (event) { 10167 if (event) { 10168 event.preventDefault(); 10169 } 10170 10171 alertInstance.close(this); 10172 }; 10173 }; 10174 10175 _createClass(Alert, null, [{ 10176 key: "VERSION", 10177 get: function get() { 10178 return VERSION$a; 10179 } 10180 }]); 10181 10182 return Alert; 10183 }(); 10184 /** 10185 * Data API implementation 10186 */ 10187 10188 10189 $__default["default"](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); 10190 /** 10191 * jQuery 10192 */ 10193 10194 $__default["default"].fn[NAME$a] = Alert._jQueryInterface; 10195 $__default["default"].fn[NAME$a].Constructor = Alert; 10196 10197 $__default["default"].fn[NAME$a].noConflict = function () { 10198 $__default["default"].fn[NAME$a] = JQUERY_NO_CONFLICT$a; 10199 return Alert._jQueryInterface; 10200 }; 10201 10202 /** 10203 * Constants 10204 */ 10205 10206 var NAME$9 = 'button'; 10207 var VERSION$9 = '4.6.2'; 10208 var DATA_KEY$9 = 'bs.button'; 10209 var EVENT_KEY$9 = "." + DATA_KEY$9; 10210 var DATA_API_KEY$6 = '.data-api'; 10211 var JQUERY_NO_CONFLICT$9 = $__default["default"].fn[NAME$9]; 10212 var CLASS_NAME_ACTIVE$3 = 'active'; 10213 var CLASS_NAME_BUTTON = 'btn'; 10214 var CLASS_NAME_FOCUS = 'focus'; 10215 var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$9 + DATA_API_KEY$6; 10216 var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$9 + DATA_API_KEY$6 + " " + ("blur" + EVENT_KEY$9 + DATA_API_KEY$6); 10217 var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$9 + DATA_API_KEY$6; 10218 var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; 10219 var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; 10220 var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="button"]'; 10221 var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; 10222 var SELECTOR_INPUT = 'input:not([type="hidden"])'; 10223 var SELECTOR_ACTIVE$2 = '.active'; 10224 var SELECTOR_BUTTON = '.btn'; 10225 /** 10226 * Class definition 10227 */ 10228 10229 var Button = /*#__PURE__*/function () { 10230 function Button(element) { 10231 this._element = element; 10232 this.shouldAvoidTriggerChange = false; 10233 } // Getters 10234 10235 10236 var _proto = Button.prototype; 10237 10238 // Public 10239 _proto.toggle = function toggle() { 10240 var triggerChangeEvent = true; 10241 var addAriaPressed = true; 10242 var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0]; 10243 10244 if (rootElement) { 10245 var input = this._element.querySelector(SELECTOR_INPUT); 10246 10247 if (input) { 10248 if (input.type === 'radio') { 10249 if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE$3)) { 10250 triggerChangeEvent = false; 10251 } else { 10252 var activeElement = rootElement.querySelector(SELECTOR_ACTIVE$2); 10253 10254 if (activeElement) { 10255 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$3); 10256 } 10257 } 10258 } 10259 10260 if (triggerChangeEvent) { 10261 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 10262 if (input.type === 'checkbox' || input.type === 'radio') { 10263 input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE$3); 10264 } 10265 10266 if (!this.shouldAvoidTriggerChange) { 10267 $__default["default"](input).trigger('change'); 10268 } 10269 } 10270 10271 input.focus(); 10272 addAriaPressed = false; 10273 } 10274 } 10275 10276 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 10277 if (addAriaPressed) { 10278 this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE$3)); 10279 } 10280 10281 if (triggerChangeEvent) { 10282 $__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE$3); 10283 } 10284 } 10285 }; 10286 10287 _proto.dispose = function dispose() { 10288 $__default["default"].removeData(this._element, DATA_KEY$9); 10289 this._element = null; 10290 } // Static 10291 ; 10292 10293 Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) { 10294 return this.each(function () { 10295 var $element = $__default["default"](this); 10296 var data = $element.data(DATA_KEY$9); 10297 10298 if (!data) { 10299 data = new Button(this); 10300 $element.data(DATA_KEY$9, data); 10301 } 10302 10303 data.shouldAvoidTriggerChange = avoidTriggerChange; 10304 10305 if (config === 'toggle') { 10306 data[config](); 10307 } 10308 }); 10309 }; 10310 10311 _createClass(Button, null, [{ 10312 key: "VERSION", 10313 get: function get() { 10314 return VERSION$9; 10315 } 10316 }]); 10317 10318 return Button; 10319 }(); 10320 /** 10321 * Data API implementation 10322 */ 10323 10324 10325 $__default["default"](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 10326 var button = event.target; 10327 var initialButton = button; 10328 10329 if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) { 10330 button = $__default["default"](button).closest(SELECTOR_BUTTON)[0]; 10331 } 10332 10333 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 10334 event.preventDefault(); // work around Firefox bug #1540995 10335 } else { 10336 var inputBtn = button.querySelector(SELECTOR_INPUT); 10337 10338 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 10339 event.preventDefault(); // work around Firefox bug #1540995 10340 10341 return; 10342 } 10343 10344 if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') { 10345 Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT'); 10346 } 10347 } 10348 }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 10349 var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0]; 10350 $__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type)); 10351 }); 10352 $__default["default"](window).on(EVENT_LOAD_DATA_API$2, function () { 10353 // ensure correct active class is set to match the controls' actual values/states 10354 // find all checkboxes/readio buttons inside data-toggle groups 10355 var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); 10356 10357 for (var i = 0, len = buttons.length; i < len; i++) { 10358 var button = buttons[i]; 10359 var input = button.querySelector(SELECTOR_INPUT); 10360 10361 if (input.checked || input.hasAttribute('checked')) { 10362 button.classList.add(CLASS_NAME_ACTIVE$3); 10363 } else { 10364 button.classList.remove(CLASS_NAME_ACTIVE$3); 10365 } 10366 } // find all button toggles 10367 10368 10369 buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$4)); 10370 10371 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 10372 var _button = buttons[_i]; 10373 10374 if (_button.getAttribute('aria-pressed') === 'true') { 10375 _button.classList.add(CLASS_NAME_ACTIVE$3); 10376 } else { 10377 _button.classList.remove(CLASS_NAME_ACTIVE$3); 10378 } 10379 } 10380 }); 10381 /** 10382 * jQuery 10383 */ 10384 10385 $__default["default"].fn[NAME$9] = Button._jQueryInterface; 10386 $__default["default"].fn[NAME$9].Constructor = Button; 10387 10388 $__default["default"].fn[NAME$9].noConflict = function () { 10389 $__default["default"].fn[NAME$9] = JQUERY_NO_CONFLICT$9; 10390 return Button._jQueryInterface; 10391 }; 10392 10393 /** 10394 * Constants 10395 */ 10396 10397 var NAME$8 = 'carousel'; 10398 var VERSION$8 = '4.6.2'; 10399 var DATA_KEY$8 = 'bs.carousel'; 10400 var EVENT_KEY$8 = "." + DATA_KEY$8; 10401 var DATA_API_KEY$5 = '.data-api'; 10402 var JQUERY_NO_CONFLICT$8 = $__default["default"].fn[NAME$8]; 10403 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 10404 10405 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 10406 10407 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 10408 10409 var SWIPE_THRESHOLD = 40; 10410 var CLASS_NAME_CAROUSEL = 'carousel'; 10411 var CLASS_NAME_ACTIVE$2 = 'active'; 10412 var CLASS_NAME_SLIDE = 'slide'; 10413 var CLASS_NAME_RIGHT = 'carousel-item-right'; 10414 var CLASS_NAME_LEFT = 'carousel-item-left'; 10415 var CLASS_NAME_NEXT = 'carousel-item-next'; 10416 var CLASS_NAME_PREV = 'carousel-item-prev'; 10417 var CLASS_NAME_POINTER_EVENT = 'pointer-event'; 10418 var DIRECTION_NEXT = 'next'; 10419 var DIRECTION_PREV = 'prev'; 10420 var DIRECTION_LEFT = 'left'; 10421 var DIRECTION_RIGHT = 'right'; 10422 var EVENT_SLIDE = "slide" + EVENT_KEY$8; 10423 var EVENT_SLID = "slid" + EVENT_KEY$8; 10424 var EVENT_KEYDOWN = "keydown" + EVENT_KEY$8; 10425 var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$8; 10426 var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$8; 10427 var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$8; 10428 var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$8; 10429 var EVENT_TOUCHEND = "touchend" + EVENT_KEY$8; 10430 var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$8; 10431 var EVENT_POINTERUP = "pointerup" + EVENT_KEY$8; 10432 var EVENT_DRAG_START = "dragstart" + EVENT_KEY$8; 10433 var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$5; 10434 var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$8 + DATA_API_KEY$5; 10435 var SELECTOR_ACTIVE$1 = '.active'; 10436 var SELECTOR_ACTIVE_ITEM = '.active.carousel-item'; 10437 var SELECTOR_ITEM = '.carousel-item'; 10438 var SELECTOR_ITEM_IMG = '.carousel-item img'; 10439 var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 10440 var SELECTOR_INDICATORS = '.carousel-indicators'; 10441 var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; 10442 var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; 10443 var Default$7 = { 10444 interval: 5000, 10445 keyboard: true, 10446 slide: false, 10447 pause: 'hover', 10448 wrap: true, 10449 touch: true 10450 }; 10451 var DefaultType$7 = { 10452 interval: '(number|boolean)', 10453 keyboard: 'boolean', 10454 slide: '(boolean|string)', 10455 pause: '(string|boolean)', 10456 wrap: 'boolean', 10457 touch: 'boolean' 10458 }; 10459 var PointerType = { 10460 TOUCH: 'touch', 10461 PEN: 'pen' 10462 }; 10463 /** 10464 * Class definition 10465 */ 10466 10467 var Carousel = /*#__PURE__*/function () { 10468 function Carousel(element, config) { 10469 this._items = null; 10470 this._interval = null; 10471 this._activeElement = null; 10472 this._isPaused = false; 10473 this._isSliding = false; 10474 this.touchTimeout = null; 10475 this.touchStartX = 0; 10476 this.touchDeltaX = 0; 10477 this._config = this._getConfig(config); 10478 this._element = element; 10479 this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); 10480 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 10481 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 10482 10483 this._addEventListeners(); 10484 } // Getters 10485 10486 10487 var _proto = Carousel.prototype; 10488 10489 // Public 10490 _proto.next = function next() { 10491 if (!this._isSliding) { 10492 this._slide(DIRECTION_NEXT); 10493 } 10494 }; 10495 10496 _proto.nextWhenVisible = function nextWhenVisible() { 10497 var $element = $__default["default"](this._element); // Don't call next when the page isn't visible 10498 // or the carousel or its parent isn't visible 10499 10500 if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { 10501 this.next(); 10502 } 10503 }; 10504 10505 _proto.prev = function prev() { 10506 if (!this._isSliding) { 10507 this._slide(DIRECTION_PREV); 10508 } 10509 }; 10510 10511 _proto.pause = function pause(event) { 10512 if (!event) { 10513 this._isPaused = true; 10514 } 10515 10516 if (this._element.querySelector(SELECTOR_NEXT_PREV)) { 10517 Util.triggerTransitionEnd(this._element); 10518 this.cycle(true); 10519 } 10520 10521 clearInterval(this._interval); 10522 this._interval = null; 10523 }; 10524 10525 _proto.cycle = function cycle(event) { 10526 if (!event) { 10527 this._isPaused = false; 10528 } 10529 10530 if (this._interval) { 10531 clearInterval(this._interval); 10532 this._interval = null; 10533 } 10534 10535 if (this._config.interval && !this._isPaused) { 10536 this._updateInterval(); 10537 10538 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 10539 } 10540 }; 10541 10542 _proto.to = function to(index) { 10543 var _this = this; 10544 10545 this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 10546 10547 var activeIndex = this._getItemIndex(this._activeElement); 10548 10549 if (index > this._items.length - 1 || index < 0) { 10550 return; 10551 } 10552 10553 if (this._isSliding) { 10554 $__default["default"](this._element).one(EVENT_SLID, function () { 10555 return _this.to(index); 10556 }); 10557 return; 10558 } 10559 10560 if (activeIndex === index) { 10561 this.pause(); 10562 this.cycle(); 10563 return; 10564 } 10565 10566 var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; 10567 10568 this._slide(direction, this._items[index]); 10569 }; 10570 10571 _proto.dispose = function dispose() { 10572 $__default["default"](this._element).off(EVENT_KEY$8); 10573 $__default["default"].removeData(this._element, DATA_KEY$8); 10574 this._items = null; 10575 this._config = null; 10576 this._element = null; 10577 this._interval = null; 10578 this._isPaused = null; 10579 this._isSliding = null; 10580 this._activeElement = null; 10581 this._indicatorsElement = null; 10582 } // Private 10583 ; 10584 10585 _proto._getConfig = function _getConfig(config) { 10586 config = _extends$1({}, Default$7, config); 10587 Util.typeCheckConfig(NAME$8, config, DefaultType$7); 10588 return config; 10589 }; 10590 10591 _proto._handleSwipe = function _handleSwipe() { 10592 var absDeltax = Math.abs(this.touchDeltaX); 10593 10594 if (absDeltax <= SWIPE_THRESHOLD) { 10595 return; 10596 } 10597 10598 var direction = absDeltax / this.touchDeltaX; 10599 this.touchDeltaX = 0; // swipe left 10600 10601 if (direction > 0) { 10602 this.prev(); 10603 } // swipe right 10604 10605 10606 if (direction < 0) { 10607 this.next(); 10608 } 10609 }; 10610 10611 _proto._addEventListeners = function _addEventListeners() { 10612 var _this2 = this; 10613 10614 if (this._config.keyboard) { 10615 $__default["default"](this._element).on(EVENT_KEYDOWN, function (event) { 10616 return _this2._keydown(event); 10617 }); 10618 } 10619 10620 if (this._config.pause === 'hover') { 10621 $__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) { 10622 return _this2.pause(event); 10623 }).on(EVENT_MOUSELEAVE, function (event) { 10624 return _this2.cycle(event); 10625 }); 10626 } 10627 10628 if (this._config.touch) { 10629 this._addTouchEventListeners(); 10630 } 10631 }; 10632 10633 _proto._addTouchEventListeners = function _addTouchEventListeners() { 10634 var _this3 = this; 10635 10636 if (!this._touchSupported) { 10637 return; 10638 } 10639 10640 var start = function start(event) { 10641 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 10642 _this3.touchStartX = event.originalEvent.clientX; 10643 } else if (!_this3._pointerEvent) { 10644 _this3.touchStartX = event.originalEvent.touches[0].clientX; 10645 } 10646 }; 10647 10648 var move = function move(event) { 10649 // ensure swiping with one touch and not pinching 10650 _this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX; 10651 }; 10652 10653 var end = function end(event) { 10654 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 10655 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 10656 } 10657 10658 _this3._handleSwipe(); 10659 10660 if (_this3._config.pause === 'hover') {
vendor: 5,760 bytes, lines 10661-10819
10661 // If it's a touch-enabled device, mouseenter/leave are fired as 10662 // part of the mouse compatibility events on first tap - the carousel 10663 // would stop cycling until user tapped out of it; 10664 // here, we listen for touchend, explicitly pause the carousel 10665 // (as if it's the second time we tap on it, mouseenter compat event 10666 // is NOT fired) and after a timeout (to allow for mouse compatibility 10667 // events to fire) we explicitly restart cycling 10668 _this3.pause(); 10669 10670 if (_this3.touchTimeout) { 10671 clearTimeout(_this3.touchTimeout); 10672 } 10673 10674 _this3.touchTimeout = setTimeout(function (event) { 10675 return _this3.cycle(event); 10676 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 10677 } 10678 }; 10679 10680 $__default["default"](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { 10681 return e.preventDefault(); 10682 }); 10683 10684 if (this._pointerEvent) { 10685 $__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) { 10686 return start(event); 10687 }); 10688 $__default["default"](this._element).on(EVENT_POINTERUP, function (event) { 10689 return end(event); 10690 }); 10691 10692 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 10693 } else { 10694 $__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) { 10695 return start(event); 10696 }); 10697 $__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) { 10698 return move(event); 10699 }); 10700 $__default["default"](this._element).on(EVENT_TOUCHEND, function (event) { 10701 return end(event); 10702 }); 10703 } 10704 }; 10705 10706 _proto._keydown = function _keydown(event) { 10707 if (/input|textarea/i.test(event.target.tagName)) { 10708 return; 10709 } 10710 10711 switch (event.which) { 10712 case ARROW_LEFT_KEYCODE: 10713 event.preventDefault(); 10714 this.prev(); 10715 break; 10716 10717 case ARROW_RIGHT_KEYCODE: 10718 event.preventDefault(); 10719 this.next(); 10720 break; 10721 } 10722 }; 10723 10724 _proto._getItemIndex = function _getItemIndex(element) { 10725 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; 10726 return this._items.indexOf(element); 10727 }; 10728 10729 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 10730 var isNextDirection = direction === DIRECTION_NEXT; 10731 var isPrevDirection = direction === DIRECTION_PREV; 10732 10733 var activeIndex = this._getItemIndex(activeElement); 10734 10735 var lastItemIndex = this._items.length - 1; 10736 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 10737 10738 if (isGoingToWrap && !this._config.wrap) { 10739 return activeElement; 10740 } 10741 10742 var delta = direction === DIRECTION_PREV ? -1 : 1; 10743 var itemIndex = (activeIndex + delta) % this._items.length; 10744 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 10745 }; 10746 10747 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 10748 var targetIndex = this._getItemIndex(relatedTarget); 10749 10750 var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); 10751 10752 var slideEvent = $__default["default"].Event(EVENT_SLIDE, { 10753 relatedTarget: relatedTarget, 10754 direction: eventDirectionName, 10755 from: fromIndex, 10756 to: targetIndex 10757 }); 10758 $__default["default"](this._element).trigger(slideEvent); 10759 return slideEvent; 10760 }; 10761 10762 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 10763 if (this._indicatorsElement) { 10764 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); 10765 $__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE$2); 10766 10767 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 10768 10769 if (nextIndicator) { 10770 $__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE$2); 10771 } 10772 } 10773 }; 10774 10775 _proto._updateInterval = function _updateInterval() { 10776 var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM); 10777 10778 if (!element) { 10779 return; 10780 } 10781 10782 var elementInterval = parseInt(element.getAttribute('data-interval'), 10); 10783 10784 if (elementInterval) { 10785 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 10786 this._config.interval = elementInterval; 10787 } else { 10788 this._config.interval = this._config.defaultInterval || this._config.interval; 10789 } 10790 }; 10791 10792 _proto._slide = function _slide(direction, element) { 10793 var _this4 = this; 10794 10795 var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 10796 10797 var activeElementIndex = this._getItemIndex(activeElement); 10798 10799 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 10800 10801 var nextElementIndex = this._getItemIndex(nextElement); 10802 10803 var isCycling = Boolean(this._interval); 10804 var directionalClassName; 10805 var orderClassName; 10806 var eventDirectionName; 10807 10808 if (direction === DIRECTION_NEXT) { 10809 directionalClassName = CLASS_NAME_LEFT; 10810 orderClassName = CLASS_NAME_NEXT; 10811 eventDirectionName = DIRECTION_LEFT; 10812 } else { 10813 directionalClassName = CLASS_NAME_RIGHT; 10814 orderClassName = CLASS_NAME_PREV; 10815 eventDirectionName = DIRECTION_RIGHT; 10816 } 10817 10818 if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE$2)) { 10819 this._isSliding = false;
vendor: 122,548 bytes, lines 10820-14340
10820 return; 10821 } 10822 10823 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 10824 10825 if (slideEvent.isDefaultPrevented()) { 10826 return; 10827 } 10828 10829 if (!activeElement || !nextElement) { 10830 // Some weirdness is happening, so we bail 10831 return; 10832 } 10833 10834 this._isSliding = true; 10835 10836 if (isCycling) { 10837 this.pause(); 10838 } 10839 10840 this._setActiveIndicatorElement(nextElement); 10841 10842 this._activeElement = nextElement; 10843 var slidEvent = $__default["default"].Event(EVENT_SLID, { 10844 relatedTarget: nextElement, 10845 direction: eventDirectionName, 10846 from: activeElementIndex, 10847 to: nextElementIndex 10848 }); 10849 10850 if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) { 10851 $__default["default"](nextElement).addClass(orderClassName); 10852 Util.reflow(nextElement); 10853 $__default["default"](activeElement).addClass(directionalClassName); 10854 $__default["default"](nextElement).addClass(directionalClassName); 10855 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 10856 $__default["default"](activeElement).one(Util.TRANSITION_END, function () { 10857 $__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$2); 10858 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2 + " " + orderClassName + " " + directionalClassName); 10859 _this4._isSliding = false; 10860 setTimeout(function () { 10861 return $__default["default"](_this4._element).trigger(slidEvent); 10862 }, 0); 10863 }).emulateTransitionEnd(transitionDuration); 10864 } else { 10865 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2); 10866 $__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE$2); 10867 this._isSliding = false; 10868 $__default["default"](this._element).trigger(slidEvent); 10869 } 10870 10871 if (isCycling) { 10872 this.cycle(); 10873 } 10874 } // Static 10875 ; 10876 10877 Carousel._jQueryInterface = function _jQueryInterface(config) { 10878 return this.each(function () { 10879 var data = $__default["default"](this).data(DATA_KEY$8); 10880 10881 var _config = _extends$1({}, Default$7, $__default["default"](this).data()); 10882 10883 if (typeof config === 'object') { 10884 _config = _extends$1({}, _config, config); 10885 } 10886 10887 var action = typeof config === 'string' ? config : _config.slide; 10888 10889 if (!data) { 10890 data = new Carousel(this, _config); 10891 $__default["default"](this).data(DATA_KEY$8, data); 10892 } 10893 10894 if (typeof config === 'number') { 10895 data.to(config); 10896 } else if (typeof action === 'string') { 10897 if (typeof data[action] === 'undefined') { 10898 throw new TypeError("No method named \"" + action + "\""); 10899 } 10900 10901 data[action](); 10902 } else if (_config.interval && _config.ride) { 10903 data.pause(); 10904 data.cycle(); 10905 } 10906 }); 10907 }; 10908 10909 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 10910 var selector = Util.getSelectorFromElement(this); 10911 10912 if (!selector) { 10913 return; 10914 } 10915 10916 var target = $__default["default"](selector)[0]; 10917 10918 if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) { 10919 return; 10920 } 10921 10922 var config = _extends$1({}, $__default["default"](target).data(), $__default["default"](this).data()); 10923 10924 var slideIndex = this.getAttribute('data-slide-to'); 10925 10926 if (slideIndex) { 10927 config.interval = false; 10928 } 10929 10930 Carousel._jQueryInterface.call($__default["default"](target), config); 10931 10932 if (slideIndex) { 10933 $__default["default"](target).data(DATA_KEY$8).to(slideIndex); 10934 } 10935 10936 event.preventDefault(); 10937 }; 10938 10939 _createClass(Carousel, null, [{ 10940 key: "VERSION", 10941 get: function get() { 10942 return VERSION$8; 10943 } 10944 }, { 10945 key: "Default", 10946 get: function get() { 10947 return Default$7; 10948 } 10949 }]); 10950 10951 return Carousel; 10952 }(); 10953 /** 10954 * Data API implementation 10955 */ 10956 10957 10958 $__default["default"](document).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); 10959 $__default["default"](window).on(EVENT_LOAD_DATA_API$1, function () { 10960 var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); 10961 10962 for (var i = 0, len = carousels.length; i < len; i++) { 10963 var $carousel = $__default["default"](carousels[i]); 10964 10965 Carousel._jQueryInterface.call($carousel, $carousel.data()); 10966 } 10967 }); 10968 /** 10969 * jQuery 10970 */ 10971 10972 $__default["default"].fn[NAME$8] = Carousel._jQueryInterface; 10973 $__default["default"].fn[NAME$8].Constructor = Carousel; 10974 10975 $__default["default"].fn[NAME$8].noConflict = function () { 10976 $__default["default"].fn[NAME$8] = JQUERY_NO_CONFLICT$8; 10977 return Carousel._jQueryInterface; 10978 }; 10979 10980 /** 10981 * Constants 10982 */ 10983 10984 var NAME$7 = 'collapse'; 10985 var VERSION$7 = '4.6.2'; 10986 var DATA_KEY$7 = 'bs.collapse'; 10987 var EVENT_KEY$7 = "." + DATA_KEY$7; 10988 var DATA_API_KEY$4 = '.data-api'; 10989 var JQUERY_NO_CONFLICT$7 = $__default["default"].fn[NAME$7]; 10990 var CLASS_NAME_SHOW$6 = 'show'; 10991 var CLASS_NAME_COLLAPSE = 'collapse'; 10992 var CLASS_NAME_COLLAPSING = 'collapsing'; 10993 var CLASS_NAME_COLLAPSED = 'collapsed'; 10994 var DIMENSION_WIDTH = 'width'; 10995 var DIMENSION_HEIGHT = 'height'; 10996 var EVENT_SHOW$4 = "show" + EVENT_KEY$7; 10997 var EVENT_SHOWN$4 = "shown" + EVENT_KEY$7; 10998 var EVENT_HIDE$4 = "hide" + EVENT_KEY$7; 10999 var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$7; 11000 var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$7 + DATA_API_KEY$4; 11001 var SELECTOR_ACTIVES = '.show, .collapsing'; 11002 var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="collapse"]'; 11003 var Default$6 = { 11004 toggle: true, 11005 parent: '' 11006 }; 11007 var DefaultType$6 = { 11008 toggle: 'boolean', 11009 parent: '(string|element)' 11010 }; 11011 /** 11012 * Class definition 11013 */ 11014 11015 var Collapse = /*#__PURE__*/function () { 11016 function Collapse(element, config) { 11017 this._isTransitioning = false; 11018 this._element = element; 11019 this._config = this._getConfig(config); 11020 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 11021 var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$3)); 11022 11023 for (var i = 0, len = toggleList.length; i < len; i++) { 11024 var elem = toggleList[i]; 11025 var selector = Util.getSelectorFromElement(elem); 11026 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 11027 return foundElem === element; 11028 }); 11029 11030 if (selector !== null && filterElement.length > 0) { 11031 this._selector = selector; 11032 11033 this._triggerArray.push(elem); 11034 } 11035 } 11036 11037 this._parent = this._config.parent ? this._getParent() : null; 11038 11039 if (!this._config.parent) { 11040 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 11041 } 11042 11043 if (this._config.toggle) { 11044 this.toggle(); 11045 } 11046 } // Getters 11047 11048 11049 var _proto = Collapse.prototype; 11050 11051 // Public 11052 _proto.toggle = function toggle() { 11053 if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 11054 this.hide(); 11055 } else { 11056 this.show(); 11057 } 11058 }; 11059 11060 _proto.show = function show() { 11061 var _this = this; 11062 11063 if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 11064 return; 11065 } 11066 11067 var actives; 11068 var activesData; 11069 11070 if (this._parent) { 11071 actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { 11072 if (typeof _this._config.parent === 'string') { 11073 return elem.getAttribute('data-parent') === _this._config.parent; 11074 } 11075 11076 return elem.classList.contains(CLASS_NAME_COLLAPSE); 11077 }); 11078 11079 if (actives.length === 0) { 11080 actives = null; 11081 } 11082 } 11083 11084 if (actives) { 11085 activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY$7); 11086 11087 if (activesData && activesData._isTransitioning) { 11088 return; 11089 } 11090 } 11091 11092 var startEvent = $__default["default"].Event(EVENT_SHOW$4); 11093 $__default["default"](this._element).trigger(startEvent); 11094 11095 if (startEvent.isDefaultPrevented()) { 11096 return; 11097 } 11098 11099 if (actives) { 11100 Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), 'hide'); 11101 11102 if (!activesData) { 11103 $__default["default"](actives).data(DATA_KEY$7, null); 11104 } 11105 } 11106 11107 var dimension = this._getDimension(); 11108 11109 $__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); 11110 this._element.style[dimension] = 0; 11111 11112 if (this._triggerArray.length) { 11113 $__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); 11114 } 11115 11116 this.setTransitioning(true); 11117 11118 var complete = function complete() { 11119 $__default["default"](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 11120 _this._element.style[dimension] = ''; 11121 11122 _this.setTransitioning(false); 11123 11124 $__default["default"](_this._element).trigger(EVENT_SHOWN$4); 11125 }; 11126 11127 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 11128 var scrollSize = "scroll" + capitalizedDimension; 11129 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 11130 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 11131 this._element.style[dimension] = this._element[scrollSize] + "px"; 11132 }; 11133 11134 _proto.hide = function hide() { 11135 var _this2 = this; 11136 11137 if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 11138 return; 11139 } 11140 11141 var startEvent = $__default["default"].Event(EVENT_HIDE$4); 11142 $__default["default"](this._element).trigger(startEvent); 11143 11144 if (startEvent.isDefaultPrevented()) { 11145 return; 11146 } 11147 11148 var dimension = this._getDimension(); 11149 11150 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 11151 Util.reflow(this._element); 11152 $__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 11153 var triggerArrayLength = this._triggerArray.length; 11154 11155 if (triggerArrayLength > 0) { 11156 for (var i = 0; i < triggerArrayLength; i++) { 11157 var trigger = this._triggerArray[i]; 11158 var selector = Util.getSelectorFromElement(trigger); 11159 11160 if (selector !== null) { 11161 var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector))); 11162 11163 if (!$elem.hasClass(CLASS_NAME_SHOW$6)) { 11164 $__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); 11165 } 11166 } 11167 } 11168 } 11169 11170 this.setTransitioning(true); 11171 11172 var complete = function complete() { 11173 _this2.setTransitioning(false); 11174 11175 $__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN$4); 11176 }; 11177 11178 this._element.style[dimension] = ''; 11179 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 11180 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 11181 }; 11182 11183 _proto.setTransitioning = function setTransitioning(isTransitioning) { 11184 this._isTransitioning = isTransitioning; 11185 }; 11186 11187 _proto.dispose = function dispose() { 11188 $__default["default"].removeData(this._element, DATA_KEY$7); 11189 this._config = null; 11190 this._parent = null; 11191 this._element = null; 11192 this._triggerArray = null; 11193 this._isTransitioning = null; 11194 } // Private 11195 ; 11196 11197 _proto._getConfig = function _getConfig(config) { 11198 config = _extends$1({}, Default$6, config); 11199 config.toggle = Boolean(config.toggle); // Coerce string values 11200 11201 Util.typeCheckConfig(NAME$7, config, DefaultType$6); 11202 return config; 11203 }; 11204 11205 _proto._getDimension = function _getDimension() { 11206 var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH); 11207 return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; 11208 }; 11209 11210 _proto._getParent = function _getParent() { 11211 var _this3 = this; 11212 11213 var parent; 11214 11215 if (Util.isElement(this._config.parent)) { 11216 parent = this._config.parent; // It's a jQuery object 11217 11218 if (typeof this._config.parent.jquery !== 'undefined') { 11219 parent = this._config.parent[0]; 11220 } 11221 } else { 11222 parent = document.querySelector(this._config.parent); 11223 } 11224 11225 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 11226 var children = [].slice.call(parent.querySelectorAll(selector)); 11227 $__default["default"](children).each(function (i, element) { 11228 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 11229 }); 11230 return parent; 11231 }; 11232 11233 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 11234 var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW$6); 11235 11236 if (triggerArray.length) { 11237 $__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 11238 } 11239 } // Static 11240 ; 11241 11242 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 11243 var selector = Util.getSelectorFromElement(element); 11244 return selector ? document.querySelector(selector) : null; 11245 }; 11246 11247 Collapse._jQueryInterface = function _jQueryInterface(config) { 11248 return this.each(function () { 11249 var $element = $__default["default"](this); 11250 var data = $element.data(DATA_KEY$7); 11251 11252 var _config = _extends$1({}, Default$6, $element.data(), typeof config === 'object' && config ? config : {}); 11253 11254 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 11255 _config.toggle = false; 11256 } 11257 11258 if (!data) { 11259 data = new Collapse(this, _config); 11260 $element.data(DATA_KEY$7, data); 11261 } 11262 11263 if (typeof config === 'string') { 11264 if (typeof data[config] === 'undefined') { 11265 throw new TypeError("No method named \"" + config + "\""); 11266 } 11267 11268 data[config](); 11269 } 11270 }); 11271 }; 11272 11273 _createClass(Collapse, null, [{ 11274 key: "VERSION", 11275 get: function get() { 11276 return VERSION$7; 11277 } 11278 }, { 11279 key: "Default", 11280 get: function get() { 11281 return Default$6; 11282 } 11283 }]); 11284 11285 return Collapse; 11286 }(); 11287 /** 11288 * Data API implementation 11289 */ 11290 11291 11292 $__default["default"](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { 11293 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 11294 if (event.currentTarget.tagName === 'A') { 11295 event.preventDefault(); 11296 } 11297 11298 var $trigger = $__default["default"](this); 11299 var selector = Util.getSelectorFromElement(this); 11300 var selectors = [].slice.call(document.querySelectorAll(selector)); 11301 $__default["default"](selectors).each(function () { 11302 var $target = $__default["default"](this); 11303 var data = $target.data(DATA_KEY$7); 11304 var config = data ? 'toggle' : $trigger.data(); 11305 11306 Collapse._jQueryInterface.call($target, config); 11307 }); 11308 }); 11309 /** 11310 * jQuery 11311 */ 11312 11313 $__default["default"].fn[NAME$7] = Collapse._jQueryInterface; 11314 $__default["default"].fn[NAME$7].Constructor = Collapse; 11315 11316 $__default["default"].fn[NAME$7].noConflict = function () { 11317 $__default["default"].fn[NAME$7] = JQUERY_NO_CONFLICT$7; 11318 return Collapse._jQueryInterface; 11319 }; 11320 11321 /**! 11322 * @fileOverview Kickass library to create and place poppers near their reference elements. 11323 * @version 1.16.1 11324 * @license 11325 * Copyright (c) 2016 Federico Zivolo and contributors 11326 * 11327 * Permission is hereby granted, free of charge, to any person obtaining a copy 11328 * of this software and associated documentation files (the "Software"), to deal 11329 * in the Software without restriction, including without limitation the rights 11330 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11331 * copies of the Software, and to permit persons to whom the Software is 11332 * furnished to do so, subject to the following conditions: 11333 * 11334 * The above copyright notice and this permission notice shall be included in all 11335 * copies or substantial portions of the Software. 11336 * 11337 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11338 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11339 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 11340 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 11341 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 11342 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 11343 * SOFTWARE. 11344 */ 11345 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 11346 11347 var timeoutDuration = function () { 11348 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 11349 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 11350 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 11351 return 1; 11352 } 11353 } 11354 return 0; 11355 }(); 11356 11357 function microtaskDebounce(fn) { 11358 var called = false; 11359 return function () { 11360 if (called) { 11361 return; 11362 } 11363 called = true; 11364 window.Promise.resolve().then(function () { 11365 called = false; 11366 fn(); 11367 }); 11368 }; 11369 } 11370 11371 function taskDebounce(fn) { 11372 var scheduled = false; 11373 return function () { 11374 if (!scheduled) { 11375 scheduled = true; 11376 setTimeout(function () { 11377 scheduled = false; 11378 fn(); 11379 }, timeoutDuration); 11380 } 11381 }; 11382 } 11383 11384 var supportsMicroTasks = isBrowser && window.Promise; 11385 11386 /** 11387 * Create a debounced version of a method, that's asynchronously deferred 11388 * but called in the minimum time possible. 11389 * 11390 * @method 11391 * @memberof Popper.Utils 11392 * @argument {Function} fn 11393 * @returns {Function} 11394 */ 11395 var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 11396 11397 /** 11398 * Check if the given variable is a function 11399 * @method 11400 * @memberof Popper.Utils 11401 * @argument {Any} functionToCheck - variable to check 11402 * @returns {Boolean} answer to: is a function? 11403 */ 11404 function isFunction(functionToCheck) { 11405 var getType = {}; 11406 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 11407 } 11408 11409 /** 11410 * Get CSS computed property of the given element 11411 * @method 11412 * @memberof Popper.Utils 11413 * @argument {Eement} element 11414 * @argument {String} property 11415 */ 11416 function getStyleComputedProperty(element, property) { 11417 if (element.nodeType !== 1) { 11418 return []; 11419 } 11420 // NOTE: 1 DOM access here 11421 var window = element.ownerDocument.defaultView; 11422 var css = window.getComputedStyle(element, null); 11423 return property ? css[property] : css; 11424 } 11425 11426 /** 11427 * Returns the parentNode or the host of the element 11428 * @method 11429 * @memberof Popper.Utils 11430 * @argument {Element} element 11431 * @returns {Element} parent 11432 */ 11433 function getParentNode(element) { 11434 if (element.nodeName === 'HTML') { 11435 return element; 11436 } 11437 return element.parentNode || element.host; 11438 } 11439 11440 /** 11441 * Returns the scrolling parent of the given element 11442 * @method 11443 * @memberof Popper.Utils 11444 * @argument {Element} element 11445 * @returns {Element} scroll parent 11446 */ 11447 function getScrollParent(element) { 11448 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 11449 if (!element) { 11450 return document.body; 11451 } 11452 11453 switch (element.nodeName) { 11454 case 'HTML': 11455 case 'BODY': 11456 return element.ownerDocument.body; 11457 case '#document': 11458 return element.body; 11459 } 11460 11461 // Firefox want us to check `-x` and `-y` variations as well 11462 11463 var _getStyleComputedProp = getStyleComputedProperty(element), 11464 overflow = _getStyleComputedProp.overflow, 11465 overflowX = _getStyleComputedProp.overflowX, 11466 overflowY = _getStyleComputedProp.overflowY; 11467 11468 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 11469 return element; 11470 } 11471 11472 return getScrollParent(getParentNode(element)); 11473 } 11474 11475 /** 11476 * Returns the reference node of the reference object, or the reference object itself. 11477 * @method 11478 * @memberof Popper.Utils 11479 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 11480 * @returns {Element} parent 11481 */ 11482 function getReferenceNode(reference) { 11483 return reference && reference.referenceNode ? reference.referenceNode : reference; 11484 } 11485 11486 var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 11487 var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 11488 11489 /** 11490 * Determines if the browser is Internet Explorer 11491 * @method 11492 * @memberof Popper.Utils 11493 * @param {Number} version to check 11494 * @returns {Boolean} isIE 11495 */ 11496 function isIE(version) { 11497 if (version === 11) { 11498 return isIE11; 11499 } 11500 if (version === 10) { 11501 return isIE10; 11502 } 11503 return isIE11 || isIE10; 11504 } 11505 11506 /** 11507 * Returns the offset parent of the given element 11508 * @method 11509 * @memberof Popper.Utils 11510 * @argument {Element} element 11511 * @returns {Element} offset parent 11512 */ 11513 function getOffsetParent(element) { 11514 if (!element) { 11515 return document.documentElement; 11516 } 11517 11518 var noOffsetParent = isIE(10) ? document.body : null; 11519 11520 // NOTE: 1 DOM access here 11521 var offsetParent = element.offsetParent || null; 11522 // Skip hidden elements which don't have an offsetParent 11523 while (offsetParent === noOffsetParent && element.nextElementSibling) { 11524 offsetParent = (element = element.nextElementSibling).offsetParent; 11525 } 11526 11527 var nodeName = offsetParent && offsetParent.nodeName; 11528 11529 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 11530 return element ? element.ownerDocument.documentElement : document.documentElement; 11531 } 11532 11533 // .offsetParent will return the closest TH, TD or TABLE in case 11534 // no offsetParent is present, I hate this job... 11535 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 11536 return getOffsetParent(offsetParent); 11537 } 11538 11539 return offsetParent; 11540 } 11541 11542 function isOffsetContainer(element) { 11543 var nodeName = element.nodeName; 11544 11545 if (nodeName === 'BODY') { 11546 return false; 11547 } 11548 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 11549 } 11550 11551 /** 11552 * Finds the root node (document, shadowDOM root) of the given element 11553 * @method 11554 * @memberof Popper.Utils 11555 * @argument {Element} node 11556 * @returns {Element} root node 11557 */ 11558 function getRoot(node) { 11559 if (node.parentNode !== null) { 11560 return getRoot(node.parentNode); 11561 } 11562 11563 return node; 11564 } 11565 11566 /** 11567 * Finds the offset parent common to the two provided nodes 11568 * @method 11569 * @memberof Popper.Utils 11570 * @argument {Element} element1 11571 * @argument {Element} element2 11572 * @returns {Element} common offset parent 11573 */ 11574 function findCommonOffsetParent(element1, element2) { 11575 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 11576 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 11577 return document.documentElement; 11578 } 11579 11580 // Here we make sure to give as "start" the element that comes first in the DOM 11581 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 11582 var start = order ? element1 : element2; 11583 var end = order ? element2 : element1; 11584 11585 // Get common ancestor container 11586 var range = document.createRange(); 11587 range.setStart(start, 0); 11588 range.setEnd(end, 0); 11589 var commonAncestorContainer = range.commonAncestorContainer; 11590 11591 // Both nodes are inside #document 11592 11593 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 11594 if (isOffsetContainer(commonAncestorContainer)) { 11595 return commonAncestorContainer; 11596 } 11597 11598 return getOffsetParent(commonAncestorContainer); 11599 } 11600 11601 // one of the nodes is inside shadowDOM, find which one 11602 var element1root = getRoot(element1); 11603 if (element1root.host) { 11604 return findCommonOffsetParent(element1root.host, element2); 11605 } else { 11606 return findCommonOffsetParent(element1, getRoot(element2).host); 11607 } 11608 } 11609 11610 /** 11611 * Gets the scroll value of the given element in the given side (top and left) 11612 * @method 11613 * @memberof Popper.Utils 11614 * @argument {Element} element 11615 * @argument {String} side `top` or `left` 11616 * @returns {number} amount of scrolled pixels 11617 */ 11618 function getScroll(element) { 11619 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 11620 11621 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 11622 var nodeName = element.nodeName; 11623 11624 if (nodeName === 'BODY' || nodeName === 'HTML') { 11625 var html = element.ownerDocument.documentElement; 11626 var scrollingElement = element.ownerDocument.scrollingElement || html; 11627 return scrollingElement[upperSide]; 11628 } 11629 11630 return element[upperSide]; 11631 } 11632 11633 /* 11634 * Sum or subtract the element scroll values (left and top) from a given rect object 11635 * @method 11636 * @memberof Popper.Utils 11637 * @param {Object} rect - Rect object you want to change 11638 * @param {HTMLElement} element - The element from the function reads the scroll values 11639 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 11640 * @return {Object} rect - The modifier rect object 11641 */ 11642 function includeScroll(rect, element) { 11643 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 11644 11645 var scrollTop = getScroll(element, 'top'); 11646 var scrollLeft = getScroll(element, 'left'); 11647 var modifier = subtract ? -1 : 1; 11648 rect.top += scrollTop * modifier; 11649 rect.bottom += scrollTop * modifier; 11650 rect.left += scrollLeft * modifier; 11651 rect.right += scrollLeft * modifier; 11652 return rect; 11653 } 11654 11655 /* 11656 * Helper to detect borders of a given element 11657 * @method 11658 * @memberof Popper.Utils 11659 * @param {CSSStyleDeclaration} styles 11660 * Result of `getStyleComputedProperty` on the given element 11661 * @param {String} axis - `x` or `y` 11662 * @return {number} borders - The borders size of the given axis 11663 */ 11664 11665 function getBordersSize(styles, axis) { 11666 var sideA = axis === 'x' ? 'Left' : 'Top'; 11667 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 11668 11669 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 11670 } 11671 11672 function getSize(axis, body, html, computedStyle) { 11673 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 11674 } 11675 11676 function getWindowSizes(document) { 11677 var body = document.body; 11678 var html = document.documentElement; 11679 var computedStyle = isIE(10) && getComputedStyle(html); 11680 11681 return { 11682 height: getSize('Height', body, html, computedStyle), 11683 width: getSize('Width', body, html, computedStyle) 11684 }; 11685 } 11686 11687 var classCallCheck = function (instance, Constructor) { 11688 if (!(instance instanceof Constructor)) { 11689 throw new TypeError("Cannot call a class as a function"); 11690 } 11691 }; 11692 11693 var createClass = function () { 11694 function defineProperties(target, props) { 11695 for (var i = 0; i < props.length; i++) { 11696 var descriptor = props[i]; 11697 descriptor.enumerable = descriptor.enumerable || false; 11698 descriptor.configurable = true; 11699 if ("value" in descriptor) descriptor.writable = true; 11700 Object.defineProperty(target, descriptor.key, descriptor); 11701 } 11702 } 11703 11704 return function (Constructor, protoProps, staticProps) { 11705 if (protoProps) defineProperties(Constructor.prototype, protoProps); 11706 if (staticProps) defineProperties(Constructor, staticProps); 11707 return Constructor; 11708 }; 11709 }(); 11710 11711 11712 11713 11714 11715 var defineProperty = function (obj, key, value) { 11716 if (key in obj) { 11717 Object.defineProperty(obj, key, { 11718 value: value, 11719 enumerable: true, 11720 configurable: true, 11721 writable: true 11722 }); 11723 } else { 11724 obj[key] = value; 11725 } 11726 11727 return obj; 11728 }; 11729 11730 var _extends = Object.assign || function (target) { 11731 for (var i = 1; i < arguments.length; i++) { 11732 var source = arguments[i]; 11733 11734 for (var key in source) { 11735 if (Object.prototype.hasOwnProperty.call(source, key)) { 11736 target[key] = source[key]; 11737 } 11738 } 11739 } 11740 11741 return target; 11742 }; 11743 11744 /** 11745 * Given element offsets, generate an output similar to getBoundingClientRect 11746 * @method 11747 * @memberof Popper.Utils 11748 * @argument {Object} offsets 11749 * @returns {Object} ClientRect like output 11750 */ 11751 function getClientRect(offsets) { 11752 return _extends({}, offsets, { 11753 right: offsets.left + offsets.width, 11754 bottom: offsets.top + offsets.height 11755 }); 11756 } 11757 11758 /** 11759 * Get bounding client rect of given element 11760 * @method 11761 * @memberof Popper.Utils 11762 * @param {HTMLElement} element 11763 * @return {Object} client rect 11764 */ 11765 function getBoundingClientRect(element) { 11766 var rect = {}; 11767 11768 // IE10 10 FIX: Please, don't ask, the element isn't 11769 // considered in DOM in some circumstances... 11770 // This isn't reproducible in IE10 compatibility mode of IE11 11771 try { 11772 if (isIE(10)) { 11773 rect = element.getBoundingClientRect(); 11774 var scrollTop = getScroll(element, 'top'); 11775 var scrollLeft = getScroll(element, 'left'); 11776 rect.top += scrollTop; 11777 rect.left += scrollLeft; 11778 rect.bottom += scrollTop; 11779 rect.right += scrollLeft; 11780 } else { 11781 rect = element.getBoundingClientRect(); 11782 } 11783 } catch (e) {} 11784 11785 var result = { 11786 left: rect.left, 11787 top: rect.top, 11788 width: rect.right - rect.left, 11789 height: rect.bottom - rect.top 11790 }; 11791 11792 // subtract scrollbar size from sizes 11793 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 11794 var width = sizes.width || element.clientWidth || result.width; 11795 var height = sizes.height || element.clientHeight || result.height; 11796 11797 var horizScrollbar = element.offsetWidth - width; 11798 var vertScrollbar = element.offsetHeight - height; 11799 11800 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 11801 // we make this check conditional for performance reasons 11802 if (horizScrollbar || vertScrollbar) { 11803 var styles = getStyleComputedProperty(element); 11804 horizScrollbar -= getBordersSize(styles, 'x'); 11805 vertScrollbar -= getBordersSize(styles, 'y'); 11806 11807 result.width -= horizScrollbar; 11808 result.height -= vertScrollbar; 11809 } 11810 11811 return getClientRect(result); 11812 } 11813 11814 function getOffsetRectRelativeToArbitraryNode(children, parent) { 11815 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 11816 11817 var isIE10 = isIE(10); 11818 var isHTML = parent.nodeName === 'HTML'; 11819 var childrenRect = getBoundingClientRect(children); 11820 var parentRect = getBoundingClientRect(parent); 11821 var scrollParent = getScrollParent(children); 11822 11823 var styles = getStyleComputedProperty(parent); 11824 var borderTopWidth = parseFloat(styles.borderTopWidth); 11825 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 11826 11827 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 11828 if (fixedPosition && isHTML) { 11829 parentRect.top = Math.max(parentRect.top, 0); 11830 parentRect.left = Math.max(parentRect.left, 0); 11831 } 11832 var offsets = getClientRect({ 11833 top: childrenRect.top - parentRect.top - borderTopWidth, 11834 left: childrenRect.left - parentRect.left - borderLeftWidth, 11835 width: childrenRect.width, 11836 height: childrenRect.height 11837 }); 11838 offsets.marginTop = 0; 11839 offsets.marginLeft = 0; 11840 11841 // Subtract margins of documentElement in case it's being used as parent 11842 // we do this only on HTML because it's the only element that behaves 11843 // differently when margins are applied to it. The margins are included in 11844 // the box of the documentElement, in the other cases not. 11845 if (!isIE10 && isHTML) { 11846 var marginTop = parseFloat(styles.marginTop); 11847 var marginLeft = parseFloat(styles.marginLeft); 11848 11849 offsets.top -= borderTopWidth - marginTop; 11850 offsets.bottom -= borderTopWidth - marginTop; 11851 offsets.left -= borderLeftWidth - marginLeft; 11852 offsets.right -= borderLeftWidth - marginLeft; 11853 11854 // Attach marginTop and marginLeft because in some circumstances we may need them 11855 offsets.marginTop = marginTop; 11856 offsets.marginLeft = marginLeft; 11857 } 11858 11859 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 11860 offsets = includeScroll(offsets, parent); 11861 } 11862 11863 return offsets; 11864 } 11865 11866 function getViewportOffsetRectRelativeToArtbitraryNode(element) { 11867 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 11868 11869 var html = element.ownerDocument.documentElement; 11870 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 11871 var width = Math.max(html.clientWidth, window.innerWidth || 0); 11872 var height = Math.max(html.clientHeight, window.innerHeight || 0); 11873 11874 var scrollTop = !excludeScroll ? getScroll(html) : 0; 11875 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 11876 11877 var offset = { 11878 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 11879 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 11880 width: width, 11881 height: height 11882 }; 11883 11884 return getClientRect(offset); 11885 } 11886 11887 /** 11888 * Check if the given element is fixed or is inside a fixed parent 11889 * @method 11890 * @memberof Popper.Utils 11891 * @argument {Element} element 11892 * @argument {Element} customContainer 11893 * @returns {Boolean} answer to "isFixed?" 11894 */ 11895 function isFixed(element) { 11896 var nodeName = element.nodeName; 11897 if (nodeName === 'BODY' || nodeName === 'HTML') { 11898 return false; 11899 } 11900 if (getStyleComputedProperty(element, 'position') === 'fixed') { 11901 return true; 11902 } 11903 var parentNode = getParentNode(element); 11904 if (!parentNode) { 11905 return false; 11906 } 11907 return isFixed(parentNode); 11908 } 11909 11910 /** 11911 * Finds the first parent of an element that has a transformed property defined 11912 * @method 11913 * @memberof Popper.Utils 11914 * @argument {Element} element 11915 * @returns {Element} first transformed parent or documentElement 11916 */ 11917 11918 function getFixedPositionOffsetParent(element) { 11919 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 11920 if (!element || !element.parentElement || isIE()) { 11921 return document.documentElement; 11922 } 11923 var el = element.parentElement; 11924 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 11925 el = el.parentElement; 11926 } 11927 return el || document.documentElement; 11928 } 11929 11930 /** 11931 * Computed the boundaries limits and return them 11932 * @method 11933 * @memberof Popper.Utils 11934 * @param {HTMLElement} popper 11935 * @param {HTMLElement} reference 11936 * @param {number} padding 11937 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 11938 * @param {Boolean} fixedPosition - Is in fixed position mode 11939 * @returns {Object} Coordinates of the boundaries 11940 */ 11941 function getBoundaries(popper, reference, padding, boundariesElement) { 11942 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 11943 11944 // NOTE: 1 DOM access here 11945 11946 var boundaries = { top: 0, left: 0 }; 11947 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 11948 11949 // Handle viewport case 11950 if (boundariesElement === 'viewport') { 11951 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 11952 } else { 11953 // Handle other cases based on DOM element used as boundaries 11954 var boundariesNode = void 0; 11955 if (boundariesElement === 'scrollParent') { 11956 boundariesNode = getScrollParent(getParentNode(reference)); 11957 if (boundariesNode.nodeName === 'BODY') { 11958 boundariesNode = popper.ownerDocument.documentElement; 11959 } 11960 } else if (boundariesElement === 'window') { 11961 boundariesNode = popper.ownerDocument.documentElement; 11962 } else { 11963 boundariesNode = boundariesElement; 11964 } 11965 11966 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 11967 11968 // In case of HTML, we need a different computation 11969 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 11970 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 11971 height = _getWindowSizes.height, 11972 width = _getWindowSizes.width; 11973 11974 boundaries.top += offsets.top - offsets.marginTop; 11975 boundaries.bottom = height + offsets.top; 11976 boundaries.left += offsets.left - offsets.marginLeft; 11977 boundaries.right = width + offsets.left; 11978 } else { 11979 // for all the other DOM elements, this one is good 11980 boundaries = offsets; 11981 } 11982 } 11983 11984 // Add paddings 11985 padding = padding || 0; 11986 var isPaddingNumber = typeof padding === 'number'; 11987 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 11988 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 11989 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 11990 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 11991 11992 return boundaries; 11993 } 11994 11995 function getArea(_ref) { 11996 var width = _ref.width, 11997 height = _ref.height; 11998 11999 return width * height; 12000 } 12001 12002 /** 12003 * Utility used to transform the `auto` placement to the placement with more 12004 * available space. 12005 * @method 12006 * @memberof Popper.Utils 12007 * @argument {Object} data - The data object generated by update method 12008 * @argument {Object} options - Modifiers configuration and options 12009 * @returns {Object} The data object, properly modified 12010 */ 12011 function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 12012 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 12013 12014 if (placement.indexOf('auto') === -1) { 12015 return placement; 12016 } 12017 12018 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 12019 12020 var rects = { 12021 top: { 12022 width: boundaries.width, 12023 height: refRect.top - boundaries.top 12024 }, 12025 right: { 12026 width: boundaries.right - refRect.right, 12027 height: boundaries.height 12028 }, 12029 bottom: { 12030 width: boundaries.width, 12031 height: boundaries.bottom - refRect.bottom 12032 }, 12033 left: { 12034 width: refRect.left - boundaries.left, 12035 height: boundaries.height 12036 } 12037 }; 12038 12039 var sortedAreas = Object.keys(rects).map(function (key) { 12040 return _extends({ 12041 key: key 12042 }, rects[key], { 12043 area: getArea(rects[key]) 12044 }); 12045 }).sort(function (a, b) { 12046 return b.area - a.area; 12047 }); 12048 12049 var filteredAreas = sortedAreas.filter(function (_ref2) { 12050 var width = _ref2.width, 12051 height = _ref2.height; 12052 return width >= popper.clientWidth && height >= popper.clientHeight; 12053 }); 12054 12055 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 12056 12057 var variation = placement.split('-')[1]; 12058 12059 return computedPlacement + (variation ? '-' + variation : ''); 12060 } 12061 12062 /** 12063 * Get offsets to the reference element 12064 * @method 12065 * @memberof Popper.Utils 12066 * @param {Object} state 12067 * @param {Element} popper - the popper element 12068 * @param {Element} reference - the reference element (the popper will be relative to this) 12069 * @param {Element} fixedPosition - is in fixed position mode 12070 * @returns {Object} An object containing the offsets which will be applied to the popper 12071 */ 12072 function getReferenceOffsets(state, popper, reference) { 12073 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 12074 12075 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 12076 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 12077 } 12078 12079 /** 12080 * Get the outer sizes of the given element (offset size + margins) 12081 * @method 12082 * @memberof Popper.Utils 12083 * @argument {Element} element 12084 * @returns {Object} object containing width and height properties 12085 */ 12086 function getOuterSizes(element) { 12087 var window = element.ownerDocument.defaultView; 12088 var styles = window.getComputedStyle(element); 12089 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 12090 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 12091 var result = { 12092 width: element.offsetWidth + y, 12093 height: element.offsetHeight + x 12094 }; 12095 return result; 12096 } 12097 12098 /** 12099 * Get the opposite placement of the given one 12100 * @method 12101 * @memberof Popper.Utils 12102 * @argument {String} placement 12103 * @returns {String} flipped placement 12104 */ 12105 function getOppositePlacement(placement) { 12106 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 12107 return placement.replace(/left|right|bottom|top/g, function (matched) { 12108 return hash[matched]; 12109 }); 12110 } 12111 12112 /** 12113 * Get offsets to the popper 12114 * @method 12115 * @memberof Popper.Utils 12116 * @param {Object} position - CSS position the Popper will get applied 12117 * @param {HTMLElement} popper - the popper element 12118 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 12119 * @param {String} placement - one of the valid placement options 12120 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 12121 */ 12122 function getPopperOffsets(popper, referenceOffsets, placement) { 12123 placement = placement.split('-')[0]; 12124 12125 // Get popper node sizes 12126 var popperRect = getOuterSizes(popper); 12127 12128 // Add position, width and height to our offsets object 12129 var popperOffsets = { 12130 width: popperRect.width, 12131 height: popperRect.height 12132 }; 12133 12134 // depending by the popper placement we have to compute its offsets slightly differently 12135 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 12136 var mainSide = isHoriz ? 'top' : 'left'; 12137 var secondarySide = isHoriz ? 'left' : 'top'; 12138 var measurement = isHoriz ? 'height' : 'width'; 12139 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 12140 12141 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 12142 if (placement === secondarySide) { 12143 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 12144 } else { 12145 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 12146 } 12147 12148 return popperOffsets; 12149 } 12150 12151 /** 12152 * Mimics the `find` method of Array 12153 * @method 12154 * @memberof Popper.Utils 12155 * @argument {Array} arr 12156 * @argument prop 12157 * @argument value 12158 * @returns index or -1 12159 */ 12160 function find(arr, check) { 12161 // use native find if supported 12162 if (Array.prototype.find) { 12163 return arr.find(check); 12164 } 12165 12166 // use `filter` to obtain the same behavior of `find` 12167 return arr.filter(check)[0]; 12168 } 12169 12170 /** 12171 * Return the index of the matching object 12172 * @method 12173 * @memberof Popper.Utils 12174 * @argument {Array} arr 12175 * @argument prop 12176 * @argument value 12177 * @returns index or -1 12178 */ 12179 function findIndex(arr, prop, value) { 12180 // use native findIndex if supported 12181 if (Array.prototype.findIndex) { 12182 return arr.findIndex(function (cur) { 12183 return cur[prop] === value; 12184 }); 12185 } 12186 12187 // use `find` + `indexOf` if `findIndex` isn't supported 12188 var match = find(arr, function (obj) { 12189 return obj[prop] === value; 12190 }); 12191 return arr.indexOf(match); 12192 } 12193 12194 /** 12195 * Loop trough the list of modifiers and run them in order, 12196 * each of them will then edit the data object. 12197 * @method 12198 * @memberof Popper.Utils 12199 * @param {dataObject} data 12200 * @param {Array} modifiers 12201 * @param {String} ends - Optional modifier name used as stopper 12202 * @returns {dataObject} 12203 */ 12204 function runModifiers(modifiers, data, ends) { 12205 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 12206 12207 modifiersToRun.forEach(function (modifier) { 12208 if (modifier['function']) { 12209 // eslint-disable-line dot-notation 12210 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 12211 } 12212 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 12213 if (modifier.enabled && isFunction(fn)) { 12214 // Add properties to offsets to make them a complete clientRect object 12215 // we do this before each modifier to make sure the previous one doesn't 12216 // mess with these values 12217 data.offsets.popper = getClientRect(data.offsets.popper); 12218 data.offsets.reference = getClientRect(data.offsets.reference); 12219 12220 data = fn(data, modifier); 12221 } 12222 }); 12223 12224 return data; 12225 } 12226 12227 /** 12228 * Updates the position of the popper, computing the new offsets and applying 12229 * the new style.<br /> 12230 * Prefer `scheduleUpdate` over `update` because of performance reasons. 12231 * @method 12232 * @memberof Popper 12233 */ 12234 function update() { 12235 // if popper is destroyed, don't perform any further update 12236 if (this.state.isDestroyed) { 12237 return; 12238 } 12239 12240 var data = { 12241 instance: this, 12242 styles: {}, 12243 arrowStyles: {}, 12244 attributes: {}, 12245 flipped: false, 12246 offsets: {} 12247 }; 12248 12249 // compute reference element offsets 12250 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 12251 12252 // compute auto placement, store placement inside the data object, 12253 // modifiers will be able to edit `placement` if needed 12254 // and refer to originalPlacement to know the original value 12255 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 12256 12257 // store the computed placement inside `originalPlacement` 12258 data.originalPlacement = data.placement; 12259 12260 data.positionFixed = this.options.positionFixed; 12261 12262 // compute the popper offsets 12263 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 12264 12265 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 12266 12267 // run the modifiers 12268 data = runModifiers(this.modifiers, data); 12269 12270 // the first `update` will call `onCreate` callback 12271 // the other ones will call `onUpdate` callback 12272 if (!this.state.isCreated) { 12273 this.state.isCreated = true; 12274 this.options.onCreate(data); 12275 } else { 12276 this.options.onUpdate(data); 12277 } 12278 } 12279 12280 /** 12281 * Helper used to know if the given modifier is enabled. 12282 * @method 12283 * @memberof Popper.Utils 12284 * @returns {Boolean} 12285 */ 12286 function isModifierEnabled(modifiers, modifierName) { 12287 return modifiers.some(function (_ref) { 12288 var name = _ref.name, 12289 enabled = _ref.enabled; 12290 return enabled && name === modifierName; 12291 }); 12292 } 12293 12294 /** 12295 * Get the prefixed supported property name 12296 * @method 12297 * @memberof Popper.Utils 12298 * @argument {String} property (camelCase) 12299 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 12300 */ 12301 function getSupportedPropertyName(property) { 12302 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 12303 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 12304 12305 for (var i = 0; i < prefixes.length; i++) { 12306 var prefix = prefixes[i]; 12307 var toCheck = prefix ? '' + prefix + upperProp : property; 12308 if (typeof document.body.style[toCheck] !== 'undefined') { 12309 return toCheck; 12310 } 12311 } 12312 return null; 12313 } 12314 12315 /** 12316 * Destroys the popper. 12317 * @method 12318 * @memberof Popper 12319 */ 12320 function destroy() { 12321 this.state.isDestroyed = true; 12322 12323 // touch DOM only if `applyStyle` modifier is enabled 12324 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 12325 this.popper.removeAttribute('x-placement'); 12326 this.popper.style.position = ''; 12327 this.popper.style.top = ''; 12328 this.popper.style.left = ''; 12329 this.popper.style.right = ''; 12330 this.popper.style.bottom = ''; 12331 this.popper.style.willChange = ''; 12332 this.popper.style[getSupportedPropertyName('transform')] = ''; 12333 } 12334 12335 this.disableEventListeners(); 12336 12337 // remove the popper if user explicitly asked for the deletion on destroy 12338 // do not use `remove` because IE11 doesn't support it 12339 if (this.options.removeOnDestroy) { 12340 this.popper.parentNode.removeChild(this.popper); 12341 } 12342 return this; 12343 } 12344 12345 /** 12346 * Get the window associated with the element 12347 * @argument {Element} element 12348 * @returns {Window} 12349 */ 12350 function getWindow(element) { 12351 var ownerDocument = element.ownerDocument; 12352 return ownerDocument ? ownerDocument.defaultView : window; 12353 } 12354 12355 function attachToScrollParents(scrollParent, event, callback, scrollParents) { 12356 var isBody = scrollParent.nodeName === 'BODY'; 12357 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 12358 target.addEventListener(event, callback, { passive: true }); 12359 12360 if (!isBody) { 12361 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 12362 } 12363 scrollParents.push(target); 12364 } 12365 12366 /** 12367 * Setup needed event listeners used to update the popper position 12368 * @method 12369 * @memberof Popper.Utils 12370 * @private 12371 */ 12372 function setupEventListeners(reference, options, state, updateBound) { 12373 // Resize event listener on window 12374 state.updateBound = updateBound; 12375 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 12376 12377 // Scroll event listener on scroll parents 12378 var scrollElement = getScrollParent(reference); 12379 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 12380 state.scrollElement = scrollElement; 12381 state.eventsEnabled = true; 12382 12383 return state; 12384 } 12385 12386 /** 12387 * It will add resize/scroll events and start recalculating 12388 * position of the popper element when they are triggered. 12389 * @method 12390 * @memberof Popper 12391 */ 12392 function enableEventListeners() { 12393 if (!this.state.eventsEnabled) { 12394 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 12395 } 12396 } 12397 12398 /** 12399 * Remove event listeners used to update the popper position 12400 * @method 12401 * @memberof Popper.Utils 12402 * @private 12403 */ 12404 function removeEventListeners(reference, state) { 12405 // Remove resize event listener on window 12406 getWindow(reference).removeEventListener('resize', state.updateBound); 12407 12408 // Remove scroll event listener on scroll parents 12409 state.scrollParents.forEach(function (target) { 12410 target.removeEventListener('scroll', state.updateBound); 12411 }); 12412 12413 // Reset state 12414 state.updateBound = null; 12415 state.scrollParents = []; 12416 state.scrollElement = null; 12417 state.eventsEnabled = false; 12418 return state; 12419 } 12420 12421 /** 12422 * It will remove resize/scroll events and won't recalculate popper position 12423 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 12424 * unless you call `update` method manually. 12425 * @method 12426 * @memberof Popper 12427 */ 12428 function disableEventListeners() { 12429 if (this.state.eventsEnabled) { 12430 cancelAnimationFrame(this.scheduleUpdate); 12431 this.state = removeEventListeners(this.reference, this.state); 12432 } 12433 } 12434 12435 /** 12436 * Tells if a given input is a number 12437 * @method 12438 * @memberof Popper.Utils 12439 * @param {*} input to check 12440 * @return {Boolean} 12441 */ 12442 function isNumeric(n) { 12443 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 12444 } 12445 12446 /** 12447 * Set the style to the given popper 12448 * @method 12449 * @memberof Popper.Utils 12450 * @argument {Element} element - Element to apply the style to 12451 * @argument {Object} styles 12452 * Object with a list of properties and values which will be applied to the element 12453 */ 12454 function setStyles(element, styles) { 12455 Object.keys(styles).forEach(function (prop) { 12456 var unit = ''; 12457 // add unit if the value is numeric and is one of the following 12458 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 12459 unit = 'px'; 12460 } 12461 element.style[prop] = styles[prop] + unit; 12462 }); 12463 } 12464 12465 /** 12466 * Set the attributes to the given popper 12467 * @method 12468 * @memberof Popper.Utils 12469 * @argument {Element} element - Element to apply the attributes to 12470 * @argument {Object} styles 12471 * Object with a list of properties and values which will be applied to the element 12472 */ 12473 function setAttributes(element, attributes) { 12474 Object.keys(attributes).forEach(function (prop) { 12475 var value = attributes[prop]; 12476 if (value !== false) { 12477 element.setAttribute(prop, attributes[prop]); 12478 } else { 12479 element.removeAttribute(prop); 12480 } 12481 }); 12482 } 12483 12484 /** 12485 * @function 12486 * @memberof Modifiers 12487 * @argument {Object} data - The data object generated by `update` method 12488 * @argument {Object} data.styles - List of style properties - values to apply to popper element 12489 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 12490 * @argument {Object} options - Modifiers configuration and options 12491 * @returns {Object} The same data object 12492 */ 12493 function applyStyle(data) { 12494 // any property present in `data.styles` will be applied to the popper, 12495 // in this way we can make the 3rd party modifiers add custom styles to it 12496 // Be aware, modifiers could override the properties defined in the previous 12497 // lines of this modifier! 12498 setStyles(data.instance.popper, data.styles); 12499 12500 // any property present in `data.attributes` will be applied to the popper, 12501 // they will be set as HTML attributes of the element 12502 setAttributes(data.instance.popper, data.attributes); 12503 12504 // if arrowElement is defined and arrowStyles has some properties 12505 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 12506 setStyles(data.arrowElement, data.arrowStyles); 12507 } 12508 12509 return data; 12510 } 12511 12512 /** 12513 * Set the x-placement attribute before everything else because it could be used 12514 * to add margins to the popper margins needs to be calculated to get the 12515 * correct popper offsets. 12516 * @method 12517 * @memberof Popper.modifiers 12518 * @param {HTMLElement} reference - The reference element used to position the popper 12519 * @param {HTMLElement} popper - The HTML element used as popper 12520 * @param {Object} options - Popper.js options 12521 */ 12522 function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 12523 // compute reference element offsets 12524 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 12525 12526 // compute auto placement, store placement inside the data object, 12527 // modifiers will be able to edit `placement` if needed 12528 // and refer to originalPlacement to know the original value 12529 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 12530 12531 popper.setAttribute('x-placement', placement); 12532 12533 // Apply `position` to popper before anything else because 12534 // without the position applied we can't guarantee correct computations 12535 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 12536 12537 return options; 12538 } 12539 12540 /** 12541 * @function 12542 * @memberof Popper.Utils 12543 * @argument {Object} data - The data object generated by `update` method 12544 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 12545 * @returns {Object} The popper's position offsets rounded 12546 * 12547 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 12548 * good as it can be within reason. 12549 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 12550 * 12551 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 12552 * as well on High DPI screens). 12553 * 12554 * Firefox prefers no rounding for positioning and does not have blurriness on 12555 * high DPI screens. 12556 * 12557 * Only horizontal placement and left/right values need to be considered. 12558 */ 12559 function getRoundedOffsets(data, shouldRound) { 12560 var _data$offsets = data.offsets, 12561 popper = _data$offsets.popper, 12562 reference = _data$offsets.reference; 12563 var round = Math.round, 12564 floor = Math.floor; 12565 12566 var noRound = function noRound(v) { 12567 return v; 12568 }; 12569 12570 var referenceWidth = round(reference.width); 12571 var popperWidth = round(popper.width); 12572 12573 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 12574 var isVariation = data.placement.indexOf('-') !== -1; 12575 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 12576 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 12577 12578 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 12579 var verticalToInteger = !shouldRound ? noRound : round; 12580 12581 return { 12582 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 12583 top: verticalToInteger(popper.top), 12584 bottom: verticalToInteger(popper.bottom), 12585 right: horizontalToInteger(popper.right) 12586 }; 12587 } 12588 12589 var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 12590 12591 /** 12592 * @function 12593 * @memberof Modifiers 12594 * @argument {Object} data - The data object generated by `update` method 12595 * @argument {Object} options - Modifiers configuration and options 12596 * @returns {Object} The data object, properly modified 12597 */ 12598 function computeStyle(data, options) { 12599 var x = options.x, 12600 y = options.y; 12601 var popper = data.offsets.popper; 12602 12603 // Remove this legacy support in Popper.js v2 12604 12605 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 12606 return modifier.name === 'applyStyle'; 12607 }).gpuAcceleration; 12608 if (legacyGpuAccelerationOption !== undefined) { 12609 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 12610 } 12611 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 12612 12613 var offsetParent = getOffsetParent(data.instance.popper); 12614 var offsetParentRect = getBoundingClientRect(offsetParent); 12615 12616 // Styles 12617 var styles = { 12618 position: popper.position 12619 }; 12620 12621 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 12622 12623 var sideA = x === 'bottom' ? 'top' : 'bottom'; 12624 var sideB = y === 'right' ? 'left' : 'right'; 12625 12626 // if gpuAcceleration is set to `true` and transform is supported, 12627 // we use `translate3d` to apply the position to the popper we 12628 // automatically use the supported prefixed version if needed 12629 var prefixedProperty = getSupportedPropertyName('transform'); 12630 12631 // now, let's make a step back and look at this code closely (wtf?) 12632 // If the content of the popper grows once it's been positioned, it 12633 // may happen that the popper gets misplaced because of the new content 12634 // overflowing its reference element 12635 // To avoid this problem, we provide two options (x and y), which allow 12636 // the consumer to define the offset origin. 12637 // If we position a popper on top of a reference element, we can set 12638 // `x` to `top` to make the popper grow towards its top instead of 12639 // its bottom. 12640 var left = void 0, 12641 top = void 0; 12642 if (sideA === 'bottom') { 12643 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 12644 // and not the bottom of the html element 12645 if (offsetParent.nodeName === 'HTML') { 12646 top = -offsetParent.clientHeight + offsets.bottom; 12647 } else { 12648 top = -offsetParentRect.height + offsets.bottom; 12649 } 12650 } else { 12651 top = offsets.top; 12652 } 12653 if (sideB === 'right') { 12654 if (offsetParent.nodeName === 'HTML') { 12655 left = -offsetParent.clientWidth + offsets.right; 12656 } else { 12657 left = -offsetParentRect.width + offsets.right; 12658 } 12659 } else { 12660 left = offsets.left; 12661 } 12662 if (gpuAcceleration && prefixedProperty) { 12663 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 12664 styles[sideA] = 0; 12665 styles[sideB] = 0; 12666 styles.willChange = 'transform'; 12667 } else { 12668 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 12669 var invertTop = sideA === 'bottom' ? -1 : 1; 12670 var invertLeft = sideB === 'right' ? -1 : 1; 12671 styles[sideA] = top * invertTop; 12672 styles[sideB] = left * invertLeft; 12673 styles.willChange = sideA + ', ' + sideB; 12674 } 12675 12676 // Attributes 12677 var attributes = { 12678 'x-placement': data.placement 12679 }; 12680 12681 // Update `data` attributes, styles and arrowStyles 12682 data.attributes = _extends({}, attributes, data.attributes); 12683 data.styles = _extends({}, styles, data.styles); 12684 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 12685 12686 return data; 12687 } 12688 12689 /** 12690 * Helper used to know if the given modifier depends from another one.<br /> 12691 * It checks if the needed modifier is listed and enabled. 12692 * @method 12693 * @memberof Popper.Utils 12694 * @param {Array} modifiers - list of modifiers 12695 * @param {String} requestingName - name of requesting modifier 12696 * @param {String} requestedName - name of requested modifier 12697 * @returns {Boolean} 12698 */ 12699 function isModifierRequired(modifiers, requestingName, requestedName) { 12700 var requesting = find(modifiers, function (_ref) { 12701 var name = _ref.name; 12702 return name === requestingName; 12703 }); 12704 12705 var isRequired = !!requesting && modifiers.some(function (modifier) { 12706 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 12707 }); 12708 12709 if (!isRequired) { 12710 var _requesting = '`' + requestingName + '`'; 12711 var requested = '`' + requestedName + '`'; 12712 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 12713 } 12714 return isRequired; 12715 } 12716 12717 /** 12718 * @function 12719 * @memberof Modifiers 12720 * @argument {Object} data - The data object generated by update method 12721 * @argument {Object} options - Modifiers configuration and options 12722 * @returns {Object} The data object, properly modified 12723 */ 12724 function arrow(data, options) { 12725 var _data$offsets$arrow; 12726 12727 // arrow depends on keepTogether in order to work 12728 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 12729 return data; 12730 } 12731 12732 var arrowElement = options.element; 12733 12734 // if arrowElement is a string, suppose it's a CSS selector 12735 if (typeof arrowElement === 'string') { 12736 arrowElement = data.instance.popper.querySelector(arrowElement); 12737 12738 // if arrowElement is not found, don't run the modifier 12739 if (!arrowElement) { 12740 return data; 12741 } 12742 } else { 12743 // if the arrowElement isn't a query selector we must check that the 12744 // provided DOM node is child of its popper node 12745 if (!data.instance.popper.contains(arrowElement)) { 12746 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 12747 return data; 12748 } 12749 } 12750 12751 var placement = data.placement.split('-')[0]; 12752 var _data$offsets = data.offsets, 12753 popper = _data$offsets.popper, 12754 reference = _data$offsets.reference; 12755 12756 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 12757 12758 var len = isVertical ? 'height' : 'width'; 12759 var sideCapitalized = isVertical ? 'Top' : 'Left'; 12760 var side = sideCapitalized.toLowerCase(); 12761 var altSide = isVertical ? 'left' : 'top'; 12762 var opSide = isVertical ? 'bottom' : 'right'; 12763 var arrowElementSize = getOuterSizes(arrowElement)[len]; 12764 12765 // 12766 // extends keepTogether behavior making sure the popper and its 12767 // reference have enough pixels in conjunction 12768 // 12769 12770 // top/left side 12771 if (reference[opSide] - arrowElementSize < popper[side]) { 12772 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 12773 } 12774 // bottom/right side 12775 if (reference[side] + arrowElementSize > popper[opSide]) { 12776 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 12777 } 12778 data.offsets.popper = getClientRect(data.offsets.popper); 12779 12780 // compute center of the popper 12781 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 12782 12783 // Compute the sideValue using the updated popper offsets 12784 // take popper margin in account because we don't have this info available 12785 var css = getStyleComputedProperty(data.instance.popper); 12786 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 12787 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 12788 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 12789 12790 // prevent arrowElement from being placed not contiguously to its popper 12791 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 12792 12793 data.arrowElement = arrowElement; 12794 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 12795 12796 return data; 12797 } 12798 12799 /** 12800 * Get the opposite placement variation of the given one 12801 * @method 12802 * @memberof Popper.Utils 12803 * @argument {String} placement variation 12804 * @returns {String} flipped placement variation 12805 */ 12806 function getOppositeVariation(variation) { 12807 if (variation === 'end') { 12808 return 'start'; 12809 } else if (variation === 'start') { 12810 return 'end'; 12811 } 12812 return variation; 12813 } 12814 12815 /** 12816 * List of accepted placements to use as values of the `placement` option.<br /> 12817 * Valid placements are: 12818 * - `auto` 12819 * - `top` 12820 * - `right` 12821 * - `bottom` 12822 * - `left` 12823 * 12824 * Each placement can have a variation from this list: 12825 * - `-start` 12826 * - `-end` 12827 * 12828 * Variations are interpreted easily if you think of them as the left to right 12829 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 12830 * is right.<br /> 12831 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 12832 * 12833 * Some valid examples are: 12834 * - `top-end` (on top of reference, right aligned) 12835 * - `right-start` (on right of reference, top aligned) 12836 * - `bottom` (on bottom, centered) 12837 * - `auto-end` (on the side with more space available, alignment depends by placement) 12838 * 12839 * @static 12840 * @type {Array} 12841 * @enum {String} 12842 * @readonly 12843 * @method placements 12844 * @memberof Popper 12845 */ 12846 var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 12847 12848 // Get rid of `auto` `auto-start` and `auto-end` 12849 var validPlacements = placements.slice(3); 12850 12851 /** 12852 * Given an initial placement, returns all the subsequent placements 12853 * clockwise (or counter-clockwise). 12854 * 12855 * @method 12856 * @memberof Popper.Utils 12857 * @argument {String} placement - A valid placement (it accepts variations) 12858 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 12859 * @returns {Array} placements including their variations 12860 */ 12861 function clockwise(placement) { 12862 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 12863 12864 var index = validPlacements.indexOf(placement); 12865 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 12866 return counter ? arr.reverse() : arr; 12867 } 12868 12869 var BEHAVIORS = { 12870 FLIP: 'flip', 12871 CLOCKWISE: 'clockwise', 12872 COUNTERCLOCKWISE: 'counterclockwise' 12873 }; 12874 12875 /** 12876 * @function 12877 * @memberof Modifiers 12878 * @argument {Object} data - The data object generated by update method 12879 * @argument {Object} options - Modifiers configuration and options 12880 * @returns {Object} The data object, properly modified 12881 */ 12882 function flip(data, options) { 12883 // if `inner` modifier is enabled, we can't use the `flip` modifier 12884 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 12885 return data; 12886 } 12887 12888 if (data.flipped && data.placement === data.originalPlacement) { 12889 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 12890 return data; 12891 } 12892 12893 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 12894 12895 var placement = data.placement.split('-')[0]; 12896 var placementOpposite = getOppositePlacement(placement); 12897 var variation = data.placement.split('-')[1] || ''; 12898 12899 var flipOrder = []; 12900 12901 switch (options.behavior) { 12902 case BEHAVIORS.FLIP: 12903 flipOrder = [placement, placementOpposite]; 12904 break; 12905 case BEHAVIORS.CLOCKWISE: 12906 flipOrder = clockwise(placement); 12907 break; 12908 case BEHAVIORS.COUNTERCLOCKWISE: 12909 flipOrder = clockwise(placement, true); 12910 break; 12911 default: 12912 flipOrder = options.behavior; 12913 } 12914 12915 flipOrder.forEach(function (step, index) { 12916 if (placement !== step || flipOrder.length === index + 1) { 12917 return data; 12918 } 12919 12920 placement = data.placement.split('-')[0]; 12921 placementOpposite = getOppositePlacement(placement); 12922 12923 var popperOffsets = data.offsets.popper; 12924 var refOffsets = data.offsets.reference; 12925 12926 // using floor because the reference offsets may contain decimals we are not going to consider here 12927 var floor = Math.floor; 12928 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 12929 12930 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 12931 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 12932 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 12933 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 12934 12935 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 12936 12937 // flip the variation if required 12938 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 12939 12940 // flips variation if reference element overflows boundaries 12941 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 12942 12943 // flips variation if popper content overflows boundaries 12944 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 12945 12946 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 12947 12948 if (overlapsRef || overflowsBoundaries || flippedVariation) { 12949 // this boolean to detect any flip loop 12950 data.flipped = true; 12951 12952 if (overlapsRef || overflowsBoundaries) { 12953 placement = flipOrder[index + 1]; 12954 } 12955 12956 if (flippedVariation) { 12957 variation = getOppositeVariation(variation); 12958 } 12959 12960 data.placement = placement + (variation ? '-' + variation : ''); 12961 12962 // this object contains `position`, we want to preserve it along with 12963 // any additional property we may add in the future 12964 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 12965 12966 data = runModifiers(data.instance.modifiers, data, 'flip'); 12967 } 12968 }); 12969 return data; 12970 } 12971 12972 /** 12973 * @function 12974 * @memberof Modifiers 12975 * @argument {Object} data - The data object generated by update method 12976 * @argument {Object} options - Modifiers configuration and options 12977 * @returns {Object} The data object, properly modified 12978 */ 12979 function keepTogether(data) { 12980 var _data$offsets = data.offsets, 12981 popper = _data$offsets.popper, 12982 reference = _data$offsets.reference; 12983 12984 var placement = data.placement.split('-')[0]; 12985 var floor = Math.floor; 12986 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 12987 var side = isVertical ? 'right' : 'bottom'; 12988 var opSide = isVertical ? 'left' : 'top'; 12989 var measurement = isVertical ? 'width' : 'height'; 12990 12991 if (popper[side] < floor(reference[opSide])) { 12992 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 12993 } 12994 if (popper[opSide] > floor(reference[side])) { 12995 data.offsets.popper[opSide] = floor(reference[side]); 12996 } 12997 12998 return data; 12999 } 13000 13001 /** 13002 * Converts a string containing value + unit into a px value number 13003 * @function 13004 * @memberof {modifiers~offset} 13005 * @private 13006 * @argument {String} str - Value + unit string 13007 * @argument {String} measurement - `height` or `width` 13008 * @argument {Object} popperOffsets 13009 * @argument {Object} referenceOffsets 13010 * @returns {Number|String} 13011 * Value in pixels, or original string if no values were extracted 13012 */ 13013 function toValue(str, measurement, popperOffsets, referenceOffsets) { 13014 // separate value from unit 13015 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 13016 var value = +split[1]; 13017 var unit = split[2]; 13018 13019 // If it's not a number it's an operator, I guess 13020 if (!value) { 13021 return str; 13022 } 13023 13024 if (unit.indexOf('%') === 0) { 13025 var element = void 0; 13026 switch (unit) { 13027 case '%p': 13028 element = popperOffsets; 13029 break; 13030 case '%': 13031 case '%r': 13032 default: 13033 element = referenceOffsets; 13034 } 13035 13036 var rect = getClientRect(element); 13037 return rect[measurement] / 100 * value; 13038 } else if (unit === 'vh' || unit === 'vw') { 13039 // if is a vh or vw, we calculate the size based on the viewport 13040 var size = void 0; 13041 if (unit === 'vh') { 13042 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 13043 } else { 13044 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 13045 } 13046 return size / 100 * value; 13047 } else { 13048 // if is an explicit pixel unit, we get rid of the unit and keep the value 13049 // if is an implicit unit, it's px, and we return just the value 13050 return value; 13051 } 13052 } 13053 13054 /** 13055 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 13056 * @function 13057 * @memberof {modifiers~offset} 13058 * @private 13059 * @argument {String} offset 13060 * @argument {Object} popperOffsets 13061 * @argument {Object} referenceOffsets 13062 * @argument {String} basePlacement 13063 * @returns {Array} a two cells array with x and y offsets in numbers 13064 */ 13065 function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 13066 var offsets = [0, 0]; 13067 13068 // Use height if placement is left or right and index is 0 otherwise use width 13069 // in this way the first offset will use an axis and the second one 13070 // will use the other one 13071 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 13072 13073 // Split the offset string to obtain a list of values and operands 13074 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 13075 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 13076 return frag.trim(); 13077 }); 13078 13079 // Detect if the offset string contains a pair of values or a single one 13080 // they could be separated by comma or space 13081 var divider = fragments.indexOf(find(fragments, function (frag) { 13082 return frag.search(/,|\s/) !== -1; 13083 })); 13084 13085 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 13086 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 13087 } 13088 13089 // If divider is found, we divide the list of values and operands to divide 13090 // them by ofset X and Y. 13091 var splitRegex = /\s*,\s*|\s+/; 13092 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 13093 13094 // Convert the values with units to absolute pixels to allow our computations 13095 ops = ops.map(function (op, index) { 13096 // Most of the units rely on the orientation of the popper 13097 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 13098 var mergeWithPrevious = false; 13099 return op 13100 // This aggregates any `+` or `-` sign that aren't considered operators 13101 // e.g.: 10 + +5 => [10, +, +5] 13102 .reduce(function (a, b) { 13103 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 13104 a[a.length - 1] = b; 13105 mergeWithPrevious = true; 13106 return a; 13107 } else if (mergeWithPrevious) { 13108 a[a.length - 1] += b; 13109 mergeWithPrevious = false; 13110 return a; 13111 } else { 13112 return a.concat(b); 13113 } 13114 }, []) 13115 // Here we convert the string values into number values (in px) 13116 .map(function (str) { 13117 return toValue(str, measurement, popperOffsets, referenceOffsets); 13118 }); 13119 }); 13120 13121 // Loop trough the offsets arrays and execute the operations 13122 ops.forEach(function (op, index) { 13123 op.forEach(function (frag, index2) { 13124 if (isNumeric(frag)) { 13125 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 13126 } 13127 }); 13128 }); 13129 return offsets; 13130 } 13131 13132 /** 13133 * @function 13134 * @memberof Modifiers 13135 * @argument {Object} data - The data object generated by update method 13136 * @argument {Object} options - Modifiers configuration and options 13137 * @argument {Number|String} options.offset=0 13138 * The offset value as described in the modifier description 13139 * @returns {Object} The data object, properly modified 13140 */ 13141 function offset(data, _ref) { 13142 var offset = _ref.offset; 13143 var placement = data.placement, 13144 _data$offsets = data.offsets, 13145 popper = _data$offsets.popper, 13146 reference = _data$offsets.reference; 13147 13148 var basePlacement = placement.split('-')[0]; 13149 13150 var offsets = void 0; 13151 if (isNumeric(+offset)) { 13152 offsets = [+offset, 0]; 13153 } else { 13154 offsets = parseOffset(offset, popper, reference, basePlacement); 13155 } 13156 13157 if (basePlacement === 'left') { 13158 popper.top += offsets[0]; 13159 popper.left -= offsets[1]; 13160 } else if (basePlacement === 'right') { 13161 popper.top += offsets[0]; 13162 popper.left += offsets[1]; 13163 } else if (basePlacement === 'top') { 13164 popper.left += offsets[0]; 13165 popper.top -= offsets[1]; 13166 } else if (basePlacement === 'bottom') { 13167 popper.left += offsets[0]; 13168 popper.top += offsets[1]; 13169 } 13170 13171 data.popper = popper; 13172 return data; 13173 } 13174 13175 /** 13176 * @function 13177 * @memberof Modifiers 13178 * @argument {Object} data - The data object generated by `update` method 13179 * @argument {Object} options - Modifiers configuration and options 13180 * @returns {Object} The data object, properly modified 13181 */ 13182 function preventOverflow(data, options) { 13183 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 13184 13185 // If offsetParent is the reference element, we really want to 13186 // go one step up and use the next offsetParent as reference to 13187 // avoid to make this modifier completely useless and look like broken 13188 if (data.instance.reference === boundariesElement) { 13189 boundariesElement = getOffsetParent(boundariesElement); 13190 } 13191 13192 // NOTE: DOM access here 13193 // resets the popper's position so that the document size can be calculated excluding 13194 // the size of the popper element itself 13195 var transformProp = getSupportedPropertyName('transform'); 13196 var popperStyles = data.instance.popper.style; // assignment to help minification 13197 var top = popperStyles.top, 13198 left = popperStyles.left, 13199 transform = popperStyles[transformProp]; 13200 13201 popperStyles.top = ''; 13202 popperStyles.left = ''; 13203 popperStyles[transformProp] = ''; 13204 13205 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 13206 13207 // NOTE: DOM access here 13208 // restores the original style properties after the offsets have been computed 13209 popperStyles.top = top; 13210 popperStyles.left = left; 13211 popperStyles[transformProp] = transform; 13212 13213 options.boundaries = boundaries; 13214 13215 var order = options.priority; 13216 var popper = data.offsets.popper; 13217 13218 var check = { 13219 primary: function primary(placement) { 13220 var value = popper[placement]; 13221 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 13222 value = Math.max(popper[placement], boundaries[placement]); 13223 } 13224 return defineProperty({}, placement, value); 13225 }, 13226 secondary: function secondary(placement) { 13227 var mainSide = placement === 'right' ? 'left' : 'top'; 13228 var value = popper[mainSide]; 13229 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 13230 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 13231 } 13232 return defineProperty({}, mainSide, value); 13233 } 13234 }; 13235 13236 order.forEach(function (placement) { 13237 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 13238 popper = _extends({}, popper, check[side](placement)); 13239 }); 13240 13241 data.offsets.popper = popper; 13242 13243 return data; 13244 } 13245 13246 /** 13247 * @function 13248 * @memberof Modifiers 13249 * @argument {Object} data - The data object generated by `update` method 13250 * @argument {Object} options - Modifiers configuration and options 13251 * @returns {Object} The data object, properly modified 13252 */ 13253 function shift(data) { 13254 var placement = data.placement; 13255 var basePlacement = placement.split('-')[0]; 13256 var shiftvariation = placement.split('-')[1]; 13257 13258 // if shift shiftvariation is specified, run the modifier 13259 if (shiftvariation) { 13260 var _data$offsets = data.offsets, 13261 reference = _data$offsets.reference, 13262 popper = _data$offsets.popper; 13263 13264 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 13265 var side = isVertical ? 'left' : 'top'; 13266 var measurement = isVertical ? 'width' : 'height'; 13267 13268 var shiftOffsets = { 13269 start: defineProperty({}, side, reference[side]), 13270 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 13271 }; 13272 13273 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 13274 } 13275 13276 return data; 13277 } 13278 13279 /** 13280 * @function 13281 * @memberof Modifiers 13282 * @argument {Object} data - The data object generated by update method 13283 * @argument {Object} options - Modifiers configuration and options 13284 * @returns {Object} The data object, properly modified 13285 */ 13286 function hide(data) { 13287 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 13288 return data; 13289 } 13290 13291 var refRect = data.offsets.reference; 13292 var bound = find(data.instance.modifiers, function (modifier) { 13293 return modifier.name === 'preventOverflow'; 13294 }).boundaries; 13295 13296 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 13297 // Avoid unnecessary DOM access if visibility hasn't changed 13298 if (data.hide === true) { 13299 return data; 13300 } 13301 13302 data.hide = true; 13303 data.attributes['x-out-of-boundaries'] = ''; 13304 } else { 13305 // Avoid unnecessary DOM access if visibility hasn't changed 13306 if (data.hide === false) { 13307 return data; 13308 } 13309 13310 data.hide = false; 13311 data.attributes['x-out-of-boundaries'] = false; 13312 } 13313 13314 return data; 13315 } 13316 13317 /** 13318 * @function 13319 * @memberof Modifiers 13320 * @argument {Object} data - The data object generated by `update` method 13321 * @argument {Object} options - Modifiers configuration and options 13322 * @returns {Object} The data object, properly modified 13323 */ 13324 function inner(data) { 13325 var placement = data.placement; 13326 var basePlacement = placement.split('-')[0]; 13327 var _data$offsets = data.offsets, 13328 popper = _data$offsets.popper, 13329 reference = _data$offsets.reference; 13330 13331 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 13332 13333 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 13334 13335 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 13336 13337 data.placement = getOppositePlacement(placement); 13338 data.offsets.popper = getClientRect(popper); 13339 13340 return data; 13341 } 13342 13343 /** 13344 * Modifier function, each modifier can have a function of this type assigned 13345 * to its `fn` property.<br /> 13346 * These functions will be called on each update, this means that you must 13347 * make sure they are performant enough to avoid performance bottlenecks. 13348 * 13349 * @function ModifierFn 13350 * @argument {dataObject} data - The data object generated by `update` method 13351 * @argument {Object} options - Modifiers configuration and options 13352 * @returns {dataObject} The data object, properly modified 13353 */ 13354 13355 /** 13356 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 13357 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 13358 * needed by the library. 13359 * 13360 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 13361 * All the other properties are configurations that could be tweaked. 13362 * @namespace modifiers 13363 */ 13364 var modifiers = { 13365 /** 13366 * Modifier used to shift the popper on the start or end of its reference 13367 * element.<br /> 13368 * It will read the variation of the `placement` property.<br /> 13369 * It can be one either `-end` or `-start`. 13370 * @memberof modifiers 13371 * @inner 13372 */ 13373 shift: { 13374 /** @prop {number} order=100 - Index used to define the order of execution */ 13375 order: 100, 13376 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13377 enabled: true, 13378 /** @prop {ModifierFn} */ 13379 fn: shift 13380 }, 13381 13382 /** 13383 * The `offset` modifier can shift your popper on both its axis. 13384 * 13385 * It accepts the following units: 13386 * - `px` or unit-less, interpreted as pixels 13387 * - `%` or `%r`, percentage relative to the length of the reference element 13388 * - `%p`, percentage relative to the length of the popper element 13389 * - `vw`, CSS viewport width unit 13390 * - `vh`, CSS viewport height unit 13391 * 13392 * For length is intended the main axis relative to the placement of the popper.<br /> 13393 * This means that if the placement is `top` or `bottom`, the length will be the 13394 * `width`. In case of `left` or `right`, it will be the `height`. 13395 * 13396 * You can provide a single value (as `Number` or `String`), or a pair of values 13397 * as `String` divided by a comma or one (or more) white spaces.<br /> 13398 * The latter is a deprecated method because it leads to confusion and will be 13399 * removed in v2.<br /> 13400 * Additionally, it accepts additions and subtractions between different units. 13401 * Note that multiplications and divisions aren't supported. 13402 * 13403 * Valid examples are: 13404 * ``` 13405 * 10 13406 * '10%' 13407 * '10, 10' 13408 * '10%, 10' 13409 * '10 + 10%' 13410 * '10 - 5vh + 3%' 13411 * '-10px + 5vh, 5px - 6%' 13412 * ``` 13413 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 13414 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 13415 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 13416 * 13417 * @memberof modifiers 13418 * @inner 13419 */ 13420 offset: { 13421 /** @prop {number} order=200 - Index used to define the order of execution */ 13422 order: 200, 13423 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13424 enabled: true, 13425 /** @prop {ModifierFn} */ 13426 fn: offset, 13427 /** @prop {Number|String} offset=0 13428 * The offset value as described in the modifier description 13429 */ 13430 offset: 0 13431 }, 13432 13433 /** 13434 * Modifier used to prevent the popper from being positioned outside the boundary. 13435 * 13436 * A scenario exists where the reference itself is not within the boundaries.<br /> 13437 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 13438 * In this case we need to decide whether the popper should either: 13439 * 13440 * - detach from the reference and remain "trapped" in the boundaries, or 13441 * - if it should ignore the boundary and "escape with its reference" 13442 * 13443 * When `escapeWithReference` is set to`true` and reference is completely 13444 * outside its boundaries, the popper will overflow (or completely leave) 13445 * the boundaries in order to remain attached to the edge of the reference. 13446 * 13447 * @memberof modifiers 13448 * @inner 13449 */ 13450 preventOverflow: { 13451 /** @prop {number} order=300 - Index used to define the order of execution */ 13452 order: 300, 13453 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13454 enabled: true, 13455 /** @prop {ModifierFn} */ 13456 fn: preventOverflow, 13457 /** 13458 * @prop {Array} [priority=['left','right','top','bottom']] 13459 * Popper will try to prevent overflow following these priorities by default, 13460 * then, it could overflow on the left and on top of the `boundariesElement` 13461 */ 13462 priority: ['left', 'right', 'top', 'bottom'], 13463 /** 13464 * @prop {number} padding=5 13465 * Amount of pixel used to define a minimum distance between the boundaries 13466 * and the popper. This makes sure the popper always has a little padding 13467 * between the edges of its container 13468 */ 13469 padding: 5, 13470 /** 13471 * @prop {String|HTMLElement} boundariesElement='scrollParent' 13472 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 13473 * `viewport` or any DOM element. 13474 */ 13475 boundariesElement: 'scrollParent' 13476 }, 13477 13478 /** 13479 * Modifier used to make sure the reference and its popper stay near each other 13480 * without leaving any gap between the two. Especially useful when the arrow is 13481 * enabled and you want to ensure that it points to its reference element. 13482 * It cares only about the first axis. You can still have poppers with margin 13483 * between the popper and its reference element. 13484 * @memberof modifiers 13485 * @inner 13486 */ 13487 keepTogether: { 13488 /** @prop {number} order=400 - Index used to define the order of execution */ 13489 order: 400, 13490 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13491 enabled: true, 13492 /** @prop {ModifierFn} */ 13493 fn: keepTogether 13494 }, 13495 13496 /** 13497 * This modifier is used to move the `arrowElement` of the popper to make 13498 * sure it is positioned between the reference element and its popper element. 13499 * It will read the outer size of the `arrowElement` node to detect how many 13500 * pixels of conjunction are needed. 13501 * 13502 * It has no effect if no `arrowElement` is provided. 13503 * @memberof modifiers 13504 * @inner 13505 */ 13506 arrow: { 13507 /** @prop {number} order=500 - Index used to define the order of execution */ 13508 order: 500, 13509 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13510 enabled: true, 13511 /** @prop {ModifierFn} */ 13512 fn: arrow, 13513 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 13514 element: '[x-arrow]' 13515 }, 13516 13517 /** 13518 * Modifier used to flip the popper's placement when it starts to overlap its 13519 * reference element. 13520 * 13521 * Requires the `preventOverflow` modifier before it in order to work. 13522 * 13523 * **NOTE:** this modifier will interrupt the current update cycle and will 13524 * restart it if it detects the need to flip the placement. 13525 * @memberof modifiers 13526 * @inner 13527 */ 13528 flip: { 13529 /** @prop {number} order=600 - Index used to define the order of execution */ 13530 order: 600, 13531 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13532 enabled: true, 13533 /** @prop {ModifierFn} */ 13534 fn: flip, 13535 /** 13536 * @prop {String|Array} behavior='flip' 13537 * The behavior used to change the popper's placement. It can be one of 13538 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 13539 * placements (with optional variations) 13540 */ 13541 behavior: 'flip', 13542 /** 13543 * @prop {number} padding=5 13544 * The popper will flip if it hits the edges of the `boundariesElement` 13545 */ 13546 padding: 5, 13547 /** 13548 * @prop {String|HTMLElement} boundariesElement='viewport' 13549 * The element which will define the boundaries of the popper position. 13550 * The popper will never be placed outside of the defined boundaries 13551 * (except if `keepTogether` is enabled) 13552 */ 13553 boundariesElement: 'viewport', 13554 /** 13555 * @prop {Boolean} flipVariations=false 13556 * The popper will switch placement variation between `-start` and `-end` when 13557 * the reference element overlaps its boundaries. 13558 * 13559 * The original placement should have a set variation. 13560 */ 13561 flipVariations: false, 13562 /** 13563 * @prop {Boolean} flipVariationsByContent=false 13564 * The popper will switch placement variation between `-start` and `-end` when 13565 * the popper element overlaps its reference boundaries. 13566 * 13567 * The original placement should have a set variation. 13568 */ 13569 flipVariationsByContent: false 13570 }, 13571 13572 /** 13573 * Modifier used to make the popper flow toward the inner of the reference element. 13574 * By default, when this modifier is disabled, the popper will be placed outside 13575 * the reference element. 13576 * @memberof modifiers 13577 * @inner 13578 */ 13579 inner: { 13580 /** @prop {number} order=700 - Index used to define the order of execution */ 13581 order: 700, 13582 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 13583 enabled: false, 13584 /** @prop {ModifierFn} */ 13585 fn: inner 13586 }, 13587 13588 /** 13589 * Modifier used to hide the popper when its reference element is outside of the 13590 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 13591 * be used to hide with a CSS selector the popper when its reference is 13592 * out of boundaries. 13593 * 13594 * Requires the `preventOverflow` modifier before it in order to work. 13595 * @memberof modifiers 13596 * @inner 13597 */ 13598 hide: { 13599 /** @prop {number} order=800 - Index used to define the order of execution */ 13600 order: 800, 13601 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13602 enabled: true, 13603 /** @prop {ModifierFn} */ 13604 fn: hide 13605 }, 13606 13607 /** 13608 * Computes the style that will be applied to the popper element to gets 13609 * properly positioned. 13610 * 13611 * Note that this modifier will not touch the DOM, it just prepares the styles 13612 * so that `applyStyle` modifier can apply it. This separation is useful 13613 * in case you need to replace `applyStyle` with a custom implementation. 13614 * 13615 * This modifier has `850` as `order` value to maintain backward compatibility 13616 * with previous versions of Popper.js. Expect the modifiers ordering method 13617 * to change in future major versions of the library. 13618 * 13619 * @memberof modifiers 13620 * @inner 13621 */ 13622 computeStyle: { 13623 /** @prop {number} order=850 - Index used to define the order of execution */ 13624 order: 850, 13625 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13626 enabled: true, 13627 /** @prop {ModifierFn} */ 13628 fn: computeStyle, 13629 /** 13630 * @prop {Boolean} gpuAcceleration=true 13631 * If true, it uses the CSS 3D transformation to position the popper. 13632 * Otherwise, it will use the `top` and `left` properties 13633 */ 13634 gpuAcceleration: true, 13635 /** 13636 * @prop {string} [x='bottom'] 13637 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 13638 * Change this if your popper should grow in a direction different from `bottom` 13639 */ 13640 x: 'bottom', 13641 /** 13642 * @prop {string} [x='left'] 13643 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 13644 * Change this if your popper should grow in a direction different from `right` 13645 */ 13646 y: 'right' 13647 }, 13648 13649 /** 13650 * Applies the computed styles to the popper element. 13651 * 13652 * All the DOM manipulations are limited to this modifier. This is useful in case 13653 * you want to integrate Popper.js inside a framework or view library and you 13654 * want to delegate all the DOM manipulations to it. 13655 * 13656 * Note that if you disable this modifier, you must make sure the popper element 13657 * has its position set to `absolute` before Popper.js can do its work! 13658 * 13659 * Just disable this modifier and define your own to achieve the desired effect. 13660 * 13661 * @memberof modifiers 13662 * @inner 13663 */ 13664 applyStyle: { 13665 /** @prop {number} order=900 - Index used to define the order of execution */ 13666 order: 900, 13667 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 13668 enabled: true, 13669 /** @prop {ModifierFn} */ 13670 fn: applyStyle, 13671 /** @prop {Function} */ 13672 onLoad: applyStyleOnLoad, 13673 /** 13674 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 13675 * @prop {Boolean} gpuAcceleration=true 13676 * If true, it uses the CSS 3D transformation to position the popper. 13677 * Otherwise, it will use the `top` and `left` properties 13678 */ 13679 gpuAcceleration: undefined 13680 } 13681 }; 13682 13683 /** 13684 * The `dataObject` is an object containing all the information used by Popper.js. 13685 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 13686 * @name dataObject 13687 * @property {Object} data.instance The Popper.js instance 13688 * @property {String} data.placement Placement applied to popper 13689 * @property {String} data.originalPlacement Placement originally defined on init 13690 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 13691 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 13692 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 13693 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 13694 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 13695 * @property {Object} data.boundaries Offsets of the popper boundaries 13696 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 13697 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 13698 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 13699 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 13700 */ 13701 13702 /** 13703 * Default options provided to Popper.js constructor.<br /> 13704 * These can be overridden using the `options` argument of Popper.js.<br /> 13705 * To override an option, simply pass an object with the same 13706 * structure of the `options` object, as the 3rd argument. For example: 13707 * ``` 13708 * new Popper(ref, pop, { 13709 * modifiers: { 13710 * preventOverflow: { enabled: false } 13711 * } 13712 * }) 13713 * ``` 13714 * @type {Object} 13715 * @static 13716 * @memberof Popper 13717 */ 13718 var Defaults = { 13719 /** 13720 * Popper's placement. 13721 * @prop {Popper.placements} placement='bottom' 13722 */ 13723 placement: 'bottom', 13724 13725 /** 13726 * Set this to true if you want popper to position it self in 'fixed' mode 13727 * @prop {Boolean} positionFixed=false 13728 */ 13729 positionFixed: false, 13730 13731 /** 13732 * Whether events (resize, scroll) are initially enabled. 13733 * @prop {Boolean} eventsEnabled=true 13734 */ 13735 eventsEnabled: true, 13736 13737 /** 13738 * Set to true if you want to automatically remove the popper when 13739 * you call the `destroy` method. 13740 * @prop {Boolean} removeOnDestroy=false 13741 */ 13742 removeOnDestroy: false, 13743 13744 /** 13745 * Callback called when the popper is created.<br /> 13746 * By default, it is set to no-op.<br /> 13747 * Access Popper.js instance with `data.instance`. 13748 * @prop {onCreate} 13749 */ 13750 onCreate: function onCreate() {}, 13751 13752 /** 13753 * Callback called when the popper is updated. This callback is not called 13754 * on the initialization/creation of the popper, but only on subsequent 13755 * updates.<br /> 13756 * By default, it is set to no-op.<br /> 13757 * Access Popper.js instance with `data.instance`. 13758 * @prop {onUpdate} 13759 */ 13760 onUpdate: function onUpdate() {}, 13761 13762 /** 13763 * List of modifiers used to modify the offsets before they are applied to the popper. 13764 * They provide most of the functionalities of Popper.js. 13765 * @prop {modifiers} 13766 */ 13767 modifiers: modifiers 13768 }; 13769 13770 /** 13771 * @callback onCreate 13772 * @param {dataObject} data 13773 */ 13774 13775 /** 13776 * @callback onUpdate 13777 * @param {dataObject} data 13778 */ 13779 13780 // Utils 13781 // Methods 13782 var Popper = function () { 13783 /** 13784 * Creates a new Popper.js instance. 13785 * @class Popper 13786 * @param {Element|referenceObject} reference - The reference element used to position the popper 13787 * @param {Element} popper - The HTML / XML element used as the popper 13788 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 13789 * @return {Object} instance - The generated Popper.js instance 13790 */ 13791 function Popper(reference, popper) { 13792 var _this = this; 13793 13794 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 13795 classCallCheck(this, Popper); 13796 13797 this.scheduleUpdate = function () { 13798 return requestAnimationFrame(_this.update); 13799 }; 13800 13801 // make update() debounced, so that it only runs at most once-per-tick 13802 this.update = debounce(this.update.bind(this)); 13803 13804 // with {} we create a new object with the options inside it 13805 this.options = _extends({}, Popper.Defaults, options); 13806 13807 // init state 13808 this.state = { 13809 isDestroyed: false, 13810 isCreated: false, 13811 scrollParents: [] 13812 }; 13813 13814 // get reference and popper elements (allow jQuery wrappers) 13815 this.reference = reference && reference.jquery ? reference[0] : reference; 13816 this.popper = popper && popper.jquery ? popper[0] : popper; 13817 13818 // Deep merge modifiers options 13819 this.options.modifiers = {}; 13820 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 13821 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 13822 }); 13823 13824 // Refactoring modifiers' list (Object => Array) 13825 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 13826 return _extends({ 13827 name: name 13828 }, _this.options.modifiers[name]); 13829 }) 13830 // sort the modifiers by order 13831 .sort(function (a, b) { 13832 return a.order - b.order; 13833 }); 13834 13835 // modifiers have the ability to execute arbitrary code when Popper.js get inited 13836 // such code is executed in the same order of its modifier 13837 // they could add new properties to their options configuration 13838 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 13839 this.modifiers.forEach(function (modifierOptions) { 13840 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 13841 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 13842 } 13843 }); 13844 13845 // fire the first update to position the popper in the right place 13846 this.update(); 13847 13848 var eventsEnabled = this.options.eventsEnabled; 13849 if (eventsEnabled) { 13850 // setup event listeners, they will take care of update the position in specific situations 13851 this.enableEventListeners(); 13852 } 13853 13854 this.state.eventsEnabled = eventsEnabled; 13855 } 13856 13857 // We can't use class properties because they don't get listed in the 13858 // class prototype and break stuff like Sinon stubs 13859 13860 13861 createClass(Popper, [{ 13862 key: 'update', 13863 value: function update$$1() { 13864 return update.call(this); 13865 } 13866 }, { 13867 key: 'destroy', 13868 value: function destroy$$1() { 13869 return destroy.call(this); 13870 } 13871 }, { 13872 key: 'enableEventListeners', 13873 value: function enableEventListeners$$1() { 13874 return enableEventListeners.call(this); 13875 } 13876 }, { 13877 key: 'disableEventListeners', 13878 value: function disableEventListeners$$1() { 13879 return disableEventListeners.call(this); 13880 } 13881 13882 /** 13883 * Schedules an update. It will run on the next UI update available. 13884 * @method scheduleUpdate 13885 * @memberof Popper 13886 */ 13887 13888 13889 /** 13890 * Collection of utilities useful when writing custom modifiers. 13891 * Starting from version 1.7, this method is available only if you 13892 * include `popper-utils.js` before `popper.js`. 13893 * 13894 * **DEPRECATION**: This way to access PopperUtils is deprecated 13895 * and will be removed in v2! Use the PopperUtils module directly instead. 13896 * Due to the high instability of the methods contained in Utils, we can't 13897 * guarantee them to follow semver. Use them at your own risk! 13898 * @static 13899 * @private 13900 * @type {Object} 13901 * @deprecated since version 1.8 13902 * @member Utils 13903 * @memberof Popper 13904 */ 13905 13906 }]); 13907 return Popper; 13908 }(); 13909 13910 /** 13911 * The `referenceObject` is an object that provides an interface compatible with Popper.js 13912 * and lets you use it as replacement of a real DOM node.<br /> 13913 * You can use this method to position a popper relatively to a set of coordinates 13914 * in case you don't have a DOM node to use as reference. 13915 * 13916 * ``` 13917 * new Popper(referenceObject, popperNode); 13918 * ``` 13919 * 13920 * NB: This feature isn't supported in Internet Explorer 10. 13921 * @name referenceObject 13922 * @property {Function} data.getBoundingClientRect 13923 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 13924 * @property {number} data.clientWidth 13925 * An ES6 getter that will return the width of the virtual reference element. 13926 * @property {number} data.clientHeight 13927 * An ES6 getter that will return the height of the virtual reference element. 13928 */ 13929 13930 13931 Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 13932 Popper.placements = placements; 13933 Popper.Defaults = Defaults; 13934 13935 var Popper$1 = Popper; 13936 13937 /** 13938 * Constants 13939 */ 13940 13941 var NAME$6 = 'dropdown'; 13942 var VERSION$6 = '4.6.2'; 13943 var DATA_KEY$6 = 'bs.dropdown'; 13944 var EVENT_KEY$6 = "." + DATA_KEY$6; 13945 var DATA_API_KEY$3 = '.data-api'; 13946 var JQUERY_NO_CONFLICT$6 = $__default["default"].fn[NAME$6]; 13947 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 13948 13949 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 13950 13951 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 13952 13953 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 13954 13955 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 13956 13957 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 13958 13959 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE$1); 13960 var CLASS_NAME_DISABLED$1 = 'disabled'; 13961 var CLASS_NAME_SHOW$5 = 'show'; 13962 var CLASS_NAME_DROPUP = 'dropup'; 13963 var CLASS_NAME_DROPRIGHT = 'dropright'; 13964 var CLASS_NAME_DROPLEFT = 'dropleft'; 13965 var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; 13966 var CLASS_NAME_POSITION_STATIC = 'position-static'; 13967 var EVENT_HIDE$3 = "hide" + EVENT_KEY$6; 13968 var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$6; 13969 var EVENT_SHOW$3 = "show" + EVENT_KEY$6; 13970 var EVENT_SHOWN$3 = "shown" + EVENT_KEY$6; 13971 var EVENT_CLICK = "click" + EVENT_KEY$6; 13972 var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$6 + DATA_API_KEY$3; 13973 var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$6 + DATA_API_KEY$3; 13974 var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$6 + DATA_API_KEY$3; 13975 var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; 13976 var SELECTOR_FORM_CHILD = '.dropdown form'; 13977 var SELECTOR_MENU = '.dropdown-menu'; 13978 var SELECTOR_NAVBAR_NAV = '.navbar-nav'; 13979 var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 13980 var PLACEMENT_TOP = 'top-start'; 13981 var PLACEMENT_TOPEND = 'top-end'; 13982 var PLACEMENT_BOTTOM = 'bottom-start'; 13983 var PLACEMENT_BOTTOMEND = 'bottom-end'; 13984 var PLACEMENT_RIGHT = 'right-start'; 13985 var PLACEMENT_LEFT = 'left-start'; 13986 var Default$5 = { 13987 offset: 0, 13988 flip: true, 13989 boundary: 'scrollParent', 13990 reference: 'toggle', 13991 display: 'dynamic', 13992 popperConfig: null 13993 }; 13994 var DefaultType$5 = { 13995 offset: '(number|string|function)', 13996 flip: 'boolean', 13997 boundary: '(string|element)', 13998 reference: '(string|element)', 13999 display: 'string', 14000 popperConfig: '(null|object)' 14001 }; 14002 /** 14003 * Class definition 14004 */ 14005 14006 var Dropdown = /*#__PURE__*/function () { 14007 function Dropdown(element, config) { 14008 this._element = element; 14009 this._popper = null; 14010 this._config = this._getConfig(config); 14011 this._menu = this._getMenuElement(); 14012 this._inNavbar = this._detectNavbar(); 14013 14014 this._addEventListeners(); 14015 } // Getters 14016 14017 14018 var _proto = Dropdown.prototype; 14019 14020 // Public 14021 _proto.toggle = function toggle() { 14022 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1)) { 14023 return; 14024 } 14025 14026 var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5); 14027 14028 Dropdown._clearMenus(); 14029 14030 if (isActive) { 14031 return; 14032 } 14033 14034 this.show(true); 14035 }; 14036 14037 _proto.show = function show(usePopper) { 14038 if (usePopper === void 0) { 14039 usePopper = false; 14040 } 14041 14042 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 14043 return; 14044 } 14045 14046 var relatedTarget = { 14047 relatedTarget: this._element 14048 }; 14049 var showEvent = $__default["default"].Event(EVENT_SHOW$3, relatedTarget); 14050 14051 var parent = Dropdown._getParentFromElement(this._element); 14052 14053 $__default["default"](parent).trigger(showEvent); 14054 14055 if (showEvent.isDefaultPrevented()) { 14056 return; 14057 } // Totally disable Popper for Dropdowns in Navbar 14058 14059 14060 if (!this._inNavbar && usePopper) { 14061 // Check for Popper dependency 14062 if (typeof Popper$1 === 'undefined') { 14063 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); 14064 } 14065 14066 var referenceElement = this._element; 14067 14068 if (this._config.reference === 'parent') { 14069 referenceElement = parent; 14070 } else if (Util.isElement(this._config.reference)) { 14071 referenceElement = this._config.reference; // Check if it's jQuery element 14072 14073 if (typeof this._config.reference.jquery !== 'undefined') { 14074 referenceElement = this._config.reference[0]; 14075 } 14076 } // If boundary is not `scrollParent`, then set position to `static` 14077 // to allow the menu to "escape" the scroll parent's boundaries 14078 // https://github.com/twbs/bootstrap/issues/24251 14079 14080 14081 if (this._config.boundary !== 'scrollParent') { 14082 $__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC); 14083 } 14084 14085 this._popper = new Popper$1(referenceElement, this._menu, this._getPopperConfig()); 14086 } // If this is a touch-enabled device we add extra 14087 // empty mouseover listeners to the body's immediate children; 14088 // only needed because of broken event delegation on iOS 14089 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 14090 14091 14092 if ('ontouchstart' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { 14093 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 14094 } 14095 14096 this._element.focus(); 14097 14098 this._element.setAttribute('aria-expanded', true); 14099 14100 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 14101 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_SHOWN$3, relatedTarget)); 14102 }; 14103 14104 _proto.hide = function hide() { 14105 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 14106 return; 14107 } 14108 14109 var relatedTarget = { 14110 relatedTarget: this._element 14111 }; 14112 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 14113 14114 var parent = Dropdown._getParentFromElement(this._element); 14115 14116 $__default["default"](parent).trigger(hideEvent); 14117 14118 if (hideEvent.isDefaultPrevented()) { 14119 return; 14120 } 14121 14122 if (this._popper) { 14123 this._popper.destroy(); 14124 } 14125 14126 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 14127 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 14128 }; 14129 14130 _proto.dispose = function dispose() { 14131 $__default["default"].removeData(this._element, DATA_KEY$6); 14132 $__default["default"](this._element).off(EVENT_KEY$6); 14133 this._element = null; 14134 this._menu = null; 14135 14136 if (this._popper !== null) { 14137 this._popper.destroy(); 14138 14139 this._popper = null; 14140 } 14141 }; 14142 14143 _proto.update = function update() { 14144 this._inNavbar = this._detectNavbar(); 14145 14146 if (this._popper !== null) { 14147 this._popper.scheduleUpdate(); 14148 } 14149 } // Private 14150 ; 14151 14152 _proto._addEventListeners = function _addEventListeners() { 14153 var _this = this; 14154 14155 $__default["default"](this._element).on(EVENT_CLICK, function (event) { 14156 event.preventDefault(); 14157 event.stopPropagation(); 14158 14159 _this.toggle(); 14160 }); 14161 }; 14162 14163 _proto._getConfig = function _getConfig(config) { 14164 config = _extends$1({}, this.constructor.Default, $__default["default"](this._element).data(), config); 14165 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 14166 return config; 14167 }; 14168 14169 _proto._getMenuElement = function _getMenuElement() { 14170 if (!this._menu) { 14171 var parent = Dropdown._getParentFromElement(this._element); 14172 14173 if (parent) { 14174 this._menu = parent.querySelector(SELECTOR_MENU); 14175 } 14176 } 14177 14178 return this._menu; 14179 }; 14180 14181 _proto._getPlacement = function _getPlacement() { 14182 var $parentDropdown = $__default["default"](this._element.parentNode); 14183 var placement = PLACEMENT_BOTTOM; // Handle dropup 14184 14185 if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { 14186 placement = $__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; 14187 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { 14188 placement = PLACEMENT_RIGHT; 14189 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { 14190 placement = PLACEMENT_LEFT; 14191 } else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) { 14192 placement = PLACEMENT_BOTTOMEND; 14193 } 14194 14195 return placement; 14196 }; 14197 14198 _proto._detectNavbar = function _detectNavbar() { 14199 return $__default["default"](this._element).closest('.navbar').length > 0; 14200 }; 14201 14202 _proto._getOffset = function _getOffset() { 14203 var _this2 = this; 14204 14205 var offset = {}; 14206 14207 if (typeof this._config.offset === 'function') { 14208 offset.fn = function (data) { 14209 data.offsets = _extends$1({}, data.offsets, _this2._config.offset(data.offsets, _this2._element)); 14210 return data; 14211 }; 14212 } else { 14213 offset.offset = this._config.offset; 14214 } 14215 14216 return offset; 14217 }; 14218 14219 _proto._getPopperConfig = function _getPopperConfig() { 14220 var popperConfig = { 14221 placement: this._getPlacement(), 14222 modifiers: { 14223 offset: this._getOffset(), 14224 flip: { 14225 enabled: this._config.flip 14226 }, 14227 preventOverflow: { 14228 boundariesElement: this._config.boundary 14229 } 14230 } 14231 }; // Disable Popper if we have a static display 14232 14233 if (this._config.display === 'static') { 14234 popperConfig.modifiers.applyStyle = { 14235 enabled: false 14236 }; 14237 } 14238 14239 return _extends$1({}, popperConfig, this._config.popperConfig); 14240 } // Static 14241 ; 14242 14243 Dropdown._jQueryInterface = function _jQueryInterface(config) { 14244 return this.each(function () { 14245 var data = $__default["default"](this).data(DATA_KEY$6); 14246 14247 var _config = typeof config === 'object' ? config : null; 14248 14249 if (!data) { 14250 data = new Dropdown(this, _config); 14251 $__default["default"](this).data(DATA_KEY$6, data); 14252 } 14253 14254 if (typeof config === 'string') { 14255 if (typeof data[config] === 'undefined') { 14256 throw new TypeError("No method named \"" + config + "\""); 14257 } 14258 14259 data[config](); 14260 } 14261 }); 14262 }; 14263 14264 Dropdown._clearMenus = function _clearMenus(event) { 14265 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 14266 return; 14267 } 14268 14269 var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); 14270 14271 for (var i = 0, len = toggles.length; i < len; i++) { 14272 var parent = Dropdown._getParentFromElement(toggles[i]); 14273 14274 var context = $__default["default"](toggles[i]).data(DATA_KEY$6); 14275 var relatedTarget = { 14276 relatedTarget: toggles[i] 14277 }; 14278 14279 if (event && event.type === 'click') { 14280 relatedTarget.clickEvent = event; 14281 } 14282 14283 if (!context) { 14284 continue; 14285 } 14286 14287 var dropdownMenu = context._menu; 14288 14289 if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW$5)) { 14290 continue; 14291 } 14292 14293 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) { 14294 continue; 14295 } 14296 14297 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 14298 $__default["default"](parent).trigger(hideEvent); 14299 14300 if (hideEvent.isDefaultPrevented()) { 14301 continue; 14302 } // If this is a touch-enabled device we remove the extra 14303 // empty mouseover listeners we added for iOS support 14304 14305 14306 if ('ontouchstart' in document.documentElement) { 14307 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 14308 } 14309 14310 toggles[i].setAttribute('aria-expanded', 'false'); 14311 14312 if (context._popper) { 14313 context._popper.destroy(); 14314 } 14315 14316 $__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW$5); 14317 $__default["default"](parent).removeClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 14318 } 14319 }; 14320 14321 Dropdown._getParentFromElement = function _getParentFromElement(element) { 14322 var parent; 14323 var selector = Util.getSelectorFromElement(element); 14324 14325 if (selector) { 14326 parent = document.querySelector(selector); 14327 } 14328 14329 return parent || element.parentNode; 14330 } // eslint-disable-next-line complexity 14331 ; 14332 14333 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 14334 // If not input/textarea: 14335 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 14336 // If input/textarea: 14337 // - If space key => not a dropdown command 14338 // - If key is other than escape 14339 // - If key is not up or down => not a dropdown command 14340 // - If trigger inside the menu =>
vendor: 5,113 bytes, lines 14340-14499
14340 not a dropdown command 14341 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE$1 && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 14342 return; 14343 } 14344 14345 if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED$1)) { 14346 return; 14347 } 14348 14349 var parent = Dropdown._getParentFromElement(this); 14350 14351 var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW$5); 14352 14353 if (!isActive && event.which === ESCAPE_KEYCODE$1) { 14354 return; 14355 } 14356 14357 event.preventDefault(); 14358 event.stopPropagation(); 14359 14360 if (!isActive || event.which === ESCAPE_KEYCODE$1 || event.which === SPACE_KEYCODE) { 14361 if (event.which === ESCAPE_KEYCODE$1) { 14362 $__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); 14363 } 14364 14365 $__default["default"](this).trigger('click'); 14366 return; 14367 } 14368 14369 var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { 14370 return $__default["default"](item).is(':visible'); 14371 }); 14372 14373 if (items.length === 0) { 14374 return; 14375 } 14376 14377 var index = items.indexOf(event.target); 14378 14379 if (event.which === ARROW_UP_KEYCODE && index > 0) { 14380 // Up 14381 index--; 14382 } 14383 14384 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 14385 // Down 14386 index++; 14387 } 14388 14389 if (index < 0) { 14390 index = 0; 14391 } 14392 14393 items[index].focus(); 14394 }; 14395 14396 _createClass(Dropdown, null, [{ 14397 key: "VERSION", 14398 get: function get() { 14399 return VERSION$6; 14400 } 14401 }, { 14402 key: "Default", 14403 get: function get() { 14404 return Default$5; 14405 } 14406 }, { 14407 key: "DefaultType", 14408 get: function get() { 14409 return DefaultType$5; 14410 } 14411 }]); 14412 14413 return Dropdown; 14414 }(); 14415 /** 14416 * Data API implementation 14417 */ 14418 14419 14420 $__default["default"](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$2 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { 14421 event.preventDefault(); 14422 event.stopPropagation(); 14423 14424 Dropdown._jQueryInterface.call($__default["default"](this), 'toggle'); 14425 }).on(EVENT_CLICK_DATA_API$2, SELECTOR_FORM_CHILD, function (e) { 14426 e.stopPropagation(); 14427 }); 14428 /** 14429 * jQuery 14430 */ 14431 14432 $__default["default"].fn[NAME$6] = Dropdown._jQueryInterface; 14433 $__default["default"].fn[NAME$6].Constructor = Dropdown; 14434 14435 $__default["default"].fn[NAME$6].noConflict = function () { 14436 $__default["default"].fn[NAME$6] = JQUERY_NO_CONFLICT$6; 14437 return Dropdown._jQueryInterface; 14438 }; 14439 14440 /** 14441 * Constants 14442 */ 14443 14444 var NAME$5 = 'modal'; 14445 var VERSION$5 = '4.6.2'; 14446 var DATA_KEY$5 = 'bs.modal'; 14447 var EVENT_KEY$5 = "." + DATA_KEY$5; 14448 var DATA_API_KEY$2 = '.data-api'; 14449 var JQUERY_NO_CONFLICT$5 = $__default["default"].fn[NAME$5]; 14450 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 14451 14452 var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; 14453 var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; 14454 var CLASS_NAME_BACKDROP = 'modal-backdrop'; 14455 var CLASS_NAME_OPEN = 'modal-open'; 14456 var CLASS_NAME_FADE$4 = 'fade'; 14457 var CLASS_NAME_SHOW$4 = 'show'; 14458 var CLASS_NAME_STATIC = 'modal-static'; 14459 var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; 14460 var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; 14461 var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; 14462 var EVENT_SHOW$2 = "show" + EVENT_KEY$5; 14463 var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; 14464 var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; 14465 var EVENT_RESIZE = "resize" + EVENT_KEY$5; 14466 var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$5; 14467 var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; 14468 var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; 14469 var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; 14470 var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$5 + DATA_API_KEY$2; 14471 var SELECTOR_DIALOG = '.modal-dialog'; 14472 var SELECTOR_MODAL_BODY = '.modal-body'; 14473 var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="modal"]'; 14474 var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="modal"]'; 14475 var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 14476 var SELECTOR_STICKY_CONTENT = '.sticky-top'; 14477 var Default$4 = { 14478 backdrop: true, 14479 keyboard: true, 14480 focus: true, 14481 show: true 14482 }; 14483 var DefaultType$4 = { 14484 backdrop: '(boolean|string)', 14485 keyboard: 'boolean', 14486 focus: 'boolean', 14487 show: 'boolean' 14488 }; 14489 /** 14490 * Class definition 14491 */ 14492 14493 var Modal = /*#__PURE__*/function () { 14494 function Modal(element, config) { 14495 this._config = this._getConfig(config); 14496 this._element = element; 14497 this._dialog = element.querySelector(SELECTOR_DIALOG); 14498 this._backdrop = null; 14499 this._isShown = false;
vendor: 6,712 bytes, lines 14500-14717
14500 this._isBodyOverflowing = false; 14501 this._ignoreBackdropClick = false; 14502 this._isTransitioning = false; 14503 this._scrollbarWidth = 0; 14504 } // Getters 14505 14506 14507 var _proto = Modal.prototype; 14508 14509 // Public 14510 _proto.toggle = function toggle(relatedTarget) { 14511 return this._isShown ? this.hide() : this.show(relatedTarget); 14512 }; 14513 14514 _proto.show = function show(relatedTarget) { 14515 var _this = this; 14516 14517 if (this._isShown || this._isTransitioning) { 14518 return; 14519 } 14520 14521 var showEvent = $__default["default"].Event(EVENT_SHOW$2, { 14522 relatedTarget: relatedTarget 14523 }); 14524 $__default["default"](this._element).trigger(showEvent); 14525 14526 if (showEvent.isDefaultPrevented()) { 14527 return; 14528 } 14529 14530 this._isShown = true; 14531 14532 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 14533 this._isTransitioning = true; 14534 } 14535 14536 this._checkScrollbar(); 14537 14538 this._setScrollbar(); 14539 14540 this._adjustDialog(); 14541 14542 this._setEscapeEvent(); 14543 14544 this._setResizeEvent(); 14545 14546 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function (event) { 14547 return _this.hide(event); 14548 }); 14549 $__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { 14550 $__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { 14551 if ($__default["default"](event.target).is(_this._element)) { 14552 _this._ignoreBackdropClick = true; 14553 } 14554 }); 14555 }); 14556 14557 this._showBackdrop(function () { 14558 return _this._showElement(relatedTarget); 14559 }); 14560 }; 14561 14562 _proto.hide = function hide(event) { 14563 var _this2 = this; 14564 14565 if (event) { 14566 event.preventDefault(); 14567 } 14568 14569 if (!this._isShown || this._isTransitioning) { 14570 return; 14571 } 14572 14573 var hideEvent = $__default["default"].Event(EVENT_HIDE$2); 14574 $__default["default"](this._element).trigger(hideEvent); 14575 14576 if (!this._isShown || hideEvent.isDefaultPrevented()) { 14577 return; 14578 } 14579 14580 this._isShown = false; 14581 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 14582 14583 if (transition) { 14584 this._isTransitioning = true; 14585 } 14586 14587 this._setEscapeEvent(); 14588 14589 this._setResizeEvent(); 14590 14591 $__default["default"](document).off(EVENT_FOCUSIN); 14592 $__default["default"](this._element).removeClass(CLASS_NAME_SHOW$4); 14593 $__default["default"](this._element).off(EVENT_CLICK_DISMISS$1); 14594 $__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS); 14595 14596 if (transition) { 14597 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 14598 $__default["default"](this._element).one(Util.TRANSITION_END, function (event) { 14599 return _this2._hideModal(event); 14600 }).emulateTransitionEnd(transitionDuration); 14601 } else { 14602 this._hideModal(); 14603 } 14604 }; 14605 14606 _proto.dispose = function dispose() { 14607 [window, this._element, this._dialog].forEach(function (htmlElement) { 14608 return $__default["default"](htmlElement).off(EVENT_KEY$5); 14609 }); 14610 /** 14611 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 14612 * Do not move `document` in `htmlElements` array 14613 * It will remove `EVENT_CLICK_DATA_API` event that should remain 14614 */ 14615 14616 $__default["default"](document).off(EVENT_FOCUSIN); 14617 $__default["default"].removeData(this._element, DATA_KEY$5); 14618 this._config = null; 14619 this._element = null; 14620 this._dialog = null; 14621 this._backdrop = null; 14622 this._isShown = null; 14623 this._isBodyOverflowing = null; 14624 this._ignoreBackdropClick = null; 14625 this._isTransitioning = null; 14626 this._scrollbarWidth = null; 14627 }; 14628 14629 _proto.handleUpdate = function handleUpdate() { 14630 this._adjustDialog(); 14631 } // Private 14632 ; 14633 14634 _proto._getConfig = function _getConfig(config) { 14635 config = _extends$1({}, Default$4, config); 14636 Util.typeCheckConfig(NAME$5, config, DefaultType$4); 14637 return config; 14638 }; 14639 14640 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 14641 var _this3 = this; 14642 14643 var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED); 14644 $__default["default"](this._element).trigger(hideEventPrevented); 14645 14646 if (hideEventPrevented.isDefaultPrevented()) { 14647 return; 14648 } 14649 14650 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 14651 14652 if (!isModalOverflowing) { 14653 this._element.style.overflowY = 'hidden'; 14654 } 14655 14656 this._element.classList.add(CLASS_NAME_STATIC); 14657 14658 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog); 14659 $__default["default"](this._element).off(Util.TRANSITION_END); 14660 $__default["default"](this._element).one(Util.TRANSITION_END, function () { 14661 _this3._element.classList.remove(CLASS_NAME_STATIC); 14662 14663 if (!isModalOverflowing) { 14664 $__default["default"](_this3._element).one(Util.TRANSITION_END, function () { 14665 _this3._element.style.overflowY = ''; 14666 }).emulateTransitionEnd(_this3._element, modalTransitionDuration); 14667 } 14668 }).emulateTransitionEnd(modalTransitionDuration); 14669 14670 this._element.focus(); 14671 }; 14672 14673 _proto._showElement = function _showElement(relatedTarget) { 14674 var _this4 = this; 14675 14676 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 14677 var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; 14678 14679 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 14680 // Don't move modal's DOM position 14681 document.body.appendChild(this._element); 14682 } 14683 14684 this._element.style.display = 'block'; 14685 14686 this._element.removeAttribute('aria-hidden'); 14687 14688 this._element.setAttribute('aria-modal', true); 14689 14690 this._element.setAttribute('role', 'dialog'); 14691 14692 if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { 14693 modalBody.scrollTop = 0; 14694 } else { 14695 this._element.scrollTop = 0; 14696 } 14697 14698 if (transition) { 14699 Util.reflow(this._element); 14700 } 14701 14702 $__default["default"](this._element).addClass(CLASS_NAME_SHOW$4); 14703 14704 if (this._config.focus) { 14705 this._enforceFocus(); 14706 } 14707 14708 var shownEvent = $__default["default"].Event(EVENT_SHOWN$2, { 14709 relatedTarget: relatedTarget 14710 }); 14711 14712 var transitionComplete = function transitionComplete() { 14713 if (_this4._config.focus) { 14714 _this4._element.focus(); 14715 } 14716 14717 _this4._isTransitioning = false;
vendor: 5,075 bytes, lines 14718-14875
14718 $__default["default"](_this4._element).trigger(shownEvent); 14719 }; 14720 14721 if (transition) { 14722 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 14723 $__default["default"](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 14724 } else { 14725 transitionComplete(); 14726 } 14727 }; 14728 14729 _proto._enforceFocus = function _enforceFocus() { 14730 var _this5 = this; 14731 14732 $__default["default"](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop 14733 .on(EVENT_FOCUSIN, function (event) { 14734 if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) { 14735 _this5._element.focus(); 14736 } 14737 }); 14738 }; 14739 14740 _proto._setEscapeEvent = function _setEscapeEvent() { 14741 var _this6 = this; 14742 14743 if (this._isShown) { 14744 $__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { 14745 if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 14746 event.preventDefault(); 14747 14748 _this6.hide(); 14749 } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 14750 _this6._triggerBackdropTransition(); 14751 } 14752 }); 14753 } else if (!this._isShown) { 14754 $__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS); 14755 } 14756 }; 14757 14758 _proto._setResizeEvent = function _setResizeEvent() { 14759 var _this7 = this; 14760 14761 if (this._isShown) { 14762 $__default["default"](window).on(EVENT_RESIZE, function (event) { 14763 return _this7.handleUpdate(event); 14764 }); 14765 } else { 14766 $__default["default"](window).off(EVENT_RESIZE); 14767 } 14768 }; 14769 14770 _proto._hideModal = function _hideModal() { 14771 var _this8 = this; 14772 14773 this._element.style.display = 'none'; 14774 14775 this._element.setAttribute('aria-hidden', true); 14776 14777 this._element.removeAttribute('aria-modal'); 14778 14779 this._element.removeAttribute('role'); 14780 14781 this._isTransitioning = false; 14782 14783 this._showBackdrop(function () { 14784 $__default["default"](document.body).removeClass(CLASS_NAME_OPEN); 14785 14786 _this8._resetAdjustments(); 14787 14788 _this8._resetScrollbar(); 14789 14790 $__default["default"](_this8._element).trigger(EVENT_HIDDEN$2); 14791 }); 14792 }; 14793 14794 _proto._removeBackdrop = function _removeBackdrop() { 14795 if (this._backdrop) { 14796 $__default["default"](this._backdrop).remove(); 14797 this._backdrop = null; 14798 } 14799 }; 14800 14801 _proto._showBackdrop = function _showBackdrop(callback) { 14802 var _this9 = this; 14803 14804 var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4) ? CLASS_NAME_FADE$4 : ''; 14805 14806 if (this._isShown && this._config.backdrop) { 14807 this._backdrop = document.createElement('div'); 14808 this._backdrop.className = CLASS_NAME_BACKDROP; 14809 14810 if (animate) { 14811 this._backdrop.classList.add(animate); 14812 } 14813 14814 $__default["default"](this._backdrop).appendTo(document.body); 14815 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, function (event) { 14816 if (_this9._ignoreBackdropClick) { 14817 _this9._ignoreBackdropClick = false; 14818 return; 14819 } 14820 14821 if (event.target !== event.currentTarget) { 14822 return; 14823 } 14824 14825 if (_this9._config.backdrop === 'static') { 14826 _this9._triggerBackdropTransition(); 14827 } else { 14828 _this9.hide(); 14829 } 14830 }); 14831 14832 if (animate) { 14833 Util.reflow(this._backdrop); 14834 } 14835 14836 $__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW$4); 14837 14838 if (!callback) { 14839 return; 14840 } 14841 14842 if (!animate) { 14843 callback(); 14844 return; 14845 } 14846 14847 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 14848 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 14849 } else if (!this._isShown && this._backdrop) { 14850 $__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW$4); 14851 14852 var callbackRemove = function callbackRemove() { 14853 _this9._removeBackdrop(); 14854 14855 if (callback) { 14856 callback(); 14857 } 14858 }; 14859 14860 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 14861 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 14862 14863 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 14864 } else { 14865 callbackRemove(); 14866 } 14867 } else if (callback) { 14868 callback(); 14869 } 14870 } // ---------------------------------------------------------------------- 14871 // the following methods are used to handle overflowing modals 14872 // todo (fat): these should probably be refactored out of modal.js 14873 // ---------------------------------------------------------------------- 14874 ; 14875
vendor: 13,480 bytes, lines 14876-15281
14876 _proto._adjustDialog = function _adjustDialog() { 14877 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 14878 14879 if (!this._isBodyOverflowing && isModalOverflowing) { 14880 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 14881 } 14882 14883 if (this._isBodyOverflowing && !isModalOverflowing) { 14884 this._element.style.paddingRight = this._scrollbarWidth + "px"; 14885 } 14886 }; 14887 14888 _proto._resetAdjustments = function _resetAdjustments() { 14889 this._element.style.paddingLeft = ''; 14890 this._element.style.paddingRight = ''; 14891 }; 14892 14893 _proto._checkScrollbar = function _checkScrollbar() { 14894 var rect = document.body.getBoundingClientRect(); 14895 this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; 14896 this._scrollbarWidth = this._getScrollbarWidth(); 14897 }; 14898 14899 _proto._setScrollbar = function _setScrollbar() { 14900 var _this10 = this; 14901 14902 if (this._isBodyOverflowing) { 14903 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 14904 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 14905 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 14906 var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding 14907 14908 $__default["default"](fixedContent).each(function (index, element) { 14909 var actualPadding = element.style.paddingRight; 14910 var calculatedPadding = $__default["default"](element).css('padding-right'); 14911 $__default["default"](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 14912 }); // Adjust sticky content margin 14913 14914 $__default["default"](stickyContent).each(function (index, element) { 14915 var actualMargin = element.style.marginRight; 14916 var calculatedMargin = $__default["default"](element).css('margin-right'); 14917 $__default["default"](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 14918 }); // Adjust body padding 14919 14920 var actualPadding = document.body.style.paddingRight; 14921 var calculatedPadding = $__default["default"](document.body).css('padding-right'); 14922 $__default["default"](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 14923 } 14924 14925 $__default["default"](document.body).addClass(CLASS_NAME_OPEN); 14926 }; 14927 14928 _proto._resetScrollbar = function _resetScrollbar() { 14929 // Restore fixed content padding 14930 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 14931 $__default["default"](fixedContent).each(function (index, element) { 14932 var padding = $__default["default"](element).data('padding-right'); 14933 $__default["default"](element).removeData('padding-right'); 14934 element.style.paddingRight = padding ? padding : ''; 14935 }); // Restore sticky content 14936 14937 var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); 14938 $__default["default"](elements).each(function (index, element) { 14939 var margin = $__default["default"](element).data('margin-right'); 14940 14941 if (typeof margin !== 'undefined') { 14942 $__default["default"](element).css('margin-right', margin).removeData('margin-right'); 14943 } 14944 }); // Restore body padding 14945 14946 var padding = $__default["default"](document.body).data('padding-right'); 14947 $__default["default"](document.body).removeData('padding-right'); 14948 document.body.style.paddingRight = padding ? padding : ''; 14949 }; 14950 14951 _proto._getScrollbarWidth = function _getScrollbarWidth() { 14952 // thx d.walsh 14953 var scrollDiv = document.createElement('div'); 14954 scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; 14955 document.body.appendChild(scrollDiv); 14956 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 14957 document.body.removeChild(scrollDiv); 14958 return scrollbarWidth; 14959 } // Static 14960 ; 14961 14962 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 14963 return this.each(function () { 14964 var data = $__default["default"](this).data(DATA_KEY$5); 14965 14966 var _config = _extends$1({}, Default$4, $__default["default"](this).data(), typeof config === 'object' && config ? config : {}); 14967 14968 if (!data) { 14969 data = new Modal(this, _config); 14970 $__default["default"](this).data(DATA_KEY$5, data); 14971 } 14972 14973 if (typeof config === 'string') { 14974 if (typeof data[config] === 'undefined') { 14975 throw new TypeError("No method named \"" + config + "\""); 14976 } 14977 14978 data[config](relatedTarget); 14979 } else if (_config.show) { 14980 data.show(relatedTarget); 14981 } 14982 }); 14983 }; 14984 14985 _createClass(Modal, null, [{ 14986 key: "VERSION", 14987 get: function get() { 14988 return VERSION$5; 14989 } 14990 }, { 14991 key: "Default", 14992 get: function get() { 14993 return Default$4; 14994 } 14995 }]); 14996 14997 return Modal; 14998 }(); 14999 /** 15000 * Data API implementation 15001 */ 15002 15003 15004 $__default["default"](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { 15005 var _this11 = this; 15006 15007 var target; 15008 var selector = Util.getSelectorFromElement(this); 15009 15010 if (selector) { 15011 target = document.querySelector(selector); 15012 } 15013 15014 var config = $__default["default"](target).data(DATA_KEY$5) ? 'toggle' : _extends$1({}, $__default["default"](target).data(), $__default["default"](this).data()); 15015 15016 if (this.tagName === 'A' || this.tagName === 'AREA') { 15017 event.preventDefault(); 15018 } 15019 15020 var $target = $__default["default"](target).one(EVENT_SHOW$2, function (showEvent) { 15021 if (showEvent.isDefaultPrevented()) { 15022 // Only register focus restorer if modal will actually get shown 15023 return; 15024 } 15025 15026 $target.one(EVENT_HIDDEN$2, function () { 15027 if ($__default["default"](_this11).is(':visible')) { 15028 _this11.focus(); 15029 } 15030 }); 15031 }); 15032 15033 Modal._jQueryInterface.call($__default["default"](target), config, this); 15034 }); 15035 /** 15036 * jQuery 15037 */ 15038 15039 $__default["default"].fn[NAME$5] = Modal._jQueryInterface; 15040 $__default["default"].fn[NAME$5].Constructor = Modal; 15041 15042 $__default["default"].fn[NAME$5].noConflict = function () { 15043 $__default["default"].fn[NAME$5] = JQUERY_NO_CONFLICT$5; 15044 return Modal._jQueryInterface; 15045 }; 15046 15047 /** 15048 * -------------------------------------------------------------------------- 15049 * Bootstrap (v4.6.2): tools/sanitizer.js 15050 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 15051 * -------------------------------------------------------------------------- 15052 */ 15053 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 15054 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 15055 var DefaultWhitelist = { 15056 // Global attributes allowed on any supplied element below. 15057 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 15058 a: ['target', 'href', 'title', 'rel'], 15059 area: [], 15060 b: [], 15061 br: [], 15062 col: [], 15063 code: [], 15064 div: [], 15065 em: [], 15066 hr: [], 15067 h1: [], 15068 h2: [], 15069 h3: [], 15070 h4: [], 15071 h5: [], 15072 h6: [], 15073 i: [], 15074 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 15075 li: [], 15076 ol: [], 15077 p: [], 15078 pre: [], 15079 s: [], 15080 small: [], 15081 span: [], 15082 sub: [], 15083 sup: [], 15084 strong: [], 15085 u: [], 15086 ul: [] 15087 }; 15088 /** 15089 * A pattern that recognizes a commonly useful subset of URLs that are safe. 15090 * 15091 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 15092 */ 15093 15094 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; 15095 /** 15096 * A pattern that matches safe data URLs. Only matches image, video and audio types. 15097 * 15098 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 15099 */ 15100 15101 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 15102 15103 function allowedAttribute(attr, allowedAttributeList) { 15104 var attrName = attr.nodeName.toLowerCase(); 15105 15106 if (allowedAttributeList.indexOf(attrName) !== -1) { 15107 if (uriAttrs.indexOf(attrName) !== -1) { 15108 return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)); 15109 } 15110 15111 return true; 15112 } 15113 15114 var regExp = allowedAttributeList.filter(function (attrRegex) { 15115 return attrRegex instanceof RegExp; 15116 }); // Check if a regular expression validates the attribute. 15117 15118 for (var i = 0, len = regExp.length; i < len; i++) { 15119 if (regExp[i].test(attrName)) { 15120 return true; 15121 } 15122 } 15123 15124 return false; 15125 } 15126 15127 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 15128 if (unsafeHtml.length === 0) { 15129 return unsafeHtml; 15130 } 15131 15132 if (sanitizeFn && typeof sanitizeFn === 'function') { 15133 return sanitizeFn(unsafeHtml); 15134 } 15135 15136 var domParser = new window.DOMParser(); 15137 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 15138 var whitelistKeys = Object.keys(whiteList); 15139 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 15140 15141 var _loop = function _loop(i, len) { 15142 var el = elements[i]; 15143 var elName = el.nodeName.toLowerCase(); 15144 15145 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 15146 el.parentNode.removeChild(el); 15147 return "continue"; 15148 } 15149 15150 var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread 15151 15152 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 15153 attributeList.forEach(function (attr) { 15154 if (!allowedAttribute(attr, whitelistedAttributes)) { 15155 el.removeAttribute(attr.nodeName); 15156 } 15157 }); 15158 }; 15159 15160 for (var i = 0, len = elements.length; i < len; i++) { 15161 var _ret = _loop(i); 15162 15163 if (_ret === "continue") continue; 15164 } 15165 15166 return createdDocument.body.innerHTML; 15167 } 15168 15169 /** 15170 * Constants 15171 */ 15172 15173 var NAME$4 = 'tooltip'; 15174 var VERSION$4 = '4.6.2'; 15175 var DATA_KEY$4 = 'bs.tooltip'; 15176 var EVENT_KEY$4 = "." + DATA_KEY$4; 15177 var JQUERY_NO_CONFLICT$4 = $__default["default"].fn[NAME$4]; 15178 var CLASS_PREFIX$1 = 'bs-tooltip'; 15179 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 15180 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 15181 var CLASS_NAME_FADE$3 = 'fade'; 15182 var CLASS_NAME_SHOW$3 = 'show'; 15183 var HOVER_STATE_SHOW = 'show'; 15184 var HOVER_STATE_OUT = 'out'; 15185 var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 15186 var SELECTOR_ARROW = '.arrow'; 15187 var TRIGGER_HOVER = 'hover'; 15188 var TRIGGER_FOCUS = 'focus'; 15189 var TRIGGER_CLICK = 'click'; 15190 var TRIGGER_MANUAL = 'manual'; 15191 var AttachmentMap = { 15192 AUTO: 'auto', 15193 TOP: 'top', 15194 RIGHT: 'right', 15195 BOTTOM: 'bottom', 15196 LEFT: 'left' 15197 }; 15198 var Default$3 = { 15199 animation: true, 15200 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 15201 trigger: 'hover focus', 15202 title: '', 15203 delay: 0, 15204 html: false, 15205 selector: false, 15206 placement: 'top', 15207 offset: 0, 15208 container: false, 15209 fallbackPlacement: 'flip', 15210 boundary: 'scrollParent', 15211 customClass: '', 15212 sanitize: true, 15213 sanitizeFn: null, 15214 whiteList: DefaultWhitelist, 15215 popperConfig: null 15216 }; 15217 var DefaultType$3 = { 15218 animation: 'boolean', 15219 template: 'string', 15220 title: '(string|element|function)', 15221 trigger: 'string', 15222 delay: '(number|object)', 15223 html: 'boolean', 15224 selector: '(string|boolean)', 15225 placement: '(string|function)', 15226 offset: '(number|string|function)', 15227 container: '(string|element|boolean)', 15228 fallbackPlacement: '(string|array)', 15229 boundary: '(string|element)', 15230 customClass: '(string|function)', 15231 sanitize: 'boolean', 15232 sanitizeFn: '(null|function)', 15233 whiteList: 'object', 15234 popperConfig: '(null|object)' 15235 }; 15236 var Event$1 = { 15237 HIDE: "hide" + EVENT_KEY$4, 15238 HIDDEN: "hidden" + EVENT_KEY$4, 15239 SHOW: "show" + EVENT_KEY$4, 15240 SHOWN: "shown" + EVENT_KEY$4, 15241 INSERTED: "inserted" + EVENT_KEY$4, 15242 CLICK: "click" + EVENT_KEY$4, 15243 FOCUSIN: "focusin" + EVENT_KEY$4, 15244 FOCUSOUT: "focusout" + EVENT_KEY$4, 15245 MOUSEENTER: "mouseenter" + EVENT_KEY$4, 15246 MOUSELEAVE: "mouseleave" + EVENT_KEY$4 15247 }; 15248 /** 15249 * Class definition 15250 */ 15251 15252 var Tooltip = /*#__PURE__*/function () { 15253 function Tooltip(element, config) { 15254 if (typeof Popper$1 === 'undefined') { 15255 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); 15256 } // Private 15257 15258 15259 this._isEnabled = true; 15260 this._timeout = 0; 15261 this._hoverState = ''; 15262 this._activeTrigger = {}; 15263 this._popper = null; // Protected 15264 15265 this.element = element; 15266 this.config = this._getConfig(config); 15267 this.tip = null; 15268 15269 this._setListeners(); 15270 } // Getters 15271 15272 15273 var _proto = Tooltip.prototype; 15274 15275 // Public 15276 _proto.enable = function enable() { 15277 this._isEnabled = true; 15278 }; 15279 15280 _proto.disable = function disable() { 15281 this._isEnabled = false;
vendor: 2,532 bytes, lines 15282-15364
15282 }; 15283 15284 _proto.toggleEnabled = function toggleEnabled() { 15285 this._isEnabled = !this._isEnabled; 15286 }; 15287 15288 _proto.toggle = function toggle(event) { 15289 if (!this._isEnabled) { 15290 return; 15291 } 15292 15293 if (event) { 15294 var dataKey = this.constructor.DATA_KEY; 15295 var context = $__default["default"](event.currentTarget).data(dataKey); 15296 15297 if (!context) { 15298 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 15299 $__default["default"](event.currentTarget).data(dataKey, context); 15300 } 15301 15302 context._activeTrigger.click = !context._activeTrigger.click; 15303 15304 if (context._isWithActiveTrigger()) { 15305 context._enter(null, context); 15306 } else { 15307 context._leave(null, context); 15308 } 15309 } else { 15310 if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW$3)) { 15311 this._leave(null, this); 15312 15313 return; 15314 } 15315 15316 this._enter(null, this); 15317 } 15318 }; 15319 15320 _proto.dispose = function dispose() { 15321 clearTimeout(this._timeout); 15322 $__default["default"].removeData(this.element, this.constructor.DATA_KEY); 15323 $__default["default"](this.element).off(this.constructor.EVENT_KEY); 15324 $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 15325 15326 if (this.tip) { 15327 $__default["default"](this.tip).remove(); 15328 } 15329 15330 this._isEnabled = null; 15331 this._timeout = null; 15332 this._hoverState = null; 15333 this._activeTrigger = null; 15334 15335 if (this._popper) { 15336 this._popper.destroy(); 15337 } 15338 15339 this._popper = null; 15340 this.element = null; 15341 this.config = null; 15342 this.tip = null; 15343 }; 15344 15345 _proto.show = function show() { 15346 var _this = this; 15347 15348 if ($__default["default"](this.element).css('display') === 'none') { 15349 throw new Error('Please use show on visible elements'); 15350 } 15351 15352 var showEvent = $__default["default"].Event(this.constructor.Event.SHOW); 15353 15354 if (this.isWithContent() && this._isEnabled) { 15355 $__default["default"](this.element).trigger(showEvent); 15356 var shadowRoot = Util.findShadowRoot(this.element); 15357 var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 15358 15359 if (showEvent.isDefaultPrevented() || !isInTheDom) { 15360 return; 15361 } 15362 15363 var tip = this.getTipElement(); 15364 var tipId = Util.getUID(this.constructor.NAME);
vendor: 19,358 bytes, lines 15365-15991
15365 tip.setAttribute('id', tipId); 15366 this.element.setAttribute('aria-describedby', tipId); 15367 this.setContent(); 15368 15369 if (this.config.animation) { 15370 $__default["default"](tip).addClass(CLASS_NAME_FADE$3); 15371 } 15372 15373 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 15374 15375 var attachment = this._getAttachment(placement); 15376 15377 this.addAttachmentClass(attachment); 15378 15379 var container = this._getContainer(); 15380 15381 $__default["default"](tip).data(this.constructor.DATA_KEY, this); 15382 15383 if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) { 15384 $__default["default"](tip).appendTo(container); 15385 } 15386 15387 $__default["default"](this.element).trigger(this.constructor.Event.INSERTED); 15388 this._popper = new Popper$1(this.element, tip, this._getPopperConfig(attachment)); 15389 $__default["default"](tip).addClass(CLASS_NAME_SHOW$3); 15390 $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra 15391 // empty mouseover listeners to the body's immediate children; 15392 // only needed because of broken event delegation on iOS 15393 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 15394 15395 if ('ontouchstart' in document.documentElement) { 15396 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 15397 } 15398 15399 var complete = function complete() { 15400 if (_this.config.animation) { 15401 _this._fixTransition(); 15402 } 15403 15404 var prevHoverState = _this._hoverState; 15405 _this._hoverState = null; 15406 $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN); 15407 15408 if (prevHoverState === HOVER_STATE_OUT) { 15409 _this._leave(null, _this); 15410 } 15411 }; 15412 15413 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 15414 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 15415 $__default["default"](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 15416 } else { 15417 complete(); 15418 } 15419 } 15420 }; 15421 15422 _proto.hide = function hide(callback) { 15423 var _this2 = this; 15424 15425 var tip = this.getTipElement(); 15426 var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE); 15427 15428 var complete = function complete() { 15429 if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { 15430 tip.parentNode.removeChild(tip); 15431 } 15432 15433 _this2._cleanTipClass(); 15434 15435 _this2.element.removeAttribute('aria-describedby'); 15436 15437 $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN); 15438 15439 if (_this2._popper !== null) { 15440 _this2._popper.destroy(); 15441 } 15442 15443 if (callback) { 15444 callback(); 15445 } 15446 }; 15447 15448 $__default["default"](this.element).trigger(hideEvent); 15449 15450 if (hideEvent.isDefaultPrevented()) { 15451 return; 15452 } 15453 15454 $__default["default"](tip).removeClass(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra 15455 // empty mouseover listeners we added for iOS support 15456 15457 if ('ontouchstart' in document.documentElement) { 15458 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 15459 } 15460 15461 this._activeTrigger[TRIGGER_CLICK] = false; 15462 this._activeTrigger[TRIGGER_FOCUS] = false; 15463 this._activeTrigger[TRIGGER_HOVER] = false; 15464 15465 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 15466 var transitionDuration = Util.getTransitionDurationFromElement(tip); 15467 $__default["default"](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 15468 } else { 15469 complete(); 15470 } 15471 15472 this._hoverState = ''; 15473 }; 15474 15475 _proto.update = function update() { 15476 if (this._popper !== null) { 15477 this._popper.scheduleUpdate(); 15478 } 15479 } // Protected 15480 ; 15481 15482 _proto.isWithContent = function isWithContent() { 15483 return Boolean(this.getTitle()); 15484 }; 15485 15486 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 15487 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 15488 }; 15489 15490 _proto.getTipElement = function getTipElement() { 15491 this.tip = this.tip || $__default["default"](this.config.template)[0]; 15492 return this.tip; 15493 }; 15494 15495 _proto.setContent = function setContent() { 15496 var tip = this.getTipElement(); 15497 this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); 15498 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$3); 15499 }; 15500 15501 _proto.setElementContent = function setElementContent($element, content) { 15502 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 15503 // Content is a DOM node or a jQuery 15504 if (this.config.html) { 15505 if (!$__default["default"](content).parent().is($element)) { 15506 $element.empty().append(content); 15507 } 15508 } else { 15509 $element.text($__default["default"](content).text()); 15510 } 15511 15512 return; 15513 } 15514 15515 if (this.config.html) { 15516 if (this.config.sanitize) { 15517 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 15518 } 15519 15520 $element.html(content); 15521 } else { 15522 $element.text(content); 15523 } 15524 }; 15525 15526 _proto.getTitle = function getTitle() { 15527 var title = this.element.getAttribute('data-original-title'); 15528 15529 if (!title) { 15530 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 15531 } 15532 15533 return title; 15534 } // Private 15535 ; 15536 15537 _proto._getPopperConfig = function _getPopperConfig(attachment) { 15538 var _this3 = this; 15539 15540 var defaultBsConfig = { 15541 placement: attachment, 15542 modifiers: { 15543 offset: this._getOffset(), 15544 flip: { 15545 behavior: this.config.fallbackPlacement 15546 }, 15547 arrow: { 15548 element: SELECTOR_ARROW 15549 }, 15550 preventOverflow: { 15551 boundariesElement: this.config.boundary 15552 } 15553 }, 15554 onCreate: function onCreate(data) { 15555 if (data.originalPlacement !== data.placement) { 15556 _this3._handlePopperPlacementChange(data); 15557 } 15558 }, 15559 onUpdate: function onUpdate(data) { 15560 return _this3._handlePopperPlacementChange(data); 15561 } 15562 }; 15563 return _extends$1({}, defaultBsConfig, this.config.popperConfig); 15564 }; 15565 15566 _proto._getOffset = function _getOffset() { 15567 var _this4 = this; 15568 15569 var offset = {}; 15570 15571 if (typeof this.config.offset === 'function') { 15572 offset.fn = function (data) { 15573 data.offsets = _extends$1({}, data.offsets, _this4.config.offset(data.offsets, _this4.element)); 15574 return data; 15575 }; 15576 } else { 15577 offset.offset = this.config.offset; 15578 } 15579 15580 return offset; 15581 }; 15582 15583 _proto._getContainer = function _getContainer() { 15584 if (this.config.container === false) { 15585 return document.body; 15586 } 15587 15588 if (Util.isElement(this.config.container)) { 15589 return $__default["default"](this.config.container); 15590 } 15591 15592 return $__default["default"](document).find(this.config.container); 15593 }; 15594 15595 _proto._getAttachment = function _getAttachment(placement) { 15596 return AttachmentMap[placement.toUpperCase()]; 15597 }; 15598 15599 _proto._setListeners = function _setListeners() { 15600 var _this5 = this; 15601 15602 var triggers = this.config.trigger.split(' '); 15603 triggers.forEach(function (trigger) { 15604 if (trigger === 'click') { 15605 $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 15606 return _this5.toggle(event); 15607 }); 15608 } else if (trigger !== TRIGGER_MANUAL) { 15609 var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 15610 var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 15611 $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) { 15612 return _this5._enter(event); 15613 }).on(eventOut, _this5.config.selector, function (event) { 15614 return _this5._leave(event); 15615 }); 15616 } 15617 }); 15618 15619 this._hideModalHandler = function () { 15620 if (_this5.element) { 15621 _this5.hide(); 15622 } 15623 }; 15624 15625 $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 15626 15627 if (this.config.selector) { 15628 this.config = _extends$1({}, this.config, { 15629 trigger: 'manual', 15630 selector: '' 15631 }); 15632 } else { 15633 this._fixTitle(); 15634 } 15635 }; 15636 15637 _proto._fixTitle = function _fixTitle() { 15638 var titleType = typeof this.element.getAttribute('data-original-title'); 15639 15640 if (this.element.getAttribute('title') || titleType !== 'string') { 15641 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 15642 this.element.setAttribute('title', ''); 15643 } 15644 }; 15645 15646 _proto._enter = function _enter(event, context) { 15647 var dataKey = this.constructor.DATA_KEY; 15648 context = context || $__default["default"](event.currentTarget).data(dataKey); 15649 15650 if (!context) { 15651 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 15652 $__default["default"](event.currentTarget).data(dataKey, context); 15653 } 15654 15655 if (event) { 15656 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 15657 } 15658 15659 if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) { 15660 context._hoverState = HOVER_STATE_SHOW; 15661 return; 15662 } 15663 15664 clearTimeout(context._timeout); 15665 context._hoverState = HOVER_STATE_SHOW; 15666 15667 if (!context.config.delay || !context.config.delay.show) { 15668 context.show(); 15669 return; 15670 } 15671 15672 context._timeout = setTimeout(function () { 15673 if (context._hoverState === HOVER_STATE_SHOW) { 15674 context.show(); 15675 } 15676 }, context.config.delay.show); 15677 }; 15678 15679 _proto._leave = function _leave(event, context) { 15680 var dataKey = this.constructor.DATA_KEY; 15681 context = context || $__default["default"](event.currentTarget).data(dataKey); 15682 15683 if (!context) { 15684 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 15685 $__default["default"](event.currentTarget).data(dataKey, context); 15686 } 15687 15688 if (event) { 15689 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false; 15690 } 15691 15692 if (context._isWithActiveTrigger()) { 15693 return; 15694 } 15695 15696 clearTimeout(context._timeout); 15697 context._hoverState = HOVER_STATE_OUT; 15698 15699 if (!context.config.delay || !context.config.delay.hide) { 15700 context.hide(); 15701 return; 15702 } 15703 15704 context._timeout = setTimeout(function () { 15705 if (context._hoverState === HOVER_STATE_OUT) { 15706 context.hide(); 15707 } 15708 }, context.config.delay.hide); 15709 }; 15710 15711 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 15712 for (var trigger in this._activeTrigger) { 15713 if (this._activeTrigger[trigger]) { 15714 return true; 15715 } 15716 } 15717 15718 return false; 15719 }; 15720 15721 _proto._getConfig = function _getConfig(config) { 15722 var dataAttributes = $__default["default"](this.element).data(); 15723 Object.keys(dataAttributes).forEach(function (dataAttr) { 15724 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 15725 delete dataAttributes[dataAttr]; 15726 } 15727 }); 15728 config = _extends$1({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 15729 15730 if (typeof config.delay === 'number') { 15731 config.delay = { 15732 show: config.delay, 15733 hide: config.delay 15734 }; 15735 } 15736 15737 if (typeof config.title === 'number') { 15738 config.title = config.title.toString(); 15739 } 15740 15741 if (typeof config.content === 'number') { 15742 config.content = config.content.toString(); 15743 } 15744 15745 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 15746 15747 if (config.sanitize) { 15748 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 15749 } 15750 15751 return config; 15752 }; 15753 15754 _proto._getDelegateConfig = function _getDelegateConfig() { 15755 var config = {}; 15756 15757 if (this.config) { 15758 for (var key in this.config) { 15759 if (this.constructor.Default[key] !== this.config[key]) { 15760 config[key] = this.config[key]; 15761 } 15762 } 15763 } 15764 15765 return config; 15766 }; 15767 15768 _proto._cleanTipClass = function _cleanTipClass() { 15769 var $tip = $__default["default"](this.getTipElement()); 15770 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 15771 15772 if (tabClass !== null && tabClass.length) { 15773 $tip.removeClass(tabClass.join('')); 15774 } 15775 }; 15776 15777 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 15778 this.tip = popperData.instance.popper; 15779 15780 this._cleanTipClass(); 15781 15782 this.addAttachmentClass(this._getAttachment(popperData.placement)); 15783 }; 15784 15785 _proto._fixTransition = function _fixTransition() { 15786 var tip = this.getTipElement(); 15787 var initConfigAnimation = this.config.animation; 15788 15789 if (tip.getAttribute('x-placement') !== null) { 15790 return; 15791 } 15792 15793 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3); 15794 this.config.animation = false; 15795 this.hide(); 15796 this.show(); 15797 this.config.animation = initConfigAnimation; 15798 } // Static 15799 ; 15800 15801 Tooltip._jQueryInterface = function _jQueryInterface(config) { 15802 return this.each(function () { 15803 var $element = $__default["default"](this); 15804 var data = $element.data(DATA_KEY$4); 15805 15806 var _config = typeof config === 'object' && config; 15807 15808 if (!data && /dispose|hide/.test(config)) { 15809 return; 15810 } 15811 15812 if (!data) { 15813 data = new Tooltip(this, _config); 15814 $element.data(DATA_KEY$4, data); 15815 } 15816 15817 if (typeof config === 'string') { 15818 if (typeof data[config] === 'undefined') { 15819 throw new TypeError("No method named \"" + config + "\""); 15820 } 15821 15822 data[config](); 15823 } 15824 }); 15825 }; 15826 15827 _createClass(Tooltip, null, [{ 15828 key: "VERSION", 15829 get: function get() { 15830 return VERSION$4; 15831 } 15832 }, { 15833 key: "Default", 15834 get: function get() { 15835 return Default$3; 15836 } 15837 }, { 15838 key: "NAME", 15839 get: function get() { 15840 return NAME$4; 15841 } 15842 }, { 15843 key: "DATA_KEY", 15844 get: function get() { 15845 return DATA_KEY$4; 15846 } 15847 }, { 15848 key: "Event", 15849 get: function get() { 15850 return Event$1; 15851 } 15852 }, { 15853 key: "EVENT_KEY", 15854 get: function get() { 15855 return EVENT_KEY$4; 15856 } 15857 }, { 15858 key: "DefaultType", 15859 get: function get() { 15860 return DefaultType$3; 15861 } 15862 }]); 15863 15864 return Tooltip; 15865 }(); 15866 /** 15867 * jQuery 15868 */ 15869 15870 15871 $__default["default"].fn[NAME$4] = Tooltip._jQueryInterface; 15872 $__default["default"].fn[NAME$4].Constructor = Tooltip; 15873 15874 $__default["default"].fn[NAME$4].noConflict = function () { 15875 $__default["default"].fn[NAME$4] = JQUERY_NO_CONFLICT$4; 15876 return Tooltip._jQueryInterface; 15877 }; 15878 15879 /** 15880 * Constants 15881 */ 15882 15883 var NAME$3 = 'popover'; 15884 var VERSION$3 = '4.6.2'; 15885 var DATA_KEY$3 = 'bs.popover'; 15886 var EVENT_KEY$3 = "." + DATA_KEY$3; 15887 var JQUERY_NO_CONFLICT$3 = $__default["default"].fn[NAME$3]; 15888 var CLASS_PREFIX = 'bs-popover'; 15889 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 15890 var CLASS_NAME_FADE$2 = 'fade'; 15891 var CLASS_NAME_SHOW$2 = 'show'; 15892 var SELECTOR_TITLE = '.popover-header'; 15893 var SELECTOR_CONTENT = '.popover-body'; 15894 15895 var Default$2 = _extends$1({}, Tooltip.Default, { 15896 placement: 'right', 15897 trigger: 'click', 15898 content: '', 15899 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 15900 }); 15901 15902 var DefaultType$2 = _extends$1({}, Tooltip.DefaultType, { 15903 content: '(string|element|function)' 15904 }); 15905 15906 var Event = { 15907 HIDE: "hide" + EVENT_KEY$3, 15908 HIDDEN: "hidden" + EVENT_KEY$3, 15909 SHOW: "show" + EVENT_KEY$3, 15910 SHOWN: "shown" + EVENT_KEY$3, 15911 INSERTED: "inserted" + EVENT_KEY$3, 15912 CLICK: "click" + EVENT_KEY$3, 15913 FOCUSIN: "focusin" + EVENT_KEY$3, 15914 FOCUSOUT: "focusout" + EVENT_KEY$3, 15915 MOUSEENTER: "mouseenter" + EVENT_KEY$3, 15916 MOUSELEAVE: "mouseleave" + EVENT_KEY$3 15917 }; 15918 /** 15919 * Class definition 15920 */ 15921 15922 var Popover = /*#__PURE__*/function (_Tooltip) { 15923 _inheritsLoose(Popover, _Tooltip); 15924 15925 function Popover() { 15926 return _Tooltip.apply(this, arguments) || this; 15927 } 15928 15929 var _proto = Popover.prototype; 15930 15931 // Overrides 15932 _proto.isWithContent = function isWithContent() { 15933 return this.getTitle() || this._getContent(); 15934 }; 15935 15936 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 15937 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 15938 }; 15939 15940 _proto.getTipElement = function getTipElement() { 15941 this.tip = this.tip || $__default["default"](this.config.template)[0]; 15942 return this.tip; 15943 }; 15944 15945 _proto.setContent = function setContent() { 15946 var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events 15947 15948 this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); 15949 15950 var content = this._getContent(); 15951 15952 if (typeof content === 'function') { 15953 content = content.call(this.element); 15954 } 15955 15956 this.setElementContent($tip.find(SELECTOR_CONTENT), content); 15957 $tip.removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$2); 15958 } // Private 15959 ; 15960 15961 _proto._getContent = function _getContent() { 15962 return this.element.getAttribute('data-content') || this.config.content; 15963 }; 15964 15965 _proto._cleanTipClass = function _cleanTipClass() { 15966 var $tip = $__default["default"](this.getTipElement()); 15967 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 15968 15969 if (tabClass !== null && tabClass.length > 0) { 15970 $tip.removeClass(tabClass.join('')); 15971 } 15972 } // Static 15973 ; 15974 15975 Popover._jQueryInterface = function _jQueryInterface(config) { 15976 return this.each(function () { 15977 var data = $__default["default"](this).data(DATA_KEY$3); 15978 15979 var _config = typeof config === 'object' ? config : null; 15980 15981 if (!data && /dispose|hide/.test(config)) { 15982 return; 15983 } 15984 15985 if (!data) { 15986 data = new Popover(this, _config); 15987 $__default["default"](this).data(DATA_KEY$3, data); 15988 } 15989 15990 if (typeof config === 'string') { 15991 if (typeof data[config] === 'undefined') {
vendor: 4,302 bytes, lines 15992-16144
15992 throw new TypeError("No method named \"" + config + "\""); 15993 } 15994 15995 data[config](); 15996 } 15997 }); 15998 }; 15999 16000 _createClass(Popover, null, [{ 16001 key: "VERSION", 16002 get: // Getters 16003 function get() { 16004 return VERSION$3; 16005 } 16006 }, { 16007 key: "Default", 16008 get: function get() { 16009 return Default$2; 16010 } 16011 }, { 16012 key: "NAME", 16013 get: function get() { 16014 return NAME$3; 16015 } 16016 }, { 16017 key: "DATA_KEY", 16018 get: function get() { 16019 return DATA_KEY$3; 16020 } 16021 }, { 16022 key: "Event", 16023 get: function get() { 16024 return Event; 16025 } 16026 }, { 16027 key: "EVENT_KEY", 16028 get: function get() { 16029 return EVENT_KEY$3; 16030 } 16031 }, { 16032 key: "DefaultType", 16033 get: function get() { 16034 return DefaultType$2; 16035 } 16036 }]); 16037 16038 return Popover; 16039 }(Tooltip); 16040 /** 16041 * jQuery 16042 */ 16043 16044 16045 $__default["default"].fn[NAME$3] = Popover._jQueryInterface; 16046 $__default["default"].fn[NAME$3].Constructor = Popover; 16047 16048 $__default["default"].fn[NAME$3].noConflict = function () { 16049 $__default["default"].fn[NAME$3] = JQUERY_NO_CONFLICT$3; 16050 return Popover._jQueryInterface; 16051 }; 16052 16053 /** 16054 * Constants 16055 */ 16056 16057 var NAME$2 = 'scrollspy'; 16058 var VERSION$2 = '4.6.2'; 16059 var DATA_KEY$2 = 'bs.scrollspy'; 16060 var EVENT_KEY$2 = "." + DATA_KEY$2; 16061 var DATA_API_KEY$1 = '.data-api'; 16062 var JQUERY_NO_CONFLICT$2 = $__default["default"].fn[NAME$2]; 16063 var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 16064 var CLASS_NAME_ACTIVE$1 = 'active'; 16065 var EVENT_ACTIVATE = "activate" + EVENT_KEY$2; 16066 var EVENT_SCROLL = "scroll" + EVENT_KEY$2; 16067 var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$1; 16068 var METHOD_OFFSET = 'offset'; 16069 var METHOD_POSITION = 'position'; 16070 var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; 16071 var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 16072 var SELECTOR_NAV_LINKS = '.nav-link'; 16073 var SELECTOR_NAV_ITEMS = '.nav-item'; 16074 var SELECTOR_LIST_ITEMS = '.list-group-item'; 16075 var SELECTOR_DROPDOWN$1 = '.dropdown'; 16076 var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; 16077 var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 16078 var Default$1 = { 16079 offset: 10, 16080 method: 'auto', 16081 target: '' 16082 }; 16083 var DefaultType$1 = { 16084 offset: 'number', 16085 method: 'string', 16086 target: '(string|element)' 16087 }; 16088 /** 16089 * Class definition 16090 */ 16091 16092 var ScrollSpy = /*#__PURE__*/function () { 16093 function ScrollSpy(element, config) { 16094 var _this = this; 16095 16096 this._element = element; 16097 this._scrollElement = element.tagName === 'BODY' ? window : element; 16098 this._config = this._getConfig(config); 16099 this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); 16100 this._offsets = []; 16101 this._targets = []; 16102 this._activeTarget = null; 16103 this._scrollHeight = 0; 16104 $__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) { 16105 return _this._process(event); 16106 }); 16107 this.refresh(); 16108 16109 this._process(); 16110 } // Getters 16111 16112 16113 var _proto = ScrollSpy.prototype; 16114 16115 // Public 16116 _proto.refresh = function refresh() { 16117 var _this2 = this; 16118 16119 var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 16120 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 16121 var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 16122 this._offsets = []; 16123 this._targets = []; 16124 this._scrollHeight = this._getScrollHeight(); 16125 var targets = [].slice.call(document.querySelectorAll(this._selector)); 16126 targets.map(function (element) { 16127 var target; 16128 var targetSelector = Util.getSelectorFromElement(element); 16129 16130 if (targetSelector) { 16131 target = document.querySelector(targetSelector); 16132 } 16133 16134 if (target) { 16135 var targetBCR = target.getBoundingClientRect(); 16136 16137 if (targetBCR.width || targetBCR.height) { 16138 // TODO (fat): remove sketch reliance on jQuery position/offset 16139 return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector]; 16140 } 16141 } 16142 16143 return null; 16144 }
vendor: 4,304 bytes, lines 16144-16267
16144).filter(Boolean).sort(function (a, b) { 16145 return a[0] - b[0]; 16146 }).forEach(function (item) { 16147 _this2._offsets.push(item[0]); 16148 16149 _this2._targets.push(item[1]); 16150 }); 16151 }; 16152 16153 _proto.dispose = function dispose() { 16154 $__default["default"].removeData(this._element, DATA_KEY$2); 16155 $__default["default"](this._scrollElement).off(EVENT_KEY$2); 16156 this._element = null; 16157 this._scrollElement = null; 16158 this._config = null; 16159 this._selector = null; 16160 this._offsets = null; 16161 this._targets = null; 16162 this._activeTarget = null; 16163 this._scrollHeight = null; 16164 } // Private 16165 ; 16166 16167 _proto._getConfig = function _getConfig(config) { 16168 config = _extends$1({}, Default$1, typeof config === 'object' && config ? config : {}); 16169 16170 if (typeof config.target !== 'string' && Util.isElement(config.target)) { 16171 var id = $__default["default"](config.target).attr('id'); 16172 16173 if (!id) { 16174 id = Util.getUID(NAME$2); 16175 $__default["default"](config.target).attr('id', id); 16176 } 16177 16178 config.target = "#" + id; 16179 } 16180 16181 Util.typeCheckConfig(NAME$2, config, DefaultType$1); 16182 return config; 16183 }; 16184 16185 _proto._getScrollTop = function _getScrollTop() { 16186 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 16187 }; 16188 16189 _proto._getScrollHeight = function _getScrollHeight() { 16190 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 16191 }; 16192 16193 _proto._getOffsetHeight = function _getOffsetHeight() { 16194 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 16195 }; 16196 16197 _proto._process = function _process() { 16198 var scrollTop = this._getScrollTop() + this._config.offset; 16199 16200 var scrollHeight = this._getScrollHeight(); 16201 16202 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 16203 16204 if (this._scrollHeight !== scrollHeight) { 16205 this.refresh(); 16206 } 16207 16208 if (scrollTop >= maxScroll) { 16209 var target = this._targets[this._targets.length - 1]; 16210 16211 if (this._activeTarget !== target) { 16212 this._activate(target); 16213 } 16214 16215 return; 16216 } 16217 16218 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 16219 this._activeTarget = null; 16220 16221 this._clear(); 16222 16223 return; 16224 } 16225 16226 for (var i = this._offsets.length; i--;) { 16227 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 16228 16229 if (isActiveTarget) { 16230 this._activate(this._targets[i]); 16231 } 16232 } 16233 }; 16234 16235 _proto._activate = function _activate(target) { 16236 this._activeTarget = target; 16237 16238 this._clear(); 16239 16240 var queries = this._selector.split(',').map(function (selector) { 16241 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 16242 }); 16243 16244 var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(',')))); 16245 16246 if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { 16247 $link.closest(SELECTOR_DROPDOWN$1).find(SELECTOR_DROPDOWN_TOGGLE$1).addClass(CLASS_NAME_ACTIVE$1); 16248 $link.addClass(CLASS_NAME_ACTIVE$1); 16249 } else { 16250 // Set triggered link as active 16251 $link.addClass(CLASS_NAME_ACTIVE$1); // Set triggered links parents as active 16252 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 16253 16254 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$1); // Handle special case when .nav-link is inside .nav-item 16255 16256 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$1); 16257 } 16258 16259 $__default["default"](this._scrollElement).trigger(EVENT_ACTIVATE, { 16260 relatedTarget: target 16261 }); 16262 }; 16263 16264 _proto._clear = function _clear() { 16265 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 16266 return node.classList.contains(CLASS_NAME_ACTIVE$1); 16267 }
vendor: 6,282 bytes, lines 16267-16461
16267).forEach(function (node) { 16268 return node.classList.remove(CLASS_NAME_ACTIVE$1); 16269 }); 16270 } // Static 16271 ; 16272 16273 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 16274 return this.each(function () { 16275 var data = $__default["default"](this).data(DATA_KEY$2); 16276 16277 var _config = typeof config === 'object' && config; 16278 16279 if (!data) { 16280 data = new ScrollSpy(this, _config); 16281 $__default["default"](this).data(DATA_KEY$2, data); 16282 } 16283 16284 if (typeof config === 'string') { 16285 if (typeof data[config] === 'undefined') { 16286 throw new TypeError("No method named \"" + config + "\""); 16287 } 16288 16289 data[config](); 16290 } 16291 }); 16292 }; 16293 16294 _createClass(ScrollSpy, null, [{ 16295 key: "VERSION", 16296 get: function get() { 16297 return VERSION$2; 16298 } 16299 }, { 16300 key: "Default", 16301 get: function get() { 16302 return Default$1; 16303 } 16304 }]); 16305 16306 return ScrollSpy; 16307 }(); 16308 /** 16309 * Data API implementation 16310 */ 16311 16312 16313 $__default["default"](window).on(EVENT_LOAD_DATA_API, function () { 16314 var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY)); 16315 var scrollSpysLength = scrollSpys.length; 16316 16317 for (var i = scrollSpysLength; i--;) { 16318 var $spy = $__default["default"](scrollSpys[i]); 16319 16320 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 16321 } 16322 }); 16323 /** 16324 * jQuery 16325 */ 16326 16327 $__default["default"].fn[NAME$2] = ScrollSpy._jQueryInterface; 16328 $__default["default"].fn[NAME$2].Constructor = ScrollSpy; 16329 16330 $__default["default"].fn[NAME$2].noConflict = function () { 16331 $__default["default"].fn[NAME$2] = JQUERY_NO_CONFLICT$2; 16332 return ScrollSpy._jQueryInterface; 16333 }; 16334 16335 /** 16336 * Constants 16337 */ 16338 16339 var NAME$1 = 'tab'; 16340 var VERSION$1 = '4.6.2'; 16341 var DATA_KEY$1 = 'bs.tab'; 16342 var EVENT_KEY$1 = "." + DATA_KEY$1; 16343 var DATA_API_KEY = '.data-api'; 16344 var JQUERY_NO_CONFLICT$1 = $__default["default"].fn[NAME$1]; 16345 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 16346 var CLASS_NAME_ACTIVE = 'active'; 16347 var CLASS_NAME_DISABLED = 'disabled'; 16348 var CLASS_NAME_FADE$1 = 'fade'; 16349 var CLASS_NAME_SHOW$1 = 'show'; 16350 var EVENT_HIDE$1 = "hide" + EVENT_KEY$1; 16351 var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$1; 16352 var EVENT_SHOW$1 = "show" + EVENT_KEY$1; 16353 var EVENT_SHOWN$1 = "shown" + EVENT_KEY$1; 16354 var EVENT_CLICK_DATA_API = "click" + EVENT_KEY$1 + DATA_API_KEY; 16355 var SELECTOR_DROPDOWN = '.dropdown'; 16356 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 16357 var SELECTOR_ACTIVE = '.active'; 16358 var SELECTOR_ACTIVE_UL = '> li > .active'; 16359 var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 16360 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 16361 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 16362 /** 16363 * Class definition 16364 */ 16365 16366 var Tab = /*#__PURE__*/function () { 16367 function Tab(element) { 16368 this._element = element; 16369 } // Getters 16370 16371 16372 var _proto = Tab.prototype; 16373 16374 // Public 16375 _proto.show = function show() { 16376 var _this = this; 16377 16378 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || this._element.hasAttribute('disabled')) { 16379 return; 16380 } 16381 16382 var target; 16383 var previous; 16384 var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]; 16385 var selector = Util.getSelectorFromElement(this._element); 16386 16387 if (listElement) { 16388 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE; 16389 previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector)); 16390 previous = previous[previous.length - 1]; 16391 } 16392 16393 var hideEvent = $__default["default"].Event(EVENT_HIDE$1, { 16394 relatedTarget: this._element 16395 }); 16396 var showEvent = $__default["default"].Event(EVENT_SHOW$1, { 16397 relatedTarget: previous 16398 }); 16399 16400 if (previous) { 16401 $__default["default"](previous).trigger(hideEvent); 16402 } 16403 16404 $__default["default"](this._element).trigger(showEvent); 16405 16406 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 16407 return; 16408 } 16409 16410 if (selector) { 16411 target = document.querySelector(selector); 16412 } 16413 16414 this._activate(this._element, listElement); 16415 16416 var complete = function complete() { 16417 var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN$1, { 16418 relatedTarget: _this._element 16419 }); 16420 var shownEvent = $__default["default"].Event(EVENT_SHOWN$1, { 16421 relatedTarget: previous 16422 }); 16423 $__default["default"](previous).trigger(hiddenEvent); 16424 $__default["default"](_this._element).trigger(shownEvent); 16425 }; 16426 16427 if (target) { 16428 this._activate(target, target.parentNode, complete); 16429 } else { 16430 complete(); 16431 } 16432 }; 16433 16434 _proto.dispose = function dispose() { 16435 $__default["default"].removeData(this._element, DATA_KEY$1); 16436 this._element = null; 16437 } // Private 16438 ; 16439 16440 _proto._activate = function _activate(element, container, callback) { 16441 var _this2 = this; 16442 16443 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE); 16444 var active = activeElements[0]; 16445 var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE$1); 16446 16447 var complete = function complete() { 16448 return _this2._transitionComplete(element, active, callback); 16449 }; 16450 16451 if (active && isTransitioning) { 16452 var transitionDuration = Util.getTransitionDurationFromElement(active); 16453 $__default["default"](active).removeClass(CLASS_NAME_SHOW$1).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 16454 } else { 16455 complete(); 16456 } 16457 }; 16458 16459 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 16460 if (active) { 16461 $__default["default"](active).removeClass(CLASS_NAME_ACTIVE);
vendor: 8,643 bytes, lines 16462-16787
16462 var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 16463 16464 if (dropdownChild) { 16465 $__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE); 16466 } 16467 16468 if (active.getAttribute('role') === 'tab') { 16469 active.setAttribute('aria-selected', false); 16470 } 16471 } 16472 16473 $__default["default"](element).addClass(CLASS_NAME_ACTIVE); 16474 16475 if (element.getAttribute('role') === 'tab') { 16476 element.setAttribute('aria-selected', true); 16477 } 16478 16479 Util.reflow(element); 16480 16481 if (element.classList.contains(CLASS_NAME_FADE$1)) { 16482 element.classList.add(CLASS_NAME_SHOW$1); 16483 } 16484 16485 var parent = element.parentNode; 16486 16487 if (parent && parent.nodeName === 'LI') { 16488 parent = parent.parentNode; 16489 } 16490 16491 if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 16492 var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0]; 16493 16494 if (dropdownElement) { 16495 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE)); 16496 $__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE); 16497 } 16498 16499 element.setAttribute('aria-expanded', true); 16500 } 16501 16502 if (callback) { 16503 callback(); 16504 } 16505 } // Static 16506 ; 16507 16508 Tab._jQueryInterface = function _jQueryInterface(config) { 16509 return this.each(function () { 16510 var $this = $__default["default"](this); 16511 var data = $this.data(DATA_KEY$1); 16512 16513 if (!data) { 16514 data = new Tab(this); 16515 $this.data(DATA_KEY$1, data); 16516 } 16517 16518 if (typeof config === 'string') { 16519 if (typeof data[config] === 'undefined') { 16520 throw new TypeError("No method named \"" + config + "\""); 16521 } 16522 16523 data[config](); 16524 } 16525 }); 16526 }; 16527 16528 _createClass(Tab, null, [{ 16529 key: "VERSION", 16530 get: function get() { 16531 return VERSION$1; 16532 } 16533 }]); 16534 16535 return Tab; 16536 }(); 16537 /** 16538 * Data API implementation 16539 */ 16540 16541 16542 $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 16543 event.preventDefault(); 16544 16545 Tab._jQueryInterface.call($__default["default"](this), 'show'); 16546 }); 16547 /** 16548 * jQuery 16549 */ 16550 16551 $__default["default"].fn[NAME$1] = Tab._jQueryInterface; 16552 $__default["default"].fn[NAME$1].Constructor = Tab; 16553 16554 $__default["default"].fn[NAME$1].noConflict = function () { 16555 $__default["default"].fn[NAME$1] = JQUERY_NO_CONFLICT$1; 16556 return Tab._jQueryInterface; 16557 }; 16558 16559 /** 16560 * Constants 16561 */ 16562 16563 var NAME = 'toast'; 16564 var VERSION = '4.6.2'; 16565 var DATA_KEY = 'bs.toast'; 16566 var EVENT_KEY = "." + DATA_KEY; 16567 var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME]; 16568 var CLASS_NAME_FADE = 'fade'; 16569 var CLASS_NAME_HIDE = 'hide'; 16570 var CLASS_NAME_SHOW = 'show'; 16571 var CLASS_NAME_SHOWING = 'showing'; 16572 var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY; 16573 var EVENT_HIDE = "hide" + EVENT_KEY; 16574 var EVENT_HIDDEN = "hidden" + EVENT_KEY; 16575 var EVENT_SHOW = "show" + EVENT_KEY; 16576 var EVENT_SHOWN = "shown" + EVENT_KEY; 16577 var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'; 16578 var Default = { 16579 animation: true, 16580 autohide: true, 16581 delay: 500 16582 }; 16583 var DefaultType = { 16584 animation: 'boolean', 16585 autohide: 'boolean', 16586 delay: 'number' 16587 }; 16588 /** 16589 * Class definition 16590 */ 16591 16592 var Toast = /*#__PURE__*/function () { 16593 function Toast(element, config) { 16594 this._element = element; 16595 this._config = this._getConfig(config); 16596 this._timeout = null; 16597 16598 this._setListeners(); 16599 } // Getters 16600 16601 16602 var _proto = Toast.prototype; 16603 16604 // Public 16605 _proto.show = function show() { 16606 var _this = this; 16607 16608 var showEvent = $__default["default"].Event(EVENT_SHOW); 16609 $__default["default"](this._element).trigger(showEvent); 16610 16611 if (showEvent.isDefaultPrevented()) { 16612 return; 16613 } 16614 16615 this._clearTimeout(); 16616 16617 if (this._config.animation) { 16618 this._element.classList.add(CLASS_NAME_FADE); 16619 } 16620 16621 var complete = function complete() { 16622 _this._element.classList.remove(CLASS_NAME_SHOWING); 16623 16624 _this._element.classList.add(CLASS_NAME_SHOW); 16625 16626 $__default["default"](_this._element).trigger(EVENT_SHOWN); 16627 16628 if (_this._config.autohide) { 16629 _this._timeout = setTimeout(function () { 16630 _this.hide(); 16631 }, _this._config.delay); 16632 } 16633 }; 16634 16635 this._element.classList.remove(CLASS_NAME_HIDE); 16636 16637 Util.reflow(this._element); 16638 16639 this._element.classList.add(CLASS_NAME_SHOWING); 16640 16641 if (this._config.animation) { 16642 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 16643 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 16644 } else { 16645 complete(); 16646 } 16647 }; 16648 16649 _proto.hide = function hide() { 16650 if (!this._element.classList.contains(CLASS_NAME_SHOW)) { 16651 return; 16652 } 16653 16654 var hideEvent = $__default["default"].Event(EVENT_HIDE); 16655 $__default["default"](this._element).trigger(hideEvent); 16656 16657 if (hideEvent.isDefaultPrevented()) { 16658 return; 16659 } 16660 16661 this._close(); 16662 }; 16663 16664 _proto.dispose = function dispose() { 16665 this._clearTimeout(); 16666 16667 if (this._element.classList.contains(CLASS_NAME_SHOW)) { 16668 this._element.classList.remove(CLASS_NAME_SHOW); 16669 } 16670 16671 $__default["default"](this._element).off(EVENT_CLICK_DISMISS); 16672 $__default["default"].removeData(this._element, DATA_KEY); 16673 this._element = null; 16674 this._config = null; 16675 } // Private 16676 ; 16677 16678 _proto._getConfig = function _getConfig(config) { 16679 config = _extends$1({}, Default, $__default["default"](this._element).data(), typeof config === 'object' && config ? config : {}); 16680 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); 16681 return config; 16682 }; 16683 16684 _proto._setListeners = function _setListeners() { 16685 var _this2 = this; 16686 16687 $__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () { 16688 return _this2.hide(); 16689 }); 16690 }; 16691 16692 _proto._close = function _close() { 16693 var _this3 = this; 16694 16695 var complete = function complete() { 16696 _this3._element.classList.add(CLASS_NAME_HIDE); 16697 16698 $__default["default"](_this3._element).trigger(EVENT_HIDDEN); 16699 }; 16700 16701 this._element.classList.remove(CLASS_NAME_SHOW); 16702 16703 if (this._config.animation) { 16704 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 16705 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 16706 } else { 16707 complete(); 16708 } 16709 }; 16710 16711 _proto._clearTimeout = function _clearTimeout() { 16712 clearTimeout(this._timeout); 16713 this._timeout = null; 16714 } // Static 16715 ; 16716 16717 Toast._jQueryInterface = function _jQueryInterface(config) { 16718 return this.each(function () { 16719 var $element = $__default["default"](this); 16720 var data = $element.data(DATA_KEY); 16721 16722 var _config = typeof config === 'object' && config; 16723 16724 if (!data) { 16725 data = new Toast(this, _config); 16726 $element.data(DATA_KEY, data); 16727 } 16728 16729 if (typeof config === 'string') { 16730 if (typeof data[config] === 'undefined') { 16731 throw new TypeError("No method named \"" + config + "\""); 16732 } 16733 16734 data[config](this); 16735 } 16736 }); 16737 }; 16738 16739 _createClass(Toast, null, [{ 16740 key: "VERSION", 16741 get: function get() { 16742 return VERSION; 16743 } 16744 }, { 16745 key: "DefaultType", 16746 get: function get() { 16747 return DefaultType; 16748 } 16749 }, { 16750 key: "Default", 16751 get: function get() { 16752 return Default; 16753 } 16754 }]); 16755 16756 return Toast; 16757 }(); 16758 /** 16759 * jQuery 16760 */ 16761 16762 16763 $__default["default"].fn[NAME] = Toast._jQueryInterface; 16764 $__default["default"].fn[NAME].Constructor = Toast; 16765 16766 $__default["default"].fn[NAME].noConflict = function () { 16767 $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT; 16768 return Toast._jQueryInterface; 16769 }; 16770 16771 exports.Alert = Alert; 16772 exports.Button = Button; 16773 exports.Carousel = Carousel; 16774 exports.Collapse = Collapse; 16775 exports.Dropdown = Dropdown; 16776 exports.Modal = Modal; 16777 exports.Popover = Popover; 16778 exports.Scrollspy = ScrollSpy; 16779 exports.Tab = Tab; 16780 exports.Toast = Toast; 16781 exports.Tooltip = Tooltip; 16782 exports.Util = Util; 16783 16784 Object.defineProperty(exports, '__esModule', { value: true }); 16785 16786})); 16787//# sourceMappingURL=bootstrap.bundle.js.map
vendor: 8,175 bytes, lines 16788-17038
16788 16789/** 16790* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 16791*/ 16792;(function(window, document) { 16793/*jshint evil:true */ 16794 /** version */ 16795 var version = '3.7.3-pre'; 16796 16797 /** Preset options */ 16798 var options = window.html5 || {}; 16799 16800 /** Used to skip problem elements */ 16801 var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; 16802 16803 /** Not all elements can be cloned in IE **/ 16804 var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; 16805 16806 /** Detect whether the browser supports default html5 styles */ 16807 var supportsHtml5Styles; 16808 16809 /** Name of the expando, to work with multiple documents or to re-shiv one document */ 16810 var expando = '_html5shiv'; 16811 16812 /** The id for the the documents expando */ 16813 var expanID = 0; 16814 16815 /** Cached data for each document */ 16816 var expandoData = {}; 16817 16818 /** Detect whether the browser supports unknown elements */ 16819 var supportsUnknownElements; 16820 16821 (function() { 16822 try { 16823 var a = document.createElement('a'); 16824 a.innerHTML = '<xyz></xyz>'; 16825 //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles 16826 supportsHtml5Styles = ('hidden' in a); 16827 16828 supportsUnknownElements = a.childNodes.length == 1 || (function() { 16829 // assign a false positive if unable to shiv 16830 (document.createElement)('a'); 16831 var frag = document.createDocumentFragment(); 16832 return ( 16833 typeof frag.cloneNode == 'undefined' || 16834 typeof frag.createDocumentFragment == 'undefined' || 16835 typeof frag.createElement == 'undefined' 16836 ); 16837 }()); 16838 } catch(e) { 16839 // assign a false positive if detection fails => unable to shiv 16840 supportsHtml5Styles = true; 16841 supportsUnknownElements = true; 16842 } 16843 16844 }()); 16845 16846 /*--------------------------------------------------------------------------*/ 16847 16848 /** 16849 * Creates a style sheet with the given CSS text and adds it to the document. 16850 * @private 16851 * @param {Document} ownerDocument The document. 16852 * @param {String} cssText The CSS text. 16853 * @returns {StyleSheet} The style element. 16854 */ 16855 function addStyleSheet(ownerDocument, cssText) { 16856 var p = ownerDocument.createElement('p'), 16857 parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; 16858 16859 p.innerHTML = 'x<style>' + cssText + '</style>'; 16860 return parent.insertBefore(p.lastChild, parent.firstChild); 16861 } 16862 16863 /** 16864 * Returns the value of `html5.elements` as an array. 16865 * @private 16866 * @returns {Array} An array of shived element node names. 16867 */ 16868 function getElements() { 16869 var elements = html5.elements; 16870 return typeof elements == 'string' ? elements.split(' ') : elements; 16871 } 16872 16873 /** 16874 * Extends the built-in list of html5 elements 16875 * @memberOf html5 16876 * @param {String|Array} newElements whitespace separated list or array of new element names to shiv 16877 * @param {Document} ownerDocument The context document. 16878 */ 16879 function addElements(newElements, ownerDocument) { 16880 var elements = html5.elements; 16881 if(typeof elements != 'string'){ 16882 elements = elements.join(' '); 16883 } 16884 if(typeof newElements != 'string'){ 16885 newElements = newElements.join(' '); 16886 } 16887 html5.elements = elements +' '+ newElements; 16888 shivDocument(ownerDocument); 16889 } 16890 16891 /** 16892 * Returns the data associated to the given document 16893 * @private 16894 * @param {Document} ownerDocument The document. 16895 * @returns {Object} An object of data. 16896 */ 16897 function getExpandoData(ownerDocument) { 16898 var data = expandoData[ownerDocument[expando]]; 16899 if (!data) { 16900 data = {}; 16901 expanID++; 16902 ownerDocument[expando] = expanID; 16903 expandoData[expanID] = data; 16904 } 16905 return data; 16906 } 16907 16908 /** 16909 * returns a shived element for the given nodeName and document 16910 * @memberOf html5 16911 * @param {String} nodeName name of the element 16912 * @param {Document} ownerDocument The context document. 16913 * @returns {Object} The shived element. 16914 */ 16915 function createElement(nodeName, ownerDocument, data){ 16916 if (!ownerDocument) { 16917 ownerDocument = document; 16918 } 16919 if(supportsUnknownElements){ 16920 return ownerDocument.createElement(nodeName); 16921 } 16922 if (!data) { 16923 data = getExpandoData(ownerDocument); 16924 } 16925 var node; 16926 16927 if (data.cache[nodeName]) { 16928 node = data.cache[nodeName].cloneNode(); 16929 } else if (saveClones.test(nodeName)) { 16930 node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); 16931 } else { 16932 node = data.createElem(nodeName); 16933 } 16934 16935 // Avoid adding some elements to fragments in IE < 9 because 16936 // * Attributes like `name` or `type` cannot be set/changed once an element 16937 // is inserted into a document/fragment 16938 // * Link elements with `src` attributes that are inaccessible, as with 16939 // a 403 response, will cause the tab/window to crash 16940 // * Script elements appended to fragments will execute when their `src` 16941 // or `text` property is set 16942 return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; 16943 } 16944 16945 /** 16946 * returns a shived DocumentFragment for the given document 16947 * @memberOf html5 16948 * @param {Document} ownerDocument The context document. 16949 * @returns {Object} The shived DocumentFragment. 16950 */ 16951 function createDocumentFragment(ownerDocument, data){ 16952 if (!ownerDocument) { 16953 ownerDocument = document; 16954 } 16955 if(supportsUnknownElements){ 16956 return ownerDocument.createDocumentFragment(); 16957 } 16958 data = data || getExpandoData(ownerDocument); 16959 var clone = data.frag.cloneNode(), 16960 i = 0, 16961 elems = getElements(), 16962 l = elems.length; 16963 for(;i<l;i++){ 16964 clone.createElement(elems[i]); 16965 } 16966 return clone; 16967 } 16968 16969 /** 16970 * Shivs the `createElement` and `createDocumentFragment` methods of the document. 16971 * @private 16972 * @param {Document|DocumentFragment} ownerDocument The document. 16973 * @param {Object} data of the document. 16974 */ 16975 function shivMethods(ownerDocument, data) { 16976 if (!data.cache) { 16977 data.cache = {}; 16978 data.createElem = ownerDocument.createElement; 16979 data.createFrag = ownerDocument.createDocumentFragment; 16980 data.frag = data.createFrag(); 16981 } 16982 16983 16984 ownerDocument.createElement = function(nodeName) { 16985 //abort shiv 16986 if (!html5.shivMethods) { 16987 return data.createElem(nodeName); 16988 } 16989 return createElement(nodeName, ownerDocument, data); 16990 }; 16991 16992 ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + 16993 'var n=f.cloneNode(),c=n.createElement;' + 16994 'h.shivMethods&&(' + 16995 // unroll the `createElement` calls 16996 getElements().join().replace(/[\w\-:]+/g, function(nodeName) { 16997 data.createElem(nodeName); 16998 data.frag.createElement(nodeName); 16999 return 'c("' + nodeName + '")'; 17000 }) + 17001 ');return n}' 17002 )(html5, data.frag); 17003 } 17004 17005 /*--------------------------------------------------------------------------*/ 17006 17007 /** 17008 * Shivs the given document. 17009 * @memberOf html5 17010 * @param {Document} ownerDocument The document to shiv. 17011 * @returns {Document} The shived document. 17012 */ 17013 function shivDocument(ownerDocument) { 17014 if (!ownerDocument) { 17015 ownerDocument = document; 17016 } 17017 var data = getExpandoData(ownerDocument); 17018 17019 if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { 17020 data.hasCSS = !!addStyleSheet(ownerDocument, 17021 // corrects block display not defined in IE6/7/8/9 17022 'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' + 17023 // adds styling not present in IE6/7/8/9 17024 'mark{background:#FF0;color:#000}' + 17025 // hides non-rendered elements 17026 'template{display:none}' 17027 ); 17028 } 17029 if (!supportsUnknownElements) { 17030 shivMethods(ownerDocument, data); 17031 } 17032 return ownerDocument; 17033 } 17034 17035 /*--------------------------------------------------------------------------*/ 17036 17037 /** 17038 * The `html5` object is exposed so that more elements can be shived and
17039 * existing shiving can be detected on iframes. 17040 * @type Object 17041 * @example 17042 * 17043 * // options can be changed before the script is included 17044 * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; 17045 */ 17046 var html5 = { 17047 17048 /** 17049 * An array or space separated string of node names of the elements to shiv. 17050 * @memberOf html5 17051 * @type Array|String 17052 */ 17053 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video', 17054 17055 /** 17056 * current version of html5shiv 17057 */ 17058 'version': version, 17059 17060 /** 17061 * A flag to indicate that the HTML5 style sheet should be inserted. 17062 * @memberOf html5 17063 * @type Boolean 17064 */ 17065 'shivCSS': (options.shivCSS !== false), 17066 17067 /** 17068 * Is equal to true if a browser supports creating unknown/HTML5 elements 17069 * @memberOf html5 17070 * @type boolean 17071 */ 17072 'supportsUnknownElements': supportsUnknownElements, 17073 17074 /** 17075 * A flag to indicate that the document's `createElement` and `createDocumentFragment` 17076 * methods should be overwritten. 17077 * @memberOf html5 17078 * @type Boolean 17079 */ 17080 'shivMethods': (options.shivMethods !== false), 17081 17082 /** 17083 * A string to describe the type of `html5` object ("default" or "default print"). 17084 * @memberOf html5
vendor: 21,444 bytes, lines 17085-17116
17085 * @type String 17086 */ 17087 'type': 'default', 17088 17089 // shivs the document according to the specified `html5` object options 17090 'shivDocument': shivDocument, 17091 17092 //creates a shived element 17093 createElement: createElement, 17094 17095 //creates a shived documentFragment 17096 createDocumentFragment: createDocumentFragment, 17097 17098 //extends list of elements 17099 addElements: addElements 17100 }; 17101 17102 /*--------------------------------------------------------------------------*/ 17103 17104 // expose html5 17105 window.html5 = html5; 17106 17107 // shiv the document 17108 shivDocument(document); 17109 17110 if(typeof module == 'object' && module.exports){ 17111 module.exports = html5; 17112 } 17113 17114}(typeof window !== "undefined" ? window : this, document)); 17115 17116!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery||window.Zepto)}(function(c){function e(){}function d(e,t){m.ev.on(x+e+I,t)}function p(e,t,n,o){var i=document.createElement("div");return i.className="mfp-"+e,n&&(i.innerHTML=n),o?t&&t.appendChild(i):(i=c(i),t&&i.appendTo(t)),i}function u(e,t){m.ev.triggerHandler(x+e,t),m.st.callbacks&&(e=e.charAt(0).toLowerCase()+e.slice(1),m.st.callbacks[e])&&m.st.callbacks[e].apply(m,Array.isArray(t)?t:[t])}function f(e){return e===A&&m.currTemplate.closeBtn||(m.currTemplate.closeBtn=c(m.st.closeMarkup.replace("%title%",m.st.tClose)),A=e),m.currTemplate.closeBtn}function r(){c.magnificPopup.instance||((m=new e).init(),c.magnificPopup.instance=m)}function a(){y&&(v.after(y.addClass(l)).detach(),y=null)}function i(){n&&c(document.body).removeClass(n)}function t(){i(),m.req&&m.req.abort()}var m,o,g,s,h,A,l,v,y,n,w="Close",F="BeforeClose",C="MarkupParse",b="Open",j="Change",x="mfp",I="."+x,T="mfp-ready",N="mfp-removing",k="mfp-prevent-close",P=!!window.jQuery,_=c(window),S=(c.magnificPopup={instance:null,proto:e.prototype={constructor:e,init:function(){var e=navigator.appVersion;m.isLowIE=m.isIE8=document.all&&!document.addEventListener,m.isAndroid=/android/gi.test(e),m.isIOS=/iphone|ipad|ipod/gi.test(e),m.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),m.probablyMobile=m.isAndroid||m.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),g=c(document),m.popupsCache={}},open:function(e){if(!1===e.isObj){m.items=e.items.toArray(),m.index=0;for(var t,n=e.items,o=0;o<n.length;o++)if((t=(t=n[o]).parsed?t.el[0]:t)===e.el[0]){m.index=o;break}}else m.items=Array.isArray(e.items)?e.items:[e.items],m.index=e.index||0;if(!m.isOpen){m.types=[],h="",e.mainEl&&e.mainEl.length?m.ev=e.mainEl.eq(0):m.ev=g,e.key?(m.popupsCache[e.key]||(m.popupsCache[e.key]={}),m.currTemplate=m.popupsCache[e.key]):m.currTemplate={},m.st=c.extend(!0,{},c.magnificPopup.defaults,e),m.fixedContentPos="auto"===m.st.fixedContentPos?!m.probablyMobile:m.st.fixedContentPos,m.st.modal&&(m.st.closeOnContentClick=!1,m.st.closeOnBgClick=!1,m.st.showCloseBtn=!1,m.st.enableEscapeKey=!1),m.bgOverlay||(m.bgOverlay=p("bg").on("click"+I,function(){m.close()}),m.wrap=p("wrap").attr("tabindex",-1).on("click"+I,function(e){m._checkIfClose(e.target)&&m.close()}),m.container=p("container",m.wrap)),m.contentContainer=p("content"),m.st.preloader&&(m.preloader=p("preloader",m.container,m.st.tLoading));var i=c.magnificPopup.modules;for(o=0;o<i.length;o++){var r=(r=i[o]).charAt(0).toUpperCase()+r.slice(1);m["init"+r].call(m)}u("BeforeOpen"),m.st.showCloseBtn&&(m.st.closeBtnInside?(d(C,function(e,t,n,o){n.close_replaceWith=f(o.type)}),h+=" mfp-close-btn-in"):m.wrap.append(f())),m.st.alignTop&&(h+=" mfp-align-top"),m.fixedContentPos?m.wrap.css({overflow:m.st.overflowY,overflowX:"hidden",overflowY:m.st.overflowY}):m.wrap.css({top:_.scrollTop(),position:"absolute"}),!1!==m.st.fixedBgPos&&("auto"!==m.st.fixedBgPos||m.fixedContentPos)||m.bgOverlay.css({height:g.height(),position:"absolute"}),m.st.enableEscapeKey&&g.on("keyup"+I,function(e){27===e.keyCode&&m.close()}),_.on("resize"+I,function(){m.updateSize()}),m.st.closeOnContentClick||(h+=" mfp-auto-cursor"),h&&m.wrap.addClass(h);var a=m.wH=_.height(),s={},l=(m.fixedContentPos&&m._hasScrollBar(a)&&(l=m._getScrollbarSize())&&(s.marginRight=l),m.fixedContentPos&&(m.isIE7?c("body, html").css("overflow","hidden"):s.overflow="hidden"),m.st.mainClass);return m.isIE7&&(l+=" mfp-ie7"),l&&m._addClassToMFP(l),m.updateItemHTML(),u("BuildControls"),c("html").css(s),m.bgOverlay.add(m.wrap).prependTo(m.st.prependTo||c(document.body)),m._lastFocusedEl=document.activeElement,setTimeout(function(){m.content?(m._addClassToMFP(T),m._setFocus()):m.bgOverlay.addClass(T),g.on("focusin"+I,m._onFocusIn)},16),m.isOpen=!0,m.updateSize(a),u(b),e}m.updateItemHTML()},close:function(){m.isOpen&&(u(F),m.isOpen=!1,m.st.removalDelay&&!m.isLowIE&&m.supportsTransition?(m._addClassToMFP(N),setTimeout(function(){m._close()},m.st.removalDelay)):m._close())},_close:function(){u(w);var e=N+" "+T+" ";m.bgOverlay.detach(),m.wrap.detach(),m.container.empty(),m.st.mainClass&&(e+=m.st.mainClass+" "),m._removeClassFromMFP(e),m.fixedContentPos&&(e={marginRight:""},m.isIE7?c("body, html").css("overflow",""):e.overflow="",c("html").css(e)),g.off("keyup.mfp focusin"+I),m.ev.off(I),m.wrap.attr("class","mfp-wrap").removeAttr("style"),m.bgOverlay.attr("class","mfp-bg"),m.container.attr("class","mfp-container"),!m.st.showCloseBtn||m.st.closeBtnInside&&!0!==m.currTemplate[m.currItem.type]||m.currTemplate.closeBtn&&m.currTemplate.closeBtn.detach(),m.st.autoFocusLast&&m._lastFocusedEl&&c(m._lastFocusedEl).trigger("focus"),m.currItem=null,m.content=null,m.currTemplate=null,m.prevHeight=0,u("AfterClose")},updateSize:function(e){var t;m.isIOS?(t=document.documentElement.clientWidth/window.innerWidth,t=window.innerHeight*t,m.wrap.css("height",t),m.wH=t):m.wH=e||_.height(),m.fixedContentPos||m.wrap.css("height",m.wH),u("Resize")},updateItemHTML:function(){var e=m.items[m.index],t=(m.contentContainer.detach(),m.content&&m.content.detach(),(e=e.parsed?e:m.parseEl(m.index)).type),n=(u("BeforeChange",[m.currItem?m.currItem.type:"",t]),m.currItem=e,m.currTemplate[t]||(n=!!m.st[t]&&m.st[t].markup,u("FirstMarkupParse",n),m.currTemplate[t]=!n||c(n)),s&&s!==e.type&&m.container.removeClass("mfp-"+s+"-holder"),m["get"+t.charAt(0).toUpperCase()+t.slice(1)](e,m.currTemplate[t]));m.appendContent(n,t),e.preloaded=!0,u(j,e),s=e.type,m.container.prepend(m.contentContainer),u("AfterChange")},appendContent:function(e,t){(m.content=e)?m.st.showCloseBtn&&m.st.closeBtnInside&&!0===m.currTemplate[t]?m.content.find(".mfp-close").length||m.content.append(f()):m.content=e:m.content="",u("BeforeAppend"),m.container.addClass("mfp-"+t+"-holder"),m.contentContainer.append(m.content)},parseEl:function(e){var t,n=m.items[e];if((n=n.tagName?{el:c(n)}:(t=n.type,{data:n,src:n.src})).el){for(var o=m.types,i=0;i<o.length;i++)if(n.el.hasClass("mfp-"+o[i])){t=o[i];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=t||m.st.type||"inline",n.index=e,n.parsed=!0,m.items[e]=n,u("ElementParse",n),m.items[e]},addGroup:function(t,n){function e(e){e.mfpEl=this,m._openClick(e,t,n)}var o="click.magnificPopup";(n=n||{}).mainEl=t,n.items?(n.isObj=!0,t.off(o).on(o,e)):(n.isObj=!1,n.delegate?t.off(o).on(o,n.delegate,e):(n.items=t).off(o).on(o,e))},_openClick:function(e,t,n){var o=(void 0!==n.midClick?n:c.magnificPopup.defaults).midClick;if(o||!(2===e.which||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)){o=(void 0!==n.disableOn?n:c.magnificPopup.defaults).disableOn;if(o)if("function"==typeof o){if(!o.call(m))return!0}else if(_.width()<o)return!0;e.type&&(e.preventDefault(),m.isOpen)&&e.stopPropagation(),n.el=c(e.mfpEl),n.delegate&&(n.items=t.find(n.delegate)),m.open(n)}},updateStatus:function(e,t){var n;m.preloader&&(o!==e&&m.container.removeClass("mfp-s-"+o),n={status:e,text:t=t||"loading"!==e?t:m.st.tLoading},u("UpdateStatus",n),e=n.status,t=n.text,m.st.allowHTMLInStatusIndicator?m.preloader.html(t):m.preloader.text(t),m.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),m.container.addClass("mfp-s-"+e),o=e)},_checkIfClose:function(e){if(!c(e).closest("."+k).length){var t=m.st.closeOnContentClick,n=m.st.closeOnBgClick;if(t&&n)return!0;if(!m.content||c(e).closest(".mfp-close").length||m.preloader&&e===m.preloader[0])return!0;if(e===m.content[0]||c.contains(m.content[0],e)){if(t)return!0}else if(n&&c.contains(document,e))return!0;return!1}},_addClassToMFP:function(e){m.bgOverlay.addClass(e),m.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),m.wrap.removeClass(e)},_hasScrollBar:function(e){return(m.isIE7?g.height():document.body.scrollHeight)>(e||_.height())},_setFocus:function(){(m.st.focus?m.content.find(m.st.focus).eq(0):m.wrap).trigger("focus")},_onFocusIn:function(e){if(e.target!==m.wrap[0]&&!c.contains(m.wrap[0],e.target))return m._setFocus(),!1},_parseMarkup:function(i,e,t){var r;t.data&&(e=c.extend(t.data,e)),u(C,[i,e,t]),c.each(e,function(e,t){if(void 0===t||!1===t)return!0;var n,o;1<(r=e.split("_")).length?0<(n=i.find(I+"-"+r[0])).length&&("replaceWith"===(o=r[1])?n[0]!==t[0]&&n.replaceWith(t):"img"===o?n.is("img")?n.attr("src",t):n.replaceWith(c("<img>").attr("src",t).attr("class",n.attr("class"))):n.attr(r[1],t)):m.st.allowHTMLInTemplate?i.find(I+"-"+e).html(t):i.find(I+"-"+e).text(t)})},_getScrollbarSize:function(){var e;return void 0===m.scrollbarSize&&((e=document.createElement("div")).style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),m.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),m.scrollbarSize}},modules:[],open:function(e,t){return r(),(e=e?c.extend(!0,{},e):{}).isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return c.magnificPopup.instance&&c.magnificPopup.instance.close()},registerModule:function(e,t){t.options&&(c.magnificPopup.defaults[e]=t.options),c.extend(this.proto,t.proto),this.modules.push(e)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0,allowHTMLInStatusIndicator:!1,allowHTMLInTemplate:!1}},c.fn.magnificPopup=function(e){r();var t,n,o,i=c(this);return"string"==typeof e?"open"===e?(t=P?i.data("magnificPopup"):i[0].magnificPopup,n=parseInt(arguments[1],10)||0,o=t.items?t.items[n]:(o=i,(o=t.delegate?o.find(t.delegate):o).eq(n)),m._openClick({mfpEl:o},i,t)):m.isOpen&&m[e].apply(m,Array.prototype.slice.call(arguments,1)):(e=c.extend(!0,{},e),P?i.data("magnificPopup",e):i[0].magnificPopup=e,m.addGroup(i,e)),i},"inline"),E=(c.magnificPopup.registerModule(S,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){m.types.push(S),d(w+"."+S,function(){a()})},getInline:function(e,t){var n,o,i;return a(),e.src?(n=m.st.inline,(o=c(e.src)).length?((i=o[0].parentNode)&&i.tagName&&(v||(l=n.hiddenClass,v=p(l),l="mfp-"+l),y=o.after(v).detach().removeClass(l)),m.updateStatus("ready")):(m.updateStatus("error",n.tNotFound),o=c("<div>")),e.inlineElement=o):(m.updateStatus("ready"),m._parseMarkup(t,{},e),t)}}}),"ajax");c.magnificPopup.registerModule(E,{options:{settings:null,cursor:"mfp-ajax-cur",tError:"The content could not be loaded."},proto:{initAjax:function(){m.types.push(E),n=m.st.ajax.cursor,d(w+"."+E,t),d("BeforeChange."+E,t)},getAjax:function(o){n&&c(document.body).addClass(n),m.updateStatus("loading");var e=c.extend({url:o.src,success:function(e,t,n){e={data:e,xhr:n};u("ParseAjax",e),m.appendContent(c(e.data),E),o.finished=!0,i(),m._setFocus(),setTimeout(function(){m.wrap.addClass(T)},16),m.updateStatus("ready"),u("AjaxContentAdded")},error:function(){i(),o.finished=o.loadError=!0,m.updateStatus("error",m.st.ajax.tError.replace("%url%",o.src))}},m.st.ajax.settings);return m.req=c.ajax(e),""}}});var z;c.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:"The image could not be loaded."},proto:{initImage:function(){var e=m.st.image,t=".image";m.types.push("image"),d(b+t,function(){"image"===m.currItem.type&&e.cursor&&c(document.body).addClass(e.cursor)}),d(w+t,function(){e.cursor&&c(document.body).removeClass(e.cursor),_.off("resize"+I)}),d("Resize"+t,m.resizeImage),m.isLowIE&&d("AfterChange",m.resizeImage)},resizeImage:function(){var e,t=m.currItem;t&&t.img&&m.st.image.verticalFit&&(e=0,m.isLowIE&&(e=parseInt(t.img.css("padding-top"),10)+parseInt(t.img.css("padding-bottom"),10)),t.img.css("max-height",m.wH-e))},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,z&&clearInterval(z),e.isCheckingImgSize=!1,u("ImageHasSize",e),e.imgHidden)&&(m.content&&m.content.removeClass("mfp-loading"),e.imgHidden=!1)},findImageSize:function(t){function n(e){z&&clearInterval(z),z=setInterval(function(){0<i.naturalWidth?m._onImageHasSize(t):(200<o&&clearInterval(z),3===++o?n(10):40===o?n(50):100===o&&n(500))},e)}var o=0,i=t.img[0];n(1)},getImage:function(e,t){function n(){e&&(e.img.off(".mfploader"),e===m.currItem&&(m._onImageHasSize(e),m.updateStatus("error",a.tError.replace("%url%",e.src))),e.hasSize=!0,e.loaded=!0,e.loadError=!0)}function o(){e&&(e.img[0].complete?(e.img.off(".mfploader"),e===m.currItem&&(m._onImageHasSize(e),m.updateStatus("ready")),e.hasSize=!0,e.loaded=!0,u("ImageLoadComplete")):++r<200?setTimeout(o,100):n())}var i,r=0,a=m.st.image,s=t.find(".mfp-img");return s.length&&((i=document.createElement("img")).className="mfp-img",e.el&&e.el.find("img").length&&(i.alt=e.el.find("img").attr("alt")),e.img=c(i).on("load.mfploader",o).on("error.mfploader",n),i.src=e.src,s.is("img")&&(e.img=e.img.clone()),0<(i=e.img[0]).naturalWidth?e.hasSize=!0:i.width||(e.hasSize=!1)),m._parseMarkup(t,{title:function(e){if(e.data&&void 0!==e.data.title)return e.data.title;var t=m.st.image.titleSrc;if(t){if("function"==typeof t)return t.call(m,e);if(e.el)return e.el.attr(t)||""}return""}(e),img_replaceWith:e.img},e),m.resizeImage(),e.hasSize?(z&&clearInterval(z),e.loadError?(t.addClass("mfp-loading"),m.updateStatus("error",a.tError.replace("%url%",e.src))):(t.removeClass("mfp-loading"),m.updateStatus("ready"))):(m.updateStatus("loading"),e.loading=!0,e.hasSize||(e.imgHidden=!0,t.addClass("mfp-loading"),m.findImageSize(e))),t}}});function O(e){var t;m.currTemplate[L]&&(t=m.currTemplate[L].find("iframe")).length&&(e||(t[0].src="//about:blank"),m.isIE8)&&t.css("display",e?"block":"none")}function M(e){var t=m.items.length;return t-1<e?e-t:e<0?t+e:e}function D(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)}c.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,t,n,o,i,r,a=m.st.zoom,s=".zoom";a.enabled&&m.supportsTransition&&(t=a.duration,n=function(e){var e=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),t="all "+a.duration/1e3+"s "+a.easing,n={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},o="transition";return n["-webkit-"+o]=n["-moz-"+o]=n["-o-"+o]=n[o]=t,e.css(n),e},o=function(){m.content.css("visibility","visible")},d("BuildControls"+s,function(){m._allowZoom()&&(clearTimeout(i),m.content.css("visibility","hidden"),(e=m._getItemToZoom())?((r=n(e)).css(m._getOffset()),m.wrap.append(r),i=setTimeout(function(){r.css(m._getOffset(!0)),i=setTimeout(function(){o(),setTimeout(function(){r.remove(),e=r=null,u("ZoomAnimationEnded")},16)},t)},16)):o())}),d(F+s,function(){if(m._allowZoom()){if(clearTimeout(i),m.st.removalDelay=t,!e){if(!(e=m._getItemToZoom()))return;r=n(e)}r.css(m._getOffset(!0)),m.wrap.append(r),m.content.css("visibility","hidden"),setTimeout(function(){r.css(m._getOffset())},16)}}),d(w+s,function(){m._allowZoom()&&(o(),r&&r.remove(),e=null)}))},_allowZoom:function(){return"image"===m.currItem.type},_getItemToZoom:function(){return!!m.currItem.hasSize&&m.currItem.img},_getOffset:function(e){var e=e?m.currItem.img:m.st.zoom.opener(m.currItem.el||m.currItem),t=e.offset(),n=parseInt(e.css("padding-top"),10),o=parseInt(e.css("padding-bottom"),10),e=(t.top-=c(window).scrollTop()-n,{width:e.width(),height:(P?e.innerHeight():e[0].offsetHeight)-o-n});return(B=void 0===B?void 0!==document.createElement("p").style.MozTransform:B)?e["-moz-transform"]=e.transform="translate("+t.left+"px,"+t.top+"px)":(e.left=t.left,e.top=t.top),e}}});var B,L="iframe",H=(c.magnificPopup.registerModule(L,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){m.types.push(L),d("BeforeChange",function(e,t,n){t!==n&&(t===L?O():n===L&&O(!0))}),d(w+"."+L,function(){O()})},getIframe:function(e,t){var n=e.src,o=m.st.iframe,i=(c.each(o.patterns,function(){if(-1<n.indexOf(this.index))return this.id&&(n="string"==typeof this.id?n.substr(n.lastIndexOf(this.id)+this.id.length,n.length):this.id.call(this,n)),n=this.src.replace("%id%",n),!1}),{});return o.srcAction&&(i[o.srcAction]=n),m._parseMarkup(t,i,e),m.updateStatus("ready"),t}}}),c.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%",langDir:null,loop:!0},proto:{initGallery:function(){var r=m.st.gallery,e=".mfp-gallery";if(m.direction=!0,!r||!r.enabled)return!1;r.langDir||(r.langDir=document.dir||"ltr"),h+=" mfp-gallery",d(b+e,function(){r.navigateByImgClick&&m.wrap.on("click"+e,".mfp-img",function(){if(1<m.items.length)return m.next(),!1}),g.on("keydown"+e,function(e){37===e.keyCode?"rtl"===r.langDir?m.next():m.prev():39===e.keyCode&&("rtl"===r.langDir?m.prev():m.next())}),m.updateGalleryButtons()}),d("UpdateStatus"+e,function(){m.updateGalleryButtons()}),d("UpdateStatus"+e,function(e,t){t.text&&(t.text=D(t.text,m.currItem.index,m.items.length))}),d(C+e,function(e,t,n,o){var i=m.items.length;n.counter=1<i?D(r.tCounter,o.index,i):""}),d("BuildControls"+e,function(){var e,t,n,o,i;1<m.items.length&&r.arrows&&!m.arrowLeft&&(t="rtl"===r.langDir?(o=r.tNext,e=r.tPrev,i="next","prev"):(o=r.tPrev,e=r.tNext,i="prev","next"),n=r.arrowMarkup,o=m.arrowLeft=c(n.replace(/%title%/gi,o).replace(/%action%/gi,i).replace(/%dir%/gi,"left")).addClass(k),i=m.arrowRight=c(n.replace(/%title%/gi,e).replace(/%action%/gi,t).replace(/%dir%/gi,"right")).addClass(k),"rtl"===r.langDir?(m.arrowNext=o,m.arrowPrev=i):(m.arrowNext=i,m.arrowPrev=o),o.on("click",function(){"rtl"===r.langDir?m.next():m.prev()}),i.on("click",function(){"rtl"===r.langDir?m.prev():m.next()}),m.container.append(o.add(i)))}),d(j+e,function(){m._preloadTimeout&&clearTimeout(m._preloadTimeout),m._preloadTimeout=setTimeout(function(){m.preloadNearbyImages(),m._preloadTimeout=null},16)}),d(w+e,function(){g.off(e),m.wrap.off("click"+e),m.arrowRight=m.arrowLeft=null})},next:function(){var e=M(m.index+1);if(!m.st.gallery.loop&&0===e)return!1;m.direction=!0,m.index=e,m.updateItemHTML()},prev:function(){var e=m.index-1;if(!m.st.gallery.loop&&e<0)return!1;m.direction=!1,m.index=M(e),m.updateItemHTML()},goTo:function(e){m.direction=e>=m.index,m.index=e,m.updateItemHTML()},preloadNearbyImages:function(){for(var e=m.st.gallery.preload,t=Math.min(e[0],m.items.length),n=Math.min(e[1],m.items.length),o=1;o<=(m.direction?n:t);o++)m._preloadItem(m.index+o);for(o=1;o<=(m.direction?t:n);o++)m._preloadItem(m.index-o)},_preloadItem:function(e){var t;e=M(e),m.items[e].preloaded||((t=m.items[e]).parsed||(t=m.parseEl(e)),u("LazyLoad",t),"image"===t.type&&(t.img=c('<img class="mfp-img" />').on("load.mfploader",function(){t.hasSize=!0}).on("error.mfploader",function(){t.hasSize=!0,t.loadError=!0,u("LazyLoadError",t)}).attr("src",t.src)),t.preloaded=!0)},updateGalleryButtons:function(){m.st.gallery.loop||"object"!=typeof m.arrowPrev||null===m.arrowPrev||(0===m.index?m.arrowPrev.hide():m.arrowPrev.show(),m.index===m.items.length-1?m.arrowNext.hide():m.arrowNext.show())}}}),"retina");c.magnificPopup.registerModule(H,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){var n,o;1<window.devicePixelRatio&&(n=m.st.retina,o=n.ratio,1<(o=isNaN(o)?o():o))&&(d("ImageHasSize."+H,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/o,width:"100%"})}),d("ElementParse."+H,function(e,t){t.src=n.replaceSrc(t,o)}))}}}),r()});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.