vendor: 87 bytes, lines 1-4
1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ "./
4app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/clientSideValidation.js": 5/*!***************************************************************************************************************************!*\ 6 !*** ./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/clientSideValidation.js ***! 7 \***************************************************************************************************************************/ 8/***/ ((module) => { 9 10"use strict"; 11 12 13/** 14 * Validate whole form. Requires `this` to be set to form object 15 * @param {jQuery.event} event - Event to be canceled if form is invalid. 16 * @returns {boolean} - Flag to indicate if form is valid 17 */ 18function _validateForm(event) { 19 var valid = true; 20 if (this.checkValidity && !this.checkValidity()) { 21 // safari 22 valid = false; 23 if (event) { 24 event.preventDefault(); 25 event.stopPropagation(); 26 event.stopImmediatePropagation(); 27 } 28 $(this).find('input, select, textarea').each(function () { 29 if (!this.validity.valid) { 30 $(this).trigger('invalid', this.validity); 31 } 32 }); 33 } 34 return valid; 35} 36 37/** 38 * Remove all validation. Should be called every time before revalidating form 39 * @param {element} form - Form to be cleared 40 * @returns {void} 41 */ 42function clearForm(form) { 43 $(form).find('.form-control.is-invalid').removeClass('is-invalid'); 44 $(form).find('.invalid-feedback').text(''); 45} 46module.exports = {
47 invalid: function invalid() { 48 $('form input, form select, form textarea').on('invalid', function (e) { 49 e.preventDefault(); 50 this.setCustomValidity(''); 51 if (!this.validity.valid) { 52 var validationMessage = this.validationMessage; 53 $(this).addClass('is-invalid'); 54 // Due to the input with type email has many validations 55 // So need to set it invalid with the pattern mismatch error 56 // (When all validity is false, but this.validity.valid is still not true) 57 if (this.validity.patternMismatch && $(this).data('pattern-mismatch') || Object.values(this.validity).every(function (value) { 58 return !value; 59 })) { 60 validationMessage = $(this).data('pattern-mismatch'); 61 } 62 if ((this.validity.rangeOverflow || this.validity.rangeUnderflow) && $(this).data('range-error')) { 63 validationMessage = $(this).data('range-error'); 64 } 65 if ((this.validity.tooLong || this.validity.tooShort) && $(this).data('range-error')) { 66 validationMessage = $(this).data('range-error'); 67 } 68 if (this.validity.valueMissing && $(this).data('missing-error')) { 69 validationMessage = $(this).data('missing-error'); 70 } 71 $(this).parents('.form-group').find('.invalid-feedback').text(validationMessage); 72 } 73 }); 74 }, 75 submit: function submit() { 76 $('form').on('submit', function (e) { 77 return _validateForm.call(this, e); 78 }); 79 }, 80 buttonClick: function buttonClick() { 81 $('form button[type="submit"], form input[type="submit"]').on('click', function () { 82 // clear all errors when trying to submit the form 83 clearForm($(this).parents('form')); 84 }); 85 }, 86 functions: { 87 validateForm: function validateForm(form, event) { 88 var isValidForm = _validateForm.call(form, event || null); 89 return isValidForm; 90 }, 91 clearForm: clearForm 92 } 93}; 94 95/***/ }), 96
97/***/ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/emailValidation.js": 98/*!**********************************************************************************************************************!*\ 99 !*** ./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/emailValidation.js ***! 100 \**********************************************************************************************************************/ 101/***/ ((module) => { 102 103"use strict"; 104 105 106module.exports = function (email) { 107 var split = email.split('@'); 108 var regex = email.match(/^[A-Za-z0-9_.+\/?-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/) && split.length == 2 && !split[0].match(/[\s,()\[\];:%*<>\""{}]/) && !split[0].match(/^[\.]|[\x01-\x1F]|[\x7f-\xff]/) && !split[1].match(/^\.|\.\.|\.$|[^a-zA-Z0-9\.\-\_]/); 109 return regex; 110}; 111 112/***/ }), 113
114/***/ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/search.js": 115/*!*************************************************************************************************************!*\ 116 !*** ./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/search.js ***! 117 \*************************************************************************************************************/ 118/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 119 120"use strict"; 121 122 123function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } 124function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } 125function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 126function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 127var debounce = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js"); 128var endpoint = $(".suggestions-wrapper").data("url"); 129var minChars = $(".suggestions-wrapper").data("min-chars") || 10; 130var UP_KEY = 38; 131var DOWN_KEY = 40; 132var DIRECTION_DOWN = 1; 133var DIRECTION_UP = -1; 134 135/** 136 * Retrieves Suggestions element relative to scope 137 * 138 * @param {Object} scope - Search input field DOM element 139 * @return {JQuery} - .suggestions-wrapper element 140 */ 141function getSuggestionsWrapper(scope) { 142 return $(scope).siblings(".suggestions-wrapper"); 143} 144 145/** 146 * Determines whether DOM element is inside the .search-mobile class 147 * 148 * @param {Object} scope - DOM element, usually the input.search-field element 149 * @return {boolean} - Whether DOM element is inside div.search-mobile 150 */ 151function isMobileSearch(scope) { 152 return !!$(scope).closest(".search-mobile").length; 153} 154 155/** 156 * Remove modal classes needed for mobile suggestions 157 * 158 */ 159function clearModals(menuType) { 160 $("body").removeClass("modal-open"); 161 $("header").siblings().attr("aria-hidden", "false"); 162 $(".suggestions").removeClass("modal"); 163 if (menuType === "pc") { 164 $("#sp-search-suggestions-result").empty(); 165 } else { 166 $(".cmn-header__navigation-pc-search").empty(); 167 } 168} 169 170/** 171 * Apply modal classes needed for mobile suggestions 172 * 173 * @param {Object} scope - Search input field DOM element 174 */ 175function applyModals(scope) { 176 if (isMobileSearch(scope)) { 177 $("body").addClass("modal-open"); 178 $("header").siblings().attr("aria-hidden", "true"); 179 getSuggestionsWrapper(scope).find(".suggestions").addClass("modal"); 180 } 181} 182 183/** 184 * Tear down Suggestions panel 185 */ 186function tearDownSuggestions() { 187 $("input.search-field").val(""); 188 clearModals(); 189 $(".search-mobile .suggestions").unbind("scroll"); 190 $(".suggestions-wrapper").empty(); 191} 192 193/**
194 * Toggle search field icon from search to close and vice-versa 195 * 196 * @param {string} action - Action to toggle to 197 */ 198function toggleSuggestionsIcon(action) { 199 var mobileSearchIcon = ".search-mobile button."; 200 var iconSearch = "fa-search"; 201 var iconSearchClose = "fa-close"; 202 if (action === "close") { 203 $(mobileSearchIcon + iconSearch).removeClass(iconSearch).addClass(iconSearchClose).attr("type", "button"); 204 } else { 205 $(mobileSearchIcon + iconSearchClose).removeClass(iconSearchClose).addClass(iconSearch).attr("type", "submit"); 206 } 207} 208 209/** 210 * Determines whether the "More Content Below" icon should be displayed 211 * 212 * @param {Object} scope - DOM element, usually the input.search-field element 213 */ 214function handleMoreContentBelowIcon(scope) { 215 if ($(scope).scrollTop() + $(scope).innerHeight() >= $(scope)[0].scrollHeight) { 216 $(".more-below").fadeOut(); 217 } else { 218 $(".more-below").fadeIn(); 219 } 220} 221 222/** 223 * Positions Suggestions panel on page 224 * 225 * @param {Object} scope - DOM element, usually the input.search-field element 226 */ 227function positionSuggestions(scope) { 228 var outerHeight; 229 var $scope; 230 var $suggestions; 231 var top; 232 if (isMobileSearch(scope)) { 233 $scope = $(scope); 234 top = $scope.offset().top; 235 outerHeight = $scope.outerHeight(); 236 $suggestions = getSuggestionsWrapper(scope).find(".suggestions"); 237 $suggestions.css("top", top + outerHeight); 238 handleMoreContentBelowIcon(scope); 239 240 // Unfortunately, we have to bind this dynamically, as the live scroll event was not 241 // properly detecting dynamic suggestions element's scroll event 242 $suggestions.scroll(function () { 243 handleMoreContentBelowIcon(this); 244 }); 245 } 246} 247 248/** 249 * Process Ajax response for SearchServices-GetSuggestions 250 * 251 * @param {Object|string} response - Empty object literal if null response or string with rendered 252 * suggestions template contents 253 * @param {string} menuType - PC or SP 254 */ 255function processResponse(response, menuType, searchInput) { 256 var $suggestionsWrapper = $(".cmn-header__navigation-pc-search").empty(); 257 if (menuType === "sp") { 258 var $suggestionsWrapper = $("#sp-search-suggestions-result").empty(); 259 } 260 storeSearchInput(searchInput); 261 $.spinner().stop(); 262 if (_typeof(response) !== "object") { 263 $suggestionsWrapper.append(response).show(); 264 $('.cmn-header__navigation-pc__inner').animate({ 265 height: 410 266 }, 300); 267 $(this).siblings(".reset-button").addClass("d-sm-block"); 268 positionSuggestions(this); 269 if (isMobileSearch(this)) { 270 toggleSuggestionsIcon("close"); 271 applyModals(this); 272 } 273 274 // Trigger screen reader by setting aria-describedby with the new suggestion message. 275 var suggestionsList = $(".suggestions .item"); 276 if ($(suggestionsList).length) { 277 $("input.search-field").attr("aria-describedby", "search-result-count"); 278 } else { 279 $("input.search-field").removeAttr("aria-describedby"); 280 } 281 } else { 282 $suggestionsWrapper.empty(); 283 } 284 appendSearchHistory(); 285} 286 287/** 288 * Retrieve suggestions 289 * 290 * @param {Object} scope - Search field DOM element 291 */ 292function getSuggestions(scope) { 293 var menuType = $(scope).data("type"); 294 var requestURL = endpoint + encodeURIComponent($(scope).val()) + "&type=" + menuType; 295 if ($(scope).val().length >= minChars) { 296 $.spinner().start(); 297 $.ajax({ 298 context: scope, 299 url: requestURL, 300 method: "GET", 301 success: function success(response) { 302 processResponse(response, menuType, $(scope).val()); 303 }, 304 error: function error() { 305 $.spinner().stop(); 306 } 307 }); 308 } else { 309 toggleSuggestionsIcon("search"); 310 $(scope).siblings(".reset-button").removeClass("d-sm-block"); 311 clearModals(menuType); 312 getSuggestionsWrapper(scope).empty(); 313 } 314} 315 316/** 317 * Handle Search Suggestion Keyboard Arrow Keys 318 * 319 * @param {Integer} direction takes positive or negative number constant, DIRECTION_UP (-1) or DIRECTION_DOWN (+1) 320 */ 321function handleArrow(direction) { 322 // get all li elements in the suggestions list 323 var suggestionsList = $(".suggestions .item"); 324 if (suggestionsList.filter(".selected").length === 0) { 325 suggestionsList.first().addClass("selected"); 326 $("input.search-field").each(function () { 327 $(this).attr("aria-activedescendant", suggestionsList.first()[0].id); 328 }); 329 } else { 330 suggestionsList.each(function (index) { 331 var idx = index + direction; 332 if ($(this).hasClass("selected")) { 333 $(this).removeClass("selected"); 334 $(this).removeAttr("aria-selected"); 335 if (suggestionsList.eq(idx).length !== 0) { 336 suggestionsList.eq(idx).addClass("selected"); 337 suggestionsList.eq(idx).attr("aria-selected", true); 338 $(this).removeProp("aria-selected"); 339 $("input.search-field").each(function () { 340 $(this).attr("aria-activedescendant", suggestionsList.eq(idx)[0].id); 341 }); 342 } else { 343 suggestionsList.first().addClass("selected"); 344 suggestionsList.first().attr("aria-selected", true); 345 $("input.search-field").each(function () { 346 $(this).attr("aria-activedescendant", suggestionsList.first()[0].id); 347 }); 348 } 349 return false;
350 } 351 return true; 352 }); 353 } 354} 355 356/** 357 * Store search input in local storage 358 * @param {String} searchInput The input to be stored 359 * @return {void} 360*/ 361function storeSearchInput(searchInput) { 362 var searchHistory = JSON.parse(localStorage.getItem("searchHistory")); 363 if (!searchHistory) { 364 searchHistory = []; 365 } 366 367 // Encode HTML in searchInput 368 var encodedSearchInput = encodeURIComponent(searchInput); 369 370 // Check if searchHistory has more than 5 items 371 if (searchHistory.length >= 5) { 372 // If it does, remove the last item 373 searchHistory.pop(); 374 } 375 376 // Check if searchInput exists in searchHistory 377 if (searchHistory.includes(encodedSearchInput)) { 378 // If it does, bring it to the first item 379 searchHistory.splice(searchHistory.indexOf(encodedSearchInput), 1); 380 } 381 // Push searchInput to the beginning of searchHistory 382 searchHistory.unshift(encodedSearchInput); 383 localStorage.setItem("searchHistory", JSON.stringify(searchHistory)); 384} 385 386/** 387 * Retrieves the search history from local storage and decodes HTML in each item of the search history 388 * @return {Array<string>} Array of decoded search history items 389 */ 390function getSearchHistory() { 391 var searchHistory = JSON.parse(localStorage.getItem("searchHistory")); 392 if (!searchHistory) { 393 searchHistory = []; 394 } 395 // Decode HTML in each item of searchHistory 396 searchHistory = searchHistory.map(function (item) { 397 return decodeURIComponent(item); 398 }); 399 return searchHistory; 400} 401 402/** 403 * Escapes HTML special characters in a string 404 * @param {String} string The string to be escaped 405 * @return {String} Escaped string 406 */ 407function escapeHtml(string) { 408 return string.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, '''); 409} 410 411/** 412 * Parses the search history to generate HTML tags for the previous search inputs 413 * @param getSearchHistory Function that returns an array of previous search inputs 414 * @return {String} HTML tags for the previous search inputs 415 */ 416function parseSearchHistory() { 417 var previousSearchInputs = getSearchHistory(); 418 var prevSearchHtmlTag = ""; 419 var searchEndpoint = $('div#search-result').data('search'); 420 if (previousSearchInputs && previousSearchInputs.length) { 421 var _iterator = _createForOfIteratorHelper(previousSearchInputs), 422 _step; 423 try { 424 for (_iterator.s(); !(_step = _iterator.n()).done;) { 425 var input = _step.value; 426 var encodedInput = encodeURIComponent(input); 427 prevSearchHtmlTag += "<li role=\"option\"><a href=\"".concat(searchEndpoint + '?q=' + encodedInput, "\">").concat(escapeHtml(input), "</a></li>"); 428 } 429 } catch (err) { 430 _iterator.e(err); 431 } finally { 432 _iterator.f(); 433 } 434 } 435 return prevSearchHtmlTag; 436} 437 438/** 439 * Append search history to the page 440 */ 441function appendSearchHistory() { 442 var prevSearchHtmlTag = parseSearchHistory(); 443 $(document).find("ul.recent_search").html(prevSearchHtmlTag); 444} 445module.exports = function () { 446 $('form[name="simpleSearch"]').submit(function (e) { 447 var searchValue = $(this).find('input.search-field').val(); 448 if (!searchValue || searchValue.trim().length === 0) { 449 e.preventDefault(); 450 return; 451 } 452 var suggestionsList = $(".suggestions .item"); 453 if (suggestionsList.filter(".selected").length !== 0) { 454 e.preventDefault(); 455 suggestionsList.filter(".selected").find("a")[0].click(); 456 } 457 }); 458 $("input.search-field").each(function () { 459 /** 460 * Use debounce to avoid making an Ajax call on every single key press by waiting a few 461 * hundred milliseconds before making the request. Without debounce, the user sees the 462 * browser blink with every key press. 463 */ 464 var debounceSuggestions = debounce(getSuggestions, 500); 465 $(this).on("keyup focus", function (e) { 466 var searchValue = $(this).val(); 467 if (!searchValue || searchValue.trim().length === 0) { 468 e.preventDefault(); 469 return; 470 } 471 // Capture Down/Up Arrow Key Events 472 switch (e.which) { 473 case DOWN_KEY: 474 handleArrow(DIRECTION_DOWN); 475 e.preventDefault(); // prevent moving the cursor 476 break; 477 case UP_KEY: 478 handleArrow(DIRECTION_UP); 479 e.preventDefault(); // prevent moving the cursor 480 break; 481 default: 482 debounceSuggestions(this, e); 483 } 484 }); 485 }); 486 $("body").on("click", function (e) { 487 if (!$(".suggestions").has(e.target).length && !$(e.target).hasClass("search-field")) { 488 $(".suggestions").hide(); 489 } 490 }); 491 $("body").on("click touchend", ".search-mobile button.fa-close", function (e) { 492 e.preventDefault(); 493 $(".suggestions").hide(); 494 toggleSuggestionsIcon("search"); 495 tearDownSuggestions(); 496 }); 497 $(function () { 498 appendSearchHistory(); 499 }); 500}; 501 502/***/ }), 503
504/***/ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/cookie.js": 505/*!**************************************************************************************************!*\ 506 !*** ./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/cookie.js ***! 507 \**************************************************************************************************/ 508/***/ (() => { 509 510"use strict"; 511 512 513function setConsent(result) { 514 var trackingConsentData = $('.tracking-consent'); 515 var url = trackingConsentData.data(result); 516 var tokenName = trackingConsentData.data('tokenname'); 517 var token = trackingConsentData.data('token'); 518 var data = {}; 519 data[tokenName] = token; 520 $.ajax({ 521 url: url, 522 type: 'post', 523 data: data, 524 dataType: 'json', 525 success: function success(response) { 526 if (response.success) { 527 $('.cookie').fadeOut(300); 528 } 529 }, 530 error: function error(err) { 531 // Expected error response is for CSRF failure, which will include a redirect to CSRF-Fail 532 if (err.responseJSON.redirectUrl) { 533 window.location.href = err.responseJSON.redirectUrl; 534 } 535 } 536 }); 537} 538function setGoogleConsent() { 539 // ç°å¢å¥è¨å®å¯¾ç 540 // æ¬çªç°å¢ä»¥å¤ã§ã¯gtag颿°ãåå¨ããªãå ´åããããã 541 if (typeof gtag == 'function') { 542 // GTMåæã¢ã¼ãæ´æ° 543 gtag('consent', 'update', { 544 'ad_storage': 'granted', 545 'ad_user_data': 'granted', 546 'ad_personalization': 'granted', 547 'analytics_storage': 'granted' 548 }); 549 } 550} 551$(function () { 552 // Google GA4ãè¨å®ãã 553 setGoogleConsent(); 554 if ($('.tracking-consent').data('tracking') === null && $('.tracking-consent').hasClass('api-true')) { 555 $('.cookie').css('display', 'flex'); 556 } 557 $('body').on('click', '.jsCookieYes', function (e) { 558 e.preventDefault(); 559 setConsent('accept'); 560 }); 561 $('body').on('click', '.jsCookieNo', function (e) { 562 e.preventDefault(); 563 setConsent('reject'); 564 }); 565}); 566 567/***/ }), 568
569/***/ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/information_bar.js": 570/*!***********************************************************************************************************!*\ 571 !*** ./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/information_bar.js ***! 572 \***********************************************************************************************************/ 573/***/ (() => { 574 575"use strict"; 576 577 578$(function () { 579 // ã¯ããã¼ã確èªãã¦è¡¨ç¤ºããã確èªãã 580 $('div.information-bar-inner').each(function (index, element) { 581 var cookieName = $(element).find('div.information-bar-close').data('id'); 582 var isCloseable = $(element).find('div.information-bar-close').data('closeable'); 583 var isExistCookie = document.cookie.split(';').find(function (row) { 584 return row.trim().startsWith(cookieName); 585 }); 586 if (isExistCookie && isCloseable) { 587 var cookieValue = isExistCookie.split('=')[1]; 588 if (cookieValue !== 'true') { 589 $(this).show(); 590 } 591 } else { 592 $(this).show(); 593 } 594 }); 595 596 // 強調CSSã®ã¯ã©ã¹ä»ä¸ 597 $('div.information-bar-text').find('strong').addClass('bold'); 598 599 // æç·CSSä»ä¸ 600 $('div.information-bar-text').find('em').css('font-style', 'italic'); 601 602 // closeãã¿ã³æ¼ä¸ 603 $('div.information-bar-close').on('click', function (e) { 604 e.preventDefault(); 605 var bar = $(this).parent(); 606 // isCloseableãtrueã®æã«ã¯cookieã«å¤ãä¿å 607 var url = $('div.information-bar-data-container').data('url'); 608 var tokenName = $('div.information-bar-data-container').data('tokenname'); 609 var token = $('div.information-bar-data-container').data('token'); 610 var data = {}; 611 data[tokenName] = token; 612 data['informationId'] = $(this).data('id'); 613 if ($(this).data('closeable')) { 614 $.ajax({ 615 url: url, 616 type: 'post', 617 data: data, 618 dataType: 'json', 619 success: function success(response) { 620 if (response.success) { 621 bar.remove(); 622 $('.jsHeader').css('top', 0); 623 } 624 }, 625 error: function error(err) { 626 // Expected error response is for CSRF failure, which will include a redirect to CSRF-Fail 627 if (err.responseJSON.redirectUrl) { 628 window.location.href = err.responseJSON.redirectUrl; 629 } 630 } 631 }); 632 } else { 633 bar.remove(); 634 $('.jsHeader').css('top', 0); 635 } 636 }); 637}); 638 639/***/ }), 640
641/***/ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/sendgrid.js": 642/*!****************************************************************************************************!*\ 643 !*** ./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/sendgrid.js ***! 644 \****************************************************************************************************/ 645/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { 646 647"use strict"; 648 649 650var emailValidation = __webpack_require__(/*! ./components/emailValidation */ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/emailValidation.js"); 651function submitSendGrid() { 652 var form = $('form.sendgrid'); 653 form.spinner().start(); 654 655 // ã¡ãã»ã¼ã¸ã®åé¤ 656 form.find('div.invalid-feedback').text(''); 657 form.find('div.success-feedback').text(''); 658 659 // emailã®ç¢ºèª 660 var emailInput = form.find('input.input__text'); 661 var email = emailInput.val(); 662 if (!email) { 663 form.find('div.invalid-feedback').text(emailInput.data('missing-error')); 664 form.spinner().stop(); 665 return false; 666 } 667 if (!emailValidation(email)) { 668 form.find('div.invalid-feedback').text(emailInput.data('pattern-mismatch')); 669 form.spinner().stop(); 670 return false; 671 } 672 var url = form.attr('action'); 673 $.ajax({ 674 url: url, 675 type: 'post', 676 dataType: 'json', 677 data: form.serialize(), 678 success: function success(data) { 679 if (data.success) { 680 // æåã¡ãã»ã¼ã¸ã®è¡¨ç¤º 681 form.find('div.success-feedback').text('We have added your address to our newsletter subscribers.'); 682 } else { 683 // 失æã¡ãã»ã¼ã¸ã®è¡¨ç¤º 684 form.find('div.invalid-feedback').text('Some error occurred when adding for the newsletter subscribers.' + 'Please take some time to retry, or contact our customer support with the error message below.' + data.errorText); 685 } 686 form.spinner().stop(); 687 }, 688 error: function error(data) { 689 if (data.responseJSON.redirectUrl) { 690 window.location.href = data.responseJSON.redirectUrl; 691 } else { 692 var errorMessage = data.responseJSON.error.errorText; 693 form.find('div.invalid-feedback').text(errorMessage); 694 form.spinner().stop(); 695 } 696 } 697 }); 698} 699$(function () { 700 $('body').on('click', 'button.button-footer-email-submit', function (e) { 701 e.preventDefault(); 702 submitSendGrid(); 703 }); 704 $('body').on('keypress', 'form.sendgrid', function (e) { 705 if (e.which == 13) { 706 e.preventDefault(); 707 submitSendGrid(); 708 } 709 }); 710}); 711 712/***/ }), 713
714/***/ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/util.js": 715/*!************************************************************************************************!*\ 716 !*** ./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/util.js ***! 717 \************************************************************************************************/ 718/***/ ((module) => { 719 720function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 721module.exports = function (include) { 722 if (typeof include === 'function') { 723 include(); 724 } else if (_typeof(include) === 'object') { 725 Object.keys(include).forEach(function (key) { 726 if (typeof include[key] === 'function') { 727 include[key](); 728 } 729 }); 730 } 731}; 732 733/***/ }), 734
vendor: 7,474 bytes, lines 735-922
735/***/ "./node_modules/bootstrap/js/src/alert.js": 736/*!************************************************!*\ 737 !*** ./node_modules/bootstrap/js/src/alert.js ***! 738 \************************************************/ 739/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 740 741"use strict"; 742__webpack_require__.r(__webpack_exports__); 743/* harmony export */ __webpack_require__.d(__webpack_exports__, { 744/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 745/* harmony export */ }); 746/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 747/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 748/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./node_modules/bootstrap/js/src/util.js"); 749function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 750function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 751function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 752function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 753function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 754function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 755/** 756 * -------------------------------------------------------------------------- 757 * Bootstrap (v4.3.1): alert.js 758 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 759 * -------------------------------------------------------------------------- 760 */ 761 762 763 764 765/** 766 * ------------------------------------------------------------------------ 767 * Constants 768 * ------------------------------------------------------------------------ 769 */ 770 771var NAME = 'alert'; 772var VERSION = '4.3.1'; 773var DATA_KEY = 'bs.alert'; 774var EVENT_KEY = ".".concat(DATA_KEY); 775var DATA_API_KEY = '.data-api'; 776var JQUERY_NO_CONFLICT = (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME]; 777var Selector = { 778 DISMISS: '[data-dismiss="alert"]' 779}; 780var Event = { 781 CLOSE: "close".concat(EVENT_KEY), 782 CLOSED: "closed".concat(EVENT_KEY), 783 CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY) 784}; 785var ClassName = { 786 ALERT: 'alert', 787 FADE: 'fade', 788 SHOW: 'show' 789}; 790 791/** 792 * ------------------------------------------------------------------------ 793 * Class Definition 794 * ------------------------------------------------------------------------ 795 */ 796var Alert = /*#__PURE__*/function () { 797 function Alert(element) { 798 _classCallCheck(this, Alert); 799 this._element = element; 800 } 801 802 // Getters 803 return _createClass(Alert, [{ 804 key: "close", 805 value: 806 // Public 807 808 function close(element) { 809 var rootElement = this._element; 810 if (element) { 811 rootElement = this._getRootElement(element); 812 } 813 var customEvent = this._triggerCloseEvent(rootElement); 814 if (customEvent.isDefaultPrevented()) { 815 return; 816 } 817 this._removeElement(rootElement); 818 } 819 }, { 820 key: "dispose", 821 value: function dispose() { 822 jquery__WEBPACK_IMPORTED_MODULE_0___default().removeData(this._element, DATA_KEY); 823 this._element = null; 824 } 825 826 // Private 827 }, { 828 key: "_getRootElement", 829 value: function _getRootElement(element) { 830 var selector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(element); 831 var parent = false; 832 if (selector) { 833 parent = document.querySelector(selector); 834 } 835 if (!parent) { 836 parent = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).closest(".".concat(ClassName.ALERT))[0]; 837 } 838 return parent; 839 } 840 }, { 841 key: "_triggerCloseEvent", 842 value: function _triggerCloseEvent(element) { 843 var closeEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.CLOSE); 844 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).trigger(closeEvent); 845 return closeEvent; 846 } 847 }, { 848 key: "_removeElement", 849 value: function _removeElement(element) { 850 var _this = this; 851 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).removeClass(ClassName.SHOW); 852 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).hasClass(ClassName.FADE)) { 853 this._destroyElement(element); 854 return; 855 } 856 var transitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(element); 857 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, function (event) { 858 return _this._destroyElement(element, event); 859 }).emulateTransitionEnd(transitionDuration); 860 } 861 }, { 862 key: "_destroyElement", 863 value: function _destroyElement(element) { 864 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).detach().trigger(Event.CLOSED).remove(); 865 } 866 867 // Static 868 }], [{ 869 key: "VERSION", 870 get: function get() { 871 return VERSION; 872 } 873 }, { 874 key: "_jQueryInterface", 875 value: function _jQueryInterface(config) { 876 return this.each(function () { 877 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 878 var data = $element.data(DATA_KEY); 879 if (!data) { 880 data = new Alert(this); 881 $element.data(DATA_KEY, data); 882 } 883 if (config === 'close') { 884 data[config](this); 885 } 886 }); 887 } 888 }, { 889 key: "_handleDismiss", 890 value: function _handleDismiss(alertInstance) { 891 return function (event) { 892 if (event) { 893 event.preventDefault(); 894 } 895 alertInstance.close(this); 896 }; 897 } 898 }]); 899}(); 900/** 901 * ------------------------------------------------------------------------ 902 * Data Api implementation 903 * ------------------------------------------------------------------------ 904 */ 905jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); 906 907/** 908 * ------------------------------------------------------------------------ 909 * jQuery 910 * ------------------------------------------------------------------------ 911 */ 912 913(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = Alert._jQueryInterface; 914(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].Constructor = Alert; 915(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].noConflict = function () { 916 (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = JQUERY_NO_CONFLICT; 917 return Alert._jQueryInterface; 918}; 919/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Alert); 920 921/***/ }), 922
vendor: 23,813 bytes, lines 923-1498
923/***/ "./node_modules/bootstrap/js/src/carousel.js": 924/*!***************************************************!*\ 925 !*** ./node_modules/bootstrap/js/src/carousel.js ***! 926 \***************************************************/ 927/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 928 929"use strict"; 930__webpack_require__.r(__webpack_exports__); 931/* harmony export */ __webpack_require__.d(__webpack_exports__, { 932/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 933/* harmony export */ }); 934/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 935/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 936/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./node_modules/bootstrap/js/src/util.js"); 937function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 938function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 939function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 940function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 941function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 942function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 943function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 944function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 945function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 946/** 947 * -------------------------------------------------------------------------- 948 * Bootstrap (v4.3.1): carousel.js 949 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 950 * -------------------------------------------------------------------------- 951 */ 952 953 954 955 956/** 957 * ------------------------------------------------------------------------ 958 * Constants 959 * ------------------------------------------------------------------------ 960 */ 961 962var NAME = 'carousel'; 963var VERSION = '4.3.1'; 964var DATA_KEY = 'bs.carousel'; 965var EVENT_KEY = ".".concat(DATA_KEY); 966var DATA_API_KEY = '.data-api'; 967var JQUERY_NO_CONFLICT = (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME]; 968var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 969var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 970var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 971var SWIPE_THRESHOLD = 40; 972var Default = { 973 interval: 5000, 974 keyboard: true, 975 slide: false, 976 pause: 'hover', 977 wrap: true, 978 touch: true 979}; 980var DefaultType = { 981 interval: '(number|boolean)', 982 keyboard: 'boolean', 983 slide: '(boolean|string)', 984 pause: '(string|boolean)', 985 wrap: 'boolean', 986 touch: 'boolean' 987}; 988var Direction = { 989 NEXT: 'next', 990 PREV: 'prev', 991 LEFT: 'left', 992 RIGHT: 'right' 993}; 994var Event = { 995 SLIDE: "slide".concat(EVENT_KEY), 996 SLID: "slid".concat(EVENT_KEY), 997 KEYDOWN: "keydown".concat(EVENT_KEY), 998 MOUSEENTER: "mouseenter".concat(EVENT_KEY), 999 MOUSELEAVE: "mouseleave".concat(EVENT_KEY), 1000 TOUCHSTART: "touchstart".concat(EVENT_KEY), 1001 TOUCHMOVE: "touchmove".concat(EVENT_KEY), 1002 TOUCHEND: "touchend".concat(EVENT_KEY), 1003 POINTERDOWN: "pointerdown".concat(EVENT_KEY), 1004 POINTERUP: "pointerup".concat(EVENT_KEY), 1005 DRAG_START: "dragstart".concat(EVENT_KEY), 1006 LOAD_DATA_API: "load".concat(EVENT_KEY).concat(DATA_API_KEY), 1007 CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY) 1008}; 1009var ClassName = { 1010 CAROUSEL: 'carousel', 1011 ACTIVE: 'active', 1012 SLIDE: 'slide', 1013 RIGHT: 'carousel-item-right', 1014 LEFT: 'carousel-item-left', 1015 NEXT: 'carousel-item-next', 1016 PREV: 'carousel-item-prev', 1017 ITEM: 'carousel-item', 1018 POINTER_EVENT: 'pointer-event' 1019}; 1020var Selector = { 1021 ACTIVE: '.active', 1022 ACTIVE_ITEM: '.active.carousel-item', 1023 ITEM: '.carousel-item', 1024 ITEM_IMG: '.carousel-item img', 1025 NEXT_PREV: '.carousel-item-next, .carousel-item-prev', 1026 INDICATORS: '.carousel-indicators', 1027 DATA_SLIDE: '[data-slide], [data-slide-to]', 1028 DATA_RIDE: '[data-ride="carousel"]' 1029}; 1030var PointerType = { 1031 TOUCH: 'touch', 1032 PEN: 'pen' 1033}; 1034 1035/** 1036 * ------------------------------------------------------------------------ 1037 * Class Definition 1038 * ------------------------------------------------------------------------ 1039 */ 1040var Carousel = /*#__PURE__*/function () { 1041 function Carousel(element, config) { 1042 _classCallCheck(this, Carousel); 1043 this._items = null; 1044 this._interval = null; 1045 this._activeElement = null; 1046 this._isPaused = false; 1047 this._isSliding = false; 1048 this.touchTimeout = null; 1049 this.touchStartX = 0; 1050 this.touchDeltaX = 0; 1051 this._config = this._getConfig(config); 1052 this._element = element; 1053 this._indicatorsElement = this._element.querySelector(Selector.INDICATORS); 1054 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 1055 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 1056 this._addEventListeners(); 1057 } 1058 1059 // Getters 1060 return _createClass(Carousel, [{ 1061 key: "next", 1062 value: 1063 // Public 1064 1065 function next() { 1066 if (!this._isSliding) { 1067 this._slide(Direction.NEXT); 1068 } 1069 } 1070 }, { 1071 key: "nextWhenVisible", 1072 value: function nextWhenVisible() { 1073 // Don't call next when the page isn't visible 1074 // or the carousel or its parent isn't visible 1075 if (!document.hidden && jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).is(':visible') && jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).css('visibility') !== 'hidden') { 1076 this.next(); 1077 } 1078 } 1079 }, { 1080 key: "prev", 1081 value: function prev() { 1082 if (!this._isSliding) { 1083 this._slide(Direction.PREV); 1084 } 1085 } 1086 }, { 1087 key: "pause", 1088 value: function pause(event) { 1089 if (!event) { 1090 this._isPaused = true; 1091 } 1092 if (this._element.querySelector(Selector.NEXT_PREV)) { 1093 _util__WEBPACK_IMPORTED_MODULE_1__["default"].triggerTransitionEnd(this._element); 1094 this.cycle(true); 1095 } 1096 clearInterval(this._interval); 1097 this._interval = null; 1098 } 1099 }, { 1100 key: "cycle", 1101 value: function cycle(event) { 1102 if (!event) { 1103 this._isPaused = false; 1104 } 1105 if (this._interval) { 1106 clearInterval(this._interval); 1107 this._interval = null; 1108 } 1109 if (this._config.interval && !this._isPaused) { 1110 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 1111 } 1112 } 1113 }, { 1114 key: "to", 1115 value: function to(index) { 1116 var _this = this; 1117 this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM); 1118 var activeIndex = this._getItemIndex(this._activeElement); 1119 if (index > this._items.length - 1 || index < 0) { 1120 return; 1121 } 1122 if (this._isSliding) { 1123 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).one(Event.SLID, function () { 1124 return _this.to(index); 1125 }); 1126 return; 1127 } 1128 if (activeIndex === index) { 1129 this.pause(); 1130 this.cycle(); 1131 return; 1132 } 1133 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; 1134 this._slide(direction, this._items[index]); 1135 } 1136 }, { 1137 key: "dispose", 1138 value: function dispose() { 1139 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).off(EVENT_KEY); 1140 jquery__WEBPACK_IMPORTED_MODULE_0___default().removeData(this._element, DATA_KEY); 1141 this._items = null; 1142 this._config = null; 1143 this._element = null; 1144 this._interval = null; 1145 this._isPaused = null; 1146 this._isSliding = null; 1147 this._activeElement = null; 1148 this._indicatorsElement = null; 1149 } 1150 1151 // Private 1152 }, { 1153 key: "_getConfig", 1154 value: function _getConfig(config) { 1155 config = _objectSpread(_objectSpread({}, Default), config); 1156 _util__WEBPACK_IMPORTED_MODULE_1__["default"].typeCheckConfig(NAME, config, DefaultType); 1157 return config; 1158 } 1159 }, { 1160 key: "_handleSwipe", 1161 value: function _handleSwipe() { 1162 var absDeltax = Math.abs(this.touchDeltaX); 1163 if (absDeltax <= SWIPE_THRESHOLD) { 1164 return; 1165 } 1166 var direction = absDeltax / this.touchDeltaX; 1167 1168 // swipe left 1169 if (direction > 0) { 1170 this.prev(); 1171 } 1172 1173 // swipe right 1174 if (direction < 0) { 1175 this.next(); 1176 } 1177 } 1178 }, { 1179 key: "_addEventListeners", 1180 value: function _addEventListeners() { 1181 var _this2 = this; 1182 if (this._config.keyboard) { 1183 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.KEYDOWN, function (event) { 1184 return _this2._keydown(event); 1185 }); 1186 } 1187 if (this._config.pause === 'hover') { 1188 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.MOUSEENTER, function (event) { 1189 return _this2.pause(event); 1190 }).on(Event.MOUSELEAVE, function (event) { 1191 return _this2.cycle(event); 1192 }); 1193 } 1194 if (this._config.touch) { 1195 this._addTouchEventListeners(); 1196 } 1197 } 1198 }, { 1199 key: "_addTouchEventListeners", 1200 value: function _addTouchEventListeners() { 1201 var _this3 = this; 1202 if (!this._touchSupported) { 1203 return; 1204 } 1205 var start = function start(event) { 1206 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 1207 _this3.touchStartX = event.originalEvent.clientX; 1208 } else if (!_this3._pointerEvent) { 1209 _this3.touchStartX = event.originalEvent.touches[0].clientX; 1210 } 1211 }; 1212 var move = function move(event) { 1213 // ensure swiping with one touch and not pinching 1214 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 1215 _this3.touchDeltaX = 0; 1216 } else { 1217 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 1218 } 1219 }; 1220 var end = function end(event) { 1221 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 1222 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 1223 } 1224 _this3._handleSwipe(); 1225 if (_this3._config.pause === 'hover') { 1226 // If it's a touch-enabled device, mouseenter/leave are fired as 1227 // part of the mouse compatibility events on first tap - the carousel 1228 // would stop cycling until user tapped out of it; 1229 // here, we listen for touchend, explicitly pause the carousel 1230 // (as if it's the second time we tap on it, mouseenter compat event 1231 // is NOT fired) and after a timeout (to allow for mouse compatibility 1232 // events to fire) we explicitly restart cycling 1233 1234 _this3.pause(); 1235 if (_this3.touchTimeout) { 1236 clearTimeout(_this3.touchTimeout); 1237 } 1238 _this3.touchTimeout = setTimeout(function (event) { 1239 return _this3.cycle(event); 1240 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 1241 } 1242 }; 1243 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, function (e) { 1244 return e.preventDefault(); 1245 }); 1246 if (this._pointerEvent) { 1247 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.POINTERDOWN, function (event) { 1248 return start(event); 1249 }); 1250 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.POINTERUP, function (event) { 1251 return end(event); 1252 }); 1253 this._element.classList.add(ClassName.POINTER_EVENT); 1254 } else { 1255 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.TOUCHSTART, function (event) { 1256 return start(event); 1257 }); 1258 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.TOUCHMOVE, function (event) { 1259 return move(event); 1260 }); 1261 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.TOUCHEND, function (event) { 1262 return end(event); 1263 }); 1264 } 1265 } 1266 }, { 1267 key: "_keydown", 1268 value: function _keydown(event) { 1269 if (/input|textarea/i.test(event.target.tagName)) { 1270 return; 1271 } 1272 switch (event.which) { 1273 case ARROW_LEFT_KEYCODE: 1274 event.preventDefault(); 1275 this.prev(); 1276 break; 1277 case ARROW_RIGHT_KEYCODE: 1278 event.preventDefault(); 1279 this.next(); 1280 break; 1281 default: 1282 } 1283 } 1284 }, { 1285 key: "_getItemIndex", 1286 value: function _getItemIndex(element) { 1287 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : []; 1288 return this._items.indexOf(element); 1289 } 1290 }, { 1291 key: "_getItemByDirection", 1292 value: function _getItemByDirection(direction, activeElement) { 1293 var isNextDirection = direction === Direction.NEXT; 1294 var isPrevDirection = direction === Direction.PREV; 1295 var activeIndex = this._getItemIndex(activeElement); 1296 var lastItemIndex = this._items.length - 1; 1297 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 1298 if (isGoingToWrap && !this._config.wrap) { 1299 return activeElement; 1300 } 1301 var delta = direction === Direction.PREV ? -1 : 1; 1302 var itemIndex = (activeIndex + delta) % this._items.length; 1303 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 1304 } 1305 }, { 1306 key: "_triggerSlideEvent", 1307 value: function _triggerSlideEvent(relatedTarget, eventDirectionName) { 1308 var targetIndex = this._getItemIndex(relatedTarget); 1309 var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM)); 1310 var slideEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.SLIDE, { 1311 relatedTarget: relatedTarget, 1312 direction: eventDirectionName, 1313 from: fromIndex, 1314 to: targetIndex 1315 }); 1316 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).trigger(slideEvent); 1317 return slideEvent; 1318 } 1319 }, { 1320 key: "_setActiveIndicatorElement", 1321 value: function _setActiveIndicatorElement(element) { 1322 if (this._indicatorsElement) { 1323 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE)); 1324 jquery__WEBPACK_IMPORTED_MODULE_0___default()(indicators).removeClass(ClassName.ACTIVE); 1325 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 1326 if (nextIndicator) { 1327 jquery__WEBPACK_IMPORTED_MODULE_0___default()(nextIndicator).addClass(ClassName.ACTIVE); 1328 } 1329 } 1330 } 1331 }, { 1332 key: "_slide", 1333 value: function _slide(direction, element) { 1334 var _this4 = this; 1335 var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM); 1336 var activeElementIndex = this._getItemIndex(activeElement); 1337 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 1338 var nextElementIndex = this._getItemIndex(nextElement); 1339 var isCycling = Boolean(this._interval); 1340 var directionalClassName; 1341 var orderClassName; 1342 var eventDirectionName; 1343 if (direction === Direction.NEXT) { 1344 directionalClassName = ClassName.LEFT; 1345 orderClassName = ClassName.NEXT; 1346 eventDirectionName = Direction.LEFT; 1347 } else { 1348 directionalClassName = ClassName.RIGHT; 1349 orderClassName = ClassName.PREV; 1350 eventDirectionName = Direction.RIGHT; 1351 } 1352 if (nextElement && jquery__WEBPACK_IMPORTED_MODULE_0___default()(nextElement).hasClass(ClassName.ACTIVE)) { 1353 this._isSliding = false; 1354 return; 1355 } 1356 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 1357 if (slideEvent.isDefaultPrevented()) { 1358 return; 1359 } 1360 if (!activeElement || !nextElement) { 1361 // Some weirdness is happening, so we bail 1362 return; 1363 } 1364 this._isSliding = true; 1365 if (isCycling) { 1366 this.pause(); 1367 } 1368 this._setActiveIndicatorElement(nextElement); 1369 var slidEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.SLID, { 1370 relatedTarget: nextElement, 1371 direction: eventDirectionName, 1372 from: activeElementIndex, 1373 to: nextElementIndex 1374 }); 1375 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.SLIDE)) { 1376 jquery__WEBPACK_IMPORTED_MODULE_0___default()(nextElement).addClass(orderClassName); 1377 _util__WEBPACK_IMPORTED_MODULE_1__["default"].reflow(nextElement); 1378 jquery__WEBPACK_IMPORTED_MODULE_0___default()(activeElement).addClass(directionalClassName); 1379 jquery__WEBPACK_IMPORTED_MODULE_0___default()(nextElement).addClass(directionalClassName); 1380 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 1381 if (nextElementInterval) { 1382 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 1383 this._config.interval = nextElementInterval; 1384 } else { 1385 this._config.interval = this._config.defaultInterval || this._config.interval; 1386 } 1387 var transitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(activeElement); 1388 jquery__WEBPACK_IMPORTED_MODULE_0___default()(activeElement).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, function () { 1389 jquery__WEBPACK_IMPORTED_MODULE_0___default()(nextElement).removeClass("".concat(directionalClassName, " ").concat(orderClassName)).addClass(ClassName.ACTIVE); 1390 jquery__WEBPACK_IMPORTED_MODULE_0___default()(activeElement).removeClass("".concat(ClassName.ACTIVE, " ").concat(orderClassName, " ").concat(directionalClassName)); 1391 _this4._isSliding = false; 1392 setTimeout(function () { 1393 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this4._element).trigger(slidEvent); 1394 }, 0); 1395 }).emulateTransitionEnd(transitionDuration); 1396 } else { 1397 jquery__WEBPACK_IMPORTED_MODULE_0___default()(activeElement).removeClass(ClassName.ACTIVE); 1398 jquery__WEBPACK_IMPORTED_MODULE_0___default()(nextElement).addClass(ClassName.ACTIVE); 1399 this._isSliding = false; 1400 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).trigger(slidEvent); 1401 } 1402 if (isCycling) { 1403 this.cycle(); 1404 } 1405 } 1406 1407 // Static 1408 }], [{ 1409 key: "VERSION", 1410 get: function get() { 1411 return VERSION; 1412 } 1413 }, { 1414 key: "Default", 1415 get: function get() { 1416 return Default; 1417 } 1418 }, { 1419 key: "_jQueryInterface", 1420 value: function _jQueryInterface(config) { 1421 return this.each(function () { 1422 var data = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data(DATA_KEY); 1423 var _config = _objectSpread(_objectSpread({}, Default), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data()); 1424 if (_typeof(config) === 'object') { 1425 _config = _objectSpread(_objectSpread({}, _config), config); 1426 } 1427 var action = typeof config === 'string' ? config : _config.slide; 1428 if (!data) { 1429 data = new Carousel(this, _config); 1430 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data(DATA_KEY, data); 1431 } 1432 if (typeof config === 'number') { 1433 data.to(config); 1434 } else if (typeof action === 'string') { 1435 if (typeof data[action] === 'undefined') { 1436 throw new TypeError("No method named \"".concat(action, "\"")); 1437 } 1438 data[action](); 1439 } else if (_config.interval && _config.ride) { 1440 data.pause(); 1441 data.cycle(); 1442 } 1443 }); 1444 } 1445 }, { 1446 key: "_dataApiClickHandler", 1447 value: function _dataApiClickHandler(event) { 1448 var selector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(this); 1449 if (!selector) { 1450 return; 1451 } 1452 var target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(selector)[0]; 1453 if (!target || !jquery__WEBPACK_IMPORTED_MODULE_0___default()(target).hasClass(ClassName.CAROUSEL)) { 1454 return; 1455 } 1456 var config = _objectSpread(_objectSpread({}, jquery__WEBPACK_IMPORTED_MODULE_0___default()(target).data()), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data()); 1457 var slideIndex = this.getAttribute('data-slide-to'); 1458 if (slideIndex) { 1459 config.interval = false; 1460 } 1461 Carousel._jQueryInterface.call(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target), config); 1462 if (slideIndex) { 1463 jquery__WEBPACK_IMPORTED_MODULE_0___default()(target).data(DATA_KEY).to(slideIndex); 1464 } 1465 event.preventDefault(); 1466 } 1467 }]); 1468}(); 1469/** 1470 * ------------------------------------------------------------------------ 1471 * Data Api implementation 1472 * ------------------------------------------------------------------------ 1473 */ 1474jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); 1475jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on(Event.LOAD_DATA_API, function () { 1476 var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE)); 1477 for (var i = 0, len = carousels.length; i < len; i++) { 1478 var $carousel = jquery__WEBPACK_IMPORTED_MODULE_0___default()(carousels[i]); 1479 Carousel._jQueryInterface.call($carousel, $carousel.data()); 1480 } 1481}); 1482 1483/** 1484 * ------------------------------------------------------------------------ 1485 * jQuery 1486 * ------------------------------------------------------------------------ 1487 */ 1488 1489(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = Carousel._jQueryInterface; 1490(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].Constructor = Carousel; 1491(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].noConflict = function () { 1492 (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = JQUERY_NO_CONFLICT; 1493 return Carousel._jQueryInterface; 1494}; 1495/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Carousel); 1496 1497/***/ }), 1498
vendor: 16,368 bytes, lines 1499-1853
1499/***/ "./node_modules/bootstrap/js/src/collapse.js": 1500/*!***************************************************!*\ 1501 !*** ./node_modules/bootstrap/js/src/collapse.js ***! 1502 \***************************************************/ 1503/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1504 1505"use strict"; 1506__webpack_require__.r(__webpack_exports__); 1507/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1508/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 1509/* harmony export */ }); 1510/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 1511/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1512/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./node_modules/bootstrap/js/src/util.js"); 1513function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 1514function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 1515function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 1516function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 1517function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 1518function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 1519function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 1520function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 1521function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 1522/** 1523 * -------------------------------------------------------------------------- 1524 * Bootstrap (v4.3.1): collapse.js 1525 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1526 * -------------------------------------------------------------------------- 1527 */ 1528 1529 1530 1531 1532/** 1533 * ------------------------------------------------------------------------ 1534 * Constants 1535 * ------------------------------------------------------------------------ 1536 */ 1537 1538var NAME = 'collapse'; 1539var VERSION = '4.3.1'; 1540var DATA_KEY = 'bs.collapse'; 1541var EVENT_KEY = ".".concat(DATA_KEY); 1542var DATA_API_KEY = '.data-api'; 1543var JQUERY_NO_CONFLICT = (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME]; 1544var Default = { 1545 toggle: true, 1546 parent: '' 1547}; 1548var DefaultType = { 1549 toggle: 'boolean', 1550 parent: '(string|element)' 1551}; 1552var Event = { 1553 SHOW: "show".concat(EVENT_KEY), 1554 SHOWN: "shown".concat(EVENT_KEY), 1555 HIDE: "hide".concat(EVENT_KEY), 1556 HIDDEN: "hidden".concat(EVENT_KEY), 1557 CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY) 1558}; 1559var ClassName = { 1560 SHOW: 'show', 1561 COLLAPSE: 'collapse', 1562 COLLAPSING: 'collapsing', 1563 COLLAPSED: 'collapsed' 1564}; 1565var Dimension = { 1566 WIDTH: 'width', 1567 HEIGHT: 'height' 1568}; 1569var Selector = { 1570 ACTIVES: '.show, .collapsing', 1571 DATA_TOGGLE: '[data-toggle="collapse"]' 1572}; 1573 1574/** 1575 * ------------------------------------------------------------------------ 1576 * Class Definition 1577 * ------------------------------------------------------------------------ 1578 */ 1579var Collapse = /*#__PURE__*/function () { 1580 function Collapse(element, config) { 1581 _classCallCheck(this, Collapse); 1582 this._isTransitioning = false; 1583 this._element = element; 1584 this._config = this._getConfig(config); 1585 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#".concat(element.id, "\"],") + "[data-toggle=\"collapse\"][data-target=\"#".concat(element.id, "\"]"))); 1586 var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)); 1587 for (var i = 0, len = toggleList.length; i < len; i++) { 1588 var elem = toggleList[i]; 1589 var selector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(elem); 1590 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 1591 return foundElem === element; 1592 }); 1593 if (selector !== null && filterElement.length > 0) { 1594 this._selector = selector; 1595 this._triggerArray.push(elem); 1596 } 1597 } 1598 this._parent = this._config.parent ? this._getParent() : null; 1599 if (!this._config.parent) { 1600 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 1601 } 1602 if (this._config.toggle) { 1603 this.toggle(); 1604 } 1605 } 1606 1607 // Getters 1608 return _createClass(Collapse, [{ 1609 key: "toggle", 1610 value: 1611 // Public 1612 1613 function toggle() { 1614 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.SHOW)) { 1615 this.hide(); 1616 } else { 1617 this.show(); 1618 } 1619 } 1620 }, { 1621 key: "show", 1622 value: function show() { 1623 var _this = this; 1624 if (this._isTransitioning || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.SHOW)) { 1625 return; 1626 } 1627 var actives; 1628 var activesData; 1629 if (this._parent) { 1630 actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) { 1631 if (typeof _this._config.parent === 'string') { 1632 return elem.getAttribute('data-parent') === _this._config.parent; 1633 } 1634 return elem.classList.contains(ClassName.COLLAPSE); 1635 }); 1636 if (actives.length === 0) { 1637 actives = null; 1638 } 1639 } 1640 if (actives) { 1641 activesData = jquery__WEBPACK_IMPORTED_MODULE_0___default()(actives).not(this._selector).data(DATA_KEY); 1642 if (activesData && activesData._isTransitioning) { 1643 return; 1644 } 1645 } 1646 var startEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.SHOW); 1647 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).trigger(startEvent); 1648 if (startEvent.isDefaultPrevented()) { 1649 return; 1650 } 1651 if (actives) { 1652 Collapse._jQueryInterface.call(jquery__WEBPACK_IMPORTED_MODULE_0___default()(actives).not(this._selector), 'hide'); 1653 if (!activesData) { 1654 jquery__WEBPACK_IMPORTED_MODULE_0___default()(actives).data(DATA_KEY, null); 1655 } 1656 } 1657 var dimension = this._getDimension(); 1658 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); 1659 this._element.style[dimension] = 0; 1660 if (this._triggerArray.length) { 1661 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); 1662 } 1663 this.setTransitioning(true); 1664 var complete = function complete() { 1665 jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW); 1666 _this._element.style[dimension] = ''; 1667 _this.setTransitioning(false); 1668 jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this._element).trigger(Event.SHOWN); 1669 }; 1670 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 1671 var scrollSize = "scroll".concat(capitalizedDimension); 1672 var transitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(this._element); 1673 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1674 this._element.style[dimension] = "".concat(this._element[scrollSize], "px"); 1675 } 1676 }, { 1677 key: "hide", 1678 value: function hide() { 1679 var _this2 = this; 1680 if (this._isTransitioning || !jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.SHOW)) { 1681 return; 1682 } 1683 var startEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.HIDE); 1684 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).trigger(startEvent); 1685 if (startEvent.isDefaultPrevented()) { 1686 return; 1687 } 1688 var dimension = this._getDimension(); 1689 this._element.style[dimension] = "".concat(this._element.getBoundingClientRect()[dimension], "px"); 1690 _util__WEBPACK_IMPORTED_MODULE_1__["default"].reflow(this._element); 1691 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW); 1692 var triggerArrayLength = this._triggerArray.length; 1693 if (triggerArrayLength > 0) { 1694 for (var i = 0; i < triggerArrayLength; i++) { 1695 var trigger = this._triggerArray[i]; 1696 var selector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(trigger); 1697 if (selector !== null) { 1698 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()([].slice.call(document.querySelectorAll(selector))); 1699 if (!$elem.hasClass(ClassName.SHOW)) { 1700 jquery__WEBPACK_IMPORTED_MODULE_0___default()(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); 1701 } 1702 } 1703 } 1704 } 1705 this.setTransitioning(true); 1706 var complete = function complete() { 1707 _this2.setTransitioning(false); 1708 jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); 1709 }; 1710 this._element.style[dimension] = ''; 1711 var transitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(this._element); 1712 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1713 } 1714 }, { 1715 key: "setTransitioning", 1716 value: function setTransitioning(isTransitioning) { 1717 this._isTransitioning = isTransitioning; 1718 } 1719 }, { 1720 key: "dispose", 1721 value: function dispose() { 1722 jquery__WEBPACK_IMPORTED_MODULE_0___default().removeData(this._element, DATA_KEY); 1723 this._config = null; 1724 this._parent = null; 1725 this._element = null; 1726 this._triggerArray = null; 1727 this._isTransitioning = null; 1728 } 1729 1730 // Private 1731 }, { 1732 key: "_getConfig", 1733 value: function _getConfig(config) { 1734 config = _objectSpread(_objectSpread({}, Default), config); 1735 config.toggle = Boolean(config.toggle); // Coerce string values 1736 _util__WEBPACK_IMPORTED_MODULE_1__["default"].typeCheckConfig(NAME, config, DefaultType); 1737 return config; 1738 } 1739 }, { 1740 key: "_getDimension", 1741 value: function _getDimension() { 1742 var hasWidth = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(Dimension.WIDTH); 1743 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; 1744 } 1745 }, { 1746 key: "_getParent", 1747 value: function _getParent() { 1748 var _this3 = this; 1749 var parent; 1750 if (_util__WEBPACK_IMPORTED_MODULE_1__["default"].isElement(this._config.parent)) { 1751 parent = this._config.parent; 1752 1753 // It's a jQuery object 1754 if (typeof this._config.parent.jquery !== 'undefined') { 1755 parent = this._config.parent[0]; 1756 } 1757 } else { 1758 parent = document.querySelector(this._config.parent); 1759 } 1760 var selector = "[data-toggle=\"collapse\"][data-parent=\"".concat(this._config.parent, "\"]"); 1761 var children = [].slice.call(parent.querySelectorAll(selector)); 1762 jquery__WEBPACK_IMPORTED_MODULE_0___default()(children).each(function (i, element) { 1763 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 1764 }); 1765 return parent; 1766 } 1767 }, { 1768 key: "_addAriaAndCollapsedClass", 1769 value: function _addAriaAndCollapsedClass(element, triggerArray) { 1770 var isOpen = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).hasClass(ClassName.SHOW); 1771 if (triggerArray.length) { 1772 jquery__WEBPACK_IMPORTED_MODULE_0___default()(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 1773 } 1774 } 1775 1776 // Static 1777 }], [{ 1778 key: "VERSION", 1779 get: function get() { 1780 return VERSION; 1781 } 1782 }, { 1783 key: "Default", 1784 get: function get() { 1785 return Default; 1786 } 1787 }, { 1788 key: "_getTargetFromElement", 1789 value: function _getTargetFromElement(element) { 1790 var selector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(element); 1791 return selector ? document.querySelector(selector) : null; 1792 } 1793 }, { 1794 key: "_jQueryInterface", 1795 value: function _jQueryInterface(config) { 1796 return this.each(function () { 1797 var $this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 1798 var data = $this.data(DATA_KEY); 1799 var _config = _objectSpread(_objectSpread(_objectSpread({}, Default), $this.data()), _typeof(config) === 'object' && config ? config : {}); 1800 if (!data && _config.toggle && /show|hide/.test(config)) { 1801 _config.toggle = false; 1802 } 1803 if (!data) { 1804 data = new Collapse(this, _config); 1805 $this.data(DATA_KEY, data); 1806 } 1807 if (typeof config === 'string') { 1808 if (typeof data[config] === 'undefined') { 1809 throw new TypeError("No method named \"".concat(config, "\"")); 1810 } 1811 data[config](); 1812 } 1813 }); 1814 } 1815 }]); 1816}(); 1817/** 1818 * ------------------------------------------------------------------------ 1819 * Data Api implementation 1820 * ------------------------------------------------------------------------ 1821 */ 1822jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { 1823 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 1824 if (event.currentTarget.tagName === 'A') { 1825 event.preventDefault(); 1826 } 1827 var $trigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 1828 var selector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(this); 1829 var selectors = [].slice.call(document.querySelectorAll(selector)); 1830 jquery__WEBPACK_IMPORTED_MODULE_0___default()(selectors).each(function () { 1831 var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 1832 var data = $target.data(DATA_KEY); 1833 var config = data ? 'toggle' : $trigger.data(); 1834 Collapse._jQueryInterface.call($target, config); 1835 }); 1836}); 1837 1838/** 1839 * ------------------------------------------------------------------------ 1840 * jQuery 1841 * ------------------------------------------------------------------------ 1842 */ 1843 1844(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = Collapse._jQueryInterface; 1845(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].Constructor = Collapse; 1846(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].noConflict = function () { 1847 (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = JQUERY_NO_CONFLICT; 1848 return Collapse._jQueryInterface; 1849}; 1850/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Collapse); 1851 1852/***/ }), 1853
vendor: 25,090 bytes, lines 1854-2415
1854/***/ "./node_modules/bootstrap/js/src/modal.js": 1855/*!************************************************!*\ 1856 !*** ./node_modules/bootstrap/js/src/modal.js ***! 1857 \************************************************/ 1858/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1859 1860"use strict"; 1861__webpack_require__.r(__webpack_exports__); 1862/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1863/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 1864/* harmony export */ }); 1865/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 1866/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1867/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./node_modules/bootstrap/js/src/util.js"); 1868function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 1869function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 1870function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 1871function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 1872function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 1873function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 1874function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 1875function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 1876function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 1877/** 1878 * -------------------------------------------------------------------------- 1879 * Bootstrap (v4.3.1): modal.js 1880 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1881 * -------------------------------------------------------------------------- 1882 */ 1883 1884 1885 1886 1887/** 1888 * ------------------------------------------------------------------------ 1889 * Constants 1890 * ------------------------------------------------------------------------ 1891 */ 1892 1893var NAME = 'modal'; 1894var VERSION = '4.3.1'; 1895var DATA_KEY = 'bs.modal'; 1896var EVENT_KEY = ".".concat(DATA_KEY); 1897var DATA_API_KEY = '.data-api'; 1898var JQUERY_NO_CONFLICT = (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME]; 1899var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 1900 1901var Default = { 1902 backdrop: true, 1903 keyboard: true, 1904 focus: true, 1905 show: true 1906}; 1907var DefaultType = { 1908 backdrop: '(boolean|string)', 1909 keyboard: 'boolean', 1910 focus: 'boolean', 1911 show: 'boolean' 1912}; 1913var Event = { 1914 HIDE: "hide".concat(EVENT_KEY), 1915 HIDDEN: "hidden".concat(EVENT_KEY), 1916 SHOW: "show".concat(EVENT_KEY), 1917 SHOWN: "shown".concat(EVENT_KEY), 1918 FOCUSIN: "focusin".concat(EVENT_KEY), 1919 RESIZE: "resize".concat(EVENT_KEY), 1920 CLICK_DISMISS: "click.dismiss".concat(EVENT_KEY), 1921 KEYDOWN_DISMISS: "keydown.dismiss".concat(EVENT_KEY), 1922 MOUSEUP_DISMISS: "mouseup.dismiss".concat(EVENT_KEY), 1923 MOUSEDOWN_DISMISS: "mousedown.dismiss".concat(EVENT_KEY), 1924 CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY) 1925}; 1926var ClassName = { 1927 SCROLLABLE: 'modal-dialog-scrollable', 1928 SCROLLBAR_MEASURER: 'modal-scrollbar-measure', 1929 BACKDROP: 'modal-backdrop', 1930 OPEN: 'modal-open', 1931 FADE: 'fade', 1932 SHOW: 'show' 1933}; 1934var Selector = { 1935 DIALOG: '.modal-dialog', 1936 MODAL_BODY: '.modal-body', 1937 DATA_TOGGLE: '[data-toggle="modal"]', 1938 DATA_DISMISS: '[data-dismiss="modal"]', 1939 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', 1940 STICKY_CONTENT: '.sticky-top' 1941}; 1942 1943/** 1944 * ------------------------------------------------------------------------ 1945 * Class Definition 1946 * ------------------------------------------------------------------------ 1947 */ 1948var Modal = /*#__PURE__*/function () { 1949 function Modal(element, config) { 1950 _classCallCheck(this, Modal); 1951 this._config = this._getConfig(config); 1952 this._element = element; 1953 this._dialog = element.querySelector(Selector.DIALOG); 1954 this._backdrop = null; 1955 this._isShown = false; 1956 this._isBodyOverflowing = false; 1957 this._ignoreBackdropClick = false; 1958 this._isTransitioning = false; 1959 this._scrollbarWidth = 0; 1960 } 1961 1962 // Getters 1963 return _createClass(Modal, [{ 1964 key: "toggle", 1965 value: 1966 // Public 1967 1968 function toggle(relatedTarget) { 1969 return this._isShown ? this.hide() : this.show(relatedTarget); 1970 } 1971 }, { 1972 key: "show", 1973 value: function show(relatedTarget) { 1974 var _this = this; 1975 if (this._isShown || this._isTransitioning) { 1976 return; 1977 } 1978 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.FADE)) { 1979 this._isTransitioning = true; 1980 } 1981 var showEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.SHOW, { 1982 relatedTarget: relatedTarget 1983 }); 1984 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).trigger(showEvent); 1985 if (this._isShown || showEvent.isDefaultPrevented()) { 1986 return; 1987 } 1988 this._isShown = true; 1989 this._checkScrollbar(); 1990 this._setScrollbar(); 1991 this._adjustDialog(); 1992 this._setEscapeEvent(); 1993 this._setResizeEvent(); 1994 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) { 1995 return _this.hide(event); 1996 }); 1997 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { 1998 jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this._element).one(Event.MOUSEUP_DISMISS, function (event) { 1999 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.target).is(_this._element)) { 2000 _this._ignoreBackdropClick = true; 2001 } 2002 }); 2003 }); 2004 this._showBackdrop(function () { 2005 return _this._showElement(relatedTarget); 2006 }); 2007 } 2008 }, { 2009 key: "hide", 2010 value: function hide(event) { 2011 var _this2 = this; 2012 if (event) { 2013 event.preventDefault(); 2014 } 2015 if (!this._isShown || this._isTransitioning) { 2016 return; 2017 } 2018 var hideEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.HIDE); 2019 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).trigger(hideEvent); 2020 if (!this._isShown || hideEvent.isDefaultPrevented()) { 2021 return; 2022 } 2023 this._isShown = false; 2024 var transition = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.FADE); 2025 if (transition) { 2026 this._isTransitioning = true; 2027 } 2028 this._setEscapeEvent(); 2029 this._setResizeEvent(); 2030 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).off(Event.FOCUSIN); 2031 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).removeClass(ClassName.SHOW); 2032 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).off(Event.CLICK_DISMISS); 2033 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._dialog).off(Event.MOUSEDOWN_DISMISS); 2034 if (transition) { 2035 var transitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(this._element); 2036 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, function (event) { 2037 return _this2._hideModal(event); 2038 }).emulateTransitionEnd(transitionDuration); 2039 } else { 2040 this._hideModal(); 2041 } 2042 } 2043 }, { 2044 key: "dispose", 2045 value: function dispose() { 2046 [window, this._element, this._dialog].forEach(function (htmlElement) { 2047 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(htmlElement).off(EVENT_KEY); 2048 }); 2049 2050 /** 2051 * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API` 2052 * Do not move `document` in `htmlElements` array 2053 * It will remove `Event.CLICK_DATA_API` event that should remain 2054 */ 2055 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).off(Event.FOCUSIN); 2056 jquery__WEBPACK_IMPORTED_MODULE_0___default().removeData(this._element, DATA_KEY); 2057 this._config = null; 2058 this._element = null; 2059 this._dialog = null; 2060 this._backdrop = null; 2061 this._isShown = null; 2062 this._isBodyOverflowing = null; 2063 this._ignoreBackdropClick = null; 2064 this._isTransitioning = null; 2065 this._scrollbarWidth = null; 2066 } 2067 }, { 2068 key: "handleUpdate", 2069 value: function handleUpdate() { 2070 this._adjustDialog(); 2071 } 2072 2073 // Private 2074 }, { 2075 key: "_getConfig", 2076 value: function _getConfig(config) { 2077 config = _objectSpread(_objectSpread({}, Default), config); 2078 _util__WEBPACK_IMPORTED_MODULE_1__["default"].typeCheckConfig(NAME, config, DefaultType); 2079 return config; 2080 } 2081 }, { 2082 key: "_showElement", 2083 value: function _showElement(relatedTarget) { 2084 var _this3 = this; 2085 var transition = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.FADE); 2086 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 2087 // Don't move modal's DOM position 2088 document.body.appendChild(this._element); 2089 } 2090 this._element.style.display = 'block'; 2091 this._element.removeAttribute('aria-hidden'); 2092 this._element.setAttribute('aria-modal', true); 2093 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._dialog).hasClass(ClassName.SCROLLABLE)) { 2094 this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0; 2095 } else { 2096 this._element.scrollTop = 0; 2097 } 2098 if (transition) { 2099 _util__WEBPACK_IMPORTED_MODULE_1__["default"].reflow(this._element); 2100 } 2101 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).addClass(ClassName.SHOW); 2102 if (this._config.focus) { 2103 this._enforceFocus(); 2104 } 2105 var shownEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.SHOWN, { 2106 relatedTarget: relatedTarget 2107 }); 2108 var transitionComplete = function transitionComplete() { 2109 if (_this3._config.focus) { 2110 _this3._element.focus(); 2111 } 2112 _this3._isTransitioning = false; 2113 jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this3._element).trigger(shownEvent); 2114 }; 2115 if (transition) { 2116 var transitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(this._dialog); 2117 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._dialog).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 2118 } else { 2119 transitionComplete(); 2120 } 2121 } 2122 }, { 2123 key: "_enforceFocus", 2124 value: function _enforceFocus() { 2125 var _this4 = this; 2126 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).off(Event.FOCUSIN) // Guard against infinite focus loop 2127 .on(Event.FOCUSIN, function (event) { 2128 if (document !== event.target && _this4._element !== event.target && jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this4._element).has(event.target).length === 0) { 2129 _this4._element.focus(); 2130 } 2131 }); 2132 } 2133 }, { 2134 key: "_setEscapeEvent", 2135 value: function _setEscapeEvent() { 2136 var _this5 = this; 2137 if (this._isShown && this._config.keyboard) { 2138 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.KEYDOWN_DISMISS, function (event) { 2139 if (event.which === ESCAPE_KEYCODE) { 2140 event.preventDefault(); 2141 _this5.hide(); 2142 } 2143 }); 2144 } else if (!this._isShown) { 2145 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).off(Event.KEYDOWN_DISMISS); 2146 } 2147 } 2148 }, { 2149 key: "_setResizeEvent", 2150 value: function _setResizeEvent() { 2151 var _this6 = this; 2152 if (this._isShown) { 2153 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on(Event.RESIZE, function (event) { 2154 return _this6.handleUpdate(event); 2155 }); 2156 } else { 2157 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(Event.RESIZE); 2158 } 2159 } 2160 }, { 2161 key: "_hideModal", 2162 value: function _hideModal() { 2163 var _this7 = this; 2164 this._element.style.display = 'none'; 2165 this._element.setAttribute('aria-hidden', true); 2166 this._element.removeAttribute('aria-modal'); 2167 this._isTransitioning = false; 2168 this._showBackdrop(function () { 2169 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).removeClass(ClassName.OPEN); 2170 _this7._resetAdjustments(); 2171 _this7._resetScrollbar(); 2172 jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this7._element).trigger(Event.HIDDEN); 2173 }); 2174 } 2175 }, { 2176 key: "_removeBackdrop", 2177 value: function _removeBackdrop() { 2178 if (this._backdrop) { 2179 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._backdrop).remove(); 2180 this._backdrop = null; 2181 } 2182 } 2183 }, { 2184 key: "_showBackdrop", 2185 value: function _showBackdrop(callback) { 2186 var _this8 = this; 2187 var animate = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; 2188 if (this._isShown && this._config.backdrop) { 2189 this._backdrop = document.createElement('div'); 2190 this._backdrop.className = ClassName.BACKDROP; 2191 if (animate) { 2192 this._backdrop.classList.add(animate); 2193 } 2194 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._backdrop).appendTo(document.body); 2195 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).on(Event.CLICK_DISMISS, function (event) { 2196 if (_this8._ignoreBackdropClick) { 2197 _this8._ignoreBackdropClick = false; 2198 return; 2199 } 2200 if (event.target !== event.currentTarget) { 2201 return; 2202 } 2203 if (_this8._config.backdrop === 'static') { 2204 _this8._element.focus(); 2205 } else { 2206 _this8.hide(); 2207 } 2208 }); 2209 if (animate) { 2210 _util__WEBPACK_IMPORTED_MODULE_1__["default"].reflow(this._backdrop); 2211 } 2212 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._backdrop).addClass(ClassName.SHOW); 2213 if (!callback) { 2214 return; 2215 } 2216 if (!animate) { 2217 callback(); 2218 return; 2219 } 2220 var backdropTransitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(this._backdrop); 2221 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._backdrop).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 2222 } else if (!this._isShown && this._backdrop) { 2223 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._backdrop).removeClass(ClassName.SHOW); 2224 var callbackRemove = function callbackRemove() { 2225 _this8._removeBackdrop(); 2226 if (callback) { 2227 callback(); 2228 } 2229 }; 2230 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.FADE)) { 2231 var _backdropTransitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(this._backdrop); 2232 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._backdrop).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 2233 } else { 2234 callbackRemove(); 2235 } 2236 } else if (callback) { 2237 callback(); 2238 } 2239 } 2240 2241 // ---------------------------------------------------------------------- 2242 // the following methods are used to handle overflowing modals 2243 // todo (fat): these should probably be refactored out of modal.js 2244 // ---------------------------------------------------------------------- 2245 }, { 2246 key: "_adjustDialog", 2247 value: function _adjustDialog() { 2248 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 2249 if (!this._isBodyOverflowing && isModalOverflowing) { 2250 this._element.style.paddingLeft = "".concat(this._scrollbarWidth, "px"); 2251 } 2252 if (this._isBodyOverflowing && !isModalOverflowing) { 2253 this._element.style.paddingRight = "".concat(this._scrollbarWidth, "px"); 2254 } 2255 } 2256 }, { 2257 key: "_resetAdjustments", 2258 value: function _resetAdjustments() { 2259 this._element.style.paddingLeft = ''; 2260 this._element.style.paddingRight = ''; 2261 } 2262 }, { 2263 key: "_checkScrollbar", 2264 value: function _checkScrollbar() { 2265 var rect = document.body.getBoundingClientRect(); 2266 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; 2267 this._scrollbarWidth = this._getScrollbarWidth(); 2268 } 2269 }, { 2270 key: "_setScrollbar", 2271 value: function _setScrollbar() { 2272 var _this9 = this; 2273 if (this._isBodyOverflowing) { 2274 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 2275 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 2276 var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)); 2277 var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); 2278 2279 // Adjust fixed content padding 2280 jquery__WEBPACK_IMPORTED_MODULE_0___default()(fixedContent).each(function (index, element) { 2281 var actualPadding = element.style.paddingRight; 2282 var calculatedPadding = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).css('padding-right'); 2283 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).data('padding-right', actualPadding).css('padding-right', "".concat(parseFloat(calculatedPadding) + _this9._scrollbarWidth, "px")); 2284 }); 2285 2286 // Adjust sticky content margin 2287 jquery__WEBPACK_IMPORTED_MODULE_0___default()(stickyContent).each(function (index, element) { 2288 var actualMargin = element.style.marginRight; 2289 var calculatedMargin = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).css('margin-right'); 2290 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).data('margin-right', actualMargin).css('margin-right', "".concat(parseFloat(calculatedMargin) - _this9._scrollbarWidth, "px")); 2291 }); 2292 2293 // Adjust body padding 2294 var actualPadding = document.body.style.paddingRight; 2295 var calculatedPadding = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).css('padding-right'); 2296 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).data('padding-right', actualPadding).css('padding-right', "".concat(parseFloat(calculatedPadding) + this._scrollbarWidth, "px")); 2297 } 2298 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).addClass(ClassName.OPEN); 2299 } 2300 }, { 2301 key: "_resetScrollbar", 2302 value: function _resetScrollbar() { 2303 // Restore fixed content padding 2304 var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)); 2305 jquery__WEBPACK_IMPORTED_MODULE_0___default()(fixedContent).each(function (index, element) { 2306 var padding = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).data('padding-right'); 2307 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).removeData('padding-right'); 2308 element.style.paddingRight = padding ? padding : ''; 2309 }); 2310 2311 // Restore sticky content 2312 var elements = [].slice.call(document.querySelectorAll("".concat(Selector.STICKY_CONTENT))); 2313 jquery__WEBPACK_IMPORTED_MODULE_0___default()(elements).each(function (index, element) { 2314 var margin = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).data('margin-right'); 2315 if (typeof margin !== 'undefined') { 2316 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).css('margin-right', margin).removeData('margin-right'); 2317 } 2318 }); 2319 2320 // Restore body padding 2321 var padding = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).data('padding-right'); 2322 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).removeData('padding-right'); 2323 document.body.style.paddingRight = padding ? padding : ''; 2324 } 2325 }, { 2326 key: "_getScrollbarWidth", 2327 value: function _getScrollbarWidth() { 2328 // thx d.walsh 2329 var scrollDiv = document.createElement('div'); 2330 scrollDiv.className = ClassName.SCROLLBAR_MEASURER; 2331 document.body.appendChild(scrollDiv); 2332 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 2333 document.body.removeChild(scrollDiv); 2334 return scrollbarWidth; 2335 } 2336 2337 // Static 2338 }], [{ 2339 key: "VERSION", 2340 get: function get() { 2341 return VERSION; 2342 } 2343 }, { 2344 key: "Default", 2345 get: function get() { 2346 return Default; 2347 } 2348 }, { 2349 key: "_jQueryInterface", 2350 value: function _jQueryInterface(config, relatedTarget) { 2351 return this.each(function () { 2352 var data = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data(DATA_KEY); 2353 var _config = _objectSpread(_objectSpread(_objectSpread({}, Default), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data()), _typeof(config) === 'object' && config ? config : {}); 2354 if (!data) { 2355 data = new Modal(this, _config); 2356 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data(DATA_KEY, data); 2357 } 2358 if (typeof config === 'string') { 2359 if (typeof data[config] === 'undefined') { 2360 throw new TypeError("No method named \"".concat(config, "\"")); 2361 } 2362 data[config](relatedTarget); 2363 } else if (_config.show) { 2364 data.show(relatedTarget); 2365 } 2366 }); 2367 } 2368 }]); 2369}(); 2370/** 2371 * ------------------------------------------------------------------------ 2372 * Data Api implementation 2373 * ------------------------------------------------------------------------ 2374 */ 2375jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { 2376 var _this0 = this; 2377 var target; 2378 var selector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(this); 2379 if (selector) { 2380 target = document.querySelector(selector); 2381 } 2382 var config = jquery__WEBPACK_IMPORTED_MODULE_0___default()(target).data(DATA_KEY) ? 'toggle' : _objectSpread(_objectSpread({}, jquery__WEBPACK_IMPORTED_MODULE_0___default()(target).data()), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data()); 2383 if (this.tagName === 'A' || this.tagName === 'AREA') { 2384 event.preventDefault(); 2385 } 2386 var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(target).one(Event.SHOW, function (showEvent) { 2387 if (showEvent.isDefaultPrevented()) { 2388 // Only register focus restorer if modal will actually get shown 2389 return; 2390 } 2391 $target.one(Event.HIDDEN, function () { 2392 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this0).is(':visible')) { 2393 _this0.focus(); 2394 } 2395 }); 2396 }); 2397 Modal._jQueryInterface.call(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target), config, this); 2398}); 2399 2400/** 2401 * ------------------------------------------------------------------------ 2402 * jQuery 2403 * ------------------------------------------------------------------------ 2404 */ 2405 2406(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = Modal._jQueryInterface; 2407(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].Constructor = Modal; 2408(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].noConflict = function () { 2409 (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = JQUERY_NO_CONFLICT; 2410 return Modal._jQueryInterface; 2411}; 2412/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Modal); 2413 2414/***/ }), 2415
vendor: 13,748 bytes, lines 2416-2729
2416/***/ "./node_modules/bootstrap/js/src/scrollspy.js": 2417/*!****************************************************!*\ 2418 !*** ./node_modules/bootstrap/js/src/scrollspy.js ***! 2419 \****************************************************/ 2420/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2421 2422"use strict"; 2423__webpack_require__.r(__webpack_exports__); 2424/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2425/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 2426/* harmony export */ }); 2427/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 2428/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2429/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./node_modules/bootstrap/js/src/util.js"); 2430function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 2431function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 2432function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 2433function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 2434function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 2435function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 2436function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 2437function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 2438function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 2439/** 2440 * -------------------------------------------------------------------------- 2441 * Bootstrap (v4.3.1): scrollspy.js 2442 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2443 * -------------------------------------------------------------------------- 2444 */ 2445 2446 2447 2448 2449/** 2450 * ------------------------------------------------------------------------ 2451 * Constants 2452 * ------------------------------------------------------------------------ 2453 */ 2454 2455var NAME = 'scrollspy'; 2456var VERSION = '4.3.1'; 2457var DATA_KEY = 'bs.scrollspy'; 2458var EVENT_KEY = ".".concat(DATA_KEY); 2459var DATA_API_KEY = '.data-api'; 2460var JQUERY_NO_CONFLICT = (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME]; 2461var Default = { 2462 offset: 10, 2463 method: 'auto', 2464 target: '' 2465}; 2466var DefaultType = { 2467 offset: 'number', 2468 method: 'string', 2469 target: '(string|element)' 2470}; 2471var Event = { 2472 ACTIVATE: "activate".concat(EVENT_KEY), 2473 SCROLL: "scroll".concat(EVENT_KEY), 2474 LOAD_DATA_API: "load".concat(EVENT_KEY).concat(DATA_API_KEY) 2475}; 2476var ClassName = { 2477 DROPDOWN_ITEM: 'dropdown-item', 2478 DROPDOWN_MENU: 'dropdown-menu', 2479 ACTIVE: 'active' 2480}; 2481var Selector = { 2482 DATA_SPY: '[data-spy="scroll"]', 2483 ACTIVE: '.active', 2484 NAV_LIST_GROUP: '.nav, .list-group', 2485 NAV_LINKS: '.nav-link', 2486 NAV_ITEMS: '.nav-item', 2487 LIST_ITEMS: '.list-group-item', 2488 DROPDOWN: '.dropdown', 2489 DROPDOWN_ITEMS: '.dropdown-item', 2490 DROPDOWN_TOGGLE: '.dropdown-toggle' 2491}; 2492var OffsetMethod = { 2493 OFFSET: 'offset', 2494 POSITION: 'position' 2495}; 2496 2497/** 2498 * ------------------------------------------------------------------------ 2499 * Class Definition 2500 * ------------------------------------------------------------------------ 2501 */ 2502var ScrollSpy = /*#__PURE__*/function () { 2503 function ScrollSpy(element, config) { 2504 var _this = this; 2505 _classCallCheck(this, ScrollSpy); 2506 this._element = element; 2507 this._scrollElement = element.tagName === 'BODY' ? window : element; 2508 this._config = this._getConfig(config); 2509 this._selector = "".concat(this._config.target, " ").concat(Selector.NAV_LINKS, ",") + "".concat(this._config.target, " ").concat(Selector.LIST_ITEMS, ",") + "".concat(this._config.target, " ").concat(Selector.DROPDOWN_ITEMS); 2510 this._offsets = []; 2511 this._targets = []; 2512 this._activeTarget = null; 2513 this._scrollHeight = 0; 2514 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._scrollElement).on(Event.SCROLL, function (event) { 2515 return _this._process(event); 2516 }); 2517 this.refresh(); 2518 this._process(); 2519 } 2520 2521 // Getters 2522 return _createClass(ScrollSpy, [{ 2523 key: "refresh", 2524 value: 2525 // Public 2526 2527 function refresh() { 2528 var _this2 = this; 2529 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; 2530 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 2531 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; 2532 this._offsets = []; 2533 this._targets = []; 2534 this._scrollHeight = this._getScrollHeight(); 2535 var targets = [].slice.call(document.querySelectorAll(this._selector)); 2536 targets.map(function (element) { 2537 var target; 2538 var targetSelector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(element); 2539 if (targetSelector) { 2540 target = document.querySelector(targetSelector); 2541 } 2542 if (target) { 2543 var targetBCR = target.getBoundingClientRect(); 2544 if (targetBCR.width || targetBCR.height) { 2545 // TODO (fat): remove sketch reliance on jQuery position/offset 2546 return [jquery__WEBPACK_IMPORTED_MODULE_0___default()(target)[offsetMethod]().top + offsetBase, targetSelector]; 2547 } 2548 } 2549 return null; 2550 }).filter(function (item) { 2551 return item; 2552 }).sort(function (a, b) { 2553 return a[0] - b[0]; 2554 }).forEach(function (item) { 2555 _this2._offsets.push(item[0]); 2556 _this2._targets.push(item[1]); 2557 }); 2558 } 2559 }, { 2560 key: "dispose", 2561 value: function dispose() { 2562 jquery__WEBPACK_IMPORTED_MODULE_0___default().removeData(this._element, DATA_KEY); 2563 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._scrollElement).off(EVENT_KEY); 2564 this._element = null; 2565 this._scrollElement = null; 2566 this._config = null; 2567 this._selector = null; 2568 this._offsets = null; 2569 this._targets = null; 2570 this._activeTarget = null; 2571 this._scrollHeight = null; 2572 } 2573 2574 // Private 2575 }, { 2576 key: "_getConfig", 2577 value: function _getConfig(config) { 2578 config = _objectSpread(_objectSpread({}, Default), _typeof(config) === 'object' && config ? config : {}); 2579 if (typeof config.target !== 'string') { 2580 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(config.target).attr('id'); 2581 if (!id) { 2582 id = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getUID(NAME); 2583 jquery__WEBPACK_IMPORTED_MODULE_0___default()(config.target).attr('id', id); 2584 } 2585 config.target = "#".concat(id); 2586 } 2587 _util__WEBPACK_IMPORTED_MODULE_1__["default"].typeCheckConfig(NAME, config, DefaultType); 2588 return config; 2589 } 2590 }, { 2591 key: "_getScrollTop", 2592 value: function _getScrollTop() { 2593 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 2594 } 2595 }, { 2596 key: "_getScrollHeight", 2597 value: function _getScrollHeight() { 2598 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 2599 } 2600 }, { 2601 key: "_getOffsetHeight", 2602 value: function _getOffsetHeight() { 2603 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 2604 } 2605 }, { 2606 key: "_process", 2607 value: function _process() { 2608 var scrollTop = this._getScrollTop() + this._config.offset; 2609 var scrollHeight = this._getScrollHeight(); 2610 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 2611 if (this._scrollHeight !== scrollHeight) { 2612 this.refresh(); 2613 } 2614 if (scrollTop >= maxScroll) { 2615 var target = this._targets[this._targets.length - 1]; 2616 if (this._activeTarget !== target) { 2617 this._activate(target); 2618 } 2619 return; 2620 } 2621 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 2622 this._activeTarget = null; 2623 this._clear(); 2624 return; 2625 } 2626 var offsetLength = this._offsets.length; 2627 for (var i = offsetLength; i--;) { 2628 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 2629 if (isActiveTarget) { 2630 this._activate(this._targets[i]); 2631 } 2632 } 2633 } 2634 }, { 2635 key: "_activate", 2636 value: function _activate(target) { 2637 this._activeTarget = target; 2638 this._clear(); 2639 var queries = this._selector.split(',').map(function (selector) { 2640 return "".concat(selector, "[data-target=\"").concat(target, "\"],").concat(selector, "[href=\"").concat(target, "\"]"); 2641 }); 2642 var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()([].slice.call(document.querySelectorAll(queries.join(',')))); 2643 if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { 2644 $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); 2645 $link.addClass(ClassName.ACTIVE); 2646 } else { 2647 // Set triggered link as active 2648 $link.addClass(ClassName.ACTIVE); 2649 // Set triggered links parents as active 2650 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 2651 $link.parents(Selector.NAV_LIST_GROUP).prev("".concat(Selector.NAV_LINKS, ", ").concat(Selector.LIST_ITEMS)).addClass(ClassName.ACTIVE); 2652 // Handle special case when .nav-link is inside .nav-item 2653 $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE); 2654 } 2655 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._scrollElement).trigger(Event.ACTIVATE, { 2656 relatedTarget: target 2657 }); 2658 } 2659 }, { 2660 key: "_clear", 2661 value: function _clear() { 2662 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 2663 return node.classList.contains(ClassName.ACTIVE); 2664 }).forEach(function (node) { 2665 return node.classList.remove(ClassName.ACTIVE); 2666 }); 2667 } 2668 2669 // Static 2670 }], [{ 2671 key: "VERSION", 2672 get: function get() { 2673 return VERSION; 2674 } 2675 }, { 2676 key: "Default", 2677 get: function get() { 2678 return Default; 2679 } 2680 }, { 2681 key: "_jQueryInterface", 2682 value: function _jQueryInterface(config) { 2683 return this.each(function () { 2684 var data = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data(DATA_KEY); 2685 var _config = _typeof(config) === 'object' && config; 2686 if (!data) { 2687 data = new ScrollSpy(this, _config); 2688 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data(DATA_KEY, data); 2689 } 2690 if (typeof config === 'string') { 2691 if (typeof data[config] === 'undefined') { 2692 throw new TypeError("No method named \"".concat(config, "\"")); 2693 } 2694 data[config](); 2695 } 2696 }); 2697 } 2698 }]); 2699}(); 2700/** 2701 * ------------------------------------------------------------------------ 2702 * Data Api implementation 2703 * ------------------------------------------------------------------------ 2704 */ 2705jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on(Event.LOAD_DATA_API, function () { 2706 var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY)); 2707 var scrollSpysLength = scrollSpys.length; 2708 for (var i = scrollSpysLength; i--;) { 2709 var $spy = jquery__WEBPACK_IMPORTED_MODULE_0___default()(scrollSpys[i]); 2710 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 2711 } 2712}); 2713 2714/** 2715 * ------------------------------------------------------------------------ 2716 * jQuery 2717 * ------------------------------------------------------------------------ 2718 */ 2719 2720(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = ScrollSpy._jQueryInterface; 2721(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].Constructor = ScrollSpy; 2722(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].noConflict = function () { 2723 (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = JQUERY_NO_CONFLICT; 2724 return ScrollSpy._jQueryInterface; 2725}; 2726/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ScrollSpy); 2727 2728/***/ }), 2729
vendor: 10,885 bytes, lines 2730-2970
2730/***/ "./node_modules/bootstrap/js/src/tab.js": 2731/*!**********************************************!*\ 2732 !*** ./node_modules/bootstrap/js/src/tab.js ***! 2733 \**********************************************/ 2734/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2735 2736"use strict"; 2737__webpack_require__.r(__webpack_exports__); 2738/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2739/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 2740/* harmony export */ }); 2741/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 2742/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2743/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./node_modules/bootstrap/js/src/util.js"); 2744function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 2745function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 2746function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 2747function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 2748function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 2749function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 2750/** 2751 * -------------------------------------------------------------------------- 2752 * Bootstrap (v4.3.1): tab.js 2753 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2754 * -------------------------------------------------------------------------- 2755 */ 2756 2757 2758 2759 2760/** 2761 * ------------------------------------------------------------------------ 2762 * Constants 2763 * ------------------------------------------------------------------------ 2764 */ 2765 2766var NAME = 'tab'; 2767var VERSION = '4.3.1'; 2768var DATA_KEY = 'bs.tab'; 2769var EVENT_KEY = ".".concat(DATA_KEY); 2770var DATA_API_KEY = '.data-api'; 2771var JQUERY_NO_CONFLICT = (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME]; 2772var Event = { 2773 HIDE: "hide".concat(EVENT_KEY), 2774 HIDDEN: "hidden".concat(EVENT_KEY), 2775 SHOW: "show".concat(EVENT_KEY), 2776 SHOWN: "shown".concat(EVENT_KEY), 2777 CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY) 2778}; 2779var ClassName = { 2780 DROPDOWN_MENU: 'dropdown-menu', 2781 ACTIVE: 'active', 2782 DISABLED: 'disabled', 2783 FADE: 'fade', 2784 SHOW: 'show' 2785}; 2786var Selector = { 2787 DROPDOWN: '.dropdown', 2788 NAV_LIST_GROUP: '.nav, .list-group', 2789 ACTIVE: '.active', 2790 ACTIVE_UL: '> li > .active', 2791 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', 2792 DROPDOWN_TOGGLE: '.dropdown-toggle', 2793 DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' 2794}; 2795 2796/** 2797 * ------------------------------------------------------------------------ 2798 * Class Definition 2799 * ------------------------------------------------------------------------ 2800 */ 2801var Tab = /*#__PURE__*/function () { 2802 function Tab(element) { 2803 _classCallCheck(this, Tab); 2804 this._element = element; 2805 } 2806 2807 // Getters 2808 return _createClass(Tab, [{ 2809 key: "show", 2810 value: 2811 // Public 2812 2813 function show() { 2814 var _this = this; 2815 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.ACTIVE) || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).hasClass(ClassName.DISABLED)) { 2816 return; 2817 } 2818 var target; 2819 var previous; 2820 var listElement = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).closest(Selector.NAV_LIST_GROUP)[0]; 2821 var selector = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getSelectorFromElement(this._element); 2822 if (listElement) { 2823 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE; 2824 previous = jquery__WEBPACK_IMPORTED_MODULE_0___default().makeArray(jquery__WEBPACK_IMPORTED_MODULE_0___default()(listElement).find(itemSelector)); 2825 previous = previous[previous.length - 1]; 2826 } 2827 var hideEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.HIDE, { 2828 relatedTarget: this._element 2829 }); 2830 var showEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.SHOW, { 2831 relatedTarget: previous 2832 }); 2833 if (previous) { 2834 jquery__WEBPACK_IMPORTED_MODULE_0___default()(previous).trigger(hideEvent); 2835 } 2836 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this._element).trigger(showEvent); 2837 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 2838 return; 2839 } 2840 if (selector) { 2841 target = document.querySelector(selector); 2842 } 2843 this._activate(this._element, listElement); 2844 var complete = function complete() { 2845 var hiddenEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.HIDDEN, { 2846 relatedTarget: _this._element 2847 }); 2848 var shownEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default().Event(Event.SHOWN, { 2849 relatedTarget: previous 2850 }); 2851 jquery__WEBPACK_IMPORTED_MODULE_0___default()(previous).trigger(hiddenEvent); 2852 jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this._element).trigger(shownEvent); 2853 }; 2854 if (target) { 2855 this._activate(target, target.parentNode, complete); 2856 } else { 2857 complete(); 2858 } 2859 } 2860 }, { 2861 key: "dispose", 2862 value: function dispose() { 2863 jquery__WEBPACK_IMPORTED_MODULE_0___default().removeData(this._element, DATA_KEY); 2864 this._element = null; 2865 } 2866 2867 // Private 2868 }, { 2869 key: "_activate", 2870 value: function _activate(element, container, callback) { 2871 var _this2 = this; 2872 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(container).find(Selector.ACTIVE_UL) : jquery__WEBPACK_IMPORTED_MODULE_0___default()(container).children(Selector.ACTIVE); 2873 var active = activeElements[0]; 2874 var isTransitioning = callback && active && jquery__WEBPACK_IMPORTED_MODULE_0___default()(active).hasClass(ClassName.FADE); 2875 var complete = function complete() { 2876 return _this2._transitionComplete(element, active, callback); 2877 }; 2878 if (active && isTransitioning) { 2879 var transitionDuration = _util__WEBPACK_IMPORTED_MODULE_1__["default"].getTransitionDurationFromElement(active); 2880 jquery__WEBPACK_IMPORTED_MODULE_0___default()(active).removeClass(ClassName.SHOW).one(_util__WEBPACK_IMPORTED_MODULE_1__["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 2881 } else { 2882 complete(); 2883 } 2884 } 2885 }, { 2886 key: "_transitionComplete", 2887 value: function _transitionComplete(element, active, callback) { 2888 if (active) { 2889 jquery__WEBPACK_IMPORTED_MODULE_0___default()(active).removeClass(ClassName.ACTIVE); 2890 var dropdownChild = jquery__WEBPACK_IMPORTED_MODULE_0___default()(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; 2891 if (dropdownChild) { 2892 jquery__WEBPACK_IMPORTED_MODULE_0___default()(dropdownChild).removeClass(ClassName.ACTIVE); 2893 } 2894 if (active.getAttribute('role') === 'tab') { 2895 active.setAttribute('aria-selected', false); 2896 } 2897 } 2898 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).addClass(ClassName.ACTIVE); 2899 if (element.getAttribute('role') === 'tab') { 2900 element.setAttribute('aria-selected', true); 2901 } 2902 _util__WEBPACK_IMPORTED_MODULE_1__["default"].reflow(element); 2903 if (element.classList.contains(ClassName.FADE)) { 2904 element.classList.add(ClassName.SHOW); 2905 } 2906 if (element.parentNode && jquery__WEBPACK_IMPORTED_MODULE_0___default()(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { 2907 var dropdownElement = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).closest(Selector.DROPDOWN)[0]; 2908 if (dropdownElement) { 2909 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE)); 2910 jquery__WEBPACK_IMPORTED_MODULE_0___default()(dropdownToggleList).addClass(ClassName.ACTIVE); 2911 } 2912 element.setAttribute('aria-expanded', true); 2913 } 2914 if (callback) { 2915 callback(); 2916 } 2917 } 2918 2919 // Static 2920 }], [{ 2921 key: "VERSION", 2922 get: function get() { 2923 return VERSION; 2924 } 2925 }, { 2926 key: "_jQueryInterface", 2927 value: function _jQueryInterface(config) { 2928 return this.each(function () { 2929 var $this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 2930 var data = $this.data(DATA_KEY); 2931 if (!data) { 2932 data = new Tab(this); 2933 $this.data(DATA_KEY, data); 2934 } 2935 if (typeof config === 'string') { 2936 if (typeof data[config] === 'undefined') { 2937 throw new TypeError("No method named \"".concat(config, "\"")); 2938 } 2939 data[config](); 2940 } 2941 }); 2942 } 2943 }]); 2944}(); 2945/** 2946 * ------------------------------------------------------------------------ 2947 * Data Api implementation 2948 * ------------------------------------------------------------------------ 2949 */ 2950jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { 2951 event.preventDefault(); 2952 Tab._jQueryInterface.call(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'show'); 2953}); 2954 2955/** 2956 * ------------------------------------------------------------------------ 2957 * jQuery 2958 * ------------------------------------------------------------------------ 2959 */ 2960 2961(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = Tab._jQueryInterface; 2962(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].Constructor = Tab; 2963(jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME].noConflict = function () { 2964 (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn)[NAME] = JQUERY_NO_CONFLICT; 2965 return Tab._jQueryInterface; 2966}; 2967/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tab); 2968 2969/***/ }), 2970
vendor: 6,137 bytes, lines 2971-3135
2971/***/ "./node_modules/bootstrap/js/src/util.js": 2972/*!***********************************************!*\ 2973 !*** ./node_modules/bootstrap/js/src/util.js ***! 2974 \***********************************************/ 2975/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2976 2977"use strict"; 2978__webpack_require__.r(__webpack_exports__); 2979/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2980/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 2981/* harmony export */ }); 2982/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 2983/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2984/** 2985 * -------------------------------------------------------------------------- 2986 * Bootstrap (v4.3.1): util.js 2987 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2988 * -------------------------------------------------------------------------- 2989 */ 2990 2991 2992 2993/** 2994 * ------------------------------------------------------------------------ 2995 * Private TransitionEnd Helpers 2996 * ------------------------------------------------------------------------ 2997 */ 2998 2999var TRANSITION_END = 'transitionend'; 3000var MAX_UID = 1000000; 3001var MILLISECONDS_MULTIPLIER = 1000; 3002 3003// Shoutout AngusCroll (https://goo.gl/pxwQGp) 3004function toType(obj) { 3005 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 3006} 3007function getSpecialTransitionEndEvent() { 3008 return { 3009 bindType: TRANSITION_END, 3010 delegateType: TRANSITION_END, 3011 handle: function handle(event) { 3012 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.target).is(this)) { 3013 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 3014 } 3015 return undefined; // eslint-disable-line no-undefined 3016 } 3017 }; 3018} 3019function transitionEndEmulator(duration) { 3020 var _this = this; 3021 var called = false; 3022 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).one(Util.TRANSITION_END, function () { 3023 called = true; 3024 }); 3025 setTimeout(function () { 3026 if (!called) { 3027 Util.triggerTransitionEnd(_this); 3028 } 3029 }, duration); 3030 return this; 3031} 3032function setTransitionEndSupport() { 3033 (jquery__WEBPACK_IMPORTED_MODULE_0___default().fn.emulateTransitionEnd) = transitionEndEmulator; 3034 (jquery__WEBPACK_IMPORTED_MODULE_0___default().event.special)[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 3035} 3036 3037/** 3038 * -------------------------------------------------------------------------- 3039 * Public Util Api 3040 * -------------------------------------------------------------------------- 3041 */ 3042 3043var Util = { 3044 TRANSITION_END: 'bsTransitionEnd', 3045 getUID: function getUID(prefix) { 3046 do { 3047 // eslint-disable-next-line no-bitwise 3048 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 3049 } while (document.getElementById(prefix)); 3050 return prefix; 3051 }, 3052 getSelectorFromElement: function getSelectorFromElement(element) { 3053 var selector = element.getAttribute('data-target'); 3054 if (!selector || selector === '#') { 3055 var hrefAttr = element.getAttribute('href'); 3056 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 3057 } 3058 try { 3059 return document.querySelector(selector) ? selector : null; 3060 } catch (err) { 3061 return null; 3062 } 3063 }, 3064 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 3065 if (!element) { 3066 return 0; 3067 } 3068 3069 // Get transition-duration of the element 3070 var transitionDuration = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).css('transition-duration'); 3071 var transitionDelay = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).css('transition-delay'); 3072 var floatTransitionDuration = parseFloat(transitionDuration); 3073 var floatTransitionDelay = parseFloat(transitionDelay); 3074 3075 // Return 0 if element or transition duration is not found 3076 if (!floatTransitionDuration && !floatTransitionDelay) { 3077 return 0; 3078 } 3079 3080 // If multiple durations are defined, take the first 3081 transitionDuration = transitionDuration.split(',')[0]; 3082 transitionDelay = transitionDelay.split(',')[0]; 3083 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 3084 }, 3085 reflow: function reflow(element) { 3086 return element.offsetHeight; 3087 }, 3088 triggerTransitionEnd: function triggerTransitionEnd(element) { 3089 jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).trigger(TRANSITION_END); 3090 }, 3091 // TODO: Remove in v5 3092 supportsTransitionEnd: function supportsTransitionEnd() { 3093 return Boolean(TRANSITION_END); 3094 }, 3095 isElement: function isElement(obj) { 3096 return (obj[0] || obj).nodeType; 3097 }, 3098 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 3099 for (var property in configTypes) { 3100 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 3101 var expectedTypes = configTypes[property]; 3102 var value = config[property]; 3103 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 3104 if (!new RegExp(expectedTypes).test(valueType)) { 3105 throw new Error("".concat(componentName.toUpperCase(), ": ") + "Option \"".concat(property, "\" provided type \"").concat(valueType, "\" ") + "but expected type \"".concat(expectedTypes, "\".")); 3106 } 3107 } 3108 } 3109 }, 3110 findShadowRoot: function findShadowRoot(element) { 3111 if (!document.documentElement.attachShadow) { 3112 return null; 3113 } 3114 3115 // Can find the shadow root otherwise it'll return the document 3116 if (typeof element.getRootNode === 'function') { 3117 var root = element.getRootNode(); 3118 return root instanceof ShadowRoot ? root : null; 3119 } 3120 if (element instanceof ShadowRoot) { 3121 return element; 3122 } 3123 3124 // when we don't find a shadow root 3125 if (!element.parentNode) { 3126 return null; 3127 } 3128 return Util.findShadowRoot(element.parentNode); 3129 } 3130}; 3131setTransitionEndSupport(); 3132/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Util); 3133 3134/***/ }), 3135
vendor: 319,041 bytes, lines 3136-12146
3136/***/ "./node_modules/jquery/dist/jquery.js": 3137/*!********************************************!*\ 3138 !*** ./node_modules/jquery/dist/jquery.js ***! 3139 \********************************************/ 3140/***/ (function(module, exports, __webpack_require__) { 3141 3142/* module decorator */ module = __webpack_require__.nmd(module); 3143var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 3144/*! 3145 * jQuery JavaScript Library v3.7.1 3146 * https://jquery.com/ 3147 * 3148 * Copyright OpenJS Foundation and other contributors 3149 * Released under the MIT license 3150 * https://jquery.org/license 3151 * 3152 * Date: 2023-08-28T13:37Z 3153 */ 3154(function (global, factory) { 3155 "use strict"; 3156 3157 if (( false ? 0 : _typeof(module)) === "object" && _typeof(module.exports) === "object") { 3158 // For CommonJS and CommonJS-like environments where a proper `window` 3159 // is present, execute the factory and get jQuery. 3160 // For environments that do not have a `window` with a `document` 3161 // (such as Node.js), expose a factory as module.exports. 3162 // This accentuates the need for the creation of a real `window`. 3163 // e.g. var jQuery = require("jquery")(window); 3164 // See ticket trac-14549 for more info. 3165 module.exports = global.document ? factory(global, true) : function (w) { 3166 if (!w.document) { 3167 throw new Error("jQuery requires a window with a document"); 3168 } 3169 return factory(w); 3170 }; 3171 } else { 3172 factory(global); 3173 } 3174 3175 // Pass this if window is not defined yet 3176})(typeof window !== "undefined" ? window : this, function (window, noGlobal) { 3177 // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 3178 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 3179 // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 3180 // enough that all such attempts are guarded in a try block. 3181 "use strict"; 3182 3183 var arr = []; 3184 var getProto = Object.getPrototypeOf; 3185 var _slice = arr.slice; 3186 var flat = arr.flat ? function (array) { 3187 return arr.flat.call(array); 3188 } : function (array) { 3189 return arr.concat.apply([], array); 3190 }; 3191 var push = arr.push; 3192 var indexOf = arr.indexOf; 3193 var class2type = {}; 3194 var toString = class2type.toString; 3195 var hasOwn = class2type.hasOwnProperty; 3196 var fnToString = hasOwn.toString; 3197 var ObjectFunctionString = fnToString.call(Object); 3198 var support = {}; 3199 var isFunction = function isFunction(obj) { 3200 // Support: Chrome <=57, Firefox <=52 3201 // In some browsers, typeof returns "function" for HTML <object> elements 3202 // (i.e., `typeof document.createElement( "object" ) === "function"`). 3203 // We don't want to classify *any* DOM node as a function. 3204 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 3205 // Plus for old WebKit, typeof returns "function" for HTML collections 3206 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 3207 return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function"; 3208 }; 3209 var isWindow = function isWindow(obj) { 3210 return obj != null && obj === obj.window; 3211 }; 3212 var document = window.document; 3213 var preservedScriptAttributes = { 3214 type: true, 3215 src: true, 3216 nonce: true, 3217 noModule: true 3218 }; 3219 function DOMEval(code, node, doc) { 3220 doc = doc || document; 3221 var i, 3222 val, 3223 script = doc.createElement("script"); 3224 script.text = code; 3225 if (node) { 3226 for (i in preservedScriptAttributes) { 3227 // Support: Firefox 64+, Edge 18+ 3228 // Some browsers don't support the "nonce" property on scripts. 3229 // On the other hand, just using `getAttribute` is not enough as 3230 // the `nonce` attribute is reset to an empty string whenever it 3231 // becomes browsing-context connected. 3232 // See https://github.com/whatwg/html/issues/2369 3233 // See https://html.spec.whatwg.org/#nonce-attributes 3234 // The `node.getAttribute` check was added for the sake of 3235 // `jQuery.globalEval` so that it can fake a nonce-containing node 3236 // via an object. 3237 val = node[i] || node.getAttribute && node.getAttribute(i); 3238 if (val) { 3239 script.setAttribute(i, val); 3240 } 3241 } 3242 } 3243 doc.head.appendChild(script).parentNode.removeChild(script); 3244 } 3245 function toType(obj) { 3246 if (obj == null) { 3247 return obj + ""; 3248 } 3249 3250 // Support: Android <=2.3 only (functionish RegExp) 3251 return _typeof(obj) === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : _typeof(obj); 3252 } 3253 /* global Symbol */ 3254 // Defining this global in .eslintrc.json would create a danger of using the global 3255 // unguarded in another place, it seems safer to define global only for this module 3256 3257 var version = "3.7.1", 3258 rhtmlSuffix = /HTML$/i, 3259 // Define a local copy of jQuery 3260 _jQuery2 = function jQuery(selector, context) { 3261 // The jQuery object is actually just the init constructor 'enhanced' 3262 // Need init if jQuery is called (just allow error to be thrown if not included) 3263 return new _jQuery2.fn.init(selector, context); 3264 }; 3265 _jQuery2.fn = _jQuery2.prototype = { 3266 // The current version of jQuery being used 3267 jquery: version, 3268 constructor: _jQuery2, 3269 // The default length of a jQuery object is 0 3270 length: 0, 3271 toArray: function toArray() { 3272 return _slice.call(this); 3273 }, 3274 // Get the Nth element in the matched element set OR 3275 // Get the whole matched element set as a clean array 3276 get: function get(num) { 3277 // Return all the elements in a clean array 3278 if (num == null) { 3279 return _slice.call(this); 3280 } 3281 3282 // Return just the one element from the set 3283 return num < 0 ? this[num + this.length] : this[num]; 3284 }, 3285 // Take an array of elements and push it onto the stack 3286 // (returning the new matched element set) 3287 pushStack: function pushStack(elems) { 3288 // Build a new jQuery matched element set 3289 var ret = _jQuery2.merge(this.constructor(), elems); 3290 3291 // Add the old object onto the stack (as a reference) 3292 ret.prevObject = this; 3293 3294 // Return the newly-formed element set 3295 return ret; 3296 }, 3297 // Execute a callback for every element in the matched set. 3298 each: function each(callback) { 3299 return _jQuery2.each(this, callback); 3300 }, 3301 map: function map(callback) { 3302 return this.pushStack(_jQuery2.map(this, function (elem, i) { 3303 return callback.call(elem, i, elem); 3304 })); 3305 }, 3306 slice: function slice() { 3307 return this.pushStack(_slice.apply(this, arguments)); 3308 }, 3309 first: function first() { 3310 return this.eq(0); 3311 }, 3312 last: function last() { 3313 return this.eq(-1); 3314 }, 3315 even: function even() { 3316 return this.pushStack(_jQuery2.grep(this, function (_elem, i) { 3317 return (i + 1) % 2; 3318 })); 3319 }, 3320 odd: function odd() { 3321 return this.pushStack(_jQuery2.grep(this, function (_elem, i) { 3322 return i % 2; 3323 })); 3324 }, 3325 eq: function eq(i) { 3326 var len = this.length, 3327 j = +i + (i < 0 ? len : 0); 3328 return this.pushStack(j >= 0 && j < len ? [this[j]] : []); 3329 }, 3330 end: function end() { 3331 return this.prevObject || this.constructor(); 3332 }, 3333 // For internal use only. 3334 // Behaves like an Array's method, not like a jQuery method. 3335 push: push, 3336 sort: arr.sort, 3337 splice: arr.splice 3338 }; 3339 _jQuery2.extend = _jQuery2.fn.extend = function () { 3340 var options, 3341 name, 3342 src, 3343 copy, 3344 copyIsArray, 3345 clone, 3346 target = arguments[0] || {}, 3347 i = 1, 3348 length = arguments.length, 3349 deep = false; 3350 3351 // Handle a deep copy situation 3352 if (typeof target === "boolean") { 3353 deep = target; 3354 3355 // Skip the boolean and the target 3356 target = arguments[i] || {}; 3357 i++; 3358 } 3359 3360 // Handle case when target is a string or something (possible in deep copy) 3361 if (_typeof(target) !== "object" && !isFunction(target)) { 3362 target = {}; 3363 } 3364 3365 // Extend jQuery itself if only one argument is passed 3366 if (i === length) { 3367 target = this; 3368 i--; 3369 } 3370 for (; i < length; i++) { 3371 // Only deal with non-null/undefined values 3372 if ((options = arguments[i]) != null) { 3373 // Extend the base object 3374 for (name in options) { 3375 copy = options[name]; 3376 3377 // Prevent Object.prototype pollution 3378 // Prevent never-ending loop 3379 if (name === "__proto__" || target === copy) { 3380 continue; 3381 } 3382 3383 // Recurse if we're merging plain objects or arrays 3384 if (deep && copy && (_jQuery2.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) { 3385 src = target[name]; 3386 3387 // Ensure proper type for the source value 3388 if (copyIsArray && !Array.isArray(src)) { 3389 clone = []; 3390 } else if (!copyIsArray && !_jQuery2.isPlainObject(src)) { 3391 clone = {}; 3392 } else { 3393 clone = src; 3394 } 3395 copyIsArray = false; 3396 3397 // Never move original objects, clone them 3398 target[name] = _jQuery2.extend(deep, clone, copy); 3399 3400 // Don't bring in undefined values 3401 } else if (copy !== undefined) { 3402 target[name] = copy; 3403 } 3404 } 3405 } 3406 } 3407 3408 // Return the modified object 3409 return target; 3410 }; 3411 _jQuery2.extend({ 3412 // Unique for each copy of jQuery on the page 3413 expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""), 3414 // Assume jQuery is ready without the ready module 3415 isReady: true, 3416 error: function error(msg) { 3417 throw new Error(msg); 3418 }, 3419 noop: function noop() {}, 3420 isPlainObject: function isPlainObject(obj) { 3421 var proto, Ctor; 3422 3423 // Detect obvious negatives 3424 // Use toString instead of jQuery.type to catch host objects 3425 if (!obj || toString.call(obj) !== "[object Object]") { 3426 return false; 3427 } 3428 proto = getProto(obj); 3429 3430 // Objects with no prototype (e.g., `Object.create( null )`) are plain 3431 if (!proto) { 3432 return true; 3433 } 3434 3435 // Objects with prototype are plain iff they were constructed by a global Object function 3436 Ctor = hasOwn.call(proto, "constructor") && proto.constructor; 3437 return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString; 3438 }, 3439 isEmptyObject: function isEmptyObject(obj) { 3440 var name; 3441 for (name in obj) { 3442 return false; 3443 } 3444 return true; 3445 }, 3446 // Evaluates a script in a provided context; falls back to the global one 3447 // if not specified. 3448 globalEval: function globalEval(code, options, doc) { 3449 DOMEval(code, { 3450 nonce: options && options.nonce 3451 }, doc); 3452 }, 3453 each: function each(obj, callback) { 3454 var length, 3455 i = 0; 3456 if (isArrayLike(obj)) { 3457 length = obj.length; 3458 for (; i < length; i++) { 3459 if (callback.call(obj[i], i, obj[i]) === false) { 3460 break; 3461 } 3462 } 3463 } else { 3464 for (i in obj) { 3465 if (callback.call(obj[i], i, obj[i]) === false) { 3466 break; 3467 } 3468 } 3469 } 3470 return obj; 3471 }, 3472 // Retrieve the text value of an array of DOM nodes 3473 text: function text(elem) { 3474 var node, 3475 ret = "", 3476 i = 0, 3477 nodeType = elem.nodeType; 3478 if (!nodeType) { 3479 // If no nodeType, this is expected to be an array 3480 while (node = elem[i++]) { 3481 // Do not traverse comment nodes 3482 ret += _jQuery2.text(node); 3483 } 3484 } 3485 if (nodeType === 1 || nodeType === 11) { 3486 return elem.textContent; 3487 } 3488 if (nodeType === 9) { 3489 return elem.documentElement.textContent; 3490 } 3491 if (nodeType === 3 || nodeType === 4) { 3492 return elem.nodeValue; 3493 } 3494 3495 // Do not include comment or processing instruction nodes 3496 3497 return ret; 3498 }, 3499 // results is for internal usage only 3500 makeArray: function makeArray(arr, results) { 3501 var ret = results || []; 3502 if (arr != null) { 3503 if (isArrayLike(Object(arr))) { 3504 _jQuery2.merge(ret, typeof arr === "string" ? [arr] : arr); 3505 } else { 3506 push.call(ret, arr); 3507 } 3508 } 3509 return ret; 3510 }, 3511 inArray: function inArray(elem, arr, i) { 3512 return arr == null ? -1 : indexOf.call(arr, elem, i); 3513 }, 3514 isXMLDoc: function isXMLDoc(elem) { 3515 var namespace = elem && elem.namespaceURI, 3516 docElem = elem && (elem.ownerDocument || elem).documentElement; 3517 3518 // Assume HTML when documentElement doesn't yet exist, such as inside 3519 // document fragments. 3520 return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML"); 3521 }, 3522 // Support: Android <=4.0 only, PhantomJS 1 only 3523 // push.apply(_, arraylike) throws on ancient WebKit 3524 merge: function merge(first, second) { 3525 var len = +second.length, 3526 j = 0, 3527 i = first.length; 3528 for (; j < len; j++) { 3529 first[i++] = second[j]; 3530 } 3531 first.length = i; 3532 return first; 3533 }, 3534 grep: function grep(elems, callback, invert) { 3535 var callbackInverse, 3536 matches = [], 3537 i = 0, 3538 length = elems.length, 3539 callbackExpect = !invert; 3540 3541 // Go through the array, only saving the items 3542 // that pass the validator function 3543 for (; i < length; i++) { 3544 callbackInverse = !callback(elems[i], i); 3545 if (callbackInverse !== callbackExpect) { 3546 matches.push(elems[i]); 3547 } 3548 } 3549 return matches; 3550 }, 3551 // arg is for internal usage only 3552 map: function map(elems, callback, arg) { 3553 var length, 3554 value, 3555 i = 0, 3556 ret = []; 3557 3558 // Go through the array, translating each of the items to their new values 3559 if (isArrayLike(elems)) { 3560 length = elems.length; 3561 for (; i < length; i++) { 3562 value = callback(elems[i], i, arg); 3563 if (value != null) { 3564 ret.push(value); 3565 } 3566 } 3567 3568 // Go through every key on the object, 3569 } else { 3570 for (i in elems) { 3571 value = callback(elems[i], i, arg); 3572 if (value != null) { 3573 ret.push(value); 3574 } 3575 } 3576 } 3577 3578 // Flatten any nested arrays 3579 return flat(ret); 3580 }, 3581 // A global GUID counter for objects 3582 guid: 1, 3583 // jQuery.support is not used in Core but other projects attach their 3584 // properties to it so it needs to exist. 3585 support: support 3586 }); 3587 if (typeof Symbol === "function") { 3588 _jQuery2.fn[Symbol.iterator] = arr[Symbol.iterator]; 3589 } 3590 3591 // Populate the class2type map 3592 _jQuery2.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (_i, name) { 3593 class2type["[object " + name + "]"] = name.toLowerCase(); 3594 }); 3595 function isArrayLike(obj) { 3596 // Support: real iOS 8.2 only (not reproducible in simulator) 3597 // `in` check used to prevent JIT error (gh-2145) 3598 // hasOwn isn't used here due to false negatives 3599 // regarding Nodelist length in IE 3600 var length = !!obj && "length" in obj && obj.length, 3601 type = toType(obj); 3602 if (isFunction(obj) || isWindow(obj)) { 3603 return false; 3604 } 3605 return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj; 3606 } 3607 function nodeName(elem, name) { 3608 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 3609 } 3610 var pop = arr.pop; 3611 var sort = arr.sort; 3612 var splice = arr.splice; 3613 var whitespace = "[\\x20\\t\\r\\n\\f]"; 3614 var rtrimCSS = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"); 3615 3616 // Note: an element does not contain itself 3617 _jQuery2.contains = function (a, b) { 3618 var bup = b && b.parentNode; 3619 return a === bup || !!(bup && bup.nodeType === 1 && ( 3620 // Support: IE 9 - 11+ 3621 // IE doesn't have `contains` on SVG. 3622 a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16)); 3623 }; 3624 3625 // CSS string/identifier serialization 3626 // https://drafts.csswg.org/cssom/#common-serializing-idioms 3627 var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 3628 function fcssescape(ch, asCodePoint) { 3629 if (asCodePoint) { 3630 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 3631 if (ch === "\0") { 3632 return "\uFFFD"; 3633 } 3634 3635 // Control characters and (dependent upon position) numbers get escaped as code points 3636 return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " "; 3637 } 3638 3639 // Other potentially-special ASCII characters get backslash-escaped 3640 return "\\" + ch; 3641 } 3642 _jQuery2.escapeSelector = function (sel) { 3643 return (sel + "").replace(rcssescape, fcssescape); 3644 }; 3645 var preferredDoc = document, 3646 pushNative = push; 3647 (function () { 3648 var i, 3649 Expr, 3650 outermostContext, 3651 sortInput, 3652 hasDuplicate, 3653 push = pushNative, 3654 // Local document vars 3655 document, 3656 documentElement, 3657 documentIsHTML, 3658 rbuggyQSA, 3659 matches, 3660 // Instance-specific data 3661 expando = _jQuery2.expando, 3662 dirruns = 0, 3663 done = 0, 3664 classCache = createCache(), 3665 tokenCache = createCache(), 3666 compilerCache = createCache(), 3667 nonnativeSelectorCache = createCache(), 3668 sortOrder = function sortOrder(a, b) { 3669 if (a === b) { 3670 hasDuplicate = true; 3671 } 3672 return 0; 3673 }, 3674 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + "loop|multiple|open|readonly|required|scoped", 3675 // Regular expressions 3676 3677 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 3678 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 3679 // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors 3680 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 3681 // Operator (capture 2) 3682 "*([*^$|!~]?=)" + whitespace + 3683 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 3684 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", 3685 pseudos = ":(" + identifier + ")(?:\\((" + 3686 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 3687 // 1. quoted (capture 3; capture 4 or capture 5) 3688 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 3689 // 2. simple (capture 6) 3690 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 3691 // 3. anything else (capture 2) 3692 ".*" + ")\\)|)", 3693 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 3694 rwhitespace = new RegExp(whitespace + "+", "g"), 3695 rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), 3696 rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), 3697 rdescend = new RegExp(whitespace + "|>"), 3698 rpseudo = new RegExp(pseudos), 3699 ridentifier = new RegExp("^" + identifier + "$"), 3700 matchExpr = { 3701 ID: new RegExp("^#(" + identifier + ")"), 3702 CLASS: new RegExp("^\\.(" + identifier + ")"), 3703 TAG: new RegExp("^(" + identifier + "|[*])"), 3704 ATTR: new RegExp("^" + attributes), 3705 PSEUDO: new RegExp("^" + pseudos), 3706 CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"), 3707 bool: new RegExp("^(?:" + booleans + ")$", "i"), 3708 // For use in libraries implementing .is() 3709 // We use this for POS matching in `select` 3710 needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i") 3711 }, 3712 rinputs = /^(?:input|select|textarea|button)$/i, 3713 rheader = /^h\d$/i, 3714 // Easily-parseable/retrievable ID or TAG or CLASS selectors 3715 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 3716 rsibling = /[+~]/, 3717 // CSS escapes 3718 // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters 3719 runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), 3720 funescape = function funescape(escape, nonHex) { 3721 var high = "0x" + escape.slice(1) - 0x10000; 3722 if (nonHex) { 3723 // Strip the backslash prefix from a non-hex escape sequence 3724 return nonHex; 3725 } 3726 3727 // Replace a hexadecimal escape sequence with the encoded Unicode code point 3728 // Support: IE <=11+ 3729 // For values outside the Basic Multilingual Plane (BMP), manually construct a 3730 // surrogate pair 3731 return high < 0 ? String.fromCharCode(high + 0x10000) : String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00); 3732 }, 3733 // Used for iframes; see `setDocument`. 3734 // Support: IE 9 - 11+, Edge 12 - 18+ 3735 // Removing the function wrapper causes a "Permission Denied" 3736 // error in IE/Edge. 3737 unloadHandler = function unloadHandler() { 3738 setDocument(); 3739 }, 3740 inDisabledFieldset = addCombinator(function (elem) { 3741 return elem.disabled === true && nodeName(elem, "fieldset"); 3742 }, { 3743 dir: "parentNode", 3744 next: "legend" 3745 }); 3746 3747 // Support: IE <=9 only 3748 // Accessing document.activeElement can throw unexpectedly 3749 // https://bugs.jquery.com/ticket/13393 3750 function safeActiveElement() { 3751 try { 3752 return document.activeElement; 3753 } catch (err) {} 3754 } 3755 3756 // Optimize for push.apply( _, NodeList ) 3757 try { 3758 push.apply(arr = _slice.call(preferredDoc.childNodes), preferredDoc.childNodes); 3759 3760 // Support: Android <=4.0 3761 // Detect silently failing push.apply 3762 // eslint-disable-next-line no-unused-expressions 3763 arr[preferredDoc.childNodes.length].nodeType; 3764 } catch (e) { 3765 push = { 3766 apply: function apply(target, els) { 3767 pushNative.apply(target, _slice.call(els)); 3768 }, 3769 call: function call(target) { 3770 pushNative.apply(target, _slice.call(arguments, 1)); 3771 } 3772 }; 3773 } 3774 function find(selector, context, results, seed) { 3775 var m, 3776 i, 3777 elem, 3778 nid, 3779 match, 3780 groups, 3781 newSelector, 3782 newContext = context && context.ownerDocument, 3783 // nodeType defaults to 9, since context defaults to document 3784 nodeType = context ? context.nodeType : 9; 3785 results = results || []; 3786 3787 // Return early from calls with invalid selector or context 3788 if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) { 3789 return results; 3790 } 3791 3792 // Try to shortcut find operations (as opposed to filters) in HTML documents 3793 if (!seed) { 3794 setDocument(context); 3795 context = context || document; 3796 if (documentIsHTML) { 3797 // If the selector is sufficiently simple, try using a "get*By*" DOM method 3798 // (excepting DocumentFragment context, where the methods don't exist) 3799 if (nodeType !== 11 && (match = rquickExpr.exec(selector))) { 3800 // ID selector 3801 if (m = match[1]) { 3802 // Document context 3803 if (nodeType === 9) { 3804 if (elem = context.getElementById(m)) { 3805 // Support: IE 9 only 3806 // getElementById can match elements by name instead of ID 3807 if (elem.id === m) { 3808 push.call(results, elem); 3809 return results; 3810 } 3811 } else { 3812 return results; 3813 } 3814 3815 // Element context 3816 } else { 3817 // Support: IE 9 only 3818 // getElementById can match elements by name instead of ID 3819 if (newContext && (elem = newContext.getElementById(m)) && find.contains(context, elem) && elem.id === m) { 3820 push.call(results, elem); 3821 return results; 3822 } 3823 } 3824 3825 // Type selector 3826 } else if (match[2]) { 3827 push.apply(results, context.getElementsByTagName(selector)); 3828 return results; 3829 3830 // Class selector 3831 } else if ((m = match[3]) && context.getElementsByClassName) { 3832 push.apply(results, context.getElementsByClassName(m)); 3833 return results; 3834 } 3835 } 3836 3837 // Take advantage of querySelectorAll 3838 if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) { 3839 newSelector = selector; 3840 newContext = context; 3841 3842 // qSA considers elements outside a scoping root when evaluating child or 3843 // descendant combinators, which is not what we want. 3844 // In such cases, we work around the behavior by prefixing every selector in the 3845 // list with an ID selector referencing the scope context. 3846 // The technique has to be used as well when a leading combinator is used 3847 // as such selectors are not recognized by querySelectorAll. 3848 // Thanks to Andrew Dupont for this technique. 3849 if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) { 3850 // Expand context for sibling selectors 3851 newContext = rsibling.test(selector) && testContext(context.parentNode) || context; 3852 3853 // We can use :scope instead of the ID hack if the browser 3854 // supports it & if we're not changing the context. 3855 // Support: IE 11+, Edge 17 - 18+ 3856 // IE/Edge sometimes throw a "Permission denied" error when 3857 // strict-comparing two documents; shallow comparisons work. 3858 // eslint-disable-next-line eqeqeq 3859 if (newContext != context || !support.scope) { 3860 // Capture the context ID, setting it first if necessary 3861 if (nid = context.getAttribute("id")) { 3862 nid = _jQuery2.escapeSelector(nid); 3863 } else { 3864 context.setAttribute("id", nid = expando); 3865 } 3866 } 3867 3868 // Prefix every selector in the list 3869 groups = tokenize(selector); 3870 i = groups.length; 3871 while (i--) { 3872 groups[i] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i]); 3873 } 3874 newSelector = groups.join(","); 3875 } 3876 try { 3877 push.apply(results, newContext.querySelectorAll(newSelector)); 3878 return results; 3879 } catch (qsaError) { 3880 nonnativeSelectorCache(selector, true); 3881 } finally { 3882 if (nid === expando) { 3883 context.removeAttribute("id"); 3884 } 3885 } 3886 } 3887 } 3888 } 3889 3890 // All others 3891 return select(selector.replace(rtrimCSS, "$1"), context, results, seed); 3892 } 3893 3894 /** 3895 * Create key-value caches of limited size 3896 * @returns {function(string, object)} Returns the Object data after storing it on itself with 3897 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 3898 * deleting the oldest entry 3899 */ 3900 function createCache() { 3901 var keys = []; 3902 function cache(key, value) { 3903 // Use (key + " ") to avoid collision with native prototype properties 3904 // (see https://github.com/jquery/sizzle/issues/157) 3905 if (keys.push(key + " ") > Expr.cacheLength) { 3906 // Only keep the most recent entries 3907 delete cache[keys.shift()]; 3908 } 3909 return cache[key + " "] = value; 3910 } 3911 return cache; 3912 } 3913 3914 /** 3915 * Mark a function for special use by jQuery selector module 3916 * @param {Function} fn The function to mark 3917 */ 3918 function markFunction(fn) { 3919 fn[expando] = true; 3920 return fn; 3921 } 3922 3923 /** 3924 * Support testing using an element 3925 * @param {Function} fn Passed the created element and returns a boolean result 3926 */ 3927 function assert(fn) { 3928 var el = document.createElement("fieldset"); 3929 try { 3930 return !!fn(el); 3931 } catch (e) { 3932 return false; 3933 } finally { 3934 // Remove from its parent by default 3935 if (el.parentNode) { 3936 el.parentNode.removeChild(el); 3937 } 3938 3939 // release memory in IE 3940 el = null; 3941 } 3942 } 3943 3944 /** 3945 * Returns a function to use in pseudos for input types 3946 * @param {String} type 3947 */ 3948 function createInputPseudo(type) { 3949 return function (elem) { 3950 return nodeName(elem, "input") && elem.type === type; 3951 }; 3952 } 3953 3954 /** 3955 * Returns a function to use in pseudos for buttons 3956 * @param {String} type 3957 */ 3958 function createButtonPseudo(type) { 3959 return function (elem) { 3960 return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type; 3961 }; 3962 } 3963 3964 /** 3965 * Returns a function to use in pseudos for :enabled/:disabled 3966 * @param {Boolean} disabled true for :disabled; false for :enabled 3967 */ 3968 function createDisabledPseudo(disabled) { 3969 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 3970 return function (elem) { 3971 // Only certain elements can match :enabled or :disabled 3972 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 3973 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 3974 if ("form" in elem) { 3975 // Check for inherited disabledness on relevant non-disabled elements: 3976 // * listed form-associated elements in a disabled fieldset 3977 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 3978 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 3979 // * option elements in a disabled optgroup 3980 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 3981 // All such elements have a "form" property. 3982 if (elem.parentNode && elem.disabled === false) { 3983 // Option elements defer to a parent optgroup if present 3984 if ("label" in elem) { 3985 if ("label" in elem.parentNode) { 3986 return elem.parentNode.disabled === disabled; 3987 } else { 3988 return elem.disabled === disabled; 3989 } 3990 } 3991 3992 // Support: IE 6 - 11+ 3993 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 3994 return elem.isDisabled === disabled || 3995 // Where there is no isDisabled, check manually 3996 elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled; 3997 } 3998 return elem.disabled === disabled; 3999 4000 // Try to winnow out elements that can't be disabled before trusting the disabled property. 4001 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 4002 // even exist on them, let alone have a boolean value. 4003 } else if ("label" in elem) { 4004 return elem.disabled === disabled; 4005 } 4006 4007 // Remaining elements are neither :enabled nor :disabled 4008 return false; 4009 }; 4010 } 4011 4012 /** 4013 * Returns a function to use in pseudos for positionals 4014 * @param {Function} fn 4015 */ 4016 function createPositionalPseudo(fn) { 4017 return markFunction(function (argument) { 4018 argument = +argument; 4019 return markFunction(function (seed, matches) { 4020 var j, 4021 matchIndexes = fn([], seed.length, argument), 4022 i = matchIndexes.length; 4023 4024 // Match elements found at the specified indexes 4025 while (i--) { 4026 if (seed[j = matchIndexes[i]]) { 4027 seed[j] = !(matches[j] = seed[j]); 4028 } 4029 } 4030 }); 4031 }); 4032 } 4033 4034 /** 4035 * Checks a node for validity as a jQuery selector context 4036 * @param {Element|Object=} context 4037 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 4038 */ 4039 function testContext(context) { 4040 return context && typeof context.getElementsByTagName !== "undefined" && context; 4041 } 4042 4043 /** 4044 * Sets document-related variables once based on the current document 4045 * @param {Element|Object} [node] An element or document object to use to set the document 4046 * @returns {Object} Returns the current document 4047 */ 4048 function setDocument(node) { 4049 var subWindow, 4050 doc = node ? node.ownerDocument || node : preferredDoc; 4051 4052 // Return early if doc is invalid or already selected 4053 // Support: IE 11+, Edge 17 - 18+ 4054 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4055 // two documents; shallow comparisons work. 4056 // eslint-disable-next-line eqeqeq 4057 if (doc == document || doc.nodeType !== 9 || !doc.documentElement) { 4058 return document; 4059 } 4060 4061 // Update global variables 4062 document = doc; 4063 documentElement = document.documentElement; 4064 documentIsHTML = !_jQuery2.isXMLDoc(document); 4065 4066 // Support: iOS 7 only, IE 9 - 11+ 4067 // Older browsers didn't support unprefixed `matches`. 4068 matches = documentElement.matches || documentElement.webkitMatchesSelector || documentElement.msMatchesSelector; 4069 4070 // Support: IE 9 - 11+, Edge 12 - 18+ 4071 // Accessing iframe documents after unload throws "permission denied" errors 4072 // (see trac-13936). 4073 // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, 4074 // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. 4075 if (documentElement.msMatchesSelector && 4076 // Support: IE 11+, Edge 17 - 18+ 4077 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4078 // two documents; shallow comparisons work. 4079 // eslint-disable-next-line eqeqeq 4080 preferredDoc != document && (subWindow = document.defaultView) && subWindow.top !== subWindow) { 4081 // Support: IE 9 - 11+, Edge 12 - 18+ 4082 subWindow.addEventListener("unload", unloadHandler); 4083 } 4084 4085 // Support: IE <10 4086 // Check if getElementById returns elements by name 4087 // The broken getElementById methods don't pick up programmatically-set names, 4088 // so use a roundabout getElementsByName test 4089 support.getById = assert(function (el) { 4090 documentElement.appendChild(el).id = _jQuery2.expando; 4091 return !document.getElementsByName || !document.getElementsByName(_jQuery2.expando).length; 4092 }); 4093 4094 // Support: IE 9 only 4095 // Check to see if it's possible to do matchesSelector 4096 // on a disconnected node. 4097 support.disconnectedMatch = assert(function (el) { 4098 return matches.call(el, "*"); 4099 }); 4100 4101 // Support: IE 9 - 11+, Edge 12 - 18+ 4102 // IE/Edge don't support the :scope pseudo-class. 4103 support.scope = assert(function () { 4104 return document.querySelectorAll(":scope"); 4105 }); 4106 4107 // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only 4108 // Make sure the `:has()` argument is parsed unforgivingly. 4109 // We include `*` in the test to detect buggy implementations that are 4110 // _selectively_ forgiving (specifically when the list includes at least 4111 // one valid selector). 4112 // Note that we treat complete lack of support for `:has()` as if it were 4113 // spec-compliant support, which is fine because use of `:has()` in such 4114 // environments will fail in the qSA path and fall back to jQuery traversal 4115 // anyway. 4116 support.cssHas = assert(function () { 4117 try { 4118 document.querySelector(":has(*,:jqfake)"); 4119 return false; 4120 } catch (e) { 4121 return true; 4122 } 4123 }); 4124 4125 // ID filter and find 4126 if (support.getById) { 4127 Expr.filter.ID = function (id) { 4128 var attrId = id.replace(runescape, funescape); 4129 return function (elem) { 4130 return elem.getAttribute("id") === attrId; 4131 }; 4132 }; 4133 Expr.find.ID = function (id, context) { 4134 if (typeof context.getElementById !== "undefined" && documentIsHTML) { 4135 var elem = context.getElementById(id); 4136 return elem ? [elem] : []; 4137 } 4138 }; 4139 } else { 4140 Expr.filter.ID = function (id) { 4141 var attrId = id.replace(runescape, funescape); 4142 return function (elem) { 4143 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); 4144 return node && node.value === attrId; 4145 }; 4146 }; 4147 4148 // Support: IE 6 - 7 only 4149 // getElementById is not reliable as a find shortcut 4150 Expr.find.ID = function (id, context) { 4151 if (typeof context.getElementById !== "undefined" && documentIsHTML) { 4152 var node, 4153 i, 4154 elems, 4155 elem = context.getElementById(id); 4156 if (elem) { 4157 // Verify the id attribute 4158 node = elem.getAttributeNode("id"); 4159 if (node && node.value === id) { 4160 return [elem]; 4161 } 4162 4163 // Fall back on getElementsByName 4164 elems = context.getElementsByName(id); 4165 i = 0; 4166 while (elem = elems[i++]) { 4167 node = elem.getAttributeNode("id"); 4168 if (node && node.value === id) { 4169 return [elem]; 4170 } 4171 } 4172 } 4173 return []; 4174 } 4175 }; 4176 } 4177 4178 // Tag 4179 Expr.find.TAG = function (tag, context) { 4180 if (typeof context.getElementsByTagName !== "undefined") { 4181 return context.getElementsByTagName(tag); 4182 4183 // DocumentFragment nodes don't have gEBTN 4184 } else { 4185 return context.querySelectorAll(tag); 4186 } 4187 }; 4188 4189 // Class 4190 Expr.find.CLASS = function (className, context) { 4191 if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) { 4192 return context.getElementsByClassName(className); 4193 } 4194 }; 4195 4196 /* QSA/matchesSelector 4197 ---------------------------------------------------------------------- */ 4198 4199 // QSA and matchesSelector support 4200 4201 rbuggyQSA = []; 4202 4203 // Build QSA regex 4204 // Regex strategy adopted from Diego Perini 4205 assert(function (el) { 4206 var input; 4207 documentElement.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a>" + "<select id='" + expando + "-\r\\' disabled='disabled'>" + "<option selected=''></option></select>"; 4208 4209 // Support: iOS <=7 - 8 only 4210 // Boolean attributes and "value" are not treated correctly in some XML documents 4211 if (!el.querySelectorAll("[selected]").length) { 4212 rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")"); 4213 } 4214 4215 // Support: iOS <=7 - 8 only 4216 if (!el.querySelectorAll("[id~=" + expando + "-]").length) { 4217 rbuggyQSA.push("~="); 4218 } 4219 4220 // Support: iOS 8 only 4221 // https://bugs.webkit.org/show_bug.cgi?id=136851 4222 // In-page `selector#id sibling-combinator selector` fails 4223 if (!el.querySelectorAll("a#" + expando + "+*").length) { 4224 rbuggyQSA.push(".#.+[+~]"); 4225 } 4226 4227 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 4228 // In some of the document kinds, these selectors wouldn't work natively. 4229 // This is probably OK but for backwards compatibility we want to maintain 4230 // handling them through jQuery traversal in jQuery 3.x. 4231 if (!el.querySelectorAll(":checked").length) { 4232 rbuggyQSA.push(":checked"); 4233 } 4234 4235 // Support: Windows 8 Native Apps 4236 // The type and name attributes are restricted during .innerHTML assignment 4237 input = document.createElement("input"); 4238 input.setAttribute("type", "hidden"); 4239 el.appendChild(input).setAttribute("name", "D"); 4240 4241 // Support: IE 9 - 11+ 4242 // IE's :disabled selector does not pick up the children of disabled fieldsets 4243 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 4244 // In some of the document kinds, these selectors wouldn't work natively. 4245 // This is probably OK but for backwards compatibility we want to maintain 4246 // handling them through jQuery traversal in jQuery 3.x. 4247 documentElement.appendChild(el).disabled = true; 4248 if (el.querySelectorAll(":disabled").length !== 2) { 4249 rbuggyQSA.push(":enabled", ":disabled"); 4250 } 4251 4252 // Support: IE 11+, Edge 15 - 18+ 4253 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 4254 // Adding a temporary attribute to the document before the selection works 4255 // around the issue. 4256 // Interestingly, IE 10 & older don't seem to have the issue. 4257 input = document.createElement("input"); 4258 input.setAttribute("name", ""); 4259 el.appendChild(input); 4260 if (!el.querySelectorAll("[name='']").length) { 4261 rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + "*(?:''|\"\")"); 4262 } 4263 }); 4264 if (!support.cssHas) { 4265 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ 4266 // Our regular `try-catch` mechanism fails to detect natively-unsupported 4267 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) 4268 // in browsers that parse the `:has()` argument as a forgiving selector list. 4269 // https://drafts.csswg.org/selectors/#relational now requires the argument 4270 // to be parsed unforgivingly, but browsers have not yet fully adjusted. 4271 rbuggyQSA.push(":has"); 4272 } 4273 rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")); 4274 4275 /* Sorting 4276 ---------------------------------------------------------------------- */ 4277 4278 // Document order sorting 4279 sortOrder = function sortOrder(a, b) { 4280 // Flag for duplicate removal 4281 if (a === b) { 4282 hasDuplicate = true; 4283 return 0; 4284 } 4285 4286 // Sort on method existence if only one input has compareDocumentPosition 4287 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 4288 if (compare) { 4289 return compare; 4290 } 4291 4292 // Calculate position if both inputs belong to the same document 4293 // Support: IE 11+, Edge 17 - 18+ 4294 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4295 // two documents; shallow comparisons work. 4296 // eslint-disable-next-line eqeqeq 4297 compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 4298 // Otherwise we know they are disconnected 4299 1; 4300 4301 // Disconnected nodes 4302 if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) { 4303 // Choose the first element that is related to our preferred document 4304 // Support: IE 11+, Edge 17 - 18+ 4305 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4306 // two documents; shallow comparisons work. 4307 // eslint-disable-next-line eqeqeq 4308 if (a === document || a.ownerDocument == preferredDoc && find.contains(preferredDoc, a)) { 4309 return -1; 4310 } 4311 4312 // Support: IE 11+, Edge 17 - 18+ 4313 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4314 // two documents; shallow comparisons work. 4315 // eslint-disable-next-line eqeqeq 4316 if (b === document || b.ownerDocument == preferredDoc && find.contains(preferredDoc, b)) { 4317 return 1; 4318 } 4319 4320 // Maintain original order 4321 return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0; 4322 } 4323 return compare & 4 ? -1 : 1; 4324 }; 4325 return document; 4326 } 4327 find.matches = function (expr, elements) { 4328 return find(expr, null, null, elements); 4329 }; 4330 find.matchesSelector = function (elem, expr) { 4331 setDocument(elem); 4332 if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) { 4333 try { 4334 var ret = matches.call(elem, expr); 4335 4336 // IE 9's matchesSelector returns false on disconnected nodes 4337 if (ret || support.disconnectedMatch || 4338 // As well, disconnected nodes are said to be in a document 4339 // fragment in IE 9 4340 elem.document && elem.document.nodeType !== 11) { 4341 return ret; 4342 } 4343 } catch (e) { 4344 nonnativeSelectorCache(expr, true); 4345 } 4346 } 4347 return find(expr, document, null, [elem]).length > 0; 4348 }; 4349 find.contains = function (context, elem) { 4350 // Set document vars if needed 4351 // Support: IE 11+, Edge 17 - 18+ 4352 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4353 // two documents; shallow comparisons work. 4354 // eslint-disable-next-line eqeqeq 4355 if ((context.ownerDocument || context) != document) { 4356 setDocument(context); 4357 } 4358 return _jQuery2.contains(context, elem); 4359 }; 4360 find.attr = function (elem, name) { 4361 // Set document vars if needed 4362 // Support: IE 11+, Edge 17 - 18+ 4363 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4364 // two documents; shallow comparisons work. 4365 // eslint-disable-next-line eqeqeq 4366 if ((elem.ownerDocument || elem) != document) { 4367 setDocument(elem); 4368 } 4369 var fn = Expr.attrHandle[name.toLowerCase()], 4370 // Don't get fooled by Object.prototype properties (see trac-13807) 4371 val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined; 4372 if (val !== undefined) { 4373 return val; 4374 } 4375 return elem.getAttribute(name); 4376 }; 4377 find.error = function (msg) { 4378 throw new Error("Syntax error, unrecognized expression: " + msg); 4379 }; 4380 4381 /** 4382 * Document sorting and removing duplicates 4383 * @param {ArrayLike} results 4384 */ 4385 _jQuery2.uniqueSort = function (results) { 4386 var elem, 4387 duplicates = [], 4388 j = 0, 4389 i = 0; 4390 4391 // Unless we *know* we can detect duplicates, assume their presence 4392 // 4393 // Support: Android <=4.0+ 4394 // Testing for detecting duplicates is unpredictable so instead assume we can't 4395 // depend on duplicate detection in all browsers without a stable sort. 4396 hasDuplicate = !support.sortStable; 4397 sortInput = !support.sortStable && _slice.call(results, 0); 4398 sort.call(results, sortOrder); 4399 if (hasDuplicate) { 4400 while (elem = results[i++]) { 4401 if (elem === results[i]) { 4402 j = duplicates.push(i); 4403 } 4404 } 4405 while (j--) { 4406 splice.call(results, duplicates[j], 1); 4407 } 4408 } 4409 4410 // Clear input after sorting to release objects 4411 // See https://github.com/jquery/sizzle/pull/225 4412 sortInput = null; 4413 return results; 4414 }; 4415 _jQuery2.fn.uniqueSort = function () { 4416 return this.pushStack(_jQuery2.uniqueSort(_slice.apply(this))); 4417 }; 4418 Expr = _jQuery2.expr = { 4419 // Can be adjusted by the user 4420 cacheLength: 50, 4421 createPseudo: markFunction, 4422 match: matchExpr, 4423 attrHandle: {}, 4424 find: {}, 4425 relative: { 4426 ">": { 4427 dir: "parentNode", 4428 first: true 4429 }, 4430 " ": { 4431 dir: "parentNode" 4432 }, 4433 "+": { 4434 dir: "previousSibling", 4435 first: true 4436 }, 4437 "~": { 4438 dir: "previousSibling" 4439 } 4440 }, 4441 preFilter: { 4442 ATTR: function ATTR(match) { 4443 match[1] = match[1].replace(runescape, funescape); 4444 4445 // Move the given value to match[3] whether quoted or unquoted 4446 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape); 4447 if (match[2] === "~=") { 4448 match[3] = " " + match[3] + " "; 4449 } 4450 return match.slice(0, 4); 4451 }, 4452 CHILD: function CHILD(match) { 4453 /* matches from matchExpr["CHILD"] 4454 1 type (only|nth|...) 4455 2 what (child|of-type) 4456 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4457 4 xn-component of xn+y argument ([+-]?\d*n|) 4458 5 sign of xn-component 4459 6 x of xn-component 4460 7 sign of y-component 4461 8 y of y-component 4462 */ 4463 match[1] = match[1].toLowerCase(); 4464 if (match[1].slice(0, 3) === "nth") { 4465 // nth-* requires argument 4466 if (!match[3]) { 4467 find.error(match[0]); 4468 } 4469 4470 // numeric x and y parameters for Expr.filter.CHILD 4471 // remember that false/true cast respectively to 0/1 4472 match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd")); 4473 match[5] = +(match[7] + match[8] || match[3] === "odd"); 4474 4475 // other types prohibit arguments 4476 } else if (match[3]) { 4477 find.error(match[0]); 4478 } 4479 return match; 4480 }, 4481 PSEUDO: function PSEUDO(match) { 4482 var excess, 4483 unquoted = !match[6] && match[2]; 4484 if (matchExpr.CHILD.test(match[0])) { 4485 return null; 4486 } 4487 4488 // Accept quoted arguments as-is 4489 if (match[3]) { 4490 match[2] = match[4] || match[5] || ""; 4491 4492 // Strip excess characters from unquoted arguments 4493 } else if (unquoted && rpseudo.test(unquoted) && ( 4494 // Get excess from tokenize (recursively) 4495 excess = tokenize(unquoted, true)) && ( 4496 // advance to the next closing parenthesis 4497 excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) { 4498 // excess is a negative index 4499 match[0] = match[0].slice(0, excess); 4500 match[2] = unquoted.slice(0, excess); 4501 } 4502 4503 // Return only captures needed by the pseudo filter method (type and argument) 4504 return match.slice(0, 3); 4505 } 4506 }, 4507 filter: { 4508 TAG: function TAG(nodeNameSelector) { 4509 var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); 4510 return nodeNameSelector === "*" ? function () { 4511 return true; 4512 } : function (elem) { 4513 return nodeName(elem, expectedNodeName); 4514 }; 4515 }, 4516 CLASS: function CLASS(className) { 4517 var pattern = classCache[className + " "]; 4518 return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function (elem) { 4519 return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""); 4520 }); 4521 }, 4522 ATTR: function ATTR(name, operator, check) { 4523 return function (elem) { 4524 var result = find.attr(elem, name); 4525 if (result == null) { 4526 return operator === "!="; 4527 } 4528 if (!operator) { 4529 return true; 4530 } 4531 result += ""; 4532 if (operator === "=") { 4533 return result === check; 4534 } 4535 if (operator === "!=") { 4536 return result !== check; 4537 } 4538 if (operator === "^=") { 4539 return check && result.indexOf(check) === 0; 4540 } 4541 if (operator === "*=") { 4542 return check && result.indexOf(check) > -1; 4543 } 4544 if (operator === "$=") { 4545 return check && result.slice(-check.length) === check; 4546 } 4547 if (operator === "~=") { 4548 return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1; 4549 } 4550 if (operator === "|=") { 4551 return result === check || result.slice(0, check.length + 1) === check + "-"; 4552 } 4553 return false; 4554 }; 4555 }, 4556 CHILD: function CHILD(type, what, _argument, first, last) { 4557 var simple = type.slice(0, 3) !== "nth", 4558 forward = type.slice(-4) !== "last", 4559 ofType = what === "of-type"; 4560 return first === 1 && last === 0 ? 4561 // Shortcut for :nth-*(n) 4562 function (elem) { 4563 return !!elem.parentNode; 4564 } : function (elem, _context, xml) { 4565 var cache, 4566 outerCache, 4567 node, 4568 nodeIndex, 4569 start, 4570 dir = simple !== forward ? "nextSibling" : "previousSibling", 4571 parent = elem.parentNode, 4572 name = ofType && elem.nodeName.toLowerCase(), 4573 useCache = !xml && !ofType, 4574 diff = false; 4575 if (parent) { 4576 // :(first|last|only)-(child|of-type) 4577 if (simple) { 4578 while (dir) { 4579 node = elem; 4580 while (node = node[dir]) { 4581 if (ofType ? nodeName(node, name) : node.nodeType === 1) { 4582 return false; 4583 } 4584 } 4585 4586 // Reverse direction for :only-* (if we haven't yet done so) 4587 start = dir = type === "only" && !start && "nextSibling"; 4588 } 4589 return true; 4590 } 4591 start = [forward ? parent.firstChild : parent.lastChild]; 4592 4593 // non-xml :nth-child(...) stores cache data on `parent` 4594 if (forward && useCache) { 4595 // Seek `elem` from a previously-cached index 4596 outerCache = parent[expando] || (parent[expando] = {}); 4597 cache = outerCache[type] || []; 4598 nodeIndex = cache[0] === dirruns && cache[1]; 4599 diff = nodeIndex && cache[2]; 4600 node = nodeIndex && parent.childNodes[nodeIndex]; 4601 while (node = ++nodeIndex && node && node[dir] || ( 4602 // Fallback to seeking `elem` from the start 4603 diff = nodeIndex = 0) || start.pop()) { 4604 // When found, cache indexes on `parent` and break 4605 if (node.nodeType === 1 && ++diff && node === elem) { 4606 outerCache[type] = [dirruns, nodeIndex, diff]; 4607 break; 4608 } 4609 } 4610 } else { 4611 // Use previously-cached element index if available 4612 if (useCache) { 4613 outerCache = elem[expando] || (elem[expando] = {}); 4614 cache = outerCache[type] || []; 4615 nodeIndex = cache[0] === dirruns && cache[1]; 4616 diff = nodeIndex; 4617 } 4618 4619 // xml :nth-child(...) 4620 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 4621 if (diff === false) { 4622 // Use the same loop as above to seek `elem` from the start 4623 while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) { 4624 if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) { 4625 // Cache the index of each encountered element 4626 if (useCache) { 4627 outerCache = node[expando] || (node[expando] = {}); 4628 outerCache[type] = [dirruns, diff]; 4629 } 4630 if (node === elem) { 4631 break; 4632 } 4633 } 4634 } 4635 } 4636 } 4637 4638 // Incorporate the offset, then check against cycle size 4639 diff -= last; 4640 return diff === first || diff % first === 0 && diff / first >= 0; 4641 } 4642 }; 4643 }, 4644 PSEUDO: function PSEUDO(pseudo, argument) { 4645 // pseudo-class names are case-insensitive 4646 // https://www.w3.org/TR/selectors/#pseudo-classes 4647 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 4648 // Remember that setFilters inherits from pseudos 4649 var args, 4650 fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find.error("unsupported pseudo: " + pseudo); 4651 4652 // The user may use createPseudo to indicate that 4653 // arguments are needed to create the filter function 4654 // just as jQuery does 4655 if (fn[expando]) { 4656 return fn(argument); 4657 } 4658 4659 // But maintain support for old signatures 4660 if (fn.length > 1) { 4661 args = [pseudo, pseudo, "", argument]; 4662 return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) { 4663 var idx, 4664 matched = fn(seed, argument), 4665 i = matched.length; 4666 while (i--) { 4667 idx = indexOf.call(seed, matched[i]); 4668 seed[idx] = !(matches[idx] = matched[i]); 4669 } 4670 }) : function (elem) { 4671 return fn(elem, 0, args); 4672 }; 4673 } 4674 return fn; 4675 } 4676 }, 4677 pseudos: { 4678 // Potentially complex pseudos 4679 not: markFunction(function (selector) { 4680 // Trim the selector passed to compile 4681 // to avoid treating leading and trailing 4682 // spaces as combinators 4683 var input = [], 4684 results = [], 4685 matcher = compile(selector.replace(rtrimCSS, "$1")); 4686 return matcher[expando] ? markFunction(function (seed, matches, _context, xml) { 4687 var elem, 4688 unmatched = matcher(seed, null, xml, []), 4689 i = seed.length; 4690 4691 // Match elements unmatched by `matcher` 4692 while (i--) { 4693 if (elem = unmatched[i]) { 4694 seed[i] = !(matches[i] = elem); 4695 } 4696 } 4697 }) : function (elem, _context, xml) { 4698 input[0] = elem; 4699 matcher(input, null, xml, results); 4700 4701 // Don't keep the element 4702 // (see https://github.com/jquery/sizzle/issues/299) 4703 input[0] = null; 4704 return !results.pop(); 4705 }; 4706 }), 4707 has: markFunction(function (selector) { 4708 return function (elem) { 4709 return find(selector, elem).length > 0; 4710 }; 4711 }), 4712 contains: markFunction(function (text) { 4713 text = text.replace(runescape, funescape); 4714 return function (elem) { 4715 return (elem.textContent || _jQuery2.text(elem)).indexOf(text) > -1; 4716 }; 4717 }), 4718 // "Whether an element is represented by a :lang() selector 4719 // is based solely on the element's language value 4720 // being equal to the identifier C, 4721 // or beginning with the identifier C immediately followed by "-". 4722 // The matching of C against the element's language value is performed case-insensitively. 4723 // The identifier C does not have to be a valid language name." 4724 // https://www.w3.org/TR/selectors/#lang-pseudo 4725 lang: markFunction(function (lang) { 4726 // lang value must be a valid identifier 4727 if (!ridentifier.test(lang || "")) { 4728 find.error("unsupported lang: " + lang); 4729 } 4730 lang = lang.replace(runescape, funescape).toLowerCase(); 4731 return function (elem) { 4732 var elemLang; 4733 do { 4734 if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) { 4735 elemLang = elemLang.toLowerCase(); 4736 return elemLang === lang || elemLang.indexOf(lang + "-") === 0; 4737 } 4738 } while ((elem = elem.parentNode) && elem.nodeType === 1); 4739 return false; 4740 }; 4741 }), 4742 // Miscellaneous 4743 target: function target(elem) { 4744 var hash = window.location && window.location.hash; 4745 return hash && hash.slice(1) === elem.id; 4746 }, 4747 root: function root(elem) { 4748 return elem === documentElement; 4749 }, 4750 focus: function focus(elem) { 4751 return elem === safeActiveElement() && document.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex); 4752 }, 4753 // Boolean properties 4754 enabled: createDisabledPseudo(false), 4755 disabled: createDisabledPseudo(true), 4756 checked: function checked(elem) { 4757 // In CSS3, :checked should return both checked and selected elements 4758 // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 4759 return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected; 4760 }, 4761 selected: function selected(elem) { 4762 // Support: IE <=11+ 4763 // Accessing the selectedIndex property 4764 // forces the browser to treat the default option as 4765 // selected when in an optgroup. 4766 if (elem.parentNode) { 4767 // eslint-disable-next-line no-unused-expressions 4768 elem.parentNode.selectedIndex; 4769 } 4770 return elem.selected === true; 4771 }, 4772 // Contents 4773 empty: function empty(elem) { 4774 // https://www.w3.org/TR/selectors/#empty-pseudo 4775 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 4776 // but not by others (comment: 8; processing instruction: 7; etc.) 4777 // nodeType < 6 works because attributes (2) do not appear as children 4778 for (elem = elem.firstChild; elem; elem = elem.nextSibling) { 4779 if (elem.nodeType < 6) { 4780 return false; 4781 } 4782 } 4783 return true; 4784 }, 4785 parent: function parent(elem) { 4786 return !Expr.pseudos.empty(elem); 4787 }, 4788 // Element/input types 4789 header: function header(elem) { 4790 return rheader.test(elem.nodeName); 4791 }, 4792 input: function input(elem) { 4793 return rinputs.test(elem.nodeName); 4794 }, 4795 button: function button(elem) { 4796 return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button"); 4797 }, 4798 text: function text(elem) { 4799 var attr; 4800 return nodeName(elem, "input") && elem.type === "text" && ( 4801 // Support: IE <10 only 4802 // New HTML5 attribute values (e.g., "search") appear 4803 // with elem.type === "text" 4804 (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text"); 4805 }, 4806 // Position-in-collection 4807 first: createPositionalPseudo(function () { 4808 return [0]; 4809 }), 4810 last: createPositionalPseudo(function (_matchIndexes, length) { 4811 return [length - 1]; 4812 }), 4813 eq: createPositionalPseudo(function (_matchIndexes, length, argument) { 4814 return [argument < 0 ? argument + length : argument]; 4815 }), 4816 even: createPositionalPseudo(function (matchIndexes, length) { 4817 var i = 0; 4818 for (; i < length; i += 2) { 4819 matchIndexes.push(i); 4820 } 4821 return matchIndexes; 4822 }), 4823 odd: createPositionalPseudo(function (matchIndexes, length) { 4824 var i = 1; 4825 for (; i < length; i += 2) { 4826 matchIndexes.push(i); 4827 } 4828 return matchIndexes; 4829 }), 4830 lt: createPositionalPseudo(function (matchIndexes, length, argument) { 4831 var i; 4832 if (argument < 0) { 4833 i = argument + length; 4834 } else if (argument > length) { 4835 i = length; 4836 } else { 4837 i = argument; 4838 } 4839 for (; --i >= 0;) { 4840 matchIndexes.push(i); 4841 } 4842 return matchIndexes; 4843 }), 4844 gt: createPositionalPseudo(function (matchIndexes, length, argument) { 4845 var i = argument < 0 ? argument + length : argument; 4846 for (; ++i < length;) { 4847 matchIndexes.push(i); 4848 } 4849 return matchIndexes; 4850 }) 4851 } 4852 }; 4853 Expr.pseudos.nth = Expr.pseudos.eq; 4854 4855 // Add button/input type pseudos 4856 for (i in { 4857 radio: true, 4858 checkbox: true, 4859 file: true, 4860 password: true, 4861 image: true 4862 }) { 4863 Expr.pseudos[i] = createInputPseudo(i); 4864 } 4865 for (i in { 4866 submit: true, 4867 reset: true 4868 }) { 4869 Expr.pseudos[i] = createButtonPseudo(i); 4870 } 4871 4872 // Easy API for creating new setFilters 4873 function setFilters() {} 4874 setFilters.prototype = Expr.filters = Expr.pseudos; 4875 Expr.setFilters = new setFilters(); 4876 function tokenize(selector, parseOnly) { 4877 var matched, 4878 match, 4879 tokens, 4880 type, 4881 soFar, 4882 groups, 4883 preFilters, 4884 cached = tokenCache[selector + " "]; 4885 if (cached) { 4886 return parseOnly ? 0 : cached.slice(0); 4887 } 4888 soFar = selector; 4889 groups = []; 4890 preFilters = Expr.preFilter; 4891 while (soFar) { 4892 // Comma and first run 4893 if (!matched || (match = rcomma.exec(soFar))) { 4894 if (match) { 4895 // Don't consume trailing commas as valid 4896 soFar = soFar.slice(match[0].length) || soFar; 4897 } 4898 groups.push(tokens = []); 4899 } 4900 matched = false; 4901 4902 // Combinators 4903 if (match = rleadingCombinator.exec(soFar)) { 4904 matched = match.shift(); 4905 tokens.push({ 4906 value: matched, 4907 // Cast descendant combinators to space 4908 type: match[0].replace(rtrimCSS, " ") 4909 }); 4910 soFar = soFar.slice(matched.length); 4911 } 4912 4913 // Filters 4914 for (type in Expr.filter) { 4915 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) { 4916 matched = match.shift(); 4917 tokens.push({ 4918 value: matched, 4919 type: type, 4920 matches: match 4921 }); 4922 soFar = soFar.slice(matched.length); 4923 } 4924 } 4925 if (!matched) { 4926 break; 4927 } 4928 } 4929 4930 // Return the length of the invalid excess 4931 // if we're just parsing 4932 // Otherwise, throw an error or return tokens 4933 if (parseOnly) { 4934 return soFar.length; 4935 } 4936 return soFar ? find.error(selector) : 4937 // Cache the tokens 4938 tokenCache(selector, groups).slice(0); 4939 } 4940 function toSelector(tokens) { 4941 var i = 0, 4942 len = tokens.length, 4943 selector = ""; 4944 for (; i < len; i++) { 4945 selector += tokens[i].value; 4946 } 4947 return selector; 4948 } 4949 function addCombinator(matcher, combinator, base) { 4950 var dir = combinator.dir, 4951 skip = combinator.next, 4952 key = skip || dir, 4953 checkNonElements = base && key === "parentNode", 4954 doneName = done++; 4955 return combinator.first ? 4956 // Check against closest ancestor/preceding element 4957 function (elem, context, xml) { 4958 while (elem = elem[dir]) { 4959 if (elem.nodeType === 1 || checkNonElements) { 4960 return matcher(elem, context, xml); 4961 } 4962 } 4963 return false; 4964 } : 4965 // Check against all ancestor/preceding elements 4966 function (elem, context, xml) { 4967 var oldCache, 4968 outerCache, 4969 newCache = [dirruns, doneName]; 4970 4971 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 4972 if (xml) { 4973 while (elem = elem[dir]) { 4974 if (elem.nodeType === 1 || checkNonElements) { 4975 if (matcher(elem, context, xml)) { 4976 return true; 4977 } 4978 } 4979 } 4980 } else { 4981 while (elem = elem[dir]) { 4982 if (elem.nodeType === 1 || checkNonElements) { 4983 outerCache = elem[expando] || (elem[expando] = {}); 4984 if (skip && nodeName(elem, skip)) { 4985 elem = elem[dir] || elem; 4986 } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) { 4987 // Assign to newCache so results back-propagate to previous elements 4988 return newCache[2] = oldCache[2]; 4989 } else { 4990 // Reuse newcache so results back-propagate to previous elements 4991 outerCache[key] = newCache; 4992 4993 // A match means we're done; a fail means we have to keep checking 4994 if (newCache[2] = matcher(elem, context, xml)) { 4995 return true; 4996 } 4997 } 4998 } 4999 } 5000 } 5001 return false; 5002 }; 5003 } 5004 function elementMatcher(matchers) { 5005 return matchers.length > 1 ? function (elem, context, xml) { 5006 var i = matchers.length; 5007 while (i--) { 5008 if (!matchers[i](elem, context, xml)) { 5009 return false; 5010 } 5011 } 5012 return true; 5013 } : matchers[0]; 5014 } 5015 function multipleContexts(selector, contexts, results) { 5016 var i = 0, 5017 len = contexts.length; 5018 for (; i < len; i++) { 5019 find(selector, contexts[i], results); 5020 } 5021 return results; 5022 } 5023 function condense(unmatched, map, filter, context, xml) { 5024 var elem, 5025 newUnmatched = [], 5026 i = 0, 5027 len = unmatched.length, 5028 mapped = map != null; 5029 for (; i < len; i++) { 5030 if (elem = unmatched[i]) { 5031 if (!filter || filter(elem, context, xml)) { 5032 newUnmatched.push(elem); 5033 if (mapped) { 5034 map.push(i); 5035 } 5036 } 5037 } 5038 } 5039 return newUnmatched; 5040 } 5041 function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { 5042 if (postFilter && !postFilter[expando]) { 5043 postFilter = setMatcher(postFilter); 5044 } 5045 if (postFinder && !postFinder[expando]) { 5046 postFinder = setMatcher(postFinder, postSelector); 5047 } 5048 return markFunction(function (seed, results, context, xml) { 5049 var temp, 5050 i, 5051 elem, 5052 matcherOut, 5053 preMap = [], 5054 postMap = [], 5055 preexisting = results.length, 5056 // Get initial elements from seed or context 5057 elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []), 5058 // Prefilter to get matcher input, preserving a map for seed-results synchronization 5059 matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems; 5060 if (matcher) { 5061 // If we have a postFinder, or filtered seed, or non-seed postFilter 5062 // or preexisting results, 5063 matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ? 5064 // ...intermediate processing is necessary 5065 [] : 5066 // ...otherwise use results directly 5067 results; 5068 5069 // Find primary matches 5070 matcher(matcherIn, matcherOut, context, xml); 5071 } else { 5072 matcherOut = matcherIn; 5073 } 5074 5075 // Apply postFilter 5076 if (postFilter) { 5077 temp = condense(matcherOut, postMap); 5078 postFilter(temp, [], context, xml); 5079 5080 // Un-match failing elements by moving them back to matcherIn 5081 i = temp.length; 5082 while (i--) { 5083 if (elem = temp[i]) { 5084 matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem); 5085 } 5086 } 5087 } 5088 if (seed) { 5089 if (postFinder || preFilter) { 5090 if (postFinder) { 5091 // Get the final matcherOut by condensing this intermediate into postFinder contexts 5092 temp = []; 5093 i = matcherOut.length; 5094 while (i--) { 5095 if (elem = matcherOut[i]) { 5096 // Restore matcherIn since elem is not yet a final match 5097 temp.push(matcherIn[i] = elem); 5098 } 5099 } 5100 postFinder(null, matcherOut = [], temp, xml); 5101 } 5102 5103 // Move matched elements from seed to results to keep them synchronized 5104 i = matcherOut.length; 5105 while (i--) { 5106 if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) { 5107 seed[temp] = !(results[temp] = elem); 5108 } 5109 } 5110 } 5111 5112 // Add elements to results, through postFinder if defined 5113 } else { 5114 matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut); 5115 if (postFinder) { 5116 postFinder(null, results, matcherOut, xml); 5117 } else { 5118 push.apply(results, matcherOut); 5119 } 5120 } 5121 }); 5122 } 5123 function matcherFromTokens(tokens) { 5124 var checkContext, 5125 matcher, 5126 j, 5127 len = tokens.length, 5128 leadingRelative = Expr.relative[tokens[0].type], 5129 implicitRelative = leadingRelative || Expr.relative[" "], 5130 i = leadingRelative ? 1 : 0, 5131 // The foundational matcher ensures that elements are reachable from top-level context(s) 5132 matchContext = addCombinator(function (elem) { 5133 return elem === checkContext; 5134 }, implicitRelative, true), 5135 matchAnyContext = addCombinator(function (elem) { 5136 return indexOf.call(checkContext, elem) > -1; 5137 }, implicitRelative, true), 5138 matchers = [function (elem, context, xml) { 5139 // Support: IE 11+, Edge 17 - 18+ 5140 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5141 // two documents; shallow comparisons work. 5142 // eslint-disable-next-line eqeqeq 5143 var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); 5144 5145 // Avoid hanging onto element 5146 // (see https://github.com/jquery/sizzle/issues/299) 5147 checkContext = null; 5148 return ret; 5149 }]; 5150 for (; i < len; i++) { 5151 if (matcher = Expr.relative[tokens[i].type]) { 5152 matchers = [addCombinator(elementMatcher(matchers), matcher)]; 5153 } else { 5154 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); 5155 5156 // Return special upon seeing a positional matcher 5157 if (matcher[expando]) { 5158 // Find the next relative operator (if any) for proper handling 5159 j = ++i; 5160 for (; j < len; j++) { 5161 if (Expr.relative[tokens[j].type]) { 5162 break; 5163 } 5164 } 5165 return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector( 5166 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 5167 tokens.slice(0, i - 1).concat({ 5168 value: tokens[i - 2].type === " " ? "*" : "" 5169 })).replace(rtrimCSS, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens)); 5170 } 5171 matchers.push(matcher); 5172 } 5173 } 5174 return elementMatcher(matchers); 5175 } 5176 function matcherFromGroupMatchers(elementMatchers, setMatchers) { 5177 var bySet = setMatchers.length > 0, 5178 byElement = elementMatchers.length > 0, 5179 superMatcher = function superMatcher(seed, context, xml, results, outermost) { 5180 var elem, 5181 j, 5182 matcher, 5183 matchedCount = 0, 5184 i = "0", 5185 unmatched = seed && [], 5186 setMatched = [], 5187 contextBackup = outermostContext, 5188 // We must always have either seed elements or outermost context 5189 elems = seed || byElement && Expr.find.TAG("*", outermost), 5190 // Use integer dirruns iff this is the outermost matcher 5191 dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, 5192 len = elems.length; 5193 if (outermost) { 5194 // Support: IE 11+, Edge 17 - 18+ 5195 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5196 // two documents; shallow comparisons work. 5197 // eslint-disable-next-line eqeqeq 5198 outermostContext = context == document || context || outermost; 5199 } 5200 5201 // Add elements passing elementMatchers directly to results 5202 // Support: iOS <=7 - 9 only 5203 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching 5204 // elements by id. (see trac-14142) 5205 for (; i !== len && (elem = elems[i]) != null; i++) { 5206 if (byElement && elem) { 5207 j = 0; 5208 5209 // Support: IE 11+, Edge 17 - 18+ 5210 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5211 // two documents; shallow comparisons work. 5212 // eslint-disable-next-line eqeqeq 5213 if (!context && elem.ownerDocument != document) { 5214 setDocument(elem); 5215 xml = !documentIsHTML; 5216 } 5217 while (matcher = elementMatchers[j++]) { 5218 if (matcher(elem, context || document, xml)) { 5219 push.call(results, elem); 5220 break; 5221 } 5222 } 5223 if (outermost) { 5224 dirruns = dirrunsUnique; 5225 } 5226 } 5227 5228 // Track unmatched elements for set filters 5229 if (bySet) { 5230 // They will have gone through all possible matchers 5231 if (elem = !matcher && elem) { 5232 matchedCount--; 5233 } 5234 5235 // Lengthen the array for every element, matched or not 5236 if (seed) { 5237 unmatched.push(elem); 5238 } 5239 } 5240 } 5241 5242 // `i` is now the count of elements visited above, and adding it to `matchedCount` 5243 // makes the latter nonnegative. 5244 matchedCount += i; 5245 5246 // Apply set filters to unmatched elements 5247 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 5248 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 5249 // no element matchers and no seed. 5250 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 5251 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 5252 // numerically zero. 5253 if (bySet && i !== matchedCount) { 5254 j = 0; 5255 while (matcher = setMatchers[j++]) { 5256 matcher(unmatched, setMatched, context, xml); 5257 } 5258 if (seed) { 5259 // Reintegrate element matches to eliminate the need for sorting 5260 if (matchedCount > 0) { 5261 while (i--) { 5262 if (!(unmatched[i] || setMatched[i])) { 5263 setMatched[i] = pop.call(results); 5264 } 5265 } 5266 } 5267 5268 // Discard index placeholder values to get only actual matches 5269 setMatched = condense(setMatched); 5270 } 5271 5272 // Add matches to results 5273 push.apply(results, setMatched); 5274 5275 // Seedless set matches succeeding multiple successful matchers stipulate sorting 5276 if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) { 5277 _jQuery2.uniqueSort(results); 5278 } 5279 } 5280 5281 // Override manipulation of globals by nested matchers 5282 if (outermost) { 5283 dirruns = dirrunsUnique; 5284 outermostContext = contextBackup; 5285 } 5286 return unmatched; 5287 }; 5288 return bySet ? markFunction(superMatcher) : superMatcher; 5289 } 5290 function compile(selector, match /* Internal Use Only */) { 5291 var i, 5292 setMatchers = [], 5293 elementMatchers = [], 5294 cached = compilerCache[selector + " "]; 5295 if (!cached) { 5296 // Generate a function of recursive functions that can be used to check each element 5297 if (!match) { 5298 match = tokenize(selector); 5299 } 5300 i = match.length; 5301 while (i--) { 5302 cached = matcherFromTokens(match[i]); 5303 if (cached[expando]) { 5304 setMatchers.push(cached); 5305 } else { 5306 elementMatchers.push(cached); 5307 } 5308 } 5309 5310 // Cache the compiled function 5311 cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); 5312 5313 // Save selector and tokenization 5314 cached.selector = selector; 5315 } 5316 return cached; 5317 } 5318 5319 /** 5320 * A low-level selection function that works with jQuery's compiled 5321 * selector functions 5322 * @param {String|Function} selector A selector or a pre-compiled 5323 * selector function built with jQuery selector compile 5324 * @param {Element} context 5325 * @param {Array} [results] 5326 * @param {Array} [seed] A set of elements to match against 5327 */ 5328 function select(selector, context, results, seed) { 5329 var i, 5330 tokens, 5331 token, 5332 type, 5333 find, 5334 compiled = typeof selector === "function" && selector, 5335 match = !seed && tokenize(selector = compiled.selector || selector); 5336 results = results || []; 5337 5338 // Try to minimize operations if there is only one selector in the list and no seed 5339 // (the latter of which guarantees us context) 5340 if (match.length === 1) { 5341 // Reduce context if the leading compound selector is an ID 5342 tokens = match[0] = match[0].slice(0); 5343 if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) { 5344 context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0]; 5345 if (!context) { 5346 return results; 5347 5348 // Precompiled matchers will still verify ancestry, so step up a level 5349 } else if (compiled) { 5350 context = context.parentNode; 5351 } 5352 selector = selector.slice(tokens.shift().value.length); 5353 } 5354 5355 // Fetch a seed set for right-to-left matching 5356 i = matchExpr.needsContext.test(selector) ? 0 : tokens.length; 5357 while (i--) { 5358 token = tokens[i]; 5359 5360 // Abort if we hit a combinator 5361 if (Expr.relative[type = token.type]) { 5362 break; 5363 } 5364 if (find = Expr.find[type]) { 5365 // Search, expanding context for leading sibling combinators 5366 if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) { 5367 // If seed is empty or no tokens remain, we can return early 5368 tokens.splice(i, 1); 5369 selector = seed.length && toSelector(tokens); 5370 if (!selector) { 5371 push.apply(results, seed); 5372 return results; 5373 } 5374 break; 5375 } 5376 } 5377 } 5378 } 5379 5380 // Compile and execute a filtering function if one is not provided 5381 // Provide `match` to avoid retokenization if we modified the selector above 5382 (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context); 5383 return results; 5384 } 5385 5386 // One-time assignments 5387 5388 // Support: Android <=4.0 - 4.1+ 5389 // Sort stability 5390 support.sortStable = expando.split("").sort(sortOrder).join("") === expando; 5391 5392 // Initialize against the default document 5393 setDocument(); 5394 5395 // Support: Android <=4.0 - 4.1+ 5396 // Detached nodes confoundingly follow *each other* 5397 support.sortDetached = assert(function (el) { 5398 // Should return 1, but returns 4 (following) 5399 return el.compareDocumentPosition(document.createElement("fieldset")) & 1; 5400 }); 5401 _jQuery2.find = find; 5402 5403 // Deprecated 5404 _jQuery2.expr[":"] = _jQuery2.expr.pseudos; 5405 _jQuery2.unique = _jQuery2.uniqueSort; 5406 5407 // These have always been private, but they used to be documented as part of 5408 // Sizzle so let's maintain them for now for backwards compatibility purposes. 5409 find.compile = compile; 5410 find.select = select; 5411 find.setDocument = setDocument; 5412 find.tokenize = tokenize; 5413 find.escape = _jQuery2.escapeSelector; 5414 find.getText = _jQuery2.text; 5415 find.isXML = _jQuery2.isXMLDoc; 5416 find.selectors = _jQuery2.expr; 5417 find.support = _jQuery2.support; 5418 find.uniqueSort = _jQuery2.uniqueSort; 5419 5420 /* eslint-enable */ 5421 })(); 5422 var dir = function dir(elem, _dir, until) { 5423 var matched = [], 5424 truncate = until !== undefined; 5425 while ((elem = elem[_dir]) && elem.nodeType !== 9) { 5426 if (elem.nodeType === 1) { 5427 if (truncate && _jQuery2(elem).is(until)) { 5428 break; 5429 } 5430 matched.push(elem); 5431 } 5432 } 5433 return matched; 5434 }; 5435 var _siblings = function siblings(n, elem) { 5436 var matched = []; 5437 for (; n; n = n.nextSibling) { 5438 if (n.nodeType === 1 && n !== elem) { 5439 matched.push(n); 5440 } 5441 } 5442 return matched; 5443 }; 5444 var rneedsContext = _jQuery2.expr.match.needsContext; 5445 var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; 5446 5447 // Implement the identical functionality for filter and not 5448 function winnow(elements, qualifier, not) { 5449 if (isFunction(qualifier)) { 5450 return _jQuery2.grep(elements, function (elem, i) { 5451 return !!qualifier.call(elem, i, elem) !== not; 5452 }); 5453 } 5454 5455 // Single element 5456 if (qualifier.nodeType) { 5457 return _jQuery2.grep(elements, function (elem) { 5458 return elem === qualifier !== not; 5459 }); 5460 } 5461 5462 // Arraylike of elements (jQuery, arguments, Array) 5463 if (typeof qualifier !== "string") { 5464 return _jQuery2.grep(elements, function (elem) { 5465 return indexOf.call(qualifier, elem) > -1 !== not; 5466 }); 5467 } 5468 5469 // Filtered directly for both simple and complex selectors 5470 return _jQuery2.filter(qualifier, elements, not); 5471 } 5472 _jQuery2.filter = function (expr, elems, not) { 5473 var elem = elems[0]; 5474 if (not) { 5475 expr = ":not(" + expr + ")"; 5476 } 5477 if (elems.length === 1 && elem.nodeType === 1) { 5478 return _jQuery2.find.matchesSelector(elem, expr) ? [elem] : []; 5479 } 5480 return _jQuery2.find.matches(expr, _jQuery2.grep(elems, function (elem) { 5481 return elem.nodeType === 1; 5482 })); 5483 }; 5484 _jQuery2.fn.extend({ 5485 find: function find(selector) { 5486 var i, 5487 ret, 5488 len = this.length, 5489 self = this; 5490 if (typeof selector !== "string") { 5491 return this.pushStack(_jQuery2(selector).filter(function () { 5492 for (i = 0; i < len; i++) { 5493 if (_jQuery2.contains(self[i], this)) { 5494 return true; 5495 } 5496 } 5497 })); 5498 } 5499 ret = this.pushStack([]); 5500 for (i = 0; i < len; i++) { 5501 _jQuery2.find(selector, self[i], ret); 5502 } 5503 return len > 1 ? _jQuery2.uniqueSort(ret) : ret; 5504 }, 5505 filter: function filter(selector) { 5506 return this.pushStack(winnow(this, selector || [], false)); 5507 }, 5508 not: function not(selector) { 5509 return this.pushStack(winnow(this, selector || [], true)); 5510 }, 5511 is: function is(selector) { 5512 return !!winnow(this, 5513 // If this is a positional/relative selector, check membership in the returned set 5514 // so $("p:first").is("p:last") won't return true for a doc with two "p". 5515 typeof selector === "string" && rneedsContext.test(selector) ? _jQuery2(selector) : selector || [], false).length; 5516 } 5517 }); 5518 5519 // Initialize a jQuery object 5520 5521 // A central reference to the root jQuery(document) 5522 var rootjQuery, 5523 // A simple way to check for HTML strings 5524 // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521) 5525 // Strict HTML recognition (trac-11290: must start with <) 5526 // Shortcut simple #id case for speed 5527 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 5528 init = _jQuery2.fn.init = function (selector, context, root) { 5529 var match, elem; 5530 5531 // HANDLE: $(""), $(null), $(undefined), $(false) 5532 if (!selector) { 5533 return this; 5534 } 5535 5536 // Method init() accepts an alternate rootjQuery 5537 // so migrate can support jQuery.sub (gh-2101) 5538 root = root || rootjQuery; 5539 5540 // Handle HTML strings 5541 if (typeof selector === "string") { 5542 if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) { 5543 // Assume that strings that start and end with <> are HTML and skip the regex check 5544 match = [null, selector, null]; 5545 } else { 5546 match = rquickExpr.exec(selector); 5547 } 5548 5549 // Match html or make sure no context is specified for #id 5550 if (match && (match[1] || !context)) { 5551 // HANDLE: $(html) -> $(array) 5552 if (match[1]) { 5553 context = context instanceof _jQuery2 ? context[0] : context; 5554 5555 // Option to run scripts is true for back-compat 5556 // Intentionally let the error be thrown if parseHTML is not present 5557 _jQuery2.merge(this, _jQuery2.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true)); 5558 5559 // HANDLE: $(html, props) 5560 if (rsingleTag.test(match[1]) && _jQuery2.isPlainObject(context)) { 5561 for (match in context) { 5562 // Properties of context are called as methods if possible 5563 if (isFunction(this[match])) { 5564 this[match](context[match]); 5565 5566 // ...and otherwise set as attributes 5567 } else { 5568 this.attr(match, context[match]); 5569 } 5570 } 5571 } 5572 return this; 5573 5574 // HANDLE: $(#id) 5575 } else { 5576 elem = document.getElementById(match[2]); 5577 if (elem) { 5578 // Inject the element directly into the jQuery object 5579 this[0] = elem; 5580 this.length = 1; 5581 } 5582 return this; 5583 } 5584 5585 // HANDLE: $(expr, $(...)) 5586 } else if (!context || context.jquery) { 5587 return (context || root).find(selector); 5588 5589 // HANDLE: $(expr, context) 5590 // (which is just equivalent to: $(context).find(expr) 5591 } else { 5592 return this.constructor(context).find(selector); 5593 } 5594 5595 // HANDLE: $(DOMElement) 5596 } else if (selector.nodeType) { 5597 this[0] = selector; 5598 this.length = 1; 5599 return this; 5600 5601 // HANDLE: $(function) 5602 // Shortcut for document ready 5603 } else if (isFunction(selector)) { 5604 return root.ready !== undefined ? root.ready(selector) : 5605 // Execute immediately if ready is not present 5606 selector(_jQuery2); 5607 } 5608 return _jQuery2.makeArray(selector, this); 5609 }; 5610 5611 // Give the init function the jQuery prototype for later instantiation 5612 init.prototype = _jQuery2.fn; 5613 5614 // Initialize central reference 5615 rootjQuery = _jQuery2(document); 5616 var rparentsprev = /^(?:parents|prev(?:Until|All))/, 5617 // Methods guaranteed to produce a unique set when starting from a unique set 5618 guaranteedUnique = { 5619 children: true, 5620 contents: true, 5621 next: true, 5622 prev: true 5623 }; 5624 _jQuery2.fn.extend({ 5625 has: function has(target) { 5626 var targets = _jQuery2(target, this), 5627 l = targets.length; 5628 return this.filter(function () { 5629 var i = 0; 5630 for (; i < l; i++) { 5631 if (_jQuery2.contains(this, targets[i])) { 5632 return true; 5633 } 5634 } 5635 }); 5636 }, 5637 closest: function closest(selectors, context) { 5638 var cur, 5639 i = 0, 5640 l = this.length, 5641 matched = [], 5642 targets = typeof selectors !== "string" && _jQuery2(selectors); 5643 5644 // Positional selectors never match, since there's no _selection_ context 5645 if (!rneedsContext.test(selectors)) { 5646 for (; i < l; i++) { 5647 for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) { 5648 // Always skip document fragments 5649 if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : 5650 // Don't pass non-elements to jQuery#find 5651 cur.nodeType === 1 && _jQuery2.find.matchesSelector(cur, selectors))) { 5652 matched.push(cur); 5653 break; 5654 } 5655 } 5656 } 5657 } 5658 return this.pushStack(matched.length > 1 ? _jQuery2.uniqueSort(matched) : matched); 5659 }, 5660 // Determine the position of an element within the set 5661 index: function index(elem) { 5662 // No argument, return index in parent 5663 if (!elem) { 5664 return this[0] && this[0].parentNode ? this.first().prevAll().length : -1; 5665 } 5666 5667 // Index in selector 5668 if (typeof elem === "string") { 5669 return indexOf.call(_jQuery2(elem), this[0]); 5670 } 5671 5672 // Locate the position of the desired element 5673 return indexOf.call(this, 5674 // If it receives a jQuery object, the first element is used 5675 elem.jquery ? elem[0] : elem); 5676 }, 5677 add: function add(selector, context) { 5678 return this.pushStack(_jQuery2.uniqueSort(_jQuery2.merge(this.get(), _jQuery2(selector, context)))); 5679 }, 5680 addBack: function addBack(selector) { 5681 return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector)); 5682 } 5683 }); 5684 function sibling(cur, dir) { 5685 while ((cur = cur[dir]) && cur.nodeType !== 1) {} 5686 return cur; 5687 } 5688 _jQuery2.each({ 5689 parent: function parent(elem) { 5690 var parent = elem.parentNode; 5691 return parent && parent.nodeType !== 11 ? parent : null; 5692 }, 5693 parents: function parents(elem) { 5694 return dir(elem, "parentNode"); 5695 }, 5696 parentsUntil: function parentsUntil(elem, _i, until) { 5697 return dir(elem, "parentNode", until); 5698 }, 5699 next: function next(elem) { 5700 return sibling(elem, "nextSibling"); 5701 }, 5702 prev: function prev(elem) { 5703 return sibling(elem, "previousSibling"); 5704 }, 5705 nextAll: function nextAll(elem) { 5706 return dir(elem, "nextSibling"); 5707 }, 5708 prevAll: function prevAll(elem) { 5709 return dir(elem, "previousSibling"); 5710 }, 5711 nextUntil: function nextUntil(elem, _i, until) { 5712 return dir(elem, "nextSibling", until); 5713 }, 5714 prevUntil: function prevUntil(elem, _i, until) { 5715 return dir(elem, "previousSibling", until); 5716 }, 5717 siblings: function siblings(elem) { 5718 return _siblings((elem.parentNode || {}).firstChild, elem); 5719 }, 5720 children: function children(elem) { 5721 return _siblings(elem.firstChild); 5722 }, 5723 contents: function contents(elem) { 5724 if (elem.contentDocument != null && 5725 // Support: IE 11+ 5726 // <object> elements with no `data` attribute has an object 5727 // `contentDocument` with a `null` prototype. 5728 getProto(elem.contentDocument)) { 5729 return elem.contentDocument; 5730 } 5731 5732 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 5733 // Treat the template element as a regular one in browsers that 5734 // don't support it. 5735 if (nodeName(elem, "template")) { 5736 elem = elem.content || elem; 5737 } 5738 return _jQuery2.merge([], elem.childNodes); 5739 } 5740 }, function (name, fn) { 5741 _jQuery2.fn[name] = function (until, selector) { 5742 var matched = _jQuery2.map(this, fn, until); 5743 if (name.slice(-5) !== "Until") { 5744 selector = until; 5745 } 5746 if (selector && typeof selector === "string") { 5747 matched = _jQuery2.filter(selector, matched); 5748 } 5749 if (this.length > 1) { 5750 // Remove duplicates 5751 if (!guaranteedUnique[name]) { 5752 _jQuery2.uniqueSort(matched); 5753 } 5754 5755 // Reverse order for parents* and prev-derivatives 5756 if (rparentsprev.test(name)) { 5757 matched.reverse(); 5758 } 5759 } 5760 return this.pushStack(matched); 5761 }; 5762 }); 5763 var rnothtmlwhite = /[^\x20\t\r\n\f]+/g; 5764 5765 // Convert String-formatted options into Object-formatted ones 5766 function createOptions(options) { 5767 var object = {}; 5768 _jQuery2.each(options.match(rnothtmlwhite) || [], function (_, flag) { 5769 object[flag] = true; 5770 }); 5771 return object; 5772 } 5773 5774 /* 5775 * Create a callback list using the following parameters: 5776 * 5777 * options: an optional list of space-separated options that will change how 5778 * the callback list behaves or a more traditional option object 5779 * 5780 * By default a callback list will act like an event callback list and can be 5781 * "fired" multiple times. 5782 * 5783 * Possible options: 5784 * 5785 * once: will ensure the callback list can only be fired once (like a Deferred) 5786 * 5787 * memory: will keep track of previous values and will call any callback added 5788 * after the list has been fired right away with the latest "memorized" 5789 * values (like a Deferred) 5790 * 5791 * unique: will ensure a callback can only be added once (no duplicate in the list) 5792 * 5793 * stopOnFalse: interrupt callings when a callback returns false 5794 * 5795 */ 5796 _jQuery2.Callbacks = function (options) { 5797 // Convert options from String-formatted to Object-formatted if needed 5798 // (we check in cache first) 5799 options = typeof options === "string" ? createOptions(options) : _jQuery2.extend({}, options); 5800 var 5801 // Flag to know if list is currently firing 5802 firing, 5803 // Last fire value for non-forgettable lists 5804 memory, 5805 // Flag to know if list was already fired 5806 _fired, 5807 // Flag to prevent firing 5808 _locked, 5809 // Actual callback list 5810 list = [], 5811 // Queue of execution data for repeatable lists 5812 queue = [], 5813 // Index of currently firing callback (modified by add/remove as needed) 5814 firingIndex = -1, 5815 // Fire callbacks 5816 fire = function fire() { 5817 // Enforce single-firing 5818 _locked = _locked || options.once; 5819 5820 // Execute callbacks for all pending executions, 5821 // respecting firingIndex overrides and runtime changes 5822 _fired = firing = true; 5823 for (; queue.length; firingIndex = -1) { 5824 memory = queue.shift(); 5825 while (++firingIndex < list.length) { 5826 // Run callback and check for early termination 5827 if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) { 5828 // Jump to end and forget the data so .add doesn't re-fire 5829 firingIndex = list.length; 5830 memory = false; 5831 } 5832 } 5833 } 5834 5835 // Forget the data if we're done with it 5836 if (!options.memory) { 5837 memory = false; 5838 } 5839 firing = false; 5840 5841 // Clean up if we're done firing for good 5842 if (_locked) { 5843 // Keep an empty list if we have data for future add calls 5844 if (memory) { 5845 list = []; 5846 5847 // Otherwise, this object is spent 5848 } else { 5849 list = ""; 5850 } 5851 } 5852 }, 5853 // Actual Callbacks object 5854 self = { 5855 // Add a callback or a collection of callbacks to the list 5856 add: function add() { 5857 if (list) { 5858 // If we have memory from a past run, we should fire after adding 5859 if (memory && !firing) { 5860 firingIndex = list.length - 1; 5861 queue.push(memory); 5862 } 5863 (function add(args) { 5864 _jQuery2.each(args, function (_, arg) { 5865 if (isFunction(arg)) { 5866 if (!options.unique || !self.has(arg)) { 5867 list.push(arg); 5868 } 5869 } else if (arg && arg.length && toType(arg) !== "string") { 5870 // Inspect recursively 5871 add(arg); 5872 } 5873 }); 5874 })(arguments); 5875 if (memory && !firing) { 5876 fire(); 5877 } 5878 } 5879 return this; 5880 }, 5881 // Remove a callback from the list 5882 remove: function remove() { 5883 _jQuery2.each(arguments, function (_, arg) { 5884 var index; 5885 while ((index = _jQuery2.inArray(arg, list, index)) > -1) { 5886 list.splice(index, 1); 5887 5888 // Handle firing indexes 5889 if (index <= firingIndex) { 5890 firingIndex--; 5891 } 5892 } 5893 }); 5894 return this; 5895 }, 5896 // Check if a given callback is in the list. 5897 // If no argument is given, return whether or not list has callbacks attached. 5898 has: function has(fn) { 5899 return fn ? _jQuery2.inArray(fn, list) > -1 : list.length > 0; 5900 }, 5901 // Remove all callbacks from the list 5902 empty: function empty() { 5903 if (list) { 5904 list = []; 5905 } 5906 return this; 5907 }, 5908 // Disable .fire and .add 5909 // Abort any current/pending executions 5910 // Clear all callbacks and values 5911 disable: function disable() { 5912 _locked = queue = []; 5913 list = memory = ""; 5914 return this; 5915 }, 5916 disabled: function disabled() { 5917 return !list; 5918 }, 5919 // Disable .fire 5920 // Also disable .add unless we have memory (since it would have no effect) 5921 // Abort any pending executions 5922 lock: function lock() { 5923 _locked = queue = []; 5924 if (!memory && !firing) { 5925 list = memory = ""; 5926 } 5927 return this; 5928 }, 5929 locked: function locked() { 5930 return !!_locked; 5931 }, 5932 // Call all callbacks with the given context and arguments 5933 fireWith: function fireWith(context, args) { 5934 if (!_locked) { 5935 args = args || []; 5936 args = [context, args.slice ? args.slice() : args]; 5937 queue.push(args); 5938 if (!firing) { 5939 fire(); 5940 } 5941 } 5942 return this; 5943 }, 5944 // Call all the callbacks with the given arguments 5945 fire: function fire() { 5946 self.fireWith(this, arguments); 5947 return this; 5948 }, 5949 // To know if the callbacks have already been called at least once 5950 fired: function fired() { 5951 return !!_fired; 5952 } 5953 }; 5954 return self; 5955 }; 5956 function Identity(v) { 5957 return v; 5958 } 5959 function Thrower(ex) { 5960 throw ex; 5961 } 5962 function adoptValue(value, resolve, reject, noValue) { 5963 var method; 5964 try { 5965 // Check for promise aspect first to privilege synchronous behavior 5966 if (value && isFunction(method = value.promise)) { 5967 method.call(value).done(resolve).fail(reject); 5968 5969 // Other thenables 5970 } else if (value && isFunction(method = value.then)) { 5971 method.call(value, resolve, reject); 5972 5973 // Other non-thenables 5974 } else { 5975 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 5976 // * false: [ value ].slice( 0 ) => resolve( value ) 5977 // * true: [ value ].slice( 1 ) => resolve() 5978 resolve.apply(undefined, [value].slice(noValue)); 5979 } 5980 5981 // For Promises/A+, convert exceptions into rejections 5982 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 5983 // Deferred#then to conditionally suppress rejection. 5984 } catch (value) { 5985 // Support: Android 4.0 only 5986 // Strict mode functions invoked without .call/.apply get global-object context 5987 reject.apply(undefined, [value]); 5988 } 5989 } 5990 _jQuery2.extend({ 5991 Deferred: function Deferred(func) { 5992 var tuples = [ 5993 // action, add listener, callbacks, 5994 // ... .then handlers, argument index, [final state] 5995 ["notify", "progress", _jQuery2.Callbacks("memory"), _jQuery2.Callbacks("memory"), 2], ["resolve", "done", _jQuery2.Callbacks("once memory"), _jQuery2.Callbacks("once memory"), 0, "resolved"], ["reject", "fail", _jQuery2.Callbacks("once memory"), _jQuery2.Callbacks("once memory"), 1, "rejected"]], 5996 _state = "pending", 5997 _promise = { 5998 state: function state() { 5999 return _state; 6000 }, 6001 always: function always() { 6002 deferred.done(arguments).fail(arguments); 6003 return this; 6004 }, 6005 "catch": function _catch(fn) { 6006 return _promise.then(null, fn); 6007 }, 6008 // Keep pipe for back-compat 6009 pipe: function pipe(/* fnDone, fnFail, fnProgress */ 6010 ) { 6011 var fns = arguments; 6012 return _jQuery2.Deferred(function (newDefer) { 6013 _jQuery2.each(tuples, function (_i, tuple) { 6014 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 6015 var fn = isFunction(fns[tuple[4]]) && fns[tuple[4]]; 6016 6017 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 6018 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 6019 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 6020 deferred[tuple[1]](function () { 6021 var returned = fn && fn.apply(this, arguments); 6022 if (returned && isFunction(returned.promise)) { 6023 returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject); 6024 } else { 6025 newDefer[tuple[0] + "With"](this, fn ? [returned] : arguments); 6026 } 6027 }); 6028 }); 6029 fns = null; 6030 }).promise(); 6031 }, 6032 then: function then(onFulfilled, onRejected, onProgress) { 6033 var maxDepth = 0; 6034 function resolve(depth, deferred, handler, special) { 6035 return function () { 6036 var that = this, 6037 args = arguments, 6038 mightThrow = function mightThrow() { 6039 var returned, then; 6040 6041 // Support: Promises/A+ section 2.3.3.3.3 6042 // https://promisesaplus.com/#point-59 6043 // Ignore double-resolution attempts 6044 if (depth < maxDepth) { 6045 return; 6046 } 6047 returned = handler.apply(that, args); 6048 6049 // Support: Promises/A+ section 2.3.1 6050 // https://promisesaplus.com/#point-48 6051 if (returned === deferred.promise()) { 6052 throw new TypeError("Thenable self-resolution"); 6053 } 6054 6055 // Support: Promises/A+ sections 2.3.3.1, 3.5 6056 // https://promisesaplus.com/#point-54 6057 // https://promisesaplus.com/#point-75 6058 // Retrieve `then` only once 6059 then = returned && ( 6060 // Support: Promises/A+ section 2.3.4 6061 // https://promisesaplus.com/#point-64 6062 // Only check objects and functions for thenability 6063 _typeof(returned) === "object" || typeof returned === "function") && returned.then; 6064 6065 // Handle a returned thenable 6066 if (isFunction(then)) { 6067 // Special processors (notify) just wait for resolution 6068 if (special) { 6069 then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special)); 6070 6071 // Normal processors (resolve) also hook into progress 6072 } else { 6073 // ...and disregard older resolution values 6074 maxDepth++; 6075 then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special), resolve(maxDepth, deferred, Identity, deferred.notifyWith)); 6076 } 6077 6078 // Handle all other returned values 6079 } else { 6080 // Only substitute handlers pass on context 6081 // and multiple values (non-spec behavior) 6082 if (handler !== Identity) { 6083 that = undefined; 6084 args = [returned]; 6085 } 6086 6087 // Process the value(s) 6088 // Default process is resolve 6089 (special || deferred.resolveWith)(that, args); 6090 } 6091 }, 6092 // Only normal processors (resolve) catch and reject exceptions 6093 process = special ? mightThrow : function () { 6094 try { 6095 mightThrow(); 6096 } catch (e) { 6097 if (_jQuery2.Deferred.exceptionHook) { 6098 _jQuery2.Deferred.exceptionHook(e, process.error); 6099 } 6100 6101 // Support: Promises/A+ section 2.3.3.3.4.1 6102 // https://promisesaplus.com/#point-61 6103 // Ignore post-resolution exceptions 6104 if (depth + 1 >= maxDepth) { 6105 // Only substitute handlers pass on context 6106 // and multiple values (non-spec behavior) 6107 if (handler !== Thrower) { 6108 that = undefined; 6109 args = [e]; 6110 } 6111 deferred.rejectWith(that, args); 6112 } 6113 } 6114 }; 6115 6116 // Support: Promises/A+ section 2.3.3.3.1 6117 // https://promisesaplus.com/#point-57 6118 // Re-resolve promises immediately to dodge false rejection from 6119 // subsequent errors 6120 if (depth) { 6121 process(); 6122 } else { 6123 // Call an optional hook to record the error, in case of exception 6124 // since it's otherwise lost when execution goes async 6125 if (_jQuery2.Deferred.getErrorHook) { 6126 process.error = _jQuery2.Deferred.getErrorHook(); 6127 6128 // The deprecated alias of the above. While the name suggests 6129 // returning the stack, not an error instance, jQuery just passes 6130 // it directly to `console.warn` so both will work; an instance 6131 // just better cooperates with source maps. 6132 } else if (_jQuery2.Deferred.getStackHook) { 6133 process.error = _jQuery2.Deferred.getStackHook(); 6134 } 6135 window.setTimeout(process); 6136 } 6137 }; 6138 } 6139 return _jQuery2.Deferred(function (newDefer) { 6140 // progress_handlers.add( ... ) 6141 tuples[0][3].add(resolve(0, newDefer, isFunction(onProgress) ? onProgress : Identity, newDefer.notifyWith)); 6142 6143 // fulfilled_handlers.add( ... ) 6144 tuples[1][3].add(resolve(0, newDefer, isFunction(onFulfilled) ? onFulfilled : Identity)); 6145 6146 // rejected_handlers.add( ... ) 6147 tuples[2][3].add(resolve(0, newDefer, isFunction(onRejected) ? onRejected : Thrower)); 6148 }).promise(); 6149 }, 6150 // Get a promise for this deferred 6151 // If obj is provided, the promise aspect is added to the object 6152 promise: function promise(obj) { 6153 return obj != null ? _jQuery2.extend(obj, _promise) : _promise; 6154 } 6155 }, 6156 deferred = {}; 6157 6158 // Add list-specific methods 6159 _jQuery2.each(tuples, function (i, tuple) { 6160 var list = tuple[2], 6161 stateString = tuple[5]; 6162 6163 // promise.progress = list.add 6164 // promise.done = list.add 6165 // promise.fail = list.add 6166 _promise[tuple[1]] = list.add; 6167 6168 // Handle state 6169 if (stateString) { 6170 list.add(function () { 6171 // state = "resolved" (i.e., fulfilled) 6172 // state = "rejected" 6173 _state = stateString; 6174 }, 6175 // rejected_callbacks.disable 6176 // fulfilled_callbacks.disable 6177 tuples[3 - i][2].disable, 6178 // rejected_handlers.disable 6179 // fulfilled_handlers.disable 6180 tuples[3 - i][3].disable, 6181 // progress_callbacks.lock 6182 tuples[0][2].lock, 6183 // progress_handlers.lock 6184 tuples[0][3].lock); 6185 } 6186 6187 // progress_handlers.fire 6188 // fulfilled_handlers.fire 6189 // rejected_handlers.fire 6190 list.add(tuple[3].fire); 6191 6192 // deferred.notify = function() { deferred.notifyWith(...) } 6193 // deferred.resolve = function() { deferred.resolveWith(...) } 6194 // deferred.reject = function() { deferred.rejectWith(...) } 6195 deferred[tuple[0]] = function () { 6196 deferred[tuple[0] + "With"](this === deferred ? undefined : this, arguments); 6197 return this; 6198 }; 6199 6200 // deferred.notifyWith = list.fireWith 6201 // deferred.resolveWith = list.fireWith 6202 // deferred.rejectWith = list.fireWith 6203 deferred[tuple[0] + "With"] = list.fireWith; 6204 }); 6205 6206 // Make the deferred a promise 6207 _promise.promise(deferred); 6208 6209 // Call given func if any 6210 if (func) { 6211 func.call(deferred, deferred); 6212 } 6213 6214 // All done! 6215 return deferred; 6216 }, 6217 // Deferred helper 6218 when: function when(singleValue) { 6219 var 6220 // count of uncompleted subordinates 6221 remaining = arguments.length, 6222 // count of unprocessed arguments 6223 i = remaining, 6224 // subordinate fulfillment data 6225 resolveContexts = Array(i), 6226 resolveValues = _slice.call(arguments), 6227 // the primary Deferred 6228 primary = _jQuery2.Deferred(), 6229 // subordinate callback factory 6230 updateFunc = function updateFunc(i) { 6231 return function (value) { 6232 resolveContexts[i] = this; 6233 resolveValues[i] = arguments.length > 1 ? _slice.call(arguments) : value; 6234 if (! --remaining) { 6235 primary.resolveWith(resolveContexts, resolveValues); 6236 } 6237 }; 6238 }; 6239 6240 // Single- and empty arguments are adopted like Promise.resolve 6241 if (remaining <= 1) { 6242 adoptValue(singleValue, primary.done(updateFunc(i)).resolve, primary.reject, !remaining); 6243 6244 // Use .then() to unwrap secondary thenables (cf. gh-3000) 6245 if (primary.state() === "pending" || isFunction(resolveValues[i] && resolveValues[i].then)) { 6246 return primary.then(); 6247 } 6248 } 6249 6250 // Multiple arguments are aggregated like Promise.all array elements 6251 while (i--) { 6252 adoptValue(resolveValues[i], updateFunc(i), primary.reject); 6253 } 6254 return primary.promise(); 6255 } 6256 }); 6257 6258 // These usually indicate a programmer mistake during development, 6259 // warn about them ASAP rather than swallowing them by default. 6260 var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 6261 6262 // If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error 6263 // captured before the async barrier to get the original error cause 6264 // which may otherwise be hidden. 6265 _jQuery2.Deferred.exceptionHook = function (error, asyncError) { 6266 // Support: IE 8 - 9 only 6267 // Console exists when dev tools are open, which can happen at any time 6268 if (window.console && window.console.warn && error && rerrorNames.test(error.name)) { 6269 window.console.warn("jQuery.Deferred exception: " + error.message, error.stack, asyncError); 6270 } 6271 }; 6272 _jQuery2.readyException = function (error) { 6273 window.setTimeout(function () { 6274 throw error; 6275 }); 6276 }; 6277 6278 // The deferred used on DOM ready 6279 var readyList = _jQuery2.Deferred(); 6280 _jQuery2.fn.ready = function (fn) { 6281 readyList.then(fn) 6282 6283 // Wrap jQuery.readyException in a function so that the lookup 6284 // happens at the time of error handling instead of callback 6285 // registration. 6286 ["catch"](function (error) { 6287 _jQuery2.readyException(error); 6288 }); 6289 return this; 6290 }; 6291 _jQuery2.extend({ 6292 // Is the DOM ready to be used? Set to true once it occurs. 6293 isReady: false, 6294 // A counter to track how many items to wait for before 6295 // the ready event fires. See trac-6781 6296 readyWait: 1, 6297 // Handle when the DOM is ready 6298 ready: function ready(wait) { 6299 // Abort if there are pending holds or we're already ready 6300 if (wait === true ? --_jQuery2.readyWait : _jQuery2.isReady) { 6301 return; 6302 } 6303 6304 // Remember that the DOM is ready 6305 _jQuery2.isReady = true; 6306 6307 // If a normal DOM Ready event fired, decrement, and wait if need be 6308 if (wait !== true && --_jQuery2.readyWait > 0) { 6309 return; 6310 } 6311 6312 // If there are functions bound, to execute 6313 readyList.resolveWith(document, [_jQuery2]); 6314 } 6315 }); 6316 _jQuery2.ready.then = readyList.then; 6317 6318 // The ready event handler and self cleanup method 6319 function completed() { 6320 document.removeEventListener("DOMContentLoaded", completed); 6321 window.removeEventListener("load", completed); 6322 _jQuery2.ready(); 6323 } 6324 6325 // Catch cases where $(document).ready() is called 6326 // after the browser event has already occurred. 6327 // Support: IE <=9 - 10 only 6328 // Older IE sometimes signals "interactive" too soon 6329 if (document.readyState === "complete" || document.readyState !== "loading" && !document.documentElement.doScroll) { 6330 // Handle it asynchronously to allow scripts the opportunity to delay ready 6331 window.setTimeout(_jQuery2.ready); 6332 } else { 6333 // Use the handy event callback 6334 document.addEventListener("DOMContentLoaded", completed); 6335 6336 // A fallback to window.onload, that will always work 6337 window.addEventListener("load", completed); 6338 } 6339 6340 // Multifunctional method to get and set values of a collection 6341 // The value/s can optionally be executed if it's a function 6342 var _access = function access(elems, fn, key, value, chainable, emptyGet, raw) { 6343 var i = 0, 6344 len = elems.length, 6345 bulk = key == null; 6346 6347 // Sets many values 6348 if (toType(key) === "object") { 6349 chainable = true; 6350 for (i in key) { 6351 _access(elems, fn, i, key[i], true, emptyGet, raw); 6352 } 6353 6354 // Sets one value 6355 } else if (value !== undefined) { 6356 chainable = true; 6357 if (!isFunction(value)) { 6358 raw = true; 6359 } 6360 if (bulk) { 6361 // Bulk operations run against the entire set 6362 if (raw) { 6363 fn.call(elems, value); 6364 fn = null; 6365 6366 // ...except when executing function values 6367 } else { 6368 bulk = fn; 6369 fn = function fn(elem, _key, value) { 6370 return bulk.call(_jQuery2(elem), value); 6371 }; 6372 } 6373 } 6374 if (fn) { 6375 for (; i < len; i++) { 6376 fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key))); 6377 } 6378 } 6379 } 6380 if (chainable) { 6381 return elems; 6382 } 6383 6384 // Gets 6385 if (bulk) { 6386 return fn.call(elems); 6387 } 6388 return len ? fn(elems[0], key) : emptyGet; 6389 }; 6390 6391 // Matches dashed string for camelizing 6392 var rmsPrefix = /^-ms-/, 6393 rdashAlpha = /-([a-z])/g; 6394 6395 // Used by camelCase as callback to replace() 6396 function fcamelCase(_all, letter) { 6397 return letter.toUpperCase(); 6398 } 6399 6400 // Convert dashed to camelCase; used by the css and data modules 6401 // Support: IE <=9 - 11, Edge 12 - 15 6402 // Microsoft forgot to hump their vendor prefix (trac-9572) 6403 function camelCase(string) { 6404 return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase); 6405 } 6406 var acceptData = function acceptData(owner) { 6407 // Accepts only: 6408 // - Node 6409 // - Node.ELEMENT_NODE 6410 // - Node.DOCUMENT_NODE 6411 // - Object 6412 // - Any 6413 return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType; 6414 }; 6415 function Data() { 6416 this.expando = _jQuery2.expando + Data.uid++; 6417 } 6418 Data.uid = 1; 6419 Data.prototype = { 6420 cache: function cache(owner) { 6421 // Check if the owner object already has a cache 6422 var value = owner[this.expando]; 6423 6424 // If not, create one 6425 if (!value) { 6426 value = {}; 6427 6428 // We can accept data for non-element nodes in modern browsers, 6429 // but we should not, see trac-8335. 6430 // Always return an empty object. 6431 if (acceptData(owner)) { 6432 // If it is a node unlikely to be stringify-ed or looped over 6433 // use plain assignment 6434 if (owner.nodeType) { 6435 owner[this.expando] = value; 6436 6437 // Otherwise secure it in a non-enumerable property 6438 // configurable must be true to allow the property to be 6439 // deleted when data is removed 6440 } else { 6441 Object.defineProperty(owner, this.expando, { 6442 value: value, 6443 configurable: true 6444 }); 6445 } 6446 } 6447 } 6448 return value; 6449 }, 6450 set: function set(owner, data, value) { 6451 var prop, 6452 cache = this.cache(owner); 6453 6454 // Handle: [ owner, key, value ] args 6455 // Always use camelCase key (gh-2257) 6456 if (typeof data === "string") { 6457 cache[camelCase(data)] = value; 6458 6459 // Handle: [ owner, { properties } ] args 6460 } else { 6461 // Copy the properties one-by-one to the cache object 6462 for (prop in data) { 6463 cache[camelCase(prop)] = data[prop]; 6464 } 6465 } 6466 return cache; 6467 }, 6468 get: function get(owner, key) { 6469 return key === undefined ? this.cache(owner) : 6470 // Always use camelCase key (gh-2257) 6471 owner[this.expando] && owner[this.expando][camelCase(key)]; 6472 }, 6473 access: function access(owner, key, value) { 6474 // In cases where either: 6475 // 6476 // 1. No key was specified 6477 // 2. A string key was specified, but no value provided 6478 // 6479 // Take the "read" path and allow the get method to determine 6480 // which value to return, respectively either: 6481 // 6482 // 1. The entire cache object 6483 // 2. The data stored at the key 6484 // 6485 if (key === undefined || key && typeof key === "string" && value === undefined) { 6486 return this.get(owner, key); 6487 } 6488 6489 // When the key is not a string, or both a key and value 6490 // are specified, set or extend (existing objects) with either: 6491 // 6492 // 1. An object of properties 6493 // 2. A key and value 6494 // 6495 this.set(owner, key, value); 6496 6497 // Since the "set" path can have two possible entry points 6498 // return the expected data based on which path was taken[*] 6499 return value !== undefined ? value : key; 6500 }, 6501 remove: function remove(owner, key) { 6502 var i, 6503 cache = owner[this.expando]; 6504 if (cache === undefined) { 6505 return; 6506 } 6507 if (key !== undefined) { 6508 // Support array or space separated string of keys 6509 if (Array.isArray(key)) { 6510 // If key is an array of keys... 6511 // We always set camelCase keys, so remove that. 6512 key = key.map(camelCase); 6513 } else { 6514 key = camelCase(key); 6515 6516 // If a key with the spaces exists, use it. 6517 // Otherwise, create an array by matching non-whitespace 6518 key = key in cache ? [key] : key.match(rnothtmlwhite) || []; 6519 } 6520 i = key.length; 6521 while (i--) { 6522 delete cache[key[i]]; 6523 } 6524 } 6525 6526 // Remove the expando if there's no more data 6527 if (key === undefined || _jQuery2.isEmptyObject(cache)) { 6528 // Support: Chrome <=35 - 45 6529 // Webkit & Blink performance suffers when deleting properties 6530 // from DOM nodes, so set to undefined instead 6531 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 6532 if (owner.nodeType) { 6533 owner[this.expando] = undefined; 6534 } else { 6535 delete owner[this.expando]; 6536 } 6537 } 6538 }, 6539 hasData: function hasData(owner) { 6540 var cache = owner[this.expando]; 6541 return cache !== undefined && !_jQuery2.isEmptyObject(cache); 6542 } 6543 }; 6544 var dataPriv = new Data(); 6545 var dataUser = new Data(); 6546 6547 // Implementation Summary 6548 // 6549 // 1. Enforce API surface and semantic compatibility with 1.9.x branch 6550 // 2. Improve the module's maintainability by reducing the storage 6551 // paths to a single mechanism. 6552 // 3. Use the same single mechanism to support "private" and "user" data. 6553 // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 6554 // 5. Avoid exposing implementation details on user objects (eg. expando properties) 6555 // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 6556 6557 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 6558 rmultiDash = /[A-Z]/g; 6559 function getData(data) { 6560 if (data === "true") { 6561 return true; 6562 } 6563 if (data === "false") { 6564 return false; 6565 } 6566 if (data === "null") { 6567 return null; 6568 } 6569 6570 // Only convert to a number if it doesn't change the string 6571 if (data === +data + "") { 6572 return +data; 6573 } 6574 if (rbrace.test(data)) { 6575 return JSON.parse(data); 6576 } 6577 return data; 6578 } 6579 function dataAttr(elem, key, data) { 6580 var name; 6581 6582 // If nothing was found internally, try to fetch any 6583 // data from the HTML5 data-* attribute 6584 if (data === undefined && elem.nodeType === 1) { 6585 name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase(); 6586 data = elem.getAttribute(name); 6587 if (typeof data === "string") { 6588 try { 6589 data = getData(data); 6590 } catch (e) {} 6591 6592 // Make sure we set the data so it isn't changed later 6593 dataUser.set(elem, key, data); 6594 } else { 6595 data = undefined; 6596 } 6597 } 6598 return data; 6599 } 6600 _jQuery2.extend({ 6601 hasData: function hasData(elem) { 6602 return dataUser.hasData(elem) || dataPriv.hasData(elem); 6603 }, 6604 data: function data(elem, name, _data) { 6605 return dataUser.access(elem, name, _data); 6606 }, 6607 removeData: function removeData(elem, name) { 6608 dataUser.remove(elem, name); 6609 }, 6610 // TODO: Now that all calls to _data and _removeData have been replaced 6611 // with direct calls to dataPriv methods, these can be deprecated. 6612 _data: function _data(elem, name, data) { 6613 return dataPriv.access(elem, name, data); 6614 }, 6615 _removeData: function _removeData(elem, name) { 6616 dataPriv.remove(elem, name); 6617 } 6618 }); 6619 _jQuery2.fn.extend({ 6620 data: function data(key, value) { 6621 var i, 6622 name, 6623 data, 6624 elem = this[0], 6625 attrs = elem && elem.attributes; 6626 6627 // Gets all values 6628 if (key === undefined) { 6629 if (this.length) { 6630 data = dataUser.get(elem); 6631 if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) { 6632 i = attrs.length; 6633 while (i--) { 6634 // Support: IE 11 only 6635 // The attrs elements can be null (trac-14894) 6636 if (attrs[i]) { 6637 name = attrs[i].name; 6638 if (name.indexOf("data-") === 0) { 6639 name = camelCase(name.slice(5)); 6640 dataAttr(elem, name, data[name]); 6641 } 6642 } 6643 } 6644 dataPriv.set(elem, "hasDataAttrs", true); 6645 } 6646 } 6647 return data; 6648 } 6649 6650 // Sets multiple values 6651 if (_typeof(key) === "object") { 6652 return this.each(function () { 6653 dataUser.set(this, key); 6654 }); 6655 } 6656 return _access(this, function (value) { 6657 var data; 6658 6659 // The calling jQuery object (element matches) is not empty 6660 // (and therefore has an element appears at this[ 0 ]) and the 6661 // `value` parameter was not undefined. An empty jQuery object 6662 // will result in `undefined` for elem = this[ 0 ] which will 6663 // throw an exception if an attempt to read a data cache is made. 6664 if (elem && value === undefined) { 6665 // Attempt to get data from the cache 6666 // The key will always be camelCased in Data 6667 data = dataUser.get(elem, key); 6668 if (data !== undefined) { 6669 return data; 6670 } 6671 6672 // Attempt to "discover" the data in 6673 // HTML5 custom data-* attrs 6674 data = dataAttr(elem, key); 6675 if (data !== undefined) { 6676 return data; 6677 } 6678 6679 // We tried really hard, but the data doesn't exist. 6680 return; 6681 } 6682 6683 // Set the data... 6684 this.each(function () { 6685 // We always store the camelCased key 6686 dataUser.set(this, key, value); 6687 }); 6688 }, null, value, arguments.length > 1, null, true); 6689 }, 6690 removeData: function removeData(key) { 6691 return this.each(function () { 6692 dataUser.remove(this, key); 6693 }); 6694 } 6695 }); 6696 _jQuery2.extend({ 6697 queue: function queue(elem, type, data) { 6698 var queue; 6699 if (elem) { 6700 type = (type || "fx") + "queue"; 6701 queue = dataPriv.get(elem, type); 6702 6703 // Speed up dequeue by getting out quickly if this is just a lookup 6704 if (data) { 6705 if (!queue || Array.isArray(data)) { 6706 queue = dataPriv.access(elem, type, _jQuery2.makeArray(data)); 6707 } else { 6708 queue.push(data); 6709 } 6710 } 6711 return queue || []; 6712 } 6713 }, 6714 dequeue: function dequeue(elem, type) { 6715 type = type || "fx"; 6716 var queue = _jQuery2.queue(elem, type), 6717 startLength = queue.length, 6718 fn = queue.shift(), 6719 hooks = _jQuery2._queueHooks(elem, type), 6720 next = function next() { 6721 _jQuery2.dequeue(elem, type); 6722 }; 6723 6724 // If the fx queue is dequeued, always remove the progress sentinel 6725 if (fn === "inprogress") { 6726 fn = queue.shift(); 6727 startLength--; 6728 } 6729 if (fn) { 6730 // Add a progress sentinel to prevent the fx queue from being 6731 // automatically dequeued 6732 if (type === "fx") { 6733 queue.unshift("inprogress"); 6734 } 6735 6736 // Clear up the last queue stop function 6737 delete hooks.stop; 6738 fn.call(elem, next, hooks); 6739 } 6740 if (!startLength && hooks) { 6741 hooks.empty.fire(); 6742 } 6743 }, 6744 // Not public - generate a queueHooks object, or return the current one 6745 _queueHooks: function _queueHooks(elem, type) { 6746 var key = type + "queueHooks"; 6747 return dataPriv.get(elem, key) || dataPriv.access(elem, key, { 6748 empty: _jQuery2.Callbacks("once memory").add(function () { 6749 dataPriv.remove(elem, [type + "queue", key]); 6750 }) 6751 }); 6752 } 6753 }); 6754 _jQuery2.fn.extend({ 6755 queue: function queue(type, data) { 6756 var setter = 2; 6757 if (typeof type !== "string") { 6758 data = type; 6759 type = "fx"; 6760 setter--; 6761 } 6762 if (arguments.length < setter) { 6763 return _jQuery2.queue(this[0], type); 6764 } 6765 return data === undefined ? this : this.each(function () { 6766 var queue = _jQuery2.queue(this, type, data); 6767 6768 // Ensure a hooks for this queue 6769 _jQuery2._queueHooks(this, type); 6770 if (type === "fx" && queue[0] !== "inprogress") { 6771 _jQuery2.dequeue(this, type); 6772 } 6773 }); 6774 }, 6775 dequeue: function dequeue(type) { 6776 return this.each(function () { 6777 _jQuery2.dequeue(this, type); 6778 }); 6779 }, 6780 clearQueue: function clearQueue(type) { 6781 return this.queue(type || "fx", []); 6782 }, 6783 // Get a promise resolved when queues of a certain type 6784 // are emptied (fx is the type by default) 6785 promise: function promise(type, obj) { 6786 var tmp, 6787 count = 1, 6788 defer = _jQuery2.Deferred(), 6789 elements = this, 6790 i = this.length, 6791 resolve = function resolve() { 6792 if (! --count) { 6793 defer.resolveWith(elements, [elements]); 6794 } 6795 }; 6796 if (typeof type !== "string") { 6797 obj = type; 6798 type = undefined; 6799 } 6800 type = type || "fx"; 6801 while (i--) { 6802 tmp = dataPriv.get(elements[i], type + "queueHooks"); 6803 if (tmp && tmp.empty) { 6804 count++; 6805 tmp.empty.add(resolve); 6806 } 6807 } 6808 resolve(); 6809 return defer.promise(obj); 6810 } 6811 }); 6812 var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; 6813 var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"); 6814 var cssExpand = ["Top", "Right", "Bottom", "Left"]; 6815 var documentElement = document.documentElement; 6816 var isAttached = function isAttached(elem) { 6817 return _jQuery2.contains(elem.ownerDocument, elem); 6818 }, 6819 composed = { 6820 composed: true 6821 }; 6822 6823 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 6824 // Check attachment across shadow DOM boundaries when possible (gh-3504) 6825 // Support: iOS 10.0-10.2 only 6826 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 6827 // leading to errors. We need to check for `getRootNode`. 6828 if (documentElement.getRootNode) { 6829 isAttached = function isAttached(elem) { 6830 return _jQuery2.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument; 6831 }; 6832 } 6833 var isHiddenWithinTree = function isHiddenWithinTree(elem, el) { 6834 // isHiddenWithinTree might be called from jQuery#filter function; 6835 // in that case, element will be second argument 6836 elem = el || elem; 6837 6838 // Inline style trumps all 6839 return elem.style.display === "none" || elem.style.display === "" && 6840 // Otherwise, check computed style 6841 // Support: Firefox <=43 - 45 6842 // Disconnected elements can have computed display: none, so first confirm that elem is 6843 // in the document. 6844 isAttached(elem) && _jQuery2.css(elem, "display") === "none"; 6845 }; 6846 function adjustCSS(elem, prop, valueParts, tween) { 6847 var adjusted, 6848 scale, 6849 maxIterations = 20, 6850 currentValue = tween ? function () { 6851 return tween.cur(); 6852 } : function () { 6853 return _jQuery2.css(elem, prop, ""); 6854 }, 6855 initial = currentValue(), 6856 unit = valueParts && valueParts[3] || (_jQuery2.cssNumber[prop] ? "" : "px"), 6857 // Starting value computation is required for potential unit mismatches 6858 initialInUnit = elem.nodeType && (_jQuery2.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(_jQuery2.css(elem, prop)); 6859 if (initialInUnit && initialInUnit[3] !== unit) { 6860 // Support: Firefox <=54 6861 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 6862 initial = initial / 2; 6863 6864 // Trust units reported by jQuery.css 6865 unit = unit || initialInUnit[3]; 6866 6867 // Iteratively approximate from a nonzero starting point 6868 initialInUnit = +initial || 1; 6869 while (maxIterations--) { 6870 // Evaluate and update our best guess (doubling guesses that zero out). 6871 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 6872 _jQuery2.style(elem, prop, initialInUnit + unit); 6873 if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) { 6874 maxIterations = 0; 6875 } 6876 initialInUnit = initialInUnit / scale; 6877 } 6878 initialInUnit = initialInUnit * 2; 6879 _jQuery2.style(elem, prop, initialInUnit + unit); 6880 6881 // Make sure we update the tween properties later on 6882 valueParts = valueParts || []; 6883 } 6884 if (valueParts) { 6885 initialInUnit = +initialInUnit || +initial || 0; 6886 6887 // Apply relative offset (+=/-=) if specified 6888 adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2]; 6889 if (tween) { 6890 tween.unit = unit; 6891 tween.start = initialInUnit; 6892 tween.end = adjusted; 6893 } 6894 } 6895 return adjusted; 6896 } 6897 var defaultDisplayMap = {}; 6898 function getDefaultDisplay(elem) { 6899 var temp, 6900 doc = elem.ownerDocument, 6901 nodeName = elem.nodeName, 6902 display = defaultDisplayMap[nodeName]; 6903 if (display) { 6904 return display; 6905 } 6906 temp = doc.body.appendChild(doc.createElement(nodeName)); 6907 display = _jQuery2.css(temp, "display"); 6908 temp.parentNode.removeChild(temp); 6909 if (display === "none") { 6910 display = "block"; 6911 } 6912 defaultDisplayMap[nodeName] = display; 6913 return display; 6914 } 6915 function showHide(elements, show) { 6916 var display, 6917 elem, 6918 values = [], 6919 index = 0, 6920 length = elements.length; 6921 6922 // Determine new display value for elements that need to change 6923 for (; index < length; index++) { 6924 elem = elements[index]; 6925 if (!elem.style) { 6926 continue; 6927 } 6928 display = elem.style.display; 6929 if (show) { 6930 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 6931 // check is required in this first loop unless we have a nonempty display value (either 6932 // inline or about-to-be-restored) 6933 if (display === "none") { 6934 values[index] = dataPriv.get(elem, "display") || null; 6935 if (!values[index]) { 6936 elem.style.display = ""; 6937 } 6938 } 6939 if (elem.style.display === "" && isHiddenWithinTree(elem)) { 6940 values[index] = getDefaultDisplay(elem); 6941 } 6942 } else { 6943 if (display !== "none") { 6944 values[index] = "none"; 6945 6946 // Remember what we're overwriting 6947 dataPriv.set(elem, "display", display); 6948 } 6949 } 6950 } 6951 6952 // Set the display of the elements in a second loop to avoid constant reflow 6953 for (index = 0; index < length; index++) { 6954 if (values[index] != null) { 6955 elements[index].style.display = values[index]; 6956 } 6957 } 6958 return elements; 6959 } 6960 _jQuery2.fn.extend({ 6961 show: function show() { 6962 return showHide(this, true); 6963 }, 6964 hide: function hide() { 6965 return showHide(this); 6966 }, 6967 toggle: function toggle(state) { 6968 if (typeof state === "boolean") { 6969 return state ? this.show() : this.hide(); 6970 } 6971 return this.each(function () { 6972 if (isHiddenWithinTree(this)) { 6973 _jQuery2(this).show(); 6974 } else { 6975 _jQuery2(this).hide(); 6976 } 6977 }); 6978 } 6979 }); 6980 var rcheckableType = /^(?:checkbox|radio)$/i; 6981 var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i; 6982 var rscriptType = /^$|^module$|\/(?:java|ecma)script/i; 6983 (function () { 6984 var fragment = document.createDocumentFragment(), 6985 div = fragment.appendChild(document.createElement("div")), 6986 input = document.createElement("input"); 6987 6988 // Support: Android 4.0 - 4.3 only 6989 // Check state lost if the name is set (trac-11217) 6990 // Support: Windows Web Apps (WWA) 6991 // `name` and `type` must use .setAttribute for WWA (trac-14901) 6992 input.setAttribute("type", "radio"); 6993 input.setAttribute("checked", "checked"); 6994 input.setAttribute("name", "t"); 6995 div.appendChild(input); 6996 6997 // Support: Android <=4.1 only 6998 // Older WebKit doesn't clone checked state correctly in fragments 6999 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked; 7000 7001 // Support: IE <=11 only 7002 // Make sure textarea (and checkbox) defaultValue is properly cloned 7003 div.innerHTML = "<textarea>x</textarea>"; 7004 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue; 7005 7006 // Support: IE <=9 only 7007 // IE <=9 replaces <option> tags with their contents when inserted outside of 7008 // the select element. 7009 div.innerHTML = "<option></option>"; 7010 support.option = !!div.lastChild; 7011 })(); 7012 7013 // We have to close these tags to support XHTML (trac-13200) 7014 var wrapMap = { 7015 // XHTML parsers do not magically insert elements in the 7016 // same way that tag soup parsers do. So we cannot shorten 7017 // this by omitting <tbody> or other required elements. 7018 thead: [1, "<table>", "</table>"], 7019 col: [2, "<table><colgroup>", "</colgroup></table>"], 7020 tr: [2, "<table><tbody>", "</tbody></table>"], 7021 td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], 7022 _default: [0, "", ""] 7023 }; 7024 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 7025 wrapMap.th = wrapMap.td; 7026 7027 // Support: IE <=9 only 7028 if (!support.option) { 7029 wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"]; 7030 } 7031 function getAll(context, tag) { 7032 // Support: IE <=9 - 11 only 7033 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) 7034 var ret; 7035 if (typeof context.getElementsByTagName !== "undefined") { 7036 ret = context.getElementsByTagName(tag || "*"); 7037 } else if (typeof context.querySelectorAll !== "undefined") { 7038 ret = context.querySelectorAll(tag || "*"); 7039 } else { 7040 ret = []; 7041 } 7042 if (tag === undefined || tag && nodeName(context, tag)) { 7043 return _jQuery2.merge([context], ret); 7044 } 7045 return ret; 7046 } 7047 7048 // Mark scripts as having already been evaluated 7049 function setGlobalEval(elems, refElements) { 7050 var i = 0, 7051 l = elems.length; 7052 for (; i < l; i++) { 7053 dataPriv.set(elems[i], "globalEval", !refElements || dataPriv.get(refElements[i], "globalEval")); 7054 } 7055 } 7056 var rhtml = /<|&#?\w+;/; 7057 function buildFragment(elems, context, scripts, selection, ignored) { 7058 var elem, 7059 tmp, 7060 tag, 7061 wrap, 7062 attached, 7063 j, 7064 fragment = context.createDocumentFragment(), 7065 nodes = [], 7066 i = 0, 7067 l = elems.length; 7068 for (; i < l; i++) { 7069 elem = elems[i]; 7070 if (elem || elem === 0) { 7071 // Add nodes directly 7072 if (toType(elem) === "object") { 7073 // Support: Android <=4.0 only, PhantomJS 1 only 7074 // push.apply(_, arraylike) throws on ancient WebKit 7075 _jQuery2.merge(nodes, elem.nodeType ? [elem] : elem); 7076 7077 // Convert non-html into a text node 7078 } else if (!rhtml.test(elem)) { 7079 nodes.push(context.createTextNode(elem)); 7080 7081 // Convert html into DOM nodes 7082 } else { 7083 tmp = tmp || fragment.appendChild(context.createElement("div")); 7084 7085 // Deserialize a standard representation 7086 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(); 7087 wrap = wrapMap[tag] || wrapMap._default; 7088 tmp.innerHTML = wrap[1] + _jQuery2.htmlPrefilter(elem) + wrap[2]; 7089 7090 // Descend through wrappers to the right content 7091 j = wrap[0]; 7092 while (j--) { 7093 tmp = tmp.lastChild; 7094 } 7095 7096 // Support: Android <=4.0 only, PhantomJS 1 only 7097 // push.apply(_, arraylike) throws on ancient WebKit 7098 _jQuery2.merge(nodes, tmp.childNodes); 7099 7100 // Remember the top-level container 7101 tmp = fragment.firstChild; 7102 7103 // Ensure the created nodes are orphaned (trac-12392) 7104 tmp.textContent = ""; 7105 } 7106 } 7107 } 7108 7109 // Remove wrapper from fragment 7110 fragment.textContent = ""; 7111 i = 0; 7112 while (elem = nodes[i++]) { 7113 // Skip elements already in the context collection (trac-4087) 7114 if (selection && _jQuery2.inArray(elem, selection) > -1) { 7115 if (ignored) { 7116 ignored.push(elem); 7117 } 7118 continue; 7119 } 7120 attached = isAttached(elem); 7121 7122 // Append to fragment 7123 tmp = getAll(fragment.appendChild(elem), "script"); 7124 7125 // Preserve script evaluation history 7126 if (attached) { 7127 setGlobalEval(tmp); 7128 } 7129 7130 // Capture executables 7131 if (scripts) { 7132 j = 0; 7133 while (elem = tmp[j++]) { 7134 if (rscriptType.test(elem.type || "")) { 7135 scripts.push(elem); 7136 } 7137 } 7138 } 7139 } 7140 return fragment; 7141 } 7142 var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 7143 function returnTrue() { 7144 return true; 7145 } 7146 function returnFalse() { 7147 return false; 7148 } 7149 function _on(elem, types, selector, data, fn, one) { 7150 var origFn, type; 7151 7152 // Types can be a map of types/handlers 7153 if (_typeof(types) === "object") { 7154 // ( types-Object, selector, data ) 7155 if (typeof selector !== "string") { 7156 // ( types-Object, data ) 7157 data = data || selector; 7158 selector = undefined; 7159 } 7160 for (type in types) { 7161 _on(elem, type, selector, data, types[type], one); 7162 } 7163 return elem; 7164 } 7165 if (data == null && fn == null) { 7166 // ( types, fn ) 7167 fn = selector; 7168 data = selector = undefined; 7169 } else if (fn == null) { 7170 if (typeof selector === "string") { 7171 // ( types, selector, fn ) 7172 fn = data; 7173 data = undefined; 7174 } else { 7175 // ( types, data, fn ) 7176 fn = data; 7177 data = selector; 7178 selector = undefined; 7179 } 7180 } 7181 if (fn === false) { 7182 fn = returnFalse; 7183 } else if (!fn) { 7184 return elem; 7185 } 7186 if (one === 1) { 7187 origFn = fn; 7188 fn = function fn(event) { 7189 // Can use an empty set, since event contains the info 7190 _jQuery2().off(event); 7191 return origFn.apply(this, arguments); 7192 }; 7193 7194 // Use same guid so caller can remove using origFn 7195 fn.guid = origFn.guid || (origFn.guid = _jQuery2.guid++); 7196 } 7197 return elem.each(function () { 7198 _jQuery2.event.add(this, types, fn, data, selector); 7199 }); 7200 } 7201 7202 /* 7203 * Helper functions for managing events -- not part of the public interface. 7204 * Props to Dean Edwards' addEvent library for many of the ideas. 7205 */ 7206 _jQuery2.event = { 7207 global: {}, 7208 add: function add(elem, types, handler, data, selector) { 7209 var handleObjIn, 7210 eventHandle, 7211 tmp, 7212 events, 7213 t, 7214 handleObj, 7215 special, 7216 handlers, 7217 type, 7218 namespaces, 7219 origType, 7220 elemData = dataPriv.get(elem); 7221 7222 // Only attach events to objects that accept data 7223 if (!acceptData(elem)) { 7224 return; 7225 } 7226 7227 // Caller can pass in an object of custom data in lieu of the handler 7228 if (handler.handler) { 7229 handleObjIn = handler; 7230 handler = handleObjIn.handler; 7231 selector = handleObjIn.selector; 7232 } 7233 7234 // Ensure that invalid selectors throw exceptions at attach time 7235 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 7236 if (selector) { 7237 _jQuery2.find.matchesSelector(documentElement, selector); 7238 } 7239 7240 // Make sure that the handler has a unique ID, used to find/remove it later 7241 if (!handler.guid) { 7242 handler.guid = _jQuery2.guid++; 7243 } 7244 7245 // Init the element's event structure and main handler, if this is the first 7246 if (!(events = elemData.events)) { 7247 events = elemData.events = Object.create(null); 7248 } 7249 if (!(eventHandle = elemData.handle)) { 7250 eventHandle = elemData.handle = function (e) { 7251 // Discard the second event of a jQuery.event.trigger() and 7252 // when an event is called after a page has unloaded 7253 return typeof _jQuery2 !== "undefined" && _jQuery2.event.triggered !== e.type ? _jQuery2.event.dispatch.apply(elem, arguments) : undefined; 7254 }; 7255 } 7256 7257 // Handle multiple events separated by a space 7258 types = (types || "").match(rnothtmlwhite) || [""]; 7259 t = types.length; 7260 while (t--) { 7261 tmp = rtypenamespace.exec(types[t]) || []; 7262 type = origType = tmp[1]; 7263 namespaces = (tmp[2] || "").split(".").sort(); 7264 7265 // There *must* be a type, no attaching namespace-only handlers 7266 if (!type) { 7267 continue; 7268 } 7269 7270 // If event changes its type, use the special event handlers for the changed type 7271 special = _jQuery2.event.special[type] || {}; 7272 7273 // If selector defined, determine special event api type, otherwise given type 7274 type = (selector ? special.delegateType : special.bindType) || type; 7275 7276 // Update special based on newly reset type 7277 special = _jQuery2.event.special[type] || {}; 7278 7279 // handleObj is passed to all event handlers 7280 handleObj = _jQuery2.extend({ 7281 type: type, 7282 origType: origType, 7283 data: data, 7284 handler: handler, 7285 guid: handler.guid, 7286 selector: selector, 7287 needsContext: selector && _jQuery2.expr.match.needsContext.test(selector), 7288 namespace: namespaces.join(".") 7289 }, handleObjIn); 7290 7291 // Init the event handler queue if we're the first 7292 if (!(handlers = events[type])) { 7293 handlers = events[type] = []; 7294 handlers.delegateCount = 0; 7295 7296 // Only use addEventListener if the special events handler returns false 7297 if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) { 7298 if (elem.addEventListener) { 7299 elem.addEventListener(type, eventHandle); 7300 } 7301 } 7302 } 7303 if (special.add) { 7304 special.add.call(elem, handleObj); 7305 if (!handleObj.handler.guid) { 7306 handleObj.handler.guid = handler.guid; 7307 } 7308 } 7309 7310 // Add to the element's handler list, delegates in front 7311 if (selector) { 7312 handlers.splice(handlers.delegateCount++, 0, handleObj); 7313 } else { 7314 handlers.push(handleObj); 7315 } 7316 7317 // Keep track of which events have ever been used, for event optimization 7318 _jQuery2.event.global[type] = true; 7319 } 7320 }, 7321 // Detach an event or set of events from an element 7322 remove: function remove(elem, types, handler, selector, mappedTypes) { 7323 var j, 7324 origCount, 7325 tmp, 7326 events, 7327 t, 7328 handleObj, 7329 special, 7330 handlers, 7331 type, 7332 namespaces, 7333 origType, 7334 elemData = dataPriv.hasData(elem) && dataPriv.get(elem); 7335 if (!elemData || !(events = elemData.events)) { 7336 return; 7337 } 7338 7339 // Once for each type.namespace in types; type may be omitted 7340 types = (types || "").match(rnothtmlwhite) || [""]; 7341 t = types.length; 7342 while (t--) { 7343 tmp = rtypenamespace.exec(types[t]) || []; 7344 type = origType = tmp[1]; 7345 namespaces = (tmp[2] || "").split(".").sort(); 7346 7347 // Unbind all events (on this namespace, if provided) for the element 7348 if (!type) { 7349 for (type in events) { 7350 _jQuery2.event.remove(elem, type + types[t], handler, selector, true); 7351 } 7352 continue; 7353 } 7354 special = _jQuery2.event.special[type] || {}; 7355 type = (selector ? special.delegateType : special.bindType) || type; 7356 handlers = events[type] || []; 7357 tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"); 7358 7359 // Remove matching events 7360 origCount = j = handlers.length; 7361 while (j--) { 7362 handleObj = handlers[j]; 7363 if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) { 7364 handlers.splice(j, 1); 7365 if (handleObj.selector) { 7366 handlers.delegateCount--; 7367 } 7368 if (special.remove) { 7369 special.remove.call(elem, handleObj); 7370 } 7371 } 7372 } 7373 7374 // Remove generic event handler if we removed something and no more handlers exist 7375 // (avoids potential for endless recursion during removal of special event handlers) 7376 if (origCount && !handlers.length) { 7377 if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) { 7378 _jQuery2.removeEvent(elem, type, elemData.handle); 7379 } 7380 delete events[type]; 7381 } 7382 } 7383 7384 // Remove data and the expando if it's no longer used 7385 if (_jQuery2.isEmptyObject(events)) { 7386 dataPriv.remove(elem, "handle events"); 7387 } 7388 }, 7389 dispatch: function dispatch(nativeEvent) { 7390 var i, 7391 j, 7392 ret, 7393 matched, 7394 handleObj, 7395 handlerQueue, 7396 args = new Array(arguments.length), 7397 // Make a writable jQuery.Event from the native event object 7398 event = _jQuery2.event.fix(nativeEvent), 7399 handlers = (dataPriv.get(this, "events") || Object.create(null))[event.type] || [], 7400 special = _jQuery2.event.special[event.type] || {}; 7401 7402 // Use the fix-ed jQuery.Event rather than the (read-only) native event 7403 args[0] = event; 7404 for (i = 1; i < arguments.length; i++) { 7405 args[i] = arguments[i]; 7406 } 7407 event.delegateTarget = this; 7408 7409 // Call the preDispatch hook for the mapped type, and let it bail if desired 7410 if (special.preDispatch && special.preDispatch.call(this, event) === false) { 7411 return; 7412 } 7413 7414 // Determine handlers 7415 handlerQueue = _jQuery2.event.handlers.call(this, event, handlers); 7416 7417 // Run delegates first; they may want to stop propagation beneath us 7418 i = 0; 7419 while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) { 7420 event.currentTarget = matched.elem; 7421 j = 0; 7422 while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) { 7423 // If the event is namespaced, then each handler is only invoked if it is 7424 // specially universal or its namespaces are a superset of the event's. 7425 if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) { 7426 event.handleObj = handleObj; 7427 event.data = handleObj.data; 7428 ret = ((_jQuery2.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args); 7429 if (ret !== undefined) { 7430 if ((event.result = ret) === false) { 7431 event.preventDefault(); 7432 event.stopPropagation(); 7433 } 7434 } 7435 } 7436 } 7437 } 7438 7439 // Call the postDispatch hook for the mapped type 7440 if (special.postDispatch) { 7441 special.postDispatch.call(this, event); 7442 } 7443 return event.result; 7444 }, 7445 handlers: function handlers(event, _handlers) { 7446 var i, 7447 handleObj, 7448 sel, 7449 matchedHandlers, 7450 matchedSelectors, 7451 handlerQueue = [], 7452 delegateCount = _handlers.delegateCount, 7453 cur = event.target; 7454 7455 // Find delegate handlers 7456 if (delegateCount && 7457 // Support: IE <=9 7458 // Black-hole SVG <use> instance trees (trac-13180) 7459 cur.nodeType && 7460 // Support: Firefox <=42 7461 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 7462 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 7463 // Support: IE 11 only 7464 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 7465 !(event.type === "click" && event.button >= 1)) { 7466 for (; cur !== this; cur = cur.parentNode || this) { 7467 // Don't check non-elements (trac-13208) 7468 // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) 7469 if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) { 7470 matchedHandlers = []; 7471 matchedSelectors = {}; 7472 for (i = 0; i < delegateCount; i++) { 7473 handleObj = _handlers[i]; 7474 7475 // Don't conflict with Object.prototype properties (trac-13203) 7476 sel = handleObj.selector + " "; 7477 if (matchedSelectors[sel] === undefined) { 7478 matchedSelectors[sel] = handleObj.needsContext ? _jQuery2(sel, this).index(cur) > -1 : _jQuery2.find(sel, this, null, [cur]).length; 7479 } 7480 if (matchedSelectors[sel]) { 7481 matchedHandlers.push(handleObj); 7482 } 7483 } 7484 if (matchedHandlers.length) { 7485 handlerQueue.push({ 7486 elem: cur, 7487 handlers: matchedHandlers 7488 }); 7489 } 7490 } 7491 } 7492 } 7493 7494 // Add the remaining (directly-bound) handlers 7495 cur = this; 7496 if (delegateCount < _handlers.length) { 7497 handlerQueue.push({ 7498 elem: cur, 7499 handlers: _handlers.slice(delegateCount) 7500 }); 7501 } 7502 return handlerQueue; 7503 }, 7504 addProp: function addProp(name, hook) { 7505 Object.defineProperty(_jQuery2.Event.prototype, name, { 7506 enumerable: true, 7507 configurable: true, 7508 get: isFunction(hook) ? function () { 7509 if (this.originalEvent) { 7510 return hook(this.originalEvent); 7511 } 7512 } : function () { 7513 if (this.originalEvent) { 7514 return this.originalEvent[name]; 7515 } 7516 }, 7517 set: function set(value) { 7518 Object.defineProperty(this, name, { 7519 enumerable: true, 7520 configurable: true, 7521 writable: true, 7522 value: value 7523 }); 7524 } 7525 }); 7526 }, 7527 fix: function fix(originalEvent) { 7528 return originalEvent[_jQuery2.expando] ? originalEvent : new _jQuery2.Event(originalEvent); 7529 }, 7530 special: { 7531 load: { 7532 // Prevent triggered image.load events from bubbling to window.load 7533 noBubble: true 7534 }, 7535 click: { 7536 // Utilize native event to ensure correct state for checkable inputs 7537 setup: function setup(data) { 7538 // For mutual compressibility with _default, replace `this` access with a local var. 7539 // `|| data` is dead code meant only to preserve the variable through minification. 7540 var el = this || data; 7541 7542 // Claim the first handler 7543 if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) { 7544 // dataPriv.set( el, "click", ... ) 7545 leverageNative(el, "click", true); 7546 } 7547 7548 // Return false to allow normal processing in the caller 7549 return false; 7550 }, 7551 trigger: function trigger(data) { 7552 // For mutual compressibility with _default, replace `this` access with a local var. 7553 // `|| data` is dead code meant only to preserve the variable through minification. 7554 var el = this || data; 7555 7556 // Force setup before triggering a click 7557 if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) { 7558 leverageNative(el, "click"); 7559 } 7560 7561 // Return non-false to allow normal event-path propagation 7562 return true; 7563 }, 7564 // For cross-browser consistency, suppress native .click() on links 7565 // Also prevent it if we're currently inside a leveraged native-event stack 7566 _default: function _default(event) { 7567 var target = event.target; 7568 return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a"); 7569 } 7570 }, 7571 beforeunload: { 7572 postDispatch: function postDispatch(event) { 7573 // Support: Firefox 20+ 7574 // Firefox doesn't alert if the returnValue field is not set. 7575 if (event.result !== undefined && event.originalEvent) { 7576 event.originalEvent.returnValue = event.result; 7577 } 7578 } 7579 } 7580 } 7581 }; 7582 7583 // Ensure the presence of an event listener that handles manually-triggered 7584 // synthetic events by interrupting progress until reinvoked in response to 7585 // *native* events that it fires directly, ensuring that state changes have 7586 // already occurred before other listeners are invoked. 7587 function leverageNative(el, type, isSetup) { 7588 // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add 7589 if (!isSetup) { 7590 if (dataPriv.get(el, type) === undefined) { 7591 _jQuery2.event.add(el, type, returnTrue); 7592 } 7593 return; 7594 } 7595 7596 // Register the controller as a special universal handler for all event namespaces 7597 dataPriv.set(el, type, false); 7598 _jQuery2.event.add(el, type, { 7599 namespace: false, 7600 handler: function handler(event) { 7601 var result, 7602 saved = dataPriv.get(this, type); 7603 if (event.isTrigger & 1 && this[type]) { 7604 // Interrupt processing of the outer synthetic .trigger()ed event 7605 if (!saved) { 7606 // Store arguments for use when handling the inner native event 7607 // There will always be at least one argument (an event object), so this array 7608 // will not be confused with a leftover capture object. 7609 saved = _slice.call(arguments); 7610 dataPriv.set(this, type, saved); 7611 7612 // Trigger the native event and capture its result 7613 this[type](); 7614 result = dataPriv.get(this, type); 7615 dataPriv.set(this, type, false); 7616 if (saved !== result) { 7617 // Cancel the outer synthetic event 7618 event.stopImmediatePropagation(); 7619 event.preventDefault(); 7620 return result; 7621 } 7622 7623 // If this is an inner synthetic event for an event with a bubbling surrogate 7624 // (focus or blur), assume that the surrogate already propagated from triggering 7625 // the native event and prevent that from happening again here. 7626 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 7627 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 7628 // less bad than duplication. 7629 } else if ((_jQuery2.event.special[type] || {}).delegateType) { 7630 event.stopPropagation(); 7631 } 7632 7633 // If this is a native event triggered above, everything is now in order 7634 // Fire an inner synthetic event with the original arguments 7635 } else if (saved) { 7636 // ...and capture the result 7637 dataPriv.set(this, type, _jQuery2.event.trigger(saved[0], saved.slice(1), this)); 7638 7639 // Abort handling of the native event by all jQuery handlers while allowing 7640 // native handlers on the same element to run. On target, this is achieved 7641 // by stopping immediate propagation just on the jQuery event. However, 7642 // the native event is re-wrapped by a jQuery one on each level of the 7643 // propagation so the only way to stop it for jQuery is to stop it for 7644 // everyone via native `stopPropagation()`. This is not a problem for 7645 // focus/blur which don't bubble, but it does also stop click on checkboxes 7646 // and radios. We accept this limitation. 7647 event.stopPropagation(); 7648 event.isImmediatePropagationStopped = returnTrue; 7649 } 7650 } 7651 }); 7652 } 7653 _jQuery2.removeEvent = function (elem, type, handle) { 7654 // This "if" is needed for plain objects 7655 if (elem.removeEventListener) { 7656 elem.removeEventListener(type, handle); 7657 } 7658 }; 7659 _jQuery2.Event = function (src, props) { 7660 // Allow instantiation without the 'new' keyword 7661 if (!(this instanceof _jQuery2.Event)) { 7662 return new _jQuery2.Event(src, props); 7663 } 7664 7665 // Event object 7666 if (src && src.type) { 7667 this.originalEvent = src; 7668 this.type = src.type; 7669 7670 // Events bubbling up the document may have been marked as prevented 7671 // by a handler lower down the tree; reflect the correct value. 7672 this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && 7673 // Support: Android <=2.3 only 7674 src.returnValue === false ? returnTrue : returnFalse; 7675 7676 // Create target properties 7677 // Support: Safari <=6 - 7 only 7678 // Target should not be a text node (trac-504, trac-13143) 7679 this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target; 7680 this.currentTarget = src.currentTarget; 7681 this.relatedTarget = src.relatedTarget; 7682 7683 // Event type 7684 } else { 7685 this.type = src; 7686 } 7687 7688 // Put explicitly provided properties onto the event object 7689 if (props) { 7690 _jQuery2.extend(this, props); 7691 } 7692 7693 // Create a timestamp if incoming event doesn't have one 7694 this.timeStamp = src && src.timeStamp || Date.now(); 7695 7696 // Mark it as fixed 7697 this[_jQuery2.expando] = true; 7698 }; 7699 7700 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 7701 // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 7702 _jQuery2.Event.prototype = { 7703 constructor: _jQuery2.Event, 7704 isDefaultPrevented: returnFalse, 7705 isPropagationStopped: returnFalse, 7706 isImmediatePropagationStopped: returnFalse, 7707 isSimulated: false, 7708 preventDefault: function preventDefault() { 7709 var e = this.originalEvent; 7710 this.isDefaultPrevented = returnTrue; 7711 if (e && !this.isSimulated) { 7712 e.preventDefault(); 7713 } 7714 }, 7715 stopPropagation: function stopPropagation() { 7716 var e = this.originalEvent; 7717 this.isPropagationStopped = returnTrue; 7718 if (e && !this.isSimulated) { 7719 e.stopPropagation(); 7720 } 7721 }, 7722 stopImmediatePropagation: function stopImmediatePropagation() { 7723 var e = this.originalEvent; 7724 this.isImmediatePropagationStopped = returnTrue; 7725 if (e && !this.isSimulated) { 7726 e.stopImmediatePropagation(); 7727 } 7728 this.stopPropagation(); 7729 } 7730 }; 7731 7732 // Includes all common event props including KeyEvent and MouseEvent specific props 7733 _jQuery2.each({ 7734 altKey: true, 7735 bubbles: true, 7736 cancelable: true, 7737 changedTouches: true, 7738 ctrlKey: true, 7739 detail: true, 7740 eventPhase: true, 7741 metaKey: true, 7742 pageX: true, 7743 pageY: true, 7744 shiftKey: true, 7745 view: true, 7746 "char": true, 7747 code: true, 7748 charCode: true, 7749 key: true, 7750 keyCode: true, 7751 button: true, 7752 buttons: true, 7753 clientX: true, 7754 clientY: true, 7755 offsetX: true, 7756 offsetY: true, 7757 pointerId: true, 7758 pointerType: true, 7759 screenX: true, 7760 screenY: true, 7761 targetTouches: true, 7762 toElement: true, 7763 touches: true, 7764 which: true 7765 }, _jQuery2.event.addProp); 7766 _jQuery2.each({ 7767 focus: "focusin", 7768 blur: "focusout" 7769 }, function (type, delegateType) { 7770 function focusMappedHandler(nativeEvent) { 7771 if (document.documentMode) { 7772 // Support: IE 11+ 7773 // Attach a single focusin/focusout handler on the document while someone wants 7774 // focus/blur. This is because the former are synchronous in IE while the latter 7775 // are async. In other browsers, all those handlers are invoked synchronously. 7776 7777 // `handle` from private data would already wrap the event, but we need 7778 // to change the `type` here. 7779 var handle = dataPriv.get(this, "handle"), 7780 event = _jQuery2.event.fix(nativeEvent); 7781 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; 7782 event.isSimulated = true; 7783 7784 // First, handle focusin/focusout 7785 handle(nativeEvent); 7786 7787 // ...then, handle focus/blur 7788 // 7789 // focus/blur don't bubble while focusin/focusout do; simulate the former by only 7790 // invoking the handler at the lower level. 7791 if (event.target === event.currentTarget) { 7792 // The setup part calls `leverageNative`, which, in turn, calls 7793 // `jQuery.event.add`, so event handle will already have been set 7794 // by this point. 7795 handle(event); 7796 } 7797 } else { 7798 // For non-IE browsers, attach a single capturing handler on the document 7799 // while someone wants focusin/focusout. 7800 _jQuery2.event.simulate(delegateType, nativeEvent.target, _jQuery2.event.fix(nativeEvent)); 7801 } 7802 } 7803 _jQuery2.event.special[type] = { 7804 // Utilize native event if possible so blur/focus sequence is correct 7805 setup: function setup() { 7806 var attaches; 7807 7808 // Claim the first handler 7809 // dataPriv.set( this, "focus", ... ) 7810 // dataPriv.set( this, "blur", ... ) 7811 leverageNative(this, type, true); 7812 if (document.documentMode) { 7813 // Support: IE 9 - 11+ 7814 // We use the same native handler for focusin & focus (and focusout & blur) 7815 // so we need to coordinate setup & teardown parts between those events. 7816 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 7817 attaches = dataPriv.get(this, delegateType); 7818 if (!attaches) { 7819 this.addEventListener(delegateType, focusMappedHandler); 7820 } 7821 dataPriv.set(this, delegateType, (attaches || 0) + 1); 7822 } else { 7823 // Return false to allow normal processing in the caller 7824 return false; 7825 } 7826 }, 7827 trigger: function trigger() { 7828 // Force setup before trigger 7829 leverageNative(this, type); 7830 7831 // Return non-false to allow normal event-path propagation 7832 return true; 7833 }, 7834 teardown: function teardown() { 7835 var attaches; 7836 if (document.documentMode) { 7837 attaches = dataPriv.get(this, delegateType) - 1; 7838 if (!attaches) { 7839 this.removeEventListener(delegateType, focusMappedHandler); 7840 dataPriv.remove(this, delegateType); 7841 } else { 7842 dataPriv.set(this, delegateType, attaches); 7843 } 7844 } else { 7845 // Return false to indicate standard teardown should be applied 7846 return false; 7847 } 7848 }, 7849 // Suppress native focus or blur if we're currently inside 7850 // a leveraged native-event stack 7851 _default: function _default(event) { 7852 return dataPriv.get(event.target, type); 7853 }, 7854 delegateType: delegateType 7855 }; 7856 7857 // Support: Firefox <=44 7858 // Firefox doesn't have focus(in | out) events 7859 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 7860 // 7861 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 7862 // focus(in | out) events fire after focus & blur events, 7863 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 7864 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 7865 // 7866 // Support: IE 9 - 11+ 7867 // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, 7868 // attach a single handler for both events in IE. 7869 _jQuery2.event.special[delegateType] = { 7870 setup: function setup() { 7871 // Handle: regular nodes (via `this.ownerDocument`), window 7872 // (via `this.document`) & document (via `this`). 7873 var doc = this.ownerDocument || this.document || this, 7874 dataHolder = document.documentMode ? this : doc, 7875 attaches = dataPriv.get(dataHolder, delegateType); 7876 7877 // Support: IE 9 - 11+ 7878 // We use the same native handler for focusin & focus (and focusout & blur) 7879 // so we need to coordinate setup & teardown parts between those events. 7880 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 7881 if (!attaches) { 7882 if (document.documentMode) { 7883 this.addEventListener(delegateType, focusMappedHandler); 7884 } else { 7885 doc.addEventListener(type, focusMappedHandler, true); 7886 } 7887 } 7888 dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1); 7889 }, 7890 teardown: function teardown() { 7891 var doc = this.ownerDocument || this.document || this, 7892 dataHolder = document.documentMode ? this : doc, 7893 attaches = dataPriv.get(dataHolder, delegateType) - 1; 7894 if (!attaches) { 7895 if (document.documentMode) { 7896 this.removeEventListener(delegateType, focusMappedHandler); 7897 } else { 7898 doc.removeEventListener(type, focusMappedHandler, true); 7899 } 7900 dataPriv.remove(dataHolder, delegateType); 7901 } else { 7902 dataPriv.set(dataHolder, delegateType, attaches); 7903 } 7904 } 7905 }; 7906 }); 7907 7908 // Create mouseenter/leave events using mouseover/out and event-time checks 7909 // so that event delegation works in jQuery. 7910 // Do the same for pointerenter/pointerleave and pointerover/pointerout 7911 // 7912 // Support: Safari 7 only 7913 // Safari sends mouseenter too often; see: 7914 // https://bugs.chromium.org/p/chromium/issues/detail?id=470258 7915 // for the description of the bug (it existed in older Chrome versions as well). 7916 _jQuery2.each({ 7917 mouseenter: "mouseover", 7918 mouseleave: "mouseout", 7919 pointerenter: "pointerover", 7920 pointerleave: "pointerout" 7921 }, function (orig, fix) { 7922 _jQuery2.event.special[orig] = { 7923 delegateType: fix, 7924 bindType: fix, 7925 handle: function handle(event) { 7926 var ret, 7927 target = this, 7928 related = event.relatedTarget, 7929 handleObj = event.handleObj; 7930 7931 // For mouseenter/leave call the handler if related is outside the target. 7932 // NB: No relatedTarget if the mouse left/entered the browser window 7933 if (!related || related !== target && !_jQuery2.contains(target, related)) { 7934 event.type = handleObj.origType; 7935 ret = handleObj.handler.apply(this, arguments); 7936 event.type = fix; 7937 } 7938 return ret; 7939 } 7940 }; 7941 }); 7942 _jQuery2.fn.extend({ 7943 on: function on(types, selector, data, fn) { 7944 return _on(this, types, selector, data, fn); 7945 }, 7946 one: function one(types, selector, data, fn) { 7947 return _on(this, types, selector, data, fn, 1); 7948 }, 7949 off: function off(types, selector, fn) { 7950 var handleObj, type; 7951 if (types && types.preventDefault && types.handleObj) { 7952 // ( event ) dispatched jQuery.Event 7953 handleObj = types.handleObj; 7954 _jQuery2(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler); 7955 return this; 7956 } 7957 if (_typeof(types) === "object") { 7958 // ( types-object [, selector] ) 7959 for (type in types) { 7960 this.off(type, selector, types[type]); 7961 } 7962 return this; 7963 } 7964 if (selector === false || typeof selector === "function") { 7965 // ( types [, fn] ) 7966 fn = selector; 7967 selector = undefined; 7968 } 7969 if (fn === false) { 7970 fn = returnFalse; 7971 } 7972 return this.each(function () { 7973 _jQuery2.event.remove(this, types, fn, selector); 7974 }); 7975 } 7976 }); 7977 var 7978 // Support: IE <=10 - 11, Edge 12 - 13 only 7979 // In IE/Edge using regex groups here causes severe slowdowns. 7980 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 7981 rnoInnerhtml = /<script|<style|<link/i, 7982 // checked="checked" or checked 7983 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 7984 rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g; 7985 7986 // Prefer a tbody over its parent table for containing new rows 7987 function manipulationTarget(elem, content) { 7988 if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) { 7989 return _jQuery2(elem).children("tbody")[0] || elem; 7990 } 7991 return elem; 7992 } 7993 7994 // Replace/restore the type attribute of script elements for safe DOM manipulation 7995 function disableScript(elem) { 7996 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; 7997 return elem; 7998 } 7999 function restoreScript(elem) { 8000 if ((elem.type || "").slice(0, 5) === "true/") { 8001 elem.type = elem.type.slice(5); 8002 } else { 8003 elem.removeAttribute("type"); 8004 } 8005 return elem; 8006 } 8007 function cloneCopyEvent(src, dest) { 8008 var i, l, type, pdataOld, udataOld, udataCur, events; 8009 if (dest.nodeType !== 1) { 8010 return; 8011 } 8012 8013 // 1. Copy private data: events, handlers, etc. 8014 if (dataPriv.hasData(src)) { 8015 pdataOld = dataPriv.get(src); 8016 events = pdataOld.events; 8017 if (events) { 8018 dataPriv.remove(dest, "handle events"); 8019 for (type in events) { 8020 for (i = 0, l = events[type].length; i < l; i++) { 8021 _jQuery2.event.add(dest, type, events[type][i]); 8022 } 8023 } 8024 } 8025 } 8026 8027 // 2. Copy user data 8028 if (dataUser.hasData(src)) { 8029 udataOld = dataUser.access(src); 8030 udataCur = _jQuery2.extend({}, udataOld); 8031 dataUser.set(dest, udataCur); 8032 } 8033 } 8034 8035 // Fix IE bugs, see support tests 8036 function fixInput(src, dest) { 8037 var nodeName = dest.nodeName.toLowerCase(); 8038 8039 // Fails to persist the checked state of a cloned checkbox or radio button. 8040 if (nodeName === "input" && rcheckableType.test(src.type)) { 8041 dest.checked = src.checked; 8042 8043 // Fails to return the selected option to the default selected state when cloning options 8044 } else if (nodeName === "input" || nodeName === "textarea") { 8045 dest.defaultValue = src.defaultValue; 8046 } 8047 } 8048 function domManip(collection, args, callback, ignored) { 8049 // Flatten any nested arrays 8050 args = flat(args); 8051 var fragment, 8052 first, 8053 scripts, 8054 hasScripts, 8055 node, 8056 doc, 8057 i = 0, 8058 l = collection.length, 8059 iNoClone = l - 1, 8060 value = args[0], 8061 valueIsFunction = isFunction(value); 8062 8063 // We can't cloneNode fragments that contain checked, in WebKit 8064 if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) { 8065 return collection.each(function (index) { 8066 var self = collection.eq(index); 8067 if (valueIsFunction) { 8068 args[0] = value.call(this, index, self.html()); 8069 } 8070 domManip(self, args, callback, ignored); 8071 }); 8072 } 8073 if (l) { 8074 fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored); 8075 first = fragment.firstChild; 8076 if (fragment.childNodes.length === 1) { 8077 fragment = first; 8078 } 8079 8080 // Require either new content or an interest in ignored elements to invoke the callback 8081 if (first || ignored) { 8082 scripts = _jQuery2.map(getAll(fragment, "script"), disableScript); 8083 hasScripts = scripts.length; 8084 8085 // Use the original fragment for the last item 8086 // instead of the first because it can end up 8087 // being emptied incorrectly in certain situations (trac-8070). 8088 for (; i < l; i++) { 8089 node = fragment; 8090 if (i !== iNoClone) { 8091 node = _jQuery2.clone(node, true, true); 8092 8093 // Keep references to cloned scripts for later restoration 8094 if (hasScripts) { 8095 // Support: Android <=4.0 only, PhantomJS 1 only 8096 // push.apply(_, arraylike) throws on ancient WebKit 8097 _jQuery2.merge(scripts, getAll(node, "script")); 8098 } 8099 } 8100 callback.call(collection[i], node, i); 8101 } 8102 if (hasScripts) { 8103 doc = scripts[scripts.length - 1].ownerDocument; 8104 8105 // Re-enable scripts 8106 _jQuery2.map(scripts, restoreScript); 8107 8108 // Evaluate executable scripts on first document insertion 8109 for (i = 0; i < hasScripts; i++) { 8110 node = scripts[i]; 8111 if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && _jQuery2.contains(doc, node)) { 8112 if (node.src && (node.type || "").toLowerCase() !== "module") { 8113 // Optional AJAX dependency, but won't run scripts if not present 8114 if (_jQuery2._evalUrl && !node.noModule) { 8115 _jQuery2._evalUrl(node.src, { 8116 nonce: node.nonce || node.getAttribute("nonce") 8117 }, doc); 8118 } 8119 } else { 8120 // Unwrap a CDATA section containing script contents. This shouldn't be 8121 // needed as in XML documents they're already not visible when 8122 // inspecting element contents and in HTML documents they have no 8123 // meaning but we're preserving that logic for backwards compatibility. 8124 // This will be removed completely in 4.0. See gh-4904. 8125 DOMEval(node.textContent.replace(rcleanScript, ""), node, doc); 8126 } 8127 } 8128 } 8129 } 8130 } 8131 } 8132 return collection; 8133 } 8134 function _remove(elem, selector, keepData) { 8135 var node, 8136 nodes = selector ? _jQuery2.filter(selector, elem) : elem, 8137 i = 0; 8138 for (; (node = nodes[i]) != null; i++) { 8139 if (!keepData && node.nodeType === 1) { 8140 _jQuery2.cleanData(getAll(node)); 8141 } 8142 if (node.parentNode) { 8143 if (keepData && isAttached(node)) { 8144 setGlobalEval(getAll(node, "script")); 8145 } 8146 node.parentNode.removeChild(node); 8147 } 8148 } 8149 return elem; 8150 } 8151 _jQuery2.extend({ 8152 htmlPrefilter: function htmlPrefilter(html) { 8153 return html; 8154 }, 8155 clone: function clone(elem, dataAndEvents, deepDataAndEvents) { 8156 var i, 8157 l, 8158 srcElements, 8159 destElements, 8160 clone = elem.cloneNode(true), 8161 inPage = isAttached(elem); 8162 8163 // Fix IE cloning issues 8164 if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !_jQuery2.isXMLDoc(elem)) { 8165 // We eschew jQuery#find here for performance reasons: 8166 // https://jsperf.com/getall-vs-sizzle/2 8167 destElements = getAll(clone); 8168 srcElements = getAll(elem); 8169 for (i = 0, l = srcElements.length; i < l; i++) { 8170 fixInput(srcElements[i], destElements[i]); 8171 } 8172 } 8173 8174 // Copy the events from the original to the clone 8175 if (dataAndEvents) { 8176 if (deepDataAndEvents) { 8177 srcElements = srcElements || getAll(elem); 8178 destElements = destElements || getAll(clone); 8179 for (i = 0, l = srcElements.length; i < l; i++) { 8180 cloneCopyEvent(srcElements[i], destElements[i]); 8181 } 8182 } else { 8183 cloneCopyEvent(elem, clone); 8184 } 8185 } 8186 8187 // Preserve script evaluation history 8188 destElements = getAll(clone, "script"); 8189 if (destElements.length > 0) { 8190 setGlobalEval(destElements, !inPage && getAll(elem, "script")); 8191 } 8192 8193 // Return the cloned set 8194 return clone; 8195 }, 8196 cleanData: function cleanData(elems) { 8197 var data, 8198 elem, 8199 type, 8200 special = _jQuery2.event.special, 8201 i = 0; 8202 for (; (elem = elems[i]) !== undefined; i++) { 8203 if (acceptData(elem)) { 8204 if (data = elem[dataPriv.expando]) { 8205 if (data.events) { 8206 for (type in data.events) { 8207 if (special[type]) { 8208 _jQuery2.event.remove(elem, type); 8209 8210 // This is a shortcut to avoid jQuery.event.remove's overhead 8211 } else { 8212 _jQuery2.removeEvent(elem, type, data.handle); 8213 } 8214 } 8215 } 8216 8217 // Support: Chrome <=35 - 45+ 8218 // Assign undefined instead of using delete, see Data#remove 8219 elem[dataPriv.expando] = undefined; 8220 } 8221 if (elem[dataUser.expando]) { 8222 // Support: Chrome <=35 - 45+ 8223 // Assign undefined instead of using delete, see Data#remove 8224 elem[dataUser.expando] = undefined; 8225 } 8226 } 8227 } 8228 } 8229 }); 8230 _jQuery2.fn.extend({ 8231 detach: function detach(selector) { 8232 return _remove(this, selector, true); 8233 }, 8234 remove: function remove(selector) { 8235 return _remove(this, selector); 8236 }, 8237 text: function text(value) { 8238 return _access(this, function (value) { 8239 return value === undefined ? _jQuery2.text(this) : this.empty().each(function () { 8240 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 8241 this.textContent = value; 8242 } 8243 }); 8244 }, null, value, arguments.length); 8245 }, 8246 append: function append() { 8247 return domManip(this, arguments, function (elem) { 8248 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 8249 var target = manipulationTarget(this, elem); 8250 target.appendChild(elem); 8251 } 8252 }); 8253 }, 8254 prepend: function prepend() { 8255 return domManip(this, arguments, function (elem) { 8256 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 8257 var target = manipulationTarget(this, elem); 8258 target.insertBefore(elem, target.firstChild); 8259 } 8260 }); 8261 }, 8262 before: function before() { 8263 return domManip(this, arguments, function (elem) { 8264 if (this.parentNode) { 8265 this.parentNode.insertBefore(elem, this); 8266 } 8267 }); 8268 }, 8269 after: function after() { 8270 return domManip(this, arguments, function (elem) { 8271 if (this.parentNode) { 8272 this.parentNode.insertBefore(elem, this.nextSibling); 8273 } 8274 }); 8275 }, 8276 empty: function empty() { 8277 var elem, 8278 i = 0; 8279 for (; (elem = this[i]) != null; i++) { 8280 if (elem.nodeType === 1) { 8281 // Prevent memory leaks 8282 _jQuery2.cleanData(getAll(elem, false)); 8283 8284 // Remove any remaining nodes 8285 elem.textContent = ""; 8286 } 8287 } 8288 return this; 8289 }, 8290 clone: function clone(dataAndEvents, deepDataAndEvents) { 8291 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 8292 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 8293 return this.map(function () { 8294 return _jQuery2.clone(this, dataAndEvents, deepDataAndEvents); 8295 }); 8296 }, 8297 html: function html(value) { 8298 return _access(this, function (value) { 8299 var elem = this[0] || {}, 8300 i = 0, 8301 l = this.length; 8302 if (value === undefined && elem.nodeType === 1) { 8303 return elem.innerHTML; 8304 } 8305 8306 // See if we can take a shortcut and just use innerHTML 8307 if (typeof value === "string" && !rnoInnerhtml.test(value) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) { 8308 value = _jQuery2.htmlPrefilter(value); 8309 try { 8310 for (; i < l; i++) { 8311 elem = this[i] || {}; 8312 8313 // Remove element nodes and prevent memory leaks 8314 if (elem.nodeType === 1) { 8315 _jQuery2.cleanData(getAll(elem, false)); 8316 elem.innerHTML = value; 8317 } 8318 } 8319 elem = 0; 8320 8321 // If using innerHTML throws an exception, use the fallback method 8322 } catch (e) {} 8323 } 8324 if (elem) { 8325 this.empty().append(value); 8326 } 8327 }, null, value, arguments.length); 8328 }, 8329 replaceWith: function replaceWith() { 8330 var ignored = []; 8331 8332 // Make the changes, replacing each non-ignored context element with the new content 8333 return domManip(this, arguments, function (elem) { 8334 var parent = this.parentNode; 8335 if (_jQuery2.inArray(this, ignored) < 0) { 8336 _jQuery2.cleanData(getAll(this)); 8337 if (parent) { 8338 parent.replaceChild(elem, this); 8339 } 8340 } 8341 8342 // Force callback invocation 8343 }, ignored); 8344 } 8345 }); 8346 _jQuery2.each({ 8347 appendTo: "append", 8348 prependTo: "prepend", 8349 insertBefore: "before", 8350 insertAfter: "after", 8351 replaceAll: "replaceWith" 8352 }, function (name, original) { 8353 _jQuery2.fn[name] = function (selector) { 8354 var elems, 8355 ret = [], 8356 insert = _jQuery2(selector), 8357 last = insert.length - 1, 8358 i = 0; 8359 for (; i <= last; i++) { 8360 elems = i === last ? this : this.clone(true); 8361 _jQuery2(insert[i])[original](elems); 8362 8363 // Support: Android <=4.0 only, PhantomJS 1 only 8364 // .get() because push.apply(_, arraylike) throws on ancient WebKit 8365 push.apply(ret, elems.get()); 8366 } 8367 return this.pushStack(ret); 8368 }; 8369 }); 8370 var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i"); 8371 var rcustomProp = /^--/; 8372 var getStyles = function getStyles(elem) { 8373 // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) 8374 // IE throws on elements created in popups 8375 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 8376 var view = elem.ownerDocument.defaultView; 8377 if (!view || !view.opener) { 8378 view = window; 8379 } 8380 return view.getComputedStyle(elem); 8381 }; 8382 var swap = function swap(elem, options, callback) { 8383 var ret, 8384 name, 8385 old = {}; 8386 8387 // Remember the old values, and insert the new ones 8388 for (name in options) { 8389 old[name] = elem.style[name]; 8390 elem.style[name] = options[name]; 8391 } 8392 ret = callback.call(elem); 8393 8394 // Revert the old values 8395 for (name in options) { 8396 elem.style[name] = old[name]; 8397 } 8398 return ret; 8399 }; 8400 var rboxStyle = new RegExp(cssExpand.join("|"), "i"); 8401 (function () { 8402 // Executing both pixelPosition & boxSizingReliable tests require only one layout 8403 // so they're executed at the same time to save the second computation. 8404 function computeStyleTests() { 8405 // This is a singleton, we need to execute it only once 8406 if (!div) { 8407 return; 8408 } 8409 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + "margin-top:1px;padding:0;border:0"; 8410 div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + "margin:auto;border:1px;padding:1px;" + "width:60%;top:1%"; 8411 documentElement.appendChild(container).appendChild(div); 8412 var divStyle = window.getComputedStyle(div); 8413 pixelPositionVal = divStyle.top !== "1%"; 8414 8415 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 8416 reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; 8417 8418 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 8419 // Some styles come back with percentage values, even though they shouldn't 8420 div.style.right = "60%"; 8421 pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; 8422 8423 // Support: IE 9 - 11 only 8424 // Detect misreporting of content dimensions for box-sizing:border-box elements 8425 boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; 8426 8427 // Support: IE 9 only 8428 // Detect overflow:scroll screwiness (gh-3699) 8429 // Support: Chrome <=64 8430 // Don't get tricked when zoom affects offsetWidth (gh-4029) 8431 div.style.position = "absolute"; 8432 scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12; 8433 documentElement.removeChild(container); 8434 8435 // Nullify the div so it wouldn't be stored in the memory and 8436 // it will also be a sign that checks already performed 8437 div = null; 8438 } 8439 function roundPixelMeasures(measure) { 8440 return Math.round(parseFloat(measure)); 8441 } 8442 var pixelPositionVal, 8443 boxSizingReliableVal, 8444 scrollboxSizeVal, 8445 pixelBoxStylesVal, 8446 reliableTrDimensionsVal, 8447 reliableMarginLeftVal, 8448 container = document.createElement("div"), 8449 div = document.createElement("div"); 8450 8451 // Finish early in limited (non-browser) environments 8452 if (!div.style) { 8453 return; 8454 } 8455 8456 // Support: IE <=9 - 11 only 8457 // Style of cloned element affects source element cloned (trac-8908) 8458 div.style.backgroundClip = "content-box"; 8459 div.cloneNode(true).style.backgroundClip = ""; 8460 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 8461 _jQuery2.extend(support, { 8462 boxSizingReliable: function boxSizingReliable() { 8463 computeStyleTests(); 8464 return boxSizingReliableVal; 8465 }, 8466 pixelBoxStyles: function pixelBoxStyles() { 8467 computeStyleTests(); 8468 return pixelBoxStylesVal; 8469 }, 8470 pixelPosition: function pixelPosition() { 8471 computeStyleTests(); 8472 return pixelPositionVal; 8473 }, 8474 reliableMarginLeft: function reliableMarginLeft() { 8475 computeStyleTests(); 8476 return reliableMarginLeftVal; 8477 }, 8478 scrollboxSize: function scrollboxSize() { 8479 computeStyleTests(); 8480 return scrollboxSizeVal; 8481 }, 8482 // Support: IE 9 - 11+, Edge 15 - 18+ 8483 // IE/Edge misreport `getComputedStyle` of table rows with width/height 8484 // set in CSS while `offset*` properties report correct values. 8485 // Behavior in IE 9 is more subtle than in newer versions & it passes 8486 // some versions of this test; make sure not to make it pass there! 8487 // 8488 // Support: Firefox 70+ 8489 // Only Firefox includes border widths 8490 // in computed dimensions. (gh-4529) 8491 reliableTrDimensions: function reliableTrDimensions() { 8492 var table, tr, trChild, trStyle; 8493 if (reliableTrDimensionsVal == null) { 8494 table = document.createElement("table"); 8495 tr = document.createElement("tr"); 8496 trChild = document.createElement("div"); 8497 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 8498 tr.style.cssText = "box-sizing:content-box;border:1px solid"; 8499 8500 // Support: Chrome 86+ 8501 // Height set through cssText does not get applied. 8502 // Computed height then comes back as 0. 8503 tr.style.height = "1px"; 8504 trChild.style.height = "9px"; 8505 8506 // Support: Android 8 Chrome 86+ 8507 // In our bodyBackground.html iframe, 8508 // display for all div elements is set to "inline", 8509 // which causes a problem only in Android 8 Chrome 86. 8510 // Ensuring the div is `display: block` 8511 // gets around this issue. 8512 trChild.style.display = "block"; 8513 documentElement.appendChild(table).appendChild(tr).appendChild(trChild); 8514 trStyle = window.getComputedStyle(tr); 8515 reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight; 8516 documentElement.removeChild(table); 8517 } 8518 return reliableTrDimensionsVal; 8519 } 8520 }); 8521 })(); 8522 function curCSS(elem, name, computed) { 8523 var width, 8524 minWidth, 8525 maxWidth, 8526 ret, 8527 isCustomProp = rcustomProp.test(name), 8528 // Support: Firefox 51+ 8529 // Retrieving style before computed somehow 8530 // fixes an issue with getting wrong values 8531 // on detached elements 8532 style = elem.style; 8533 computed = computed || getStyles(elem); 8534 8535 // getPropertyValue is needed for: 8536 // .css('filter') (IE 9 only, trac-12537) 8537 // .css('--customProperty) (gh-3144) 8538 if (computed) { 8539 // Support: IE <=9 - 11+ 8540 // IE only supports `"float"` in `getPropertyValue`; in computed styles 8541 // it's only available as `"cssFloat"`. We no longer modify properties 8542 // sent to `.css()` apart from camelCasing, so we need to check both. 8543 // Normally, this would create difference in behavior: if 8544 // `getPropertyValue` returns an empty string, the value returned 8545 // by `.css()` would be `undefined`. This is usually the case for 8546 // disconnected elements. However, in IE even disconnected elements 8547 // with no styles return `"none"` for `getPropertyValue( "float" )` 8548 ret = computed.getPropertyValue(name) || computed[name]; 8549 if (isCustomProp && ret) { 8550 // Support: Firefox 105+, Chrome <=105+ 8551 // Spec requires trimming whitespace for custom properties (gh-4926). 8552 // Firefox only trims leading whitespace. Chrome just collapses 8553 // both leading & trailing whitespace to a single space. 8554 // 8555 // Fall back to `undefined` if empty string returned. 8556 // This collapses a missing definition with property defined 8557 // and set to an empty string but there's no standard API 8558 // allowing us to differentiate them without a performance penalty 8559 // and returning `undefined` aligns with older jQuery. 8560 // 8561 // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED 8562 // as whitespace while CSS does not, but this is not a problem 8563 // because CSS preprocessing replaces them with U+000A LINE FEED 8564 // (which *is* CSS whitespace) 8565 // https://www.w3.org/TR/css-syntax-3/#input-preprocessing 8566 ret = ret.replace(rtrimCSS, "$1") || undefined; 8567 } 8568 if (ret === "" && !isAttached(elem)) { 8569 ret = _jQuery2.style(elem, name); 8570 } 8571 8572 // A tribute to the "awesome hack by Dean Edwards" 8573 // Android Browser returns percentage for some values, 8574 // but width seems to be reliably pixels. 8575 // This is against the CSSOM draft spec: 8576 // https://drafts.csswg.org/cssom/#resolved-values 8577 if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) { 8578 // Remember the original values 8579 width = style.width; 8580 minWidth = style.minWidth; 8581 maxWidth = style.maxWidth; 8582 8583 // Put in the new values to get a computed value out 8584 style.minWidth = style.maxWidth = style.width = ret; 8585 ret = computed.width; 8586 8587 // Revert the changed values 8588 style.width = width; 8589 style.minWidth = minWidth; 8590 style.maxWidth = maxWidth; 8591 } 8592 } 8593 return ret !== undefined ? 8594 // Support: IE <=9 - 11 only 8595 // IE returns zIndex value as an integer. 8596 ret + "" : ret; 8597 } 8598 function addGetHookIf(conditionFn, hookFn) { 8599 // Define the hook, we'll check on the first run if it's really needed. 8600 return { 8601 get: function get() { 8602 if (conditionFn()) { 8603 // Hook not needed (or it's not possible to use it due 8604 // to missing dependency), remove it. 8605 delete this.get; 8606 return; 8607 } 8608 8609 // Hook needed; redefine it so that the support test is not executed again. 8610 return (this.get = hookFn).apply(this, arguments); 8611 } 8612 }; 8613 } 8614 var cssPrefixes = ["Webkit", "Moz", "ms"], 8615 emptyStyle = document.createElement("div").style, 8616 vendorProps = {}; 8617 8618 // Return a vendor-prefixed property or undefined 8619 function vendorPropName(name) { 8620 // Check for vendor prefixed names 8621 var capName = name[0].toUpperCase() + name.slice(1), 8622 i = cssPrefixes.length; 8623 while (i--) { 8624 name = cssPrefixes[i] + capName; 8625 if (name in emptyStyle) { 8626 return name; 8627 } 8628 } 8629 } 8630 8631 // Return a potentially-mapped jQuery.cssProps or vendor prefixed property 8632 function finalPropName(name) { 8633 var _final = _jQuery2.cssProps[name] || vendorProps[name]; 8634 if (_final) { 8635 return _final; 8636 } 8637 if (name in emptyStyle) { 8638 return name; 8639 } 8640 return vendorProps[name] = vendorPropName(name) || name; 8641 } 8642 var 8643 // Swappable if display is none or starts with table 8644 // except "table", "table-cell", or "table-caption" 8645 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 8646 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 8647 cssShow = { 8648 position: "absolute", 8649 visibility: "hidden", 8650 display: "block" 8651 }, 8652 cssNormalTransform = { 8653 letterSpacing: "0", 8654 fontWeight: "400" 8655 }; 8656 function setPositiveNumber(_elem, value, subtract) { 8657 // Any relative (+/-) values have already been 8658 // normalized at this point 8659 var matches = rcssNum.exec(value); 8660 return matches ? 8661 // Guard against undefined "subtract", e.g., when used as in cssHooks 8662 Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") : value; 8663 } 8664 function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) { 8665 var i = dimension === "width" ? 1 : 0, 8666 extra = 0, 8667 delta = 0, 8668 marginDelta = 0; 8669 8670 // Adjustment may not be necessary 8671 if (box === (isBorderBox ? "border" : "content")) { 8672 return 0; 8673 } 8674 for (; i < 4; i += 2) { 8675 // Both box models exclude margin 8676 // Count margin delta separately to only add it after scroll gutter adjustment. 8677 // This is needed to make negative margins work with `outerHeight( true )` (gh-3982). 8678 if (box === "margin") { 8679 marginDelta += _jQuery2.css(elem, box + cssExpand[i], true, styles); 8680 } 8681 8682 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 8683 if (!isBorderBox) { 8684 // Add padding 8685 delta += _jQuery2.css(elem, "padding" + cssExpand[i], true, styles); 8686 8687 // For "border" or "margin", add border 8688 if (box !== "padding") { 8689 delta += _jQuery2.css(elem, "border" + cssExpand[i] + "Width", true, styles); 8690 8691 // But still keep track of it otherwise 8692 } else { 8693 extra += _jQuery2.css(elem, "border" + cssExpand[i] + "Width", true, styles); 8694 } 8695 8696 // If we get here with a border-box (content + padding + border), we're seeking "content" or 8697 // "padding" or "margin" 8698 } else { 8699 // For "content", subtract padding 8700 if (box === "content") { 8701 delta -= _jQuery2.css(elem, "padding" + cssExpand[i], true, styles); 8702 } 8703 8704 // For "content" or "padding", subtract border 8705 if (box !== "margin") { 8706 delta -= _jQuery2.css(elem, "border" + cssExpand[i] + "Width", true, styles); 8707 } 8708 } 8709 } 8710 8711 // Account for positive content-box scroll gutter when requested by providing computedVal 8712 if (!isBorderBox && computedVal >= 0) { 8713 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 8714 // Assuming integer scroll gutter, subtract the rest and round down 8715 delta += Math.max(0, Math.ceil(elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5 8716 8717 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 8718 // Use an explicit zero to avoid NaN (gh-3964) 8719 )) || 0; 8720 } 8721 return delta + marginDelta; 8722 } 8723 function getWidthOrHeight(elem, dimension, extra) { 8724 // Start with computed style 8725 var styles = getStyles(elem), 8726 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 8727 // Fake content-box until we know it's needed to know the true value. 8728 boxSizingNeeded = !support.boxSizingReliable() || extra, 8729 isBorderBox = boxSizingNeeded && _jQuery2.css(elem, "boxSizing", false, styles) === "border-box", 8730 valueIsBorderBox = isBorderBox, 8731 val = curCSS(elem, dimension, styles), 8732 offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1); 8733 8734 // Support: Firefox <=54 8735 // Return a confounding non-pixel value or feign ignorance, as appropriate. 8736 if (rnumnonpx.test(val)) { 8737 if (!extra) { 8738 return val; 8739 } 8740 val = "auto"; 8741 } 8742 8743 // Support: IE 9 - 11 only 8744 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 8745 // In those cases, the computed value can be trusted to be border-box. 8746 if ((!support.boxSizingReliable() && isBorderBox || 8747 // Support: IE 10 - 11+, Edge 15 - 18+ 8748 // IE/Edge misreport `getComputedStyle` of table rows with width/height 8749 // set in CSS while `offset*` properties report correct values. 8750 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 8751 !support.reliableTrDimensions() && nodeName(elem, "tr") || 8752 // Fall back to offsetWidth/offsetHeight when value is "auto" 8753 // This happens for inline elements with no explicit setting (gh-3571) 8754 val === "auto" || 8755 // Support: Android <=4.1 - 4.3 only 8756 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 8757 !parseFloat(val) && _jQuery2.css(elem, "display", false, styles) === "inline") && 8758 // Make sure the element is visible & connected 8759 elem.getClientRects().length) { 8760 isBorderBox = _jQuery2.css(elem, "boxSizing", false, styles) === "border-box"; 8761 8762 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 8763 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 8764 // retrieved value as a content box dimension. 8765 valueIsBorderBox = offsetProp in elem; 8766 if (valueIsBorderBox) { 8767 val = elem[offsetProp]; 8768 } 8769 } 8770 8771 // Normalize "" and auto 8772 val = parseFloat(val) || 0; 8773 8774 // Adjust for the element's box model 8775 return val + boxModelAdjustment(elem, dimension, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles, 8776 // Provide the current computed size to request scroll gutter calculation (gh-3589) 8777 val) + "px"; 8778 } 8779 _jQuery2.extend({ 8780 // Add in style property hooks for overriding the default 8781 // behavior of getting and setting a style property 8782 cssHooks: { 8783 opacity: { 8784 get: function get(elem, computed) { 8785 if (computed) { 8786 // We should always get a number back from opacity 8787 var ret = curCSS(elem, "opacity"); 8788 return ret === "" ? "1" : ret; 8789 } 8790 } 8791 } 8792 }, 8793 // Don't automatically add "px" to these possibly-unitless properties 8794 cssNumber: { 8795 animationIterationCount: true, 8796 aspectRatio: true, 8797 borderImageSlice: true, 8798 columnCount: true, 8799 flexGrow: true, 8800 flexShrink: true, 8801 fontWeight: true, 8802 gridArea: true, 8803 gridColumn: true, 8804 gridColumnEnd: true, 8805 gridColumnStart: true, 8806 gridRow: true, 8807 gridRowEnd: true, 8808 gridRowStart: true, 8809 lineHeight: true, 8810 opacity: true, 8811 order: true, 8812 orphans: true, 8813 scale: true, 8814 widows: true, 8815 zIndex: true, 8816 zoom: true, 8817 // SVG-related 8818 fillOpacity: true, 8819 floodOpacity: true, 8820 stopOpacity: true, 8821 strokeMiterlimit: true, 8822 strokeOpacity: true 8823 }, 8824 // Add in properties whose names you wish to fix before 8825 // setting or getting the value 8826 cssProps: {}, 8827 // Get and set the style property on a DOM Node 8828 style: function style(elem, name, value, extra) { 8829 // Don't set styles on text and comment nodes 8830 if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) { 8831 return; 8832 } 8833 8834 // Make sure that we're working with the right name 8835 var ret, 8836 type, 8837 hooks, 8838 origName = camelCase(name), 8839 isCustomProp = rcustomProp.test(name), 8840 style = elem.style; 8841 8842 // Make sure that we're working with the right name. We don't 8843 // want to query the value if it is a CSS custom property 8844 // since they are user-defined. 8845 if (!isCustomProp) { 8846 name = finalPropName(origName); 8847 } 8848 8849 // Gets hook for the prefixed version, then unprefixed version 8850 hooks = _jQuery2.cssHooks[name] || _jQuery2.cssHooks[origName]; 8851 8852 // Check if we're setting a value 8853 if (value !== undefined) { 8854 type = _typeof(value); 8855 8856 // Convert "+=" or "-=" to relative numbers (trac-7345) 8857 if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) { 8858 value = adjustCSS(elem, name, ret); 8859 8860 // Fixes bug trac-9237 8861 type = "number"; 8862 } 8863 8864 // Make sure that null and NaN values aren't set (trac-7116) 8865 if (value == null || value !== value) { 8866 return; 8867 } 8868 8869 // If a number was passed in, add the unit (except for certain CSS properties) 8870 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 8871 // "px" to a few hardcoded values. 8872 if (type === "number" && !isCustomProp) { 8873 value += ret && ret[3] || (_jQuery2.cssNumber[origName] ? "" : "px"); 8874 } 8875 8876 // background-* props affect original clone's values 8877 if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) { 8878 style[name] = "inherit"; 8879 } 8880 8881 // If a hook was provided, use that value, otherwise just set the specified value 8882 if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) { 8883 if (isCustomProp) { 8884 style.setProperty(name, value); 8885 } else { 8886 style[name] = value; 8887 } 8888 } 8889 } else { 8890 // If a hook was provided get the non-computed value from there 8891 if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) { 8892 return ret; 8893 } 8894 8895 // Otherwise just get the value from the style object 8896 return style[name]; 8897 } 8898 }, 8899 css: function css(elem, name, extra, styles) { 8900 var val, 8901 num, 8902 hooks, 8903 origName = camelCase(name), 8904 isCustomProp = rcustomProp.test(name); 8905 8906 // Make sure that we're working with the right name. We don't 8907 // want to modify the value if it is a CSS custom property 8908 // since they are user-defined. 8909 if (!isCustomProp) { 8910 name = finalPropName(origName); 8911 } 8912 8913 // Try prefixed name followed by the unprefixed name 8914 hooks = _jQuery2.cssHooks[name] || _jQuery2.cssHooks[origName]; 8915 8916 // If a hook was provided get the computed value from there 8917 if (hooks && "get" in hooks) { 8918 val = hooks.get(elem, true, extra); 8919 } 8920 8921 // Otherwise, if a way to get the computed value exists, use that 8922 if (val === undefined) { 8923 val = curCSS(elem, name, styles); 8924 } 8925 8926 // Convert "normal" to computed value 8927 if (val === "normal" && name in cssNormalTransform) { 8928 val = cssNormalTransform[name]; 8929 } 8930 8931 // Make numeric if forced or a qualifier was provided and val looks numeric 8932 if (extra === "" || extra) { 8933 num = parseFloat(val); 8934 return extra === true || isFinite(num) ? num || 0 : val; 8935 } 8936 return val; 8937 } 8938 }); 8939 _jQuery2.each(["height", "width"], function (_i, dimension) { 8940 _jQuery2.cssHooks[dimension] = { 8941 get: function get(elem, computed, extra) { 8942 if (computed) { 8943 // Certain elements can have dimension info if we invisibly show them 8944 // but it must have a current display style that would benefit 8945 return rdisplayswap.test(_jQuery2.css(elem, "display")) && ( 8946 // Support: Safari 8+ 8947 // Table columns in Safari have non-zero offsetWidth & zero 8948 // getBoundingClientRect().width unless display is changed. 8949 // Support: IE <=11 only 8950 // Running getBoundingClientRect on a disconnected node 8951 // in IE throws an error. 8952 !elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function () { 8953 return getWidthOrHeight(elem, dimension, extra); 8954 }) : getWidthOrHeight(elem, dimension, extra); 8955 } 8956 }, 8957 set: function set(elem, value, extra) { 8958 var matches, 8959 styles = getStyles(elem), 8960 // Only read styles.position if the test has a chance to fail 8961 // to avoid forcing a reflow. 8962 scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", 8963 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 8964 boxSizingNeeded = scrollboxSizeBuggy || extra, 8965 isBorderBox = boxSizingNeeded && _jQuery2.css(elem, "boxSizing", false, styles) === "border-box", 8966 subtract = extra ? boxModelAdjustment(elem, dimension, extra, isBorderBox, styles) : 0; 8967 8968 // Account for unreliable border-box dimensions by comparing offset* to computed and 8969 // faking a content-box to get border and padding (gh-3699) 8970 if (isBorderBox && scrollboxSizeBuggy) { 8971 subtract -= Math.ceil(elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5); 8972 } 8973 8974 // Convert to pixels if value adjustment is needed 8975 if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") { 8976 elem.style[dimension] = value; 8977 value = _jQuery2.css(elem, dimension); 8978 } 8979 return setPositiveNumber(elem, value, subtract); 8980 } 8981 }; 8982 }); 8983 _jQuery2.cssHooks.marginLeft = addGetHookIf(support.reliableMarginLeft, function (elem, computed) { 8984 if (computed) { 8985 return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { 8986 marginLeft: 0 8987 }, function () { 8988 return elem.getBoundingClientRect().left; 8989 })) + "px"; 8990 } 8991 }); 8992 8993 // These hooks are used by animate to expand properties 8994 _jQuery2.each({ 8995 margin: "", 8996 padding: "", 8997 border: "Width" 8998 }, function (prefix, suffix) { 8999 _jQuery2.cssHooks[prefix + suffix] = { 9000 expand: function expand(value) { 9001 var i = 0, 9002 expanded = {}, 9003 // Assumes a single number if not a string 9004 parts = typeof value === "string" ? value.split(" ") : [value]; 9005 for (; i < 4; i++) { 9006 expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; 9007 } 9008 return expanded; 9009 } 9010 }; 9011 if (prefix !== "margin") { 9012 _jQuery2.cssHooks[prefix + suffix].set = setPositiveNumber; 9013 } 9014 }); 9015 _jQuery2.fn.extend({ 9016 css: function css(name, value) { 9017 return _access(this, function (elem, name, value) { 9018 var styles, 9019 len, 9020 map = {}, 9021 i = 0; 9022 if (Array.isArray(name)) { 9023 styles = getStyles(elem); 9024 len = name.length; 9025 for (; i < len; i++) { 9026 map[name[i]] = _jQuery2.css(elem, name[i], false, styles); 9027 } 9028 return map; 9029 } 9030 return value !== undefined ? _jQuery2.style(elem, name, value) : _jQuery2.css(elem, name); 9031 }, name, value, arguments.length > 1); 9032 } 9033 }); 9034 function Tween(elem, options, prop, end, easing) { 9035 return new Tween.prototype.init(elem, options, prop, end, easing); 9036 } 9037 _jQuery2.Tween = Tween; 9038 Tween.prototype = { 9039 constructor: Tween, 9040 init: function init(elem, options, prop, end, easing, unit) { 9041 this.elem = elem; 9042 this.prop = prop; 9043 this.easing = easing || _jQuery2.easing._default; 9044 this.options = options; 9045 this.start = this.now = this.cur(); 9046 this.end = end; 9047 this.unit = unit || (_jQuery2.cssNumber[prop] ? "" : "px"); 9048 }, 9049 cur: function cur() { 9050 var hooks = Tween.propHooks[this.prop]; 9051 return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this); 9052 }, 9053 run: function run(percent) { 9054 var eased, 9055 hooks = Tween.propHooks[this.prop]; 9056 if (this.options.duration) { 9057 this.pos = eased = _jQuery2.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration); 9058 } else { 9059 this.pos = eased = percent; 9060 } 9061 this.now = (this.end - this.start) * eased + this.start; 9062 if (this.options.step) { 9063 this.options.step.call(this.elem, this.now, this); 9064 } 9065 if (hooks && hooks.set) { 9066 hooks.set(this); 9067 } else { 9068 Tween.propHooks._default.set(this); 9069 } 9070 return this; 9071 } 9072 }; 9073 Tween.prototype.init.prototype = Tween.prototype; 9074 Tween.propHooks = { 9075 _default: { 9076 get: function get(tween) { 9077 var result; 9078 9079 // Use a property on the element directly when it is not a DOM element, 9080 // or when there is no matching style property that exists. 9081 if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) { 9082 return tween.elem[tween.prop]; 9083 } 9084 9085 // Passing an empty string as a 3rd parameter to .css will automatically 9086 // attempt a parseFloat and fallback to a string if the parse fails. 9087 // Simple values such as "10px" are parsed to Float; 9088 // complex values such as "rotate(1rad)" are returned as-is. 9089 result = _jQuery2.css(tween.elem, tween.prop, ""); 9090 9091 // Empty strings, null, undefined and "auto" are converted to 0. 9092 return !result || result === "auto" ? 0 : result; 9093 }, 9094 set: function set(tween) { 9095 // Use step hook for back compat. 9096 // Use cssHook if its there. 9097 // Use .style if available and use plain properties where available. 9098 if (_jQuery2.fx.step[tween.prop]) { 9099 _jQuery2.fx.step[tween.prop](tween); 9100 } else if (tween.elem.nodeType === 1 && (_jQuery2.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) { 9101 _jQuery2.style(tween.elem, tween.prop, tween.now + tween.unit); 9102 } else { 9103 tween.elem[tween.prop] = tween.now; 9104 } 9105 } 9106 } 9107 }; 9108 9109 // Support: IE <=9 only 9110 // Panic based approach to setting things on disconnected nodes 9111 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 9112 set: function set(tween) { 9113 if (tween.elem.nodeType && tween.elem.parentNode) { 9114 tween.elem[tween.prop] = tween.now; 9115 } 9116 } 9117 }; 9118 _jQuery2.easing = { 9119 linear: function linear(p) { 9120 return p; 9121 }, 9122 swing: function swing(p) { 9123 return 0.5 - Math.cos(p * Math.PI) / 2; 9124 }, 9125 _default: "swing" 9126 }; 9127 _jQuery2.fx = Tween.prototype.init; 9128 9129 // Back compat <1.8 extension point 9130 _jQuery2.fx.step = {}; 9131 var fxNow, 9132 inProgress, 9133 rfxtypes = /^(?:toggle|show|hide)$/, 9134 rrun = /queueHooks$/; 9135 function schedule() { 9136 if (inProgress) { 9137 if (document.hidden === false && window.requestAnimationFrame) { 9138 window.requestAnimationFrame(schedule); 9139 } else { 9140 window.setTimeout(schedule, _jQuery2.fx.interval); 9141 } 9142 _jQuery2.fx.tick(); 9143 } 9144 } 9145 9146 // Animations created synchronously will run synchronously 9147 function createFxNow() { 9148 window.setTimeout(function () { 9149 fxNow = undefined; 9150 }); 9151 return fxNow = Date.now(); 9152 } 9153 9154 // Generate parameters to create a standard animation 9155 function genFx(type, includeWidth) { 9156 var which, 9157 i = 0, 9158 attrs = { 9159 height: type 9160 }; 9161 9162 // If we include width, step value is 1 to do all cssExpand values, 9163 // otherwise step value is 2 to skip over Left and Right 9164 includeWidth = includeWidth ? 1 : 0; 9165 for (; i < 4; i += 2 - includeWidth) { 9166 which = cssExpand[i]; 9167 attrs["margin" + which] = attrs["padding" + which] = type; 9168 } 9169 if (includeWidth) { 9170 attrs.opacity = attrs.width = type; 9171 } 9172 return attrs; 9173 } 9174 function createTween(value, prop, animation) { 9175 var tween, 9176 collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), 9177 index = 0, 9178 length = collection.length; 9179 for (; index < length; index++) { 9180 if (tween = collection[index].call(animation, prop, value)) { 9181 // We're done with this property 9182 return tween; 9183 } 9184 } 9185 } 9186 function defaultPrefilter(elem, props, opts) { 9187 var prop, 9188 value, 9189 toggle, 9190 hooks, 9191 oldfire, 9192 propTween, 9193 restoreDisplay, 9194 display, 9195 isBox = "width" in props || "height" in props, 9196 anim = this, 9197 orig = {}, 9198 style = elem.style, 9199 hidden = elem.nodeType && isHiddenWithinTree(elem), 9200 dataShow = dataPriv.get(elem, "fxshow"); 9201 9202 // Queue-skipping animations hijack the fx hooks 9203 if (!opts.queue) { 9204 hooks = _jQuery2._queueHooks(elem, "fx"); 9205 if (hooks.unqueued == null) { 9206 hooks.unqueued = 0; 9207 oldfire = hooks.empty.fire; 9208 hooks.empty.fire = function () { 9209 if (!hooks.unqueued) { 9210 oldfire(); 9211 } 9212 }; 9213 } 9214 hooks.unqueued++; 9215 anim.always(function () { 9216 // Ensure the complete handler is called before this completes 9217 anim.always(function () { 9218 hooks.unqueued--; 9219 if (!_jQuery2.queue(elem, "fx").length) { 9220 hooks.empty.fire(); 9221 } 9222 }); 9223 }); 9224 } 9225 9226 // Detect show/hide animations 9227 for (prop in props) { 9228 value = props[prop]; 9229 if (rfxtypes.test(value)) { 9230 delete props[prop]; 9231 toggle = toggle || value === "toggle"; 9232 if (value === (hidden ? "hide" : "show")) { 9233 // Pretend to be hidden if this is a "show" and 9234 // there is still data from a stopped show/hide 9235 if (value === "show" && dataShow && dataShow[prop] !== undefined) { 9236 hidden = true; 9237 9238 // Ignore all other no-op show/hide data 9239 } else { 9240 continue; 9241 } 9242 } 9243 orig[prop] = dataShow && dataShow[prop] || _jQuery2.style(elem, prop); 9244 } 9245 } 9246 9247 // Bail out if this is a no-op like .hide().hide() 9248 propTween = !_jQuery2.isEmptyObject(props); 9249 if (!propTween && _jQuery2.isEmptyObject(orig)) { 9250 return; 9251 } 9252 9253 // Restrict "overflow" and "display" styles during box animations 9254 if (isBox && elem.nodeType === 1) { 9255 // Support: IE <=9 - 11, Edge 12 - 15 9256 // Record all 3 overflow attributes because IE does not infer the shorthand 9257 // from identically-valued overflowX and overflowY and Edge just mirrors 9258 // the overflowX value there. 9259 opts.overflow = [style.overflow, style.overflowX, style.overflowY]; 9260 9261 // Identify a display type, preferring old show/hide data over the CSS cascade 9262 restoreDisplay = dataShow && dataShow.display; 9263 if (restoreDisplay == null) { 9264 restoreDisplay = dataPriv.get(elem, "display"); 9265 } 9266 display = _jQuery2.css(elem, "display"); 9267 if (display === "none") { 9268 if (restoreDisplay) { 9269 display = restoreDisplay; 9270 } else { 9271 // Get nonempty value(s) by temporarily forcing visibility 9272 showHide([elem], true); 9273 restoreDisplay = elem.style.display || restoreDisplay; 9274 display = _jQuery2.css(elem, "display"); 9275 showHide([elem]); 9276 } 9277 } 9278 9279 // Animate inline elements as inline-block 9280 if (display === "inline" || display === "inline-block" && restoreDisplay != null) { 9281 if (_jQuery2.css(elem, "float") === "none") { 9282 // Restore the original display value at the end of pure show/hide animations 9283 if (!propTween) { 9284 anim.done(function () { 9285 style.display = restoreDisplay; 9286 }); 9287 if (restoreDisplay == null) { 9288 display = style.display; 9289 restoreDisplay = display === "none" ? "" : display; 9290 } 9291 } 9292 style.display = "inline-block"; 9293 } 9294 } 9295 } 9296 if (opts.overflow) { 9297 style.overflow = "hidden"; 9298 anim.always(function () { 9299 style.overflow = opts.overflow[0]; 9300 style.overflowX = opts.overflow[1]; 9301 style.overflowY = opts.overflow[2]; 9302 }); 9303 } 9304 9305 // Implement show/hide animations 9306 propTween = false; 9307 for (prop in orig) { 9308 // General show/hide setup for this element animation 9309 if (!propTween) { 9310 if (dataShow) { 9311 if ("hidden" in dataShow) { 9312 hidden = dataShow.hidden; 9313 } 9314 } else { 9315 dataShow = dataPriv.access(elem, "fxshow", { 9316 display: restoreDisplay 9317 }); 9318 } 9319 9320 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 9321 if (toggle) { 9322 dataShow.hidden = !hidden; 9323 } 9324 9325 // Show elements before animating them 9326 if (hidden) { 9327 showHide([elem], true); 9328 } 9329 9330 /* eslint-disable no-loop-func */ 9331 9332 anim.done(function () { 9333 /* eslint-enable no-loop-func */ 9334 9335 // The final step of a "hide" animation is actually hiding the element 9336 if (!hidden) { 9337 showHide([elem]); 9338 } 9339 dataPriv.remove(elem, "fxshow"); 9340 for (prop in orig) { 9341 _jQuery2.style(elem, prop, orig[prop]); 9342 } 9343 }); 9344 } 9345 9346 // Per-property setup 9347 propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim); 9348 if (!(prop in dataShow)) { 9349 dataShow[prop] = propTween.start; 9350 if (hidden) { 9351 propTween.end = propTween.start; 9352 propTween.start = 0; 9353 } 9354 } 9355 } 9356 } 9357 function propFilter(props, specialEasing) { 9358 var index, name, easing, value, hooks; 9359 9360 // camelCase, specialEasing and expand cssHook pass 9361 for (index in props) { 9362 name = camelCase(index); 9363 easing = specialEasing[name]; 9364 value = props[index]; 9365 if (Array.isArray(value)) { 9366 easing = value[1]; 9367 value = props[index] = value[0]; 9368 } 9369 if (index !== name) { 9370 props[name] = value; 9371 delete props[index]; 9372 } 9373 hooks = _jQuery2.cssHooks[name]; 9374 if (hooks && "expand" in hooks) { 9375 value = hooks.expand(value); 9376 delete props[name]; 9377 9378 // Not quite $.extend, this won't overwrite existing keys. 9379 // Reusing 'index' because we have the correct "name" 9380 for (index in value) { 9381 if (!(index in props)) { 9382 props[index] = value[index]; 9383 specialEasing[index] = easing; 9384 } 9385 } 9386 } else { 9387 specialEasing[name] = easing; 9388 } 9389 } 9390 } 9391 function Animation(elem, properties, options) { 9392 var result, 9393 stopped, 9394 index = 0, 9395 length = Animation.prefilters.length, 9396 deferred = _jQuery2.Deferred().always(function () { 9397 // Don't match elem in the :animated selector 9398 delete tick.elem; 9399 }), 9400 tick = function tick() { 9401 if (stopped) { 9402 return false; 9403 } 9404 var currentTime = fxNow || createFxNow(), 9405 remaining = Math.max(0, animation.startTime + animation.duration - currentTime), 9406 // Support: Android 2.3 only 9407 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497) 9408 temp = remaining / animation.duration || 0, 9409 percent = 1 - temp, 9410 index = 0, 9411 length = animation.tweens.length; 9412 for (; index < length; index++) { 9413 animation.tweens[index].run(percent); 9414 } 9415 deferred.notifyWith(elem, [animation, percent, remaining]); 9416 9417 // If there's more to do, yield 9418 if (percent < 1 && length) { 9419 return remaining; 9420 } 9421 9422 // If this was an empty animation, synthesize a final progress notification 9423 if (!length) { 9424 deferred.notifyWith(elem, [animation, 1, 0]); 9425 } 9426 9427 // Resolve the animation and report its conclusion 9428 deferred.resolveWith(elem, [animation]); 9429 return false; 9430 }, 9431 animation = deferred.promise({ 9432 elem: elem, 9433 props: _jQuery2.extend({}, properties), 9434 opts: _jQuery2.extend(true, { 9435 specialEasing: {}, 9436 easing: _jQuery2.easing._default 9437 }, options), 9438 originalProperties: properties, 9439 originalOptions: options, 9440 startTime: fxNow || createFxNow(), 9441 duration: options.duration, 9442 tweens: [], 9443 createTween: function createTween(prop, end) { 9444 var tween = _jQuery2.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing); 9445 animation.tweens.push(tween); 9446 return tween; 9447 }, 9448 stop: function stop(gotoEnd) { 9449 var index = 0, 9450 // If we are going to the end, we want to run all the tweens 9451 // otherwise we skip this part 9452 length = gotoEnd ? animation.tweens.length : 0; 9453 if (stopped) { 9454 return this; 9455 } 9456 stopped = true; 9457 for (; index < length; index++) { 9458 animation.tweens[index].run(1); 9459 } 9460 9461 // Resolve when we played the last frame; otherwise, reject 9462 if (gotoEnd) { 9463 deferred.notifyWith(elem, [animation, 1, 0]); 9464 deferred.resolveWith(elem, [animation, gotoEnd]); 9465 } else { 9466 deferred.rejectWith(elem, [animation, gotoEnd]); 9467 } 9468 return this; 9469 } 9470 }), 9471 props = animation.props; 9472 propFilter(props, animation.opts.specialEasing); 9473 for (; index < length; index++) { 9474 result = Animation.prefilters[index].call(animation, elem, props, animation.opts); 9475 if (result) { 9476 if (isFunction(result.stop)) { 9477 _jQuery2._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result); 9478 } 9479 return result; 9480 } 9481 } 9482 _jQuery2.map(props, createTween, animation); 9483 if (isFunction(animation.opts.start)) { 9484 animation.opts.start.call(elem, animation); 9485 } 9486 9487 // Attach callbacks from options 9488 animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always); 9489 _jQuery2.fx.timer(_jQuery2.extend(tick, { 9490 elem: elem, 9491 anim: animation, 9492 queue: animation.opts.queue 9493 })); 9494 return animation; 9495 } 9496 _jQuery2.Animation = _jQuery2.extend(Animation, { 9497 tweeners: { 9498 "*": [function (prop, value) { 9499 var tween = this.createTween(prop, value); 9500 adjustCSS(tween.elem, prop, rcssNum.exec(value), tween); 9501 return tween; 9502 }] 9503 }, 9504 tweener: function tweener(props, callback) { 9505 if (isFunction(props)) { 9506 callback = props; 9507 props = ["*"]; 9508 } else { 9509 props = props.match(rnothtmlwhite); 9510 } 9511 var prop, 9512 index = 0, 9513 length = props.length; 9514 for (; index < length; index++) { 9515 prop = props[index]; 9516 Animation.tweeners[prop] = Animation.tweeners[prop] || []; 9517 Animation.tweeners[prop].unshift(callback); 9518 } 9519 }, 9520 prefilters: [defaultPrefilter], 9521 prefilter: function prefilter(callback, prepend) { 9522 if (prepend) { 9523 Animation.prefilters.unshift(callback); 9524 } else { 9525 Animation.prefilters.push(callback); 9526 } 9527 } 9528 }); 9529 _jQuery2.speed = function (speed, easing, fn) { 9530 var opt = speed && _typeof(speed) === "object" ? _jQuery2.extend({}, speed) : { 9531 complete: fn || !fn && easing || isFunction(speed) && speed, 9532 duration: speed, 9533 easing: fn && easing || easing && !isFunction(easing) && easing 9534 }; 9535 9536 // Go to the end state if fx are off 9537 if (_jQuery2.fx.off) { 9538 opt.duration = 0; 9539 } else { 9540 if (typeof opt.duration !== "number") { 9541 if (opt.duration in _jQuery2.fx.speeds) { 9542 opt.duration = _jQuery2.fx.speeds[opt.duration]; 9543 } else { 9544 opt.duration = _jQuery2.fx.speeds._default; 9545 } 9546 } 9547 } 9548 9549 // Normalize opt.queue - true/undefined/null -> "fx" 9550 if (opt.queue == null || opt.queue === true) { 9551 opt.queue = "fx"; 9552 } 9553 9554 // Queueing 9555 opt.old = opt.complete; 9556 opt.complete = function () { 9557 if (isFunction(opt.old)) { 9558 opt.old.call(this); 9559 } 9560 if (opt.queue) { 9561 _jQuery2.dequeue(this, opt.queue); 9562 } 9563 }; 9564 return opt; 9565 }; 9566 _jQuery2.fn.extend({ 9567 fadeTo: function fadeTo(speed, to, easing, callback) { 9568 // Show any hidden elements after setting opacity to 0 9569 return this.filter(isHiddenWithinTree).css("opacity", 0).show() 9570 9571 // Animate to the value specified 9572 .end().animate({ 9573 opacity: to 9574 }, speed, easing, callback); 9575 }, 9576 animate: function animate(prop, speed, easing, callback) { 9577 var empty = _jQuery2.isEmptyObject(prop), 9578 optall = _jQuery2.speed(speed, easing, callback), 9579 doAnimation = function doAnimation() { 9580 // Operate on a copy of prop so per-property easing won't be lost 9581 var anim = Animation(this, _jQuery2.extend({}, prop), optall); 9582 9583 // Empty animations, or finishing resolves immediately 9584 if (empty || dataPriv.get(this, "finish")) { 9585 anim.stop(true); 9586 } 9587 }; 9588 doAnimation.finish = doAnimation; 9589 return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation); 9590 }, 9591 stop: function stop(type, clearQueue, gotoEnd) { 9592 var stopQueue = function stopQueue(hooks) { 9593 var stop = hooks.stop; 9594 delete hooks.stop; 9595 stop(gotoEnd); 9596 }; 9597 if (typeof type !== "string") { 9598 gotoEnd = clearQueue; 9599 clearQueue = type; 9600 type = undefined; 9601 } 9602 if (clearQueue) { 9603 this.queue(type || "fx", []); 9604 } 9605 return this.each(function () { 9606 var dequeue = true, 9607 index = type != null && type + "queueHooks", 9608 timers = _jQuery2.timers, 9609 data = dataPriv.get(this); 9610 if (index) { 9611 if (data[index] && data[index].stop) { 9612 stopQueue(data[index]); 9613 } 9614 } else { 9615 for (index in data) { 9616 if (data[index] && data[index].stop && rrun.test(index)) { 9617 stopQueue(data[index]); 9618 } 9619 } 9620 } 9621 for (index = timers.length; index--;) { 9622 if (timers[index].elem === this && (type == null || timers[index].queue === type)) { 9623 timers[index].anim.stop(gotoEnd); 9624 dequeue = false; 9625 timers.splice(index, 1); 9626 } 9627 } 9628 9629 // Start the next in the queue if the last step wasn't forced. 9630 // Timers currently will call their complete callbacks, which 9631 // will dequeue but only if they were gotoEnd. 9632 if (dequeue || !gotoEnd) { 9633 _jQuery2.dequeue(this, type); 9634 } 9635 }); 9636 }, 9637 finish: function finish(type) { 9638 if (type !== false) { 9639 type = type || "fx"; 9640 } 9641 return this.each(function () { 9642 var index, 9643 data = dataPriv.get(this), 9644 queue = data[type + "queue"], 9645 hooks = data[type + "queueHooks"], 9646 timers = _jQuery2.timers, 9647 length = queue ? queue.length : 0; 9648 9649 // Enable finishing flag on private data 9650 data.finish = true; 9651 9652 // Empty the queue first 9653 _jQuery2.queue(this, type, []); 9654 if (hooks && hooks.stop) { 9655 hooks.stop.call(this, true); 9656 } 9657 9658 // Look for any active animations, and finish them 9659 for (index = timers.length; index--;) { 9660 if (timers[index].elem === this && timers[index].queue === type) { 9661 timers[index].anim.stop(true); 9662 timers.splice(index, 1); 9663 } 9664 } 9665 9666 // Look for any animations in the old queue and finish them 9667 for (index = 0; index < length; index++) { 9668 if (queue[index] && queue[index].finish) { 9669 queue[index].finish.call(this); 9670 } 9671 } 9672 9673 // Turn off finishing flag 9674 delete data.finish; 9675 }); 9676 } 9677 }); 9678 _jQuery2.each(["toggle", "show", "hide"], function (_i, name) { 9679 var cssFn = _jQuery2.fn[name]; 9680 _jQuery2.fn[name] = function (speed, easing, callback) { 9681 return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback); 9682 }; 9683 }); 9684 9685 // Generate shortcuts for custom animations 9686 _jQuery2.each({ 9687 slideDown: genFx("show"), 9688 slideUp: genFx("hide"), 9689 slideToggle: genFx("toggle"), 9690 fadeIn: { 9691 opacity: "show" 9692 }, 9693 fadeOut: { 9694 opacity: "hide" 9695 }, 9696 fadeToggle: { 9697 opacity: "toggle" 9698 } 9699 }, function (name, props) { 9700 _jQuery2.fn[name] = function (speed, easing, callback) { 9701 return this.animate(props, speed, easing, callback); 9702 }; 9703 }); 9704 _jQuery2.timers = []; 9705 _jQuery2.fx.tick = function () { 9706 var timer, 9707 i = 0, 9708 timers = _jQuery2.timers; 9709 fxNow = Date.now(); 9710 for (; i < timers.length; i++) { 9711 timer = timers[i]; 9712 9713 // Run the timer and safely remove it when done (allowing for external removal) 9714 if (!timer() && timers[i] === timer) { 9715 timers.splice(i--, 1); 9716 } 9717 } 9718 if (!timers.length) { 9719 _jQuery2.fx.stop(); 9720 } 9721 fxNow = undefined; 9722 }; 9723 _jQuery2.fx.timer = function (timer) { 9724 _jQuery2.timers.push(timer); 9725 _jQuery2.fx.start(); 9726 }; 9727 _jQuery2.fx.interval = 13; 9728 _jQuery2.fx.start = function () { 9729 if (inProgress) { 9730 return; 9731 } 9732 inProgress = true; 9733 schedule(); 9734 }; 9735 _jQuery2.fx.stop = function () { 9736 inProgress = null; 9737 }; 9738 _jQuery2.fx.speeds = { 9739 slow: 600, 9740 fast: 200, 9741 // Default speed 9742 _default: 400 9743 }; 9744 9745 // Based off of the plugin by Clint Helfers, with permission. 9746 _jQuery2.fn.delay = function (time, type) { 9747 time = _jQuery2.fx ? _jQuery2.fx.speeds[time] || time : time; 9748 type = type || "fx"; 9749 return this.queue(type, function (next, hooks) { 9750 var timeout = window.setTimeout(next, time); 9751 hooks.stop = function () { 9752 window.clearTimeout(timeout); 9753 }; 9754 }); 9755 }; 9756 (function () { 9757 var input = document.createElement("input"), 9758 select = document.createElement("select"), 9759 opt = select.appendChild(document.createElement("option")); 9760 input.type = "checkbox"; 9761 9762 // Support: Android <=4.3 only 9763 // Default value for a checkbox should be "on" 9764 support.checkOn = input.value !== ""; 9765 9766 // Support: IE <=11 only 9767 // Must access selectedIndex to make default options select 9768 support.optSelected = opt.selected; 9769 9770 // Support: IE <=11 only 9771 // An input loses its value after becoming a radio 9772 input = document.createElement("input"); 9773 input.value = "t"; 9774 input.type = "radio"; 9775 support.radioValue = input.value === "t"; 9776 })(); 9777 var boolHook, 9778 attrHandle = _jQuery2.expr.attrHandle; 9779 _jQuery2.fn.extend({ 9780 attr: function attr(name, value) { 9781 return _access(this, _jQuery2.attr, name, value, arguments.length > 1); 9782 }, 9783 removeAttr: function removeAttr(name) { 9784 return this.each(function () { 9785 _jQuery2.removeAttr(this, name); 9786 }); 9787 } 9788 }); 9789 _jQuery2.extend({ 9790 attr: function attr(elem, name, value) { 9791 var ret, 9792 hooks, 9793 nType = elem.nodeType; 9794 9795 // Don't get/set attributes on text, comment and attribute nodes 9796 if (nType === 3 || nType === 8 || nType === 2) { 9797 return; 9798 } 9799 9800 // Fallback to prop when attributes are not supported 9801 if (typeof elem.getAttribute === "undefined") { 9802 return _jQuery2.prop(elem, name, value); 9803 } 9804 9805 // Attribute hooks are determined by the lowercase version 9806 // Grab necessary hook if one is defined 9807 if (nType !== 1 || !_jQuery2.isXMLDoc(elem)) { 9808 hooks = _jQuery2.attrHooks[name.toLowerCase()] || (_jQuery2.expr.match.bool.test(name) ? boolHook : undefined); 9809 } 9810 if (value !== undefined) { 9811 if (value === null) { 9812 _jQuery2.removeAttr(elem, name); 9813 return; 9814 } 9815 if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) { 9816 return ret; 9817 } 9818 elem.setAttribute(name, value + ""); 9819 return value; 9820 } 9821 if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { 9822 return ret; 9823 } 9824 ret = _jQuery2.find.attr(elem, name); 9825 9826 // Non-existent attributes return null, we normalize to undefined 9827 return ret == null ? undefined : ret; 9828 }, 9829 attrHooks: { 9830 type: { 9831 set: function set(elem, value) { 9832 if (!support.radioValue && value === "radio" && nodeName(elem, "input")) { 9833 var val = elem.value; 9834 elem.setAttribute("type", value); 9835 if (val) { 9836 elem.value = val; 9837 } 9838 return value; 9839 } 9840 } 9841 } 9842 }, 9843 removeAttr: function removeAttr(elem, value) { 9844 var name, 9845 i = 0, 9846 // Attribute names can contain non-HTML whitespace characters 9847 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 9848 attrNames = value && value.match(rnothtmlwhite); 9849 if (attrNames && elem.nodeType === 1) { 9850 while (name = attrNames[i++]) { 9851 elem.removeAttribute(name); 9852 } 9853 } 9854 } 9855 }); 9856 9857 // Hooks for boolean attributes 9858 boolHook = { 9859 set: function set(elem, value, name) { 9860 if (value === false) { 9861 // Remove boolean attributes when set to false 9862 _jQuery2.removeAttr(elem, name); 9863 } else { 9864 elem.setAttribute(name, name); 9865 } 9866 return name; 9867 } 9868 }; 9869 _jQuery2.each(_jQuery2.expr.match.bool.source.match(/\w+/g), function (_i, name) { 9870 var getter = attrHandle[name] || _jQuery2.find.attr; 9871 attrHandle[name] = function (elem, name, isXML) { 9872 var ret, 9873 handle, 9874 lowercaseName = name.toLowerCase(); 9875 if (!isXML) { 9876 // Avoid an infinite loop by temporarily removing this function from the getter 9877 handle = attrHandle[lowercaseName]; 9878 attrHandle[lowercaseName] = ret; 9879 ret = getter(elem, name, isXML) != null ? lowercaseName : null; 9880 attrHandle[lowercaseName] = handle; 9881 } 9882 return ret; 9883 }; 9884 }); 9885 var rfocusable = /^(?:input|select|textarea|button)$/i, 9886 rclickable = /^(?:a|area)$/i; 9887 _jQuery2.fn.extend({ 9888 prop: function prop(name, value) { 9889 return _access(this, _jQuery2.prop, name, value, arguments.length > 1); 9890 }, 9891 removeProp: function removeProp(name) { 9892 return this.each(function () { 9893 delete this[_jQuery2.propFix[name] || name]; 9894 }); 9895 } 9896 }); 9897 _jQuery2.extend({ 9898 prop: function prop(elem, name, value) { 9899 var ret, 9900 hooks, 9901 nType = elem.nodeType; 9902 9903 // Don't get/set properties on text, comment and attribute nodes 9904 if (nType === 3 || nType === 8 || nType === 2) { 9905 return; 9906 } 9907 if (nType !== 1 || !_jQuery2.isXMLDoc(elem)) { 9908 // Fix name and attach hooks 9909 name = _jQuery2.propFix[name] || name; 9910 hooks = _jQuery2.propHooks[name]; 9911 } 9912 if (value !== undefined) { 9913 if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) { 9914 return ret; 9915 } 9916 return elem[name] = value; 9917 } 9918 if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { 9919 return ret; 9920 } 9921 return elem[name]; 9922 }, 9923 propHooks: { 9924 tabIndex: { 9925 get: function get(elem) { 9926 // Support: IE <=9 - 11 only 9927 // elem.tabIndex doesn't always return the 9928 // correct value when it hasn't been explicitly set 9929 // Use proper attribute retrieval (trac-12072) 9930 var tabindex = _jQuery2.find.attr(elem, "tabindex"); 9931 if (tabindex) { 9932 return parseInt(tabindex, 10); 9933 } 9934 if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) { 9935 return 0; 9936 } 9937 return -1; 9938 } 9939 } 9940 }, 9941 propFix: { 9942 "for": "htmlFor", 9943 "class": "className" 9944 } 9945 }); 9946 9947 // Support: IE <=11 only 9948 // Accessing the selectedIndex property 9949 // forces the browser to respect setting selected 9950 // on the option 9951 // The getter ensures a default option is selected 9952 // when in an optgroup 9953 // eslint rule "no-unused-expressions" is disabled for this code 9954 // since it considers such accessions noop 9955 if (!support.optSelected) { 9956 _jQuery2.propHooks.selected = { 9957 get: function get(elem) { 9958 /* eslint no-unused-expressions: "off" */ 9959 9960 var parent = elem.parentNode; 9961 if (parent && parent.parentNode) { 9962 parent.parentNode.selectedIndex; 9963 } 9964 return null; 9965 }, 9966 set: function set(elem) { 9967 /* eslint no-unused-expressions: "off" */ 9968 9969 var parent = elem.parentNode; 9970 if (parent) { 9971 parent.selectedIndex; 9972 if (parent.parentNode) { 9973 parent.parentNode.selectedIndex; 9974 } 9975 } 9976 } 9977 }; 9978 } 9979 _jQuery2.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { 9980 _jQuery2.propFix[this.toLowerCase()] = this; 9981 }); 9982 9983 // Strip and collapse whitespace according to HTML spec 9984 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 9985 function stripAndCollapse(value) { 9986 var tokens = value.match(rnothtmlwhite) || []; 9987 return tokens.join(" "); 9988 } 9989 function getClass(elem) { 9990 return elem.getAttribute && elem.getAttribute("class") || ""; 9991 } 9992 function classesToArray(value) { 9993 if (Array.isArray(value)) { 9994 return value; 9995 } 9996 if (typeof value === "string") { 9997 return value.match(rnothtmlwhite) || []; 9998 } 9999 return []; 10000 } 10001 _jQuery2.fn.extend({ 10002 addClass: function addClass(value) { 10003 var classNames, cur, curValue, className, i, finalValue; 10004 if (isFunction(value)) { 10005 return this.each(function (j) { 10006 _jQuery2(this).addClass(value.call(this, j, getClass(this))); 10007 }); 10008 } 10009 classNames = classesToArray(value); 10010 if (classNames.length) { 10011 return this.each(function () { 10012 curValue = getClass(this); 10013 cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " "; 10014 if (cur) { 10015 for (i = 0; i < classNames.length; i++) { 10016 className = classNames[i]; 10017 if (cur.indexOf(" " + className + " ") < 0) { 10018 cur += className + " "; 10019 } 10020 } 10021 10022 // Only assign if different to avoid unneeded rendering. 10023 finalValue = stripAndCollapse(cur); 10024 if (curValue !== finalValue) { 10025 this.setAttribute("class", finalValue); 10026 } 10027 } 10028 }); 10029 } 10030 return this; 10031 }, 10032 removeClass: function removeClass(value) { 10033 var classNames, cur, curValue, className, i, finalValue; 10034 if (isFunction(value)) { 10035 return this.each(function (j) { 10036 _jQuery2(this).removeClass(value.call(this, j, getClass(this))); 10037 }); 10038 } 10039 if (!arguments.length) { 10040 return this.attr("class", ""); 10041 } 10042 classNames = classesToArray(value); 10043 if (classNames.length) { 10044 return this.each(function () { 10045 curValue = getClass(this); 10046 10047 // This expression is here for better compressibility (see addClass) 10048 cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " "; 10049 if (cur) { 10050 for (i = 0; i < classNames.length; i++) { 10051 className = classNames[i]; 10052 10053 // Remove *all* instances 10054 while (cur.indexOf(" " + className + " ") > -1) { 10055 cur = cur.replace(" " + className + " ", " "); 10056 } 10057 } 10058 10059 // Only assign if different to avoid unneeded rendering. 10060 finalValue = stripAndCollapse(cur); 10061 if (curValue !== finalValue) { 10062 this.setAttribute("class", finalValue); 10063 } 10064 } 10065 }); 10066 } 10067 return this; 10068 }, 10069 toggleClass: function toggleClass(value, stateVal) { 10070 var classNames, 10071 className, 10072 i, 10073 self, 10074 type = _typeof(value), 10075 isValidValue = type === "string" || Array.isArray(value); 10076 if (isFunction(value)) { 10077 return this.each(function (i) { 10078 _jQuery2(this).toggleClass(value.call(this, i, getClass(this), stateVal), stateVal); 10079 }); 10080 } 10081 if (typeof stateVal === "boolean" && isValidValue) { 10082 return stateVal ? this.addClass(value) : this.removeClass(value); 10083 } 10084 classNames = classesToArray(value); 10085 return this.each(function () { 10086 if (isValidValue) { 10087 // Toggle individual class names 10088 self = _jQuery2(this); 10089 for (i = 0; i < classNames.length; i++) { 10090 className = classNames[i]; 10091 10092 // Check each className given, space separated list 10093 if (self.hasClass(className)) { 10094 self.removeClass(className); 10095 } else { 10096 self.addClass(className); 10097 } 10098 } 10099 10100 // Toggle whole class name 10101 } else if (value === undefined || type === "boolean") { 10102 className = getClass(this); 10103 if (className) { 10104 // Store className if set 10105 dataPriv.set(this, "__className__", className); 10106 } 10107 10108 // If the element has a class name or if we're passed `false`, 10109 // then remove the whole classname (if there was one, the above saved it). 10110 // Otherwise bring back whatever was previously saved (if anything), 10111 // falling back to the empty string if nothing was stored. 10112 if (this.setAttribute) { 10113 this.setAttribute("class", className || value === false ? "" : dataPriv.get(this, "__className__") || ""); 10114 } 10115 } 10116 }); 10117 }, 10118 hasClass: function hasClass(selector) { 10119 var className, 10120 elem, 10121 i = 0; 10122 className = " " + selector + " "; 10123 while (elem = this[i++]) { 10124 if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) { 10125 return true; 10126 } 10127 } 10128 return false; 10129 } 10130 }); 10131 var rreturn = /\r/g; 10132 _jQuery2.fn.extend({ 10133 val: function val(value) { 10134 var hooks, 10135 ret, 10136 valueIsFunction, 10137 elem = this[0]; 10138 if (!arguments.length) { 10139 if (elem) { 10140 hooks = _jQuery2.valHooks[elem.type] || _jQuery2.valHooks[elem.nodeName.toLowerCase()]; 10141 if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) { 10142 return ret; 10143 } 10144 ret = elem.value; 10145 10146 // Handle most common string cases 10147 if (typeof ret === "string") { 10148 return ret.replace(rreturn, ""); 10149 } 10150 10151 // Handle cases where value is null/undef or number 10152 return ret == null ? "" : ret; 10153 } 10154 return; 10155 } 10156 valueIsFunction = isFunction(value); 10157 return this.each(function (i) { 10158 var val; 10159 if (this.nodeType !== 1) { 10160 return; 10161 } 10162 if (valueIsFunction) { 10163 val = value.call(this, i, _jQuery2(this).val()); 10164 } else { 10165 val = value; 10166 } 10167 10168 // Treat null/undefined as ""; convert numbers to string 10169 if (val == null) { 10170 val = ""; 10171 } else if (typeof val === "number") { 10172 val += ""; 10173 } else if (Array.isArray(val)) { 10174 val = _jQuery2.map(val, function (value) { 10175 return value == null ? "" : value + ""; 10176 }); 10177 } 10178 hooks = _jQuery2.valHooks[this.type] || _jQuery2.valHooks[this.nodeName.toLowerCase()]; 10179 10180 // If set returns undefined, fall back to normal setting 10181 if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) { 10182 this.value = val; 10183 } 10184 }); 10185 } 10186 }); 10187 _jQuery2.extend({ 10188 valHooks: { 10189 option: { 10190 get: function get(elem) { 10191 var val = _jQuery2.find.attr(elem, "value"); 10192 return val != null ? val : 10193 // Support: IE <=10 - 11 only 10194 // option.text throws exceptions (trac-14686, trac-14858) 10195 // Strip and collapse whitespace 10196 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 10197 stripAndCollapse(_jQuery2.text(elem)); 10198 } 10199 }, 10200 select: { 10201 get: function get(elem) { 10202 var value, 10203 option, 10204 i, 10205 options = elem.options, 10206 index = elem.selectedIndex, 10207 one = elem.type === "select-one", 10208 values = one ? null : [], 10209 max = one ? index + 1 : options.length; 10210 if (index < 0) { 10211 i = max; 10212 } else { 10213 i = one ? index : 0; 10214 } 10215 10216 // Loop through all the selected options 10217 for (; i < max; i++) { 10218 option = options[i]; 10219 10220 // Support: IE <=9 only 10221 // IE8-9 doesn't update selected after form reset (trac-2551) 10222 if ((option.selected || i === index) && 10223 // Don't return options that are disabled or in a disabled optgroup 10224 !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) { 10225 // Get the specific value for the option 10226 value = _jQuery2(option).val(); 10227 10228 // We don't need an array for one selects 10229 if (one) { 10230 return value; 10231 } 10232 10233 // Multi-Selects return an array 10234 values.push(value); 10235 } 10236 } 10237 return values; 10238 }, 10239 set: function set(elem, value) { 10240 var optionSet, 10241 option, 10242 options = elem.options, 10243 values = _jQuery2.makeArray(value), 10244 i = options.length; 10245 while (i--) { 10246 option = options[i]; 10247 10248 /* eslint-disable no-cond-assign */ 10249 10250 if (option.selected = _jQuery2.inArray(_jQuery2.valHooks.option.get(option), values) > -1) { 10251 optionSet = true; 10252 } 10253 10254 /* eslint-enable no-cond-assign */ 10255 } 10256 10257 // Force browsers to behave consistently when non-matching value is set 10258 if (!optionSet) { 10259 elem.selectedIndex = -1; 10260 } 10261 return values; 10262 } 10263 } 10264 } 10265 }); 10266 10267 // Radios and checkboxes getter/setter 10268 _jQuery2.each(["radio", "checkbox"], function () { 10269 _jQuery2.valHooks[this] = { 10270 set: function set(elem, value) { 10271 if (Array.isArray(value)) { 10272 return elem.checked = _jQuery2.inArray(_jQuery2(elem).val(), value) > -1; 10273 } 10274 } 10275 }; 10276 if (!support.checkOn) { 10277 _jQuery2.valHooks[this].get = function (elem) { 10278 return elem.getAttribute("value") === null ? "on" : elem.value; 10279 }; 10280 } 10281 }); 10282 10283 // Return jQuery for attributes-only inclusion 10284 var location = window.location; 10285 var nonce = { 10286 guid: Date.now() 10287 }; 10288 var rquery = /\?/; 10289 10290 // Cross-browser xml parsing 10291 _jQuery2.parseXML = function (data) { 10292 var xml, parserErrorElem; 10293 if (!data || typeof data !== "string") { 10294 return null; 10295 } 10296 10297 // Support: IE 9 - 11 only 10298 // IE throws on parseFromString with invalid input. 10299 try { 10300 xml = new window.DOMParser().parseFromString(data, "text/xml"); 10301 } catch (e) {} 10302 parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0]; 10303 if (!xml || parserErrorElem) { 10304 _jQuery2.error("Invalid XML: " + (parserErrorElem ? _jQuery2.map(parserErrorElem.childNodes, function (el) { 10305 return el.textContent; 10306 }).join("\n") : data)); 10307 } 10308 return xml; 10309 }; 10310 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 10311 stopPropagationCallback = function stopPropagationCallback(e) { 10312 e.stopPropagation(); 10313 }; 10314 _jQuery2.extend(_jQuery2.event, { 10315 trigger: function trigger(event, data, elem, onlyHandlers) { 10316 var i, 10317 cur, 10318 tmp, 10319 bubbleType, 10320 ontype, 10321 handle, 10322 special, 10323 lastElement, 10324 eventPath = [elem || document], 10325 type = hasOwn.call(event, "type") ? event.type : event, 10326 namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : []; 10327 cur = lastElement = tmp = elem = elem || document; 10328 10329 // Don't do events on text and comment nodes 10330 if (elem.nodeType === 3 || elem.nodeType === 8) { 10331 return; 10332 } 10333 10334 // focus/blur morphs to focusin/out; ensure we're not firing them right now 10335 if (rfocusMorph.test(type + _jQuery2.event.triggered)) { 10336 return; 10337 } 10338 if (type.indexOf(".") > -1) { 10339 // Namespaced trigger; create a regexp to match event type in handle() 10340 namespaces = type.split("."); 10341 type = namespaces.shift(); 10342 namespaces.sort(); 10343 } 10344 ontype = type.indexOf(":") < 0 && "on" + type; 10345 10346 // Caller can pass in a jQuery.Event object, Object, or just an event type string 10347 event = event[_jQuery2.expando] ? event : new _jQuery2.Event(type, _typeof(event) === "object" && event); 10348 10349 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 10350 event.isTrigger = onlyHandlers ? 2 : 3; 10351 event.namespace = namespaces.join("."); 10352 event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; 10353 10354 // Clean up the event in case it is being reused 10355 event.result = undefined; 10356 if (!event.target) { 10357 event.target = elem; 10358 } 10359 10360 // Clone any incoming data and prepend the event, creating the handler arg list 10361 data = data == null ? [event] : _jQuery2.makeArray(data, [event]); 10362 10363 // Allow special events to draw outside the lines 10364 special = _jQuery2.event.special[type] || {}; 10365 if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) { 10366 return; 10367 } 10368 10369 // Determine event propagation path in advance, per W3C events spec (trac-9951) 10370 // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724) 10371 if (!onlyHandlers && !special.noBubble && !isWindow(elem)) { 10372 bubbleType = special.delegateType || type; 10373 if (!rfocusMorph.test(bubbleType + type)) { 10374 cur = cur.parentNode; 10375 } 10376 for (; cur; cur = cur.parentNode) { 10377 eventPath.push(cur); 10378 tmp = cur; 10379 } 10380 10381 // Only add window if we got to document (e.g., not plain obj or detached DOM) 10382 if (tmp === (elem.ownerDocument || document)) { 10383 eventPath.push(tmp.defaultView || tmp.parentWindow || window); 10384 } 10385 } 10386 10387 // Fire handlers on the event path 10388 i = 0; 10389 while ((cur = eventPath[i++]) && !event.isPropagationStopped()) { 10390 lastElement = cur; 10391 event.type = i > 1 ? bubbleType : special.bindType || type; 10392 10393 // jQuery handler 10394 handle = (dataPriv.get(cur, "events") || Object.create(null))[event.type] && dataPriv.get(cur, "handle"); 10395 if (handle) { 10396 handle.apply(cur, data); 10397 } 10398 10399 // Native handler 10400 handle = ontype && cur[ontype]; 10401 if (handle && handle.apply && acceptData(cur)) { 10402 event.result = handle.apply(cur, data); 10403 if (event.result === false) { 10404 event.preventDefault(); 10405 } 10406 } 10407 } 10408 event.type = type; 10409 10410 // If nobody prevented the default action, do it now 10411 if (!onlyHandlers && !event.isDefaultPrevented()) { 10412 if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) { 10413 // Call a native DOM method on the target with the same name as the event. 10414 // Don't do default actions on window, that's where global variables be (trac-6170) 10415 if (ontype && isFunction(elem[type]) && !isWindow(elem)) { 10416 // Don't re-trigger an onFOO event when we call its FOO() method 10417 tmp = elem[ontype]; 10418 if (tmp) { 10419 elem[ontype] = null; 10420 } 10421 10422 // Prevent re-triggering of the same event, since we already bubbled it above 10423 _jQuery2.event.triggered = type; 10424 if (event.isPropagationStopped()) { 10425 lastElement.addEventListener(type, stopPropagationCallback); 10426 } 10427 elem[type](); 10428 if (event.isPropagationStopped()) { 10429 lastElement.removeEventListener(type, stopPropagationCallback); 10430 } 10431 _jQuery2.event.triggered = undefined; 10432 if (tmp) { 10433 elem[ontype] = tmp; 10434 } 10435 } 10436 } 10437 } 10438 return event.result; 10439 }, 10440 // Piggyback on a donor event to simulate a different one 10441 // Used only for `focus(in | out)` events 10442 simulate: function simulate(type, elem, event) { 10443 var e = _jQuery2.extend(new _jQuery2.Event(), event, { 10444 type: type, 10445 isSimulated: true 10446 }); 10447 _jQuery2.event.trigger(e, null, elem); 10448 } 10449 }); 10450 _jQuery2.fn.extend({ 10451 trigger: function trigger(type, data) { 10452 return this.each(function () { 10453 _jQuery2.event.trigger(type, data, this); 10454 }); 10455 }, 10456 triggerHandler: function triggerHandler(type, data) { 10457 var elem = this[0]; 10458 if (elem) { 10459 return _jQuery2.event.trigger(type, data, elem, true); 10460 } 10461 } 10462 }); 10463 var rbracket = /\[\]$/, 10464 rCRLF = /\r?\n/g, 10465 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 10466 rsubmittable = /^(?:input|select|textarea|keygen)/i; 10467 function buildParams(prefix, obj, traditional, add) { 10468 var name; 10469 if (Array.isArray(obj)) { 10470 // Serialize array item. 10471 _jQuery2.each(obj, function (i, v) { 10472 if (traditional || rbracket.test(prefix)) { 10473 // Treat each array item as a scalar. 10474 add(prefix, v); 10475 } else { 10476 // Item is non-scalar (array or object), encode its numeric index. 10477 buildParams(prefix + "[" + (_typeof(v) === "object" && v != null ? i : "") + "]", v, traditional, add); 10478 } 10479 }); 10480 } else if (!traditional && toType(obj) === "object") { 10481 // Serialize object item. 10482 for (name in obj) { 10483 buildParams(prefix + "[" + name + "]", obj[name], traditional, add); 10484 } 10485 } else { 10486 // Serialize scalar item. 10487 add(prefix, obj); 10488 } 10489 } 10490 10491 // Serialize an array of form elements or a set of 10492 // key/values into a query string 10493 _jQuery2.param = function (a, traditional) { 10494 var prefix, 10495 s = [], 10496 add = function add(key, valueOrFunction) { 10497 // If value is a function, invoke it and use its return value 10498 var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction; 10499 s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value); 10500 }; 10501 if (a == null) { 10502 return ""; 10503 } 10504 10505 // If an array was passed in, assume that it is an array of form elements. 10506 if (Array.isArray(a) || a.jquery && !_jQuery2.isPlainObject(a)) { 10507 // Serialize the form elements 10508 _jQuery2.each(a, function () { 10509 add(this.name, this.value); 10510 }); 10511 } else { 10512 // If traditional, encode the "old" way (the way 1.3.2 or older 10513 // did it), otherwise encode params recursively. 10514 for (prefix in a) { 10515 buildParams(prefix, a[prefix], traditional, add); 10516 } 10517 } 10518 10519 // Return the resulting serialization 10520 return s.join("&"); 10521 }; 10522 _jQuery2.fn.extend({ 10523 serialize: function serialize() { 10524 return _jQuery2.param(this.serializeArray()); 10525 }, 10526 serializeArray: function serializeArray() { 10527 return this.map(function () { 10528 // Can add propHook for "elements" to filter or add form elements 10529 var elements = _jQuery2.prop(this, "elements"); 10530 return elements ? _jQuery2.makeArray(elements) : this; 10531 }).filter(function () { 10532 var type = this.type; 10533 10534 // Use .is( ":disabled" ) so that fieldset[disabled] works 10535 return this.name && !_jQuery2(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type)); 10536 }).map(function (_i, elem) { 10537 var val = _jQuery2(this).val(); 10538 if (val == null) { 10539 return null; 10540 } 10541 if (Array.isArray(val)) { 10542 return _jQuery2.map(val, function (val) { 10543 return { 10544 name: elem.name, 10545 value: val.replace(rCRLF, "\r\n") 10546 }; 10547 }); 10548 } 10549 return { 10550 name: elem.name, 10551 value: val.replace(rCRLF, "\r\n") 10552 }; 10553 }).get(); 10554 } 10555 }); 10556 var r20 = /%20/g, 10557 rhash = /#.*$/, 10558 rantiCache = /([?&])_=[^&]*/, 10559 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 10560 // trac-7653, trac-8125, trac-8152: local protocol detection 10561 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 10562 rnoContent = /^(?:GET|HEAD)$/, 10563 rprotocol = /^\/\//, 10564 /* Prefilters 10565 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 10566 * 2) These are called: 10567 * - BEFORE asking for a transport 10568 * - AFTER param serialization (s.data is a string if s.processData is true) 10569 * 3) key is the dataType 10570 * 4) the catchall symbol "*" can be used 10571 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 10572 */ 10573 prefilters = {}, 10574 /* Transports bindings 10575 * 1) key is the dataType 10576 * 2) the catchall symbol "*" can be used 10577 * 3) selection will start with transport dataType and THEN go to "*" if needed 10578 */ 10579 transports = {}, 10580 // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression 10581 allTypes = "*/".concat("*"), 10582 // Anchor tag for parsing the document origin 10583 originAnchor = document.createElement("a"); 10584 originAnchor.href = location.href; 10585 10586 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 10587 function addToPrefiltersOrTransports(structure) { 10588 // dataTypeExpression is optional and defaults to "*" 10589 return function (dataTypeExpression, func) { 10590 if (typeof dataTypeExpression !== "string") { 10591 func = dataTypeExpression; 10592 dataTypeExpression = "*"; 10593 } 10594 var dataType, 10595 i = 0, 10596 dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || []; 10597 if (isFunction(func)) { 10598 // For each dataType in the dataTypeExpression 10599 while (dataType = dataTypes[i++]) { 10600 // Prepend if requested 10601 if (dataType[0] === "+") { 10602 dataType = dataType.slice(1) || "*"; 10603 (structure[dataType] = structure[dataType] || []).unshift(func); 10604 10605 // Otherwise append 10606 } else { 10607 (structure[dataType] = structure[dataType] || []).push(func); 10608 } 10609 } 10610 } 10611 }; 10612 } 10613 10614 // Base inspection function for prefilters and transports 10615 function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { 10616 var inspected = {}, 10617 seekingTransport = structure === transports; 10618 function inspect(dataType) { 10619 var selected; 10620 inspected[dataType] = true; 10621 _jQuery2.each(structure[dataType] || [], function (_, prefilterOrFactory) { 10622 var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR); 10623 if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) { 10624 options.dataTypes.unshift(dataTypeOrTransport); 10625 inspect(dataTypeOrTransport); 10626 return false; 10627 } else if (seekingTransport) { 10628 return !(selected = dataTypeOrTransport); 10629 } 10630 }); 10631 return selected; 10632 } 10633 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*"); 10634 } 10635 10636 // A special extend for ajax options 10637 // that takes "flat" options (not to be deep extended) 10638 // Fixes trac-9887 10639 function ajaxExtend(target, src) { 10640 var key, 10641 deep, 10642 flatOptions = _jQuery2.ajaxSettings.flatOptions || {}; 10643 for (key in src) { 10644 if (src[key] !== undefined) { 10645 (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key]; 10646 } 10647 } 10648 if (deep) { 10649 _jQuery2.extend(true, target, deep); 10650 } 10651 return target; 10652 } 10653 10654 /* Handles responses to an ajax request: 10655 * - finds the right dataType (mediates between content-type and expected dataType) 10656 * - returns the corresponding response 10657 */ 10658 function ajaxHandleResponses(s, jqXHR, responses) { 10659 var ct, 10660 type, 10661 finalDataType, 10662 firstDataType, 10663 contents = s.contents, 10664 dataTypes = s.dataTypes; 10665 10666 // Remove auto dataType and get content-type in the process 10667 while (dataTypes[0] === "*") { 10668 dataTypes.shift(); 10669 if (ct === undefined) { 10670 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); 10671 } 10672 } 10673 10674 // Check if we're dealing with a known content-type 10675 if (ct) { 10676 for (type in contents) { 10677 if (contents[type] && contents[type].test(ct)) { 10678 dataTypes.unshift(type); 10679 break; 10680 } 10681 } 10682 } 10683 10684 // Check to see if we have a response for the expected dataType 10685 if (dataTypes[0] in responses) { 10686 finalDataType = dataTypes[0]; 10687 } else { 10688 // Try convertible dataTypes 10689 for (type in responses) { 10690 if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) { 10691 finalDataType = type; 10692 break; 10693 } 10694 if (!firstDataType) { 10695 firstDataType = type; 10696 } 10697 } 10698 10699 // Or just use first one 10700 finalDataType = finalDataType || firstDataType; 10701 } 10702 10703 // If we found a dataType 10704 // We add the dataType to the list if needed 10705 // and return the corresponding response 10706 if (finalDataType) { 10707 if (finalDataType !== dataTypes[0]) { 10708 dataTypes.unshift(finalDataType); 10709 } 10710 return responses[finalDataType]; 10711 } 10712 } 10713 10714 /* Chain conversions given the request and the original response 10715 * Also sets the responseXXX fields on the jqXHR instance 10716 */ 10717 function ajaxConvert(s, response, jqXHR, isSuccess) { 10718 var conv2, 10719 current, 10720 conv, 10721 tmp, 10722 prev, 10723 converters = {}, 10724 // Work with a copy of dataTypes in case we need to modify it for conversion 10725 dataTypes = s.dataTypes.slice(); 10726 10727 // Create converters map with lowercased keys 10728 if (dataTypes[1]) { 10729 for (conv in s.converters) { 10730 converters[conv.toLowerCase()] = s.converters[conv]; 10731 } 10732 } 10733 current = dataTypes.shift(); 10734 10735 // Convert to each sequential dataType 10736 while (current) { 10737 if (s.responseFields[current]) { 10738 jqXHR[s.responseFields[current]] = response; 10739 } 10740 10741 // Apply the dataFilter if provided 10742 if (!prev && isSuccess && s.dataFilter) { 10743 response = s.dataFilter(response, s.dataType); 10744 } 10745 prev = current; 10746 current = dataTypes.shift(); 10747 if (current) { 10748 // There's only work to do if current dataType is non-auto 10749 if (current === "*") { 10750 current = prev; 10751 10752 // Convert response if prev dataType is non-auto and differs from current 10753 } else if (prev !== "*" && prev !== current) { 10754 // Seek a direct converter 10755 conv = converters[prev + " " + current] || converters["* " + current]; 10756 10757 // If none found, seek a pair 10758 if (!conv) { 10759 for (conv2 in converters) { 10760 // If conv2 outputs current 10761 tmp = conv2.split(" "); 10762 if (tmp[1] === current) { 10763 // If prev can be converted to accepted input 10764 conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]]; 10765 if (conv) { 10766 // Condense equivalence converters 10767 if (conv === true) { 10768 conv = converters[conv2]; 10769 10770 // Otherwise, insert the intermediate dataType 10771 } else if (converters[conv2] !== true) { 10772 current = tmp[0]; 10773 dataTypes.unshift(tmp[1]); 10774 } 10775 break; 10776 } 10777 } 10778 } 10779 } 10780 10781 // Apply converter (if not an equivalence) 10782 if (conv !== true) { 10783 // Unless errors are allowed to bubble, catch and return them 10784 if (conv && s["throws"]) { 10785 response = conv(response); 10786 } else { 10787 try { 10788 response = conv(response); 10789 } catch (e) { 10790 return { 10791 state: "parsererror", 10792 error: conv ? e : "No conversion from " + prev + " to " + current 10793 }; 10794 } 10795 } 10796 } 10797 } 10798 } 10799 } 10800 return { 10801 state: "success", 10802 data: response 10803 }; 10804 } 10805 _jQuery2.extend({ 10806 // Counter for holding the number of active queries 10807 active: 0, 10808 // Last-Modified header cache for next request 10809 lastModified: {}, 10810 etag: {}, 10811 ajaxSettings: { 10812 url: location.href, 10813 type: "GET", 10814 isLocal: rlocalProtocol.test(location.protocol), 10815 global: true, 10816 processData: true, 10817 async: true, 10818 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 10819 /* 10820 timeout: 0, 10821 data: null, 10822 dataType: null, 10823 username: null, 10824 password: null, 10825 cache: null, 10826 throws: false, 10827 traditional: false, 10828 headers: {}, 10829 */ 10830 10831 accepts: { 10832 "*": allTypes, 10833 text: "text/plain", 10834 html: "text/html", 10835 xml: "application/xml, text/xml", 10836 json: "application/json, text/javascript" 10837 }, 10838 contents: { 10839 xml: /\bxml\b/, 10840 html: /\bhtml/, 10841 json: /\bjson\b/ 10842 }, 10843 responseFields: { 10844 xml: "responseXML", 10845 text: "responseText", 10846 json: "responseJSON" 10847 }, 10848 // Data converters 10849 // Keys separate source (or catchall "*") and destination types with a single space 10850 converters: { 10851 // Convert anything to text 10852 "* text": String, 10853 // Text to html (true = no transformation) 10854 "text html": true, 10855 // Evaluate text as a json expression 10856 "text json": JSON.parse, 10857 // Parse text as xml 10858 "text xml": _jQuery2.parseXML 10859 }, 10860 // For options that shouldn't be deep extended: 10861 // you can add your own custom options here if 10862 // and when you create one that shouldn't be 10863 // deep extended (see ajaxExtend) 10864 flatOptions: { 10865 url: true, 10866 context: true 10867 } 10868 }, 10869 // Creates a full fledged settings object into target 10870 // with both ajaxSettings and settings fields. 10871 // If target is omitted, writes into ajaxSettings. 10872 ajaxSetup: function ajaxSetup(target, settings) { 10873 return settings ? 10874 // Building a settings object 10875 ajaxExtend(ajaxExtend(target, _jQuery2.ajaxSettings), settings) : 10876 // Extending ajaxSettings 10877 ajaxExtend(_jQuery2.ajaxSettings, target); 10878 }, 10879 ajaxPrefilter: addToPrefiltersOrTransports(prefilters), 10880 ajaxTransport: addToPrefiltersOrTransports(transports), 10881 // Main method 10882 ajax: function ajax(url, options) { 10883 // If url is an object, simulate pre-1.5 signature 10884 if (_typeof(url) === "object") { 10885 options = url; 10886 url = undefined; 10887 } 10888 10889 // Force options to be an object 10890 options = options || {}; 10891 var transport, 10892 // URL without anti-cache param 10893 cacheURL, 10894 // Response headers 10895 responseHeadersString, 10896 responseHeaders, 10897 // timeout handle 10898 timeoutTimer, 10899 // Url cleanup var 10900 urlAnchor, 10901 // Request state (becomes false upon send and true upon completion) 10902 completed, 10903 // To know if global events are to be dispatched 10904 fireGlobals, 10905 // Loop variable 10906 i, 10907 // uncached part of the url 10908 uncached, 10909 // Create the final options object 10910 s = _jQuery2.ajaxSetup({}, options), 10911 // Callbacks context 10912 callbackContext = s.context || s, 10913 // Context for global events is callbackContext if it is a DOM node or jQuery collection 10914 globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? _jQuery2(callbackContext) : _jQuery2.event, 10915 // Deferreds 10916 deferred = _jQuery2.Deferred(), 10917 completeDeferred = _jQuery2.Callbacks("once memory"), 10918 // Status-dependent callbacks 10919 _statusCode = s.statusCode || {}, 10920 // Headers (they are sent all at once) 10921 requestHeaders = {}, 10922 requestHeadersNames = {}, 10923 // Default abort message 10924 strAbort = "canceled", 10925 // Fake xhr 10926 jqXHR = { 10927 readyState: 0, 10928 // Builds headers hashtable if needed 10929 getResponseHeader: function getResponseHeader(key) { 10930 var match; 10931 if (completed) { 10932 if (!responseHeaders) { 10933 responseHeaders = {}; 10934 while (match = rheaders.exec(responseHeadersString)) { 10935 responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]); 10936 } 10937 } 10938 match = responseHeaders[key.toLowerCase() + " "]; 10939 } 10940 return match == null ? null : match.join(", "); 10941 }, 10942 // Raw string 10943 getAllResponseHeaders: function getAllResponseHeaders() { 10944 return completed ? responseHeadersString : null; 10945 }, 10946 // Caches the header 10947 setRequestHeader: function setRequestHeader(name, value) { 10948 if (completed == null) { 10949 name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name; 10950 requestHeaders[name] = value; 10951 } 10952 return this; 10953 }, 10954 // Overrides response content-type header 10955 overrideMimeType: function overrideMimeType(type) { 10956 if (completed == null) { 10957 s.mimeType = type; 10958 } 10959 return this; 10960 }, 10961 // Status-dependent callbacks 10962 statusCode: function statusCode(map) { 10963 var code; 10964 if (map) { 10965 if (completed) { 10966 // Execute the appropriate callbacks 10967 jqXHR.always(map[jqXHR.status]); 10968 } else { 10969 // Lazy-add the new callbacks in a way that preserves old ones 10970 for (code in map) { 10971 _statusCode[code] = [_statusCode[code], map[code]]; 10972 } 10973 } 10974 } 10975 return this; 10976 }, 10977 // Cancel the request 10978 abort: function abort(statusText) { 10979 var finalText = statusText || strAbort; 10980 if (transport) { 10981 transport.abort(finalText); 10982 } 10983 done(0, finalText); 10984 return this; 10985 } 10986 }; 10987 10988 // Attach deferreds 10989 deferred.promise(jqXHR); 10990 10991 // Add protocol if not provided (prefilters might expect it) 10992 // Handle falsy url in the settings object (trac-10093: consistency with old signature) 10993 // We also use the url parameter if available 10994 s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//"); 10995 10996 // Alias method option to type as per ticket trac-12004 10997 s.type = options.method || options.type || s.method || s.type; 10998 10999 // Extract dataTypes list 11000 s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""]; 11001 11002 // A cross-domain request is in order when the origin doesn't match the current origin. 11003 if (s.crossDomain == null) { 11004 urlAnchor = document.createElement("a"); 11005 11006 // Support: IE <=8 - 11, Edge 12 - 15 11007 // IE throws exception on accessing the href property if url is malformed, 11008 // e.g. http://example.com:80x/ 11009 try { 11010 urlAnchor.href = s.url; 11011 11012 // Support: IE <=8 - 11 only 11013 // Anchor's host property isn't correctly set when s.url is relative 11014 urlAnchor.href = urlAnchor.href; 11015 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host; 11016 } catch (e) { 11017 // If there is an error parsing the URL, assume it is crossDomain, 11018 // it can be rejected by the transport if it is invalid 11019 s.crossDomain = true; 11020 } 11021 } 11022 11023 // Convert data if not already a string 11024 if (s.data && s.processData && typeof s.data !== "string") { 11025 s.data = _jQuery2.param(s.data, s.traditional); 11026 } 11027 11028 // Apply prefilters 11029 inspectPrefiltersOrTransports(prefilters, s, options, jqXHR); 11030 11031 // If request was aborted inside a prefilter, stop there 11032 if (completed) { 11033 return jqXHR; 11034 } 11035 11036 // We can fire global events as of now if asked to 11037 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118) 11038 fireGlobals = _jQuery2.event && s.global; 11039 11040 // Watch for a new set of requests 11041 if (fireGlobals && _jQuery2.active++ === 0) { 11042 _jQuery2.event.trigger("ajaxStart"); 11043 } 11044 11045 // Uppercase the type 11046 s.type = s.type.toUpperCase(); 11047 11048 // Determine if request has content 11049 s.hasContent = !rnoContent.test(s.type); 11050 11051 // Save the URL in case we're toying with the If-Modified-Since 11052 // and/or If-None-Match header later on 11053 // Remove hash to simplify url manipulation 11054 cacheURL = s.url.replace(rhash, ""); 11055 11056 // More options handling for requests with no content 11057 if (!s.hasContent) { 11058 // Remember the hash so we can put it back 11059 uncached = s.url.slice(cacheURL.length); 11060 11061 // If data is available and should be processed, append data to url 11062 if (s.data && (s.processData || typeof s.data === "string")) { 11063 cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data; 11064 11065 // trac-9682: remove data so that it's not used in an eventual retry 11066 delete s.data; 11067 } 11068 11069 // Add or update anti-cache param if needed 11070 if (s.cache === false) { 11071 cacheURL = cacheURL.replace(rantiCache, "$1"); 11072 uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached; 11073 } 11074 11075 // Put hash and anti-cache on the URL that will be requested (gh-1732) 11076 s.url = cacheURL + uncached; 11077 11078 // Change '%20' to '+' if this is encoded form body content (gh-2658) 11079 } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) { 11080 s.data = s.data.replace(r20, "+"); 11081 } 11082 11083 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 11084 if (s.ifModified) { 11085 if (_jQuery2.lastModified[cacheURL]) { 11086 jqXHR.setRequestHeader("If-Modified-Since", _jQuery2.lastModified[cacheURL]); 11087 } 11088 if (_jQuery2.etag[cacheURL]) { 11089 jqXHR.setRequestHeader("If-None-Match", _jQuery2.etag[cacheURL]); 11090 } 11091 } 11092 11093 // Set the correct header, if data is being sent 11094 if (s.data && s.hasContent && s.contentType !== false || options.contentType) { 11095 jqXHR.setRequestHeader("Content-Type", s.contentType); 11096 } 11097 11098 // Set the Accepts header for the server, depending on the dataType 11099 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["*"]); 11100 11101 // Check for headers option 11102 for (i in s.headers) { 11103 jqXHR.setRequestHeader(i, s.headers[i]); 11104 } 11105 11106 // Allow custom headers/mimetypes and early abort 11107 if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed)) { 11108 // Abort if not done already and return 11109 return jqXHR.abort(); 11110 } 11111 11112 // Aborting is no longer a cancellation 11113 strAbort = "abort"; 11114 11115 // Install callbacks on deferreds 11116 completeDeferred.add(s.complete); 11117 jqXHR.done(s.success); 11118 jqXHR.fail(s.error); 11119 11120 // Get transport 11121 transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR); 11122 11123 // If no transport, we auto-abort 11124 if (!transport) { 11125 done(-1, "No Transport"); 11126 } else { 11127 jqXHR.readyState = 1; 11128 11129 // Send global event 11130 if (fireGlobals) { 11131 globalEventContext.trigger("ajaxSend", [jqXHR, s]); 11132 } 11133 11134 // If request was aborted inside ajaxSend, stop there 11135 if (completed) { 11136 return jqXHR; 11137 } 11138 11139 // Timeout 11140 if (s.async && s.timeout > 0) { 11141 timeoutTimer = window.setTimeout(function () { 11142 jqXHR.abort("timeout"); 11143 }, s.timeout); 11144 } 11145 try { 11146 completed = false; 11147 transport.send(requestHeaders, done); 11148 } catch (e) { 11149 // Rethrow post-completion exceptions 11150 if (completed) { 11151 throw e; 11152 } 11153 11154 // Propagate others as results 11155 done(-1, e); 11156 } 11157 } 11158 11159 // Callback for when everything is done 11160 function done(status, nativeStatusText, responses, headers) { 11161 var isSuccess, 11162 success, 11163 error, 11164 response, 11165 modified, 11166 statusText = nativeStatusText; 11167 11168 // Ignore repeat invocations 11169 if (completed) { 11170 return; 11171 } 11172 completed = true; 11173 11174 // Clear timeout if it exists 11175 if (timeoutTimer) { 11176 window.clearTimeout(timeoutTimer); 11177 } 11178 11179 // Dereference transport for early garbage collection 11180 // (no matter how long the jqXHR object will be used) 11181 transport = undefined; 11182 11183 // Cache response headers 11184 responseHeadersString = headers || ""; 11185 11186 // Set readyState 11187 jqXHR.readyState = status > 0 ? 4 : 0; 11188 11189 // Determine if successful 11190 isSuccess = status >= 200 && status < 300 || status === 304; 11191 11192 // Get response data 11193 if (responses) { 11194 response = ajaxHandleResponses(s, jqXHR, responses); 11195 } 11196 11197 // Use a noop converter for missing script but not if jsonp 11198 if (!isSuccess && _jQuery2.inArray("script", s.dataTypes) > -1 && _jQuery2.inArray("json", s.dataTypes) < 0) { 11199 s.converters["text script"] = function () {}; 11200 } 11201 11202 // Convert no matter what (that way responseXXX fields are always set) 11203 response = ajaxConvert(s, response, jqXHR, isSuccess); 11204 11205 // If successful, handle type chaining 11206 if (isSuccess) { 11207 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 11208 if (s.ifModified) { 11209 modified = jqXHR.getResponseHeader("Last-Modified"); 11210 if (modified) { 11211 _jQuery2.lastModified[cacheURL] = modified; 11212 } 11213 modified = jqXHR.getResponseHeader("etag"); 11214 if (modified) { 11215 _jQuery2.etag[cacheURL] = modified; 11216 } 11217 } 11218 11219 // if no content 11220 if (status === 204 || s.type === "HEAD") { 11221 statusText = "nocontent"; 11222 11223 // if not modified 11224 } else if (status === 304) { 11225 statusText = "notmodified"; 11226 11227 // If we have data, let's convert it 11228 } else { 11229 statusText = response.state; 11230 success = response.data; 11231 error = response.error; 11232 isSuccess = !error; 11233 } 11234 } else { 11235 // Extract error from statusText and normalize for non-aborts 11236 error = statusText; 11237 if (status || !statusText) { 11238 statusText = "error"; 11239 if (status < 0) { 11240 status = 0; 11241 } 11242 } 11243 } 11244 11245 // Set data for the fake xhr object 11246 jqXHR.status = status; 11247 jqXHR.statusText = (nativeStatusText || statusText) + ""; 11248 11249 // Success/Error 11250 if (isSuccess) { 11251 deferred.resolveWith(callbackContext, [success, statusText, jqXHR]); 11252 } else { 11253 deferred.rejectWith(callbackContext, [jqXHR, statusText, error]); 11254 } 11255 11256 // Status-dependent callbacks 11257 jqXHR.statusCode(_statusCode); 11258 _statusCode = undefined; 11259 if (fireGlobals) { 11260 globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]); 11261 } 11262 11263 // Complete 11264 completeDeferred.fireWith(callbackContext, [jqXHR, statusText]); 11265 if (fireGlobals) { 11266 globalEventContext.trigger("ajaxComplete", [jqXHR, s]); 11267 11268 // Handle the global AJAX counter 11269 if (! --_jQuery2.active) { 11270 _jQuery2.event.trigger("ajaxStop"); 11271 } 11272 } 11273 } 11274 return jqXHR; 11275 }, 11276 getJSON: function getJSON(url, data, callback) { 11277 return _jQuery2.get(url, data, callback, "json"); 11278 }, 11279 getScript: function getScript(url, callback) { 11280 return _jQuery2.get(url, undefined, callback, "script"); 11281 } 11282 }); 11283 _jQuery2.each(["get", "post"], function (_i, method) { 11284 _jQuery2[method] = function (url, data, callback, type) { 11285 // Shift arguments if data argument was omitted 11286 if (isFunction(data)) { 11287 type = type || callback; 11288 callback = data; 11289 data = undefined; 11290 } 11291 11292 // The url can be an options object (which then must have .url) 11293 return _jQuery2.ajax(_jQuery2.extend({ 11294 url: url, 11295 type: method, 11296 dataType: type, 11297 data: data, 11298 success: callback 11299 }, _jQuery2.isPlainObject(url) && url)); 11300 }; 11301 }); 11302 _jQuery2.ajaxPrefilter(function (s) { 11303 var i; 11304 for (i in s.headers) { 11305 if (i.toLowerCase() === "content-type") { 11306 s.contentType = s.headers[i] || ""; 11307 } 11308 } 11309 }); 11310 _jQuery2._evalUrl = function (url, options, doc) { 11311 return _jQuery2.ajax({ 11312 url: url, 11313 // Make this explicit, since user can override this through ajaxSetup (trac-11264) 11314 type: "GET", 11315 dataType: "script", 11316 cache: true, 11317 async: false, 11318 global: false, 11319 // Only evaluate the response if it is successful (gh-4126) 11320 // dataFilter is not invoked for failure responses, so using it instead 11321 // of the default converter is kludgy but it works. 11322 converters: { 11323 "text script": function text_script() {} 11324 }, 11325 dataFilter: function dataFilter(response) { 11326 _jQuery2.globalEval(response, options, doc); 11327 } 11328 }); 11329 }; 11330 _jQuery2.fn.extend({ 11331 wrapAll: function wrapAll(html) { 11332 var wrap; 11333 if (this[0]) { 11334 if (isFunction(html)) { 11335 html = html.call(this[0]); 11336 } 11337 11338 // The elements to wrap the target around 11339 wrap = _jQuery2(html, this[0].ownerDocument).eq(0).clone(true); 11340 if (this[0].parentNode) { 11341 wrap.insertBefore(this[0]); 11342 } 11343 wrap.map(function () { 11344 var elem = this; 11345 while (elem.firstElementChild) { 11346 elem = elem.firstElementChild; 11347 } 11348 return elem; 11349 }).append(this); 11350 } 11351 return this; 11352 }, 11353 wrapInner: function wrapInner(html) { 11354 if (isFunction(html)) { 11355 return this.each(function (i) { 11356 _jQuery2(this).wrapInner(html.call(this, i)); 11357 }); 11358 } 11359 return this.each(function () { 11360 var self = _jQuery2(this), 11361 contents = self.contents(); 11362 if (contents.length) { 11363 contents.wrapAll(html); 11364 } else { 11365 self.append(html); 11366 } 11367 }); 11368 }, 11369 wrap: function wrap(html) { 11370 var htmlIsFunction = isFunction(html); 11371 return this.each(function (i) { 11372 _jQuery2(this).wrapAll(htmlIsFunction ? html.call(this, i) : html); 11373 }); 11374 }, 11375 unwrap: function unwrap(selector) { 11376 this.parent(selector).not("body").each(function () { 11377 _jQuery2(this).replaceWith(this.childNodes); 11378 }); 11379 return this; 11380 } 11381 }); 11382 _jQuery2.expr.pseudos.hidden = function (elem) { 11383 return !_jQuery2.expr.pseudos.visible(elem); 11384 }; 11385 _jQuery2.expr.pseudos.visible = function (elem) { 11386 return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length); 11387 }; 11388 _jQuery2.ajaxSettings.xhr = function () { 11389 try { 11390 return new window.XMLHttpRequest(); 11391 } catch (e) {} 11392 }; 11393 var xhrSuccessStatus = { 11394 // File protocol always yields status code 0, assume 200 11395 0: 200, 11396 // Support: IE <=9 only 11397 // trac-1450: sometimes IE returns 1223 when it should be 204 11398 1223: 204 11399 }, 11400 xhrSupported = _jQuery2.ajaxSettings.xhr(); 11401 support.cors = !!xhrSupported && "withCredentials" in xhrSupported; 11402 support.ajax = xhrSupported = !!xhrSupported; 11403 _jQuery2.ajaxTransport(function (options) { 11404 var _callback, errorCallback; 11405 11406 // Cross domain only allowed if supported through XMLHttpRequest 11407 if (support.cors || xhrSupported && !options.crossDomain) { 11408 return { 11409 send: function send(headers, complete) { 11410 var i, 11411 xhr = options.xhr(); 11412 xhr.open(options.type, options.url, options.async, options.username, options.password); 11413 11414 // Apply custom fields if provided 11415 if (options.xhrFields) { 11416 for (i in options.xhrFields) { 11417 xhr[i] = options.xhrFields[i]; 11418 } 11419 } 11420 11421 // Override mime type if needed 11422 if (options.mimeType && xhr.overrideMimeType) { 11423 xhr.overrideMimeType(options.mimeType); 11424 } 11425 11426 // X-Requested-With header 11427 // For cross-domain requests, seeing as conditions for a preflight are 11428 // akin to a jigsaw puzzle, we simply never set it to be sure. 11429 // (it can always be set on a per-request basis or even using ajaxSetup) 11430 // For same-domain requests, won't change header if already provided. 11431 if (!options.crossDomain && !headers["X-Requested-With"]) { 11432 headers["X-Requested-With"] = "XMLHttpRequest"; 11433 } 11434 11435 // Set headers 11436 for (i in headers) { 11437 xhr.setRequestHeader(i, headers[i]); 11438 } 11439 11440 // Callback 11441 _callback = function callback(type) { 11442 return function () { 11443 if (_callback) { 11444 _callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null; 11445 if (type === "abort") { 11446 xhr.abort(); 11447 } else if (type === "error") { 11448 // Support: IE <=9 only 11449 // On a manual native abort, IE9 throws 11450 // errors on any property access that is not readyState 11451 if (typeof xhr.status !== "number") { 11452 complete(0, "error"); 11453 } else { 11454 complete( 11455 // File: protocol always yields status 0; see trac-8605, trac-14207 11456 xhr.status, xhr.statusText); 11457 } 11458 } else { 11459 complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText, 11460 // Support: IE <=9 only 11461 // IE9 has no XHR2 but throws on binary (trac-11426) 11462 // For XHR2 non-text, let the caller handle it (gh-2498) 11463 (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { 11464 binary: xhr.response 11465 } : { 11466 text: xhr.responseText 11467 }, xhr.getAllResponseHeaders()); 11468 } 11469 } 11470 }; 11471 }; 11472 11473 // Listen to events 11474 xhr.onload = _callback(); 11475 errorCallback = xhr.onerror = xhr.ontimeout = _callback("error"); 11476 11477 // Support: IE 9 only 11478 // Use onreadystatechange to replace onabort 11479 // to handle uncaught aborts 11480 if (xhr.onabort !== undefined) { 11481 xhr.onabort = errorCallback; 11482 } else { 11483 xhr.onreadystatechange = function () { 11484 // Check readyState before timeout as it changes 11485 if (xhr.readyState === 4) { 11486 // Allow onerror to be called first, 11487 // but that will not handle a native abort 11488 // Also, save errorCallback to a variable 11489 // as xhr.onerror cannot be accessed 11490 window.setTimeout(function () { 11491 if (_callback) { 11492 errorCallback(); 11493 } 11494 }); 11495 } 11496 }; 11497 } 11498 11499 // Create the abort callback 11500 _callback = _callback("abort"); 11501 try { 11502 // Do send the request (this may raise an exception) 11503 xhr.send(options.hasContent && options.data || null); 11504 } catch (e) { 11505 // trac-14683: Only rethrow if this hasn't been notified as an error yet 11506 if (_callback) { 11507 throw e; 11508 } 11509 } 11510 }, 11511 abort: function abort() { 11512 if (_callback) { 11513 _callback(); 11514 } 11515 } 11516 }; 11517 } 11518 }); 11519 11520 // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 11521 _jQuery2.ajaxPrefilter(function (s) { 11522 if (s.crossDomain) { 11523 s.contents.script = false; 11524 } 11525 }); 11526 11527 // Install script dataType 11528 _jQuery2.ajaxSetup({ 11529 accepts: { 11530 script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript" 11531 }, 11532 contents: { 11533 script: /\b(?:java|ecma)script\b/ 11534 }, 11535 converters: { 11536 "text script": function text_script(text) { 11537 _jQuery2.globalEval(text); 11538 return text; 11539 } 11540 } 11541 }); 11542 11543 // Handle cache's special case and crossDomain 11544 _jQuery2.ajaxPrefilter("script", function (s) { 11545 if (s.cache === undefined) { 11546 s.cache = false; 11547 } 11548 if (s.crossDomain) { 11549 s.type = "GET"; 11550 } 11551 }); 11552 11553 // Bind script tag hack transport 11554 _jQuery2.ajaxTransport("script", function (s) { 11555 // This transport only deals with cross domain or forced-by-attrs requests 11556 if (s.crossDomain || s.scriptAttrs) { 11557 var script, _callback2; 11558 return { 11559 send: function send(_, complete) { 11560 script = _jQuery2("<script>").attr(s.scriptAttrs || {}).prop({ 11561 charset: s.scriptCharset, 11562 src: s.url 11563 }).on("load error", _callback2 = function callback(evt) { 11564 script.remove(); 11565 _callback2 = null; 11566 if (evt) { 11567 complete(evt.type === "error" ? 404 : 200, evt.type); 11568 } 11569 }); 11570 11571 // Use native DOM manipulation to avoid our domManip AJAX trickery 11572 document.head.appendChild(script[0]); 11573 }, 11574 abort: function abort() { 11575 if (_callback2) { 11576 _callback2(); 11577 } 11578 } 11579 }; 11580 } 11581 }); 11582 var oldCallbacks = [], 11583 rjsonp = /(=)\?(?=&|$)|\?\?/; 11584 11585 // Default jsonp settings 11586 _jQuery2.ajaxSetup({ 11587 jsonp: "callback", 11588 jsonpCallback: function jsonpCallback() { 11589 var callback = oldCallbacks.pop() || _jQuery2.expando + "_" + nonce.guid++; 11590 this[callback] = true; 11591 return callback; 11592 } 11593 }); 11594 11595 // Detect, normalize options and install callbacks for jsonp requests 11596 _jQuery2.ajaxPrefilter("json jsonp", function (s, originalSettings, jqXHR) { 11597 var callbackName, 11598 overwritten, 11599 responseContainer, 11600 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"); 11601 11602 // Handle iff the expected data type is "jsonp" or we have a parameter to set 11603 if (jsonProp || s.dataTypes[0] === "jsonp") { 11604 // Get callback name, remembering preexisting value associated with it 11605 callbackName = s.jsonpCallback = isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback; 11606 11607 // Insert callback into url or form data 11608 if (jsonProp) { 11609 s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName); 11610 } else if (s.jsonp !== false) { 11611 s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName; 11612 } 11613 11614 // Use data converter to retrieve json after script execution 11615 s.converters["script json"] = function () { 11616 if (!responseContainer) { 11617 _jQuery2.error(callbackName + " was not called"); 11618 } 11619 return responseContainer[0]; 11620 }; 11621 11622 // Force json dataType 11623 s.dataTypes[0] = "json"; 11624 11625 // Install callback 11626 overwritten = window[callbackName]; 11627 window[callbackName] = function () { 11628 responseContainer = arguments; 11629 }; 11630 11631 // Clean-up function (fires after converters) 11632 jqXHR.always(function () { 11633 // If previous value didn't exist - remove it 11634 if (overwritten === undefined) { 11635 _jQuery2(window).removeProp(callbackName); 11636 11637 // Otherwise restore preexisting value 11638 } else { 11639 window[callbackName] = overwritten; 11640 } 11641 11642 // Save back as free 11643 if (s[callbackName]) { 11644 // Make sure that re-using the options doesn't screw things around 11645 s.jsonpCallback = originalSettings.jsonpCallback; 11646 11647 // Save the callback name for future use 11648 oldCallbacks.push(callbackName); 11649 } 11650 11651 // Call if it was a function and we have a response 11652 if (responseContainer && isFunction(overwritten)) { 11653 overwritten(responseContainer[0]); 11654 } 11655 responseContainer = overwritten = undefined; 11656 }); 11657 11658 // Delegate to script 11659 return "script"; 11660 } 11661 }); 11662 11663 // Support: Safari 8 only 11664 // In Safari 8 documents created via document.implementation.createHTMLDocument 11665 // collapse sibling forms: the second one becomes a child of the first one. 11666 // Because of that, this security measure has to be disabled in Safari 8. 11667 // https://bugs.webkit.org/show_bug.cgi?id=137337 11668 support.createHTMLDocument = function () { 11669 var body = document.implementation.createHTMLDocument("").body; 11670 body.innerHTML = "<form></form><form></form>"; 11671 return body.childNodes.length === 2; 11672 }(); 11673 11674 // Argument "data" should be string of html 11675 // context (optional): If specified, the fragment will be created in this context, 11676 // defaults to document 11677 // keepScripts (optional): If true, will include scripts passed in the html string 11678 _jQuery2.parseHTML = function (data, context, keepScripts) { 11679 if (typeof data !== "string") { 11680 return []; 11681 } 11682 if (typeof context === "boolean") { 11683 keepScripts = context; 11684 context = false; 11685 } 11686 var base, parsed, scripts; 11687 if (!context) { 11688 // Stop scripts or inline event handlers from being executed immediately 11689 // by using document.implementation 11690 if (support.createHTMLDocument) { 11691 context = document.implementation.createHTMLDocument(""); 11692 11693 // Set the base href for the created document 11694 // so any parsed elements with URLs 11695 // are based on the document's URL (gh-2965) 11696 base = context.createElement("base"); 11697 base.href = document.location.href; 11698 context.head.appendChild(base); 11699 } else { 11700 context = document; 11701 } 11702 } 11703 parsed = rsingleTag.exec(data); 11704 scripts = !keepScripts && []; 11705 11706 // Single tag 11707 if (parsed) { 11708 return [context.createElement(parsed[1])]; 11709 } 11710 parsed = buildFragment([data], context, scripts); 11711 if (scripts && scripts.length) { 11712 _jQuery2(scripts).remove(); 11713 } 11714 return _jQuery2.merge([], parsed.childNodes); 11715 }; 11716 11717 /** 11718 * Load a url into a page 11719 */ 11720 _jQuery2.fn.load = function (url, params, callback) { 11721 var selector, 11722 type, 11723 response, 11724 self = this, 11725 off = url.indexOf(" "); 11726 if (off > -1) { 11727 selector = stripAndCollapse(url.slice(off)); 11728 url = url.slice(0, off); 11729 } 11730 11731 // If it's a function 11732 if (isFunction(params)) { 11733 // We assume that it's the callback 11734 callback = params; 11735 params = undefined; 11736 11737 // Otherwise, build a param string 11738 } else if (params && _typeof(params) === "object") { 11739 type = "POST"; 11740 } 11741 11742 // If we have elements to modify, make the request 11743 if (self.length > 0) { 11744 _jQuery2.ajax({ 11745 url: url, 11746 // If "type" variable is undefined, then "GET" method will be used. 11747 // Make value of this field explicit since 11748 // user can override it through ajaxSetup method 11749 type: type || "GET", 11750 dataType: "html", 11751 data: params 11752 }).done(function (responseText) { 11753 // Save response for use in complete callback 11754 response = arguments; 11755 self.html(selector ? 11756 // If a selector was specified, locate the right elements in a dummy div 11757 // Exclude scripts to avoid IE 'Permission Denied' errors 11758 _jQuery2("<div>").append(_jQuery2.parseHTML(responseText)).find(selector) : 11759 // Otherwise use the full result 11760 responseText); 11761 11762 // If the request succeeds, this function gets "data", "status", "jqXHR" 11763 // but they are ignored because response was set above. 11764 // If it fails, this function gets "jqXHR", "status", "error" 11765 }).always(callback && function (jqXHR, status) { 11766 self.each(function () { 11767 callback.apply(this, response || [jqXHR.responseText, status, jqXHR]); 11768 }); 11769 }); 11770 } 11771 return this; 11772 }; 11773 _jQuery2.expr.pseudos.animated = function (elem) { 11774 return _jQuery2.grep(_jQuery2.timers, function (fn) { 11775 return elem === fn.elem; 11776 }).length; 11777 }; 11778 _jQuery2.offset = { 11779 setOffset: function setOffset(elem, options, i) { 11780 var curPosition, 11781 curLeft, 11782 curCSSTop, 11783 curTop, 11784 curOffset, 11785 curCSSLeft, 11786 calculatePosition, 11787 position = _jQuery2.css(elem, "position"), 11788 curElem = _jQuery2(elem), 11789 props = {}; 11790 11791 // Set position first, in-case top/left are set even on static elem 11792 if (position === "static") { 11793 elem.style.position = "relative"; 11794 } 11795 curOffset = curElem.offset(); 11796 curCSSTop = _jQuery2.css(elem, "top"); 11797 curCSSLeft = _jQuery2.css(elem, "left"); 11798 calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1; 11799 11800 // Need to be able to calculate position if either 11801 // top or left is auto and position is either absolute or fixed 11802 if (calculatePosition) { 11803 curPosition = curElem.position(); 11804 curTop = curPosition.top; 11805 curLeft = curPosition.left; 11806 } else { 11807 curTop = parseFloat(curCSSTop) || 0; 11808 curLeft = parseFloat(curCSSLeft) || 0; 11809 } 11810 if (isFunction(options)) { 11811 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 11812 options = options.call(elem, i, _jQuery2.extend({}, curOffset)); 11813 } 11814 if (options.top != null) { 11815 props.top = options.top - curOffset.top + curTop; 11816 } 11817 if (options.left != null) { 11818 props.left = options.left - curOffset.left + curLeft; 11819 } 11820 if ("using" in options) { 11821 options.using.call(elem, props); 11822 } else { 11823 curElem.css(props); 11824 } 11825 } 11826 }; 11827 _jQuery2.fn.extend({ 11828 // offset() relates an element's border box to the document origin 11829 offset: function offset(options) { 11830 // Preserve chaining for setter 11831 if (arguments.length) { 11832 return options === undefined ? this : this.each(function (i) { 11833 _jQuery2.offset.setOffset(this, options, i); 11834 }); 11835 } 11836 var rect, 11837 win, 11838 elem = this[0]; 11839 if (!elem) { 11840 return; 11841 } 11842 11843 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 11844 // Support: IE <=11 only 11845 // Running getBoundingClientRect on a 11846 // disconnected node in IE throws an error 11847 if (!elem.getClientRects().length) { 11848 return { 11849 top: 0, 11850 left: 0 11851 }; 11852 } 11853 11854 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 11855 rect = elem.getBoundingClientRect(); 11856 win = elem.ownerDocument.defaultView; 11857 return { 11858 top: rect.top + win.pageYOffset, 11859 left: rect.left + win.pageXOffset 11860 }; 11861 }, 11862 // position() relates an element's margin box to its offset parent's padding box 11863 // This corresponds to the behavior of CSS absolute positioning 11864 position: function position() { 11865 if (!this[0]) { 11866 return; 11867 } 11868 var offsetParent, 11869 offset, 11870 doc, 11871 elem = this[0], 11872 parentOffset = { 11873 top: 0, 11874 left: 0 11875 }; 11876 11877 // position:fixed elements are offset from the viewport, which itself always has zero offset 11878 if (_jQuery2.css(elem, "position") === "fixed") { 11879 // Assume position:fixed implies availability of getBoundingClientRect 11880 offset = elem.getBoundingClientRect(); 11881 } else { 11882 offset = this.offset(); 11883 11884 // Account for the *real* offset parent, which can be the document or its root element 11885 // when a statically positioned element is identified 11886 doc = elem.ownerDocument; 11887 offsetParent = elem.offsetParent || doc.documentElement; 11888 while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && _jQuery2.css(offsetParent, "position") === "static") { 11889 offsetParent = offsetParent.parentNode; 11890 } 11891 if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) { 11892 // Incorporate borders into its offset, since they are outside its content origin 11893 parentOffset = _jQuery2(offsetParent).offset(); 11894 parentOffset.top += _jQuery2.css(offsetParent, "borderTopWidth", true); 11895 parentOffset.left += _jQuery2.css(offsetParent, "borderLeftWidth", true); 11896 } 11897 } 11898 11899 // Subtract parent offsets and element margins 11900 return { 11901 top: offset.top - parentOffset.top - _jQuery2.css(elem, "marginTop", true), 11902 left: offset.left - parentOffset.left - _jQuery2.css(elem, "marginLeft", true) 11903 }; 11904 }, 11905 // This method will return documentElement in the following cases: 11906 // 1) For the element inside the iframe without offsetParent, this method will return 11907 // documentElement of the parent window 11908 // 2) For the hidden or detached element 11909 // 3) For body or html element, i.e. in case of the html node - it will return itself 11910 // 11911 // but those exceptions were never presented as a real life use-cases 11912 // and might be considered as more preferable results. 11913 // 11914 // This logic, however, is not guaranteed and can change at any point in the future 11915 offsetParent: function offsetParent() { 11916 return this.map(function () { 11917 var offsetParent = this.offsetParent; 11918 while (offsetParent && _jQuery2.css(offsetParent, "position") === "static") { 11919 offsetParent = offsetParent.offsetParent; 11920 } 11921 return offsetParent || documentElement; 11922 }); 11923 } 11924 }); 11925 11926 // Create scrollLeft and scrollTop methods 11927 _jQuery2.each({ 11928 scrollLeft: "pageXOffset", 11929 scrollTop: "pageYOffset" 11930 }, function (method, prop) { 11931 var top = "pageYOffset" === prop; 11932 _jQuery2.fn[method] = function (val) { 11933 return _access(this, function (elem, method, val) { 11934 // Coalesce documents and windows 11935 var win; 11936 if (isWindow(elem)) { 11937 win = elem; 11938 } else if (elem.nodeType === 9) { 11939 win = elem.defaultView; 11940 } 11941 if (val === undefined) { 11942 return win ? win[prop] : elem[method]; 11943 } 11944 if (win) { 11945 win.scrollTo(!top ? val : win.pageXOffset, top ? val : win.pageYOffset); 11946 } else { 11947 elem[method] = val; 11948 } 11949 }, method, val, arguments.length); 11950 }; 11951 }); 11952 11953 // Support: Safari <=7 - 9.1, Chrome <=37 - 49 11954 // Add the top/left cssHooks using jQuery.fn.position 11955 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 11956 // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 11957 // getComputedStyle returns percent when specified for top/left/bottom/right; 11958 // rather than make the css module depend on the offset module, just check for it here 11959 _jQuery2.each(["top", "left"], function (_i, prop) { 11960 _jQuery2.cssHooks[prop] = addGetHookIf(support.pixelPosition, function (elem, computed) { 11961 if (computed) { 11962 computed = curCSS(elem, prop); 11963 11964 // If curCSS returns percentage, fallback to offset 11965 return rnumnonpx.test(computed) ? _jQuery2(elem).position()[prop] + "px" : computed; 11966 } 11967 }); 11968 }); 11969 11970 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 11971 _jQuery2.each({ 11972 Height: "height", 11973 Width: "width" 11974 }, function (name, type) { 11975 _jQuery2.each({ 11976 padding: "inner" + name, 11977 content: type, 11978 "": "outer" + name 11979 }, function (defaultExtra, funcName) { 11980 // Margin is only for outerHeight, outerWidth 11981 _jQuery2.fn[funcName] = function (margin, value) { 11982 var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), 11983 extra = defaultExtra || (margin === true || value === true ? "margin" : "border"); 11984 return _access(this, function (elem, type, value) { 11985 var doc; 11986 if (isWindow(elem)) { 11987 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 11988 return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name]; 11989 } 11990 11991 // Get document width or height 11992 if (elem.nodeType === 9) { 11993 doc = elem.documentElement; 11994 11995 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 11996 // whichever is greatest 11997 return Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name]); 11998 } 11999 return value === undefined ? 12000 // Get width or height on the element, requesting but not forcing parseFloat 12001 _jQuery2.css(elem, type, extra) : 12002 // Set width or height on the element 12003 _jQuery2.style(elem, type, value, extra); 12004 }, type, chainable ? margin : undefined, chainable); 12005 }; 12006 }); 12007 }); 12008 _jQuery2.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (_i, type) { 12009 _jQuery2.fn[type] = function (fn) { 12010 return this.on(type, fn); 12011 }; 12012 }); 12013 _jQuery2.fn.extend({ 12014 bind: function bind(types, data, fn) { 12015 return this.on(types, null, data, fn); 12016 }, 12017 unbind: function unbind(types, fn) { 12018 return this.off(types, null, fn); 12019 }, 12020 delegate: function delegate(selector, types, data, fn) { 12021 return this.on(types, selector, data, fn); 12022 }, 12023 undelegate: function undelegate(selector, types, fn) { 12024 // ( namespace ) or ( selector, types [, fn] ) 12025 return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn); 12026 }, 12027 hover: function hover(fnOver, fnOut) { 12028 return this.on("mouseenter", fnOver).on("mouseleave", fnOut || fnOver); 12029 } 12030 }); 12031 _jQuery2.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) { 12032 // Handle event binding 12033 _jQuery2.fn[name] = function (data, fn) { 12034 return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name); 12035 }; 12036 }); 12037 12038 // Support: Android <=4.0 only 12039 // Make sure we trim BOM and NBSP 12040 // Require that the "whitespace run" starts from a non-whitespace 12041 // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. 12042 var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; 12043 12044 // Bind a function to a context, optionally partially applying any 12045 // arguments. 12046 // jQuery.proxy is deprecated to promote standards (specifically Function#bind) 12047 // However, it is not slated for removal any time soon 12048 _jQuery2.proxy = function (fn, context) { 12049 var tmp, args, proxy; 12050 if (typeof context === "string") { 12051 tmp = fn[context]; 12052 context = fn; 12053 fn = tmp; 12054 } 12055 12056 // Quick check to determine if target is callable, in the spec 12057 // this throws a TypeError, but we will just return undefined. 12058 if (!isFunction(fn)) { 12059 return undefined; 12060 } 12061 12062 // Simulated bind 12063 args = _slice.call(arguments, 2); 12064 proxy = function proxy() { 12065 return fn.apply(context || this, args.concat(_slice.call(arguments))); 12066 }; 12067 12068 // Set the guid of unique handler to the same of original handler, so it can be removed 12069 proxy.guid = fn.guid = fn.guid || _jQuery2.guid++; 12070 return proxy; 12071 }; 12072 _jQuery2.holdReady = function (hold) { 12073 if (hold) { 12074 _jQuery2.readyWait++; 12075 } else { 12076 _jQuery2.ready(true); 12077 } 12078 }; 12079 _jQuery2.isArray = Array.isArray; 12080 _jQuery2.parseJSON = JSON.parse; 12081 _jQuery2.nodeName = nodeName; 12082 _jQuery2.isFunction = isFunction; 12083 _jQuery2.isWindow = isWindow; 12084 _jQuery2.camelCase = camelCase; 12085 _jQuery2.type = toType; 12086 _jQuery2.now = Date.now; 12087 _jQuery2.isNumeric = function (obj) { 12088 // As of jQuery 3.0, isNumeric is limited to 12089 // strings and numbers (primitives or objects) 12090 // that can be coerced to finite numbers (gh-2662) 12091 var type = _jQuery2.type(obj); 12092 return (type === "number" || type === "string") && 12093 // parseFloat NaNs numeric-cast false positives ("") 12094 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 12095 // subtraction forces infinities to NaN 12096 !isNaN(obj - parseFloat(obj)); 12097 }; 12098 _jQuery2.trim = function (text) { 12099 return text == null ? "" : (text + "").replace(rtrim, "$1"); 12100 }; 12101 12102 // Register as a named AMD module, since jQuery can be concatenated with other 12103 // files that may use define, but not via a proper concatenation script that 12104 // understands anonymous AMD modules. A named AMD is safest and most robust 12105 // way to register. Lowercase jquery is used because AMD module names are 12106 // derived from file names, and jQuery is normally delivered in a lowercase 12107 // file name. Do this after creating the global so that if an AMD module wants 12108 // to call noConflict to hide this version of jQuery, it will work. 12109 12110 // Note that for maximum portability, libraries that are not jQuery should 12111 // declare themselves as anonymous modules, and avoid setting a global if an 12112 // AMD loader is present. jQuery is a special case. For more information, see 12113 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 12114 12115 if (true) { 12116 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 12117 return _jQuery2; 12118 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 12119 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 12120 } 12121 var 12122 // Map over jQuery in case of overwrite 12123 _jQuery = window.jQuery, 12124 // Map over the $ in case of overwrite 12125 _$ = window.$; 12126 _jQuery2.noConflict = function (deep) { 12127 if (window.$ === _jQuery2) { 12128 window.$ = _$; 12129 } 12130 if (deep && window.jQuery === _jQuery2) { 12131 window.jQuery = _jQuery; 12132 } 12133 return _jQuery2; 12134 }; 12135 12136 // Expose jQuery and $ identifiers, even in AMD 12137 // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557) 12138 // and CommonJS for browser emulators (trac-13566) 12139 if (typeof noGlobal === "undefined") { 12140 window.jQuery = window.$ = _jQuery2; 12141 } 12142 return _jQuery2; 12143}); 12144 12145/***/ }), 12146
vendor: 429 bytes, lines 12147-12160
12147/***/ "./node_modules/lodash/_Symbol.js": 12148/*!****************************************!*\ 12149 !*** ./node_modules/lodash/_Symbol.js ***! 12150 \****************************************/ 12151/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12152 12153var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); 12154 12155/** Built-in value references. */ 12156var _Symbol = root.Symbol; 12157module.exports = _Symbol; 12158 12159/***/ }), 12160
vendor: 1,221 bytes, lines 12161-12194
12161/***/ "./node_modules/lodash/_baseGetTag.js": 12162/*!********************************************!*\ 12163 !*** ./node_modules/lodash/_baseGetTag.js ***! 12164 \********************************************/ 12165/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12166 12167var _Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), 12168 getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"), 12169 objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js"); 12170 12171/** `Object#toString` result references. */ 12172var nullTag = '[object Null]', 12173 undefinedTag = '[object Undefined]'; 12174 12175/** Built-in value references. */ 12176var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; 12177 12178/** 12179 * The base implementation of `getTag` without fallbacks for buggy environments. 12180 * 12181 * @private 12182 * @param {*} value The value to query. 12183 * @returns {string} Returns the `toStringTag`. 12184 */ 12185function baseGetTag(value) { 12186 if (value == null) { 12187 return value === undefined ? undefinedTag : nullTag; 12188 } 12189 return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); 12190} 12191module.exports = baseGetTag; 12192 12193/***/ }), 12194
vendor: 764 bytes, lines 12195-12219
12195/***/ "./node_modules/lodash/_baseTrim.js": 12196/*!******************************************!*\ 12197 !*** ./node_modules/lodash/_baseTrim.js ***! 12198 \******************************************/ 12199/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12200 12201var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js"); 12202 12203/** Used to match leading whitespace. */ 12204var reTrimStart = /^\s+/; 12205 12206/** 12207 * The base implementation of `_.trim`. 12208 * 12209 * @private 12210 * @param {string} string The string to trim. 12211 * @returns {string} Returns the trimmed string. 12212 */ 12213function baseTrim(string) { 12214 return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string; 12215} 12216module.exports = baseTrim; 12217 12218/***/ }), 12219
vendor: 892 bytes, lines 12220-12232
12220/***/ "./node_modules/lodash/_freeGlobal.js": 12221/*!********************************************!*\ 12222 !*** ./node_modules/lodash/_freeGlobal.js ***! 12223 \********************************************/ 12224/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12225 12226function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 12227/** Detect free variable `global` from Node.js. */ 12228var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; 12229module.exports = freeGlobal; 12230 12231/***/ }), 12232
vendor: 1,461 bytes, lines 12233-12284
12233/***/ "./node_modules/lodash/_getRawTag.js": 12234/*!*******************************************!*\ 12235 !*** ./node_modules/lodash/_getRawTag.js ***! 12236 \*******************************************/ 12237/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12238 12239var _Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); 12240 12241/** Used for built-in method references. */ 12242var objectProto = Object.prototype; 12243 12244/** Used to check objects for own properties. */ 12245var hasOwnProperty = objectProto.hasOwnProperty; 12246 12247/** 12248 * Used to resolve the 12249 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 12250 * of values. 12251 */ 12252var nativeObjectToString = objectProto.toString; 12253 12254/** Built-in value references. */ 12255var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; 12256 12257/** 12258 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 12259 * 12260 * @private 12261 * @param {*} value The value to query. 12262 * @returns {string} Returns the raw `toStringTag`. 12263 */ 12264function getRawTag(value) { 12265 var isOwn = hasOwnProperty.call(value, symToStringTag), 12266 tag = value[symToStringTag]; 12267 try { 12268 value[symToStringTag] = undefined; 12269 var unmasked = true; 12270 } catch (e) {} 12271 var result = nativeObjectToString.call(value); 12272 if (unmasked) { 12273 if (isOwn) { 12274 value[symToStringTag] = tag; 12275 } else { 12276 delete value[symToStringTag]; 12277 } 12278 } 12279 return result; 12280} 12281module.exports = getRawTag; 12282 12283/***/ }), 12284
vendor: 809 bytes, lines 12285-12314
12285/***/ "./node_modules/lodash/_objectToString.js": 12286/*!************************************************!*\ 12287 !*** ./node_modules/lodash/_objectToString.js ***! 12288 \************************************************/ 12289/***/ ((module) => { 12290 12291/** Used for built-in method references. */ 12292var objectProto = Object.prototype; 12293 12294/** 12295 * Used to resolve the 12296 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 12297 * of values. 12298 */ 12299var nativeObjectToString = objectProto.toString; 12300 12301/** 12302 * Converts `value` to a string using `Object.prototype.toString`. 12303 * 12304 * @private 12305 * @param {*} value The value to convert. 12306 * @returns {string} Returns the converted string. 12307 */ 12308function objectToString(value) { 12309 return nativeObjectToString.call(value); 12310} 12311module.exports = objectToString; 12312 12313/***/ }), 12314
vendor: 974 bytes, lines 12315-12332
12315/***/ "./node_modules/lodash/_root.js": 12316/*!**************************************!*\ 12317 !*** ./node_modules/lodash/_root.js ***! 12318 \**************************************/ 12319/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12320 12321function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 12322var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); 12323 12324/** Detect free variable `self`. */ 12325var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self; 12326 12327/** Used as a reference to the global object. */ 12328var root = freeGlobal || freeSelf || Function('return this')(); 12329module.exports = root; 12330 12331/***/ }), 12332
vendor: 762 bytes, lines 12333-12358
12333/***/ "./node_modules/lodash/_trimmedEndIndex.js": 12334/*!*************************************************!*\ 12335 !*** ./node_modules/lodash/_trimmedEndIndex.js ***! 12336 \*************************************************/ 12337/***/ ((module) => { 12338 12339/** Used to match a single whitespace character. */ 12340var reWhitespace = /\s/; 12341 12342/** 12343 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 12344 * character of `string`. 12345 * 12346 * @private 12347 * @param {string} string The string to inspect. 12348 * @returns {number} Returns the index of the last non-whitespace character. 12349 */ 12350function trimmedEndIndex(string) { 12351 var index = string.length; 12352 while (index-- && reWhitespace.test(string.charAt(index))) {} 12353 return index; 12354} 12355module.exports = trimmedEndIndex; 12356 12357/***/ }), 12358
vendor: 6,443 bytes, lines 12359-12540
12359/***/ "./node_modules/lodash/debounce.js": 12360/*!*****************************************!*\ 12361 !*** ./node_modules/lodash/debounce.js ***! 12362 \*****************************************/ 12363/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12364 12365var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), 12366 now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"), 12367 toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js"); 12368 12369/** Error message constants. */ 12370var FUNC_ERROR_TEXT = 'Expected a function'; 12371 12372/* Built-in method references for those with the same name as other `lodash` methods. */ 12373var nativeMax = Math.max, 12374 nativeMin = Math.min; 12375 12376/** 12377 * Creates a debounced function that delays invoking `func` until after `wait` 12378 * milliseconds have elapsed since the last time the debounced function was 12379 * invoked. The debounced function comes with a `cancel` method to cancel 12380 * delayed `func` invocations and a `flush` method to immediately invoke them. 12381 * Provide `options` to indicate whether `func` should be invoked on the 12382 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 12383 * with the last arguments provided to the debounced function. Subsequent 12384 * calls to the debounced function return the result of the last `func` 12385 * invocation. 12386 * 12387 * **Note:** If `leading` and `trailing` options are `true`, `func` is 12388 * invoked on the trailing edge of the timeout only if the debounced function 12389 * is invoked more than once during the `wait` timeout. 12390 * 12391 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 12392 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 12393 * 12394 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 12395 * for details over the differences between `_.debounce` and `_.throttle`. 12396 * 12397 * @static 12398 * @memberOf _ 12399 * @since 0.1.0 12400 * @category Function 12401 * @param {Function} func The function to debounce. 12402 * @param {number} [wait=0] The number of milliseconds to delay. 12403 * @param {Object} [options={}] The options object. 12404 * @param {boolean} [options.leading=false] 12405 * Specify invoking on the leading edge of the timeout. 12406 * @param {number} [options.maxWait] 12407 * The maximum time `func` is allowed to be delayed before it's invoked. 12408 * @param {boolean} [options.trailing=true] 12409 * Specify invoking on the trailing edge of the timeout. 12410 * @returns {Function} Returns the new debounced function. 12411 * @example 12412 * 12413 * // Avoid costly calculations while the window size is in flux. 12414 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 12415 * 12416 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 12417 * jQuery(element).on('click', _.debounce(sendMail, 300, { 12418 * 'leading': true, 12419 * 'trailing': false 12420 * })); 12421 * 12422 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 12423 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 12424 * var source = new EventSource('/stream'); 12425 * jQuery(source).on('message', debounced); 12426 * 12427 * // Cancel the trailing debounced invocation. 12428 * jQuery(window).on('popstate', debounced.cancel); 12429 */ 12430function debounce(func, wait, options) { 12431 var lastArgs, 12432 lastThis, 12433 maxWait, 12434 result, 12435 timerId, 12436 lastCallTime, 12437 lastInvokeTime = 0, 12438 leading = false, 12439 maxing = false, 12440 trailing = true; 12441 if (typeof func != 'function') { 12442 throw new TypeError(FUNC_ERROR_TEXT); 12443 } 12444 wait = toNumber(wait) || 0; 12445 if (isObject(options)) { 12446 leading = !!options.leading; 12447 maxing = 'maxWait' in options; 12448 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 12449 trailing = 'trailing' in options ? !!options.trailing : trailing; 12450 } 12451 function invokeFunc(time) { 12452 var args = lastArgs, 12453 thisArg = lastThis; 12454 lastArgs = lastThis = undefined; 12455 lastInvokeTime = time; 12456 result = func.apply(thisArg, args); 12457 return result; 12458 } 12459 function leadingEdge(time) { 12460 // Reset any `maxWait` timer. 12461 lastInvokeTime = time; 12462 // Start the timer for the trailing edge. 12463 timerId = setTimeout(timerExpired, wait); 12464 // Invoke the leading edge. 12465 return leading ? invokeFunc(time) : result; 12466 } 12467 function remainingWait(time) { 12468 var timeSinceLastCall = time - lastCallTime, 12469 timeSinceLastInvoke = time - lastInvokeTime, 12470 timeWaiting = wait - timeSinceLastCall; 12471 return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; 12472 } 12473 function shouldInvoke(time) { 12474 var timeSinceLastCall = time - lastCallTime, 12475 timeSinceLastInvoke = time - lastInvokeTime; 12476 12477 // Either this is the first call, activity has stopped and we're at the 12478 // trailing edge, the system time has gone backwards and we're treating 12479 // it as the trailing edge, or we've hit the `maxWait` limit. 12480 return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; 12481 } 12482 function timerExpired() { 12483 var time = now(); 12484 if (shouldInvoke(time)) { 12485 return trailingEdge(time); 12486 } 12487 // Restart the timer. 12488 timerId = setTimeout(timerExpired, remainingWait(time)); 12489 } 12490 function trailingEdge(time) { 12491 timerId = undefined; 12492 12493 // Only invoke if we have `lastArgs` which means `func` has been 12494 // debounced at least once. 12495 if (trailing && lastArgs) { 12496 return invokeFunc(time); 12497 } 12498 lastArgs = lastThis = undefined; 12499 return result; 12500 } 12501 function cancel() { 12502 if (timerId !== undefined) { 12503 clearTimeout(timerId); 12504 } 12505 lastInvokeTime = 0; 12506 lastArgs = lastCallTime = lastThis = timerId = undefined; 12507 } 12508 function flush() { 12509 return timerId === undefined ? result : trailingEdge(now()); 12510 } 12511 function debounced() { 12512 var time = now(), 12513 isInvoking = shouldInvoke(time); 12514 lastArgs = arguments; 12515 lastThis = this; 12516 lastCallTime = time; 12517 if (isInvoking) { 12518 if (timerId === undefined) { 12519 return leadingEdge(lastCallTime); 12520 } 12521 if (maxing) { 12522 // Handle invocations in a tight loop. 12523 clearTimeout(timerId); 12524 timerId = setTimeout(timerExpired, wait); 12525 return invokeFunc(lastCallTime); 12526 } 12527 } 12528 if (timerId === undefined) { 12529 timerId = setTimeout(timerExpired, wait); 12530 } 12531 return result; 12532 } 12533 debounced.cancel = cancel; 12534 debounced.flush = flush; 12535 return debounced; 12536} 12537module.exports = debounce; 12538 12539/***/ }), 12540
vendor: 1,270 bytes, lines 12541-12580
12541/***/ "./node_modules/lodash/isObject.js": 12542/*!*****************************************!*\ 12543 !*** ./node_modules/lodash/isObject.js ***! 12544 \*****************************************/ 12545/***/ ((module) => { 12546 12547function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 12548/** 12549 * Checks if `value` is the 12550 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 12551 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 12552 * 12553 * @static 12554 * @memberOf _ 12555 * @since 0.1.0 12556 * @category Lang 12557 * @param {*} value The value to check. 12558 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 12559 * @example 12560 * 12561 * _.isObject({}); 12562 * // => true 12563 * 12564 * _.isObject([1, 2, 3]); 12565 * // => true 12566 * 12567 * _.isObject(_.noop); 12568 * // => true 12569 * 12570 * _.isObject(null); 12571 * // => false 12572 */ 12573function isObject(value) { 12574 var type = _typeof(value); 12575 return value != null && (type == 'object' || type == 'function'); 12576} 12577module.exports = isObject; 12578 12579/***/ }), 12580
vendor: 1,167 bytes, lines 12581-12618
12581/***/ "./node_modules/lodash/isObjectLike.js": 12582/*!*********************************************!*\ 12583 !*** ./node_modules/lodash/isObjectLike.js ***! 12584 \*********************************************/ 12585/***/ ((module) => { 12586 12587function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 12588/** 12589 * Checks if `value` is object-like. A value is object-like if it's not `null` 12590 * and has a `typeof` result of "object". 12591 * 12592 * @static 12593 * @memberOf _ 12594 * @since 4.0.0 12595 * @category Lang 12596 * @param {*} value The value to check. 12597 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 12598 * @example 12599 * 12600 * _.isObjectLike({}); 12601 * // => true 12602 * 12603 * _.isObjectLike([1, 2, 3]); 12604 * // => true 12605 * 12606 * _.isObjectLike(_.noop); 12607 * // => false 12608 * 12609 * _.isObjectLike(null); 12610 * // => false 12611 */ 12612function isObjectLike(value) { 12613 return value != null && _typeof(value) == 'object'; 12614} 12615module.exports = isObjectLike; 12616 12617/***/ }), 12618
vendor: 1,371 bytes, lines 12619-12655
12619/***/ "./node_modules/lodash/isSymbol.js": 12620/*!*****************************************!*\ 12621 !*** ./node_modules/lodash/isSymbol.js ***! 12622 \*****************************************/ 12623/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12624 12625function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 12626var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), 12627 isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); 12628 12629/** `Object#toString` result references. */ 12630var symbolTag = '[object Symbol]'; 12631 12632/** 12633 * Checks if `value` is classified as a `Symbol` primitive or object. 12634 * 12635 * @static 12636 * @memberOf _ 12637 * @since 4.0.0 12638 * @category Lang 12639 * @param {*} value The value to check. 12640 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 12641 * @example 12642 * 12643 * _.isSymbol(Symbol.iterator); 12644 * // => true 12645 * 12646 * _.isSymbol('abc'); 12647 * // => false 12648 */ 12649function isSymbol(value) { 12650 return _typeof(value) == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag; 12651} 12652module.exports = isSymbol; 12653 12654/***/ }), 12655
vendor: 817 bytes, lines 12656-12686
12656/***/ "./node_modules/lodash/now.js": 12657/*!************************************!*\ 12658 !*** ./node_modules/lodash/now.js ***! 12659 \************************************/ 12660/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12661 12662var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); 12663 12664/** 12665 * Gets the timestamp of the number of milliseconds that have elapsed since 12666 * the Unix epoch (1 January 1970 00:00:00 UTC). 12667 * 12668 * @static 12669 * @memberOf _ 12670 * @since 2.4.0 12671 * @category Date 12672 * @returns {number} Returns the timestamp. 12673 * @example 12674 * 12675 * _.defer(function(stamp) { 12676 * console.log(_.now() - stamp); 12677 * }, _.now()); 12678 * // => Logs the number of milliseconds it took for the deferred invocation. 12679 */ 12680var now = function now() { 12681 return root.Date.now(); 12682}; 12683module.exports = now; 12684 12685/***/ }), 12686
vendor: 1,924 bytes, lines 12687-12756
12687/***/ "./node_modules/lodash/toNumber.js": 12688/*!*****************************************!*\ 12689 !*** ./node_modules/lodash/toNumber.js ***! 12690 \*****************************************/ 12691/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 12692 12693var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"), 12694 isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), 12695 isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); 12696 12697/** Used as references for various `Number` constants. */ 12698var NAN = 0 / 0; 12699 12700/** Used to detect bad signed hexadecimal string values. */ 12701var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 12702 12703/** Used to detect binary string values. */ 12704var reIsBinary = /^0b[01]+$/i; 12705 12706/** Used to detect octal string values. */ 12707var reIsOctal = /^0o[0-7]+$/i; 12708 12709/** Built-in method references without a dependency on `root`. */ 12710var freeParseInt = parseInt; 12711 12712/** 12713 * Converts `value` to a number. 12714 * 12715 * @static 12716 * @memberOf _ 12717 * @since 4.0.0 12718 * @category Lang 12719 * @param {*} value The value to process. 12720 * @returns {number} Returns the number. 12721 * @example 12722 * 12723 * _.toNumber(3.2); 12724 * // => 3.2 12725 * 12726 * _.toNumber(Number.MIN_VALUE); 12727 * // => 5e-324 12728 * 12729 * _.toNumber(Infinity); 12730 * // => Infinity 12731 * 12732 * _.toNumber('3.2'); 12733 * // => 3.2 12734 */ 12735function toNumber(value) { 12736 if (typeof value == 'number') { 12737 return value; 12738 } 12739 if (isSymbol(value)) { 12740 return NAN; 12741 } 12742 if (isObject(value)) { 12743 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 12744 value = isObject(other) ? other + '' : other; 12745 } 12746 if (typeof value != 'string') { 12747 return value === 0 ? value : +value; 12748 } 12749 value = baseTrim(value); 12750 var isBinary = reIsBinary.test(value); 12751 return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; 12752} 12753module.exports = toNumber; 12754 12755/***/ }), 12756
vendor: 52,913 bytes, lines 12757-14350
12757/***/ "./node_modules/magnific-popup/dist/jquery.magnific-popup.js": 12758/*!*******************************************************************!*\ 12759 !*** ./node_modules/magnific-popup/dist/jquery.magnific-popup.js ***! 12760 \*******************************************************************/ 12761/***/ ((module, exports, __webpack_require__) => { 12762 12763var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 12764/*! Magnific Popup - v1.2.0 - 2024-06-08 12765* http://dimsemenov.com/plugins/magnific-popup/ 12766* Copyright (c) 2024 Dmytro Semenov; */ 12767; 12768(function (factory) { 12769 if (true) { 12770 // AMD. Register as an anonymous module. 12771 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 12772 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 12773 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 12774 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 12775 } else {} 12776})(function ($) { 12777 /*>>core*/ 12778 /** 12779 * 12780 * Magnific Popup Core JS file 12781 * 12782 */ 12783 12784 /** 12785 * Private static constants 12786 */ 12787 var CLOSE_EVENT = 'Close', 12788 BEFORE_CLOSE_EVENT = 'BeforeClose', 12789 AFTER_CLOSE_EVENT = 'AfterClose', 12790 BEFORE_APPEND_EVENT = 'BeforeAppend', 12791 MARKUP_PARSE_EVENT = 'MarkupParse', 12792 OPEN_EVENT = 'Open', 12793 CHANGE_EVENT = 'Change', 12794 NS = 'mfp', 12795 EVENT_NS = '.' + NS, 12796 READY_CLASS = 'mfp-ready', 12797 REMOVING_CLASS = 'mfp-removing', 12798 PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; 12799 12800 /** 12801 * Private vars 12802 */ 12803 /*jshint -W079 */ 12804 var mfp, 12805 // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' 12806 MagnificPopup = function MagnificPopup() {}, 12807 _isJQ = !!window.jQuery, 12808 _prevStatus, 12809 _window = $(window), 12810 _document, 12811 _prevContentType, 12812 _wrapClasses, 12813 _currPopupType; 12814 12815 /** 12816 * Private functions 12817 */ 12818 var _mfpOn = function _mfpOn(name, f) { 12819 mfp.ev.on(NS + name + EVENT_NS, f); 12820 }, 12821 _getEl = function _getEl(className, appendTo, html, raw) { 12822 var el = document.createElement('div'); 12823 el.className = 'mfp-' + className; 12824 if (html) { 12825 el.innerHTML = html; 12826 } 12827 if (!raw) { 12828 el = $(el); 12829 if (appendTo) { 12830 el.appendTo(appendTo); 12831 } 12832 } else if (appendTo) { 12833 appendTo.appendChild(el); 12834 } 12835 return el; 12836 }, 12837 _mfpTrigger = function _mfpTrigger(e, data) { 12838 mfp.ev.triggerHandler(NS + e, data); 12839 if (mfp.st.callbacks) { 12840 // converts "mfpEventName" to "eventName" callback and triggers it if it's present 12841 e = e.charAt(0).toLowerCase() + e.slice(1); 12842 if (mfp.st.callbacks[e]) { 12843 mfp.st.callbacks[e].apply(mfp, Array.isArray(data) ? data : [data]); 12844 } 12845 } 12846 }, 12847 _getCloseBtn = function _getCloseBtn(type) { 12848 if (type !== _currPopupType || !mfp.currTemplate.closeBtn) { 12849 mfp.currTemplate.closeBtn = $(mfp.st.closeMarkup.replace('%title%', mfp.st.tClose)); 12850 _currPopupType = type; 12851 } 12852 return mfp.currTemplate.closeBtn; 12853 }, 12854 // Initialize Magnific Popup only when called at least once 12855 _checkInstance = function _checkInstance() { 12856 if (!$.magnificPopup.instance) { 12857 /*jshint -W020 */ 12858 mfp = new MagnificPopup(); 12859 mfp.init(); 12860 $.magnificPopup.instance = mfp; 12861 } 12862 }, 12863 // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr 12864 supportsTransitions = function supportsTransitions() { 12865 var s = document.createElement('p').style, 12866 // 's' for style. better to create an element if body yet to exist 12867 v = ['ms', 'O', 'Moz', 'Webkit']; // 'v' for vendor 12868 12869 if (s['transition'] !== undefined) { 12870 return true; 12871 } 12872 while (v.length) { 12873 if (v.pop() + 'Transition' in s) { 12874 return true; 12875 } 12876 } 12877 return false; 12878 }; 12879 12880 /** 12881 * Public functions 12882 */ 12883 MagnificPopup.prototype = { 12884 constructor: MagnificPopup, 12885 /** 12886 * Initializes Magnific Popup plugin. 12887 * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed 12888 */ 12889 init: function init() { 12890 var appVersion = navigator.appVersion; 12891 mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener; 12892 mfp.isAndroid = /android/gi.test(appVersion); 12893 mfp.isIOS = /iphone|ipad|ipod/gi.test(appVersion); 12894 mfp.supportsTransition = supportsTransitions(); 12895 12896 // We disable fixed positioned lightbox on devices that don't handle it nicely. 12897 // If you know a better way of detecting this - let me know. 12898 mfp.probablyMobile = mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent); 12899 _document = $(document); 12900 mfp.popupsCache = {}; 12901 }, 12902 /** 12903 * Opens popup 12904 * @param data [description] 12905 */ 12906 open: function open(data) { 12907 var i; 12908 if (data.isObj === false) { 12909 // convert jQuery collection to array to avoid conflicts later 12910 mfp.items = data.items.toArray(); 12911 mfp.index = 0; 12912 var items = data.items, 12913 item; 12914 for (i = 0; i < items.length; i++) { 12915 item = items[i]; 12916 if (item.parsed) { 12917 item = item.el[0]; 12918 } 12919 if (item === data.el[0]) { 12920 mfp.index = i; 12921 break; 12922 } 12923 } 12924 } else { 12925 mfp.items = Array.isArray(data.items) ? data.items : [data.items]; 12926 mfp.index = data.index || 0; 12927 } 12928 12929 // if popup is already opened - we just update the content 12930 if (mfp.isOpen) { 12931 mfp.updateItemHTML(); 12932 return; 12933 } 12934 mfp.types = []; 12935 _wrapClasses = ''; 12936 if (data.mainEl && data.mainEl.length) { 12937 mfp.ev = data.mainEl.eq(0); 12938 } else { 12939 mfp.ev = _document; 12940 } 12941 if (data.key) { 12942 if (!mfp.popupsCache[data.key]) { 12943 mfp.popupsCache[data.key] = {}; 12944 } 12945 mfp.currTemplate = mfp.popupsCache[data.key]; 12946 } else { 12947 mfp.currTemplate = {}; 12948 } 12949 mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data); 12950 mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; 12951 if (mfp.st.modal) { 12952 mfp.st.closeOnContentClick = false; 12953 mfp.st.closeOnBgClick = false; 12954 mfp.st.showCloseBtn = false; 12955 mfp.st.enableEscapeKey = false; 12956 } 12957 12958 // Building markup 12959 // main containers are created only once 12960 if (!mfp.bgOverlay) { 12961 // Dark overlay 12962 mfp.bgOverlay = _getEl('bg').on('click' + EVENT_NS, function () { 12963 mfp.close(); 12964 }); 12965 mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click' + EVENT_NS, function (e) { 12966 if (mfp._checkIfClose(e.target)) { 12967 mfp.close(); 12968 } 12969 }); 12970 mfp.container = _getEl('container', mfp.wrap); 12971 } 12972 mfp.contentContainer = _getEl('content'); 12973 if (mfp.st.preloader) { 12974 mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); 12975 } 12976 12977 // Initializing modules 12978 var modules = $.magnificPopup.modules; 12979 for (i = 0; i < modules.length; i++) { 12980 var n = modules[i]; 12981 n = n.charAt(0).toUpperCase() + n.slice(1); 12982 mfp['init' + n].call(mfp); 12983 } 12984 _mfpTrigger('BeforeOpen'); 12985 if (mfp.st.showCloseBtn) { 12986 // Close button 12987 if (!mfp.st.closeBtnInside) { 12988 mfp.wrap.append(_getCloseBtn()); 12989 } else { 12990 _mfpOn(MARKUP_PARSE_EVENT, function (e, template, values, item) { 12991 values.close_replaceWith = _getCloseBtn(item.type); 12992 }); 12993 _wrapClasses += ' mfp-close-btn-in'; 12994 } 12995 } 12996 if (mfp.st.alignTop) { 12997 _wrapClasses += ' mfp-align-top'; 12998 } 12999 if (mfp.fixedContentPos) { 13000 mfp.wrap.css({ 13001 overflow: mfp.st.overflowY, 13002 overflowX: 'hidden', 13003 overflowY: mfp.st.overflowY 13004 }); 13005 } else { 13006 mfp.wrap.css({ 13007 top: _window.scrollTop(), 13008 position: 'absolute' 13009 }); 13010 } 13011 if (mfp.st.fixedBgPos === false || mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) { 13012 mfp.bgOverlay.css({ 13013 height: _document.height(), 13014 position: 'absolute' 13015 }); 13016 } 13017 if (mfp.st.enableEscapeKey) { 13018 // Close on ESC key 13019 _document.on('keyup' + EVENT_NS, function (e) { 13020 if (e.keyCode === 27) { 13021 mfp.close(); 13022 } 13023 }); 13024 } 13025 _window.on('resize' + EVENT_NS, function () { 13026 mfp.updateSize(); 13027 }); 13028 if (!mfp.st.closeOnContentClick) { 13029 _wrapClasses += ' mfp-auto-cursor'; 13030 } 13031 if (_wrapClasses) mfp.wrap.addClass(_wrapClasses); 13032 13033 // this triggers recalculation of layout, so we get it once to not to trigger twice 13034 var windowHeight = mfp.wH = _window.height(); 13035 var windowStyles = {}; 13036 if (mfp.fixedContentPos) { 13037 if (mfp._hasScrollBar(windowHeight)) { 13038 var s = mfp._getScrollbarSize(); 13039 if (s) { 13040 windowStyles.marginRight = s; 13041 } 13042 } 13043 } 13044 if (mfp.fixedContentPos) { 13045 if (!mfp.isIE7) { 13046 windowStyles.overflow = 'hidden'; 13047 } else { 13048 // ie7 double-scroll bug 13049 $('body, html').css('overflow', 'hidden'); 13050 } 13051 } 13052 var classesToadd = mfp.st.mainClass; 13053 if (mfp.isIE7) { 13054 classesToadd += ' mfp-ie7'; 13055 } 13056 if (classesToadd) { 13057 mfp._addClassToMFP(classesToadd); 13058 } 13059 13060 // add content 13061 mfp.updateItemHTML(); 13062 _mfpTrigger('BuildControls'); 13063 13064 // remove scrollbar, add margin e.t.c 13065 $('html').css(windowStyles); 13066 13067 // add everything to DOM 13068 mfp.bgOverlay.add(mfp.wrap).prependTo(mfp.st.prependTo || $(document.body)); 13069 13070 // Save last focused element 13071 mfp._lastFocusedEl = document.activeElement; 13072 13073 // Wait for next cycle to allow CSS transition 13074 setTimeout(function () { 13075 if (mfp.content) { 13076 mfp._addClassToMFP(READY_CLASS); 13077 mfp._setFocus(); 13078 } else { 13079 // if content is not defined (not loaded e.t.c) we add class only for BG 13080 mfp.bgOverlay.addClass(READY_CLASS); 13081 } 13082 13083 // Trap the focus in popup 13084 _document.on('focusin' + EVENT_NS, mfp._onFocusIn); 13085 }, 16); 13086 mfp.isOpen = true; 13087 mfp.updateSize(windowHeight); 13088 _mfpTrigger(OPEN_EVENT); 13089 return data; 13090 }, 13091 /** 13092 * Closes the popup 13093 */ 13094 close: function close() { 13095 if (!mfp.isOpen) return; 13096 _mfpTrigger(BEFORE_CLOSE_EVENT); 13097 mfp.isOpen = false; 13098 // for CSS3 animation 13099 if (mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition) { 13100 mfp._addClassToMFP(REMOVING_CLASS); 13101 setTimeout(function () { 13102 mfp._close(); 13103 }, mfp.st.removalDelay); 13104 } else { 13105 mfp._close(); 13106 } 13107 }, 13108 /** 13109 * Helper for close() function 13110 */ 13111 _close: function _close() { 13112 _mfpTrigger(CLOSE_EVENT); 13113 var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; 13114 mfp.bgOverlay.detach(); 13115 mfp.wrap.detach(); 13116 mfp.container.empty(); 13117 if (mfp.st.mainClass) { 13118 classesToRemove += mfp.st.mainClass + ' '; 13119 } 13120 mfp._removeClassFromMFP(classesToRemove); 13121 if (mfp.fixedContentPos) { 13122 var windowStyles = { 13123 marginRight: '' 13124 }; 13125 if (mfp.isIE7) { 13126 $('body, html').css('overflow', ''); 13127 } else { 13128 windowStyles.overflow = ''; 13129 } 13130 $('html').css(windowStyles); 13131 } 13132 _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); 13133 mfp.ev.off(EVENT_NS); 13134 13135 // clean up DOM elements that aren't removed 13136 mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); 13137 mfp.bgOverlay.attr('class', 'mfp-bg'); 13138 mfp.container.attr('class', 'mfp-container'); 13139 13140 // remove close button from target element 13141 if (mfp.st.showCloseBtn && (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { 13142 if (mfp.currTemplate.closeBtn) mfp.currTemplate.closeBtn.detach(); 13143 } 13144 if (mfp.st.autoFocusLast && mfp._lastFocusedEl) { 13145 $(mfp._lastFocusedEl).trigger('focus'); // put tab focus back 13146 } 13147 mfp.currItem = null; 13148 mfp.content = null; 13149 mfp.currTemplate = null; 13150 mfp.prevHeight = 0; 13151 _mfpTrigger(AFTER_CLOSE_EVENT); 13152 }, 13153 updateSize: function updateSize(winHeight) { 13154 if (mfp.isIOS) { 13155 // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 13156 var zoomLevel = document.documentElement.clientWidth / window.innerWidth; 13157 var height = window.innerHeight * zoomLevel; 13158 mfp.wrap.css('height', height); 13159 mfp.wH = height; 13160 } else { 13161 mfp.wH = winHeight || _window.height(); 13162 } 13163 // Fixes #84: popup incorrectly positioned with position:relative on body 13164 if (!mfp.fixedContentPos) { 13165 mfp.wrap.css('height', mfp.wH); 13166 } 13167 _mfpTrigger('Resize'); 13168 }, 13169 /** 13170 * Set content of popup based on current index 13171 */ 13172 updateItemHTML: function updateItemHTML() { 13173 var item = mfp.items[mfp.index]; 13174 13175 // Detach and perform modifications 13176 mfp.contentContainer.detach(); 13177 if (mfp.content) mfp.content.detach(); 13178 if (!item.parsed) { 13179 item = mfp.parseEl(mfp.index); 13180 } 13181 var type = item.type; 13182 _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); 13183 // BeforeChange event works like so: 13184 // _mfpOn('BeforeChange', function(e, prevType, newType) { }); 13185 13186 mfp.currItem = item; 13187 if (!mfp.currTemplate[type]) { 13188 var markup = mfp.st[type] ? mfp.st[type].markup : false; 13189 13190 // allows to modify markup 13191 _mfpTrigger('FirstMarkupParse', markup); 13192 if (markup) { 13193 mfp.currTemplate[type] = $(markup); 13194 } else { 13195 // if there is no markup found we just define that template is parsed 13196 mfp.currTemplate[type] = true; 13197 } 13198 } 13199 if (_prevContentType && _prevContentType !== item.type) { 13200 mfp.container.removeClass('mfp-' + _prevContentType + '-holder'); 13201 } 13202 var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); 13203 mfp.appendContent(newContent, type); 13204 item.preloaded = true; 13205 _mfpTrigger(CHANGE_EVENT, item); 13206 _prevContentType = item.type; 13207 13208 // Append container back after its content changed 13209 mfp.container.prepend(mfp.contentContainer); 13210 _mfpTrigger('AfterChange'); 13211 }, 13212 /** 13213 * Set HTML content of popup 13214 */ 13215 appendContent: function appendContent(newContent, type) { 13216 mfp.content = newContent; 13217 if (newContent) { 13218 if (mfp.st.showCloseBtn && mfp.st.closeBtnInside && mfp.currTemplate[type] === true) { 13219 // if there is no markup, we just append close button element inside 13220 if (!mfp.content.find('.mfp-close').length) { 13221 mfp.content.append(_getCloseBtn()); 13222 } 13223 } else { 13224 mfp.content = newContent; 13225 } 13226 } else { 13227 mfp.content = ''; 13228 } 13229 _mfpTrigger(BEFORE_APPEND_EVENT); 13230 mfp.container.addClass('mfp-' + type + '-holder'); 13231 mfp.contentContainer.append(mfp.content); 13232 }, 13233 /** 13234 * Creates Magnific Popup data object based on given data 13235 * @param {int} index Index of item to parse 13236 */ 13237 parseEl: function parseEl(index) { 13238 var item = mfp.items[index], 13239 type; 13240 if (item.tagName) { 13241 item = { 13242 el: $(item) 13243 }; 13244 } else { 13245 type = item.type; 13246 item = { 13247 data: item, 13248 src: item.src 13249 }; 13250 } 13251 if (item.el) { 13252 var types = mfp.types; 13253 13254 // check for 'mfp-TYPE' class 13255 for (var i = 0; i < types.length; i++) { 13256 if (item.el.hasClass('mfp-' + types[i])) { 13257 type = types[i]; 13258 break; 13259 } 13260 } 13261 item.src = item.el.attr('data-mfp-src'); 13262 if (!item.src) { 13263 item.src = item.el.attr('href'); 13264 } 13265 } 13266 item.type = type || mfp.st.type || 'inline'; 13267 item.index = index; 13268 item.parsed = true; 13269 mfp.items[index] = item; 13270 _mfpTrigger('ElementParse', item); 13271 return mfp.items[index]; 13272 }, 13273 /** 13274 * Initializes single popup or a group of popups 13275 */ 13276 addGroup: function addGroup(el, options) { 13277 var eHandler = function eHandler(e) { 13278 e.mfpEl = this; 13279 mfp._openClick(e, el, options); 13280 }; 13281 if (!options) { 13282 options = {}; 13283 } 13284 var eName = 'click.magnificPopup'; 13285 options.mainEl = el; 13286 if (options.items) { 13287 options.isObj = true; 13288 el.off(eName).on(eName, eHandler); 13289 } else { 13290 options.isObj = false; 13291 if (options.delegate) { 13292 el.off(eName).on(eName, options.delegate, eHandler); 13293 } else { 13294 options.items = el; 13295 el.off(eName).on(eName, eHandler); 13296 } 13297 } 13298 }, 13299 _openClick: function _openClick(e, el, options) { 13300 var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; 13301 if (!midClick && (e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey)) { 13302 return; 13303 } 13304 var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; 13305 if (disableOn) { 13306 if (typeof disableOn === "function") { 13307 if (!disableOn.call(mfp)) { 13308 return true; 13309 } 13310 } else { 13311 // else it's number 13312 if (_window.width() < disableOn) { 13313 return true; 13314 } 13315 } 13316 } 13317 if (e.type) { 13318 e.preventDefault(); 13319 13320 // This will prevent popup from closing if element is inside and popup is already opened 13321 if (mfp.isOpen) { 13322 e.stopPropagation(); 13323 } 13324 } 13325 options.el = $(e.mfpEl); 13326 if (options.delegate) { 13327 options.items = el.find(options.delegate); 13328 } 13329 mfp.open(options); 13330 }, 13331 /** 13332 * Updates text on preloader 13333 */ 13334 updateStatus: function updateStatus(status, text) { 13335 if (mfp.preloader) { 13336 if (_prevStatus !== status) { 13337 mfp.container.removeClass('mfp-s-' + _prevStatus); 13338 } 13339 if (!text && status === 'loading') { 13340 text = mfp.st.tLoading; 13341 } 13342 var data = { 13343 status: status, 13344 text: text 13345 }; 13346 // allows to modify status 13347 _mfpTrigger('UpdateStatus', data); 13348 status = data.status; 13349 text = data.text; 13350 if (mfp.st.allowHTMLInStatusIndicator) { 13351 mfp.preloader.html(text); 13352 } else { 13353 mfp.preloader.text(text); 13354 } 13355 mfp.preloader.find('a').on('click', function (e) { 13356 e.stopImmediatePropagation(); 13357 }); 13358 mfp.container.addClass('mfp-s-' + status); 13359 _prevStatus = status; 13360 } 13361 }, 13362 /* 13363 "Private" helpers that aren't private at all 13364 */ 13365 // Check to close popup or not 13366 // "target" is an element that was clicked 13367 _checkIfClose: function _checkIfClose(target) { 13368 if ($(target).closest('.' + PREVENT_CLOSE_CLASS).length) { 13369 return; 13370 } 13371 var closeOnContent = mfp.st.closeOnContentClick; 13372 var closeOnBg = mfp.st.closeOnBgClick; 13373 if (closeOnContent && closeOnBg) { 13374 return true; 13375 } else { 13376 // We close the popup if click is on close button or on preloader. Or if there is no content. 13377 if (!mfp.content || $(target).closest('.mfp-close').length || mfp.preloader && target === mfp.preloader[0]) { 13378 return true; 13379 } 13380 13381 // if click is outside the content 13382 if (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) { 13383 if (closeOnBg) { 13384 // last check, if the clicked element is in DOM, (in case it's removed onclick) 13385 if ($.contains(document, target)) { 13386 return true; 13387 } 13388 } 13389 } else if (closeOnContent) { 13390 return true; 13391 } 13392 } 13393 return false; 13394 }, 13395 _addClassToMFP: function _addClassToMFP(cName) { 13396 mfp.bgOverlay.addClass(cName); 13397 mfp.wrap.addClass(cName); 13398 }, 13399 _removeClassFromMFP: function _removeClassFromMFP(cName) { 13400 this.bgOverlay.removeClass(cName); 13401 mfp.wrap.removeClass(cName); 13402 }, 13403 _hasScrollBar: function _hasScrollBar(winHeight) { 13404 return (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()); 13405 }, 13406 _setFocus: function _setFocus() { 13407 (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).trigger('focus'); 13408 }, 13409 _onFocusIn: function _onFocusIn(e) { 13410 if (e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target)) { 13411 mfp._setFocus(); 13412 return false; 13413 } 13414 }, 13415 _parseMarkup: function _parseMarkup(template, values, item) { 13416 var arr; 13417 if (item.data) { 13418 values = $.extend(item.data, values); 13419 } 13420 _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item]); 13421 $.each(values, function (key, value) { 13422 if (value === undefined || value === false) { 13423 return true; 13424 } 13425 arr = key.split('_'); 13426 if (arr.length > 1) { 13427 var el = template.find(EVENT_NS + '-' + arr[0]); 13428 if (el.length > 0) { 13429 var attr = arr[1]; 13430 if (attr === 'replaceWith') { 13431 if (el[0] !== value[0]) { 13432 el.replaceWith(value); 13433 } 13434 } else if (attr === 'img') { 13435 if (el.is('img')) { 13436 el.attr('src', value); 13437 } else { 13438 el.replaceWith($('<img>').attr('src', value).attr('class', el.attr('class'))); 13439 } 13440 } else { 13441 el.attr(arr[1], value); 13442 } 13443 } 13444 } else { 13445 if (mfp.st.allowHTMLInTemplate) { 13446 template.find(EVENT_NS + '-' + key).html(value); 13447 } else { 13448 template.find(EVENT_NS + '-' + key).text(value); 13449 } 13450 } 13451 }); 13452 }, 13453 _getScrollbarSize: function _getScrollbarSize() { 13454 // thx David 13455 if (mfp.scrollbarSize === undefined) { 13456 var scrollDiv = document.createElement("div"); 13457 scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; 13458 document.body.appendChild(scrollDiv); 13459 mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; 13460 document.body.removeChild(scrollDiv); 13461 } 13462 return mfp.scrollbarSize; 13463 } 13464 }; /* MagnificPopup core prototype end */ 13465 13466 /** 13467 * Public static functions 13468 */ 13469 $.magnificPopup = { 13470 instance: null, 13471 proto: MagnificPopup.prototype, 13472 modules: [], 13473 open: function open(options, index) { 13474 _checkInstance(); 13475 if (!options) { 13476 options = {}; 13477 } else { 13478 options = $.extend(true, {}, options); 13479 } 13480 options.isObj = true; 13481 options.index = index || 0; 13482 return this.instance.open(options); 13483 }, 13484 close: function close() { 13485 return $.magnificPopup.instance && $.magnificPopup.instance.close(); 13486 }, 13487 registerModule: function registerModule(name, module) { 13488 if (module.options) { 13489 $.magnificPopup.defaults[name] = module.options; 13490 } 13491 $.extend(this.proto, module.proto); 13492 this.modules.push(name); 13493 }, 13494 defaults: { 13495 // Info about options is in docs: 13496 // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options 13497 13498 disableOn: 0, 13499 key: null, 13500 midClick: false, 13501 mainClass: '', 13502 preloader: true, 13503 focus: '', 13504 // CSS selector of input to focus after popup is opened 13505 13506 closeOnContentClick: false, 13507 closeOnBgClick: true, 13508 closeBtnInside: true, 13509 showCloseBtn: true, 13510 enableEscapeKey: true, 13511 modal: false, 13512 alignTop: false, 13513 removalDelay: 0, 13514 prependTo: null, 13515 fixedContentPos: 'auto', 13516 fixedBgPos: 'auto', 13517 overflowY: 'auto', 13518 closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>', 13519 tClose: 'Close (Esc)', 13520 tLoading: 'Loading...', 13521 autoFocusLast: true, 13522 allowHTMLInStatusIndicator: false, 13523 allowHTMLInTemplate: false 13524 } 13525 }; 13526 $.fn.magnificPopup = function (options) { 13527 _checkInstance(); 13528 var jqEl = $(this); 13529 13530 // We call some API method of first param is a string 13531 if (typeof options === "string") { 13532 if (options === 'open') { 13533 var items, 13534 itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, 13535 index = parseInt(arguments[1], 10) || 0; 13536 if (itemOpts.items) { 13537 items = itemOpts.items[index]; 13538 } else { 13539 items = jqEl; 13540 if (itemOpts.delegate) { 13541 items = items.find(itemOpts.delegate); 13542 } 13543 items = items.eq(index); 13544 } 13545 mfp._openClick({ 13546 mfpEl: items 13547 }, jqEl, itemOpts); 13548 } else { 13549 if (mfp.isOpen) mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); 13550 } 13551 } else { 13552 // clone options obj 13553 options = $.extend(true, {}, options); 13554 13555 /* 13556 * As Zepto doesn't support .data() method for objects 13557 * and it works only in normal browsers 13558 * we assign "options" object directly to the DOM element. FTW! 13559 */ 13560 if (_isJQ) { 13561 jqEl.data('magnificPopup', options); 13562 } else { 13563 jqEl[0].magnificPopup = options; 13564 } 13565 mfp.addGroup(jqEl, options); 13566 } 13567 return jqEl; 13568 }; 13569 13570 /*>>core*/ 13571 13572 /*>>inline*/ 13573 13574 var INLINE_NS = 'inline', 13575 _hiddenClass, 13576 _inlinePlaceholder, 13577 _lastInlineElement, 13578 _putInlineElementsBack = function _putInlineElementsBack() { 13579 if (_lastInlineElement) { 13580 _inlinePlaceholder.after(_lastInlineElement.addClass(_hiddenClass)).detach(); 13581 _lastInlineElement = null; 13582 } 13583 }; 13584 $.magnificPopup.registerModule(INLINE_NS, { 13585 options: { 13586 hiddenClass: 'hide', 13587 // will be appended with `mfp-` prefix 13588 markup: '', 13589 tNotFound: 'Content not found' 13590 }, 13591 proto: { 13592 initInline: function initInline() { 13593 mfp.types.push(INLINE_NS); 13594 _mfpOn(CLOSE_EVENT + '.' + INLINE_NS, function () { 13595 _putInlineElementsBack(); 13596 }); 13597 }, 13598 getInline: function getInline(item, template) { 13599 _putInlineElementsBack(); 13600 if (item.src) { 13601 var inlineSt = mfp.st.inline, 13602 el = $(item.src); 13603 if (el.length) { 13604 // If target element has parent - we replace it with placeholder and put it back after popup is closed 13605 var parent = el[0].parentNode; 13606 if (parent && parent.tagName) { 13607 if (!_inlinePlaceholder) { 13608 _hiddenClass = inlineSt.hiddenClass; 13609 _inlinePlaceholder = _getEl(_hiddenClass); 13610 _hiddenClass = 'mfp-' + _hiddenClass; 13611 } 13612 // replace target inline element with placeholder 13613 _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); 13614 } 13615 mfp.updateStatus('ready'); 13616 } else { 13617 mfp.updateStatus('error', inlineSt.tNotFound); 13618 el = $('<div>'); 13619 } 13620 item.inlineElement = el; 13621 return el; 13622 } 13623 mfp.updateStatus('ready'); 13624 mfp._parseMarkup(template, {}, item); 13625 return template; 13626 } 13627 } 13628 }); 13629 13630 /*>>inline*/ 13631 13632 /*>>ajax*/ 13633 var AJAX_NS = 'ajax', 13634 _ajaxCur, 13635 _removeAjaxCursor = function _removeAjaxCursor() { 13636 if (_ajaxCur) { 13637 $(document.body).removeClass(_ajaxCur); 13638 } 13639 }, 13640 _destroyAjaxRequest = function _destroyAjaxRequest() { 13641 _removeAjaxCursor(); 13642 if (mfp.req) { 13643 mfp.req.abort(); 13644 } 13645 }; 13646 $.magnificPopup.registerModule(AJAX_NS, { 13647 options: { 13648 settings: null, 13649 cursor: 'mfp-ajax-cur', 13650 tError: 'The content could not be loaded.' 13651 }, 13652 proto: { 13653 initAjax: function initAjax() { 13654 mfp.types.push(AJAX_NS); 13655 _ajaxCur = mfp.st.ajax.cursor; 13656 _mfpOn(CLOSE_EVENT + '.' + AJAX_NS, _destroyAjaxRequest); 13657 _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest); 13658 }, 13659 getAjax: function getAjax(item) { 13660 if (_ajaxCur) { 13661 $(document.body).addClass(_ajaxCur); 13662 } 13663 mfp.updateStatus('loading'); 13664 var opts = $.extend({ 13665 url: item.src, 13666 success: function success(data, textStatus, jqXHR) { 13667 var temp = { 13668 data: data, 13669 xhr: jqXHR 13670 }; 13671 _mfpTrigger('ParseAjax', temp); 13672 mfp.appendContent($(temp.data), AJAX_NS); 13673 item.finished = true; 13674 _removeAjaxCursor(); 13675 mfp._setFocus(); 13676 setTimeout(function () { 13677 mfp.wrap.addClass(READY_CLASS); 13678 }, 16); 13679 mfp.updateStatus('ready'); 13680 _mfpTrigger('AjaxContentAdded'); 13681 }, 13682 error: function error() { 13683 _removeAjaxCursor(); 13684 item.finished = item.loadError = true; 13685 mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); 13686 } 13687 }, mfp.st.ajax.settings); 13688 mfp.req = $.ajax(opts); 13689 return ''; 13690 } 13691 } 13692 }); 13693 13694 /*>>ajax*/ 13695 13696 /*>>image*/ 13697 var _imgInterval, 13698 _getTitle = function _getTitle(item) { 13699 if (item.data && item.data.title !== undefined) return item.data.title; 13700 var src = mfp.st.image.titleSrc; 13701 if (src) { 13702 if (typeof src === "function") { 13703 return src.call(mfp, item); 13704 } else if (item.el) { 13705 return item.el.attr(src) || ''; 13706 } 13707 } 13708 return ''; 13709 }; 13710 $.magnificPopup.registerModule('image', { 13711 options: { 13712 markup: '<div class="mfp-figure">' + '<div class="mfp-close"></div>' + '<figure>' + '<div class="mfp-img"></div>' + '<figcaption>' + '<div class="mfp-bottom-bar">' + '<div class="mfp-title"></div>' + '<div class="mfp-counter"></div>' + '</div>' + '</figcaption>' + '</figure>' + '</div>', 13713 cursor: 'mfp-zoom-out-cur', 13714 titleSrc: 'title', 13715 verticalFit: true, 13716 tError: 'The image could not be loaded.' 13717 }, 13718 proto: { 13719 initImage: function initImage() { 13720 var imgSt = mfp.st.image, 13721 ns = '.image'; 13722 mfp.types.push('image'); 13723 _mfpOn(OPEN_EVENT + ns, function () { 13724 if (mfp.currItem.type === 'image' && imgSt.cursor) { 13725 $(document.body).addClass(imgSt.cursor); 13726 } 13727 }); 13728 _mfpOn(CLOSE_EVENT + ns, function () { 13729 if (imgSt.cursor) { 13730 $(document.body).removeClass(imgSt.cursor); 13731 } 13732 _window.off('resize' + EVENT_NS); 13733 }); 13734 _mfpOn('Resize' + ns, mfp.resizeImage); 13735 if (mfp.isLowIE) { 13736 _mfpOn('AfterChange', mfp.resizeImage); 13737 } 13738 }, 13739 resizeImage: function resizeImage() { 13740 var item = mfp.currItem; 13741 if (!item || !item.img) return; 13742 if (mfp.st.image.verticalFit) { 13743 var decr = 0; 13744 // fix box-sizing in ie7/8 13745 if (mfp.isLowIE) { 13746 decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'), 10); 13747 } 13748 item.img.css('max-height', mfp.wH - decr); 13749 } 13750 }, 13751 _onImageHasSize: function _onImageHasSize(item) { 13752 if (item.img) { 13753 item.hasSize = true; 13754 if (_imgInterval) { 13755 clearInterval(_imgInterval); 13756 } 13757 item.isCheckingImgSize = false; 13758 _mfpTrigger('ImageHasSize', item); 13759 if (item.imgHidden) { 13760 if (mfp.content) mfp.content.removeClass('mfp-loading'); 13761 item.imgHidden = false; 13762 } 13763 } 13764 }, 13765 /** 13766 * Function that loops until the image has size to display elements that rely on it asap 13767 */ 13768 findImageSize: function findImageSize(item) { 13769 var counter = 0, 13770 img = item.img[0], 13771 _mfpSetInterval = function mfpSetInterval(delay) { 13772 if (_imgInterval) { 13773 clearInterval(_imgInterval); 13774 } 13775 // decelerating interval that checks for size of an image 13776 _imgInterval = setInterval(function () { 13777 if (img.naturalWidth > 0) { 13778 mfp._onImageHasSize(item); 13779 return; 13780 } 13781 if (counter > 200) { 13782 clearInterval(_imgInterval); 13783 } 13784 counter++; 13785 if (counter === 3) { 13786 _mfpSetInterval(10); 13787 } else if (counter === 40) { 13788 _mfpSetInterval(50); 13789 } else if (counter === 100) { 13790 _mfpSetInterval(500); 13791 } 13792 }, delay); 13793 }; 13794 _mfpSetInterval(1); 13795 }, 13796 getImage: function getImage(item, template) { 13797 var guard = 0, 13798 imgSt = mfp.st.image, 13799 // image error handler 13800 onLoadError = function onLoadError() { 13801 if (item) { 13802 item.img.off('.mfploader'); 13803 if (item === mfp.currItem) { 13804 mfp._onImageHasSize(item); 13805 mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src)); 13806 } 13807 item.hasSize = true; 13808 item.loaded = true; 13809 item.loadError = true; 13810 } 13811 }, 13812 // image load complete handler 13813 _onLoadComplete = function onLoadComplete() { 13814 if (item) { 13815 if (item.img[0].complete) { 13816 item.img.off('.mfploader'); 13817 if (item === mfp.currItem) { 13818 mfp._onImageHasSize(item); 13819 mfp.updateStatus('ready'); 13820 } 13821 item.hasSize = true; 13822 item.loaded = true; 13823 _mfpTrigger('ImageLoadComplete'); 13824 } else { 13825 // if image complete check fails 200 times (20 sec), we assume that there was an error. 13826 guard++; 13827 if (guard < 200) { 13828 setTimeout(_onLoadComplete, 100); 13829 } else { 13830 onLoadError(); 13831 } 13832 } 13833 } 13834 }; 13835 var el = template.find('.mfp-img'); 13836 if (el.length) { 13837 var img = document.createElement('img'); 13838 img.className = 'mfp-img'; 13839 if (item.el && item.el.find('img').length) { 13840 img.alt = item.el.find('img').attr('alt'); 13841 } 13842 item.img = $(img).on('load.mfploader', _onLoadComplete).on('error.mfploader', onLoadError); 13843 img.src = item.src; 13844 13845 // without clone() "error" event is not firing when IMG is replaced by new IMG 13846 // TODO: find a way to avoid such cloning 13847 if (el.is('img')) { 13848 item.img = item.img.clone(); 13849 } 13850 img = item.img[0]; 13851 if (img.naturalWidth > 0) { 13852 item.hasSize = true; 13853 } else if (!img.width) { 13854 item.hasSize = false; 13855 } 13856 } 13857 mfp._parseMarkup(template, { 13858 title: _getTitle(item), 13859 img_replaceWith: item.img 13860 }, item); 13861 mfp.resizeImage(); 13862 if (item.hasSize) { 13863 if (_imgInterval) clearInterval(_imgInterval); 13864 if (item.loadError) { 13865 template.addClass('mfp-loading'); 13866 mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src)); 13867 } else { 13868 template.removeClass('mfp-loading'); 13869 mfp.updateStatus('ready'); 13870 } 13871 return template; 13872 } 13873 mfp.updateStatus('loading'); 13874 item.loading = true; 13875 if (!item.hasSize) { 13876 item.imgHidden = true; 13877 template.addClass('mfp-loading'); 13878 mfp.findImageSize(item); 13879 } 13880 return template; 13881 } 13882 } 13883 }); 13884 13885 /*>>image*/ 13886 13887 /*>>zoom*/ 13888 var hasMozTransform, 13889 getHasMozTransform = function getHasMozTransform() { 13890 if (hasMozTransform === undefined) { 13891 hasMozTransform = document.createElement('p').style.MozTransform !== undefined; 13892 } 13893 return hasMozTransform; 13894 }; 13895 $.magnificPopup.registerModule('zoom', { 13896 options: { 13897 enabled: false, 13898 easing: 'ease-in-out', 13899 duration: 300, 13900 opener: function opener(element) { 13901 return element.is('img') ? element : element.find('img'); 13902 } 13903 }, 13904 proto: { 13905 initZoom: function initZoom() { 13906 var zoomSt = mfp.st.zoom, 13907 ns = '.zoom', 13908 image; 13909 if (!zoomSt.enabled || !mfp.supportsTransition) { 13910 return; 13911 } 13912 var duration = zoomSt.duration, 13913 getElToAnimate = function getElToAnimate(image) { 13914 var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), 13915 transition = 'all ' + zoomSt.duration / 1000 + 's ' + zoomSt.easing, 13916 cssObj = { 13917 position: 'fixed', 13918 zIndex: 9999, 13919 left: 0, 13920 top: 0, 13921 '-webkit-backface-visibility': 'hidden' 13922 }, 13923 t = 'transition'; 13924 cssObj['-webkit-' + t] = cssObj['-moz-' + t] = cssObj['-o-' + t] = cssObj[t] = transition; 13925 newImg.css(cssObj); 13926 return newImg; 13927 }, 13928 showMainContent = function showMainContent() { 13929 mfp.content.css('visibility', 'visible'); 13930 }, 13931 openTimeout, 13932 animatedImg; 13933 _mfpOn('BuildControls' + ns, function () { 13934 if (mfp._allowZoom()) { 13935 clearTimeout(openTimeout); 13936 mfp.content.css('visibility', 'hidden'); 13937 13938 // Basically, all code below does is clones existing image, puts in on top of the current one and animated it 13939 13940 image = mfp._getItemToZoom(); 13941 if (!image) { 13942 showMainContent(); 13943 return; 13944 } 13945 animatedImg = getElToAnimate(image); 13946 animatedImg.css(mfp._getOffset()); 13947 mfp.wrap.append(animatedImg); 13948 openTimeout = setTimeout(function () { 13949 animatedImg.css(mfp._getOffset(true)); 13950 openTimeout = setTimeout(function () { 13951 showMainContent(); 13952 setTimeout(function () { 13953 animatedImg.remove(); 13954 image = animatedImg = null; 13955 _mfpTrigger('ZoomAnimationEnded'); 13956 }, 16); // avoid blink when switching images 13957 }, duration); // this timeout equals animation duration 13958 }, 16); // by adding this timeout we avoid short glitch at the beginning of animation 13959 13960 // Lots of timeouts... 13961 } 13962 }); 13963 _mfpOn(BEFORE_CLOSE_EVENT + ns, function () { 13964 if (mfp._allowZoom()) { 13965 clearTimeout(openTimeout); 13966 mfp.st.removalDelay = duration; 13967 if (!image) { 13968 image = mfp._getItemToZoom(); 13969 if (!image) { 13970 return; 13971 } 13972 animatedImg = getElToAnimate(image); 13973 } 13974 animatedImg.css(mfp._getOffset(true)); 13975 mfp.wrap.append(animatedImg); 13976 mfp.content.css('visibility', 'hidden'); 13977 setTimeout(function () { 13978 animatedImg.css(mfp._getOffset()); 13979 }, 16); 13980 } 13981 }); 13982 _mfpOn(CLOSE_EVENT + ns, function () { 13983 if (mfp._allowZoom()) { 13984 showMainContent(); 13985 if (animatedImg) { 13986 animatedImg.remove(); 13987 } 13988 image = null; 13989 } 13990 }); 13991 }, 13992 _allowZoom: function _allowZoom() { 13993 return mfp.currItem.type === 'image'; 13994 }, 13995 _getItemToZoom: function _getItemToZoom() { 13996 if (mfp.currItem.hasSize) { 13997 return mfp.currItem.img; 13998 } else { 13999 return false; 14000 } 14001 }, 14002 // Get element postion relative to viewport 14003 _getOffset: function _getOffset(isLarge) { 14004 var el; 14005 if (isLarge) { 14006 el = mfp.currItem.img; 14007 } else { 14008 el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); 14009 } 14010 var offset = el.offset(); 14011 var paddingTop = parseInt(el.css('padding-top'), 10); 14012 var paddingBottom = parseInt(el.css('padding-bottom'), 10); 14013 offset.top -= $(window).scrollTop() - paddingTop; 14014 14015 /* 14016 Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. 14017 */ 14018 var obj = { 14019 width: el.width(), 14020 // fix Zepto height+padding issue 14021 height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop 14022 }; 14023 14024 // I hate to do this, but there is no another option 14025 if (getHasMozTransform()) { 14026 obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; 14027 } else { 14028 obj.left = offset.left; 14029 obj.top = offset.top; 14030 } 14031 return obj; 14032 } 14033 } 14034 }); 14035 14036 /*>>zoom*/ 14037 14038 /*>>iframe*/ 14039 14040 var IFRAME_NS = 'iframe', 14041 _emptyPage = '//about:blank', 14042 _fixIframeBugs = function _fixIframeBugs(isShowing) { 14043 if (mfp.currTemplate[IFRAME_NS]) { 14044 var el = mfp.currTemplate[IFRAME_NS].find('iframe'); 14045 if (el.length) { 14046 // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug 14047 if (!isShowing) { 14048 el[0].src = _emptyPage; 14049 } 14050 14051 // IE8 black screen bug fix 14052 if (mfp.isIE8) { 14053 el.css('display', isShowing ? 'block' : 'none'); 14054 } 14055 } 14056 } 14057 }; 14058 $.magnificPopup.registerModule(IFRAME_NS, { 14059 options: { 14060 markup: '<div class="mfp-iframe-scaler">' + '<div class="mfp-close"></div>' + '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>' + '</div>', 14061 srcAction: 'iframe_src', 14062 // we don't care and support only one default type of URL by default 14063 patterns: { 14064 youtube: { 14065 index: 'youtube.com', 14066 id: 'v=', 14067 src: '//www.youtube.com/embed/%id%?autoplay=1' 14068 }, 14069 vimeo: { 14070 index: 'vimeo.com/', 14071 id: '/', 14072 src: '//player.vimeo.com/video/%id%?autoplay=1' 14073 }, 14074 gmaps: { 14075 index: '//maps.google.', 14076 src: '%id%&output=embed' 14077 } 14078 } 14079 }, 14080 proto: { 14081 initIframe: function initIframe() { 14082 mfp.types.push(IFRAME_NS); 14083 _mfpOn('BeforeChange', function (e, prevType, newType) { 14084 if (prevType !== newType) { 14085 if (prevType === IFRAME_NS) { 14086 _fixIframeBugs(); // iframe if removed 14087 } else if (newType === IFRAME_NS) { 14088 _fixIframeBugs(true); // iframe is showing 14089 } 14090 } // else { 14091 // iframe source is switched, don't do anything 14092 //} 14093 }); 14094 _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function () { 14095 _fixIframeBugs(); 14096 }); 14097 }, 14098 getIframe: function getIframe(item, template) { 14099 var embedSrc = item.src; 14100 var iframeSt = mfp.st.iframe; 14101 $.each(iframeSt.patterns, function () { 14102 if (embedSrc.indexOf(this.index) > -1) { 14103 if (this.id) { 14104 if (typeof this.id === 'string') { 14105 embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id) + this.id.length, embedSrc.length); 14106 } else { 14107 embedSrc = this.id.call(this, embedSrc); 14108 } 14109 } 14110 embedSrc = this.src.replace('%id%', embedSrc); 14111 return false; // break; 14112 } 14113 }); 14114 var dataObj = {}; 14115 if (iframeSt.srcAction) { 14116 dataObj[iframeSt.srcAction] = embedSrc; 14117 } 14118 mfp._parseMarkup(template, dataObj, item); 14119 mfp.updateStatus('ready'); 14120 return template; 14121 } 14122 } 14123 }); 14124 14125 /*>>iframe*/ 14126 14127 /*>>gallery*/ 14128 /** 14129 * Get looped index depending on number of slides 14130 */ 14131 var _getLoopedId = function _getLoopedId(index) { 14132 var numSlides = mfp.items.length; 14133 if (index > numSlides - 1) { 14134 return index - numSlides; 14135 } else if (index < 0) { 14136 return numSlides + index; 14137 } 14138 return index; 14139 }, 14140 _replaceCurrTotal = function _replaceCurrTotal(text, curr, total) { 14141 return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total); 14142 }; 14143 $.magnificPopup.registerModule('gallery', { 14144 options: { 14145 enabled: false, 14146 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 14147 preload: [0, 2], 14148 navigateByImgClick: true, 14149 arrows: true, 14150 tPrev: 'Previous (Left arrow key)', 14151 tNext: 'Next (Right arrow key)', 14152 tCounter: '%curr% of %total%', 14153 langDir: null, 14154 loop: true 14155 }, 14156 proto: { 14157 initGallery: function initGallery() { 14158 var gSt = mfp.st.gallery, 14159 ns = '.mfp-gallery'; 14160 mfp.direction = true; // true - next, false - prev 14161 14162 if (!gSt || !gSt.enabled) return false; 14163 if (!gSt.langDir) { 14164 gSt.langDir = document.dir || 'ltr'; 14165 } 14166 _wrapClasses += ' mfp-gallery'; 14167 _mfpOn(OPEN_EVENT + ns, function () { 14168 if (gSt.navigateByImgClick) { 14169 mfp.wrap.on('click' + ns, '.mfp-img', function () { 14170 if (mfp.items.length > 1) { 14171 mfp.next(); 14172 return false; 14173 } 14174 }); 14175 } 14176 _document.on('keydown' + ns, function (e) { 14177 if (e.keyCode === 37) { 14178 if (gSt.langDir === 'rtl') mfp.next();else mfp.prev(); 14179 } else if (e.keyCode === 39) { 14180 if (gSt.langDir === 'rtl') mfp.prev();else mfp.next(); 14181 } 14182 }); 14183 mfp.updateGalleryButtons(); 14184 }); 14185 _mfpOn('UpdateStatus' + ns, function /*e, data*/ 14186 () { 14187 mfp.updateGalleryButtons(); 14188 }); 14189 _mfpOn('UpdateStatus' + ns, function (e, data) { 14190 if (data.text) { 14191 data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); 14192 } 14193 }); 14194 _mfpOn(MARKUP_PARSE_EVENT + ns, function (e, element, values, item) { 14195 var l = mfp.items.length; 14196 values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; 14197 }); 14198 _mfpOn('BuildControls' + ns, function () { 14199 if (mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { 14200 var arrowLeftDesc, arrowRightDesc, arrowLeftAction, arrowRightAction; 14201 if (gSt.langDir === 'rtl') { 14202 arrowLeftDesc = gSt.tNext; 14203 arrowRightDesc = gSt.tPrev; 14204 arrowLeftAction = 'next'; 14205 arrowRightAction = 'prev'; 14206 } else { 14207 arrowLeftDesc = gSt.tPrev; 14208 arrowRightDesc = gSt.tNext; 14209 arrowLeftAction = 'prev'; 14210 arrowRightAction = 'next'; 14211 } 14212 var markup = gSt.arrowMarkup, 14213 arrowLeft = mfp.arrowLeft = $(markup.replace(/%title%/gi, arrowLeftDesc).replace(/%action%/gi, arrowLeftAction).replace(/%dir%/gi, 'left')).addClass(PREVENT_CLOSE_CLASS), 14214 arrowRight = mfp.arrowRight = $(markup.replace(/%title%/gi, arrowRightDesc).replace(/%action%/gi, arrowRightAction).replace(/%dir%/gi, 'right')).addClass(PREVENT_CLOSE_CLASS); 14215 if (gSt.langDir === 'rtl') { 14216 mfp.arrowNext = arrowLeft; 14217 mfp.arrowPrev = arrowRight; 14218 } else { 14219 mfp.arrowNext = arrowRight; 14220 mfp.arrowPrev = arrowLeft; 14221 } 14222 arrowLeft.on('click', function () { 14223 if (gSt.langDir === 'rtl') mfp.next();else mfp.prev(); 14224 }); 14225 arrowRight.on('click', function () { 14226 if (gSt.langDir === 'rtl') mfp.prev();else mfp.next(); 14227 }); 14228 mfp.container.append(arrowLeft.add(arrowRight)); 14229 } 14230 }); 14231 _mfpOn(CHANGE_EVENT + ns, function () { 14232 if (mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); 14233 mfp._preloadTimeout = setTimeout(function () { 14234 mfp.preloadNearbyImages(); 14235 mfp._preloadTimeout = null; 14236 }, 16); 14237 }); 14238 _mfpOn(CLOSE_EVENT + ns, function () { 14239 _document.off(ns); 14240 mfp.wrap.off('click' + ns); 14241 mfp.arrowRight = mfp.arrowLeft = null; 14242 }); 14243 }, 14244 next: function next() { 14245 var newIndex = _getLoopedId(mfp.index + 1); 14246 if (!mfp.st.gallery.loop && newIndex === 0) return false; 14247 mfp.direction = true; 14248 mfp.index = newIndex; 14249 mfp.updateItemHTML(); 14250 }, 14251 prev: function prev() { 14252 var newIndex = mfp.index - 1; 14253 if (!mfp.st.gallery.loop && newIndex < 0) return false; 14254 mfp.direction = false; 14255 mfp.index = _getLoopedId(newIndex); 14256 mfp.updateItemHTML(); 14257 }, 14258 goTo: function goTo(newIndex) { 14259 mfp.direction = newIndex >= mfp.index; 14260 mfp.index = newIndex; 14261 mfp.updateItemHTML(); 14262 }, 14263 preloadNearbyImages: function preloadNearbyImages() { 14264 var p = mfp.st.gallery.preload, 14265 preloadBefore = Math.min(p[0], mfp.items.length), 14266 preloadAfter = Math.min(p[1], mfp.items.length), 14267 i; 14268 for (i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { 14269 mfp._preloadItem(mfp.index + i); 14270 } 14271 for (i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { 14272 mfp._preloadItem(mfp.index - i); 14273 } 14274 }, 14275 _preloadItem: function _preloadItem(index) { 14276 index = _getLoopedId(index); 14277 if (mfp.items[index].preloaded) { 14278 return; 14279 } 14280 var item = mfp.items[index]; 14281 if (!item.parsed) { 14282 item = mfp.parseEl(index); 14283 } 14284 _mfpTrigger('LazyLoad', item); 14285 if (item.type === 'image') { 14286 item.img = $('<img class="mfp-img" />').on('load.mfploader', function () { 14287 item.hasSize = true; 14288 }).on('error.mfploader', function () { 14289 item.hasSize = true; 14290 item.loadError = true; 14291 _mfpTrigger('LazyLoadError', item); 14292 }).attr('src', item.src); 14293 } 14294 item.preloaded = true; 14295 }, 14296 /** 14297 * Show/hide the gallery prev/next buttons if we're at the start/end, if looping is turned off 14298 * Added by Joloco for Veg 14299 */ 14300 updateGalleryButtons: function updateGalleryButtons() { 14301 if (!mfp.st.gallery.loop && _typeof(mfp.arrowPrev) === 'object' && mfp.arrowPrev !== null) { 14302 if (mfp.index === 0) mfp.arrowPrev.hide();else mfp.arrowPrev.show(); 14303 if (mfp.index === mfp.items.length - 1) mfp.arrowNext.hide();else mfp.arrowNext.show(); 14304 } 14305 } 14306 } 14307 }); 14308 14309 /*>>gallery*/ 14310 14311 /*>>retina*/ 14312 14313 var RETINA_NS = 'retina'; 14314 $.magnificPopup.registerModule(RETINA_NS, { 14315 options: { 14316 replaceSrc: function replaceSrc(item) { 14317 return item.src.replace(/\.\w+$/, function (m) { 14318 return '@2x' + m; 14319 }); 14320 }, 14321 ratio: 1 // Function or number. Set to 1 to disable. 14322 }, 14323 proto: { 14324 initRetina: function initRetina() { 14325 if (window.devicePixelRatio > 1) { 14326 var st = mfp.st.retina, 14327 ratio = st.ratio; 14328 ratio = !isNaN(ratio) ? ratio : ratio(); 14329 if (ratio > 1) { 14330 _mfpOn('ImageHasSize' + '.' + RETINA_NS, function (e, item) { 14331 item.img.css({ 14332 'max-width': item.img[0].naturalWidth / ratio, 14333 'width': '100%' 14334 }); 14335 }); 14336 _mfpOn('ElementParse' + '.' + RETINA_NS, function (e, item) { 14337 item.src = st.replaceSrc(item, ratio); 14338 }); 14339 } 14340 } 14341 } 14342 } 14343 }); 14344 14345 /*>>retina*/ 14346 _checkInstance(); 14347}); 14348 14349/***/ }), 14350
vendor: 74,614 bytes, lines 14351-16466
14351/***/ "./node_modules/slick-carousel/slick/slick.js": 14352/*!****************************************************!*\ 14353 !*** ./node_modules/slick-carousel/slick/slick.js ***! 14354 \****************************************************/ 14355/***/ ((module, exports, __webpack_require__) => { 14356 14357var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 14358/* 14359 _ _ _ _ 14360 ___| (_) ___| | __ (_)___ 14361/ __| | |/ __| |/ / | / __| 14362\__ \ | | (__| < _ | \__ \ 14363|___/_|_|\___|_|\_(_)/ |___/ 14364 |__/ 14365 14366 Version: 1.8.1 14367 Author: Ken Wheeler 14368 Website: http://kenwheeler.github.io 14369 Docs: http://kenwheeler.github.io/slick 14370 Repo: http://github.com/kenwheeler/slick 14371 Issues: http://github.com/kenwheeler/slick/issues 14372 14373 */ 14374/* global window, document, define, jQuery, setInterval, clearInterval */ 14375; 14376(function (factory) { 14377 'use strict'; 14378 14379 if (true) { 14380 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 14381 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 14382 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 14383 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 14384 } else {} 14385})(function ($) { 14386 'use strict'; 14387 14388 var Slick = window.Slick || {}; 14389 Slick = function () { 14390 var instanceUid = 0; 14391 function Slick(element, settings) { 14392 var _ = this, 14393 dataSettings; 14394 _.defaults = { 14395 accessibility: true, 14396 adaptiveHeight: false, 14397 appendArrows: $(element), 14398 appendDots: $(element), 14399 arrows: true, 14400 asNavFor: null, 14401 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', 14402 nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', 14403 autoplay: false, 14404 autoplaySpeed: 3000, 14405 centerMode: false, 14406 centerPadding: '50px', 14407 cssEase: 'ease', 14408 customPaging: function customPaging(slider, i) { 14409 return $('<button type="button" />').text(i + 1); 14410 }, 14411 dots: false, 14412 dotsClass: 'slick-dots', 14413 draggable: true, 14414 easing: 'linear', 14415 edgeFriction: 0.35, 14416 fade: false, 14417 focusOnSelect: false, 14418 focusOnChange: false, 14419 infinite: true, 14420 initialSlide: 0, 14421 lazyLoad: 'ondemand', 14422 mobileFirst: false, 14423 pauseOnHover: true, 14424 pauseOnFocus: true, 14425 pauseOnDotsHover: false, 14426 respondTo: 'window', 14427 responsive: null, 14428 rows: 1, 14429 rtl: false, 14430 slide: '', 14431 slidesPerRow: 1, 14432 slidesToShow: 1, 14433 slidesToScroll: 1, 14434 speed: 500, 14435 swipe: true, 14436 swipeToSlide: false, 14437 touchMove: true, 14438 touchThreshold: 5, 14439 useCSS: true, 14440 useTransform: true, 14441 variableWidth: false, 14442 vertical: false, 14443 verticalSwiping: false, 14444 waitForAnimate: true, 14445 zIndex: 1000 14446 }; 14447 _.initials = { 14448 animating: false, 14449 dragging: false, 14450 autoPlayTimer: null, 14451 currentDirection: 0, 14452 currentLeft: null, 14453 currentSlide: 0, 14454 direction: 1, 14455 $dots: null, 14456 listWidth: null, 14457 listHeight: null, 14458 loadIndex: 0, 14459 $nextArrow: null, 14460 $prevArrow: null, 14461 scrolling: false, 14462 slideCount: null, 14463 slideWidth: null, 14464 $slideTrack: null, 14465 $slides: null, 14466 sliding: false, 14467 slideOffset: 0, 14468 swipeLeft: null, 14469 swiping: false, 14470 $list: null, 14471 touchObject: {}, 14472 transformsEnabled: false, 14473 unslicked: false 14474 }; 14475 $.extend(_, _.initials); 14476 _.activeBreakpoint = null; 14477 _.animType = null; 14478 _.animProp = null; 14479 _.breakpoints = []; 14480 _.breakpointSettings = []; 14481 _.cssTransitions = false; 14482 _.focussed = false; 14483 _.interrupted = false; 14484 _.hidden = 'hidden'; 14485 _.paused = true; 14486 _.positionProp = null; 14487 _.respondTo = null; 14488 _.rowCount = 1; 14489 _.shouldClick = true; 14490 _.$slider = $(element); 14491 _.$slidesCache = null; 14492 _.transformType = null; 14493 _.transitionType = null; 14494 _.visibilityChange = 'visibilitychange'; 14495 _.windowWidth = 0; 14496 _.windowTimer = null; 14497 dataSettings = $(element).data('slick') || {}; 14498 _.options = $.extend({}, _.defaults, settings, dataSettings); 14499 _.currentSlide = _.options.initialSlide; 14500 _.originalSettings = _.options; 14501 if (typeof document.mozHidden !== 'undefined') { 14502 _.hidden = 'mozHidden'; 14503 _.visibilityChange = 'mozvisibilitychange'; 14504 } else if (typeof document.webkitHidden !== 'undefined') { 14505 _.hidden = 'webkitHidden'; 14506 _.visibilityChange = 'webkitvisibilitychange'; 14507 } 14508 _.autoPlay = $.proxy(_.autoPlay, _); 14509 _.autoPlayClear = $.proxy(_.autoPlayClear, _); 14510 _.autoPlayIterator = $.proxy(_.autoPlayIterator, _); 14511 _.changeSlide = $.proxy(_.changeSlide, _); 14512 _.clickHandler = $.proxy(_.clickHandler, _); 14513 _.selectHandler = $.proxy(_.selectHandler, _); 14514 _.setPosition = $.proxy(_.setPosition, _); 14515 _.swipeHandler = $.proxy(_.swipeHandler, _); 14516 _.dragHandler = $.proxy(_.dragHandler, _); 14517 _.keyHandler = $.proxy(_.keyHandler, _); 14518 _.instanceUid = instanceUid++; 14519 14520 // A simple way to check for HTML strings 14521 // Strict HTML recognition (must start with <) 14522 // Extracted from jQuery v1.11 source 14523 _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; 14524 _.registerBreakpoints(); 14525 _.init(true); 14526 } 14527 return Slick; 14528 }(); 14529 Slick.prototype.activateADA = function () { 14530 var _ = this; 14531 _.$slideTrack.find('.slick-active').attr({ 14532 'aria-hidden': 'false' 14533 }).find('a, input, button, select').attr({ 14534 'tabindex': '0' 14535 }); 14536 }; 14537 Slick.prototype.addSlide = Slick.prototype.slickAdd = function (markup, index, addBefore) { 14538 var _ = this; 14539 if (typeof index === 'boolean') { 14540 addBefore = index; 14541 index = null; 14542 } else if (index < 0 || index >= _.slideCount) { 14543 return false; 14544 } 14545 _.unload(); 14546 if (typeof index === 'number') { 14547 if (index === 0 && _.$slides.length === 0) { 14548 $(markup).appendTo(_.$slideTrack); 14549 } else if (addBefore) { 14550 $(markup).insertBefore(_.$slides.eq(index)); 14551 } else { 14552 $(markup).insertAfter(_.$slides.eq(index)); 14553 } 14554 } else { 14555 if (addBefore === true) { 14556 $(markup).prependTo(_.$slideTrack); 14557 } else { 14558 $(markup).appendTo(_.$slideTrack); 14559 } 14560 } 14561 _.$slides = _.$slideTrack.children(this.options.slide); 14562 _.$slideTrack.children(this.options.slide).detach(); 14563 _.$slideTrack.append(_.$slides); 14564 _.$slides.each(function (index, element) { 14565 $(element).attr('data-slick-index', index); 14566 }); 14567 _.$slidesCache = _.$slides; 14568 _.reinit(); 14569 }; 14570 Slick.prototype.animateHeight = function () { 14571 var _ = this; 14572 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 14573 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 14574 _.$list.animate({ 14575 height: targetHeight 14576 }, _.options.speed); 14577 } 14578 }; 14579 Slick.prototype.animateSlide = function (targetLeft, callback) { 14580 var animProps = {}, 14581 _ = this; 14582 _.animateHeight(); 14583 if (_.options.rtl === true && _.options.vertical === false) { 14584 targetLeft = -targetLeft; 14585 } 14586 if (_.transformsEnabled === false) { 14587 if (_.options.vertical === false) { 14588 _.$slideTrack.animate({ 14589 left: targetLeft 14590 }, _.options.speed, _.options.easing, callback); 14591 } else { 14592 _.$slideTrack.animate({ 14593 top: targetLeft 14594 }, _.options.speed, _.options.easing, callback); 14595 } 14596 } else { 14597 if (_.cssTransitions === false) { 14598 if (_.options.rtl === true) { 14599 _.currentLeft = -_.currentLeft; 14600 } 14601 $({ 14602 animStart: _.currentLeft 14603 }).animate({ 14604 animStart: targetLeft 14605 }, { 14606 duration: _.options.speed, 14607 easing: _.options.easing, 14608 step: function step(now) { 14609 now = Math.ceil(now); 14610 if (_.options.vertical === false) { 14611 animProps[_.animType] = 'translate(' + now + 'px, 0px)'; 14612 _.$slideTrack.css(animProps); 14613 } else { 14614 animProps[_.animType] = 'translate(0px,' + now + 'px)'; 14615 _.$slideTrack.css(animProps); 14616 } 14617 }, 14618 complete: function complete() { 14619 if (callback) { 14620 callback.call(); 14621 } 14622 } 14623 }); 14624 } else { 14625 _.applyTransition(); 14626 targetLeft = Math.ceil(targetLeft); 14627 if (_.options.vertical === false) { 14628 animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; 14629 } else { 14630 animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; 14631 } 14632 _.$slideTrack.css(animProps); 14633 if (callback) { 14634 setTimeout(function () { 14635 _.disableTransition(); 14636 callback.call(); 14637 }, _.options.speed); 14638 } 14639 } 14640 } 14641 }; 14642 Slick.prototype.getNavTarget = function () { 14643 var _ = this, 14644 asNavFor = _.options.asNavFor; 14645 if (asNavFor && asNavFor !== null) { 14646 asNavFor = $(asNavFor).not(_.$slider); 14647 } 14648 return asNavFor; 14649 }; 14650 Slick.prototype.asNavFor = function (index) { 14651 var _ = this, 14652 asNavFor = _.getNavTarget(); 14653 if (asNavFor !== null && _typeof(asNavFor) === 'object') { 14654 asNavFor.each(function () { 14655 var target = $(this).slick('getSlick'); 14656 if (!target.unslicked) { 14657 target.slideHandler(index, true); 14658 } 14659 }); 14660 } 14661 }; 14662 Slick.prototype.applyTransition = function (slide) { 14663 var _ = this, 14664 transition = {}; 14665 if (_.options.fade === false) { 14666 transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; 14667 } else { 14668 transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; 14669 } 14670 if (_.options.fade === false) { 14671 _.$slideTrack.css(transition); 14672 } else { 14673 _.$slides.eq(slide).css(transition); 14674 } 14675 }; 14676 Slick.prototype.autoPlay = function () { 14677 var _ = this; 14678 _.autoPlayClear(); 14679 if (_.slideCount > _.options.slidesToShow) { 14680 _.autoPlayTimer = setInterval(_.autoPlayIterator, _.options.autoplaySpeed); 14681 } 14682 }; 14683 Slick.prototype.autoPlayClear = function () { 14684 var _ = this; 14685 if (_.autoPlayTimer) { 14686 clearInterval(_.autoPlayTimer); 14687 } 14688 }; 14689 Slick.prototype.autoPlayIterator = function () { 14690 var _ = this, 14691 slideTo = _.currentSlide + _.options.slidesToScroll; 14692 if (!_.paused && !_.interrupted && !_.focussed) { 14693 if (_.options.infinite === false) { 14694 if (_.direction === 1 && _.currentSlide + 1 === _.slideCount - 1) { 14695 _.direction = 0; 14696 } else if (_.direction === 0) { 14697 slideTo = _.currentSlide - _.options.slidesToScroll; 14698 if (_.currentSlide - 1 === 0) { 14699 _.direction = 1; 14700 } 14701 } 14702 } 14703 _.slideHandler(slideTo); 14704 } 14705 }; 14706 Slick.prototype.buildArrows = function () { 14707 var _ = this; 14708 if (_.options.arrows === true) { 14709 _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow'); 14710 _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow'); 14711 if (_.slideCount > _.options.slidesToShow) { 14712 _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 14713 _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 14714 if (_.htmlExpr.test(_.options.prevArrow)) { 14715 _.$prevArrow.prependTo(_.options.appendArrows); 14716 } 14717 if (_.htmlExpr.test(_.options.nextArrow)) { 14718 _.$nextArrow.appendTo(_.options.appendArrows); 14719 } 14720 if (_.options.infinite !== true) { 14721 _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 14722 } 14723 } else { 14724 _.$prevArrow.add(_.$nextArrow).addClass('slick-hidden').attr({ 14725 'aria-disabled': 'true', 14726 'tabindex': '-1' 14727 }); 14728 } 14729 } 14730 }; 14731 Slick.prototype.buildDots = function () { 14732 var _ = this, 14733 i, 14734 dot; 14735 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 14736 _.$slider.addClass('slick-dotted'); 14737 dot = $('<ul />').addClass(_.options.dotsClass); 14738 for (i = 0; i <= _.getDotCount(); i += 1) { 14739 dot.append($('<li />').append(_.options.customPaging.call(this, _, i))); 14740 } 14741 _.$dots = dot.appendTo(_.options.appendDots); 14742 _.$dots.find('li').first().addClass('slick-active'); 14743 } 14744 }; 14745 Slick.prototype.buildOut = function () { 14746 var _ = this; 14747 _.$slides = _.$slider.children(_.options.slide + ':not(.slick-cloned)').addClass('slick-slide'); 14748 _.slideCount = _.$slides.length; 14749 _.$slides.each(function (index, element) { 14750 $(element).attr('data-slick-index', index).data('originalStyling', $(element).attr('style') || ''); 14751 }); 14752 _.$slider.addClass('slick-slider'); 14753 _.$slideTrack = _.slideCount === 0 ? $('<div class="slick-track"/>').appendTo(_.$slider) : _.$slides.wrapAll('<div class="slick-track"/>').parent(); 14754 _.$list = _.$slideTrack.wrap('<div class="slick-list"/>').parent(); 14755 _.$slideTrack.css('opacity', 0); 14756 if (_.options.centerMode === true || _.options.swipeToSlide === true) { 14757 _.options.slidesToScroll = 1; 14758 } 14759 $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); 14760 _.setupInfinite(); 14761 _.buildArrows(); 14762 _.buildDots(); 14763 _.updateDots(); 14764 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 14765 if (_.options.draggable === true) { 14766 _.$list.addClass('draggable'); 14767 } 14768 }; 14769 Slick.prototype.buildRows = function () { 14770 var _ = this, 14771 a, 14772 b, 14773 c, 14774 newSlides, 14775 numOfSlides, 14776 originalSlides, 14777 slidesPerSection; 14778 newSlides = document.createDocumentFragment(); 14779 originalSlides = _.$slider.children(); 14780 if (_.options.rows > 0) { 14781 slidesPerSection = _.options.slidesPerRow * _.options.rows; 14782 numOfSlides = Math.ceil(originalSlides.length / slidesPerSection); 14783 for (a = 0; a < numOfSlides; a++) { 14784 var slide = document.createElement('div'); 14785 for (b = 0; b < _.options.rows; b++) { 14786 var row = document.createElement('div'); 14787 for (c = 0; c < _.options.slidesPerRow; c++) { 14788 var target = a * slidesPerSection + (b * _.options.slidesPerRow + c); 14789 if (originalSlides.get(target)) { 14790 row.appendChild(originalSlides.get(target)); 14791 } 14792 } 14793 slide.appendChild(row); 14794 } 14795 newSlides.appendChild(slide); 14796 } 14797 _.$slider.empty().append(newSlides); 14798 _.$slider.children().children().children().css({ 14799 'width': 100 / _.options.slidesPerRow + '%', 14800 'display': 'inline-block' 14801 }); 14802 } 14803 }; 14804 Slick.prototype.checkResponsive = function (initial, forceUpdate) { 14805 var _ = this, 14806 breakpoint, 14807 targetBreakpoint, 14808 respondToWidth, 14809 triggerBreakpoint = false; 14810 var sliderWidth = _.$slider.width(); 14811 var windowWidth = window.innerWidth || $(window).width(); 14812 if (_.respondTo === 'window') { 14813 respondToWidth = windowWidth; 14814 } else if (_.respondTo === 'slider') { 14815 respondToWidth = sliderWidth; 14816 } else if (_.respondTo === 'min') { 14817 respondToWidth = Math.min(windowWidth, sliderWidth); 14818 } 14819 if (_.options.responsive && _.options.responsive.length && _.options.responsive !== null) { 14820 targetBreakpoint = null; 14821 for (breakpoint in _.breakpoints) { 14822 if (_.breakpoints.hasOwnProperty(breakpoint)) { 14823 if (_.originalSettings.mobileFirst === false) { 14824 if (respondToWidth < _.breakpoints[breakpoint]) { 14825 targetBreakpoint = _.breakpoints[breakpoint]; 14826 } 14827 } else { 14828 if (respondToWidth > _.breakpoints[breakpoint]) { 14829 targetBreakpoint = _.breakpoints[breakpoint]; 14830 } 14831 } 14832 } 14833 } 14834 if (targetBreakpoint !== null) { 14835 if (_.activeBreakpoint !== null) { 14836 if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) { 14837 _.activeBreakpoint = targetBreakpoint; 14838 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 14839 _.unslick(targetBreakpoint); 14840 } else { 14841 _.options = $.extend({}, _.originalSettings, _.breakpointSettings[targetBreakpoint]); 14842 if (initial === true) { 14843 _.currentSlide = _.options.initialSlide; 14844 } 14845 _.refresh(initial); 14846 } 14847 triggerBreakpoint = targetBreakpoint; 14848 } 14849 } else { 14850 _.activeBreakpoint = targetBreakpoint; 14851 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 14852 _.unslick(targetBreakpoint); 14853 } else { 14854 _.options = $.extend({}, _.originalSettings, _.breakpointSettings[targetBreakpoint]); 14855 if (initial === true) { 14856 _.currentSlide = _.options.initialSlide; 14857 } 14858 _.refresh(initial); 14859 } 14860 triggerBreakpoint = targetBreakpoint; 14861 } 14862 } else { 14863 if (_.activeBreakpoint !== null) { 14864 _.activeBreakpoint = null; 14865 _.options = _.originalSettings; 14866 if (initial === true) { 14867 _.currentSlide = _.options.initialSlide; 14868 } 14869 _.refresh(initial); 14870 triggerBreakpoint = targetBreakpoint; 14871 } 14872 } 14873 14874 // only trigger breakpoints during an actual break. not on initialize. 14875 if (!initial && triggerBreakpoint !== false) { 14876 _.$slider.trigger('breakpoint', [_, triggerBreakpoint]); 14877 } 14878 } 14879 }; 14880 Slick.prototype.changeSlide = function (event, dontAnimate) { 14881 var _ = this, 14882 $target = $(event.currentTarget), 14883 indexOffset, 14884 slideOffset, 14885 unevenOffset; 14886 14887 // If target is a link, prevent default action. 14888 if ($target.is('a')) { 14889 event.preventDefault(); 14890 } 14891 14892 // If target is not the <li> element (ie: a child), find the <li>. 14893 if (!$target.is('li')) { 14894 $target = $target.closest('li'); 14895 } 14896 unevenOffset = _.slideCount % _.options.slidesToScroll !== 0; 14897 indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; 14898 switch (event.data.message) { 14899 case 'previous': 14900 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; 14901 if (_.slideCount > _.options.slidesToShow) { 14902 _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); 14903 } 14904 break; 14905 case 'next': 14906 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; 14907 if (_.slideCount > _.options.slidesToShow) { 14908 _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); 14909 } 14910 break; 14911 case 'index': 14912 var index = event.data.index === 0 ? 0 : event.data.index || $target.index() * _.options.slidesToScroll; 14913 _.slideHandler(_.checkNavigable(index), false, dontAnimate); 14914 $target.children().trigger('focus'); 14915 break; 14916 default: 14917 return; 14918 } 14919 }; 14920 Slick.prototype.checkNavigable = function (index) { 14921 var _ = this, 14922 navigables, 14923 prevNavigable; 14924 navigables = _.getNavigableIndexes(); 14925 prevNavigable = 0; 14926 if (index > navigables[navigables.length - 1]) { 14927 index = navigables[navigables.length - 1]; 14928 } else { 14929 for (var n in navigables) { 14930 if (index < navigables[n]) { 14931 index = prevNavigable; 14932 break; 14933 } 14934 prevNavigable = navigables[n]; 14935 } 14936 } 14937 return index; 14938 }; 14939 Slick.prototype.cleanUpEvents = function () { 14940 var _ = this; 14941 if (_.options.dots && _.$dots !== null) { 14942 $('li', _.$dots).off('click.slick', _.changeSlide).off('mouseenter.slick', $.proxy(_.interrupt, _, true)).off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 14943 if (_.options.accessibility === true) { 14944 _.$dots.off('keydown.slick', _.keyHandler); 14945 } 14946 } 14947 _.$slider.off('focus.slick blur.slick'); 14948 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 14949 _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); 14950 _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); 14951 if (_.options.accessibility === true) { 14952 _.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler); 14953 _.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler); 14954 } 14955 } 14956 _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); 14957 _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); 14958 _.$list.off('touchend.slick mouseup.slick', _.swipeHandler); 14959 _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); 14960 _.$list.off('click.slick', _.clickHandler); 14961 $(document).off(_.visibilityChange, _.visibility); 14962 _.cleanUpSlideEvents(); 14963 if (_.options.accessibility === true) { 14964 _.$list.off('keydown.slick', _.keyHandler); 14965 } 14966 if (_.options.focusOnSelect === true) { 14967 $(_.$slideTrack).children().off('click.slick', _.selectHandler); 14968 } 14969 $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); 14970 $(window).off('resize.slick.slick-' + _.instanceUid, _.resize); 14971 $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); 14972 $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); 14973 }; 14974 Slick.prototype.cleanUpSlideEvents = function () { 14975 var _ = this; 14976 _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true)); 14977 _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 14978 }; 14979 Slick.prototype.cleanUpRows = function () { 14980 var _ = this, 14981 originalSlides; 14982 if (_.options.rows > 0) { 14983 originalSlides = _.$slides.children().children(); 14984 originalSlides.removeAttr('style'); 14985 _.$slider.empty().append(originalSlides); 14986 } 14987 }; 14988 Slick.prototype.clickHandler = function (event) { 14989 var _ = this; 14990 if (_.shouldClick === false) { 14991 event.stopImmediatePropagation(); 14992 event.stopPropagation(); 14993 event.preventDefault(); 14994 } 14995 }; 14996 Slick.prototype.destroy = function (refresh) { 14997 var _ = this; 14998 _.autoPlayClear(); 14999 _.touchObject = {}; 15000 _.cleanUpEvents(); 15001 $('.slick-cloned', _.$slider).detach(); 15002 if (_.$dots) { 15003 _.$dots.remove(); 15004 } 15005 if (_.$prevArrow && _.$prevArrow.length) { 15006 _.$prevArrow.removeClass('slick-disabled slick-arrow slick-hidden').removeAttr('aria-hidden aria-disabled tabindex').css('display', ''); 15007 if (_.htmlExpr.test(_.options.prevArrow)) { 15008 _.$prevArrow.remove(); 15009 } 15010 } 15011 if (_.$nextArrow && _.$nextArrow.length) { 15012 _.$nextArrow.removeClass('slick-disabled slick-arrow slick-hidden').removeAttr('aria-hidden aria-disabled tabindex').css('display', ''); 15013 if (_.htmlExpr.test(_.options.nextArrow)) { 15014 _.$nextArrow.remove(); 15015 } 15016 } 15017 if (_.$slides) { 15018 _.$slides.removeClass('slick-slide slick-active slick-center slick-visible slick-current').removeAttr('aria-hidden').removeAttr('data-slick-index').each(function () { 15019 $(this).attr('style', $(this).data('originalStyling')); 15020 }); 15021 _.$slideTrack.children(this.options.slide).detach(); 15022 _.$slideTrack.detach(); 15023 _.$list.detach(); 15024 _.$slider.append(_.$slides); 15025 } 15026 _.cleanUpRows(); 15027 _.$slider.removeClass('slick-slider'); 15028 _.$slider.removeClass('slick-initialized'); 15029 _.$slider.removeClass('slick-dotted'); 15030 _.unslicked = true; 15031 if (!refresh) { 15032 _.$slider.trigger('destroy', [_]); 15033 } 15034 }; 15035 Slick.prototype.disableTransition = function (slide) { 15036 var _ = this, 15037 transition = {}; 15038 transition[_.transitionType] = ''; 15039 if (_.options.fade === false) { 15040 _.$slideTrack.css(transition); 15041 } else { 15042 _.$slides.eq(slide).css(transition); 15043 } 15044 }; 15045 Slick.prototype.fadeSlide = function (slideIndex, callback) { 15046 var _ = this; 15047 if (_.cssTransitions === false) { 15048 _.$slides.eq(slideIndex).css({ 15049 zIndex: _.options.zIndex 15050 }); 15051 _.$slides.eq(slideIndex).animate({ 15052 opacity: 1 15053 }, _.options.speed, _.options.easing, callback); 15054 } else { 15055 _.applyTransition(slideIndex); 15056 _.$slides.eq(slideIndex).css({ 15057 opacity: 1, 15058 zIndex: _.options.zIndex 15059 }); 15060 if (callback) { 15061 setTimeout(function () { 15062 _.disableTransition(slideIndex); 15063 callback.call(); 15064 }, _.options.speed); 15065 } 15066 } 15067 }; 15068 Slick.prototype.fadeSlideOut = function (slideIndex) { 15069 var _ = this; 15070 if (_.cssTransitions === false) { 15071 _.$slides.eq(slideIndex).animate({ 15072 opacity: 0, 15073 zIndex: _.options.zIndex - 2 15074 }, _.options.speed, _.options.easing); 15075 } else { 15076 _.applyTransition(slideIndex); 15077 _.$slides.eq(slideIndex).css({ 15078 opacity: 0, 15079 zIndex: _.options.zIndex - 2 15080 }); 15081 } 15082 }; 15083 Slick.prototype.filterSlides = Slick.prototype.slickFilter = function (filter) { 15084 var _ = this; 15085 if (filter !== null) { 15086 _.$slidesCache = _.$slides; 15087 _.unload(); 15088 _.$slideTrack.children(this.options.slide).detach(); 15089 _.$slidesCache.filter(filter).appendTo(_.$slideTrack); 15090 _.reinit(); 15091 } 15092 }; 15093 Slick.prototype.focusHandler = function () { 15094 var _ = this; 15095 _.$slider.off('focus.slick blur.slick').on('focus.slick blur.slick', '*', function (event) { 15096 event.stopImmediatePropagation(); 15097 var $sf = $(this); 15098 setTimeout(function () { 15099 if (_.options.pauseOnFocus) { 15100 _.focussed = $sf.is(':focus'); 15101 _.autoPlay(); 15102 } 15103 }, 0); 15104 }); 15105 }; 15106 Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function () { 15107 var _ = this; 15108 return _.currentSlide; 15109 }; 15110 Slick.prototype.getDotCount = function () { 15111 var _ = this; 15112 var breakPoint = 0; 15113 var counter = 0; 15114 var pagerQty = 0; 15115 if (_.options.infinite === true) { 15116 if (_.slideCount <= _.options.slidesToShow) { 15117 ++pagerQty; 15118 } else { 15119 while (breakPoint < _.slideCount) { 15120 ++pagerQty; 15121 breakPoint = counter + _.options.slidesToScroll; 15122 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 15123 } 15124 } 15125 } else if (_.options.centerMode === true) { 15126 pagerQty = _.slideCount; 15127 } else if (!_.options.asNavFor) { 15128 pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll); 15129 } else { 15130 while (breakPoint < _.slideCount) { 15131 ++pagerQty; 15132 breakPoint = counter + _.options.slidesToScroll; 15133 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 15134 } 15135 } 15136 return pagerQty - 1; 15137 }; 15138 Slick.prototype.getLeft = function (slideIndex) { 15139 var _ = this, 15140 targetLeft, 15141 verticalHeight, 15142 verticalOffset = 0, 15143 targetSlide, 15144 coef; 15145 _.slideOffset = 0; 15146 verticalHeight = _.$slides.first().outerHeight(true); 15147 if (_.options.infinite === true) { 15148 if (_.slideCount > _.options.slidesToShow) { 15149 _.slideOffset = _.slideWidth * _.options.slidesToShow * -1; 15150 coef = -1; 15151 if (_.options.vertical === true && _.options.centerMode === true) { 15152 if (_.options.slidesToShow === 2) { 15153 coef = -1.5; 15154 } else if (_.options.slidesToShow === 1) { 15155 coef = -2; 15156 } 15157 } 15158 verticalOffset = verticalHeight * _.options.slidesToShow * coef; 15159 } 15160 if (_.slideCount % _.options.slidesToScroll !== 0) { 15161 if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { 15162 if (slideIndex > _.slideCount) { 15163 _.slideOffset = (_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth * -1; 15164 verticalOffset = (_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight * -1; 15165 } else { 15166 _.slideOffset = _.slideCount % _.options.slidesToScroll * _.slideWidth * -1; 15167 verticalOffset = _.slideCount % _.options.slidesToScroll * verticalHeight * -1; 15168 } 15169 } 15170 } 15171 } else { 15172 if (slideIndex + _.options.slidesToShow > _.slideCount) { 15173 _.slideOffset = (slideIndex + _.options.slidesToShow - _.slideCount) * _.slideWidth; 15174 verticalOffset = (slideIndex + _.options.slidesToShow - _.slideCount) * verticalHeight; 15175 } 15176 } 15177 if (_.slideCount <= _.options.slidesToShow) { 15178 _.slideOffset = 0; 15179 verticalOffset = 0; 15180 } 15181 if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) { 15182 _.slideOffset = _.slideWidth * Math.floor(_.options.slidesToShow) / 2 - _.slideWidth * _.slideCount / 2; 15183 } else if (_.options.centerMode === true && _.options.infinite === true) { 15184 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; 15185 } else if (_.options.centerMode === true) { 15186 _.slideOffset = 0; 15187 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); 15188 } 15189 if (_.options.vertical === false) { 15190 targetLeft = slideIndex * _.slideWidth * -1 + _.slideOffset; 15191 } else { 15192 targetLeft = slideIndex * verticalHeight * -1 + verticalOffset; 15193 } 15194 if (_.options.variableWidth === true) { 15195 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 15196 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 15197 } else { 15198 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); 15199 } 15200 if (_.options.rtl === true) { 15201 if (targetSlide[0]) { 15202 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 15203 } else { 15204 targetLeft = 0; 15205 } 15206 } else { 15207 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 15208 } 15209 if (_.options.centerMode === true) { 15210 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 15211 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 15212 } else { 15213 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); 15214 } 15215 if (_.options.rtl === true) { 15216 if (targetSlide[0]) { 15217 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 15218 } else { 15219 targetLeft = 0; 15220 } 15221 } else { 15222 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 15223 } 15224 targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; 15225 } 15226 } 15227 return targetLeft; 15228 }; 15229 Slick.prototype.getOption = Slick.prototype.slickGetOption = function (option) { 15230 var _ = this; 15231 return _.options[option]; 15232 }; 15233 Slick.prototype.getNavigableIndexes = function () { 15234 var _ = this, 15235 breakPoint = 0, 15236 counter = 0, 15237 indexes = [], 15238 max; 15239 if (_.options.infinite === false) { 15240 max = _.slideCount; 15241 } else { 15242 breakPoint = _.options.slidesToScroll * -1; 15243 counter = _.options.slidesToScroll * -1; 15244 max = _.slideCount * 2; 15245 } 15246 while (breakPoint < max) { 15247 indexes.push(breakPoint); 15248 breakPoint = counter + _.options.slidesToScroll; 15249 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 15250 } 15251 return indexes; 15252 }; 15253 Slick.prototype.getSlick = function () { 15254 return this; 15255 }; 15256 Slick.prototype.getSlideCount = function () { 15257 var _ = this, 15258 slidesTraversed, 15259 swipedSlide, 15260 centerOffset; 15261 centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0; 15262 if (_.options.swipeToSlide === true) { 15263 _.$slideTrack.find('.slick-slide').each(function (index, slide) { 15264 if (slide.offsetLeft - centerOffset + $(slide).outerWidth() / 2 > _.swipeLeft * -1) { 15265 swipedSlide = slide; 15266 return false; 15267 } 15268 }); 15269 slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; 15270 return slidesTraversed; 15271 } else { 15272 return _.options.slidesToScroll; 15273 } 15274 }; 15275 Slick.prototype.goTo = Slick.prototype.slickGoTo = function (slide, dontAnimate) { 15276 var _ = this; 15277 _.changeSlide({ 15278 data: { 15279 message: 'index', 15280 index: parseInt(slide) 15281 } 15282 }, dontAnimate); 15283 }; 15284 Slick.prototype.init = function (creation) { 15285 var _ = this; 15286 if (!$(_.$slider).hasClass('slick-initialized')) { 15287 $(_.$slider).addClass('slick-initialized'); 15288 _.buildRows(); 15289 _.buildOut(); 15290 _.setProps(); 15291 _.startLoad(); 15292 _.loadSlider(); 15293 _.initializeEvents(); 15294 _.updateArrows(); 15295 _.updateDots(); 15296 _.checkResponsive(true); 15297 _.focusHandler(); 15298 } 15299 if (creation) { 15300 _.$slider.trigger('init', [_]); 15301 } 15302 if (_.options.accessibility === true) { 15303 _.initADA(); 15304 } 15305 if (_.options.autoplay) { 15306 _.paused = false; 15307 _.autoPlay(); 15308 } 15309 }; 15310 Slick.prototype.initADA = function () { 15311 var _ = this, 15312 numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow), 15313 tabControlIndexes = _.getNavigableIndexes().filter(function (val) { 15314 return val >= 0 && val < _.slideCount; 15315 }); 15316 _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({ 15317 'aria-hidden': 'true', 15318 'tabindex': '-1' 15319 }).find('a, input, button, select').attr({ 15320 'tabindex': '-1' 15321 }); 15322 if (_.$dots !== null) { 15323 _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function (i) { 15324 var slideControlIndex = tabControlIndexes.indexOf(i); 15325 $(this).attr({ 15326 'role': 'tabpanel', 15327 'id': 'slick-slide' + _.instanceUid + i, 15328 'tabindex': -1 15329 }); 15330 if (slideControlIndex !== -1) { 15331 var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex; 15332 if ($('#' + ariaButtonControl).length) { 15333 $(this).attr({ 15334 'aria-describedby': ariaButtonControl 15335 }); 15336 } 15337 } 15338 }); 15339 _.$dots.attr('role', 'tablist').find('li').each(function (i) { 15340 var mappedSlideIndex = tabControlIndexes[i]; 15341 $(this).attr({ 15342 'role': 'presentation' 15343 }); 15344 $(this).find('button').first().attr({ 15345 'role': 'tab', 15346 'id': 'slick-slide-control' + _.instanceUid + i, 15347 'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex, 15348 'aria-label': i + 1 + ' of ' + numDotGroups, 15349 'aria-selected': null, 15350 'tabindex': '-1' 15351 }); 15352 }).eq(_.currentSlide).find('button').attr({ 15353 'aria-selected': 'true', 15354 'tabindex': '0' 15355 }).end(); 15356 } 15357 for (var i = _.currentSlide, max = i + _.options.slidesToShow; i < max; i++) { 15358 if (_.options.focusOnChange) { 15359 _.$slides.eq(i).attr({ 15360 'tabindex': '0' 15361 }); 15362 } else { 15363 _.$slides.eq(i).removeAttr('tabindex'); 15364 } 15365 } 15366 _.activateADA(); 15367 }; 15368 Slick.prototype.initArrowEvents = function () { 15369 var _ = this; 15370 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 15371 _.$prevArrow.off('click.slick').on('click.slick', { 15372 message: 'previous' 15373 }, _.changeSlide); 15374 _.$nextArrow.off('click.slick').on('click.slick', { 15375 message: 'next' 15376 }, _.changeSlide); 15377 if (_.options.accessibility === true) { 15378 _.$prevArrow.on('keydown.slick', _.keyHandler); 15379 _.$nextArrow.on('keydown.slick', _.keyHandler); 15380 } 15381 } 15382 }; 15383 Slick.prototype.initDotEvents = function () { 15384 var _ = this; 15385 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 15386 $('li', _.$dots).on('click.slick', { 15387 message: 'index' 15388 }, _.changeSlide); 15389 if (_.options.accessibility === true) { 15390 _.$dots.on('keydown.slick', _.keyHandler); 15391 } 15392 } 15393 if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.slideCount > _.options.slidesToShow) { 15394 $('li', _.$dots).on('mouseenter.slick', $.proxy(_.interrupt, _, true)).on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 15395 } 15396 }; 15397 Slick.prototype.initSlideEvents = function () { 15398 var _ = this; 15399 if (_.options.pauseOnHover) { 15400 _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true)); 15401 _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 15402 } 15403 }; 15404 Slick.prototype.initializeEvents = function () { 15405 var _ = this; 15406 _.initArrowEvents(); 15407 _.initDotEvents(); 15408 _.initSlideEvents(); 15409 _.$list.on('touchstart.slick mousedown.slick', { 15410 action: 'start' 15411 }, _.swipeHandler); 15412 _.$list.on('touchmove.slick mousemove.slick', { 15413 action: 'move' 15414 }, _.swipeHandler); 15415 _.$list.on('touchend.slick mouseup.slick', { 15416 action: 'end' 15417 }, _.swipeHandler); 15418 _.$list.on('touchcancel.slick mouseleave.slick', { 15419 action: 'end' 15420 }, _.swipeHandler); 15421 _.$list.on('click.slick', _.clickHandler); 15422 $(document).on(_.visibilityChange, $.proxy(_.visibility, _)); 15423 if (_.options.accessibility === true) { 15424 _.$list.on('keydown.slick', _.keyHandler); 15425 } 15426 if (_.options.focusOnSelect === true) { 15427 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 15428 } 15429 $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); 15430 $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); 15431 $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); 15432 $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); 15433 $(_.setPosition); 15434 }; 15435 Slick.prototype.initUI = function () { 15436 var _ = this; 15437 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 15438 _.$prevArrow.show(); 15439 _.$nextArrow.show(); 15440 } 15441 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 15442 _.$dots.show(); 15443 } 15444 }; 15445 Slick.prototype.keyHandler = function (event) { 15446 var _ = this; 15447 //Dont slide if the cursor is inside the form fields and arrow keys are pressed 15448 if (!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) { 15449 if (event.keyCode === 37 && _.options.accessibility === true) { 15450 _.changeSlide({ 15451 data: { 15452 message: _.options.rtl === true ? 'next' : 'previous' 15453 } 15454 }); 15455 } else if (event.keyCode === 39 && _.options.accessibility === true) { 15456 _.changeSlide({ 15457 data: { 15458 message: _.options.rtl === true ? 'previous' : 'next' 15459 } 15460 }); 15461 } 15462 } 15463 }; 15464 Slick.prototype.lazyLoad = function () { 15465 var _ = this, 15466 loadRange, 15467 cloneRange, 15468 rangeStart, 15469 rangeEnd; 15470 function loadImages(imagesScope) { 15471 $('img[data-lazy]', imagesScope).each(function () { 15472 var image = $(this), 15473 imageSource = $(this).attr('data-lazy'), 15474 imageSrcSet = $(this).attr('data-srcset'), 15475 imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'), 15476 imageToLoad = document.createElement('img'); 15477 imageToLoad.onload = function () { 15478 image.animate({ 15479 opacity: 0 15480 }, 100, function () { 15481 if (imageSrcSet) { 15482 image.attr('srcset', imageSrcSet); 15483 if (imageSizes) { 15484 image.attr('sizes', imageSizes); 15485 } 15486 } 15487 image.attr('src', imageSource).animate({ 15488 opacity: 1 15489 }, 200, function () { 15490 image.removeAttr('data-lazy data-srcset data-sizes').removeClass('slick-loading'); 15491 }); 15492 _.$slider.trigger('lazyLoaded', [_, image, imageSource]); 15493 }); 15494 }; 15495 imageToLoad.onerror = function () { 15496 image.removeAttr('data-lazy').removeClass('slick-loading').addClass('slick-lazyload-error'); 15497 _.$slider.trigger('lazyLoadError', [_, image, imageSource]); 15498 }; 15499 imageToLoad.src = imageSource; 15500 }); 15501 } 15502 if (_.options.centerMode === true) { 15503 if (_.options.infinite === true) { 15504 rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); 15505 rangeEnd = rangeStart + _.options.slidesToShow + 2; 15506 } else { 15507 rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); 15508 rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; 15509 } 15510 } else { 15511 rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; 15512 rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow); 15513 if (_.options.fade === true) { 15514 if (rangeStart > 0) rangeStart--; 15515 if (rangeEnd <= _.slideCount) rangeEnd++; 15516 } 15517 } 15518 loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); 15519 if (_.options.lazyLoad === 'anticipated') { 15520 var prevSlide = rangeStart - 1, 15521 nextSlide = rangeEnd, 15522 $slides = _.$slider.find('.slick-slide'); 15523 for (var i = 0; i < _.options.slidesToScroll; i++) { 15524 if (prevSlide < 0) prevSlide = _.slideCount - 1; 15525 loadRange = loadRange.add($slides.eq(prevSlide)); 15526 loadRange = loadRange.add($slides.eq(nextSlide)); 15527 prevSlide--; 15528 nextSlide++; 15529 } 15530 } 15531 loadImages(loadRange); 15532 if (_.slideCount <= _.options.slidesToShow) { 15533 cloneRange = _.$slider.find('.slick-slide'); 15534 loadImages(cloneRange); 15535 } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { 15536 cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); 15537 loadImages(cloneRange); 15538 } else if (_.currentSlide === 0) { 15539 cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); 15540 loadImages(cloneRange); 15541 } 15542 }; 15543 Slick.prototype.loadSlider = function () { 15544 var _ = this; 15545 _.setPosition(); 15546 _.$slideTrack.css({ 15547 opacity: 1 15548 }); 15549 _.$slider.removeClass('slick-loading'); 15550 _.initUI(); 15551 if (_.options.lazyLoad === 'progressive') { 15552 _.progressiveLazyLoad(); 15553 } 15554 }; 15555 Slick.prototype.next = Slick.prototype.slickNext = function () { 15556 var _ = this; 15557 _.changeSlide({ 15558 data: { 15559 message: 'next' 15560 } 15561 }); 15562 }; 15563 Slick.prototype.orientationChange = function () { 15564 var _ = this; 15565 _.checkResponsive(); 15566 _.setPosition(); 15567 }; 15568 Slick.prototype.pause = Slick.prototype.slickPause = function () { 15569 var _ = this; 15570 _.autoPlayClear(); 15571 _.paused = true; 15572 }; 15573 Slick.prototype.play = Slick.prototype.slickPlay = function () { 15574 var _ = this; 15575 _.autoPlay(); 15576 _.options.autoplay = true; 15577 _.paused = false; 15578 _.focussed = false; 15579 _.interrupted = false; 15580 }; 15581 Slick.prototype.postSlide = function (index) { 15582 var _ = this; 15583 if (!_.unslicked) { 15584 _.$slider.trigger('afterChange', [_, index]); 15585 _.animating = false; 15586 if (_.slideCount > _.options.slidesToShow) { 15587 _.setPosition(); 15588 } 15589 _.swipeLeft = null; 15590 if (_.options.autoplay) { 15591 _.autoPlay(); 15592 } 15593 if (_.options.accessibility === true) { 15594 _.initADA(); 15595 if (_.options.focusOnChange) { 15596 var $currentSlide = $(_.$slides.get(_.currentSlide)); 15597 $currentSlide.attr('tabindex', 0).focus(); 15598 } 15599 } 15600 } 15601 }; 15602 Slick.prototype.prev = Slick.prototype.slickPrev = function () { 15603 var _ = this; 15604 _.changeSlide({ 15605 data: { 15606 message: 'previous' 15607 } 15608 }); 15609 }; 15610 Slick.prototype.preventDefault = function (event) { 15611 event.preventDefault(); 15612 }; 15613 Slick.prototype.progressiveLazyLoad = function (tryCount) { 15614 tryCount = tryCount || 1; 15615 var _ = this, 15616 $imgsToLoad = $('img[data-lazy]', _.$slider), 15617 image, 15618 imageSource, 15619 imageSrcSet, 15620 imageSizes, 15621 imageToLoad; 15622 if ($imgsToLoad.length) { 15623 image = $imgsToLoad.first(); 15624 imageSource = image.attr('data-lazy'); 15625 imageSrcSet = image.attr('data-srcset'); 15626 imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes'); 15627 imageToLoad = document.createElement('img'); 15628 imageToLoad.onload = function () { 15629 if (imageSrcSet) { 15630 image.attr('srcset', imageSrcSet); 15631 if (imageSizes) { 15632 image.attr('sizes', imageSizes); 15633 } 15634 } 15635 image.attr('src', imageSource).removeAttr('data-lazy data-srcset data-sizes').removeClass('slick-loading'); 15636 if (_.options.adaptiveHeight === true) { 15637 _.setPosition(); 15638 } 15639 _.$slider.trigger('lazyLoaded', [_, image, imageSource]); 15640 _.progressiveLazyLoad(); 15641 }; 15642 imageToLoad.onerror = function () { 15643 if (tryCount < 3) { 15644 /** 15645 * try to load the image 3 times, 15646 * leave a slight delay so we don't get 15647 * servers blocking the request. 15648 */ 15649 setTimeout(function () { 15650 _.progressiveLazyLoad(tryCount + 1); 15651 }, 500); 15652 } else { 15653 image.removeAttr('data-lazy').removeClass('slick-loading').addClass('slick-lazyload-error'); 15654 _.$slider.trigger('lazyLoadError', [_, image, imageSource]); 15655 _.progressiveLazyLoad(); 15656 } 15657 }; 15658 imageToLoad.src = imageSource; 15659 } else { 15660 _.$slider.trigger('allImagesLoaded', [_]); 15661 } 15662 }; 15663 Slick.prototype.refresh = function (initializing) { 15664 var _ = this, 15665 currentSlide, 15666 lastVisibleIndex; 15667 lastVisibleIndex = _.slideCount - _.options.slidesToShow; 15668 15669 // in non-infinite sliders, we don't want to go past the 15670 // last visible index. 15671 if (!_.options.infinite && _.currentSlide > lastVisibleIndex) { 15672 _.currentSlide = lastVisibleIndex; 15673 } 15674 15675 // if less slides than to show, go to start. 15676 if (_.slideCount <= _.options.slidesToShow) { 15677 _.currentSlide = 0; 15678 } 15679 currentSlide = _.currentSlide; 15680 _.destroy(true); 15681 $.extend(_, _.initials, { 15682 currentSlide: currentSlide 15683 }); 15684 _.init(); 15685 if (!initializing) { 15686 _.changeSlide({ 15687 data: { 15688 message: 'index', 15689 index: currentSlide 15690 } 15691 }, false); 15692 } 15693 }; 15694 Slick.prototype.registerBreakpoints = function () { 15695 var _ = this, 15696 breakpoint, 15697 currentBreakpoint, 15698 l, 15699 responsiveSettings = _.options.responsive || null; 15700 if ($.type(responsiveSettings) === 'array' && responsiveSettings.length) { 15701 _.respondTo = _.options.respondTo || 'window'; 15702 for (breakpoint in responsiveSettings) { 15703 l = _.breakpoints.length - 1; 15704 if (responsiveSettings.hasOwnProperty(breakpoint)) { 15705 currentBreakpoint = responsiveSettings[breakpoint].breakpoint; 15706 15707 // loop through the breakpoints and cut out any existing 15708 // ones with the same breakpoint number, we don't want dupes. 15709 while (l >= 0) { 15710 if (_.breakpoints[l] && _.breakpoints[l] === currentBreakpoint) { 15711 _.breakpoints.splice(l, 1); 15712 } 15713 l--; 15714 } 15715 _.breakpoints.push(currentBreakpoint); 15716 _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings; 15717 } 15718 } 15719 _.breakpoints.sort(function (a, b) { 15720 return _.options.mobileFirst ? a - b : b - a; 15721 }); 15722 } 15723 }; 15724 Slick.prototype.reinit = function () { 15725 var _ = this; 15726 _.$slides = _.$slideTrack.children(_.options.slide).addClass('slick-slide'); 15727 _.slideCount = _.$slides.length; 15728 if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { 15729 _.currentSlide = _.currentSlide - _.options.slidesToScroll; 15730 } 15731 if (_.slideCount <= _.options.slidesToShow) { 15732 _.currentSlide = 0; 15733 } 15734 _.registerBreakpoints(); 15735 _.setProps(); 15736 _.setupInfinite(); 15737 _.buildArrows(); 15738 _.updateArrows(); 15739 _.initArrowEvents(); 15740 _.buildDots(); 15741 _.updateDots(); 15742 _.initDotEvents(); 15743 _.cleanUpSlideEvents(); 15744 _.initSlideEvents(); 15745 _.checkResponsive(false, true); 15746 if (_.options.focusOnSelect === true) { 15747 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 15748 } 15749 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 15750 _.setPosition(); 15751 _.focusHandler(); 15752 _.paused = !_.options.autoplay; 15753 _.autoPlay(); 15754 _.$slider.trigger('reInit', [_]); 15755 }; 15756 Slick.prototype.resize = function () { 15757 var _ = this; 15758 if ($(window).width() !== _.windowWidth) { 15759 clearTimeout(_.windowDelay); 15760 _.windowDelay = window.setTimeout(function () { 15761 _.windowWidth = $(window).width(); 15762 _.checkResponsive(); 15763 if (!_.unslicked) { 15764 _.setPosition(); 15765 } 15766 }, 50); 15767 } 15768 }; 15769 Slick.prototype.removeSlide = Slick.prototype.slickRemove = function (index, removeBefore, removeAll) { 15770 var _ = this; 15771 if (typeof index === 'boolean') { 15772 removeBefore = index; 15773 index = removeBefore === true ? 0 : _.slideCount - 1; 15774 } else { 15775 index = removeBefore === true ? --index : index; 15776 } 15777 if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { 15778 return false; 15779 } 15780 _.unload(); 15781 if (removeAll === true) { 15782 _.$slideTrack.children().remove(); 15783 } else { 15784 _.$slideTrack.children(this.options.slide).eq(index).remove(); 15785 } 15786 _.$slides = _.$slideTrack.children(this.options.slide); 15787 _.$slideTrack.children(this.options.slide).detach(); 15788 _.$slideTrack.append(_.$slides); 15789 _.$slidesCache = _.$slides; 15790 _.reinit(); 15791 }; 15792 Slick.prototype.setCSS = function (position) { 15793 var _ = this, 15794 positionProps = {}, 15795 x, 15796 y; 15797 if (_.options.rtl === true) { 15798 position = -position; 15799 } 15800 x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; 15801 y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; 15802 positionProps[_.positionProp] = position; 15803 if (_.transformsEnabled === false) { 15804 _.$slideTrack.css(positionProps); 15805 } else { 15806 positionProps = {}; 15807 if (_.cssTransitions === false) { 15808 positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; 15809 _.$slideTrack.css(positionProps); 15810 } else { 15811 positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; 15812 _.$slideTrack.css(positionProps); 15813 } 15814 } 15815 }; 15816 Slick.prototype.setDimensions = function () { 15817 var _ = this; 15818 if (_.options.vertical === false) { 15819 if (_.options.centerMode === true) { 15820 _.$list.css({ 15821 padding: '0px ' + _.options.centerPadding 15822 }); 15823 } 15824 } else { 15825 _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); 15826 if (_.options.centerMode === true) { 15827 _.$list.css({ 15828 padding: _.options.centerPadding + ' 0px' 15829 }); 15830 } 15831 } 15832 _.listWidth = _.$list.width(); 15833 _.listHeight = _.$list.height(); 15834 if (_.options.vertical === false && _.options.variableWidth === false) { 15835 _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); 15836 _.$slideTrack.width(Math.ceil(_.slideWidth * _.$slideTrack.children('.slick-slide').length)); 15837 } else if (_.options.variableWidth === true) { 15838 _.$slideTrack.width(5000 * _.slideCount); 15839 } else { 15840 _.slideWidth = Math.ceil(_.listWidth); 15841 _.$slideTrack.height(Math.ceil(_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)); 15842 } 15843 var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); 15844 if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); 15845 }; 15846 Slick.prototype.setFade = function () { 15847 var _ = this, 15848 targetLeft; 15849 _.$slides.each(function (index, element) { 15850 targetLeft = _.slideWidth * index * -1; 15851 if (_.options.rtl === true) { 15852 $(element).css({ 15853 position: 'relative', 15854 right: targetLeft, 15855 top: 0, 15856 zIndex: _.options.zIndex - 2, 15857 opacity: 0 15858 }); 15859 } else { 15860 $(element).css({ 15861 position: 'relative', 15862 left: targetLeft, 15863 top: 0, 15864 zIndex: _.options.zIndex - 2, 15865 opacity: 0 15866 }); 15867 } 15868 }); 15869 _.$slides.eq(_.currentSlide).css({ 15870 zIndex: _.options.zIndex - 1, 15871 opacity: 1 15872 }); 15873 }; 15874 Slick.prototype.setHeight = function () { 15875 var _ = this; 15876 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 15877 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 15878 _.$list.css('height', targetHeight); 15879 } 15880 }; 15881 Slick.prototype.setOption = Slick.prototype.slickSetOption = function () { 15882 /** 15883 * accepts arguments in format of: 15884 * 15885 * - for changing a single option's value: 15886 * .slick("setOption", option, value, refresh ) 15887 * 15888 * - for changing a set of responsive options: 15889 * .slick("setOption", 'responsive', [{}, ...], refresh ) 15890 * 15891 * - for updating multiple values at once (not responsive) 15892 * .slick("setOption", { 'option': value, ... }, refresh ) 15893 */ 15894 15895 var _ = this, 15896 l, 15897 item, 15898 option, 15899 value, 15900 refresh = false, 15901 type; 15902 if ($.type(arguments[0]) === 'object') { 15903 option = arguments[0]; 15904 refresh = arguments[1]; 15905 type = 'multiple'; 15906 } else if ($.type(arguments[0]) === 'string') { 15907 option = arguments[0]; 15908 value = arguments[1]; 15909 refresh = arguments[2]; 15910 if (arguments[0] === 'responsive' && $.type(arguments[1]) === 'array') { 15911 type = 'responsive'; 15912 } else if (typeof arguments[1] !== 'undefined') { 15913 type = 'single'; 15914 } 15915 } 15916 if (type === 'single') { 15917 _.options[option] = value; 15918 } else if (type === 'multiple') { 15919 $.each(option, function (opt, val) { 15920 _.options[opt] = val; 15921 }); 15922 } else if (type === 'responsive') { 15923 for (item in value) { 15924 if ($.type(_.options.responsive) !== 'array') { 15925 _.options.responsive = [value[item]]; 15926 } else { 15927 l = _.options.responsive.length - 1; 15928 15929 // loop through the responsive object and splice out duplicates. 15930 while (l >= 0) { 15931 if (_.options.responsive[l].breakpoint === value[item].breakpoint) { 15932 _.options.responsive.splice(l, 1); 15933 } 15934 l--; 15935 } 15936 _.options.responsive.push(value[item]); 15937 } 15938 } 15939 } 15940 if (refresh) { 15941 _.unload(); 15942 _.reinit(); 15943 } 15944 }; 15945 Slick.prototype.setPosition = function () { 15946 var _ = this; 15947 _.setDimensions(); 15948 _.setHeight(); 15949 if (_.options.fade === false) { 15950 _.setCSS(_.getLeft(_.currentSlide)); 15951 } else { 15952 _.setFade(); 15953 } 15954 _.$slider.trigger('setPosition', [_]); 15955 }; 15956 Slick.prototype.setProps = function () { 15957 var _ = this, 15958 bodyStyle = document.body.style; 15959 _.positionProp = _.options.vertical === true ? 'top' : 'left'; 15960 if (_.positionProp === 'top') { 15961 _.$slider.addClass('slick-vertical'); 15962 } else { 15963 _.$slider.removeClass('slick-vertical'); 15964 } 15965 if (bodyStyle.WebkitTransition !== undefined || bodyStyle.MozTransition !== undefined || bodyStyle.msTransition !== undefined) { 15966 if (_.options.useCSS === true) { 15967 _.cssTransitions = true; 15968 } 15969 } 15970 if (_.options.fade) { 15971 if (typeof _.options.zIndex === 'number') { 15972 if (_.options.zIndex < 3) { 15973 _.options.zIndex = 3; 15974 } 15975 } else { 15976 _.options.zIndex = _.defaults.zIndex; 15977 } 15978 } 15979 if (bodyStyle.OTransform !== undefined) { 15980 _.animType = 'OTransform'; 15981 _.transformType = '-o-transform'; 15982 _.transitionType = 'OTransition'; 15983 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 15984 } 15985 if (bodyStyle.MozTransform !== undefined) { 15986 _.animType = 'MozTransform'; 15987 _.transformType = '-moz-transform'; 15988 _.transitionType = 'MozTransition'; 15989 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; 15990 } 15991 if (bodyStyle.webkitTransform !== undefined) { 15992 _.animType = 'webkitTransform'; 15993 _.transformType = '-webkit-transform'; 15994 _.transitionType = 'webkitTransition'; 15995 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 15996 } 15997 if (bodyStyle.msTransform !== undefined) { 15998 _.animType = 'msTransform'; 15999 _.transformType = '-ms-transform'; 16000 _.transitionType = 'msTransition'; 16001 if (bodyStyle.msTransform === undefined) _.animType = false; 16002 } 16003 if (bodyStyle.transform !== undefined && _.animType !== false) { 16004 _.animType = 'transform'; 16005 _.transformType = 'transform'; 16006 _.transitionType = 'transition'; 16007 } 16008 _.transformsEnabled = _.options.useTransform && _.animType !== null && _.animType !== false; 16009 }; 16010 Slick.prototype.setSlideClasses = function (index) { 16011 var _ = this, 16012 centerOffset, 16013 allSlides, 16014 indexOffset, 16015 remainder; 16016 allSlides = _.$slider.find('.slick-slide').removeClass('slick-active slick-center slick-current').attr('aria-hidden', 'true'); 16017 _.$slides.eq(index).addClass('slick-current'); 16018 if (_.options.centerMode === true) { 16019 var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0; 16020 centerOffset = Math.floor(_.options.slidesToShow / 2); 16021 if (_.options.infinite === true) { 16022 if (index >= centerOffset && index <= _.slideCount - 1 - centerOffset) { 16023 _.$slides.slice(index - centerOffset + evenCoef, index + centerOffset + 1).addClass('slick-active').attr('aria-hidden', 'false'); 16024 } else { 16025 indexOffset = _.options.slidesToShow + index; 16026 allSlides.slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2).addClass('slick-active').attr('aria-hidden', 'false'); 16027 } 16028 if (index === 0) { 16029 allSlides.eq(allSlides.length - 1 - _.options.slidesToShow).addClass('slick-center'); 16030 } else if (index === _.slideCount - 1) { 16031 allSlides.eq(_.options.slidesToShow).addClass('slick-center'); 16032 } 16033 } 16034 _.$slides.eq(index).addClass('slick-center'); 16035 } else { 16036 if (index >= 0 && index <= _.slideCount - _.options.slidesToShow) { 16037 _.$slides.slice(index, index + _.options.slidesToShow).addClass('slick-active').attr('aria-hidden', 'false'); 16038 } else if (allSlides.length <= _.options.slidesToShow) { 16039 allSlides.addClass('slick-active').attr('aria-hidden', 'false'); 16040 } else { 16041 remainder = _.slideCount % _.options.slidesToShow; 16042 indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; 16043 if (_.options.slidesToShow == _.options.slidesToScroll && _.slideCount - index < _.options.slidesToShow) { 16044 allSlides.slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder).addClass('slick-active').attr('aria-hidden', 'false'); 16045 } else { 16046 allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active').attr('aria-hidden', 'false'); 16047 } 16048 } 16049 } 16050 if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') { 16051 _.lazyLoad(); 16052 } 16053 }; 16054 Slick.prototype.setupInfinite = function () { 16055 var _ = this, 16056 i, 16057 slideIndex, 16058 infiniteCount; 16059 if (_.options.fade === true) { 16060 _.options.centerMode = false; 16061 } 16062 if (_.options.infinite === true && _.options.fade === false) { 16063 slideIndex = null; 16064 if (_.slideCount > _.options.slidesToShow) { 16065 if (_.options.centerMode === true) { 16066 infiniteCount = _.options.slidesToShow + 1; 16067 } else { 16068 infiniteCount = _.options.slidesToShow; 16069 } 16070 for (i = _.slideCount; i > _.slideCount - infiniteCount; i -= 1) { 16071 slideIndex = i - 1; 16072 $(_.$slides[slideIndex]).clone(true).attr('id', '').attr('data-slick-index', slideIndex - _.slideCount).prependTo(_.$slideTrack).addClass('slick-cloned'); 16073 } 16074 for (i = 0; i < infiniteCount + _.slideCount; i += 1) { 16075 slideIndex = i; 16076 $(_.$slides[slideIndex]).clone(true).attr('id', '').attr('data-slick-index', slideIndex + _.slideCount).appendTo(_.$slideTrack).addClass('slick-cloned'); 16077 } 16078 _.$slideTrack.find('.slick-cloned').find('[id]').each(function () { 16079 $(this).attr('id', ''); 16080 }); 16081 } 16082 } 16083 }; 16084 Slick.prototype.interrupt = function (toggle) { 16085 var _ = this; 16086 if (!toggle) { 16087 _.autoPlay(); 16088 } 16089 _.interrupted = toggle; 16090 }; 16091 Slick.prototype.selectHandler = function (event) { 16092 var _ = this; 16093 var targetElement = $(event.target).is('.slick-slide') ? $(event.target) : $(event.target).parents('.slick-slide'); 16094 var index = parseInt(targetElement.attr('data-slick-index')); 16095 if (!index) index = 0; 16096 if (_.slideCount <= _.options.slidesToShow) { 16097 _.slideHandler(index, false, true); 16098 return; 16099 } 16100 _.slideHandler(index); 16101 }; 16102 Slick.prototype.slideHandler = function (index, sync, dontAnimate) { 16103 var targetSlide, 16104 animSlide, 16105 oldSlide, 16106 slideLeft, 16107 targetLeft = null, 16108 _ = this, 16109 navTarget; 16110 sync = sync || false; 16111 if (_.animating === true && _.options.waitForAnimate === true) { 16112 return; 16113 } 16114 if (_.options.fade === true && _.currentSlide === index) { 16115 return; 16116 } 16117 if (sync === false) { 16118 _.asNavFor(index); 16119 } 16120 targetSlide = index; 16121 targetLeft = _.getLeft(targetSlide); 16122 slideLeft = _.getLeft(_.currentSlide); 16123 _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; 16124 if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { 16125 if (_.options.fade === false) { 16126 targetSlide = _.currentSlide; 16127 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 16128 _.animateSlide(slideLeft, function () { 16129 _.postSlide(targetSlide); 16130 }); 16131 } else { 16132 _.postSlide(targetSlide); 16133 } 16134 } 16135 return; 16136 } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > _.slideCount - _.options.slidesToScroll)) { 16137 if (_.options.fade === false) { 16138 targetSlide = _.currentSlide; 16139 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 16140 _.animateSlide(slideLeft, function () { 16141 _.postSlide(targetSlide); 16142 }); 16143 } else { 16144 _.postSlide(targetSlide); 16145 } 16146 } 16147 return; 16148 } 16149 if (_.options.autoplay) { 16150 clearInterval(_.autoPlayTimer); 16151 } 16152 if (targetSlide < 0) { 16153 if (_.slideCount % _.options.slidesToScroll !== 0) { 16154 animSlide = _.slideCount - _.slideCount % _.options.slidesToScroll; 16155 } else { 16156 animSlide = _.slideCount + targetSlide; 16157 } 16158 } else if (targetSlide >= _.slideCount) { 16159 if (_.slideCount % _.options.slidesToScroll !== 0) { 16160 animSlide = 0; 16161 } else { 16162 animSlide = targetSlide - _.slideCount; 16163 } 16164 } else { 16165 animSlide = targetSlide; 16166 } 16167 _.animating = true; 16168 _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]); 16169 oldSlide = _.currentSlide; 16170 _.currentSlide = animSlide; 16171 _.setSlideClasses(_.currentSlide); 16172 if (_.options.asNavFor) { 16173 navTarget = _.getNavTarget(); 16174 navTarget = navTarget.slick('getSlick'); 16175 if (navTarget.slideCount <= navTarget.options.slidesToShow) { 16176 navTarget.setSlideClasses(_.currentSlide); 16177 } 16178 } 16179 _.updateDots(); 16180 _.updateArrows(); 16181 if (_.options.fade === true) { 16182 if (dontAnimate !== true) { 16183 _.fadeSlideOut(oldSlide); 16184 _.fadeSlide(animSlide, function () { 16185 _.postSlide(animSlide); 16186 }); 16187 } else { 16188 _.postSlide(animSlide); 16189 } 16190 _.animateHeight(); 16191 return; 16192 } 16193 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 16194 _.animateSlide(targetLeft, function () { 16195 _.postSlide(animSlide); 16196 }); 16197 } else { 16198 _.postSlide(animSlide); 16199 } 16200 }; 16201 Slick.prototype.startLoad = function () { 16202 var _ = this; 16203 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 16204 _.$prevArrow.hide(); 16205 _.$nextArrow.hide(); 16206 } 16207 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 16208 _.$dots.hide(); 16209 } 16210 _.$slider.addClass('slick-loading'); 16211 }; 16212 Slick.prototype.swipeDirection = function () { 16213 var xDist, 16214 yDist, 16215 r, 16216 swipeAngle, 16217 _ = this; 16218 xDist = _.touchObject.startX - _.touchObject.curX; 16219 yDist = _.touchObject.startY - _.touchObject.curY; 16220 r = Math.atan2(yDist, xDist); 16221 swipeAngle = Math.round(r * 180 / Math.PI); 16222 if (swipeAngle < 0) { 16223 swipeAngle = 360 - Math.abs(swipeAngle); 16224 } 16225 if (swipeAngle <= 45 && swipeAngle >= 0) { 16226 return _.options.rtl === false ? 'left' : 'right'; 16227 } 16228 if (swipeAngle <= 360 && swipeAngle >= 315) { 16229 return _.options.rtl === false ? 'left' : 'right'; 16230 } 16231 if (swipeAngle >= 135 && swipeAngle <= 225) { 16232 return _.options.rtl === false ? 'right' : 'left'; 16233 } 16234 if (_.options.verticalSwiping === true) { 16235 if (swipeAngle >= 35 && swipeAngle <= 135) { 16236 return 'down'; 16237 } else { 16238 return 'up'; 16239 } 16240 } 16241 return 'vertical'; 16242 }; 16243 Slick.prototype.swipeEnd = function (event) { 16244 var _ = this, 16245 slideCount, 16246 direction; 16247 _.dragging = false; 16248 _.swiping = false; 16249 if (_.scrolling) { 16250 _.scrolling = false; 16251 return false; 16252 } 16253 _.interrupted = false; 16254 _.shouldClick = _.touchObject.swipeLength > 10 ? false : true; 16255 if (_.touchObject.curX === undefined) { 16256 return false; 16257 } 16258 if (_.touchObject.edgeHit === true) { 16259 _.$slider.trigger('edge', [_, _.swipeDirection()]); 16260 } 16261 if (_.touchObject.swipeLength >= _.touchObject.minSwipe) { 16262 direction = _.swipeDirection(); 16263 switch (direction) { 16264 case 'left': 16265 case 'down': 16266 slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide + _.getSlideCount()) : _.currentSlide + _.getSlideCount(); 16267 _.currentDirection = 0; 16268 break; 16269 case 'right': 16270 case 'up': 16271 slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide - _.getSlideCount()) : _.currentSlide - _.getSlideCount(); 16272 _.currentDirection = 1; 16273 break; 16274 default: 16275 } 16276 if (direction != 'vertical') { 16277 _.slideHandler(slideCount); 16278 _.touchObject = {}; 16279 _.$slider.trigger('swipe', [_, direction]); 16280 } 16281 } else { 16282 if (_.touchObject.startX !== _.touchObject.curX) { 16283 _.slideHandler(_.currentSlide); 16284 _.touchObject = {}; 16285 } 16286 } 16287 }; 16288 Slick.prototype.swipeHandler = function (event) { 16289 var _ = this; 16290 if (_.options.swipe === false || 'ontouchend' in document && _.options.swipe === false) { 16291 return; 16292 } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { 16293 return; 16294 } 16295 _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? event.originalEvent.touches.length : 1; 16296 _.touchObject.minSwipe = _.listWidth / _.options.touchThreshold; 16297 if (_.options.verticalSwiping === true) { 16298 _.touchObject.minSwipe = _.listHeight / _.options.touchThreshold; 16299 } 16300 switch (event.data.action) { 16301 case 'start': 16302 _.swipeStart(event); 16303 break; 16304 case 'move': 16305 _.swipeMove(event); 16306 break; 16307 case 'end': 16308 _.swipeEnd(event); 16309 break; 16310 } 16311 }; 16312 Slick.prototype.swipeMove = function (event) { 16313 var _ = this, 16314 edgeWasHit = false, 16315 curLeft, 16316 swipeDirection, 16317 swipeLength, 16318 positionOffset, 16319 touches, 16320 verticalSwipeLength; 16321 touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; 16322 if (!_.dragging || _.scrolling || touches && touches.length !== 1) { 16323 return false; 16324 } 16325 curLeft = _.getLeft(_.currentSlide); 16326 _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; 16327 _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; 16328 _.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); 16329 verticalSwipeLength = Math.round(Math.sqrt(Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); 16330 if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) { 16331 _.scrolling = true; 16332 return false; 16333 } 16334 if (_.options.verticalSwiping === true) { 16335 _.touchObject.swipeLength = verticalSwipeLength; 16336 } 16337 swipeDirection = _.swipeDirection(); 16338 if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { 16339 _.swiping = true; 16340 event.preventDefault(); 16341 } 16342 positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); 16343 if (_.options.verticalSwiping === true) { 16344 positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; 16345 } 16346 swipeLength = _.touchObject.swipeLength; 16347 _.touchObject.edgeHit = false; 16348 if (_.options.infinite === false) { 16349 if (_.currentSlide === 0 && swipeDirection === 'right' || _.currentSlide >= _.getDotCount() && swipeDirection === 'left') { 16350 swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; 16351 _.touchObject.edgeHit = true; 16352 } 16353 } 16354 if (_.options.vertical === false) { 16355 _.swipeLeft = curLeft + swipeLength * positionOffset; 16356 } else { 16357 _.swipeLeft = curLeft + swipeLength * (_.$list.height() / _.listWidth) * positionOffset; 16358 } 16359 if (_.options.verticalSwiping === true) { 16360 _.swipeLeft = curLeft + swipeLength * positionOffset; 16361 } 16362 if (_.options.fade === true || _.options.touchMove === false) { 16363 return false; 16364 } 16365 if (_.animating === true) { 16366 _.swipeLeft = null; 16367 return false; 16368 } 16369 _.setCSS(_.swipeLeft); 16370 }; 16371 Slick.prototype.swipeStart = function (event) { 16372 var _ = this, 16373 touches; 16374 _.interrupted = true; 16375 if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { 16376 _.touchObject = {}; 16377 return false; 16378 } 16379 if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { 16380 touches = event.originalEvent.touches[0]; 16381 } 16382 _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; 16383 _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; 16384 _.dragging = true; 16385 }; 16386 Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function () { 16387 var _ = this; 16388 if (_.$slidesCache !== null) { 16389 _.unload(); 16390 _.$slideTrack.children(this.options.slide).detach(); 16391 _.$slidesCache.appendTo(_.$slideTrack); 16392 _.reinit(); 16393 } 16394 }; 16395 Slick.prototype.unload = function () { 16396 var _ = this; 16397 $('.slick-cloned', _.$slider).remove(); 16398 if (_.$dots) { 16399 _.$dots.remove(); 16400 } 16401 if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) { 16402 _.$prevArrow.remove(); 16403 } 16404 if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) { 16405 _.$nextArrow.remove(); 16406 } 16407 _.$slides.removeClass('slick-slide slick-active slick-visible slick-current').attr('aria-hidden', 'true').css('width', ''); 16408 }; 16409 Slick.prototype.unslick = function (fromBreakpoint) { 16410 var _ = this; 16411 _.$slider.trigger('unslick', [_, fromBreakpoint]); 16412 _.destroy(); 16413 }; 16414 Slick.prototype.updateArrows = function () { 16415 var _ = this, 16416 centerOffset; 16417 centerOffset = Math.floor(_.options.slidesToShow / 2); 16418 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow && !_.options.infinite) { 16419 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 16420 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 16421 if (_.currentSlide === 0) { 16422 _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 16423 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 16424 } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { 16425 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 16426 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 16427 } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { 16428 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 16429 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 16430 } 16431 } 16432 }; 16433 Slick.prototype.updateDots = function () { 16434 var _ = this; 16435 if (_.$dots !== null) { 16436 _.$dots.find('li').removeClass('slick-active').end(); 16437 _.$dots.find('li').eq(Math.floor(_.currentSlide / _.options.slidesToScroll)).addClass('slick-active'); 16438 } 16439 }; 16440 Slick.prototype.visibility = function () { 16441 var _ = this; 16442 if (_.options.autoplay) { 16443 if (document[_.hidden]) { 16444 _.interrupted = true; 16445 } else { 16446 _.interrupted = false; 16447 } 16448 } 16449 }; 16450 $.fn.slick = function () { 16451 var _ = this, 16452 opt = arguments[0], 16453 args = Array.prototype.slice.call(arguments, 1), 16454 l = _.length, 16455 i, 16456 ret; 16457 for (i = 0; i < l; i++) { 16458 if (_typeof(opt) == 'object' || typeof opt == 'undefined') _[i].slick = new Slick(_[i], opt);else ret = _[i].slick[opt].apply(_[i].slick, args); 16459 if (typeof ret != 'undefined') return ret; 16460 } 16461 return _; 16462 }; 16463}); 16464 16465/***/ }), 16466
16467/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/cart/cart.js": 16468/*!*******************************************************************************************************************!*\ 16469 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/cart/cart.js ***! 16470 \*******************************************************************************************************************/ 16471/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 16472 16473"use strict"; 16474 16475 16476var base = __webpack_require__(/*! ../product/base */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/product/base.js"); 16477var focusHelper = __webpack_require__(/*! ../components/focus */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js"); 16478 16479/** 16480 * appends params to a url 16481 * @param {string} url - Original url 16482 * @param {Object} params - Parameters to append 16483 * @returns {string} result url with appended parameters 16484 */ 16485function appendToUrl(url, params) { 16486 var newUrl = url; 16487 newUrl += (newUrl.indexOf('?') !== -1 ? '&' : '?') + Object.keys(params).map(function (key) { 16488 return key + '=' + encodeURIComponent(params[key]); 16489 }).join('&'); 16490 return newUrl; 16491} 16492 16493/** 16494 * Checks whether the basket is valid. if invalid displays error message and disables 16495 * checkout button 16496 * @param {Object} data - AJAX response from the server 16497 */ 16498function validateBasket(data) { 16499 if (data.valid.error) { 16500 if (data.valid.message) { 16501 var errorHtml = '<div class="alert alert-danger alert-dismissible valid-cart-error ' + 'fade show" role="alert">' + '<button type="button" class="close" data-dismiss="alert" aria-label="Close">' + '<span aria-hidden="true">×</span>' + '</button>' + data.valid.message + '</div>'; 16502 $('.cart-error').append(errorHtml); 16503 } else { 16504 $('.cart').empty().append('<div class="row"> ' + '<div class="col-12 text-center"> ' + '<h1>' + data.resources.emptyCartMsg + '</h1> ' + '</div> ' + '</div>'); 16505 $('.number-of-items').empty().append(data.resources.numberOfItems); 16506 $('.minicart-quantity').empty().append(data.numItems); 16507 $('.minicart-link').attr({ 16508 'aria-label': data.resources.minicartCountOfItems, 16509 title: data.resources.minicartCountOfItems 16510 }); 16511 $('.minicart .popover').empty(); 16512 $('.minicart .popover').removeClass('show'); 16513 } 16514 $('.checkout-btn').addClass('disabled'); 16515 } else { 16516 $('.checkout-btn').removeClass('disabled'); 16517 } 16518} 16519 16520/** 16521 * re-renders the order totals and the number of items in the cart 16522 * @param {Object} data - AJAX response from the server 16523 */ 16524function updateCartTotals(data) { 16525 $('.number-of-items').empty().append(data.resources.numberOfItems); 16526 $('.shipping-cost').empty().append(data.totals.totalShippingCost); 16527 $('.tax-total').empty().append(data.totals.totalTax); 16528 $('.grand-total').empty().append(data.totals.grandTotal); 16529 $('.sub-total').empty().append(data.totals.subTotal); 16530 $('.minicart-quantity').empty().append(data.numItems); 16531 $('.minicart-link').attr({ 16532 'aria-label': data.resources.minicartCountOfItems, 16533 title: data.resources.minicartCountOfItems 16534 }); 16535 if (data.totals.orderLevelDiscountTotal.value > 0) { 16536 $('.order-discount').removeClass('hide-order-discount'); 16537 $('.order-discount-total').empty().append('- ' + data.totals.orderLevelDiscountTotal.formatted); 16538 } else { 16539 $('.order-discount').addClass('hide-order-discount'); 16540 } 16541 if (data.totals.shippingLevelDiscountTotal.value > 0) { 16542 $('.shipping-discount').removeClass('hide-shipping-discount'); 16543 $('.shipping-discount-total').empty().append('- ' + data.totals.shippingLevelDiscountTotal.formatted); 16544 } else { 16545 $('.shipping-discount').addClass('hide-shipping-discount'); 16546 } 16547 data.items.forEach(function (item) { 16548 if (data.totals.orderLevelDiscountTotal.value > 0) { 16549 $('.coupons-and-promos').empty().append(data.totals.discountsHtml); 16550 } 16551 if (item.renderedPromotions) { 16552 $('.item-' + item.UUID).empty().append(item.renderedPromotions); 16553 } else { 16554 $('.item-' + item.UUID).empty(); 16555 } 16556 $('.uuid-' + item.UUID + ' .unit-price').empty().append(item.renderedPrice); 16557 $('.line-item-price-' + item.UUID + ' .unit-price').empty().append(item.renderedPrice); 16558 $('.item-total-' + item.UUID).empty().append(item.priceTotal.renderedPrice); 16559 }); 16560} 16561 16562/** 16563 * re-renders the order totals and the number of items in the cart 16564 * @param {Object} message - Error message to display 16565 */ 16566function createErrorNotification(message) { 16567 var errorHtml = '<div class="alert alert-danger alert-dismissible valid-cart-error ' + 'fade show" role="alert">
16567' + '<button type="button" class="close" data-dismiss="alert" aria-label="Close">' + '<span aria-hidden="true">×</span>' + '</button>' + message + '</div>'; 16568 $('.cart-error').append(errorHtml); 16569} 16570 16571/** 16572 * re-renders the approaching discount messages 16573 * @param {Object} approachingDiscounts - updated approaching discounts for the cart 16574 */ 16575function updateApproachingDiscounts(approachingDiscounts) { 16576 var html = ''; 16577 $('.approaching-discounts').empty(); 16578 if (approachingDiscounts.length > 0) { 16579 approachingDiscounts.forEach(function (item) { 16580 html += '<div class="single-approaching-discount text-center">' + item.discountMsg + '</div>'; 16581 }); 16582 } 16583 $('.approaching-discounts').append(html); 16584} 16585 16586/** 16587 * Updates the availability of a product line item 16588 * @param {Object} data - AJAX response from the server 16589 * @param {string} uuid - The uuid of the product line item to update 16590 */ 16591function updateAvailability(data, uuid) { 16592 var lineItem; 16593 var messages = ''; 16594 for (var i = 0; i < data.items.length; i++) { 16595 if (data.items[i].UUID === uuid) { 16596 lineItem = data.items[i]; 16597 break; 16598 } 16599 } 16600 if (lineItem != null) { 16601 $('.availability-' + lineItem.UUID).empty(); 16602 if (lineItem.availability) { 16603 if (lineItem.availability.messages) { 16604 lineItem.availability.messages.forEach(function (message) { 16605 messages += '<p class="line-item-attributes">' + message + '</p>'; 16606 }); 16607 } 16608 if (lineItem.availability.inStockDate) { 16609 messages += '<p class="line-item-attributes line-item-instock-date">' + lineItem.availability.inStockDate + '</p>'; 16610 } 16611 } 16612 $('.availability-' + lineItem.UUID).html(messages); 16613 } 16614} 16615 16616/** 16617 * Finds an element in the array that matches search parameter 16618 * @param {array} array - array of items to search 16619 * @param {function} match - function that takes an element and returns a boolean indicating if the match is made 16620 * @returns {Object|null} - returns an element of the array that matched the query. 16621 */ 16622function findItem(array, match) { 16623 // eslint-disable-line no-unused-vars 16624 for (var i = 0, l = array.length; i < l; i++) { 16625 if (match.call(this, array[i])) { 16626 return array[i]; 16627 } 16628 } 16629 return null; 16630} 16631 16632/** 16633 * Updates details of a product line item 16634 * @param {Object} data - AJAX response from the server 16635 * @param {string} uuid - The uuid of the product line item to update 16636 */ 16637function updateProductDetails(data, uuid) { 16638 $('.card.product-info.uuid-' + uuid).replaceWith(data.renderedTemplate); 16639} 16640 16641/** 16642 * Generates the modal window on the first call. 16643 * 16644 */ 16645function getModalHtmlElement() { 16646 if ($('#editProductModal').length !== 0) { 16647 $('#editProductModal').remove(); 16648 } 16649 var htmlString = '<!-- Modal -->' + '<div class="modal fade" id="editProductModal" tabindex="-1" role="dialog">' + '<span class="enter-message sr-only" ></span>' + '<div class="modal-dialog quick-view-dialog">' + '<!-- Modal content-->' + '<div class="modal-content">' + '<div class="modal-header">' + ' <button type="button" class="close pull-right" data-dismiss="modal">' + ' <span aria-hidden="true">×</span>' + ' <span class="sr-only"> </span>' + ' </button>' + '</div>' + '<div class="modal-body"></div>' + '<div class="modal-footer"></div>' + '</div>' + '</div>' + '</div>'; 16650 $('body').append(htmlString); 16651} 16652 16653/** 16654 * Parses the html for a modal window 16655 * @param {string} html - representing the body and footer of the modal window 16656 * 16657 * @return {Object} - Object with properties body and footer. 16658 */ 16659function parseHtml(html) { 16660 var $html = $('<div>').append($.parseHTML(html)); 16661 var body = $html.find('.product-quickview'); 16662 var footer = $html.find('.modal-footer').children(); 16663 return { 16664 body: body, 16665 footer: footer 16666 }; 16667} 16668 16669/** 16670 * replaces the content in the modal window for product variation to be edited. 16671 * @param {string} editProductUrl - url to be used to retrieve a new product model 16672 */ 16673function fillModalElement(editProductUrl) { 16674 $('.modal-body').spinner().start(); 16675 $.ajax({ 16676 url: editProductUrl, 16677 method: 'GET', 16678 dataType: 'json', 16679 success: function success(data) { 16680 var parsedHtml = parseHtml(data.renderedTemplate); 16681 $('#editProductModal .modal-body').empty(); 16682 $('#editProductModal .modal-body').html(parsedHtml.body); 16683 $('#editProductModal .modal-footer').html(parsedHtml.footer); 16684 $('#editProductModal .modal-header .close .sr-only').text(data.closeButtonText); 16685 $('#editProductModal .enter-message').text(data.enterDialogMessage); 16686 $('#editProductModal').modal('show'); 16687 $('body').trigger('editproductmodal:ready'); 16688 $.spinner().stop(); 16689 }, 16690 error: function error() { 16691 $.spinner().stop(); 16692 } 16693 }); 16694} 16695 16696/** 16697 * replace content of modal 16698 * @param {string} actionUrl - url to be used to remove product 16699 * @param {string} productID - pid 16700 * @param {string} productName - product name 16701 * @param {string} uuid - uuid 16702 */ 16703function confirmDelete(actionUrl, productID, productName, uuid) { 16704 var $deleteConfirmBtn = $('.cart-delete-confirmation-btn'); 16705 var $productToRemoveSpan = $('.product-to-remove'); 16706 $deleteConfirmBtn.data('pid', productID); 16707 $deleteConfirmBtn.data('action', actionUrl); 16708 $deleteConfirmBtn.data('uuid', uuid); 16709 $productToRemoveSpan.empty().append(productName); 16710} 16711module.exports = function () { 16712 $('body').on('click', '.remove-product', function (e) { 16713 e.preventDefault(); 16714 var actionUrl = $(this).data('action'); 16715 var productID = $(this).data('pid'); 16716 var productName = $(this).data('name'); 16717 var uuid = $(this).data('uuid'); 16718 confirmDelete(actionUrl, productID, productName, uuid); 16719 }); 16720 $('body').on('afterRemoveFromCart', function (e, data) { 16721 e.preventDefault();
16722 confirmDelete(data.actionUrl, data.productID, data.productName, data.uuid); 16723 }); 16724 $('.optional-promo').click(function (e) { 16725 e.preventDefault(); 16726 $('.promo-code-form').toggle(); 16727 }); 16728 $('body').on('click', '.cart-delete-confirmation-btn', function (e) { 16729 e.preventDefault(); 16730 var productID = $(this).data('pid'); 16731 var url = $(this).data('action'); 16732 var uuid = $(this).data('uuid'); 16733 var urlParams = { 16734 pid: productID, 16735 uuid: uuid 16736 }; 16737 url = appendToUrl(url, urlParams); 16738 $('body > .modal-backdrop').remove(); 16739 $.spinner().start(); 16740 $('body').trigger('cart:beforeUpdate'); 16741 $.ajax({ 16742 url: url, 16743 type: 'get', 16744 dataType: 'json', 16745 success: function success(data) { 16746 if (data.basket.items.length === 0) { 16747 $('.cart').empty().append('<div class="row"> ' + '<div class="col-12 text-center"> ' + '<h1>' + data.basket.resources.emptyCartMsg + '</h1> ' + '</div> ' + '</div>'); 16748 $('.number-of-items').empty().append(data.basket.resources.numberOfItems); 16749 $('.minicart-quantity').empty().append(data.basket.numItems); 16750 $('.minicart-link').attr({ 16751 'aria-label': data.basket.resources.minicartCountOfItems, 16752 title: data.basket.resources.minicartCountOfItems 16753 }); 16754 $('.minicart .popover').empty(); 16755 $('.minicart .popover').removeClass('show'); 16756 $('body').removeClass('modal-open'); 16757 $('html').removeClass('veiled'); 16758 } else { 16759 if (data.toBeDeletedUUIDs && data.toBeDeletedUUIDs.length > 0) { 16760 for (var i = 0; i < data.toBeDeletedUUIDs.length; i++) { 16761 $('.uuid-' + data.toBeDeletedUUIDs[i]).remove(); 16762 } 16763 } 16764 $('.uuid-' + uuid).remove(); 16765 if (!data.basket.hasBonusProduct) { 16766 $('.bonus-product').remove(); 16767 } 16768 $('.coupons-and-promos').empty().append(data.basket.totals.discountsHtml); 16769 updateCartTotals(data.basket); 16770 updateApproachingDiscounts(data.basket.approachingDiscounts); 16771 $('body').trigger('setShippingMethodSelection', data.basket); 16772 validateBasket(data.basket); 16773 } 16774 $('body').trigger('cart:update', data); 16775 $.spinner().stop(); 16776 }, 16777 error: function error(err) { 16778 if (err.responseJSON.redirectUrl) { 16779 window.location.href = err.responseJSON.redirectUrl; 16780 } else { 16781 createErrorNotification(err.responseJSON.errorMessage); 16782 $.spinner().stop(); 16783 } 16784 } 16785 }); 16786 }); 16787 $('body').on('change', '.quantity-form > .quantity', function () { 16788 var preSelectQty = $(this).data('pre-select-qty'); 16789 var quantity = $(this).val(); 16790 var productID = $(this).data('pid'); 16791 var url = $(this).data('action'); 16792 var uuid = $(this).data('uuid'); 16793 var urlParams = { 16794 pid: productID, 16795 quantity: quantity, 16796 uuid: uuid 16797 }; 16798 url = appendToUrl(url, urlParams); 16799 $(this).parents('.card').spinner().start(); 16800 $('body').trigger('cart:beforeUpdate'); 16801 $.ajax({ 16802 url: url, 16803 type: 'get', 16804 context: this, 16805 dataType: 'json', 16806 success: function success(data) { 16807 $('.quantity[data-uuid="' + uuid + '"]').val(quantity); 16808 $('.coupons-and-promos').empty().append(data.totals.discountsHtml); 16809 updateCartTotals(data); 16810 updateApproachingDiscounts(data.approachingDiscounts); 16811 updateAvailability(data, uuid); 16812 validateBasket(data); 16813 $(this).data('pre-select-qty', quantity); 16814 $('body').trigger('cart:update', data); 16815 $.spinner().stop(); 16816 if ($(this).parents('.product-info').hasClass('bonus-product-line-item') && $('.cart-page').length) { 16817 location.reload(); 16818 } 16819 }, 16820 error: function error(err) { 16821 if (err.responseJSON.redirectUrl) { 16822 window.location.href = err.responseJSON.redirectUrl; 16823 } else { 16824 createErrorNotification(err.responseJSON.errorMessage); 16825 $(this).val(parseInt(preSelectQty, 10)); 16826 $.spinner().stop(); 16827 } 16828 } 16829 }); 16830 }); 16831 $('.shippingMethods').change(function () { 16832 var url = $(this).attr('data-actionUrl');
16833 var urlParams = { 16834 methodID: $(this).find(':selected').attr('data-shipping-id') 16835 }; 16836 // url = appendToUrl(url, urlParams); 16837 16838 $('.totals').spinner().start(); 16839 $('body').trigger('cart:beforeShippingMethodSelected'); 16840 $.ajax({ 16841 url: url, 16842 type: 'post', 16843 dataType: 'json', 16844 data: urlParams, 16845 success: function success(data) { 16846 if (data.error) { 16847 window.location.href = data.redirectUrl; 16848 } else { 16849 $('.coupons-and-promos').empty().append(data.totals.discountsHtml); 16850 updateCartTotals(data); 16851 updateApproachingDiscounts(data.approachingDiscounts); 16852 validateBasket(data); 16853 } 16854 $('body').trigger('cart:shippingMethodSelected', data); 16855 $.spinner().stop(); 16856 }, 16857 error: function error(err) { 16858 if (err.redirectUrl) { 16859 window.location.href = err.redirectUrl; 16860 } else { 16861 createErrorNotification(err.responseJSON.errorMessage); 16862 $.spinner().stop(); 16863 } 16864 } 16865 }); 16866 }); 16867 $('.promo-code-form').submit(function (e) { 16868 e.preventDefault(); 16869 $.spinner().start(); 16870 $('.coupon-missing-error').hide(); 16871 $('.coupon-error-message').empty(); 16872 if (!$('.coupon-code-field').val()) { 16873 $('.promo-code-form .form-control').addClass('is-invalid'); 16874 $('.promo-code-form .form-control').attr('aria-describedby', 'missingCouponCode'); 16875 $('.coupon-missing-error').show(); 16876 $.spinner().stop(); 16877 return false; 16878 } 16879 var $form = $('.promo-code-form'); 16880 $('.promo-code-form .form-control').removeClass('is-invalid'); 16881 $('.coupon-error-message').empty(); 16882 $('body').trigger('promotion:beforeUpdate'); 16883 $.ajax({ 16884 url: $form.attr('action'), 16885 type: 'GET', 16886 dataType: 'json', 16887 data: $form.serialize(), 16888 success: function success(data) { 16889 if (data.error) { 16890 $('.promo-code-form .form-control').addClass('is-invalid'); 16891 $('.promo-code-form .form-control').attr('aria-describedby', 'invalidCouponCode'); 16892 $('.coupon-error-message').empty().append(data.errorMessage); 16893 $('body').trigger('promotion:error', data); 16894 } else { 16895 $('.coupons-and-promos').empty().append(data.totals.discountsHtml); 16896 updateCartTotals(data); 16897 updateApproachingDiscounts(data.approachingDiscounts); 16898 validateBasket(data); 16899 $('body').trigger('promotion:success', data); 16900 } 16901 $('.coupon-code-field').val(''); 16902 $.spinner().stop(); 16903 }, 16904 error: function error(err) { 16905 $('body').trigger('promotion:error', err); 16906 if (err.responseJSON.redirectUrl) { 16907 window.location.href = err.responseJSON.redirectUrl; 16908 } else { 16909 createErrorNotification(err.errorMessage); 16910 $.spinner().stop(); 16911 } 16912 } 16913 }); 16914 return false; 16915 }); 16916 $('body').on('click', '.remove-coupon', function (e) { 16917 e.preventDefault(); 16918 var couponCode = $(this).data('code'); 16919 var uuid = $(this).data('uuid'); 16920 var $deleteConfirmBtn = $('.delete-coupon-confirmation-btn'); 16921 var $productToRemoveSpan = $('.coupon-to-remove'); 16922 $deleteConfirmBtn.data('uuid', uuid); 16923 $deleteConfirmBtn.data('code', couponCode); 16924 $productToRemoveSpan.empty().append(couponCode); 16925 }); 16926 $('body').on('click', '.delete-coupon-confirmation-btn', function (e) { 16927 e.preventDefault(); 16928 var url = $(this).data('action'); 16929 var uuid = $(this).data('uuid'); 16930 var couponCode = $(this).data('code'); 16931 var urlParams = { 16932 code: couponCode, 16933 uuid: uuid 16934 }; 16935 url = appendToUrl(url, urlParams); 16936 $('body > .modal-backdrop').remove(); 16937 $.spinner().start(); 16938 $('body').trigger('promotion:beforeUpdate'); 16939 $.ajax({ 16940 url: url, 16941 type: 'get', 16942 dataType: 'json', 16943 success: function success(data) { 16944 $('.coupon-uuid-' + uuid).remove(); 16945 updateCartTotals(data); 16946 updateApproachingDiscounts(data.approachingDiscounts); 16947 validateBasket(data); 16948 $.spinner().stop(); 16949 $('body').trigger('promotion:success', data); 16950 }, 16951 error: function error(err) { 16952 $('body').trigger('promotion:error', err); 16953 if (err.responseJSON.redirectUrl) { 16954 window.location.href = err.responseJSON.redirectUrl; 16955 } else { 16956 createErrorNotification(err.responseJSON.errorMessage); 16957 $.spinner().stop(); 16958 } 16959 } 16960 }); 16961 }); 16962 $('body').on('click', '.cart-page .bonus-product-button', function () { 16963 $.spinner().start(); 16964 $(this).addClass('launched-modal'); 16965 $.ajax({ 16966 url: $(this).data('url'), 16967 method: 'GET', 16968 dataType: 'json', 16969 success: function success(data) { 16970 base.methods.editBonusProducts(data); 16971 $.spinner().stop(); 16972 }, 16973 error: function error() { 16974 $.spinner().stop(); 16975 } 16976 }); 16977 }); 16978 $('body').on('hidden.bs.modal', '#chooseBonusProductModal', function () { 16979 $('#chooseBonusProductModal').remove(); 16980 $('.modal-backdrop').remove(); 16981 $('body').removeClass('modal-open'); 16982 if ($('.cart-page').length) { 16983 $('.launched-modal .btn-outline-primary').trigger('focus'); 16984 $('.launched-modal').removeClass('launched-modal'); 16985 } else { 16986 $('.product-detail .add-to-cart').focus(); 16987 } 16988 }); 16989 $('body').on('click', '.cart-page .product-edit .edit, .cart-page .bundle-edit .edit', function (e) { 16990 e.preventDefault(); 16991 var editProductUrl = $(this).attr('href'); 16992 getModalHtmlElement(); 16993 fillModalElement(editProductUrl); 16994 }); 16995 $('body').on('shown.bs.modal', '#editProductModal', function () { 16996 $('#editProductModal').siblings().attr('aria-hidden', 'true'); 16997 $('#editProductModal .close').focus(); 16998 }); 16999 $('body').on('hidden.bs.modal', '#editProductModal', function () { 17000 $('#editProductModal').siblings().attr('aria-hidden', 'false'); 17001 }); 17002 $('body').on('keydown', '#editProductModal', function (e) { 17003 var focusParams = { 17004 event: e, 17005 containerSelector: '#editProductModal', 17006 firstElementSelector: '.close', 17007 lastElementSelector: '.update-cart-product-global', 17008 nextToLastElementSelector: '.modal-footer .quantity-select' 17009 }; 17010 focusHelper.setTabNextFocus(focusParams); 17011 }); 17012 $('body').on('product:updateAddToCart', function (e, response) { 17013 // update global add to cart (single products, bundles)
17014 var dialog = $(response.$productContainer).closest('.quick-view-dialog'); 17015 $('.update-cart-product-global', dialog).attr('disabled', !$('.global-availability', dialog).data('ready-to-order') || !$('.global-availability', dialog).data('available')); 17016 }); 17017 $('body').on('product:updateAvailability', function (e, response) { 17018 // bundle individual products 17019 $('.product-availability', response.$productContainer).data('ready-to-order', response.product.readyToOrder).data('available', response.product.available).find('.availability-msg').empty().html(response.message); 17020 var dialog = $(response.$productContainer).closest('.quick-view-dialog'); 17021 if ($('.product-availability', dialog).length) { 17022 // bundle all products 17023 var allAvailable = $('.product-availability', dialog).toArray().every(function (item) { 17024 return $(item).data('available'); 17025 }); 17026 var allReady = $('.product-availability', dialog).toArray().every(function (item) { 17027 return $(item).data('ready-to-order'); 17028 }); 17029 $('.global-availability', dialog).data('ready-to-order', allReady).data('available', allAvailable); 17030 $('.global-availability .availability-msg', dialog).empty().html(allReady ? response.message : response.resources.info_selectforstock); 17031 } else { 17032 // single product 17033 $('.global-availability', dialog).data('ready-to-order', response.product.readyToOrder).data('available', response.product.available).find('.availability-msg').empty().html(response.message); 17034 } 17035 }); 17036 $('body').on('product:afterAttributeSelect', function (e, response) { 17037 if ($('.modal.show .product-quickview .bundle-items').length) { 17038 $('.modal.show').find(response.container).data('pid', response.data.product.id); 17039 $('.modal.show').find(response.container).find('.product-id').text(response.data.product.id); 17040 } else { 17041 $('.modal.show .product-quickview').data('pid', response.data.product.id); 17042 } 17043 }); 17044 $('body').on('change', '.quantity-select', function () { 17045 var selectedQuantity = $(this).val(); 17046 $('.modal.show .update-cart-url').data('selected-quantity', selectedQuantity); 17047 }); 17048 $('body').on('change', '.options-select', function () { 17049 var selectedOptionValueId = $(this).children('option:selected').data('value-id'); 17050 $('.modal.show .update-cart-url').data('selected-option', selectedOptionValueId); 17051 }); 17052 $('body').on('click', '.update-cart-product-global', function (e) { 17053 e.preventDefault(); 17054 var updateProductUrl = $(this).closest('.cart-and-ipay').find('.update-cart-url').val(); 17055 var selectedQuantity = $(this).closest('.cart-and-ipay').find('.update-cart-url').data('selected-quantity'); 17056 var selectedOptionValueId = $(this).closest('.cart-and-ipay').find('.update-cart-url').data('selected-option'); 17057 var uuid = $(this).closest('.cart-and-ipay').find('.update-cart-url').data('uuid'); 17058 var form = { 17059 uuid: uuid, 17060 pid: base.getPidValue($(this)), 17061 quantity: selectedQuantity, 17062 selectedOptionValueId: selectedOptionValueId 17063 }; 17064 $(this).parents('.card').spinner().start(); 17065 $('body').trigger('cart:beforeUpdate'); 17066 if (updateProductUrl) { 17067 $.ajax({ 17068 url: updateProductUrl, 17069 type: 'post', 17070 context: this, 17071 data: form, 17072 dataType: 'json', 17073 success: function success(data) { 17074 $('#editProductModal').modal('hide'); 17075 $('.coupons-and-promos').empty().append(data.cartModel.totals.discountsHtml); 17076 updateCartTotals(data.cartModel); 17077 updateApproachingDiscounts(data.cartModel.approachingDiscounts); 17078 updateAvailability(data.cartModel, uuid); 17079 updateProductDetails(data, uuid); 17080 if (data.uuidToBeDeleted) { 17081 $('.uuid-' + data.uuidToBeDeleted).remove(); 17082 } 17083 validateBasket(data.cartModel); 17084 $('body').trigger('cart:update', data); 17085 $.spinner().stop(); 17086 }, 17087 error: function error(err) { 17088 if (err.responseJSON.redirectUrl) { 17089 window.location.href = err.responseJSON.redirectUrl; 17090 } else { 17091 createErrorNotification(err.responseJSON.errorMessage); 17092 $.spinner().stop(); 17093 } 17094 } 17095 }); 17096 } 17097 }); 17098 base.selectAttribute(); 17099 base.colorAttribute(); 17100 base.removeBonusProduct(); 17101 base.selectBonusProduct(); 17102 base.enableBonusProductSelection(); 17103 base.showMoreBonusProducts(); 17104 base.addBonusProductsToCart(); 17105 base.focusChooseBonusProductModal(); 17106 base.trapChooseBonusProductModalFocus(); 17107 base.onClosingChooseBonusProductModal(); 17108}; 17109 17110/***/ }), 17111
17112/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/clientSideValidation.js": 17113/*!*****************************************************************************************************************************************!*\ 17114 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/clientSideValidation.js ***! 17115 \*****************************************************************************************************************************************/ 17116/***/ ((module) => { 17117 17118"use strict"; 17119 17120 17121/** 17122 * Validate whole form. Requires `this` to be set to form object 17123 * @param {jQuery.event} event - Event to be canceled if form is invalid. 17124 * @returns {boolean} - Flag to indicate if form is valid 17125 */ 17126function _validateForm(event) { 17127 var valid = true; 17128 if (this.checkValidity && !this.checkValidity()) { 17129 // safari 17130 valid = false; 17131 if (event) { 17132 event.preventDefault(); 17133 event.stopPropagation(); 17134 event.stopImmediatePropagation(); 17135 } 17136 $(this).find('input, select').each(function () { 17137 if (!this.validity.valid) { 17138 $(this).trigger('invalid', this.validity); 17139 } 17140 }); 17141 } 17142 return valid; 17143} 17144 17145/** 17146 * Remove all validation. Should be called every time before revalidating form 17147 * @param {element} form - Form to be cleared 17148 * @returns {void} 17149 */ 17150function clearForm(form) { 17151 $(form).find('.form-control.is-invalid').removeClass('is-invalid'); 17152} 17153module.exports = {
17154 invalid: function invalid() { 17155 $('form input, form select').on('invalid', function (e) { 17156 e.preventDefault(); 17157 this.setCustomValidity(''); 17158 if (!this.validity.valid) { 17159 var validationMessage = this.validationMessage; 17160 $(this).addClass('is-invalid'); 17161 if (this.validity.patternMismatch && $(this).data('pattern-mismatch')) { 17162 validationMessage = $(this).data('pattern-mismatch'); 17163 } 17164 if ((this.validity.rangeOverflow || this.validity.rangeUnderflow) && $(this).data('range-error')) { 17165 validationMessage = $(this).data('range-error'); 17166 } 17167 if ((this.validity.tooLong || this.validity.tooShort) && $(this).data('range-error')) { 17168 validationMessage = $(this).data('range-error'); 17169 } 17170 if (this.validity.valueMissing && $(this).data('missing-error')) { 17171 validationMessage = $(this).data('missing-error'); 17172 } 17173 $(this).parents('.form-group').find('.invalid-feedback').text(validationMessage); 17174 } 17175 }); 17176 }, 17177 submit: function submit() { 17178 $('form').on('submit', function (e) { 17179 return _validateForm.call(this, e); 17180 }); 17181 }, 17182 buttonClick: function buttonClick() { 17183 $('form button[type="submit"], form input[type="submit"]').on('click', function () { 17184 // clear all errors when trying to submit the form 17185 clearForm($(this).parents('form')); 17186 }); 17187 }, 17188 functions: { 17189 validateForm: function validateForm(form, event) { 17190 _validateForm.call($(form), event || null); 17191 }, 17192 clearForm: clearForm 17193 } 17194}; 17195 17196/***/ }), 17197
17198/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/collapsibleItem.js": 17199/*!************************************************************************************************************************************!*\ 17200 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/collapsibleItem.js ***! 17201 \************************************************************************************************************************************/ 17202/***/ ((module) => { 17203 17204"use strict"; 17205 17206 17207module.exports = function () { 17208 var sizes = ['xs', 'sm', 'md', 'lg', 'xl']; 17209 sizes.forEach(function (size) { 17210 var selector = '.collapsible-' + size + ' .title'; 17211 $('body').on('click', selector, function (e) { 17212 e.preventDefault(); 17213 $(this).parents('.collapsible-' + size).toggleClass('active'); 17214 if ($(this).parents('.collapsible-' + size).hasClass('active')) { 17215 $(this).attr('aria-expanded', true); 17216 } else { 17217 $(this).attr('aria-expanded', false); 17218 } 17219 }); 17220 }); 17221}; 17222 17223/***/ }), 17224
17225/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/consentTracking.js": 17226/*!************************************************************************************************************************************!*\ 17227 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/consentTracking.js ***! 17228 \************************************************************************************************************************************/ 17229/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 17230 17231"use strict"; 17232 17233 17234var focusHelper = __webpack_require__(/*! ../components/focus */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js"); 17235 17236/** 17237 * Renders a modal window that will track the users consenting to accepting site tracking policy 17238 */ 17239function showConsentModal() { 17240 var trackingConsentData = $('.tracking-consent'); 17241 if (!trackingConsentData.data('caonline')) { 17242 return; 17243 } 17244 var urlContent = trackingConsentData.data('url'); 17245 var urlAccept = trackingConsentData.data('accept'); 17246 var urlReject = trackingConsentData.data('reject'); 17247 var textYes = trackingConsentData.data('accepttext'); 17248 var textNo = trackingConsentData.data('rejecttext'); 17249 var textHeader = trackingConsentData.data('heading'); 17250 var tokenName = trackingConsentData.data('tokenname'); 17251 var token = trackingConsentData.data('token'); 17252 var htmlString = '<!-- Modal -->' + '<div class="modal show" id="consent-tracking" aria-modal="true" role="dialog" style="display: block;">' + '<div class="modal-dialog">' + '<!-- Modal content-->' + '<div class="modal-content">' + '<div class="modal-header">' + textHeader + '</div>' + '<div class="modal-body"></div>' + '<div class="modal-footer">' + '<div class="button-wrapper">' + '<button class="affirm btn btn-primary" data-url="' + urlAccept + '" autofocus data-dismiss="modal">' + textYes + '</button>' + '<button class="decline btn btn-primary" data-url="' + urlReject + '" data-dismiss="modal" >' + textNo + '</button>' + '</div>' + '</div>' + '</div>' + '</div>' + '</div>'; 17253 $.spinner().start(); 17254 $('body').append(htmlString); 17255 $.ajax({ 17256 url: urlContent, 17257 type: 'get', 17258 dataType: 'html', 17259 success: function success(response) { 17260 $('.modal-body').html(response); 17261 $('#consent-tracking').modal('show'); 17262 }, 17263 error: function error() { 17264 $('#consent-tracking').remove(); 17265 } 17266 }); 17267 $('#consent-tracking .button-wrapper button').click(function (e) { 17268 e.preventDefault(); 17269 var url = $(this).data('url'); 17270 var data = {}; 17271 data[tokenName] = token; 17272 $.ajax({ 17273 url: url, 17274 type: 'post', 17275 data: data, 17276 dataType: 'json', 17277 success: function success(response) { 17278 // Only hide modal if the operation is successful - don't want to give a false impression 17279 if (response.success) { 17280 $('#consent-tracking').remove(); 17281 $.spinner().stop(); 17282 } 17283 }, 17284 error: function error(err) { 17285 // Expected error response is for CSRF failure, which will include a redirect to CSRF-Fail 17286 if (err.responseJSON.redirectUrl) { 17287 window.location.href = err.responseJSON.redirectUrl; 17288 } 17289 } 17290 }); 17291 }); 17292} 17293module.exports = function () { 17294 if ($('.consented').length === 0 && $('.tracking-consent').hasClass('api-true')) { 17295 showConsentModal(); 17296 } 17297 if ($('.tracking-consent').hasClass('api-true')) { 17298 $('.tracking-consent').click(function () { 17299 showConsentModal(); 17300 }); 17301 } 17302 $('body').on('shown.bs.modal', '#consent-tracking', function () { 17303 $('#consent-tracking').siblings().attr('aria-hidden', 'true'); 17304 $('#consent-tracking .affirm').focus(); 17305 }); 17306 $('body').on('hidden.bs.modal', '#consent-tracking', function () { 17307 $('#consent-tracking').siblings().attr('aria-hidden', 'false'); 17308 }); 17309 $('body').on('keydown', '#consent-tracking', function (e) { 17310 var focusParams = { 17311 event: e, 17312 containerSelector: '#consent-tracking', 17313 firstElementSelector: '.affirm', 17314 lastElementSelector: '.decline', 17315 nextToLastElementSelector: '.affirm' 17316 }; 17317 focusHelper.setTabNextFocus(focusParams); 17318 }); 17319}; 17320 17321/***/ }), 17322
17323/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/cookie.js": 17324/*!***************************************************************************************************************************!*\ 17325 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/cookie.js ***! 17326 \***************************************************************************************************************************/ 17327/***/ ((module) => { 17328 17329"use strict"; 17330 17331 17332/** 17333 * Get cookie value by cookie name from browser 17334 * @param {string} cookieName - name of the cookie 17335 * @returns {string} cookie value of the found cookie name 17336 */ 17337function getCookie(cookieName) { 17338 var name = cookieName + '='; 17339 var decodedCookie = decodeURIComponent(document.cookie); 17340 var cookieArray = decodedCookie.split(';'); 17341 for (var i = 0; i < cookieArray.length; i++) { 17342 var cookieItem = cookieArray[i]; 17343 while (cookieItem.charAt(0) === ' ') { 17344 cookieItem = cookieItem.substring(1); 17345 } 17346 if (cookieItem.indexOf(name) === 0) { 17347 return cookieItem.substring(name.length, cookieItem.length); 17348 } 17349 } 17350 return ''; 17351} 17352module.exports = function () { 17353 if ($('.valid-cookie-warning').length > 0) { 17354 var previousSessionID = window.localStorage.getItem('previousSid'); 17355 var currentSessionID = getCookie('sid'); 17356 if (!previousSessionID && currentSessionID) { 17357 // When a user first time visit the home page, 17358 // set the previousSessionID to currentSessionID 17359 // and Show the cookie alert 17360 previousSessionID = currentSessionID; 17361 window.localStorage.setItem('previousSid', previousSessionID); 17362 $('.cookie-warning-messaging').show(); 17363 } else if (previousSessionID && previousSessionID === currentSessionID) { 17364 // Hide the cookie alert if user is in the same session 17365 $('.cookie-warning-messaging').hide(); 17366 } else { 17367 // Clear the previousSessionID from localStorage 17368 // when user session is changed or expired 17369 window.localStorage.removeItem('previousSid'); 17370 } 17371 } 17372}; 17373 17374/***/ }), 17375
17376/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/countrySelector.js": 17377/*!************************************************************************************************************************************!*\ 17378 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/countrySelector.js ***! 17379 \************************************************************************************************************************************/ 17380/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 17381 17382"use strict"; 17383 17384 17385var keyboardAccessibility = __webpack_require__(/*! ./keyboardAccessibility */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/keyboardAccessibility.js"); 17386module.exports = function () { 17387 $('.country-selector a').click(function (e) { 17388 e.preventDefault(); 17389 var action = $('.page').data('action'); 17390 var localeCode = $(this).data('locale'); 17391 var localeCurrencyCode = $(this).data('currencycode'); 17392 var queryString = $('.page').data('querystring'); 17393 var url = $('.country-selector').data('url'); 17394 $.ajax({ 17395 url: url, 17396 type: 'get', 17397 dataType: 'json', 17398 data: { 17399 code: localeCode, 17400 queryString: queryString, 17401 CurrencyCode: localeCurrencyCode, 17402 action: action 17403 }, 17404 success: function success(response) { 17405 $.spinner().stop(); 17406 if (response && response.redirectUrl) { 17407 window.location.href = response.redirectUrl; 17408 } 17409 }, 17410 error: function error() { 17411 $.spinner().stop(); 17412 } 17413 }); 17414 }); 17415 keyboardAccessibility('.navbar-header .country-selector', { 17416 40: function _($countryOptions) { 17417 // down 17418 if ($(this).is(':focus')) { 17419 $countryOptions.first().focus(); 17420 } else { 17421 $(':focus').next().focus(); 17422 } 17423 }, 17424 38: function _($countryOptions) { 17425 // up 17426 if ($countryOptions.first().is(':focus') || $(this).is(':focus')) { 17427 $(this).focus(); 17428 $(this).removeClass('show'); 17429 } else { 17430 $(':focus').prev().focus(); 17431 } 17432 }, 17433 27: function _() { 17434 // escape 17435 $(this).focus(); 17436 $(this).removeClass('show').children('.dropdown-menu').removeClass('show'); 17437 }, 17438 9: function _() { 17439 // tab 17440 $(this).removeClass('show').children('.dropdown-menu').removeClass('show'); 17441 } 17442 }, function () { 17443 if (!$(this).hasClass('show')) { 17444 $(this).addClass('show'); 17445 } 17446 return $(this).find('.dropdown-country-selector').children('a'); 17447 }); 17448 $('.navbar-header .country-selector').on('focusin', function () { 17449 $(this).addClass('show').children('.dropdown-menu').addClass('show'); 17450 }); 17451}; 17452 17453/***/ }), 17454
17455/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js": 17456/*!**************************************************************************************************************************!*\ 17457 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js ***! 17458 \**************************************************************************************************************************/ 17459/***/ ((module) => { 17460 17461"use strict"; 17462 17463 17464module.exports = { 17465 setTabNextFocus: function setTabNextFocus(focusParams) { 17466 var KEYCODE_TAB = 9; 17467 var isTabPressed = focusParams.event.key === 'Tab' || focusParams.event.keyCode === KEYCODE_TAB; 17468 if (!isTabPressed) { 17469 return; 17470 } 17471 var firstFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.firstElementSelector); 17472 var lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.lastElementSelector); 17473 if ($(focusParams.containerSelector + ' ' + focusParams.lastElementSelector).is(':disabled')) { 17474 lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.nextToLastElementSelector); 17475 if ($('.product-quickview.product-set').length > 0) { 17476 var linkElements = $(focusParams.containerSelector + ' a#fa-link.share-icons'); 17477 lastFocusableEl = linkElements[linkElements.length - 1]; 17478 } 17479 } 17480 if (focusParams.event.shiftKey) /* shift + tab */{ 17481 if ($(':focus').is(firstFocusableEl)) {
17482 lastFocusableEl.focus(); 17483 focusParams.event.preventDefault(); 17484 } 17485 } else /* tab */{ 17486 if ($(':focus').is(lastFocusableEl)) { 17487 // eslint-disable-line 17488 firstFocusableEl.focus(); 17489 focusParams.event.preventDefault(); 17490 } 17491 } 17492 } 17493}; 17494 17495/***/ }), 17496
17497/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/footer.js": 17498/*!***************************************************************************************************************************!*\ 17499 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/footer.js ***! 17500 \***************************************************************************************************************************/ 17501/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 17502 17503"use strict"; 17504 17505 17506var scrollAnimate = __webpack_require__(/*! ./scrollAnimate */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js"); 17507 17508/** 17509 * appends params to a url 17510 * @param {string} data - data returned from the server's ajax call 17511 * @param {Object} button - button that was clicked for email sign-up 17512 */ 17513function displayMessage(data, button) { 17514 $.spinner().stop(); 17515 var status; 17516 if (data.success) { 17517 status = 'alert-success'; 17518 } else { 17519 status = 'alert-danger'; 17520 } 17521 if ($('.email-signup-message').length === 0) { 17522 $('body').append('<div class="email-signup-message"></div>'); 17523 } 17524 $('.email-signup-message').append('<div class="email-signup-alert text-center ' + status + '">' + data.msg + '</div>'); 17525 setTimeout(function () { 17526 $('.email-signup-message').remove(); 17527 button.removeAttr('disabled'); 17528 }, 3000); 17529} 17530module.exports = function () { 17531 $('.back-to-top').click(function () { 17532 scrollAnimate(); 17533 }); 17534 $('.subscribe-email').on('click', function (e) { 17535 e.preventDefault(); 17536 var url = $(this).data('href'); 17537 var button = $(this); 17538 var emailId = $('input[name=hpEmailSignUp]').val(); 17539 $.spinner().start(); 17540 $(this).attr('disabled', true); 17541 $.ajax({ 17542 url: url, 17543 type: 'post', 17544 dataType: 'json', 17545 data: { 17546 emailId: emailId 17547 }, 17548 success: function success(data) { 17549 displayMessage(data, button); 17550 }, 17551 error: function error(err) { 17552 displayMessage(err, button); 17553 } 17554 }); 17555 }); 17556}; 17557 17558/***/ }), 17559
17560/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/keyboardAccessibility.js": 17561/*!******************************************************************************************************************************************!*\ 17562 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/keyboardAccessibility.js ***! 17563 \******************************************************************************************************************************************/ 17564/***/ ((module) => { 17565 17566"use strict"; 17567 17568 17569module.exports = function (selector, keyFunctions, preFunction) { 17570 $(selector).on('keydown', function (e) { 17571 var key = e.which; 17572 var supportedKeyCodes = [37, 38, 39, 40, 27]; 17573 if (supportedKeyCodes.indexOf(key) >= 0) { 17574 e.preventDefault(); 17575 } 17576 var returnedScope = preFunction.call(this); 17577 if (keyFunctions[key]) { 17578 keyFunctions[key].call(this, returnedScope); 17579 } 17580 }); 17581}; 17582 17583/***/ }), 17584
17585/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/menu.js": 17586/*!*************************************************************************************************************************!*\ 17587 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/menu.js ***! 17588 \*************************************************************************************************************************/ 17589/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 17590 17591"use strict"; 17592 17593 17594var keyboardAccessibility = __webpack_require__(/*! ./keyboardAccessibility */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/keyboardAccessibility.js"); 17595var clearSelection = function clearSelection(element) { 17596 $(element).closest('.dropdown').children('.dropdown-menu').children('.top-category').detach(); 17597 $(element).closest('.dropdown.show').children('.nav-link').attr('aria-expanded', 'false'); 17598 $(element).closest('.dropdown.show').children('.dropdown-menu').attr('aria-hidden', 'true'); 17599 $(element).closest('.dropdown.show').removeClass('show'); 17600 $('div.menu-group > ul.nav.navbar-nav > li.nav-item > a').attr('aria-hidden', 'false'); 17601 $(element).closest('li').detach(); 17602}; 17603module.exports = function () { 17604 var isDesktop = function isDesktop(element) { 17605 return $(element).parents('.menu-toggleable-left').css('position') !== 'fixed'; 17606 }; 17607 var headerBannerStatus = window.sessionStorage.getItem('hide_header_banner'); 17608 $('.header-banner .close').on('click', function () { 17609 $('.header-banner').addClass('d-none'); 17610 window.sessionStorage.setItem('hide_header_banner', '1'); 17611 }); 17612 if (!headerBannerStatus || headerBannerStatus < 0) { 17613 $('.header-banner').removeClass('d-none'); 17614 } 17615 keyboardAccessibility('.main-menu .nav-link, .main-menu .dropdown-link', { 17616 40: function _(menuItem) { 17617 // down 17618 if (menuItem.hasClass('nav-item')) { 17619 // top level 17620 $('.navbar-nav .show').removeClass('show').children('.dropdown-menu').removeClass('show'); 17621 menuItem.addClass('show').children('.dropdown-menu').addClass('show'); 17622 menuItem.find('ul > li > a').first().focus(); 17623 } else { 17624 menuItem.removeClass('show').children('.dropdown-menu').removeClass('show'); 17625 if (!(menuItem.next().length > 0)) { 17626 // if this is the last menuItem 17627 menuItem.parent().parent().find('li > a') // set focus to the first menuitem 17628 .first().focus(); 17629 } else { 17630 menuItem.next().children().first().focus(); 17631 } 17632 } 17633 }, 17634 39: function _(menuItem) { 17635 // right 17636 if (menuItem.hasClass('nav-item')) { 17637 // top level 17638 menuItem.removeClass('show').children('.dropdown-menu').removeClass('show'); 17639 $(this).attr('aria-expanded', 'false'); 17640 menuItem.next().children().first().focus(); 17641 } else if (menuItem.hasClass('dropdown')) { 17642 menuItem.addClass('show').children('.dropdown-menu').addClass('show'); 17643 $(this).attr('aria-expanded', 'true'); 17644 menuItem.find('ul > li > a').first().focus(); 17645 } 17646 }, 17647 38: function _(menuItem) { 17648 // up 17649 if (menuItem.hasClass('nav-item')) { 17650 // top level 17651 menuItem.removeClass('show').children('.dropdown-menu').removeClass('show'); 17652 } else if (menuItem.prev().length === 0) { 17653 // first menuItem 17654 menuItem.parent().parent().removeClass('show').children('.nav-link').attr('aria-expanded', 'false'); 17655 menuItem.parent().children().last().children() // set the focus to the last menuItem 17656 .first().focus(); 17657 } else { 17658 menuItem.prev().children().first().focus(); 17659 } 17660 }, 17661 37: function _(menuItem) { 17662 // left 17663 if (menuItem.hasClass('nav-item')) { 17664 // top level 17665 menuItem.removeClass('show').children('.dropdown-menu').removeClass('show'); 17666 $(this).attr('aria-expanded', 'false'); 17667 menuItem.prev().children().first().focus(); 17668 } else { 17669 menuItem.closest('.show').removeClass('show').closest('li.show').removeClass('show').children().first().focus().attr('aria-expanded', 'false'); 17670 } 17671 }, 17672 27: function _(menuItem) { 17673 // escape 17674 var parentMenu = menuItem.hasClass('show') ? menuItem : menuItem.closest('li.show'); 17675 parentMenu.children('.show').removeClass('show'); 17676 parentMenu.removeClass('show').children('.nav-link').attr('aria-expanded', 'false'); 17677 parentMenu.children().first().focus(); 17678 } 17679 }, function () { 17680 return $(this).parent(); 17681 }); 17682 $('.dropdown:not(.disabled) [data-toggle="dropdown"]').on('click', function (e) { 17683 if (!isDesktop(this)) { 17684 $('.modal-background').show(); 17685 // copy parent element into current UL 17686 var li = $('<li class="dropdown-item top-category" role="button"></li>'); 17687 var link = $(this).clone().removeClass('dropdown-toggle').removeAttr('data-toggle').removeAttr('aria-expanded').attr('aria-haspopup', 'false'); 17688 li.append(link); 17689 var closeMenu = $('<li class="nav-menu"></li>'); 17690 closeMenu.append($('.close-menu').first().clone()); 17691 $(this).parent().children('.dropdown-menu').prepend(li).prepend(closeMenu).attr('aria-hidden', 'false'); 17692 // copy navigation menu into view 17693 $(this).parent().addClass('show'); 17694 $(this).attr('aria-expanded', 'true'); 17695 $(link).focus(); 17696 $('div.menu-group > ul.nav.navbar-nav > li.nav-item > a').attr('aria-hidden', 'true'); 17697 e.preventDefault(); 17698 } 17699 }).on('mouseenter', function () { 17700 if (isDesktop(this)) { 17701 var eventElement = this; 17702 $('.navbar-nav > li').each(function () { 17703 if (!$.contains(this, eventElement)) { 17704 $(this).find('.show').each(function () { 17705 clearSelection(this); 17706 }); 17707 if ($(this).hasClass('show')) { 17708 $(this).removeClass('show'); 17709 $(this).children('ul.dropdown-menu').removeClass('show'); 17710 $(this).children('.nav-link').attr('aria-expanded', 'false'); 17711 } 17712 } 17713 }); 17714 // need to close all the dropdowns that are not direct parent of current dropdown 17715 $(this).parent().addClass('show'); 17716 $(this).siblings('.dropdown-menu').addClass('show'); 17717 $(this).attr('aria-expanded', 'true'); 17718 } 17719 }).parent().on('mouseleave', function () { 17720 if (isDesktop(this)) { 17721 $(this).removeClass('show'); 17722 $(this).children('.dropdown-menu').removeClass('show'); 17723 $(this).children('.nav-link').attr('aria-expanded', 'false'); 17724 } 17725 }); 17726 $('.navbar>.close-menu>.close-button').on('click', function (e) { 17727 e.preventDefault(); 17728 $('.menu-toggleable-left').removeClass('in'); 17729 $('.modal-background').hide(); 17730 $('.navbar-toggler').focus(); 17731 $('.main-menu').attr('aria-hidden', 'true'); 17732 $('.main-menu').siblings().attr('aria-hidden', 'false'); 17733 $('header').siblings().attr('aria-hidden', 'false'); 17734 }); 17735 $('.navbar-nav').on('click', '.back', function (e) { 17736 e.preventDefault(); 17737 clearSelection(this); 17738 }); 17739 $('.navbar-nav').on('click', '.close-button', function (e) { 17740 e.preventDefault(); 17741 $('.navbar-nav').find('.top-category').detach(); 17742 $('.navbar-nav').find('.nav-menu').detach(); 17743 $('.navbar-nav').find('.show').removeClass('show'); 17744 $('.menu-toggleable-left').removeClass('in'); 17745 $('.main-menu').siblings().attr('aria-hidden', 'false'); 17746 $('header').siblings().attr('aria-hidden', 'false'); 17747 $('.modal-background').hide(); 17748 }); 17749 $('.navbar-toggler').click(function (e) { 17750 e.preventDefault(); 17751 $('.main-menu').toggleClass('in'); 17752 $('.modal-background').show(); 17753 $('.main-menu').removeClass('d-none'); 17754 $('.main-menu').attr('aria-hidden', 'false'); 17755 $('.main-menu').siblings().attr('aria-hidden', 'true'); 17756 $('header').siblings().attr('aria-hidden', 'true'); 17757 $('.main-menu .nav.navbar-nav .nav-link').first().focus(); 17758 }); 17759 keyboardAccessibility('.navbar-header .user', { 17760 40: function _($popover) { 17761 // down 17762 if ($popover.children('a').first().is(':focus')) { 17763 $popover.next().children().first().focus(); 17764 } else { 17765 $popover.children('a').first().focus(); 17766 } 17767 }, 17768 38: function _($popover) { 17769 // up 17770 if ($popover.children('a').first().is(':focus')) { 17771 $(this).focus(); 17772 $popover.removeClass('show'); 17773 } else { 17774 $popover.children('a').first().focus(); 17775 } 17776 }, 17777 27: function _() { 17778 // escape 17779 $('.navbar-header .user .popover').removeClass('show'); 17780 $('.user').attr('aria-expanded', 'false'); 17781 }, 17782 9: function _() { 17783 // tab 17784 $('.navbar-header .user .popover').removeClass('show'); 17785 $('.user').attr('aria-expanded', 'false'); 17786 } 17787 }, function () { 17788 var $popover = $('.user .popover li.nav-item'); 17789 return $popover; 17790 }); 17791 $('.navbar-header .user').on('mouseenter focusin', function () { 17792 if ($('.navbar-header .user .popover').length > 0) { 17793 $('.navbar-header .user .popover').addClass('show'); 17794 $('.user').attr('aria-expanded', 'true'); 17795 } 17796 }); 17797 $('.navbar-header .user').on('mouseleave', function () { 17798 $('.navbar-header .user .popover').removeClass('show'); 17799 $('.user').attr('aria-expanded', 'false'); 17800 }); 17801 $('body').on('click', '#myaccount', function () { 17802 event.preventDefault(); 17803 }); 17804}; 17805 17806/***/ }), 17807
17808/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/miniCart.js": 17809/*!*****************************************************************************************************************************!*\ 17810 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/miniCart.js ***! 17811 \*****************************************************************************************************************************/ 17812/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 17813 17814"use strict"; 17815 17816 17817var cart = __webpack_require__(/*! ../cart/cart */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/cart/cart.js"); 17818var updateMiniCart = true; 17819module.exports = function () { 17820 cart(); 17821 $('.minicart').on('count:update', function (event, count) { 17822 if (count && $.isNumeric(count.quantityTotal)) { 17823 $('.minicart .minicart-quantity').text(count.quantityTotal); 17824 $('.minicart .minicart-link').attr({ 17825 'aria-label': count.minicartCountOfItems, 17826 title: count.minicartCountOfItems 17827 }); 17828 } 17829 }); 17830 $('.minicart').on('mouseenter focusin touchstart', function () { 17831 if ($('.search:visible').length === 0) { 17832 return; 17833 } 17834 var url = $('.minicart').data('action-url'); 17835 var count = parseInt($('.minicart .minicart-quantity').text(), 10); 17836 if (count !== 0 && $('.minicart .popover.show').length === 0) { 17837 if (!updateMiniCart) { 17838 $('.minicart .popover').addClass('show'); 17839 return; 17840 } 17841 $('.minicart .popover').addClass('show'); 17842 $('.minicart .popover').spinner().start(); 17843 $.get(url, function (data) { 17844 $('.minicart .popover').empty(); 17845 $('.minicart .popover').append(data); 17846 updateMiniCart = false; 17847 $.spinner().stop(); 17848 }); 17849 } 17850 }); 17851 $('body').on('touchstart click', function (e) { 17852 if ($('.minicart').has(e.target).length <= 0) { 17853 $('.minicart .popover').removeClass('show'); 17854 } 17855 }); 17856 $('.minicart').on('mouseleave focusout', function (event) { 17857 if (event.type === 'focusout' && $('.minicart').has(event.target).length > 0 || event.type === 'mouseleave' && $(event.target).is('.minicart .quantity') || $('body').hasClass('modal-open')) { 17858 event.stopPropagation(); 17859 return; 17860 } 17861 $('.minicart .popover').removeClass('show'); 17862 }); 17863 $('body').on('change', '.minicart .quantity', function () { 17864 if ($(this).parents('.bonus-product-line-item').length && $('.cart-page').length) { 17865 location.reload(); 17866 } 17867 }); 17868 $('body').on('product:afterAddToCart', function () { 17869 updateMiniCart = true; 17870 }); 17871 $('body').on('cart:update', function () { 17872 updateMiniCart = true; 17873 }); 17874}; 17875 17876/***/ }), 17877
17878/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js": 17879/*!**********************************************************************************************************************************!*\ 17880 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js ***! 17881 \**********************************************************************************************************************************/ 17882/***/ ((module) => { 17883 17884"use strict"; 17885 17886 17887module.exports = function (element) { 17888 var position = element && element.length ? element.offset().top : 0; 17889 $('html, body').animate({ 17890 scrollTop: position 17891 }, 500); 17892 if (!element) { 17893 $('.logo-home').focus(); 17894 } 17895}; 17896 17897/***/ }), 17898
17899/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/spinner.js": 17900/*!****************************************************************************************************************************!*\ 17901 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/spinner.js ***! 17902 \****************************************************************************************************************************/ 17903/***/ (() => { 17904 17905"use strict"; 17906 17907 17908/** 17909 * Show a spinner inside a given element 17910 * @param {element} $target - Element to block by the veil and spinner. 17911 * Pass body to block the whole page. 17912 */ 17913function addSpinner($target) { 17914 var $veil = $('<div class="veil"><div class="underlay"></div></div>'); 17915 $veil.append('<div class="spinner"><div class="dot1"></div><div class="dot2"></div></div>'); 17916 if ($target.get(0).tagName === 'IMG') { 17917 $target.after($veil); 17918 $veil.css({ 17919 width: $target.width(), 17920 height: $target.height() 17921 }); 17922 if ($target.parent().css('position') === 'static') { 17923 $target.parent().css('position', 'relative'); 17924 } 17925 } else { 17926 $target.append($veil); 17927 if ($target.css('position') === 'static') { 17928 $target.parent().css('position', 'relative'); 17929 $target.parent().addClass('veiled'); 17930 } 17931 if ($target.get(0).tagName === 'BODY') { 17932 $veil.find('.spinner').css('position', 'fixed'); 17933 } 17934 } 17935 $veil.click(function (e) { 17936 e.stopPropagation(); 17937 }); 17938} 17939 17940/** 17941 * Remove existing spinner 17942 * @param {element} $veil - jQuery pointer to the veil element 17943 */ 17944function removeSpinner($veil) { 17945 if ($veil.parent().hasClass('veiled')) { 17946 $veil.parent().css('position', ''); 17947 $veil.parent().removeClass('veiled'); 17948 } 17949 $veil.off('click'); 17950 $veil.remove(); 17951} 17952 17953// element level spinner: 17954$.fn.spinner = function () { 17955 var $element = $(this); 17956 var Fn = function Fn() { 17957 this.start = function () { 17958 if ($element.length) { 17959 addSpinner($element); 17960 } 17961 }; 17962 this.stop = function () { 17963 if ($element.length) { 17964 var $veil = $('.veil'); 17965 removeSpinner($veil); 17966 } 17967 }; 17968 }; 17969 return new Fn(); 17970}; 17971 17972// page-level spinner: 17973$.spinner = function () { 17974 var Fn = function Fn() { 17975 this.start = function () { 17976 addSpinner($('body')); 17977 }; 17978 this.stop = function () { 17979 removeSpinner($('.veil')); 17980 }; 17981 }; 17982 return new Fn(); 17983}; 17984 17985/***/ }), 17986
17987/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/toolTip.js": 17988/*!****************************************************************************************************************************!*\ 17989 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/toolTip.js ***! 17990 \****************************************************************************************************************************/ 17991/***/ ((module) => { 17992 17993"use strict"; 17994 17995 17996module.exports = function () { 17997 $('.info-icon').on('mouseenter focusin', function () { 17998 $(this).find('.tooltip').removeClass('d-none'); 17999 }); 18000 $('.info-icon').on('mouseleave focusout', function () { 18001 $(this).find('.tooltip').addClass('d-none'); 18002 }); 18003}; 18004 18005/***/ }), 18006
18007/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/main.js": 18008/*!**************************************************************************************************************!*\ 18009 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/main.js ***! 18010 \**************************************************************************************************************/ 18011/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { 18012 18013window.jQuery = window.$ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 18014var processInclude = __webpack_require__(/*! ./util */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js"); 18015$(document).ready(function () { 18016 processInclude(__webpack_require__(/*! ./components/menu */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/menu.js")); 18017 processInclude(__webpack_require__(/*! ./components/cookie */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/cookie.js")); 18018 processInclude(__webpack_require__(/*! ./components/consentTracking */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/consentTracking.js")); 18019 processInclude(__webpack_require__(/*! ./components/footer */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/footer.js")); 18020 processInclude(__webpack_require__(/*! ./components/miniCart */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/miniCart.js")); 18021 processInclude(__webpack_require__(/*! ./components/collapsibleItem */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/collapsibleItem.js")); 18022 // processInclude(require('./components/search')); 18023 processInclude(__webpack_require__(/*! ./components/clientSideValidation */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/clientSideValidation.js")); 18024 processInclude(__webpack_require__(/*! ./components/countrySelector */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/countrySelector.js")); 18025 processInclude(__webpack_require__(/*! ./components/toolTip */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/toolTip.js")); 18026}); 18027__webpack_require__(/*! ./thirdParty/bootstrap */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/thirdParty/bootstrap.js"); 18028__webpack_require__(/*! ./components/spinner */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/spinner.js"); 18029 18030/***/ }), 18031
18032/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/product/base.js": 18033/*!**********************************************************************************************************************!*\ 18034 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/product/base.js ***! 18035 \**********************************************************************************************************************/ 18036/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 18037 18038"use strict"; 18039 18040 18041var focusHelper = __webpack_require__(/*! ../components/focus */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js"); 18042 18043/** 18044 * Retrieves the relevant pid value 18045 * @param {jquery} $el - DOM container for a given add to cart button 18046 * @return {string} - value to be used when adding product to cart 18047 */ 18048function getPidValue($el) { 18049 var pid; 18050 if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) { 18051 pid = $($el).closest('.modal-content').find('.product-quickview').data('pid'); 18052 } else if ($('.product-set-detail').length || $('.product-set').length) { 18053 pid = $($el).closest('.product-detail').find('.product-id').text(); 18054 } else { 18055 pid = $('.product-detail:not(".bundle-item")').data('pid'); 18056 } 18057 return pid; 18058} 18059 18060/** 18061 * Retrieve contextual quantity selector 18062 * @param {jquery} $el - DOM container for the relevant quantity 18063 * @return {jquery} - quantity selector DOM container 18064 */ 18065function getQuantitySelector($el) { 18066 var quantitySelected; 18067 if ($el && $('.set-items').length) { 18068 quantitySelected = $($el).closest('.product-detail').find('.quantity-select'); 18069 } else if ($el && $('.product-bundle').length) { 18070 var quantitySelectedModal = $($el).closest('.modal-footer').find('.quantity-select'); 18071 var quantitySelectedPDP = $($el).closest('.bundle-footer').find('.quantity-select'); 18072 if (quantitySelectedModal.val() === undefined) { 18073 quantitySelected = quantitySelectedPDP; 18074 } else { 18075 quantitySelected = quantitySelectedModal; 18076 } 18077 } else { 18078 quantitySelected = $('.quantity-select'); 18079 } 18080 return quantitySelected; 18081} 18082 18083/** 18084 * Retrieves the value associated with the Quantity pull-down menu 18085 * @param {jquery} $el - DOM container for the relevant quantity 18086 * @return {string} - value found in the quantity input 18087 */ 18088function getQuantitySelected($el) { 18089 return getQuantitySelector($el).val(); 18090} 18091 18092/** 18093 * Process the attribute values for an attribute that has image swatches 18094 * 18095 * @param {Object} attr - Attribute 18096 * @param {string} attr.id - Attribute ID 18097 * @param {Object[]} attr.values - Array of attribute value objects 18098 * @param {string} attr.values.value - Attribute coded value 18099 * @param {string} attr.values.url - URL to de/select an attribute value of the product 18100 * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be 18101 * selected. If there is no variant that corresponds to a specific combination of attribute 18102 * values, an attribute may be disabled in the Product Detail Page 18103 * @param {jQuery} $productContainer - DOM container for a given product 18104 * @param {Object} msgs - object containing resource messages 18105 */ 18106function processSwatchValues(attr, $productContainer, msgs) { 18107 attr.values.forEach(function (attrValue) { 18108 var $attrValue = $productContainer.find('[data-attr="' + attr.id + '"] [data-attr-value="' + attrValue.value + '"]'); 18109 var $swatchButton = $attrValue.parent(); 18110 if (attrValue.selected) { 18111 $attrValue.addClass('selected'); 18112 $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText); 18113 } else { 18114 $attrValue.removeClass('selected'); 18115 $attrValue.siblings('.selected-assistive-text').empty(); 18116 } 18117 if (attrValue.url) { 18118 $swatchButton.attr('data-url', attrValue.url); 18119 } else { 18120 $swatchButton.removeAttr('data-url'); 18121 } 18122 18123 // Disable if not selectable 18124 $attrValue.removeClass('selectable unselectable'); 18125 $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable'); 18126 }); 18127} 18128 18129/** 18130 * Process attribute values associated with an attribute that does not have image swatches 18131 * 18132 * @param {Object} attr - Attribute 18133 * @param {string} attr.id - Attribute ID 18134 * @param {Object[]} attr.values - Array of attribute value objects 18135 * @param {string} attr.values.value - Attribute coded value 18136 * @param {string}
18136 attr.values.url - URL to de/select an attribute value of the product 18137 * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be 18138 * selected. If there is no variant that corresponds to a specific combination of attribute 18139 * values, an attribute may be disabled in the Product Detail Page 18140 * @param {jQuery} $productContainer - DOM container for a given product 18141 */ 18142function processNonSwatchValues(attr, $productContainer) { 18143 var $attr = '[data-attr="' + attr.id + '"]'; 18144 var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first'); 18145 $defaultOption.attr('value', attr.resetUrl); 18146 attr.values.forEach(function (attrValue) { 18147 var $attrValue = $productContainer.find($attr + ' [data-attr-value="' + attrValue.value + '"]'); 18148 $attrValue.attr('value', attrValue.url).removeAttr('disabled'); 18149 if (!attrValue.selectable) { 18150 $attrValue.attr('disabled', true); 18151 } 18152 }); 18153} 18154 18155/** 18156 * Routes the handling of attribute processing depending on whether the attribute has image 18157 * swatches or not 18158 * 18159 * @param {Object} attrs - Attribute 18160 * @param {string} attr.id - Attribute ID 18161 * @param {jQuery} $productContainer - DOM element for a given product 18162 * @param {Object} msgs - object containing resource messages 18163 */ 18164function updateAttrs(attrs, $productContainer, msgs) { 18165 // Currently, the only attribute type that has image swatches is Color. 18166 var attrsWithSwatches = ['color']; 18167 attrs.forEach(function (attr) { 18168 if (attrsWithSwatches.indexOf(attr.id) > -1) { 18169 processSwatchValues(attr, $productContainer, msgs); 18170 } else { 18171 processNonSwatchValues(attr, $productContainer); 18172 } 18173 }); 18174} 18175 18176/** 18177 * Updates the availability status in the Product Detail Page 18178 * 18179 * @param {Object} response - Ajax response object after an 18180 * attribute value has been [de]selected 18181 * @param {jQuery} $productContainer - DOM element for a given product 18182 */ 18183function updateAvailability(response, $productContainer) { 18184 var availabilityValue = ''; 18185 var availabilityMessages = response.product.availability.messages; 18186 if (!response.product.readyToOrder) { 18187 availabilityValue = '<li><div>' + response.resources.info_selectforstock + '</div></li>'; 18188 } else { 18189 availabilityMessages.forEach(function (message) { 18190 availabilityValue += '<li><div>' + message + '</div></li>'; 18191 }); 18192 } 18193 $($productContainer).trigger('product:updateAvailability', { 18194 product: response.product, 18195 $productContainer: $productContainer, 18196 message: availabilityValue, 18197 resources: response.resources 18198 }); 18199} 18200 18201/** 18202 * Generates html for product attributes section 18203 * 18204 * @param {array} attributes - list of attributes 18205 * @return {string} - Compiled HTML 18206 */ 18207function getAttributesHtml(attributes) { 18208 if (!attributes) { 18209 return ''; 18210 } 18211 var html = ''; 18212 attributes.forEach(function (attributeGroup) { 18213 if (attributeGroup.ID === 'mainAttributes') { 18214 attributeGroup.attributes.forEach(function (attribute) { 18215 html += '<div class="attribute-values">' + attribute.label + ': ' + attribute.value + '</div>'; 18216 }); 18217 } 18218 }); 18219 return html; 18220} 18221 18222/** 18223 * @typedef UpdatedOptionValue 18224 * @type Object 18225 * @property {string} id - Option value ID for look up 18226 * @property {string} url - Updated option value selection URL 18227 */ 18228 18229/** 18230 * @typedef OptionSelectionResponse 18231 * @type Object 18232 * @property {string} priceHtml - Updated price HTML code 18233 * @property {Object} options - Updated Options 18234 * @property {string} options.id - Option ID 18235 * @property {UpdatedOptionValue[]} options.values - Option values 18236 */ 18237 18238/** 18239 * Updates DOM using post-option selection Ajax response 18240 * 18241 * @param {OptionSelectionResponse} optionsHtml - Ajax response optionsHtml from selecting a product option 18242 * @param {jQuery} $productContainer - DOM element for current product 18243 */ 18244function updateOptions(optionsHtml, $productContainer) { 18245 // Update options 18246 $productContainer.find('.product-options').empty().html(optionsHtml); 18247} 18248 18249/** 18250 * Dynamically creates Bootstrap carousel from response containing images 18251 * @param {Object[]} imgs - Array of large product images,along with related information 18252 * @param {jQuery}
18252 $productContainer - DOM element for a given product 18253 */ 18254function createCarousel(imgs, $productContainer) { 18255 var carousel = $productContainer.find('.carousel'); 18256 $(carousel).carousel('dispose'); 18257 var carouselId = $(carousel).attr('id'); 18258 $(carousel).empty().append('<ol class="carousel-indicators"></ol><div class="carousel-inner" role="listbox"></div><a class="carousel-control-prev" href="#' + carouselId + '" role="button" data-slide="prev"><span class="fa icon-prev" aria-hidden="true"></span><span class="sr-only">' + $(carousel).data('prev') + '</span></a><a class="carousel-control-next" href="#' + carouselId + '" role="button" data-slide="next"><span class="fa icon-next" aria-hidden="true"></span><span class="sr-only">' + $(carousel).data('next') + '</span></a>'); 18259 for (var i = 0; i < imgs.length; i++) { 18260 $('<div class="carousel-item"><img src="' + imgs[i].url + '" class="d-block img-fluid" alt="' + imgs[i].alt + ' image number ' + parseInt(imgs[i].index, 10) + '" title="' + imgs[i].title + '" itemprop="image" /></div>').appendTo($(carousel).find('.carousel-inner')); 18261 $('<li data-target="#' + carouselId + '" data-slide-to="' + i + '" class=""></li>').appendTo($(carousel).find('.carousel-indicators')); 18262 } 18263 $($(carousel).find('.carousel-item')).first().addClass('active'); 18264 $($(carousel).find('.carousel-indicators > li')).first().addClass('active'); 18265 if (imgs.length === 1) { 18266 $($(carousel).find('.carousel-indicators, a[class^="carousel-control-"]')).detach(); 18267 } 18268 $(carousel).carousel(); 18269 $($(carousel).find('.carousel-indicators')).attr('aria-hidden', true); 18270} 18271 18272/** 18273 * Parses JSON from Ajax call made whenever an attribute value is [de]selected 18274 * @param {Object} response - response from Ajax call 18275 * @param {Object} response.product - Product object 18276 * @param {string} response.product.id - Product ID 18277 * @param {Object[]} response.product.variationAttributes - Product attributes 18278 * @param {Object[]} response.product.images - Product images 18279 * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required 18280 * attributes have been selected. Used partially to 18281 * determine whether the Add to Cart button can be enabled 18282 * @param {jQuery} $productContainer - DOM element for a given product. 18283 */ 18284function handleVariantResponse(response, $productContainer) { 18285 var isChoiceOfBonusProducts = $productContainer.parents('.choose-bonus-product-dialog').length > 0; 18286 var isVaraint; 18287 if (response.product.variationAttributes) { 18288 updateAttrs(response.product.variationAttributes, $productContainer, response.resources); 18289 isVaraint = response.product.productType === 'variant'; 18290 if (isChoiceOfBonusProducts && isVaraint) { 18291 $productContainer.parent('.bonus-product-item').data('pid', response.product.id); 18292 $productContainer.parent('.bonus-product-item').data('ready-to-order', response.product.readyToOrder); 18293 } 18294 } 18295 18296 // Update primary images 18297 var primaryImageUrls = response.product.images.large; 18298 createCarousel(primaryImageUrls, $productContainer); 18299 18300 // Update pricing 18301 if (!isChoiceOfBonusProducts) { 18302 var $priceSelector = $('.prices .price', $productContainer).length ? $('.prices .price', $productContainer) : $('.prices .price'); 18303 $priceSelector.replaceWith(response.product.price.html); 18304 } 18305 18306 // Update promotions 18307 $productContainer.find('.promotions').empty().html(response.product.promotionsHtml); 18308 updateAvailability(response, $productContainer); 18309 if (isChoiceOfBonusProducts) { 18310 var $selectButton = $productContainer.find('.select-bonus-product'); 18311 $selectButton.trigger('bonusproduct:updateSelectButton', { 18312 product: response.product, 18313 $productContainer: $productContainer 18314 }); 18315 } else { 18316 // Enable "Add to Cart" button if all required attributes have been selected 18317 $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', { 18318 product: response.product, 18319 $productContainer: $productContainer 18320 }).trigger('product:statusUpdate', response.product); 18321 } 18322 18323 // Update attributes
18324 $productContainer.find('.main-attributes').empty().html(getAttributesHtml(response.product.attributes)); 18325} 18326 18327/** 18328 * @typespec UpdatedQuantity 18329 * @type Object 18330 * @property {boolean} selected - Whether the quantity has been selected 18331 * @property {string} value - The number of products to purchase 18332 * @property {string} url - Compiled URL that specifies variation attributes, product ID, options, 18333 * etc. 18334 */ 18335 18336/** 18337 * Updates the quantity DOM elements post Ajax call 18338 * @param {UpdatedQuantity[]} quantities - 18339 * @param {jQuery} $productContainer - DOM container for a given product 18340 */ 18341function updateQuantities(quantities, $productContainer) { 18342 if ($productContainer.parent('.bonus-product-item').length <= 0) { 18343 var optionsHtml = quantities.map(function (quantity) { 18344 var selected = quantity.selected ? ' selected ' : ''; 18345 return '<option value="' + quantity.value + '" data-url="' + quantity.url + '"' + selected + '>' + quantity.value + '</option>'; 18346 }).join(''); 18347 getQuantitySelector($productContainer).empty().html(optionsHtml); 18348 } 18349} 18350 18351/** 18352 * updates the product view when a product attribute is selected or deselected or when 18353 * changing quantity 18354 * @param {string} selectedValueUrl - the Url for the selected variation value 18355 * @param {jQuery} $productContainer - DOM element for current product 18356 */ 18357function attributeSelect(selectedValueUrl, $productContainer) { 18358 if (selectedValueUrl) { 18359 $('body').trigger('product:beforeAttributeSelect', { 18360 url: selectedValueUrl, 18361 container: $productContainer 18362 }); 18363 $.ajax({ 18364 url: selectedValueUrl, 18365 method: 'GET', 18366 success: function success(data) { 18367 handleVariantResponse(data, $productContainer); 18368 updateOptions(data.product.optionsHtml, $productContainer); 18369 updateQuantities(data.product.quantities, $productContainer); 18370 $('body').trigger('product:afterAttributeSelect', { 18371 data: data, 18372 container: $productContainer 18373 }); 18374 $.spinner().stop(); 18375 }, 18376 error: function error() { 18377 $.spinner().stop(); 18378 } 18379 }); 18380 } 18381} 18382 18383/** 18384 * Retrieves url to use when adding a product to the cart 18385 * 18386 * @return {string} - The provided URL to use when adding a product to the cart 18387 */ 18388function getAddToCartUrl() { 18389 return $('.add-to-cart-url').val(); 18390} 18391 18392/** 18393 * Parses the html for a modal window 18394 * @param {string} html - representing the body and footer of the modal window 18395 * 18396 * @return {Object} - Object with properties body and footer. 18397 */ 18398function parseHtml(html) { 18399 var $html = $('<div>').append($.parseHTML(html)); 18400 var body = $html.find('.choice-of-bonus-product'); 18401 var footer = $html.find('.modal-footer').children(); 18402 return { 18403 body: body, 18404 footer: footer 18405 }; 18406} 18407 18408/** 18409 * Retrieves url to use when adding a product to the cart 18410 * 18411 * @param {Object} data - data object used to fill in dynamic portions of the html 18412 */ 18413function chooseBonusProducts(data) { 18414 $('.modal-body').spinner().start(); 18415 if ($('#chooseBonusProductModal').length !== 0) { 18416 $('#chooseBonusProductModal').remove(); 18417 } 18418 var bonusUrl; 18419 if (data.bonusChoiceRuleBased) { 18420 bonusUrl = data.showProductsUrlRuleBased; 18421 } else { 18422 bonusUrl = data.showProductsUrlListBased; 18423 } 18424 var htmlString = '<!-- Modal -->' + '<div class="modal fade" id="chooseBonusProductModal" tabindex="-1" role="dialog">' + '<span class="enter-message sr-only" ></span>' + '<div class="modal-dialog choose-bonus-product-dialog" ' + 'data-total-qty="' + data.maxBonusItems + '"' + 'data-UUID="' + data.uuid + '"' + 'data-pliUUID="' + data.pliUUID + '"' + 'data-addToCartUrl="' + data.addToCartUrl + '"' + 'data-pageStart="0"' + 'data-pageSize="' + data.pageSize + '"' + 'data-moreURL="' + data.showProductsUrlRuleBased + '"' + 'data-bonusChoiceRuleBased="' + data.bonusChoiceRuleBased + '">' + '<!-- Modal content-->' + '<div class="modal-content">' + '<div class="modal-header">' + ' <span class="">' + data.labels.selectprods + '</span>' + ' <button type="button" class="close pull-right" data-dismiss="modal">' + ' <span aria-hidden="true">×</span>
18424' + ' <span class="sr-only"> </span>' + ' </button>' + '</div>' + '<div class="modal-body"></div>' + '<div class="modal-footer"></div>' + '</div>' + '</div>' + '</div>'; 18425 $('body').append(htmlString); 18426 $('.modal-body').spinner().start(); 18427 $.ajax({ 18428 url: bonusUrl, 18429 method: 'GET', 18430 dataType: 'json', 18431 success: function success(response) { 18432 var parsedHtml = parseHtml(response.renderedTemplate); 18433 $('#chooseBonusProductModal .modal-body').empty(); 18434 $('#chooseBonusProductModal .enter-message').text(response.enterDialogMessage); 18435 $('#chooseBonusProductModal .modal-header .close .sr-only').text(response.closeButtonText); 18436 $('#chooseBonusProductModal .modal-body').html(parsedHtml.body); 18437 $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer); 18438 $('#chooseBonusProductModal').modal('show'); 18439 $.spinner().stop(); 18440 }, 18441 error: function error() { 18442 $.spinner().stop(); 18443 } 18444 }); 18445} 18446 18447/** 18448 * Updates the Mini-Cart quantity value after the customer has pressed the "Add to Cart" button 18449 * @param {string} response - ajax response from clicking the add to cart button 18450 */ 18451function handlePostCartAdd(response) { 18452 $('.minicart').trigger('count:update', response); 18453 var messageType = response.error ? 'alert-danger' : 'alert-success'; 18454 // show add to cart toast 18455 if (response.newBonusDiscountLineItem && Object.keys(response.newBonusDiscountLineItem).length !== 0) {
18456 chooseBonusProducts(response.newBonusDiscountLineItem); 18457 } else { 18458 if ($('.add-to-cart-messages').length === 0) { 18459 $('body').append('<div class="add-to-cart-messages"></div>'); 18460 } 18461 $('.add-to-cart-messages').append('<div class="alert ' + messageType + ' add-to-basket-alert text-center" role="alert">' + response.message + '</div>'); 18462 setTimeout(function () { 18463 $('.add-to-basket-alert').remove(); 18464 }, 5000); 18465 } 18466} 18467 18468/** 18469 * Retrieves the bundle product item ID's for the Controller to replace bundle master product 18470 * items with their selected variants 18471 * 18472 * @return {string[]} - List of selected bundle product item ID's 18473 */ 18474function getChildProducts() { 18475 var childProducts = []; 18476 $('.bundle-item').each(function () { 18477 childProducts.push({ 18478 pid: $(this).find('.product-id').text(), 18479 quantity: parseInt($(this).find('label.quantity').data('quantity'), 10) 18480 }); 18481 }); 18482 return childProducts.length ? JSON.stringify(childProducts) : []; 18483} 18484 18485/** 18486 * Retrieve product options 18487 * 18488 * @param {jQuery} $productContainer - DOM element for current product 18489 * @return {string} - Product options and their selected values 18490 */ 18491function getOptions($productContainer) { 18492 var options = $productContainer.find('.product-option').map(function () { 18493 var $elOption = $(this).find('.options-select'); 18494 var urlValue = $elOption.val(); 18495 var selectedValueId = $elOption.find('option[value="' + urlValue + '"]').data('value-id'); 18496 return { 18497 optionId: $(this).data('option-id'), 18498 selectedValueId: selectedValueId 18499 }; 18500 }).toArray(); 18501 return JSON.stringify(options); 18502} 18503 18504/** 18505 * Makes a call to the server to report the event of adding an item to the cart 18506 * 18507 * @param {string | boolean} url - a string representing the end point to hit so that the event can be recorded, or false 18508 */ 18509function miniCartReportingUrl(url) { 18510 if (url) { 18511 $.ajax({ 18512 url: url, 18513 method: 'GET', 18514 success: function success() { 18515 // reporting urls hit on the server 18516 }, 18517 error: function error() { 18518 // no reporting urls hit on the server 18519 } 18520 }); 18521 } 18522} 18523module.exports = { 18524 attributeSelect: attributeSelect, 18525 methods: { 18526 editBonusProducts: function editBonusProducts(data) { 18527 chooseBonusProducts(data); 18528 } 18529 }, 18530 focusChooseBonusProductModal: function focusChooseBonusProductModal() { 18531 $('body').on('shown.bs.modal', '#chooseBonusProductModal', function () { 18532 $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'true'); 18533 $('#chooseBonusProductModal .close').focus(); 18534 }); 18535 }, 18536 onClosingChooseBonusProductModal: function onClosingChooseBonusProductModal() { 18537 $('body').on('hidden.bs.modal', '#chooseBonusProductModal', function () { 18538 $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'false'); 18539 }); 18540 }, 18541 trapChooseBonusProductModalFocus: function trapChooseBonusProductModalFocus() { 18542 $('body').on('keydown', '#chooseBonusProductModal', function (e) { 18543 var focusParams = { 18544 event: e, 18545 containerSelector: '#chooseBonusProductModal', 18546 firstElementSelector: '.close', 18547 lastElementSelector: '.add-bonus-products' 18548 }; 18549 focusHelper.setTabNextFocus(focusParams); 18550 }); 18551 }, 18552 colorAttribute: function colorAttribute() { 18553 $(document).on('click', '[data-attr="color"] button', function (e) { 18554 e.preventDefault(); 18555 if ($(this).attr('disabled')) { 18556 return; 18557 } 18558 var $productContainer = $(this).closest('.set-item');
18559 if (!$productContainer.length) { 18560 $productContainer = $(this).closest('.product-detail'); 18561 } 18562 attributeSelect($(this).attr('data-url'), $productContainer); 18563 }); 18564 }, 18565 selectAttribute: function selectAttribute() { 18566 $(document).on('change', 'select[class*="select-"], .options-select', function (e) { 18567 e.preventDefault(); 18568 var $productContainer = $(this).closest('.set-item'); 18569 if (!$productContainer.length) { 18570 $productContainer = $(this).closest('.product-detail'); 18571 } 18572 attributeSelect(e.currentTarget.value, $productContainer); 18573 }); 18574 }, 18575 availability: function availability() { 18576 $(document).on('change', '.quantity-select', function (e) { 18577 e.preventDefault(); 18578 var $productContainer = $(this).closest('.product-detail'); 18579 if (!$productContainer.length) { 18580 $productContainer = $(this).closest('.modal-content').find('.product-quickview'); 18581 } 18582 if ($('.bundle-items', $productContainer).length === 0) { 18583 attributeSelect($(e.currentTarget).find('option:selected').data('url'), $productContainer); 18584 } 18585 }); 18586 }, 18587 addToCart: function addToCart() { 18588 $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', function () { 18589 var addToCartUrl; 18590 var pid; 18591 var pidsObj; 18592 var setPids; 18593 $('body').trigger('product:beforeAddToCart', this); 18594 if ($('.set-items').length && $(this).hasClass('add-to-cart-global')) { 18595 setPids = []; 18596 $('.product-detail').each(function () { 18597 if (!$(this).hasClass('product-set-detail')) { 18598 setPids.push({ 18599 pid: $(this).find('.product-id').text(), 18600 qty: $(this).find('.quantity-select').val(), 18601 options: getOptions($(this)) 18602 }); 18603 } 18604 }); 18605 pidsObj = JSON.stringify(setPids); 18606 } 18607 pid = getPidValue($(this)); 18608 var $productContainer = $(this).closest('.product-detail');
18609 if (!$productContainer.length) { 18610 $productContainer = $(this).closest('.quick-view-dialog').find('.product-detail'); 18611 } 18612 addToCartUrl = getAddToCartUrl(); 18613 var form = { 18614 pid: pid, 18615 pidsObj: pidsObj, 18616 childProducts: getChildProducts(), 18617 quantity: getQuantitySelected($(this)) 18618 }; 18619 if (!$('.bundle-item').length) { 18620 form.options = getOptions($productContainer); 18621 } 18622 $(this).trigger('updateAddToCartFormData', form); 18623 if (addToCartUrl) { 18624 $.ajax({ 18625 url: addToCartUrl, 18626 method: 'POST', 18627 data: form, 18628 success: function success(data) { 18629 handlePostCartAdd(data); 18630 $('body').trigger('product:afterAddToCart', data); 18631 $.spinner().stop(); 18632 miniCartReportingUrl(data.reportingURL); 18633 }, 18634 error: function error() { 18635 $.spinner().stop(); 18636 } 18637 }); 18638 } 18639 }); 18640 }, 18641 selectBonusProduct: function selectBonusProduct() { 18642 $(document).on('click', '.select-bonus-product', function () { 18643 var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product'); 18644 var pid = $(this).data('pid'); 18645 var maxPids = $('.choose-bonus-product-dialog').data('total-qty'); 18646 var submittedQty = parseInt($choiceOfBonusProduct.find('.bonus-quantity-select').val(), 10); 18647 var totalQty = 0; 18648 $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () { 18649 totalQty += $(this).data('qty'); 18650 }); 18651 totalQty += submittedQty; 18652 var optionID = $choiceOfBonusProduct.find('.product-option').data('option-id'); 18653 var valueId = $choiceOfBonusProduct.find('.options-select option:selected').data('valueId'); 18654 if (totalQty <= maxPids) { 18655 var selectedBonusProductHtml = '' + '<div class="selected-pid row" ' + 'data-pid="' + pid + '"' + 'data-qty="' + submittedQty + '"' + 'data-optionID="' + (optionID || '') + '"' + 'data-option-selected-value="' + (valueId || '') + '"' + '>' + '<div class="col-sm-11 col-9 bonus-product-name" >' + $choiceOfBonusProduct.find('.product-name').html() + '</div>' + '<div class="col-1"><i class="fa fa-times" aria-hidden="true"></i></div>' + '</div>'; 18656 $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml); 18657 $('.pre-cart-products').html(totalQty); 18658 $('.selected-bonus-products .bonus-summary').removeClass('alert-danger'); 18659 } else { 18660 $('.selected-bonus-products .bonus-summary').addClass('alert-danger'); 18661 } 18662 }); 18663 }, 18664 removeBonusProduct: function removeBonusProduct() { 18665 $(document).on('click', '.selected-pid', function () { 18666 $(this).remove(); 18667 var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid'); 18668 var count = 0; 18669 if ($selected.length) { 18670 $selected.each(function () { 18671 count += parseInt($(this).data('qty'), 10); 18672 }); 18673 } 18674 $('.pre-cart-products').html(count); 18675 $('.selected-bonus-products .bonus-summary').removeClass('alert-danger'); 18676 }); 18677 }, 18678 enableBonusProductSelection: function enableBonusProductSelection() { 18679 $('body').on('bonusproduct:updateSelectButton', function (e, response) { 18680 $('button.select-bonus-product', response.$productContainer).attr('disabled', !response.product.readyToOrder || !response.product.available); 18681 var pid = response.product.id; 18682 $('button.select-bonus-product', response.$productContainer).data('pid', pid); 18683 }); 18684 }, 18685 showMoreBonusProducts: function showMoreBonusProducts() { 18686 $(document).on('click', '.show-more-bonus-products', function () { 18687 var url = $(this).data('url'); 18688 $('.modal-content').spinner().start(); 18689 $.ajax({ 18690 url: url, 18691 method: 'GET', 18692 success: function success(html) { 18693 var parsedHtml = parseHtml(html); 18694 $('.modal-body').append(parsedHtml.body); 18695 $('.show-more-bonus-products:first').remove(); 18696 $('.modal-content').spinner().stop(); 18697 }, 18698 error: function error() { 18699 $('.modal-content').spinner().stop(); 18700 } 18701 }); 18702 }); 18703 }, 18704 addBonusProductsToCart: function addBonusProductsToCart() { 18705 $(document).on('click', '.add-bonus-products', function () { 18706 var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid'); 18707 var queryString = '?pids='; 18708 var url = $('.choose-bonus-product-dialog').data('addtocarturl'); 18709 var pidsObject = { 18710 bonusProducts: [] 18711 }; 18712 $.each($readyToOrderBonusProducts, function () { 18713 var qtyOption = parseInt($(this).data('qty'), 10); 18714 var option = null; 18715 if (qtyOption > 0) { 18716 if ($(this).data('optionid') && $(this).data('option-selected-value')) { 18717 option = {}; 18718 option.optionId = $(this).data('optionid'); 18719 option.productId = $(this).data('pid'); 18720 option.selectedValueId = $(this).data('option-selected-value'); 18721 } 18722 pidsObject.bonusProducts.push({ 18723 pid: $(this).data('pid'), 18724 qty: qtyOption, 18725 options: [option] 18726 }); 18727 pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10); 18728 } 18729 }); 18730 queryString += JSON.stringify(pidsObject); 18731 queryString = queryString + '&uuid=' + $('.choose-bonus-product-dialog').data('uuid'); 18732 queryString = queryString + '&pliuuid=' + $('.choose-bonus-product-dialog').data('pliuuid'); 18733 $.spinner().start(); 18734 $.ajax({ 18735 url: url + queryString, 18736 method: 'POST', 18737 success: function success(data) { 18738 $.spinner().stop(); 18739 if (data.error) { 18740 $('#chooseBonusProductModal').modal('hide'); 18741 if ($('.add-to-cart-messages').length === 0) { 18742 $('body').append('<div class="add-to-cart-messages"></div>'); 18743 } 18744 $('.add-to-cart-messages').append('<div class="alert alert-danger add-to-basket-alert text-center"' + ' role="alert">
18744' + data.errorMessage + '</div>'); 18745 setTimeout(function () { 18746 $('.add-to-basket-alert').remove(); 18747 }, 3000); 18748 } else { 18749 $('.configure-bonus-product-attributes').html(data); 18750 $('.bonus-products-step2').removeClass('hidden-xl-down'); 18751 $('#chooseBonusProductModal').modal('hide'); 18752 if ($('.add-to-cart-messages').length === 0) { 18753 $('body').append('<div class="add-to-cart-messages"></div>'); 18754 } 18755 $('.minicart-quantity').html(data.totalQty); 18756 $('.add-to-cart-messages').append('<div class="alert alert-success add-to-basket-alert text-center"' + ' role="alert">' + data.msgSuccess + '</div>'); 18757 setTimeout(function () { 18758 $('.add-to-basket-alert').remove(); 18759 if ($('.cart-page').length) { 18760 location.reload(); 18761 } 18762 }, 1500); 18763 } 18764 }, 18765 error: function error() { 18766 $.spinner().stop(); 18767 } 18768 }); 18769 }); 18770 }, 18771 getPidValue: getPidValue, 18772 getQuantitySelected: getQuantitySelected, 18773 miniCartReportingUrl: miniCartReportingUrl 18774}; 18775 18776/***/ }), 18777
18778/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/thirdParty/bootstrap.js": 18779/*!******************************************************************************************************************************!*\ 18780 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/thirdParty/bootstrap.js ***! 18781 \******************************************************************************************************************************/ 18782/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { 18783 18784__webpack_require__(/*! bootstrap/js/src/util.js */ "./node_modules/bootstrap/js/src/util.js"); 18785__webpack_require__(/*! bootstrap/js/src/alert.js */ "./node_modules/bootstrap/js/src/alert.js"); 18786// require('bootstrap/js/src/button.js'); 18787__webpack_require__(/*! bootstrap/js/src/carousel.js */ "./node_modules/bootstrap/js/src/carousel.js"); 18788__webpack_require__(/*! bootstrap/js/src/collapse.js */ "./node_modules/bootstrap/js/src/collapse.js"); 18789// require('bootstrap/js/src/dropdown.js'); 18790__webpack_require__(/*! bootstrap/js/src/modal.js */ "./node_modules/bootstrap/js/src/modal.js"); 18791__webpack_require__(/*! bootstrap/js/src/scrollspy.js */ "./node_modules/bootstrap/js/src/scrollspy.js"); 18792__webpack_require__(/*! bootstrap/js/src/tab.js */ "./node_modules/bootstrap/js/src/tab.js"); 18793// require('bootstrap/js/src/tooltip.js'); 18794// require('bootstrap/js/src/popover.js'); 18795 18796/***/ }), 18797
18798/***/ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js": 18799/*!**************************************************************************************************************!*\ 18800 !*** ./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js ***! 18801 \**************************************************************************************************************/ 18802/***/ ((module) => { 18803 18804"use strict"; 18805 18806 18807function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 18808module.exports = function (include) { 18809 if (typeof include === 'function') { 18810 include(); 18811 } else if (_typeof(include) === 'object') { 18812 Object.keys(include).forEach(function (key) { 18813 if (typeof include[key] === 'function') { 18814 include[key](); 18815 } 18816 }); 18817 } 18818}; 18819 18820/***/ })
vendor: 4,418 bytes, lines 18820-18923
18820 18821 18822/******/ }); 18823/************************************************************************/ 18824/******/ // The module cache 18825/******/ var __webpack_module_cache__ = {}; 18826/******/ 18827/******/ // The require function 18828/******/ function __webpack_require__(moduleId) { 18829/******/ // Check if module is in cache 18830/******/ var cachedModule = __webpack_module_cache__[moduleId]; 18831/******/ if (cachedModule !== undefined) { 18832/******/ return cachedModule.exports; 18833/******/ } 18834/******/ // Create a new module (and put it into the cache) 18835/******/ var module = __webpack_module_cache__[moduleId] = { 18836/******/ id: moduleId, 18837/******/ loaded: false, 18838/******/ exports: {} 18839/******/ }; 18840/******/ 18841/******/ // Execute the module function 18842/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 18843/******/ 18844/******/ // Flag the module as loaded 18845/******/ module.loaded = true; 18846/******/ 18847/******/ // Return the exports of the module 18848/******/ return module.exports; 18849/******/ } 18850/******/ 18851/************************************************************************/ 18852/******/ /* webpack/runtime/compat get default export */ 18853/******/ (() => { 18854/******/ // getDefaultExport function for compatibility with non-harmony modules 18855/******/ __webpack_require__.n = (module) => { 18856/******/ var getter = module && module.__esModule ? 18857/******/ () => (module['default']) : 18858/******/ () => (module); 18859/******/ __webpack_require__.d(getter, { a: getter }); 18860/******/ return getter; 18861/******/ }; 18862/******/ })(); 18863/******/ 18864/******/ /* webpack/runtime/define property getters */ 18865/******/ (() => { 18866/******/ // define getter functions for harmony exports 18867/******/ __webpack_require__.d = (exports, definition) => { 18868/******/ for(var key in definition) { 18869/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 18870/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 18871/******/ } 18872/******/ } 18873/******/ }; 18874/******/ })(); 18875/******/ 18876/******/ /* webpack/runtime/global */ 18877/******/ (() => { 18878/******/ __webpack_require__.g = (function() { 18879/******/ if (typeof globalThis === 'object') return globalThis; 18880/******/ try { 18881/******/ return this || new Function('return this')(); 18882/******/ } catch (e) { 18883/******/ if (typeof window === 'object') return window; 18884/******/ } 18885/******/ })(); 18886/******/ })(); 18887/******/ 18888/******/ /* webpack/runtime/hasOwnProperty shorthand */ 18889/******/ (() => { 18890/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 18891/******/ })(); 18892/******/ 18893/******/ /* webpack/runtime/make namespace object */ 18894/******/ (() => { 18895/******/ // define __esModule on exports 18896/******/ __webpack_require__.r = (exports) => { 18897/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 18898/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 18899/******/ } 18900/******/ Object.defineProperty(exports, '__esModule', { value: true }); 18901/******/ }; 18902/******/ })(); 18903/******/ 18904/******/ /* webpack/runtime/node module decorator */ 18905/******/ (() => { 18906/******/ __webpack_require__.nmd = (module) => { 18907/******/ module.paths = []; 18908/******/ if (!module.children) module.children = []; 18909/******/ return module; 18910/******/ }; 18911/******/ })(); 18912/******/ 18913/************************************************************************/ 18914var __webpack_exports__ = {}; 18915// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. 18916(() => { 18917/*!************************************************************************************************!*\ 18918 !*** ./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/main.js ***! 18919 \************************************************************************************************/ 18920window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 18921window.$ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 18922var processInclude = __webpack_require__(/*! ./util */ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/util.js"); 18923var base = __webpack_require__(/*! base/main */ "./storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/main.js");
18924$(document).ready(function () { 18925 // baseãã夿´ãããå ´åã¯ãããã«è¿½å ããããªããã°baseãèªã¿è¾¼ããã¨ã§å¯¾å¿ 18926 processInclude(__webpack_require__(/*! ./components/clientSideValidation */ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/clientSideValidation.js")); 18927 processInclude(__webpack_require__(/*! ./components/search */ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/components/search.js")); 18928 processInclude(__webpack_require__(/*! ./cookie */ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/cookie.js")); 18929 processInclude(__webpack_require__(/*! ./information_bar */ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/information_bar.js")); 18930 processInclude(__webpack_require__(/*! ./sendgrid */ "./app_prime1studio_ec/cartridges/app_prime1studio_ec/cartridge/client/default/js/sendgrid.js")); 18931}); 18932__webpack_require__(/*! slick-carousel */ "./node_modules/slick-carousel/slick/slick.js"); 18933__webpack_require__(/*! magnific-popup */ "./node_modules/magnific-popup/dist/jquery.magnific-popup.js"); 18934})(); 18935 18936/******/ })() 18937; 18938//# sourceMappingURL=main.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.