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