1/*! 2 * Bootstrap v4.3.1 (https://getbootstrap.com/) 3 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 */ 6(function (global, factory) { 7 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) : 8 typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) : 9 (global = global || self, factory(global.bootstrap = {}, global.jQuery)); 10}(this, function (exports, $) { 'use strict'; 11 12 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 13 14 function _defineProperties(target, props) { 15 for (var i = 0; i < props.length; i++) { 16 var descriptor = props[i]; 17 descriptor.enumerable = descriptor.enumerable || false; 18 descriptor.configurable = true; 19 if ("value" in descriptor) descriptor.writable = true; 20 Object.defineProperty(target, descriptor.key, descriptor); 21 } 22 } 23 24 function _createClass(Constructor, protoProps, staticProps) { 25 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 26 if (staticProps) _defineProperties(Constructor, staticProps); 27 return Constructor; 28 } 29 30 function _defineProperty(obj, key, value) { 31 if (key in obj) { 32 Object.defineProperty(obj, key, { 33 value: value, 34 enumerable: true, 35 configurable: true, 36 writable: true 37 }); 38 } else { 39 obj[key] = value; 40 } 41 42 return obj; 43 } 44 45 function _objectSpread(target) { 46 for (var i = 1; i < arguments.length; i++) { 47 var source = arguments[i] != null ? arguments[i] : {}; 48 var ownKeys = Object.keys(source); 49 50 if (typeof Object.getOwnPropertySymbols === 'function') { 51 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { 52 return Object.getOwnPropertyDescriptor(source, sym).enumerable; 53 })); 54 } 55 56 ownKeys.forEach(function (key) { 57 _defineProperty(target, key, source[key]); 58 }); 59 } 60 61 return target; 62 } 63 64 function _inheritsLoose(subClass, superClass) { 65 subClass.prototype = Object.create(superClass.prototype); 66 subClass.prototype.constructor = subClass; 67 subClass.__proto__ = superClass; 68 } 69 70 /** 71 * -------------------------------------------------------------------------- 72 * Bootstrap (v4.3.1): util.js 73 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 74 * -------------------------------------------------------------------------- 75 */ 76 /** 77 * ------------------------------------------------------------------------ 78 * Private TransitionEnd Helpers 79 * ------------------------------------------------------------------------ 80 */ 81 82 var TRANSITION_END = 'transitionend'; 83 var MAX_UID = 1000000; 84 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 85 86 function toType(obj) { 87 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 88 } 89 90 function getSpecialTransitionEndEvent() { 91 return { 92 bindType: TRANSITION_END, 93 delegateType: TRANSITION_END, 94 handle: function handle(event) { 95 if ($(event.target).is(this)) { 96 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 97 } 98 99 return undefined; // eslint-disable-line no-undefined 100 } 101 }; 102 } 103 104 function transitionEndEmulator(duration) { 105 var _this = this; 106 107 var called = false; 108 $(this).one(Util.TRANSITION_END, function () { 109 called = true; 110 }); 111 setTimeout(function () { 112 if (!called) { 113 Util.triggerTransitionEnd(_this); 114 } 115 }, duration); 116 return this; 117 } 118 119 function setTransitionEndSupport() { 120 $.fn.emulateTransitionEnd = transitionEndEmulator; 121 $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 122 } 123 /** 124 * -------------------------------------------------------------------------- 125 * Public Util Api 126 * -------------------------------------------------------------------------- 127 */ 128 129 130 var Util = { 131 TRANSITION_END: 'bsTransitionEnd', 132 getUID: function getUID(prefix) { 133 do { 134 // eslint-disable-next-line no-bitwise 135 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 136 } while (document.getElementById(prefix)); 137 138 return prefix; 139 }, 140 getSelectorFromElement: function getSelectorFromElement(element) { 141 var selector = element.getAttribute('data-target'); 142 143 if (!selector || selector === '#') { 144 var hrefAttr = element.getAttribute('href'); 145 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 146 } 147 148 try { 149 return document.querySelector(selector) ? selector : null; 150 } catch (err) { 151 return null; 152 } 153 }, 154 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 155 if (!element) { 156 return 0; 157 } // Get transition-duration of the element 158 159 160 var transitionDuration = $(element).css('transition-duration'); 161 var transitionDelay = $(element).css('transition-delay'); 162 var floatTransitionDuration = parseFloat(transitionDuration); 163 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 164 165 if (!floatTransitionDuration && !floatTransitionDelay) { 166 return 0; 167 } // If multiple durations are defined, take the first 168 169 170 transitionDuration = transitionDuration.split(',')[0]; 171 transitionDelay = transitionDelay.split(',')[0]; 172 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 173 }, 174 reflow: function reflow(element) { 175 return element.offsetHeight; 176 }, 177 triggerTransitionEnd: function triggerTransitionEnd(element) { 178 $(element).trigger(TRANSITION_END); 179 }, 180 // TODO: Remove in v5 181 supportsTransitionEnd: function supportsTransitionEnd() { 182 return Boolean(TRANSITION_END); 183 }, 184 isElement: function isElement(obj) { 185 return (obj[0] || obj).nodeType; 186 }, 187 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 188 for (var property in configTypes) { 189 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 190 var expectedTypes = configTypes[property]; 191 var value = config[property]; 192 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 193 194 if (!new RegExp(expectedTypes).test(valueType)) { 195 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 196 } 197 } 198 } 199 }, 200 findShadowRoot: function findShadowRoot(element) { 201 if (!document.documentElement.attachShadow) { 202 return null; 203 } // Can find the shadow root otherwise it'll return the document 204 205 206 if (typeof element.getRootNode === 'function') { 207 var root = element.getRootNode(); 208 return root instanceof ShadowRoot ? root : null; 209 } 210 211 if (element instanceof ShadowRoot) { 212 return element; 213 } // when we don't find a shadow root 214 215 216 if (!element.parentNode) { 217 return null; 218 } 219 220 return Util.findShadowRoot(element.parentNode); 221 } 222 }; 223 setTransitionEndSupport(); 224 225 /** 226 * ------------------------------------------------------------------------ 227 * Constants 228 * ------------------------------------------------------------------------ 229 */ 230 231 var NAME = 'alert'; 232 var VERSION = '4.3.1'; 233 var DATA_KEY = 'bs.alert'; 234 var EVENT_KEY = "." + DATA_KEY; 235 var DATA_API_KEY = '.data-api'; 236 var JQUERY_NO_CONFLICT = $.fn[NAME]; 237 var Selector = { 238 DISMISS: '[data-dismiss="alert"]' 239 }; 240 var Event = { 241 CLOSE: "close" + EVENT_KEY, 242 CLOSED: "closed" + EVENT_KEY, 243 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 244 }; 245 var ClassName = { 246 ALERT: 'alert', 247 FADE: 'fade', 248 SHOW: 'show' 249 /** 250 * ------------------------------------------------------------------------ 251 * Class Definition 252 * ------------------------------------------------------------------------ 253 */ 254 255 }; 256 257 var Alert = 258 /*#__PURE__*/ 259 function () { 260 function Alert(element) { 261 this._element = element; 262 } // Getters 263 264 265 var _proto = Alert.prototype; 266 267 // Public 268 _proto.close = function close(element) { 269 var rootElement = this._element; 270 271 if (element) { 272 rootElement = this._getRootElement(element); 273 } 274 275 var customEvent = this._triggerCloseEvent(rootElement); 276 277 if (customEvent.isDefaultPrevented()) { 278 return; 279 } 280 281 this._removeElement(rootElement); 282 }; 283 284 _proto.dispose = function dispose() { 285 $.removeData(this._element, DATA_KEY); 286 this._element = null; 287 } // Private 288 ; 289 290 _proto._getRootElement = function _getRootElement(element) { 291 var selector = Util.getSelectorFromElement(element); 292 var parent = false;
293 294 if (selector) { 295 parent = document.querySelector(selector); 296 } 297 298 if (!parent) { 299 parent = $(element).closest("." + ClassName.ALERT)[0]; 300 } 301 302 return parent; 303 }; 304 305 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 306 var closeEvent = $.Event(Event.CLOSE); 307 $(element).trigger(closeEvent); 308 return closeEvent; 309 }; 310 311 _proto._removeElement = function _removeElement(element) { 312 var _this = this; 313 314 $(element).removeClass(ClassName.SHOW); 315 316 if (!$(element).hasClass(ClassName.FADE)) { 317 this._destroyElement(element); 318 319 return; 320 } 321 322 var transitionDuration = Util.getTransitionDurationFromElement(element); 323 $(element).one(Util.TRANSITION_END, function (event) { 324 return _this._destroyElement(element, event); 325 }).emulateTransitionEnd(transitionDuration); 326 }; 327 328 _proto._destroyElement = function _destroyElement(element) { 329 $(element).detach().trigger(Event.CLOSED).remove(); 330 } // Static 331 ; 332 333 Alert._jQueryInterface = function _jQueryInterface(config) { 334 return this.each(function () { 335 var $element = $(this); 336 var data = $element.data(DATA_KEY); 337 338 if (!data) { 339 data = new Alert(this); 340 $element.data(DATA_KEY, data); 341 } 342 343 if (config === 'close') { 344 data[config](this); 345 } 346 }); 347 }; 348 349 Alert._handleDismiss = function _handleDismiss(alertInstance) { 350 return function (event) { 351 if (event) { 352 event.preventDefault(); 353 } 354 355 alertInstance.close(this); 356 }; 357 }; 358 359 _createClass(Alert, null, [{ 360 key: "VERSION", 361 get: function get() { 362 return VERSION; 363 } 364 }]); 365 366 return Alert; 367 }(); 368 /** 369 * ------------------------------------------------------------------------ 370 * Data Api implementation 371 * ------------------------------------------------------------------------ 372 */ 373 374 375 $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); 376 /** 377 * ------------------------------------------------------------------------ 378 * jQuery 379 * ------------------------------------------------------------------------ 380 */ 381 382 $.fn[NAME] = Alert._jQueryInterface; 383 $.fn[NAME].Constructor = Alert; 384 385 $.fn[NAME].noConflict = function () { 386 $.fn[NAME] = JQUERY_NO_CONFLICT; 387 return Alert._jQueryInterface; 388 }; 389 390 /** 391 * ------------------------------------------------------------------------ 392 * Constants 393 * ------------------------------------------------------------------------ 394 */ 395 396 var NAME$1 = 'button'; 397 var VERSION$1 = '4.3.1'; 398 var DATA_KEY$1 = 'bs.button'; 399 var EVENT_KEY$1 = "." + DATA_KEY$1; 400 var DATA_API_KEY$1 = '.data-api'; 401 var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1]; 402 var ClassName$1 = { 403 ACTIVE: 'active', 404 BUTTON: 'btn', 405 FOCUS: 'focus' 406 }; 407 var Selector$1 = { 408 DATA_TOGGLE_CARROT: '[data-toggle^="button"]', 409 DATA_TOGGLE: '[data-toggle="buttons"]', 410 INPUT: 'input:not([type="hidden"])', 411 ACTIVE: '.active', 412 BUTTON: '.btn' 413 }; 414 var Event$1 = { 415 CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1, 416 FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1) 417 /** 418 * ------------------------------------------------------------------------ 419 * Class Definition 420 * ------------------------------------------------------------------------ 421 */ 422 423 }; 424 425 var Button = 426 /*#__PURE__*/ 427 function () { 428 function Button(element) { 429 this._element = element; 430 } // Getters 431 432 433 var _proto = Button.prototype; 434 435 // Public
436 _proto.toggle = function toggle() { 437 var triggerChangeEvent = true; 438 var addAriaPressed = true; 439 var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0]; 440 441 if (rootElement) { 442 var input = this._element.querySelector(Selector$1.INPUT); 443 444 if (input) { 445 if (input.type === 'radio') { 446 if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) { 447 triggerChangeEvent = false; 448 } else { 449 var activeElement = rootElement.querySelector(Selector$1.ACTIVE); 450 451 if (activeElement) { 452 $(activeElement).removeClass(ClassName$1.ACTIVE); 453 } 454 } 455 } 456 457 if (triggerChangeEvent) { 458 if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { 459 return; 460 } 461 462 input.checked = !this._element.classList.contains(ClassName$1.ACTIVE); 463 $(input).trigger('change'); 464 } 465 466 input.focus(); 467 addAriaPressed = false; 468 } 469 } 470 471 if (addAriaPressed) { 472 this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE)); 473 } 474 475 if (triggerChangeEvent) { 476 $(this._element).toggleClass(ClassName$1.ACTIVE); 477 } 478 }; 479 480 _proto.dispose = function dispose() { 481 $.removeData(this._element, DATA_KEY$1); 482 this._element = null; 483 } // Static 484 ; 485 486 Button._jQueryInterface = function _jQueryInterface(config) { 487 return this.each(function () { 488 var data = $(this).data(DATA_KEY$1); 489 490 if (!data) { 491 data = new Button(this); 492 $(this).data(DATA_KEY$1, data); 493 } 494 495 if (config === 'toggle') { 496 data[config](); 497 } 498 }); 499 }; 500 501 _createClass(Button, null, [{ 502 key: "VERSION", 503 get: function get() { 504 return VERSION$1; 505 } 506 }]); 507 508 return Button; 509 }(); 510 /** 511 * ------------------------------------------------------------------------ 512 * Data Api implementation 513 * ------------------------------------------------------------------------ 514 */ 515 516 517 $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 518 event.preventDefault(); 519 var button = event.target; 520 521 if (!$(button).hasClass(ClassName$1.BUTTON)) { 522 button = $(button).closest(Selector$1.BUTTON); 523 } 524 525 Button._jQueryInterface.call($(button), 'toggle'); 526 }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 527 var button = $(event.target).closest(Selector$1.BUTTON)[0]; 528 $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type)); 529 }); 530 /** 531 * ------------------------------------------------------------------------ 532 * jQuery 533 * ------------------------------------------------------------------------ 534 */ 535 536 $.fn[NAME$1] = Button._jQueryInterface; 537 $.fn[NAME$1].Constructor = Button; 538 539 $.fn[NAME$1].noConflict = function () { 540 $.fn[NAME$1] = JQUERY_NO_CONFLICT$1; 541 return Button._jQueryInterface; 542 }; 543 544 /** 545 * ------------------------------------------------------------------------ 546 * Constants 547 * ------------------------------------------------------------------------ 548 */ 549 550 var NAME$2 = 'carousel'; 551 var VERSION$2 = '4.3.1'; 552 var DATA_KEY$2 = 'bs.carousel'; 553 var EVENT_KEY$2 = "." + DATA_KEY$2; 554 var DATA_API_KEY$2 = '.data-api'; 555 var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2]; 556 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 557 558 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 559 560 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 561 562 var SWIPE_THRESHOLD = 40; 563 var Default = { 564 interval: 5000, 565 keyboard: true, 566 slide: false, 567 pause: 'hover', 568 wrap: true, 569 touch: true 570 }; 571 var DefaultType = { 572 interval: '(number|boolean)', 573 keyboard: 'boolean', 574 slide: '(boolean|string)', 575 pause: '(string|boolean)', 576 wrap: 'boolean', 577 touch: 'boolean' 578 }; 579 var Direction = { 580 NEXT: 'next', 581 PREV: 'prev', 582 LEFT: 'left', 583 RIGHT: 'right' 584 }; 585 var Event$2 = { 586 SLIDE: "slide" + EVENT_KEY$2, 587 SLID: "slid" + EVENT_KEY$2, 588 KEYDOWN: "keydown" + EVENT_KEY$2, 589 MOUSEENTER: "mouseenter" + EVENT_KEY$2, 590 MOUSELEAVE: "mouseleave" + EVENT_KEY$2, 591 TOUCHSTART: "touchstart" + EVENT_KEY$2, 592 TOUCHMOVE: "touchmove" + EVENT_KEY$2, 593 TOUCHEND: "touchend" + EVENT_KEY$2, 594 POINTERDOWN: "pointerdown" + EVENT_KEY$2, 595 POINTERUP: "pointerup" + EVENT_KEY$2, 596 DRAG_START: "dragstart" + EVENT_KEY$2, 597 LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2, 598 CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2 599 }; 600 var ClassName$2 = { 601 CAROUSEL: 'carousel', 602 ACTIVE: 'active', 603 SLIDE: 'slide', 604 RIGHT: 'carousel-item-right', 605 LEFT: 'carousel-item-left', 606 NEXT: 'carousel-item-next', 607 PREV: 'carousel-item-prev', 608 ITEM: 'carousel-item', 609 POINTER_EVENT: 'pointer-event' 610 }; 611 var Selector$2 = { 612 ACTIVE: '.active', 613 ACTIVE_ITEM: '.active.carousel-item', 614 ITEM: '.carousel-item', 615 ITEM_IMG: '.carousel-item img', 616 NEXT_PREV: '.carousel-item-next, .carousel-item-prev', 617 INDICATORS: '.carousel-indicators',
618 DATA_SLIDE: '[data-slide], [data-slide-to]', 619 DATA_RIDE: '[data-ride="carousel"]' 620 }; 621 var PointerType = { 622 TOUCH: 'touch', 623 PEN: 'pen' 624 /** 625 * ------------------------------------------------------------------------ 626 * Class Definition 627 * ------------------------------------------------------------------------ 628 */ 629 630 }; 631 632 var Carousel = 633 /*#__PURE__*/ 634 function () { 635 function Carousel(element, config) { 636 this._items = null; 637 this._interval = null; 638 this._activeElement = null; 639 this._isPaused = false; 640 this._isSliding = false; 641 this.touchTimeout = null; 642 this.touchStartX = 0; 643 this.touchDeltaX = 0; 644 this._config = this._getConfig(config); 645 this._element = element; 646 this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS); 647 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 648 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 649 650 this._addEventListeners(); 651 } // Getters 652 653 654 var _proto = Carousel.prototype; 655 656 // Public 657 _proto.next = function next() { 658 if (!this._isSliding) { 659 this._slide(Direction.NEXT); 660 } 661 }; 662 663 _proto.nextWhenVisible = function nextWhenVisible() { 664 // Don't call next when the page isn't visible 665 // or the carousel or its parent isn't visible 666 if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { 667 this.next(); 668 } 669 }; 670 671 _proto.prev = function prev() { 672 if (!this._isSliding) { 673 this._slide(Direction.PREV); 674 } 675 }; 676 677 _proto.pause = function pause(event) { 678 if (!event) { 679 this._isPaused = true; 680 } 681 682 if (this._element.querySelector(Selector$2.NEXT_PREV)) { 683 Util.triggerTransitionEnd(this._element); 684 this.cycle(true); 685 } 686 687 clearInterval(this._interval); 688 this._interval = null; 689 }; 690 691 _proto.cycle = function cycle(event) { 692 if (!event) { 693 this._isPaused = false; 694 } 695 696 if (this._interval) { 697 clearInterval(this._interval); 698 this._interval = null; 699 } 700 701 if (this._config.interval && !this._isPaused) { 702 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 703 } 704 }; 705 706 _proto.to = function to(index) { 707 var _this = this; 708 709 this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); 710 711 var activeIndex = this._getItemIndex(this._activeElement); 712 713 if (index > this._items.length - 1 || index < 0) { 714 return; 715 } 716 717 if (this._isSliding) { 718 $(this._element).one(Event$2.SLID, function () { 719 return _this.to(index); 720 }); 721 return; 722 } 723 724 if (activeIndex === index) { 725 this.pause(); 726 this.cycle(); 727 return; 728 } 729 730 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; 731 732 this._slide(direction, this._items[index]); 733 }; 734 735 _proto.dispose = function dispose() { 736 $(this._element).off(EVENT_KEY$2); 737 $.removeData(this._element, DATA_KEY$2); 738 this._items = null; 739 this._config = null; 740 this._element = null; 741 this._interval = null; 742 this._isPaused = null; 743 this._isSliding = null; 744 this._activeElement = null; 745 this._indicatorsElement = null; 746 } // Private 747 ; 748 749 _proto._getConfig = function _getConfig(config) { 750 config = _objectSpread({}, Default, config); 751 Util.typeCheckConfig(NAME$2, config, DefaultType); 752 return config; 753 }; 754 755 _proto._handleSwipe = function _handleSwipe() { 756 var absDeltax = Math.abs(this.touchDeltaX); 757 758 if (absDeltax <= SWIPE_THRESHOLD) { 759 return; 760 } 761 762 var direction = absDeltax / this.touchDeltaX; // swipe left 763 764 if (direction > 0) { 765 this.prev(); 766 } // swipe right 767 768 769 if (direction < 0) { 770 this.next(); 771 } 772 }; 773 774 _proto._addEventListeners = function _addEventListeners() { 775 var _this2 = this; 776 777 if (this._config.keyboard) { 778 $(this._element).on(Event$2.KEYDOWN, function (event) { 779 return _this2._keydown(event); 780 }); 781 } 782 783 if (this._config.pause === 'hover') { 784 $(this._element).on(Event$2.MOUSEENTER, function (event) { 785 return _this2.pause(event); 786 }).on(Event$2.MOUSELEAVE, function (event) { 787 return _this2.cycle(event); 788 }); 789 } 790 791 if (this._config.touch) { 792 this._addTouchEventListeners(); 793 } 794 }; 795 796 _proto._addTouchEventListeners = function _addTouchEventListeners() { 797 var _this3 = this; 798 799 if (!this._touchSupported) { 800 return; 801 } 802 803 var start = function start(event) { 804 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 805 _this3.touchStartX = event.originalEvent.clientX; 806 } else if (!_this3._pointerEvent) { 807 _this3.touchStartX = event.originalEvent.touches[0].clientX; 808 } 809 }; 810 811 var move = function move(event) { 812 // ensure swiping with one touch and not pinching 813 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 814 _this3.touchDeltaX = 0; 815 } else { 816 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 817 } 818 }; 819 820 var end = function end(event) { 821 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 822 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 823 } 824 825 _this3._handleSwipe(); 826 827 if (_this3._config.pause === 'hover') {
828 // If it's a touch-enabled device, mouseenter/leave are fired as 829 // part of the mouse compatibility events on first tap - the carousel 830 // would stop cycling until user tapped out of it; 831 // here, we listen for touchend, explicitly pause the carousel 832 // (as if it's the second time we tap on it, mouseenter compat event 833 // is NOT fired) and after a timeout (to allow for mouse compatibility 834 // events to fire) we explicitly restart cycling 835 _this3.pause(); 836 837 if (_this3.touchTimeout) { 838 clearTimeout(_this3.touchTimeout); 839 } 840 841 _this3.touchTimeout = setTimeout(function (event) { 842 return _this3.cycle(event); 843 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 844 } 845 }; 846 847 $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) { 848 return e.preventDefault(); 849 }); 850 851 if (this._pointerEvent) { 852 $(this._element).on(Event$2.POINTERDOWN, function (event) { 853 return start(event); 854 }); 855 $(this._element).on(Event$2.POINTERUP, function (event) { 856 return end(event); 857 }); 858 859 this._element.classList.add(ClassName$2.POINTER_EVENT); 860 } else { 861 $(this._element).on(Event$2.TOUCHSTART, function (event) { 862 return start(event); 863 }); 864 $(this._element).on(Event$2.TOUCHMOVE, function (event) { 865 return move(event); 866 }); 867 $(this._element).on(Event$2.TOUCHEND, function (event) { 868 return end(event); 869 }); 870 } 871 }; 872 873 _proto._keydown = function _keydown(event) { 874 if (/input|textarea/i.test(event.target.tagName)) { 875 return; 876 } 877 878 switch (event.which) { 879 case ARROW_LEFT_KEYCODE: 880 event.preventDefault(); 881 this.prev(); 882 break; 883 884 case ARROW_RIGHT_KEYCODE: 885 event.preventDefault(); 886 this.next(); 887 break; 888 889 default: 890 } 891 }; 892 893 _proto._getItemIndex = function _getItemIndex(element) { 894 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : []; 895 return this._items.indexOf(element); 896 }; 897 898 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 899 var isNextDirection = direction === Direction.NEXT; 900 var isPrevDirection = direction === Direction.PREV; 901 902 var activeIndex = this._getItemIndex(activeElement); 903 904 var lastItemIndex = this._items.length - 1; 905 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 906 907 if (isGoingToWrap && !this._config.wrap) { 908 return activeElement; 909 } 910 911 var delta = direction === Direction.PREV ? -1 : 1; 912 var itemIndex = (activeIndex + delta) % this._items.length; 913 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 914 }; 915 916 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 917 var targetIndex = this._getItemIndex(relatedTarget); 918 919 var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM)); 920 921 var slideEvent = $.Event(Event$2.SLIDE, { 922 relatedTarget: relatedTarget, 923 direction: eventDirectionName, 924 from: fromIndex, 925 to: targetIndex 926 }); 927 $(this._element).trigger(slideEvent); 928 return slideEvent; 929 }; 930 931 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 932 if (this._indicatorsElement) { 933 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE)); 934 $(indicators).removeClass(ClassName$2.ACTIVE); 935 936 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 937 938 if (nextIndicator) { 939 $(nextIndicator).addClass(ClassName$2.ACTIVE); 940 } 941 } 942 }; 943 944 _proto._slide = function _slide(direction, element) { 945 var _this4 = this; 946 947 var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); 948 949 var activeElementIndex = this._getItemIndex(activeElement); 950 951 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 952 953 var nextElementIndex = this._getItemIndex(nextElement); 954 955 var isCycling = Boolean(this._interval); 956 var directionalClassName; 957 var orderClassName; 958 var eventDirectionName; 959 960 if (direction === Direction.NEXT) { 961 directionalClassName = ClassName$2.LEFT; 962 orderClassName = ClassName$2.NEXT; 963 eventDirectionName = Direction.LEFT; 964 } else { 965 directionalClassName = ClassName$2.RIGHT; 966 orderClassName = ClassName$2.PREV; 967 eventDirectionName = Direction.RIGHT; 968 } 969 970 if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) { 971 this._isSliding = false;
972 return; 973 } 974 975 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 976 977 if (slideEvent.isDefaultPrevented()) { 978 return; 979 } 980 981 if (!activeElement || !nextElement) { 982 // Some weirdness is happening, so we bail 983 return; 984 } 985 986 this._isSliding = true; 987 988 if (isCycling) { 989 this.pause(); 990 } 991 992 this._setActiveIndicatorElement(nextElement); 993 994 var slidEvent = $.Event(Event$2.SLID, { 995 relatedTarget: nextElement, 996 direction: eventDirectionName, 997 from: activeElementIndex, 998 to: nextElementIndex 999 }); 1000 1001 if ($(this._element).hasClass(ClassName$2.SLIDE)) { 1002 $(nextElement).addClass(orderClassName); 1003 Util.reflow(nextElement); 1004 $(activeElement).addClass(directionalClassName); 1005 $(nextElement).addClass(directionalClassName); 1006 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 1007 1008 if (nextElementInterval) { 1009 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 1010 this._config.interval = nextElementInterval; 1011 } else { 1012 this._config.interval = this._config.defaultInterval || this._config.interval; 1013 } 1014 1015 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 1016 $(activeElement).one(Util.TRANSITION_END, function () { 1017 $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE); 1018 $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName); 1019 _this4._isSliding = false; 1020 setTimeout(function () { 1021 return $(_this4._element).trigger(slidEvent); 1022 }, 0); 1023 }).emulateTransitionEnd(transitionDuration); 1024 } else { 1025 $(activeElement).removeClass(ClassName$2.ACTIVE); 1026 $(nextElement).addClass(ClassName$2.ACTIVE); 1027 this._isSliding = false; 1028 $(this._element).trigger(slidEvent); 1029 } 1030 1031 if (isCycling) { 1032 this.cycle(); 1033 } 1034 } // Static 1035 ; 1036 1037 Carousel._jQueryInterface = function _jQueryInterface(config) { 1038 return this.each(function () { 1039 var data = $(this).data(DATA_KEY$2); 1040 1041 var _config = _objectSpread({}, Default, $(this).data()); 1042 1043 if (typeof config === 'object') { 1044 _config = _objectSpread({}, _config, config); 1045 } 1046 1047 var action = typeof config === 'string' ? config : _config.slide; 1048 1049 if (!data) { 1050 data = new Carousel(this, _config); 1051 $(this).data(DATA_KEY$2, data); 1052 } 1053 1054 if (typeof config === 'number') { 1055 data.to(config); 1056 } else if (typeof action === 'string') { 1057 if (typeof data[action] === 'undefined') { 1058 throw new TypeError("No method named \"" + action + "\""); 1059 } 1060 1061 data[action](); 1062 } else if (_config.interval && _config.ride) { 1063 data.pause(); 1064 data.cycle(); 1065 } 1066 }); 1067 }; 1068 1069 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 1070 var selector = Util.getSelectorFromElement(this); 1071 1072 if (!selector) { 1073 return; 1074 } 1075 1076 var target = $(selector)[0]; 1077 1078 if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) { 1079 return; 1080 } 1081 1082 var config = _objectSpread({}, $(target).data(), $(this).data()); 1083
1084 var slideIndex = this.getAttribute('data-slide-to'); 1085 1086 if (slideIndex) { 1087 config.interval = false; 1088 } 1089 1090 Carousel._jQueryInterface.call($(target), config); 1091 1092 if (slideIndex) { 1093 $(target).data(DATA_KEY$2).to(slideIndex); 1094 } 1095 1096 event.preventDefault(); 1097 }; 1098 1099 _createClass(Carousel, null, [{ 1100 key: "VERSION", 1101 get: function get() { 1102 return VERSION$2; 1103 } 1104 }, { 1105 key: "Default", 1106 get: function get() { 1107 return Default; 1108 } 1109 }]); 1110 1111 return Carousel; 1112 }(); 1113 /** 1114 * ------------------------------------------------------------------------ 1115 * Data Api implementation 1116 * ------------------------------------------------------------------------ 1117 */ 1118 1119 1120 $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler); 1121 $(window).on(Event$2.LOAD_DATA_API, function () { 1122 var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE)); 1123 1124 for (var i = 0, len = carousels.length; i < len; i++) { 1125 var $carousel = $(carousels[i]); 1126 1127 Carousel._jQueryInterface.call($carousel, $carousel.data()); 1128 } 1129 }); 1130 /** 1131 * ------------------------------------------------------------------------ 1132 * jQuery 1133 * ------------------------------------------------------------------------ 1134 */ 1135 1136 $.fn[NAME$2] = Carousel._jQueryInterface; 1137 $.fn[NAME$2].Constructor = Carousel; 1138 1139 $.fn[NAME$2].noConflict = function () { 1140 $.fn[NAME$2] = JQUERY_NO_CONFLICT$2; 1141 return Carousel._jQueryInterface; 1142 }; 1143 1144 /** 1145 * ------------------------------------------------------------------------ 1146 * Constants 1147 * ------------------------------------------------------------------------ 1148 */ 1149 1150 var NAME$3 = 'collapse'; 1151 var VERSION$3 = '4.3.1'; 1152 var DATA_KEY$3 = 'bs.collapse'; 1153 var EVENT_KEY$3 = "." + DATA_KEY$3; 1154 var DATA_API_KEY$3 = '.data-api'; 1155 var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3]; 1156 var Default$1 = { 1157 toggle: true, 1158 parent: '' 1159 }; 1160 var DefaultType$1 = { 1161 toggle: 'boolean', 1162 parent: '(string|element)' 1163 }; 1164 var Event$3 = { 1165 SHOW: "show" + EVENT_KEY$3, 1166 SHOWN: "shown" + EVENT_KEY$3, 1167 HIDE: "hide" + EVENT_KEY$3, 1168 HIDDEN: "hidden" + EVENT_KEY$3, 1169 CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3 1170 }; 1171 var ClassName$3 = { 1172 SHOW: 'show', 1173 COLLAPSE: 'collapse', 1174 COLLAPSING: 'collapsing', 1175 COLLAPSED: 'collapsed' 1176 }; 1177 var Dimension = { 1178 WIDTH: 'width', 1179 HEIGHT: 'height' 1180 }; 1181 var Selector$3 = { 1182 ACTIVES: '.show, .collapsing', 1183 DATA_TOGGLE: '[data-toggle="collapse"]' 1184 /** 1185 * ------------------------------------------------------------------------ 1186 * Class Definition 1187 * ------------------------------------------------------------------------ 1188 */ 1189 1190 }; 1191 1192 var Collapse = 1193 /*#__PURE__*/ 1194 function () { 1195 function Collapse(element, config) { 1196 this._isTransitioning = false; 1197 this._element = element; 1198 this._config = this._getConfig(config); 1199 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 1200 var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE)); 1201 1202 for (var i = 0, len = toggleList.length; i < len; i++) { 1203 var elem = toggleList[i]; 1204 var selector = Util.getSelectorFromElement(elem); 1205 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 1206 return foundElem === element; 1207 }); 1208 1209 if (selector !== null && filterElement.length > 0) { 1210 this._selector = selector; 1211 1212 this._triggerArray.push(elem); 1213 } 1214 } 1215 1216 this._parent = this._config.parent ? this._getParent() : null; 1217 1218 if (!this._config.parent) { 1219 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 1220 } 1221 1222 if (this._config.toggle) { 1223 this.toggle(); 1224 } 1225 } // Getters 1226 1227 1228 var _proto = Collapse.prototype; 1229 1230 // Public
1231 _proto.toggle = function toggle() { 1232 if ($(this._element).hasClass(ClassName$3.SHOW)) { 1233 this.hide(); 1234 } else { 1235 this.show(); 1236 } 1237 }; 1238 1239 _proto.show = function show() { 1240 var _this = this; 1241 1242 if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) { 1243 return; 1244 } 1245 1246 var actives; 1247 var activesData; 1248 1249 if (this._parent) { 1250 actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) { 1251 if (typeof _this._config.parent === 'string') { 1252 return elem.getAttribute('data-parent') === _this._config.parent; 1253 } 1254 1255 return elem.classList.contains(ClassName$3.COLLAPSE); 1256 }); 1257 1258 if (actives.length === 0) { 1259 actives = null; 1260 } 1261 } 1262 1263 if (actives) { 1264 activesData = $(actives).not(this._selector).data(DATA_KEY$3); 1265 1266 if (activesData && activesData._isTransitioning) { 1267 return; 1268 } 1269 } 1270 1271 var startEvent = $.Event(Event$3.SHOW); 1272 $(this._element).trigger(startEvent); 1273 1274 if (startEvent.isDefaultPrevented()) { 1275 return; 1276 } 1277 1278 if (actives) { 1279 Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide'); 1280 1281 if (!activesData) { 1282 $(actives).data(DATA_KEY$3, null); 1283 } 1284 } 1285 1286 var dimension = this._getDimension(); 1287 1288 $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING); 1289 this._element.style[dimension] = 0; 1290 1291 if (this._triggerArray.length) { 1292 $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true); 1293 } 1294 1295 this.setTransitioning(true); 1296 1297 var complete = function complete() { 1298 $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW); 1299 _this._element.style[dimension] = ''; 1300 1301 _this.setTransitioning(false); 1302 1303 $(_this._element).trigger(Event$3.SHOWN); 1304 }; 1305 1306 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 1307 var scrollSize = "scroll" + capitalizedDimension; 1308 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1309 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1310 this._element.style[dimension] = this._element[scrollSize] + "px"; 1311 }; 1312 1313 _proto.hide = function hide() { 1314 var _this2 = this; 1315 1316 if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) { 1317 return; 1318 } 1319 1320 var startEvent = $.Event(Event$3.HIDE); 1321 $(this._element).trigger(startEvent); 1322 1323 if (startEvent.isDefaultPrevented()) { 1324 return; 1325 } 1326 1327 var dimension = this._getDimension(); 1328 1329 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 1330 Util.reflow(this._element); 1331 $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW); 1332 var triggerArrayLength = this._triggerArray.length; 1333 1334 if (triggerArrayLength > 0) { 1335 for (var i = 0; i < triggerArrayLength; i++) { 1336 var trigger = this._triggerArray[i]; 1337 var selector = Util.getSelectorFromElement(trigger); 1338 1339 if (selector !== null) { 1340 var $elem = $([].slice.call(document.querySelectorAll(selector))); 1341 1342 if (!$elem.hasClass(ClassName$3.SHOW)) { 1343 $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false); 1344 } 1345 } 1346 } 1347 } 1348 1349 this.setTransitioning(true); 1350 1351 var complete = function complete() { 1352 _this2.setTransitioning(false); 1353 1354 $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN); 1355 }; 1356 1357 this._element.style[dimension] = ''; 1358 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1359 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1360 }; 1361 1362 _proto.setTransitioning = function setTransitioning(isTransitioning) { 1363 this._isTransitioning = isTransitioning; 1364 }; 1365 1366 _proto.dispose = function dispose() { 1367 $.removeData(this._element, DATA_KEY$3); 1368 this._config = null; 1369 this._parent = null; 1370 this._element = null; 1371 this._triggerArray = null; 1372 this._isTransitioning = null; 1373 } // Private 1374 ; 1375 1376 _proto._getConfig = function _getConfig(config) { 1377 config = _objectSpread({}, Default$1, config); 1378 config.toggle = Boolean(config.toggle); // Coerce string values 1379 1380 Util.typeCheckConfig(NAME$3, config, DefaultType$1); 1381 return config; 1382 }; 1383 1384 _proto._getDimension = function _getDimension() { 1385 var hasWidth = $(this._element).hasClass(Dimension.WIDTH); 1386 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; 1387 }; 1388 1389 _proto._getParent = function _getParent() { 1390 var _this3 = this; 1391 1392 var parent; 1393 1394 if (Util.isElement(this._config.parent)) { 1395 parent = this._config.parent; // It's a jQuery object 1396 1397 if (typeof this._config.parent.jquery !== 'undefined') { 1398 parent = this._config.parent[0]; 1399 } 1400 } else { 1401 parent = document.querySelector(this._config.parent); 1402 } 1403 1404 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 1405 var children = [].slice.call(parent.querySelectorAll(selector)); 1406 $(children).each(function (i, element) { 1407 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 1408 }); 1409 return parent; 1410 }; 1411 1412 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 1413 var isOpen = $(element).hasClass(ClassName$3.SHOW); 1414 1415 if (triggerArray.length) { 1416 $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 1417 } 1418 } // Static 1419 ; 1420 1421 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 1422 var selector = Util.getSelectorFromElement(element); 1423 return selector ? document.querySelector(selector) : null; 1424 }; 1425 1426 Collapse._jQueryInterface = function _jQueryInterface(config) { 1427 return this.each(function () { 1428 var $this = $(this); 1429 var data = $this.data(DATA_KEY$3); 1430 1431 var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {}); 1432 1433 if (!data && _config.toggle && /show|hide/.test(config)) { 1434 _config.toggle = false;
1435 } 1436 1437 if (!data) { 1438 data = new Collapse(this, _config); 1439 $this.data(DATA_KEY$3, data); 1440 } 1441 1442 if (typeof config === 'string') { 1443 if (typeof data[config] === 'undefined') { 1444 throw new TypeError("No method named \"" + config + "\""); 1445 } 1446 1447 data[config](); 1448 } 1449 }); 1450 }; 1451 1452 _createClass(Collapse, null, [{ 1453 key: "VERSION", 1454 get: function get() { 1455 return VERSION$3; 1456 } 1457 }, { 1458 key: "Default", 1459 get: function get() { 1460 return Default$1; 1461 } 1462 }]); 1463 1464 return Collapse; 1465 }(); 1466 /** 1467 * ------------------------------------------------------------------------ 1468 * Data Api implementation 1469 * ------------------------------------------------------------------------ 1470 */ 1471 1472 1473 $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) { 1474 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 1475 if (event.currentTarget.tagName === 'A') { 1476 event.preventDefault(); 1477 } 1478 1479 var $trigger = $(this); 1480 var selector = Util.getSelectorFromElement(this); 1481 var selectors = [].slice.call(document.querySelectorAll(selector)); 1482 $(selectors).each(function () { 1483 var $target = $(this); 1484 var data = $target.data(DATA_KEY$3); 1485 var config = data ? 'toggle' : $trigger.data(); 1486 1487 Collapse._jQueryInterface.call($target, config); 1488 }); 1489 }); 1490 /** 1491 * ------------------------------------------------------------------------ 1492 * jQuery 1493 * ------------------------------------------------------------------------ 1494 */ 1495 1496 $.fn[NAME$3] = Collapse._jQueryInterface; 1497 $.fn[NAME$3].Constructor = Collapse; 1498 1499 $.fn[NAME$3].noConflict = function () { 1500 $.fn[NAME$3] = JQUERY_NO_CONFLICT$3; 1501 return Collapse._jQueryInterface; 1502 }; 1503 1504 /**! 1505 * @fileOverview Kickass library to create and place poppers near their reference elements. 1506 * @version 1.14.7 1507 * @license 1508 * Copyright (c) 2016 Federico Zivolo and contributors 1509 * 1510 * Permission is hereby granted, free of charge, to any person obtaining a copy 1511 * of this software and associated documentation files (the "Software"), to deal 1512 * in the Software without restriction, including without limitation the rights 1513 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1514 * copies of the Software, and to permit persons to whom the Software is 1515 * furnished to do so, subject to the following conditions: 1516 * 1517 * The above copyright notice and this permission notice shall be included in all 1518 * copies or substantial portions of the Software. 1519 * 1520 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1521 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1522 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1523 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1524 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1525 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 1526 * SOFTWARE. 1527 */ 1528 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; 1529 1530 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 1531 var timeoutDuration = 0; 1532 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 1533 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 1534 timeoutDuration = 1; 1535 break; 1536 } 1537 } 1538 1539 function microtaskDebounce(fn) { 1540 var called = false; 1541 return function () { 1542 if (called) { 1543 return; 1544 } 1545 called = true; 1546 window.Promise.resolve().then(function () { 1547 called = false;
vendor: 4,392 bytes, lines 1548-1697
1548 fn(); 1549 }); 1550 }; 1551 } 1552 1553 function taskDebounce(fn) { 1554 var scheduled = false; 1555 return function () { 1556 if (!scheduled) { 1557 scheduled = true; 1558 setTimeout(function () { 1559 scheduled = false; 1560 fn(); 1561 }, timeoutDuration); 1562 } 1563 }; 1564 } 1565 1566 var supportsMicroTasks = isBrowser && window.Promise; 1567 1568 /** 1569 * Create a debounced version of a method, that's asynchronously deferred 1570 * but called in the minimum time possible. 1571 * 1572 * @method 1573 * @memberof Popper.Utils 1574 * @argument {Function} fn 1575 * @returns {Function} 1576 */ 1577 var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 1578 1579 /** 1580 * Check if the given variable is a function 1581 * @method 1582 * @memberof Popper.Utils 1583 * @argument {Any} functionToCheck - variable to check 1584 * @returns {Boolean} answer to: is a function? 1585 */ 1586 function isFunction(functionToCheck) { 1587 var getType = {}; 1588 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 1589 } 1590 1591 /** 1592 * Get CSS computed property of the given element 1593 * @method 1594 * @memberof Popper.Utils 1595 * @argument {Eement} element 1596 * @argument {String} property 1597 */ 1598 function getStyleComputedProperty(element, property) { 1599 if (element.nodeType !== 1) { 1600 return []; 1601 } 1602 // NOTE: 1 DOM access here 1603 var window = element.ownerDocument.defaultView; 1604 var css = window.getComputedStyle(element, null); 1605 return property ? css[property] : css; 1606 } 1607 1608 /** 1609 * Returns the parentNode or the host of the element 1610 * @method 1611 * @memberof Popper.Utils 1612 * @argument {Element} element 1613 * @returns {Element} parent 1614 */ 1615 function getParentNode(element) { 1616 if (element.nodeName === 'HTML') { 1617 return element; 1618 } 1619 return element.parentNode || element.host; 1620 } 1621 1622 /** 1623 * Returns the scrolling parent of the given element 1624 * @method 1625 * @memberof Popper.Utils 1626 * @argument {Element} element 1627 * @returns {Element} scroll parent 1628 */ 1629 function getScrollParent(element) { 1630 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 1631 if (!element) { 1632 return document.body; 1633 } 1634 1635 switch (element.nodeName) { 1636 case 'HTML': 1637 case 'BODY': 1638 return element.ownerDocument.body; 1639 case '#document': 1640 return element.body; 1641 } 1642 1643 // Firefox want us to check `-x` and `-y` variations as well 1644 1645 var _getStyleComputedProp = getStyleComputedProperty(element), 1646 overflow = _getStyleComputedProp.overflow, 1647 overflowX = _getStyleComputedProp.overflowX, 1648 overflowY = _getStyleComputedProp.overflowY; 1649 1650 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 1651 return element; 1652 } 1653 1654 return getScrollParent(getParentNode(element)); 1655 } 1656 1657 var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 1658 var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 1659 1660 /** 1661 * Determines if the browser is Internet Explorer 1662 * @method 1663 * @memberof Popper.Utils 1664 * @param {Number} version to check 1665 * @returns {Boolean} isIE 1666 */ 1667 function isIE(version) { 1668 if (version === 11) { 1669 return isIE11; 1670 } 1671 if (version === 10) { 1672 return isIE10; 1673 } 1674 return isIE11 || isIE10; 1675 } 1676 1677 /** 1678 * Returns the offset parent of the given element 1679 * @method 1680 * @memberof Popper.Utils 1681 * @argument {Element} element 1682 * @returns {Element} offset parent 1683 */ 1684 function getOffsetParent(element) { 1685 if (!element) { 1686 return document.documentElement; 1687 } 1688 1689 var noOffsetParent = isIE(10) ? document.body : null; 1690 1691 // NOTE: 1 DOM access here 1692 var offsetParent = element.offsetParent || null; 1693 // Skip hidden elements which don't have an offsetParent 1694 while (offsetParent === noOffsetParent && element.nextElementSibling) { 1695 offsetParent = (element = element.nextElementSibling).offsetParent; 1696 } 1697
vendor: 4,347 bytes, lines 1698-1814
1698 var nodeName = offsetParent && offsetParent.nodeName; 1699 1700 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 1701 return element ? element.ownerDocument.documentElement : document.documentElement; 1702 } 1703 1704 // .offsetParent will return the closest TH, TD or TABLE in case 1705 // no offsetParent is present, I hate this job... 1706 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 1707 return getOffsetParent(offsetParent); 1708 } 1709 1710 return offsetParent; 1711 } 1712 1713 function isOffsetContainer(element) { 1714 var nodeName = element.nodeName; 1715 1716 if (nodeName === 'BODY') { 1717 return false; 1718 } 1719 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 1720 } 1721 1722 /** 1723 * Finds the root node (document, shadowDOM root) of the given element 1724 * @method 1725 * @memberof Popper.Utils 1726 * @argument {Element} node 1727 * @returns {Element} root node 1728 */ 1729 function getRoot(node) { 1730 if (node.parentNode !== null) { 1731 return getRoot(node.parentNode); 1732 } 1733 1734 return node; 1735 } 1736 1737 /** 1738 * Finds the offset parent common to the two provided nodes 1739 * @method 1740 * @memberof Popper.Utils 1741 * @argument {Element} element1 1742 * @argument {Element} element2 1743 * @returns {Element} common offset parent 1744 */ 1745 function findCommonOffsetParent(element1, element2) { 1746 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 1747 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 1748 return document.documentElement; 1749 } 1750 1751 // Here we make sure to give as "start" the element that comes first in the DOM 1752 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 1753 var start = order ? element1 : element2; 1754 var end = order ? element2 : element1; 1755 1756 // Get common ancestor container 1757 var range = document.createRange(); 1758 range.setStart(start, 0); 1759 range.setEnd(end, 0); 1760 var commonAncestorContainer = range.commonAncestorContainer; 1761 1762 // Both nodes are inside #document 1763 1764 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 1765 if (isOffsetContainer(commonAncestorContainer)) { 1766 return commonAncestorContainer; 1767 } 1768 1769 return getOffsetParent(commonAncestorContainer); 1770 } 1771 1772 // one of the nodes is inside shadowDOM, find which one 1773 var element1root = getRoot(element1); 1774 if (element1root.host) { 1775 return findCommonOffsetParent(element1root.host, element2); 1776 } else { 1777 return findCommonOffsetParent(element1, getRoot(element2).host); 1778 } 1779 } 1780 1781 /** 1782 * Gets the scroll value of the given element in the given side (top and left) 1783 * @method 1784 * @memberof Popper.Utils 1785 * @argument {Element} element 1786 * @argument {String} side `top` or `left` 1787 * @returns {number} amount of scrolled pixels 1788 */ 1789 function getScroll(element) { 1790 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 1791 1792 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 1793 var nodeName = element.nodeName; 1794 1795 if (nodeName === 'BODY' || nodeName === 'HTML') { 1796 var html = element.ownerDocument.documentElement; 1797 var scrollingElement = element.ownerDocument.scrollingElement || html; 1798 return scrollingElement[upperSide]; 1799 } 1800 1801 return element[upperSide]; 1802 } 1803 1804 /* 1805 * Sum or subtract the element scroll values (left and top) from a given rect object 1806 * @method 1807 * @memberof Popper.Utils 1808 * @param {Object} rect - Rect object you want to change 1809 * @param {HTMLElement} element - The element from the function reads the scroll values 1810 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 1811 * @return {Object} rect - The modifier rect object 1812 */ 1813 function includeScroll(rect, element) { 1814 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
vendor: 4,120 bytes, lines 1815-1939
1815 1816 var scrollTop = getScroll(element, 'top'); 1817 var scrollLeft = getScroll(element, 'left'); 1818 var modifier = subtract ? -1 : 1; 1819 rect.top += scrollTop * modifier; 1820 rect.bottom += scrollTop * modifier; 1821 rect.left += scrollLeft * modifier; 1822 rect.right += scrollLeft * modifier; 1823 return rect; 1824 } 1825 1826 /* 1827 * Helper to detect borders of a given element 1828 * @method 1829 * @memberof Popper.Utils 1830 * @param {CSSStyleDeclaration} styles 1831 * Result of `getStyleComputedProperty` on the given element 1832 * @param {String} axis - `x` or `y` 1833 * @return {number} borders - The borders size of the given axis 1834 */ 1835 1836 function getBordersSize(styles, axis) { 1837 var sideA = axis === 'x' ? 'Left' : 'Top'; 1838 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 1839 1840 return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); 1841 } 1842 1843 function getSize(axis, body, html, computedStyle) { 1844 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 1845 } 1846 1847 function getWindowSizes(document) { 1848 var body = document.body; 1849 var html = document.documentElement; 1850 var computedStyle = isIE(10) && getComputedStyle(html); 1851 1852 return { 1853 height: getSize('Height', body, html, computedStyle), 1854 width: getSize('Width', body, html, computedStyle) 1855 }; 1856 } 1857 1858 var classCallCheck = function (instance, Constructor) { 1859 if (!(instance instanceof Constructor)) { 1860 throw new TypeError("Cannot call a class as a function"); 1861 } 1862 }; 1863 1864 var createClass = function () { 1865 function defineProperties(target, props) { 1866 for (var i = 0; i < props.length; i++) { 1867 var descriptor = props[i]; 1868 descriptor.enumerable = descriptor.enumerable || false; 1869 descriptor.configurable = true; 1870 if ("value" in descriptor) descriptor.writable = true; 1871 Object.defineProperty(target, descriptor.key, descriptor); 1872 } 1873 } 1874 1875 return function (Constructor, protoProps, staticProps) { 1876 if (protoProps) defineProperties(Constructor.prototype, protoProps); 1877 if (staticProps) defineProperties(Constructor, staticProps); 1878 return Constructor; 1879 }; 1880 }(); 1881 1882 1883 1884 1885 1886 var defineProperty = function (obj, key, value) { 1887 if (key in obj) { 1888 Object.defineProperty(obj, key, { 1889 value: value, 1890 enumerable: true, 1891 configurable: true, 1892 writable: true 1893 }); 1894 } else { 1895 obj[key] = value; 1896 } 1897 1898 return obj; 1899 }; 1900 1901 var _extends = Object.assign || function (target) { 1902 for (var i = 1; i < arguments.length; i++) { 1903 var source = arguments[i]; 1904 1905 for (var key in source) { 1906 if (Object.prototype.hasOwnProperty.call(source, key)) { 1907 target[key] = source[key]; 1908 } 1909 } 1910 } 1911 1912 return target; 1913 }; 1914 1915 /** 1916 * Given element offsets, generate an output similar to getBoundingClientRect 1917 * @method 1918 * @memberof Popper.Utils 1919 * @argument {Object} offsets 1920 * @returns {Object} ClientRect like output 1921 */ 1922 function getClientRect(offsets) { 1923 return _extends({}, offsets, { 1924 right: offsets.left + offsets.width, 1925 bottom: offsets.top + offsets.height 1926 }); 1927 } 1928 1929 /** 1930 * Get bounding client rect of given element 1931 * @method 1932 * @memberof Popper.Utils 1933 * @param {HTMLElement} element 1934 * @return {Object} client rect 1935 */ 1936 function getBoundingClientRect(element) { 1937 var rect = {}; 1938 1939 // IE10 10 FIX: Please, don't ask, the element isn't
vendor: 4,266 bytes, lines 1940-2038
1940 // considered in DOM in some circumstances... 1941 // This isn't reproducible in IE10 compatibility mode of IE11 1942 try { 1943 if (isIE(10)) { 1944 rect = element.getBoundingClientRect(); 1945 var scrollTop = getScroll(element, 'top'); 1946 var scrollLeft = getScroll(element, 'left'); 1947 rect.top += scrollTop; 1948 rect.left += scrollLeft; 1949 rect.bottom += scrollTop; 1950 rect.right += scrollLeft; 1951 } else { 1952 rect = element.getBoundingClientRect(); 1953 } 1954 } catch (e) {} 1955 1956 var result = { 1957 left: rect.left, 1958 top: rect.top, 1959 width: rect.right - rect.left, 1960 height: rect.bottom - rect.top 1961 }; 1962 1963 // subtract scrollbar size from sizes 1964 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 1965 var width = sizes.width || element.clientWidth || result.right - result.left; 1966 var height = sizes.height || element.clientHeight || result.bottom - result.top; 1967 1968 var horizScrollbar = element.offsetWidth - width; 1969 var vertScrollbar = element.offsetHeight - height; 1970 1971 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 1972 // we make this check conditional for performance reasons 1973 if (horizScrollbar || vertScrollbar) { 1974 var styles = getStyleComputedProperty(element); 1975 horizScrollbar -= getBordersSize(styles, 'x'); 1976 vertScrollbar -= getBordersSize(styles, 'y'); 1977 1978 result.width -= horizScrollbar; 1979 result.height -= vertScrollbar; 1980 } 1981 1982 return getClientRect(result); 1983 } 1984 1985 function getOffsetRectRelativeToArbitraryNode(children, parent) { 1986 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 1987 1988 var isIE10 = isIE(10); 1989 var isHTML = parent.nodeName === 'HTML'; 1990 var childrenRect = getBoundingClientRect(children); 1991 var parentRect = getBoundingClientRect(parent); 1992 var scrollParent = getScrollParent(children); 1993 1994 var styles = getStyleComputedProperty(parent); 1995 var borderTopWidth = parseFloat(styles.borderTopWidth, 10); 1996 var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); 1997 1998 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 1999 if (fixedPosition && isHTML) { 2000 parentRect.top = Math.max(parentRect.top, 0); 2001 parentRect.left = Math.max(parentRect.left, 0); 2002 } 2003 var offsets = getClientRect({ 2004 top: childrenRect.top - parentRect.top - borderTopWidth, 2005 left: childrenRect.left - parentRect.left - borderLeftWidth, 2006 width: childrenRect.width, 2007 height: childrenRect.height 2008 }); 2009 offsets.marginTop = 0; 2010 offsets.marginLeft = 0; 2011 2012 // Subtract margins of documentElement in case it's being used as parent 2013 // we do this only on HTML because it's the only element that behaves 2014 // differently when margins are applied to it. The margins are included in 2015 // the box of the documentElement, in the other cases not. 2016 if (!isIE10 && isHTML) { 2017 var marginTop = parseFloat(styles.marginTop, 10); 2018 var marginLeft = parseFloat(styles.marginLeft, 10); 2019 2020 offsets.top -= borderTopWidth - marginTop; 2021 offsets.bottom -= borderTopWidth - marginTop; 2022 offsets.left -= borderLeftWidth - marginLeft; 2023 offsets.right -= borderLeftWidth - marginLeft; 2024 2025 // Attach marginTop and marginLeft because in some circumstances we may need them 2026 offsets.marginTop = marginTop; 2027 offsets.marginLeft = marginLeft; 2028 } 2029 2030 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 2031 offsets = includeScroll(offsets, parent); 2032 } 2033 2034 return offsets; 2035 } 2036 2037 function getViewportOffsetRectRelativeToArtbitraryNode(element) { 2038 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
vendor: 7,614 bytes, lines 2039-2241
2039 2040 var html = element.ownerDocument.documentElement; 2041 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 2042 var width = Math.max(html.clientWidth, window.innerWidth || 0); 2043 var height = Math.max(html.clientHeight, window.innerHeight || 0); 2044 2045 var scrollTop = !excludeScroll ? getScroll(html) : 0; 2046 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 2047 2048 var offset = { 2049 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 2050 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 2051 width: width, 2052 height: height 2053 }; 2054 2055 return getClientRect(offset); 2056 } 2057 2058 /** 2059 * Check if the given element is fixed or is inside a fixed parent 2060 * @method 2061 * @memberof Popper.Utils 2062 * @argument {Element} element 2063 * @argument {Element} customContainer 2064 * @returns {Boolean} answer to "isFixed?" 2065 */ 2066 function isFixed(element) { 2067 var nodeName = element.nodeName; 2068 if (nodeName === 'BODY' || nodeName === 'HTML') { 2069 return false; 2070 } 2071 if (getStyleComputedProperty(element, 'position') === 'fixed') { 2072 return true; 2073 } 2074 var parentNode = getParentNode(element); 2075 if (!parentNode) { 2076 return false; 2077 } 2078 return isFixed(parentNode); 2079 } 2080 2081 /** 2082 * Finds the first parent of an element that has a transformed property defined 2083 * @method 2084 * @memberof Popper.Utils 2085 * @argument {Element} element 2086 * @returns {Element} first transformed parent or documentElement 2087 */ 2088 2089 function getFixedPositionOffsetParent(element) { 2090 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 2091 if (!element || !element.parentElement || isIE()) { 2092 return document.documentElement; 2093 } 2094 var el = element.parentElement; 2095 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 2096 el = el.parentElement; 2097 } 2098 return el || document.documentElement; 2099 } 2100 2101 /** 2102 * Computed the boundaries limits and return them 2103 * @method 2104 * @memberof Popper.Utils 2105 * @param {HTMLElement} popper 2106 * @param {HTMLElement} reference 2107 * @param {number} padding 2108 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 2109 * @param {Boolean} fixedPosition - Is in fixed position mode 2110 * @returns {Object} Coordinates of the boundaries 2111 */ 2112 function getBoundaries(popper, reference, padding, boundariesElement) { 2113 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 2114 2115 // NOTE: 1 DOM access here 2116 2117 var boundaries = { top: 0, left: 0 }; 2118 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); 2119 2120 // Handle viewport case 2121 if (boundariesElement === 'viewport') { 2122 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 2123 } else { 2124 // Handle other cases based on DOM element used as boundaries 2125 var boundariesNode = void 0; 2126 if (boundariesElement === 'scrollParent') { 2127 boundariesNode = getScrollParent(getParentNode(reference)); 2128 if (boundariesNode.nodeName === 'BODY') { 2129 boundariesNode = popper.ownerDocument.documentElement; 2130 } 2131 } else if (boundariesElement === 'window') { 2132 boundariesNode = popper.ownerDocument.documentElement; 2133 } else { 2134 boundariesNode = boundariesElement; 2135 } 2136 2137 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 2138 2139 // In case of HTML, we need a different computation 2140 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 2141 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 2142 height = _getWindowSizes.height, 2143 width = _getWindowSizes.width; 2144 2145 boundaries.top += offsets.top - offsets.marginTop; 2146 boundaries.bottom = height + offsets.top; 2147 boundaries.left += offsets.left - offsets.marginLeft; 2148 boundaries.right = width + offsets.left; 2149 } else { 2150 // for all the other DOM elements, this one is good 2151 boundaries = offsets; 2152 } 2153 } 2154 2155 // Add paddings 2156 padding = padding || 0; 2157 var isPaddingNumber = typeof padding === 'number'; 2158 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 2159 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 2160 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 2161 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 2162 2163 return boundaries; 2164 } 2165 2166 function getArea(_ref) { 2167 var width = _ref.width, 2168 height = _ref.height; 2169 2170 return width * height; 2171 } 2172 2173 /** 2174 * Utility used to transform the `auto` placement to the placement with more 2175 * available space. 2176 * @method 2177 * @memberof Popper.Utils 2178 * @argument {Object} data - The data object generated by update method 2179 * @argument {Object} options - Modifiers configuration and options 2180 * @returns {Object} The data object, properly modified 2181 */ 2182 function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 2183 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 2184 2185 if (placement.indexOf('auto') === -1) { 2186 return placement; 2187 } 2188 2189 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 2190 2191 var rects = { 2192 top: { 2193 width: boundaries.width, 2194 height: refRect.top - boundaries.top 2195 }, 2196 right: { 2197 width: boundaries.right - refRect.right, 2198 height: boundaries.height 2199 }, 2200 bottom: { 2201 width: boundaries.width, 2202 height: boundaries.bottom - refRect.bottom 2203 }, 2204 left: { 2205 width: refRect.left - boundaries.left, 2206 height: boundaries.height 2207 } 2208 }; 2209 2210 var sortedAreas = Object.keys(rects).map(function (key) { 2211 return _extends({ 2212 key: key 2213 }, rects[key], { 2214 area: getArea(rects[key]) 2215 }); 2216 }).sort(function (a, b) { 2217 return b.area - a.area; 2218 }); 2219 2220 var filteredAreas = sortedAreas.filter(function (_ref2) { 2221 var width = _ref2.width, 2222 height = _ref2.height; 2223 return width >= popper.clientWidth && height >= popper.clientHeight; 2224 }); 2225 2226 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 2227 2228 var variation = placement.split('-')[1]; 2229 2230 return computedPlacement + (variation ? '-' + variation : ''); 2231 } 2232 2233 /** 2234 * Get offsets to the reference element 2235 * @method 2236 * @memberof Popper.Utils 2237 * @param {Object} state 2238 * @param {Element} popper - the popper element 2239 * @param {Element} reference - the reference element (the popper will be relative to this) 2240 * @param {Element} fixedPosition - is in fixed position mode 2241 * @returns {Object}
2241 An object containing the offsets which will be applied to the popper 2242 */ 2243 function getReferenceOffsets(state, popper, reference) { 2244 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 2245 2246 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); 2247 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 2248 } 2249 2250 /** 2251 * Get the outer sizes of the given element (offset size + margins) 2252 * @method 2253 * @memberof Popper.Utils 2254 * @argument {Element} element 2255 * @returns {Object} object containing width and height properties 2256 */ 2257 function getOuterSizes(element) { 2258 var window = element.ownerDocument.defaultView; 2259 var styles = window.getComputedStyle(element); 2260 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 2261 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0
vendor: 5,077 bytes, lines 2261-2404
2261); 2262 var result = { 2263 width: element.offsetWidth + y, 2264 height: element.offsetHeight + x 2265 }; 2266 return result; 2267 } 2268 2269 /** 2270 * Get the opposite placement of the given one 2271 * @method 2272 * @memberof Popper.Utils 2273 * @argument {String} placement 2274 * @returns {String} flipped placement 2275 */ 2276 function getOppositePlacement(placement) { 2277 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 2278 return placement.replace(/left|right|bottom|top/g, function (matched) { 2279 return hash[matched]; 2280 }); 2281 } 2282 2283 /** 2284 * Get offsets to the popper 2285 * @method 2286 * @memberof Popper.Utils 2287 * @param {Object} position - CSS position the Popper will get applied 2288 * @param {HTMLElement} popper - the popper element 2289 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 2290 * @param {String} placement - one of the valid placement options 2291 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 2292 */ 2293 function getPopperOffsets(popper, referenceOffsets, placement) { 2294 placement = placement.split('-')[0]; 2295 2296 // Get popper node sizes 2297 var popperRect = getOuterSizes(popper); 2298 2299 // Add position, width and height to our offsets object 2300 var popperOffsets = { 2301 width: popperRect.width, 2302 height: popperRect.height 2303 }; 2304 2305 // depending by the popper placement we have to compute its offsets slightly differently 2306 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 2307 var mainSide = isHoriz ? 'top' : 'left'; 2308 var secondarySide = isHoriz ? 'left' : 'top'; 2309 var measurement = isHoriz ? 'height' : 'width'; 2310 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 2311 2312 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 2313 if (placement === secondarySide) { 2314 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 2315 } else { 2316 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 2317 } 2318 2319 return popperOffsets; 2320 } 2321 2322 /** 2323 * Mimics the `find` method of Array 2324 * @method 2325 * @memberof Popper.Utils 2326 * @argument {Array} arr 2327 * @argument prop 2328 * @argument value 2329 * @returns index or -1 2330 */ 2331 function find(arr, check) { 2332 // use native find if supported 2333 if (Array.prototype.find) { 2334 return arr.find(check); 2335 } 2336 2337 // use `filter` to obtain the same behavior of `find` 2338 return arr.filter(check)[0]; 2339 } 2340 2341 /** 2342 * Return the index of the matching object 2343 * @method 2344 * @memberof Popper.Utils 2345 * @argument {Array} arr 2346 * @argument prop 2347 * @argument value 2348 * @returns index or -1 2349 */ 2350 function findIndex(arr, prop, value) { 2351 // use native findIndex if supported 2352 if (Array.prototype.findIndex) { 2353 return arr.findIndex(function (cur) { 2354 return cur[prop] === value; 2355 }); 2356 } 2357 2358 // use `find` + `indexOf` if `findIndex` isn't supported 2359 var match = find(arr, function (obj) { 2360 return obj[prop] === value; 2361 }); 2362 return arr.indexOf(match); 2363 } 2364 2365 /** 2366 * Loop trough the list of modifiers and run them in order, 2367 * each of them will then edit the data object. 2368 * @method 2369 * @memberof Popper.Utils 2370 * @param {dataObject} data 2371 * @param {Array} modifiers 2372 * @param {String} ends - Optional modifier name used as stopper 2373 * @returns {dataObject} 2374 */ 2375 function runModifiers(modifiers, data, ends) { 2376 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 2377 2378 modifiersToRun.forEach(function (modifier) { 2379 if (modifier['function']) { 2380 // eslint-disable-line dot-notation 2381 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 2382 } 2383 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 2384 if (modifier.enabled && isFunction(fn)) { 2385 // Add properties to offsets to make them a complete clientRect object 2386 // we do this before each modifier to make sure the previous one doesn't 2387 // mess with these values 2388 data.offsets.popper = getClientRect(data.offsets.popper); 2389 data.offsets.reference = getClientRect(data.offsets.reference); 2390 2391 data = fn(data, modifier); 2392 } 2393 }); 2394 2395 return data; 2396 } 2397 2398 /** 2399 * Updates the position of the popper, computing the new offsets and applying 2400 * the new style.<br /> 2401 * Prefer `scheduleUpdate` over `update` because of performance reasons. 2402 * @method 2403 * @memberof Popper 2404 */
vendor: 23,004 bytes, lines 2405-2996
2405 function update() { 2406 // if popper is destroyed, don't perform any further update 2407 if (this.state.isDestroyed) { 2408 return; 2409 } 2410 2411 var data = { 2412 instance: this, 2413 styles: {}, 2414 arrowStyles: {}, 2415 attributes: {}, 2416 flipped: false, 2417 offsets: {} 2418 }; 2419 2420 // compute reference element offsets 2421 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 2422 2423 // compute auto placement, store placement inside the data object, 2424 // modifiers will be able to edit `placement` if needed 2425 // and refer to originalPlacement to know the original value 2426 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 2427 2428 // store the computed placement inside `originalPlacement` 2429 data.originalPlacement = data.placement; 2430 2431 data.positionFixed = this.options.positionFixed; 2432 2433 // compute the popper offsets 2434 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 2435 2436 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 2437 2438 // run the modifiers 2439 data = runModifiers(this.modifiers, data); 2440 2441 // the first `update` will call `onCreate` callback 2442 // the other ones will call `onUpdate` callback 2443 if (!this.state.isCreated) { 2444 this.state.isCreated = true; 2445 this.options.onCreate(data); 2446 } else { 2447 this.options.onUpdate(data); 2448 } 2449 } 2450 2451 /** 2452 * Helper used to know if the given modifier is enabled. 2453 * @method 2454 * @memberof Popper.Utils 2455 * @returns {Boolean} 2456 */ 2457 function isModifierEnabled(modifiers, modifierName) { 2458 return modifiers.some(function (_ref) { 2459 var name = _ref.name, 2460 enabled = _ref.enabled; 2461 return enabled && name === modifierName; 2462 }); 2463 } 2464 2465 /** 2466 * Get the prefixed supported property name 2467 * @method 2468 * @memberof Popper.Utils 2469 * @argument {String} property (camelCase) 2470 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 2471 */ 2472 function getSupportedPropertyName(property) { 2473 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 2474 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 2475 2476 for (var i = 0; i < prefixes.length; i++) { 2477 var prefix = prefixes[i]; 2478 var toCheck = prefix ? '' + prefix + upperProp : property; 2479 if (typeof document.body.style[toCheck] !== 'undefined') { 2480 return toCheck; 2481 } 2482 } 2483 return null; 2484 } 2485 2486 /** 2487 * Destroys the popper. 2488 * @method 2489 * @memberof Popper 2490 */ 2491 function destroy() { 2492 this.state.isDestroyed = true; 2493 2494 // touch DOM only if `applyStyle` modifier is enabled 2495 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 2496 this.popper.removeAttribute('x-placement'); 2497 this.popper.style.position = ''; 2498 this.popper.style.top = ''; 2499 this.popper.style.left = ''; 2500 this.popper.style.right = ''; 2501 this.popper.style.bottom = ''; 2502 this.popper.style.willChange = ''; 2503 this.popper.style[getSupportedPropertyName('transform')] = ''; 2504 } 2505 2506 this.disableEventListeners(); 2507 2508 // remove the popper if user explicity asked for the deletion on destroy 2509 // do not use `remove` because IE11 doesn't support it 2510 if (this.options.removeOnDestroy) { 2511 this.popper.parentNode.removeChild(this.popper); 2512 } 2513 return this; 2514 } 2515 2516 /** 2517 * Get the window associated with the element 2518 * @argument {Element} element 2519 * @returns {Window} 2520 */ 2521 function getWindow(element) { 2522 var ownerDocument = element.ownerDocument; 2523 return ownerDocument ? ownerDocument.defaultView : window; 2524 } 2525 2526 function attachToScrollParents(scrollParent, event, callback, scrollParents) { 2527 var isBody = scrollParent.nodeName === 'BODY'; 2528 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 2529 target.addEventListener(event, callback, { passive: true }); 2530 2531 if (!isBody) { 2532 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 2533 } 2534 scrollParents.push(target); 2535 } 2536 2537 /** 2538 * Setup needed event listeners used to update the popper position 2539 * @method 2540 * @memberof Popper.Utils 2541 * @private 2542 */ 2543 function setupEventListeners(reference, options, state, updateBound) { 2544 // Resize event listener on window 2545 state.updateBound = updateBound; 2546 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 2547 2548 // Scroll event listener on scroll parents 2549 var scrollElement = getScrollParent(reference); 2550 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 2551 state.scrollElement = scrollElement; 2552 state.eventsEnabled = true; 2553 2554 return state; 2555 } 2556 2557 /** 2558 * It will add resize/scroll events and start recalculating 2559 * position of the popper element when they are triggered. 2560 * @method 2561 * @memberof Popper 2562 */ 2563 function enableEventListeners() { 2564 if (!this.state.eventsEnabled) { 2565 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 2566 } 2567 } 2568 2569 /** 2570 * Remove event listeners used to update the popper position 2571 * @method 2572 * @memberof Popper.Utils 2573 * @private 2574 */ 2575 function removeEventListeners(reference, state) { 2576 // Remove resize event listener on window 2577 getWindow(reference).removeEventListener('resize', state.updateBound); 2578 2579 // Remove scroll event listener on scroll parents 2580 state.scrollParents.forEach(function (target) { 2581 target.removeEventListener('scroll', state.updateBound); 2582 }); 2583 2584 // Reset state 2585 state.updateBound = null; 2586 state.scrollParents = []; 2587 state.scrollElement = null; 2588 state.eventsEnabled = false; 2589 return state; 2590 } 2591 2592 /** 2593 * It will remove resize/scroll events and won't recalculate popper position 2594 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 2595 * unless you call `update` method manually. 2596 * @method 2597 * @memberof Popper 2598 */ 2599 function disableEventListeners() { 2600 if (this.state.eventsEnabled) { 2601 cancelAnimationFrame(this.scheduleUpdate); 2602 this.state = removeEventListeners(this.reference, this.state); 2603 } 2604 } 2605 2606 /** 2607 * Tells if a given input is a number 2608 * @method 2609 * @memberof Popper.Utils 2610 * @param {*} input to check 2611 * @return {Boolean} 2612 */ 2613 function isNumeric(n) { 2614 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 2615 } 2616 2617 /** 2618 * Set the style to the given popper 2619 * @method 2620 * @memberof Popper.Utils 2621 * @argument {Element} element - Element to apply the style to 2622 * @argument {Object} styles 2623 * Object with a list of properties and values which will be applied to the element 2624 */ 2625 function setStyles(element, styles) { 2626 Object.keys(styles).forEach(function (prop) { 2627 var unit = ''; 2628 // add unit if the value is numeric and is one of the following 2629 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 2630 unit = 'px'; 2631 } 2632 element.style[prop] = styles[prop] + unit; 2633 }); 2634 } 2635 2636 /** 2637 * Set the attributes to the given popper 2638 * @method 2639 * @memberof Popper.Utils 2640 * @argument {Element} element - Element to apply the attributes to 2641 * @argument {Object} styles 2642 * Object with a list of properties and values which will be applied to the element 2643 */ 2644 function setAttributes(element, attributes) { 2645 Object.keys(attributes).forEach(function (prop) { 2646 var value = attributes[prop]; 2647 if (value !== false) { 2648 element.setAttribute(prop, attributes[prop]); 2649 } else { 2650 element.removeAttribute(prop); 2651 } 2652 }); 2653 } 2654 2655 /** 2656 * @function 2657 * @memberof Modifiers 2658 * @argument {Object} data - The data object generated by `update` method 2659 * @argument {Object} data.styles - List of style properties - values to apply to popper element 2660 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 2661 * @argument {Object} options - Modifiers configuration and options 2662 * @returns {Object} The same data object 2663 */ 2664 function applyStyle(data) { 2665 // any property present in `data.styles` will be applied to the popper, 2666 // in this way we can make the 3rd party modifiers add custom styles to it 2667 // Be aware, modifiers could override the properties defined in the previous 2668 // lines of this modifier! 2669 setStyles(data.instance.popper, data.styles); 2670 2671 // any property present in `data.attributes` will be applied to the popper, 2672 // they will be set as HTML attributes of the element 2673 setAttributes(data.instance.popper, data.attributes); 2674 2675 // if arrowElement is defined and arrowStyles has some properties 2676 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 2677 setStyles(data.arrowElement, data.arrowStyles); 2678 } 2679 2680 return data; 2681 } 2682 2683 /** 2684 * Set the x-placement attribute before everything else because it could be used 2685 * to add margins to the popper margins needs to be calculated to get the 2686 * correct popper offsets. 2687 * @method 2688 * @memberof Popper.modifiers 2689 * @param {HTMLElement} reference - The reference element used to position the popper 2690 * @param {HTMLElement} popper - The HTML element used as popper 2691 * @param {Object} options - Popper.js options 2692 */ 2693 function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 2694 // compute reference element offsets 2695 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 2696 2697 // compute auto placement, store placement inside the data object, 2698 // modifiers will be able to edit `placement` if needed 2699 // and refer to originalPlacement to know the original value 2700 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 2701 2702 popper.setAttribute('x-placement', placement); 2703 2704 // Apply `position` to popper before anything else because 2705 // without the position applied we can't guarantee correct computations 2706 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 2707 2708 return options; 2709 } 2710 2711 /** 2712 * @function 2713 * @memberof Popper.Utils 2714 * @argument {Object} data - The data object generated by `update` method 2715 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 2716 * @returns {Object} The popper's position offsets rounded 2717 * 2718 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 2719 * good as it can be within reason. 2720 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 2721 * 2722 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 2723 * as well on High DPI screens). 2724 * 2725 * Firefox prefers no rounding for positioning and does not have blurriness on 2726 * high DPI screens. 2727 * 2728 * Only horizontal placement and left/right values need to be considered. 2729 */ 2730 function getRoundedOffsets(data, shouldRound) { 2731 var _data$offsets = data.offsets, 2732 popper = _data$offsets.popper, 2733 reference = _data$offsets.reference; 2734 var round = Math.round, 2735 floor = Math.floor; 2736 2737 var noRound = function noRound(v) { 2738 return v; 2739 }; 2740 2741 var referenceWidth = round(reference.width); 2742 var popperWidth = round(popper.width); 2743 2744 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 2745 var isVariation = data.placement.indexOf('-') !== -1; 2746 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 2747 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 2748 2749 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 2750 var verticalToInteger = !shouldRound ? noRound : round; 2751 2752 return { 2753 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 2754 top: verticalToInteger(popper.top), 2755 bottom: verticalToInteger(popper.bottom), 2756 right: horizontalToInteger(popper.right) 2757 }; 2758 } 2759 2760 var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 2761 2762 /** 2763 * @function 2764 * @memberof Modifiers 2765 * @argument {Object} data - The data object generated by `update` method 2766 * @argument {Object} options - Modifiers configuration and options 2767 * @returns {Object} The data object, properly modified 2768 */ 2769 function computeStyle(data, options) { 2770 var x = options.x, 2771 y = options.y; 2772 var popper = data.offsets.popper; 2773 2774 // Remove this legacy support in Popper.js v2 2775 2776 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 2777 return modifier.name === 'applyStyle'; 2778 }).gpuAcceleration; 2779 if (legacyGpuAccelerationOption !== undefined) { 2780 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 2781 } 2782 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 2783 2784 var offsetParent = getOffsetParent(data.instance.popper); 2785 var offsetParentRect = getBoundingClientRect(offsetParent); 2786 2787 // Styles 2788 var styles = { 2789 position: popper.position 2790 }; 2791 2792 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 2793 2794 var sideA = x === 'bottom' ? 'top' : 'bottom'; 2795 var sideB = y === 'right' ? 'left' : 'right'; 2796 2797 // if gpuAcceleration is set to `true` and transform is supported, 2798 // we use `translate3d` to apply the position to the popper we 2799 // automatically use the supported prefixed version if needed 2800 var prefixedProperty = getSupportedPropertyName('transform'); 2801 2802 // now, let's make a step back and look at this code closely (wtf?) 2803 // If the content of the popper grows once it's been positioned, it 2804 // may happen that the popper gets misplaced because of the new content 2805 // overflowing its reference element 2806 // To avoid this problem, we provide two options (x and y), which allow 2807 // the consumer to define the offset origin. 2808 // If we position a popper on top of a reference element, we can set 2809 // `x` to `top` to make the popper grow towards its top instead of 2810 // its bottom. 2811 var left = void 0, 2812 top = void 0; 2813 if (sideA === 'bottom') { 2814 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 2815 // and not the bottom of the html element 2816 if (offsetParent.nodeName === 'HTML') { 2817 top = -offsetParent.clientHeight + offsets.bottom; 2818 } else { 2819 top = -offsetParentRect.height + offsets.bottom; 2820 } 2821 } else { 2822 top = offsets.top; 2823 } 2824 if (sideB === 'right') { 2825 if (offsetParent.nodeName === 'HTML') { 2826 left = -offsetParent.clientWidth + offsets.right; 2827 } else { 2828 left = -offsetParentRect.width + offsets.right; 2829 } 2830 } else { 2831 left = offsets.left; 2832 } 2833 if (gpuAcceleration && prefixedProperty) { 2834 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 2835 styles[sideA] = 0; 2836 styles[sideB] = 0; 2837 styles.willChange = 'transform'; 2838 } else { 2839 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 2840 var invertTop = sideA === 'bottom' ? -1 : 1; 2841 var invertLeft = sideB === 'right' ? -1 : 1; 2842 styles[sideA] = top * invertTop; 2843 styles[sideB] = left * invertLeft; 2844 styles.willChange = sideA + ', ' + sideB; 2845 } 2846 2847 // Attributes 2848 var attributes = { 2849 'x-placement': data.placement 2850 }; 2851 2852 // Update `data` attributes, styles and arrowStyles 2853 data.attributes = _extends({}, attributes, data.attributes); 2854 data.styles = _extends({}, styles, data.styles); 2855 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 2856 2857 return data; 2858 } 2859 2860 /** 2861 * Helper used to know if the given modifier depends from another one.<br /> 2862 * It checks if the needed modifier is listed and enabled. 2863 * @method 2864 * @memberof Popper.Utils 2865 * @param {Array} modifiers - list of modifiers 2866 * @param {String} requestingName - name of requesting modifier 2867 * @param {String} requestedName - name of requested modifier 2868 * @returns {Boolean} 2869 */ 2870 function isModifierRequired(modifiers, requestingName, requestedName) { 2871 var requesting = find(modifiers, function (_ref) { 2872 var name = _ref.name; 2873 return name === requestingName; 2874 }); 2875 2876 var isRequired = !!requesting && modifiers.some(function (modifier) { 2877 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 2878 }); 2879 2880 if (!isRequired) { 2881 var _requesting = '`' + requestingName + '`'; 2882 var requested = '`' + requestedName + '`'; 2883 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 2884 } 2885 return isRequired; 2886 } 2887 2888 /** 2889 * @function 2890 * @memberof Modifiers 2891 * @argument {Object} data - The data object generated by update method 2892 * @argument {Object} options - Modifiers configuration and options 2893 * @returns {Object} The data object, properly modified 2894 */ 2895 function arrow(data, options) { 2896 var _data$offsets$arrow; 2897 2898 // arrow depends on keepTogether in order to work 2899 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 2900 return data; 2901 } 2902 2903 var arrowElement = options.element; 2904 2905 // if arrowElement is a string, suppose it's a CSS selector 2906 if (typeof arrowElement === 'string') { 2907 arrowElement = data.instance.popper.querySelector(arrowElement); 2908 2909 // if arrowElement is not found, don't run the modifier 2910 if (!arrowElement) { 2911 return data; 2912 } 2913 } else { 2914 // if the arrowElement isn't a query selector we must check that the 2915 // provided DOM node is child of its popper node 2916 if (!data.instance.popper.contains(arrowElement)) { 2917 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 2918 return data; 2919 } 2920 } 2921 2922 var placement = data.placement.split('-')[0]; 2923 var _data$offsets = data.offsets, 2924 popper = _data$offsets.popper, 2925 reference = _data$offsets.reference; 2926 2927 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 2928 2929 var len = isVertical ? 'height' : 'width'; 2930 var sideCapitalized = isVertical ? 'Top' : 'Left'; 2931 var side = sideCapitalized.toLowerCase(); 2932 var altSide = isVertical ? 'left' : 'top'; 2933 var opSide = isVertical ? 'bottom' : 'right'; 2934 var arrowElementSize = getOuterSizes(arrowElement)[len]; 2935 2936 // 2937 // extends keepTogether behavior making sure the popper and its 2938 // reference have enough pixels in conjunction 2939 // 2940 2941 // top/left side 2942 if (reference[opSide] - arrowElementSize < popper[side]) { 2943 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 2944 } 2945 // bottom/right side 2946 if (reference[side] + arrowElementSize > popper[opSide]) { 2947 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 2948 } 2949 data.offsets.popper = getClientRect(data.offsets.popper); 2950 2951 // compute center of the popper 2952 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 2953 2954 // Compute the sideValue using the updated popper offsets 2955 // take popper margin in account because we don't have this info available 2956 var css = getStyleComputedProperty(data.instance.popper); 2957 var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10); 2958 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10); 2959 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 2960 2961 // prevent arrowElement from being placed not contiguously to its popper 2962 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 2963 2964 data.arrowElement = arrowElement; 2965 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 2966 2967 return data; 2968 } 2969 2970 /** 2971 * Get the opposite placement variation of the given one 2972 * @method 2973 * @memberof Popper.Utils 2974 * @argument {String} placement variation 2975 * @returns {String} flipped placement variation 2976 */ 2977 function getOppositeVariation(variation) { 2978 if (variation === 'end') { 2979 return 'start'; 2980 } else if (variation === 'start') { 2981 return 'end'; 2982 } 2983 return variation; 2984 } 2985 2986 /** 2987 * List of accepted placements to use as values of the `placement` option.<br /> 2988 * Valid placements are: 2989 * - `auto` 2990 * - `top` 2991 * - `right` 2992 * - `bottom` 2993 * - `left` 2994 * 2995 * Each placement can have a variation from this list: 2996 * - `-start`
vendor: 5,778 bytes, lines 2997-3125
2997 * - `-end` 2998 * 2999 * Variations are interpreted easily if you think of them as the left to right 3000 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 3001 * is right.<br /> 3002 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 3003 * 3004 * Some valid examples are: 3005 * - `top-end` (on top of reference, right aligned) 3006 * - `right-start` (on right of reference, top aligned) 3007 * - `bottom` (on bottom, centered) 3008 * - `auto-end` (on the side with more space available, alignment depends by placement) 3009 * 3010 * @static 3011 * @type {Array} 3012 * @enum {String} 3013 * @readonly 3014 * @method placements 3015 * @memberof Popper 3016 */ 3017 var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 3018 3019 // Get rid of `auto` `auto-start` and `auto-end` 3020 var validPlacements = placements.slice(3); 3021 3022 /** 3023 * Given an initial placement, returns all the subsequent placements 3024 * clockwise (or counter-clockwise). 3025 * 3026 * @method 3027 * @memberof Popper.Utils 3028 * @argument {String} placement - A valid placement (it accepts variations) 3029 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 3030 * @returns {Array} placements including their variations 3031 */ 3032 function clockwise(placement) { 3033 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 3034 3035 var index = validPlacements.indexOf(placement); 3036 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 3037 return counter ? arr.reverse() : arr; 3038 } 3039 3040 var BEHAVIORS = { 3041 FLIP: 'flip', 3042 CLOCKWISE: 'clockwise', 3043 COUNTERCLOCKWISE: 'counterclockwise' 3044 }; 3045 3046 /** 3047 * @function 3048 * @memberof Modifiers 3049 * @argument {Object} data - The data object generated by update method 3050 * @argument {Object} options - Modifiers configuration and options 3051 * @returns {Object} The data object, properly modified 3052 */ 3053 function flip(data, options) { 3054 // if `inner` modifier is enabled, we can't use the `flip` modifier 3055 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 3056 return data; 3057 } 3058 3059 if (data.flipped && data.placement === data.originalPlacement) { 3060 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 3061 return data; 3062 } 3063 3064 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 3065 3066 var placement = data.placement.split('-')[0]; 3067 var placementOpposite = getOppositePlacement(placement); 3068 var variation = data.placement.split('-')[1] || ''; 3069 3070 var flipOrder = []; 3071 3072 switch (options.behavior) { 3073 case BEHAVIORS.FLIP: 3074 flipOrder = [placement, placementOpposite]; 3075 break; 3076 case BEHAVIORS.CLOCKWISE: 3077 flipOrder = clockwise(placement); 3078 break; 3079 case BEHAVIORS.COUNTERCLOCKWISE: 3080 flipOrder = clockwise(placement, true); 3081 break; 3082 default: 3083 flipOrder = options.behavior; 3084 } 3085 3086 flipOrder.forEach(function (step, index) { 3087 if (placement !== step || flipOrder.length === index + 1) { 3088 return data; 3089 } 3090 3091 placement = data.placement.split('-')[0]; 3092 placementOpposite = getOppositePlacement(placement); 3093 3094 var popperOffsets = data.offsets.popper; 3095 var refOffsets = data.offsets.reference; 3096 3097 // using floor because the reference offsets may contain decimals we are not going to consider here 3098 var floor = Math.floor; 3099 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 3100 3101 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 3102 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 3103 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 3104 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 3105 3106 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 3107 3108 // flip the variation if required 3109 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 3110 var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 3111 3112 if (overlapsRef || overflowsBoundaries || flippedVariation) { 3113 // this boolean to detect any flip loop 3114 data.flipped = true; 3115 3116 if (overlapsRef || overflowsBoundaries) { 3117 placement = flipOrder[index + 1]; 3118 } 3119 3120 if (flippedVariation) { 3121 variation = getOppositeVariation(variation); 3122 } 3123 3124 data.placement = placement + (variation ? '-' + variation : ''); 3125
vendor: 17,381 bytes, lines 3126-3561
3126 // this object contains `position`, we want to preserve it along with 3127 // any additional property we may add in the future 3128 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 3129 3130 data = runModifiers(data.instance.modifiers, data, 'flip'); 3131 } 3132 }); 3133 return data; 3134 } 3135 3136 /** 3137 * @function 3138 * @memberof Modifiers 3139 * @argument {Object} data - The data object generated by update method 3140 * @argument {Object} options - Modifiers configuration and options 3141 * @returns {Object} The data object, properly modified 3142 */ 3143 function keepTogether(data) { 3144 var _data$offsets = data.offsets, 3145 popper = _data$offsets.popper, 3146 reference = _data$offsets.reference; 3147 3148 var placement = data.placement.split('-')[0]; 3149 var floor = Math.floor; 3150 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 3151 var side = isVertical ? 'right' : 'bottom'; 3152 var opSide = isVertical ? 'left' : 'top'; 3153 var measurement = isVertical ? 'width' : 'height'; 3154 3155 if (popper[side] < floor(reference[opSide])) { 3156 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 3157 } 3158 if (popper[opSide] > floor(reference[side])) { 3159 data.offsets.popper[opSide] = floor(reference[side]); 3160 } 3161 3162 return data; 3163 } 3164 3165 /** 3166 * Converts a string containing value + unit into a px value number 3167 * @function 3168 * @memberof {modifiers~offset} 3169 * @private 3170 * @argument {String} str - Value + unit string 3171 * @argument {String} measurement - `height` or `width` 3172 * @argument {Object} popperOffsets 3173 * @argument {Object} referenceOffsets 3174 * @returns {Number|String} 3175 * Value in pixels, or original string if no values were extracted 3176 */ 3177 function toValue(str, measurement, popperOffsets, referenceOffsets) { 3178 // separate value from unit 3179 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 3180 var value = +split[1]; 3181 var unit = split[2]; 3182 3183 // If it's not a number it's an operator, I guess 3184 if (!value) { 3185 return str; 3186 } 3187 3188 if (unit.indexOf('%') === 0) { 3189 var element = void 0; 3190 switch (unit) { 3191 case '%p': 3192 element = popperOffsets; 3193 break; 3194 case '%': 3195 case '%r': 3196 default: 3197 element = referenceOffsets; 3198 } 3199 3200 var rect = getClientRect(element); 3201 return rect[measurement] / 100 * value; 3202 } else if (unit === 'vh' || unit === 'vw') { 3203 // if is a vh or vw, we calculate the size based on the viewport 3204 var size = void 0; 3205 if (unit === 'vh') { 3206 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 3207 } else { 3208 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 3209 } 3210 return size / 100 * value; 3211 } else { 3212 // if is an explicit pixel unit, we get rid of the unit and keep the value 3213 // if is an implicit unit, it's px, and we return just the value 3214 return value; 3215 } 3216 } 3217 3218 /** 3219 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 3220 * @function 3221 * @memberof {modifiers~offset} 3222 * @private 3223 * @argument {String} offset 3224 * @argument {Object} popperOffsets 3225 * @argument {Object} referenceOffsets 3226 * @argument {String} basePlacement 3227 * @returns {Array} a two cells array with x and y offsets in numbers 3228 */ 3229 function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 3230 var offsets = [0, 0]; 3231 3232 // Use height if placement is left or right and index is 0 otherwise use width 3233 // in this way the first offset will use an axis and the second one 3234 // will use the other one 3235 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 3236 3237 // Split the offset string to obtain a list of values and operands 3238 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 3239 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 3240 return frag.trim(); 3241 }); 3242 3243 // Detect if the offset string contains a pair of values or a single one 3244 // they could be separated by comma or space 3245 var divider = fragments.indexOf(find(fragments, function (frag) { 3246 return frag.search(/,|\s/) !== -1; 3247 })); 3248 3249 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 3250 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 3251 } 3252 3253 // If divider is found, we divide the list of values and operands to divide 3254 // them by ofset X and Y. 3255 var splitRegex = /\s*,\s*|\s+/; 3256 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 3257 3258 // Convert the values with units to absolute pixels to allow our computations 3259 ops = ops.map(function (op, index) { 3260 // Most of the units rely on the orientation of the popper 3261 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 3262 var mergeWithPrevious = false; 3263 return op 3264 // This aggregates any `+` or `-` sign that aren't considered operators 3265 // e.g.: 10 + +5 => [10, +, +5] 3266 .reduce(function (a, b) { 3267 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 3268 a[a.length - 1] = b; 3269 mergeWithPrevious = true; 3270 return a; 3271 } else if (mergeWithPrevious) { 3272 a[a.length - 1] += b; 3273 mergeWithPrevious = false; 3274 return a; 3275 } else { 3276 return a.concat(b); 3277 } 3278 }, []) 3279 // Here we convert the string values into number values (in px) 3280 .map(function (str) { 3281 return toValue(str, measurement, popperOffsets, referenceOffsets); 3282 }); 3283 }); 3284 3285 // Loop trough the offsets arrays and execute the operations 3286 ops.forEach(function (op, index) { 3287 op.forEach(function (frag, index2) { 3288 if (isNumeric(frag)) { 3289 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 3290 } 3291 }); 3292 }); 3293 return offsets; 3294 } 3295 3296 /** 3297 * @function 3298 * @memberof Modifiers 3299 * @argument {Object} data - The data object generated by update method 3300 * @argument {Object} options - Modifiers configuration and options 3301 * @argument {Number|String} options.offset=0 3302 * The offset value as described in the modifier description 3303 * @returns {Object} The data object, properly modified 3304 */ 3305 function offset(data, _ref) { 3306 var offset = _ref.offset; 3307 var placement = data.placement, 3308 _data$offsets = data.offsets, 3309 popper = _data$offsets.popper, 3310 reference = _data$offsets.reference; 3311 3312 var basePlacement = placement.split('-')[0]; 3313 3314 var offsets = void 0; 3315 if (isNumeric(+offset)) { 3316 offsets = [+offset, 0]; 3317 } else { 3318 offsets = parseOffset(offset, popper, reference, basePlacement); 3319 } 3320 3321 if (basePlacement === 'left') { 3322 popper.top += offsets[0]; 3323 popper.left -= offsets[1]; 3324 } else if (basePlacement === 'right') { 3325 popper.top += offsets[0]; 3326 popper.left += offsets[1]; 3327 } else if (basePlacement === 'top') { 3328 popper.left += offsets[0]; 3329 popper.top -= offsets[1]; 3330 } else if (basePlacement === 'bottom') { 3331 popper.left += offsets[0]; 3332 popper.top += offsets[1]; 3333 } 3334 3335 data.popper = popper; 3336 return data; 3337 } 3338 3339 /** 3340 * @function 3341 * @memberof Modifiers 3342 * @argument {Object} data - The data object generated by `update` method 3343 * @argument {Object} options - Modifiers configuration and options 3344 * @returns {Object} The data object, properly modified 3345 */ 3346 function preventOverflow(data, options) { 3347 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 3348 3349 // If offsetParent is the reference element, we really want to 3350 // go one step up and use the next offsetParent as reference to 3351 // avoid to make this modifier completely useless and look like broken 3352 if (data.instance.reference === boundariesElement) { 3353 boundariesElement = getOffsetParent(boundariesElement); 3354 } 3355 3356 // NOTE: DOM access here 3357 // resets the popper's position so that the document size can be calculated excluding 3358 // the size of the popper element itself 3359 var transformProp = getSupportedPropertyName('transform'); 3360 var popperStyles = data.instance.popper.style; // assignment to help minification 3361 var top = popperStyles.top, 3362 left = popperStyles.left, 3363 transform = popperStyles[transformProp]; 3364 3365 popperStyles.top = ''; 3366 popperStyles.left = ''; 3367 popperStyles[transformProp] = ''; 3368 3369 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 3370 3371 // NOTE: DOM access here 3372 // restores the original style properties after the offsets have been computed 3373 popperStyles.top = top; 3374 popperStyles.left = left; 3375 popperStyles[transformProp] = transform; 3376 3377 options.boundaries = boundaries; 3378 3379 var order = options.priority; 3380 var popper = data.offsets.popper; 3381 3382 var check = { 3383 primary: function primary(placement) { 3384 var value = popper[placement]; 3385 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 3386 value = Math.max(popper[placement], boundaries[placement]); 3387 } 3388 return defineProperty({}, placement, value); 3389 }, 3390 secondary: function secondary(placement) { 3391 var mainSide = placement === 'right' ? 'left' : 'top'; 3392 var value = popper[mainSide]; 3393 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 3394 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 3395 } 3396 return defineProperty({}, mainSide, value); 3397 } 3398 }; 3399 3400 order.forEach(function (placement) { 3401 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 3402 popper = _extends({}, popper, check[side](placement)); 3403 }); 3404 3405 data.offsets.popper = popper; 3406 3407 return data; 3408 } 3409 3410 /** 3411 * @function 3412 * @memberof Modifiers 3413 * @argument {Object} data - The data object generated by `update` method 3414 * @argument {Object} options - Modifiers configuration and options 3415 * @returns {Object} The data object, properly modified 3416 */ 3417 function shift(data) { 3418 var placement = data.placement; 3419 var basePlacement = placement.split('-')[0]; 3420 var shiftvariation = placement.split('-')[1]; 3421 3422 // if shift shiftvariation is specified, run the modifier 3423 if (shiftvariation) { 3424 var _data$offsets = data.offsets, 3425 reference = _data$offsets.reference, 3426 popper = _data$offsets.popper; 3427 3428 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 3429 var side = isVertical ? 'left' : 'top'; 3430 var measurement = isVertical ? 'width' : 'height'; 3431 3432 var shiftOffsets = { 3433 start: defineProperty({}, side, reference[side]), 3434 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 3435 }; 3436 3437 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 3438 } 3439 3440 return data; 3441 } 3442 3443 /** 3444 * @function 3445 * @memberof Modifiers 3446 * @argument {Object} data - The data object generated by update method 3447 * @argument {Object} options - Modifiers configuration and options 3448 * @returns {Object} The data object, properly modified 3449 */ 3450 function hide(data) { 3451 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 3452 return data; 3453 } 3454 3455 var refRect = data.offsets.reference; 3456 var bound = find(data.instance.modifiers, function (modifier) { 3457 return modifier.name === 'preventOverflow'; 3458 }).boundaries; 3459 3460 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 3461 // Avoid unnecessary DOM access if visibility hasn't changed 3462 if (data.hide === true) { 3463 return data; 3464 } 3465 3466 data.hide = true; 3467 data.attributes['x-out-of-boundaries'] = ''; 3468 } else { 3469 // Avoid unnecessary DOM access if visibility hasn't changed 3470 if (data.hide === false) { 3471 return data; 3472 } 3473 3474 data.hide = false; 3475 data.attributes['x-out-of-boundaries'] = false; 3476 } 3477 3478 return data; 3479 } 3480 3481 /** 3482 * @function 3483 * @memberof Modifiers 3484 * @argument {Object} data - The data object generated by `update` method 3485 * @argument {Object} options - Modifiers configuration and options 3486 * @returns {Object} The data object, properly modified 3487 */ 3488 function inner(data) { 3489 var placement = data.placement; 3490 var basePlacement = placement.split('-')[0]; 3491 var _data$offsets = data.offsets, 3492 popper = _data$offsets.popper, 3493 reference = _data$offsets.reference; 3494 3495 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 3496 3497 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 3498 3499 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 3500 3501 data.placement = getOppositePlacement(placement); 3502 data.offsets.popper = getClientRect(popper); 3503 3504 return data; 3505 } 3506 3507 /** 3508 * Modifier function, each modifier can have a function of this type assigned 3509 * to its `fn` property.<br /> 3510 * These functions will be called on each update, this means that you must 3511 * make sure they are performant enough to avoid performance bottlenecks. 3512 * 3513 * @function ModifierFn 3514 * @argument {dataObject} data - The data object generated by `update` method 3515 * @argument {Object} options - Modifiers configuration and options 3516 * @returns {dataObject} The data object, properly modified 3517 */ 3518 3519 /** 3520 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 3521 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 3522 * needed by the library. 3523 * 3524 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 3525 * All the other properties are configurations that could be tweaked. 3526 * @namespace modifiers 3527 */ 3528 var modifiers = { 3529 /** 3530 * Modifier used to shift the popper on the start or end of its reference 3531 * element.<br /> 3532 * It will read the variation of the `placement` property.<br /> 3533 * It can be one either `-end` or `-start`. 3534 * @memberof modifiers 3535 * @inner 3536 */ 3537 shift: { 3538 /** @prop {number} order=100 - Index used to define the order of execution */ 3539 order: 100, 3540 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3541 enabled: true, 3542 /** @prop {ModifierFn} */ 3543 fn: shift 3544 }, 3545 3546 /** 3547 * The `offset` modifier can shift your popper on both its axis. 3548 * 3549 * It accepts the following units: 3550 * - `px` or unit-less, interpreted as pixels 3551 * - `%` or `%r`, percentage relative to the length of the reference element 3552 * - `%p`, percentage relative to the length of the popper element 3553 * - `vw`, CSS viewport width unit 3554 * - `vh`, CSS viewport height unit 3555 * 3556 * For length is intended the main axis relative to the placement of the popper.<br /> 3557 * This means that if the placement is `top` or `bottom`, the length will be the 3558 * `width`. In case of `left` or `right`, it will be the `height`. 3559 * 3560 * You can provide a single value (as `Number` or `String`), or a pair of values 3561 * as `String` divided by a comma or one (or more) white space
3561s.<br /> 3562 * The latter is a deprecated method because it leads to confusion and will be 3563 * removed in v2.<br /> 3564 * Additionally, it accepts additions and subtractions between different units. 3565 * Note that multiplications and divisions aren't supported. 3566 * 3567 * Valid examples are: 3568 * ``` 3569 * 10 3570 * '10%' 3571 * '10, 10' 3572 * '10%, 10' 3573 * '10 + 10%' 3574 * '10 - 5vh + 3%' 3575 * '-10px + 5vh, 5px - 6%' 3576 * ``` 3577 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 3578 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 3579 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 3580 * 3581 * @memberof modifiers 3582 * @inner 3583 */ 3584 offset: { 3585 /** @prop {number} order=200 - Index used to define the order of execution */ 3586 order: 200, 3587 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3588 enabled: true, 3589 /** @prop {ModifierFn} */ 3590 fn: offset, 3591 /** @prop {Number|String} offset=0 3592 * The offset value as described in the modifier description 3593 */ 3594 offset: 0 3595 }, 3596 3597 /** 3598 * Modifier used to prevent the popper from being positioned outside the boundary. 3599 * 3600 * A scenario exists where the reference itself is not within the boundaries.<br /> 3601 * We can say it has "escaped the boundaries" â or just "escaped".<br /> 3602 * In this case we need to decide whether the popper should either: 3603 * 3604 * - detach from the reference and remain "trapped" in the boundaries, or 3605 * - if it should ignore the boundary and "escape with its reference" 3606 * 3607 * When `escapeWithReference` is set to`true` and reference is completely 3608 * outside its boundaries, the popper will overflow (or completely leave) 3609 * the boundaries in order to remain attached to the edge of the reference. 3610 * 3611 * @memberof modifiers 3612 * @inner 3613 */ 3614 preventOverflow: { 3615 /** @prop {number} order=300 - Index used to define the order of execution */ 3616 order: 300, 3617 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3618 enabled: true, 3619 /** @prop {ModifierFn} */ 3620 fn: preventOverflow, 3621 /** 3622 * @prop {Array} [priority=['left','right','top','bottom']] 3623 * Popper will try to prevent overflow following these priorities by default, 3624 * then, it could overflow on the left and on top of the `boundariesElement` 3625 */ 3626 priority: ['left', 'right', 'top', 'bottom'], 3627 /** 3628 * @prop {number} padding=5 3629 * Amount of pixel used to define a minimum distance between the boundaries 3630 * and the popper. This makes sure the popper always has a little padding 3631 * between the edges of its container 3632 */ 3633 padding: 5, 3634 /** 3635 * @prop {String|HTMLElement} boundariesElement='scrollParent' 3636 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 3637 * `viewport` or any DOM element. 3638 */ 3639 boundariesElement: 'scrollParent' 3640 }, 3641 3642 /** 3643 * Modifier used to make sure the reference and its popper stay near each other 3644 * without leaving any gap between the two. Especially useful when the arrow is 3645 * enabled and you want to ensure that it points to its reference element. 3646 * It cares only about the first axis. You can still have poppers with margin 3647 * between the popper and its reference element. 3648 * @memberof modifiers 3649 * @inner 3650 */ 3651 keepTogether: { 3652 /** @prop {number} order=400 - Index used to define the order of execution */ 3653 order: 400, 3654 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3655 enabled: true, 3656 /** @prop {ModifierFn} */ 3657 fn: keepTogether 3658 }, 3659 3660 /** 3661 * This modifier is used to move the `arrowElement` of the popper to make 3662 * sure it is positioned between the reference element and its popper element. 3663 * It will read the outer size of the `arrowElement` node to detect how many 3664 * pixels of conjunction are needed. 3665 * 3666 * It has no effect if no `arrowElement` is provided. 3667 * @memberof modifiers 3668 * @inner 3669 */ 3670 arrow: { 3671 /** @prop {number} order=500 - Index used to define the order of execution */ 3672 order: 500, 3673 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3674 enabled: true, 3675 /** @prop {ModifierFn} */ 3676 fn: arrow, 3677 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 3678 element: '[x-arrow]' 3679 }, 3680 3681 /** 3682 * Modifier used to flip the popper's placement when it starts to overlap its 3683 * reference element. 3684 * 3685 * Requires the `preventOverflow` modifier before it in order to work. 3686 * 3687 * **NOTE:** this modifier will interrupt the current update cycle and will 3688 * restart it if it detects the need to flip the placement. 3689 * @memberof modifiers 3690 * @inner 3691 */ 3692 flip: { 3693 /** @prop {number} order=600 - Index used to define the order of execution */ 3694 order: 600, 3695 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3696 enabled: true, 3697 /** @prop {ModifierFn} */ 3698 fn: flip, 3699 /** 3700 * @prop {String|Array} behavior='flip' 3701 * The behavior used to change the popper's placement. It can be one of 3702 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 3703 * placements (with optional variations) 3704 */ 3705 behavior: 'flip', 3706 /** 3707 * @prop {number} padding=5 3708 * The popper will flip if it hits the edges of the `boundariesElement` 3709 */ 3710 padding: 5, 3711 /** 3712 * @prop {String|HTMLElement} boundariesElement='viewport' 3713 * The element which will define the boundaries of the popper position. 3714 * The popper will never be placed outside of the defined boundaries 3715 * (except if `keepTogether` is enabled) 3716 */ 3717 boundariesElement: 'viewport' 3718 }, 3719 3720 /** 3721 * Modifier used to make the popper flow toward the inner of the reference element. 3722 * By default, when this modifier is disabled, the popper will be placed outside 3723 * the reference element. 3724 * @memberof modifiers 3725 * @inner 3726 */ 3727 inner: { 3728 /** @prop {number} order=700 - Index used to define the order of execution */ 3729 order: 700, 3730 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 3731 enabled: false, 3732 /** @prop {ModifierFn} */ 3733 fn: inner 3734 }, 3735 3736 /** 3737 * Modifier used to hide the popper when its reference element is outside of the 3738 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 3739 * be used to hide with a CSS selector the popper when its reference is 3740 * out of boundaries. 3741 * 3742 * Requires the `preventOverflow` modifier before it in order to work. 3743 * @memberof modifiers 3744 * @inner 3745 */ 3746 hide: { 3747 /** @prop {number} order=800 - Index used to define the order of execution */ 3748 order: 800, 3749 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3750 enabled: true, 3751 /** @prop {ModifierFn} */ 3752 fn: hide 3753 }, 3754 3755 /** 3756 * Computes the style that will be applied to the popper element to gets 3757 * properly positioned. 3758 * 3759 * Note that this modifier will not touch the DOM, it just prepares the styles 3760 * so that `applyStyle` modifier can apply it. This separation is useful 3761 * in case you need to replace `applyStyle` with a custom implementation. 3762 * 3763 * This modifier has `850` as `order` value to maintain backward compatibility 3764 * with previous versions of Popper.js. Expect the modifiers ordering method 3765 * to change in future major versions of the library. 3766 * 3767 * @memberof modifiers 3768 * @inner 3769 */ 3770 computeStyle: { 3771 /** @prop {number} order=850 - Index used to define the order of execution */ 3772 order: 850, 3773 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3774 enabled: true, 3775 /** @prop {ModifierFn} */ 3776 fn: computeStyle, 3777 /** 3778 * @prop {Boolean} gpuAcceleration=true 3779 * If true, it uses the CSS 3D transformation to position the popper. 3780 * Otherwise, it will use the `top` and `left` properties 3781 */ 3782 gpuAcceleration: true, 3783 /** 3784 * @prop {string} [x='bottom'] 3785 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 3786 * Change this if your popper should grow in a direction different from `bottom` 3787 */ 3788 x: 'bottom', 3789 /** 3790 * @prop {string} [x='left'] 3791 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 3792 * Change this if your popper should grow in a direction different from `right` 3793 */ 3794 y: 'right' 3795 }, 3796 3797 /** 3798 * Applies the computed styles to the popper element. 3799 * 3800 * All the DOM manipulations are limited to this modifier. This is useful in case 3801 * you want to integrate Popper.js inside a framework or view library and you 3802 * want to delegate all the DOM manipulations to it. 3803 * 3804 * Note that if you disable this modifier, you must make sure the popper element 3805 * has its position set to `absolute` before Popper.js can do its work! 3806 * 3807 * Just disable this modifier and define your own to achieve the desired effect. 3808 * 3809 * @memberof modifiers 3810 * @inner 3811 */ 3812 applyStyle: { 3813 /** @prop {number} order=900 - Index used to define the order of execution */ 3814 order: 900, 3815 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3816 enabled: true, 3817 /** @prop {ModifierFn} */
vendor: 5,610 bytes, lines 3818-3956
3818 fn: applyStyle, 3819 /** @prop {Function} */ 3820 onLoad: applyStyleOnLoad, 3821 /** 3822 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 3823 * @prop {Boolean} gpuAcceleration=true 3824 * If true, it uses the CSS 3D transformation to position the popper. 3825 * Otherwise, it will use the `top` and `left` properties 3826 */ 3827 gpuAcceleration: undefined 3828 } 3829 }; 3830 3831 /** 3832 * The `dataObject` is an object containing all the information used by Popper.js. 3833 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 3834 * @name dataObject 3835 * @property {Object} data.instance The Popper.js instance 3836 * @property {String} data.placement Placement applied to popper 3837 * @property {String} data.originalPlacement Placement originally defined on init 3838 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 3839 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 3840 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 3841 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 3842 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 3843 * @property {Object} data.boundaries Offsets of the popper boundaries 3844 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 3845 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 3846 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 3847 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 3848 */ 3849 3850 /** 3851 * Default options provided to Popper.js constructor.<br /> 3852 * These can be overridden using the `options` argument of Popper.js.<br /> 3853 * To override an option, simply pass an object with the same 3854 * structure of the `options` object, as the 3rd argument. For example: 3855 * ``` 3856 * new Popper(ref, pop, { 3857 * modifiers: { 3858 * preventOverflow: { enabled: false } 3859 * } 3860 * }) 3861 * ``` 3862 * @type {Object} 3863 * @static 3864 * @memberof Popper 3865 */ 3866 var Defaults = { 3867 /** 3868 * Popper's placement. 3869 * @prop {Popper.placements} placement='bottom' 3870 */ 3871 placement: 'bottom', 3872 3873 /** 3874 * Set this to true if you want popper to position it self in 'fixed' mode 3875 * @prop {Boolean} positionFixed=false 3876 */ 3877 positionFixed: false, 3878 3879 /** 3880 * Whether events (resize, scroll) are initially enabled. 3881 * @prop {Boolean} eventsEnabled=true 3882 */ 3883 eventsEnabled: true, 3884 3885 /** 3886 * Set to true if you want to automatically remove the popper when 3887 * you call the `destroy` method. 3888 * @prop {Boolean} removeOnDestroy=false 3889 */ 3890 removeOnDestroy: false, 3891 3892 /** 3893 * Callback called when the popper is created.<br /> 3894 * By default, it is set to no-op.<br /> 3895 * Access Popper.js instance with `data.instance`. 3896 * @prop {onCreate} 3897 */ 3898 onCreate: function onCreate() {}, 3899 3900 /** 3901 * Callback called when the popper is updated. This callback is not called 3902 * on the initialization/creation of the popper, but only on subsequent 3903 * updates.<br /> 3904 * By default, it is set to no-op.<br /> 3905 * Access Popper.js instance with `data.instance`. 3906 * @prop {onUpdate} 3907 */ 3908 onUpdate: function onUpdate() {}, 3909 3910 /** 3911 * List of modifiers used to modify the offsets before they are applied to the popper. 3912 * They provide most of the functionalities of Popper.js. 3913 * @prop {modifiers} 3914 */ 3915 modifiers: modifiers 3916 }; 3917 3918 /** 3919 * @callback onCreate 3920 * @param {dataObject} data 3921 */ 3922 3923 /** 3924 * @callback onUpdate 3925 * @param {dataObject} data 3926 */ 3927 3928 // Utils 3929 // Methods 3930 var Popper = function () { 3931 /** 3932 * Creates a new Popper.js instance. 3933 * @class Popper 3934 * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper 3935 * @param {HTMLElement} popper - The HTML element used as the popper 3936 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 3937 * @return {Object} instance - The generated Popper.js instance 3938 */ 3939 function Popper(reference, popper) { 3940 var _this = this; 3941 3942 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 3943 classCallCheck(this, Popper); 3944 3945 this.scheduleUpdate = function () { 3946 return requestAnimationFrame(_this.update); 3947 }; 3948 3949 // make update() debounced, so that it only runs at most once-per-tick 3950 this.update = debounce(this.update.bind(this)); 3951 3952 // with {} we create a new object with the options inside it 3953 this.options = _extends({}, Popper.Defaults, options); 3954 3955 // init state 3956 this.state = {
3957 isDestroyed: false, 3958 isCreated: false, 3959 scrollParents: [] 3960 }; 3961 3962 // get reference and popper elements (allow jQuery wrappers) 3963 this.reference = reference && reference.jquery ? reference[0] : reference; 3964 this.popper = popper && popper.jquery ? popper[0] : popper; 3965 3966 // Deep merge modifiers options 3967 this.options.modifiers = {}; 3968 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 3969 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 3970 }); 3971 3972 // Refactoring modifiers' list (Object => Array) 3973 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 3974 return _extends({ 3975 name: name 3976 }, _this.options.modifiers[name]); 3977 }) 3978 // sort the modifiers by order 3979 .sort(function (a, b) { 3980 return a.order - b.order; 3981 }); 3982 3983 // modifiers have the ability to execute arbitrary code when Popper.js get inited 3984 // such code is executed in the same order of its modifier 3985 // they could add new properties to their options configuration 3986 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 3987 this.modifiers.forEach(function (modifierOptions) { 3988 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 3989 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 3990 } 3991 }); 3992 3993 // fire the first update to position the popper in the right place 3994 this.update(); 3995 3996 var eventsEnabled = this.options.eventsEnabled; 3997 if (eventsEnabled) { 3998 // setup event listeners, they will take care of update the position in specific situations 3999 this.enableEventListeners(); 4000 } 4001 4002 this.state.eventsEnabled = eventsEnabled; 4003 } 4004 4005 // We can't use class properties because they don't get listed in the 4006 // class prototype and break stuff like Sinon stubs 4007 4008 4009 createClass(Popper, [{ 4010 key: 'update', 4011 value: function update$$1() { 4012 return update.call(this); 4013 } 4014 }, { 4015 key: 'destroy', 4016 value: function destroy$$1() { 4017 return destroy.call(this); 4018 } 4019 }, { 4020 key: 'enableEventListeners', 4021 value: function enableEventListeners$$1() { 4022 return enableEventListeners.call(this); 4023 } 4024 }, { 4025 key: 'disableEventListeners', 4026 value: function disableEventListeners$$1() { 4027 return disableEventListeners.call(this); 4028 } 4029 4030 /** 4031 * Schedules an update. It will run on the next UI update available. 4032 * @method scheduleUpdate 4033 * @memberof Popper 4034 */ 4035 4036 4037 /** 4038 * Collection of utilities useful when writing custom modifiers. 4039 * Starting from version 1.7, this method is available only if you 4040 * include `popper-utils.js` before `popper.js`. 4041 * 4042 * **DEPRECATION**: This way to access PopperUtils is deprecated 4043 * and will be removed in v2! Use the PopperUtils module directly instead. 4044 * Due to the high instability of the methods contained in Utils, we can't 4045 * guarantee them to follow semver. Use them at your own risk! 4046 * @static 4047 * @private 4048 * @type {Object} 4049 * @deprecated since version 1.8 4050 * @member Utils 4051 * @memberof Popper 4052 */ 4053 4054 }]); 4055 return Popper; 4056 }(); 4057 4058 /** 4059 * The `referenceObject` is an object that provides an interface compatible with Popper.js 4060 * and lets you use it as replacement of a real DOM node.<br /> 4061 * You can use this method to position a popper relatively to a set of coordinates 4062 * in case you don't have a DOM node to use as reference. 4063 * 4064 * ``` 4065 * new Popper(referenceObject, popperNode); 4066 * ``` 4067 * 4068 * NB: This feature isn't supported in Internet Explorer 10. 4069 * @name referenceObject 4070 * @property {Function} data.getBoundingClientRect 4071 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 4072 * @property {number} data.clientWidth 4073 * An ES6 getter that will return the width of the virtual reference element. 4074 * @property {number} data.clientHeight 4075 * An ES6 getter that will return the height of the virtual reference element. 4076 */ 4077 4078 4079 Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 4080 Popper.placements = placements; 4081 Popper.Defaults = Defaults; 4082 4083 /** 4084 * ------------------------------------------------------------------------ 4085 * Constants 4086 * ------------------------------------------------------------------------ 4087 */ 4088 4089 var NAME$4 = 'dropdown'; 4090 var VERSION$4 = '4.3.1'; 4091 var DATA_KEY$4 = 'bs.dropdown'; 4092 var EVENT_KEY$4 = "." + DATA_KEY$4; 4093 var DATA_API_KEY$4 = '.data-api'; 4094 var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4]; 4095 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 4096 4097 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 4098 4099 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 4100 4101 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 4102 4103 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 4104 4105 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 4106 4107 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 4108 var Event$4 = { 4109 HIDE: "hide" + EVENT_KEY$4, 4110 HIDDEN: "hidden" + EVENT_KEY$4, 4111 SHOW: "show" + EVENT_KEY$4, 4112 SHOWN: "shown" + EVENT_KEY$4, 4113 CLICK: "click" + EVENT_KEY$4, 4114 CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4, 4115 KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4, 4116 KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4 4117 }; 4118 var ClassName$4 = { 4119 DISABLED: 'disabled', 4120 SHOW: 'show', 4121 DROPUP: 'dropup', 4122 DROPRIGHT: 'dropright', 4123 DROPLEFT: 'dropleft', 4124 MENURIGHT: 'dropdown-menu-right', 4125 MENULEFT: 'dropdown-menu-left', 4126 POSITION_STATIC: 'position-static' 4127 }; 4128 var Selector$4 = { 4129 DATA_TOGGLE: '[data-toggle="dropdown"]', 4130 FORM_CHILD: '.dropdown form', 4131 MENU: '.dropdown-menu', 4132 NAVBAR_NAV: '.navbar-nav', 4133 VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' 4134 }; 4135 var AttachmentMap = { 4136 TOP: 'top-start', 4137 TOPEND: 'top-end', 4138 BOTTOM: 'bottom-start', 4139 BOTTOMEND: 'bottom-end', 4140 RIGHT: 'right-start', 4141 RIGHTEND: 'right-end', 4142 LEFT: 'left-start', 4143 LEFTEND: 'left-end' 4144 }; 4145 var Default$2 = { 4146 offset: 0, 4147 flip: true, 4148 boundary: 'scrollParent', 4149 reference: 'toggle', 4150 display: 'dynamic' 4151 }; 4152 var DefaultType$2 = { 4153 offset: '(number|string|function)', 4154 flip: 'boolean', 4155 boundary: '(string|element)', 4156 reference: '(string|element)', 4157 display: 'string' 4158 /** 4159 * ------------------------------------------------------------------------ 4160 * Class Definition 4161 * ------------------------------------------------------------------------ 4162 */ 4163 4164 }; 4165 4166 var Dropdown = 4167 /*#__PURE__*/ 4168 function () { 4169 function Dropdown(element, config) { 4170 this._element = element; 4171 this._popper = null; 4172 this._config = this._getConfig(config); 4173 this._menu = this._getMenuElement(); 4174 this._inNavbar = this._detectNavbar(); 4175 4176 this._addEventListeners(); 4177 } // Getters 4178 4179 4180 var _proto = Dropdown.prototype; 4181 4182 // Public
4183 _proto.toggle = function toggle() { 4184 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) { 4185 return; 4186 } 4187 4188 var parent = Dropdown._getParentFromElement(this._element); 4189 4190 var isActive = $(this._menu).hasClass(ClassName$4.SHOW); 4191 4192 Dropdown._clearMenus(); 4193 4194 if (isActive) { 4195 return; 4196 } 4197 4198 var relatedTarget = { 4199 relatedTarget: this._element 4200 }; 4201 var showEvent = $.Event(Event$4.SHOW, relatedTarget); 4202 $(parent).trigger(showEvent); 4203 4204 if (showEvent.isDefaultPrevented()) { 4205 return; 4206 } // Disable totally Popper.js for Dropdown in Navbar 4207 4208 4209 if (!this._inNavbar) { 4210 /** 4211 * Check for Popper dependency 4212 * Popper - https://popper.js.org 4213 */ 4214 if (typeof Popper === 'undefined') { 4215 throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)'); 4216 } 4217 4218 var referenceElement = this._element; 4219 4220 if (this._config.reference === 'parent') { 4221 referenceElement = parent; 4222 } else if (Util.isElement(this._config.reference)) { 4223 referenceElement = this._config.reference; // Check if it's jQuery element 4224 4225 if (typeof this._config.reference.jquery !== 'undefined') { 4226 referenceElement = this._config.reference[0]; 4227 } 4228 } // If boundary is not `scrollParent`, then set position to `static` 4229 // to allow the menu to "escape" the scroll parent's boundaries 4230 // https://github.com/twbs/bootstrap/issues/24251 4231 4232 4233 if (this._config.boundary !== 'scrollParent') { 4234 $(parent).addClass(ClassName$4.POSITION_STATIC); 4235 } 4236 4237 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); 4238 } // If this is a touch-enabled device we add extra 4239 // empty mouseover listeners to the body's immediate children; 4240 // only needed because of broken event delegation on iOS 4241 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 4242 4243 4244 if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) { 4245 $(document.body).children().on('mouseover', null, $.noop); 4246 } 4247 4248 this._element.focus(); 4249 4250 this._element.setAttribute('aria-expanded', true); 4251 4252 $(this._menu).toggleClass(ClassName$4.SHOW); 4253 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); 4254 }; 4255 4256 _proto.show = function show() { 4257 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) { 4258 return; 4259 } 4260 4261 var relatedTarget = { 4262 relatedTarget: this._element 4263 }; 4264 var showEvent = $.Event(Event$4.SHOW, relatedTarget); 4265 4266 var parent = Dropdown._getParentFromElement(this._element); 4267 4268 $(parent).trigger(showEvent); 4269 4270 if (showEvent.isDefaultPrevented()) { 4271 return; 4272 } 4273 4274 $(this._menu).toggleClass(ClassName$4.SHOW); 4275 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); 4276 }; 4277 4278 _proto.hide = function hide() { 4279 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) { 4280 return; 4281 } 4282 4283 var relatedTarget = { 4284 relatedTarget: this._element 4285 }; 4286 var hideEvent = $.Event(Event$4.HIDE, relatedTarget); 4287 4288 var parent = Dropdown._getParentFromElement(this._element); 4289 4290 $(parent).trigger(hideEvent); 4291 4292 if (hideEvent.isDefaultPrevented()) { 4293 return; 4294 } 4295 4296 $(this._menu).toggleClass(ClassName$4.SHOW); 4297 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); 4298 }; 4299 4300 _proto.dispose = function dispose() { 4301 $.removeData(this._element, DATA_KEY$4); 4302 $(this._element).off(EVENT_KEY$4); 4303 this._element = null; 4304 this._menu = null; 4305 4306 if (this._popper !== null) { 4307 this._popper.destroy(); 4308 4309 this._popper = null; 4310 } 4311 }; 4312
4313 _proto.update = function update() { 4314 this._inNavbar = this._detectNavbar(); 4315 4316 if (this._popper !== null) { 4317 this._popper.scheduleUpdate(); 4318 } 4319 } // Private 4320 ; 4321 4322 _proto._addEventListeners = function _addEventListeners() { 4323 var _this = this; 4324 4325 $(this._element).on(Event$4.CLICK, function (event) { 4326 event.preventDefault(); 4327 event.stopPropagation(); 4328 4329 _this.toggle(); 4330 }); 4331 }; 4332 4333 _proto._getConfig = function _getConfig(config) { 4334 config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config); 4335 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 4336 return config; 4337 }; 4338 4339 _proto._getMenuElement = function _getMenuElement() { 4340 if (!this._menu) { 4341 var parent = Dropdown._getParentFromElement(this._element); 4342 4343 if (parent) { 4344 this._menu = parent.querySelector(Selector$4.MENU); 4345 } 4346 } 4347 4348 return this._menu; 4349 }; 4350 4351 _proto._getPlacement = function _getPlacement() { 4352 var $parentDropdown = $(this._element.parentNode); 4353 var placement = AttachmentMap.BOTTOM; // Handle dropup 4354 4355 if ($parentDropdown.hasClass(ClassName$4.DROPUP)) { 4356 placement = AttachmentMap.TOP; 4357 4358 if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { 4359 placement = AttachmentMap.TOPEND; 4360 } 4361 } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) { 4362 placement = AttachmentMap.RIGHT; 4363 } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) { 4364 placement = AttachmentMap.LEFT; 4365 } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { 4366 placement = AttachmentMap.BOTTOMEND; 4367 } 4368 4369 return placement; 4370 }; 4371 4372 _proto._detectNavbar = function _detectNavbar() { 4373 return $(this._element).closest('.navbar').length > 0; 4374 }; 4375 4376 _proto._getOffset = function _getOffset() { 4377 var _this2 = this; 4378 4379 var offset = {}; 4380 4381 if (typeof this._config.offset === 'function') { 4382 offset.fn = function (data) { 4383 data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); 4384 return data; 4385 }; 4386 } else { 4387 offset.offset = this._config.offset; 4388 } 4389 4390 return offset; 4391 }; 4392 4393 _proto._getPopperConfig = function _getPopperConfig() { 4394 var popperConfig = { 4395 placement: this._getPlacement(), 4396 modifiers: { 4397 offset: this._getOffset(), 4398 flip: { 4399 enabled: this._config.flip 4400 }, 4401 preventOverflow: { 4402 boundariesElement: this._config.boundary 4403 } 4404 } // Disable Popper.js if we have a static display 4405 4406 }; 4407 4408 if (this._config.display === 'static') { 4409 popperConfig.modifiers.applyStyle = { 4410 enabled: false 4411 }; 4412 } 4413 4414 return popperConfig; 4415 } // Static 4416 ; 4417 4418 Dropdown._jQueryInterface = function _jQueryInterface(config) { 4419 return this.each(function () { 4420 var data = $(this).data(DATA_KEY$4); 4421 4422 var _config = typeof config === 'object' ? config : null; 4423 4424 if (!data) { 4425 data = new Dropdown(this, _config); 4426 $(this).data(DATA_KEY$4, data); 4427 } 4428 4429 if (typeof config === 'string') { 4430 if (typeof data[config] === 'undefined') {
4431 throw new TypeError("No method named \"" + config + "\""); 4432 } 4433 4434 data[config](); 4435 } 4436 }); 4437 }; 4438 4439 Dropdown._clearMenus = function _clearMenus(event) { 4440 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 4441 return; 4442 } 4443 4444 var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE)); 4445 4446 for (var i = 0, len = toggles.length; i < len; i++) { 4447 var parent = Dropdown._getParentFromElement(toggles[i]); 4448 4449 var context = $(toggles[i]).data(DATA_KEY$4); 4450 var relatedTarget = { 4451 relatedTarget: toggles[i] 4452 }; 4453 4454 if (event && event.type === 'click') { 4455 relatedTarget.clickEvent = event; 4456 } 4457 4458 if (!context) { 4459 continue; 4460 } 4461 4462 var dropdownMenu = context._menu; 4463 4464 if (!$(parent).hasClass(ClassName$4.SHOW)) { 4465 continue; 4466 } 4467 4468 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { 4469 continue; 4470 } 4471 4472 var hideEvent = $.Event(Event$4.HIDE, relatedTarget); 4473 $(parent).trigger(hideEvent); 4474 4475 if (hideEvent.isDefaultPrevented()) { 4476 continue; 4477 } // If this is a touch-enabled device we remove the extra 4478 // empty mouseover listeners we added for iOS support 4479 4480 4481 if ('ontouchstart' in document.documentElement) { 4482 $(document.body).children().off('mouseover', null, $.noop); 4483 } 4484 4485 toggles[i].setAttribute('aria-expanded', 'false'); 4486 $(dropdownMenu).removeClass(ClassName$4.SHOW); 4487 $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); 4488 } 4489 }; 4490 4491 Dropdown._getParentFromElement = function _getParentFromElement(element) { 4492 var parent; 4493 var selector = Util.getSelectorFromElement(element); 4494 4495 if (selector) { 4496 parent = document.querySelector(selector); 4497 } 4498 4499 return parent || element.parentNode; 4500 } // eslint-disable-next-line complexity 4501 ; 4502 4503 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 4504 // If not input/textarea: 4505 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 4506 // If input/textarea: 4507 // - If space key => not a dropdown command 4508 // - If key is other than escape 4509 // - If key is not up or down => not a dropdown command 4510 // - If trigger inside the menu => not a dropdown command 4511 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 4512 return; 4513 } 4514 4515 event.preventDefault(); 4516 event.stopPropagation(); 4517 4518 if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) { 4519 return; 4520 } 4521 4522 var parent = Dropdown._getParentFromElement(this); 4523 4524 var isActive = $(parent).hasClass(ClassName$4.SHOW); 4525 4526 if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { 4527 if (event.which === ESCAPE_KEYCODE) { 4528 var toggle = parent.querySelector(Selector$4.DATA_TOGGLE); 4529 $(toggle).trigger('focus'); 4530 } 4531 4532 $(this).trigger('click'); 4533 return; 4534 } 4535 4536 var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)); 4537 4538 if (items.length === 0) { 4539 return; 4540 } 4541 4542 var index = items.indexOf(event.target); 4543 4544 if (event.which === ARROW_UP_KEYCODE && index > 0) { 4545 // Up 4546 index--; 4547 } 4548 4549 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 4550 // Down 4551 index++; 4552 } 4553 4554 if (index < 0) { 4555 index = 0; 4556 } 4557 4558 items[index].focus(); 4559 }; 4560 4561 _createClass(Dropdown, null, [{ 4562 key: "VERSION", 4563 get: function get() { 4564 return VERSION$4; 4565 } 4566 }, { 4567 key: "Default", 4568 get: function get() { 4569 return Default$2; 4570 } 4571 }, { 4572 key: "DefaultType", 4573 get: function get() { 4574 return DefaultType$2; 4575 } 4576 }]); 4577 4578 return Dropdown; 4579 }(); 4580 /** 4581 * ------------------------------------------------------------------------ 4582 * Data Api implementation 4583 * ------------------------------------------------------------------------ 4584 */ 4585 4586 4587 $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) { 4588 event.preventDefault(); 4589 event.stopPropagation(); 4590 4591 Dropdown._jQueryInterface.call($(this), 'toggle'); 4592 }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) { 4593 e.stopPropagation(); 4594 }); 4595 /** 4596 * ------------------------------------------------------------------------ 4597 * jQuery 4598 * ------------------------------------------------------------------------ 4599 */ 4600 4601 $.fn[NAME$4] = Dropdown._jQueryInterface; 4602 $.fn[NAME$4].Constructor = Dropdown; 4603 4604 $.fn[NAME$4].noConflict = function () { 4605 $.fn[NAME$4] = JQUERY_NO_CONFLICT$4; 4606 return Dropdown._jQueryInterface; 4607 }; 4608 4609 /** 4610 * ------------------------------------------------------------------------ 4611 * Constants 4612 * ------------------------------------------------------------------------ 4613 */ 4614 4615 var NAME$5 = 'modal'; 4616 var VERSION$5 = '4.3.1'; 4617 var DATA_KEY$5 = 'bs.modal'; 4618 var EVENT_KEY$5 = "." + DATA_KEY$5; 4619 var DATA_API_KEY$5 = '.data-api'; 4620 var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5]; 4621 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 4622 4623 var Default$3 = { 4624 backdrop: true, 4625 keyboard: true, 4626 focus: true, 4627 show: true 4628 }; 4629 var DefaultType$3 = { 4630 backdrop: '(boolean|string)', 4631 keyboard: 'boolean', 4632 focus: 'boolean', 4633 show: 'boolean' 4634 }; 4635 var Event$5 = { 4636 HIDE: "hide" + EVENT_KEY$5, 4637 HIDDEN: "hidden" + EVENT_KEY$5, 4638 SHOW: "show" + EVENT_KEY$5, 4639 SHOWN: "shown" + EVENT_KEY$5, 4640 FOCUSIN: "focusin" + EVENT_KEY$5, 4641 RESIZE: "resize" + EVENT_KEY$5, 4642 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5, 4643 KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5, 4644 MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5, 4645 MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5, 4646 CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5 4647 }; 4648 var ClassName$5 = {
4649 SCROLLABLE: 'modal-dialog-scrollable', 4650 SCROLLBAR_MEASURER: 'modal-scrollbar-measure', 4651 BACKDROP: 'modal-backdrop', 4652 OPEN: 'modal-open', 4653 FADE: 'fade', 4654 SHOW: 'show' 4655 }; 4656 var Selector$5 = { 4657 DIALOG: '.modal-dialog', 4658 MODAL_BODY: '.modal-body', 4659 DATA_TOGGLE: '[data-toggle="modal"]', 4660 DATA_DISMISS: '[data-dismiss="modal"]', 4661 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', 4662 STICKY_CONTENT: '.sticky-top' 4663 /** 4664 * ------------------------------------------------------------------------ 4665 * Class Definition 4666 * ------------------------------------------------------------------------ 4667 */ 4668 4669 }; 4670 4671 var Modal = 4672 /*#__PURE__*/ 4673 function () { 4674 function Modal(element, config) { 4675 this._config = this._getConfig(config); 4676 this._element = element; 4677 this._dialog = element.querySelector(Selector$5.DIALOG); 4678 this._backdrop = null; 4679 this._isShown = false; 4680 this._isBodyOverflowing = false; 4681 this._ignoreBackdropClick = false; 4682 this._isTransitioning = false; 4683 this._scrollbarWidth = 0; 4684 } // Getters 4685 4686 4687 var _proto = Modal.prototype; 4688 4689 // Public 4690 _proto.toggle = function toggle(relatedTarget) { 4691 return this._isShown ? this.hide() : this.show(relatedTarget); 4692 }; 4693 4694 _proto.show = function show(relatedTarget) { 4695 var _this = this; 4696 4697 if (this._isShown || this._isTransitioning) { 4698 return; 4699 } 4700 4701 if ($(this._element).hasClass(ClassName$5.FADE)) { 4702 this._isTransitioning = true; 4703 } 4704 4705 var showEvent = $.Event(Event$5.SHOW, { 4706 relatedTarget: relatedTarget 4707 }); 4708 $(this._element).trigger(showEvent); 4709 4710 if (this._isShown || showEvent.isDefaultPrevented()) { 4711 return; 4712 } 4713 4714 this._isShown = true; 4715 4716 this._checkScrollbar(); 4717 4718 this._setScrollbar(); 4719 4720 this._adjustDialog(); 4721 4722 this._setEscapeEvent(); 4723 4724 this._setResizeEvent(); 4725 4726 $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) { 4727 return _this.hide(event); 4728 }); 4729 $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () { 4730 $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) { 4731 if ($(event.target).is(_this._element)) { 4732 _this._ignoreBackdropClick = true; 4733 } 4734 }); 4735 }); 4736 4737 this._showBackdrop(function () { 4738 return _this._showElement(relatedTarget); 4739 }); 4740 }; 4741 4742 _proto.hide = function hide(event) { 4743 var _this2 = this; 4744 4745 if (event) { 4746 event.preventDefault(); 4747 } 4748 4749 if (!this._isShown || this._isTransitioning) { 4750 return; 4751 } 4752 4753 var hideEvent = $.Event(Event$5.HIDE); 4754 $(this._element).trigger(hideEvent); 4755 4756 if (!this._isShown || hideEvent.isDefaultPrevented()) { 4757 return; 4758 } 4759 4760 this._isShown = false; 4761 var transition = $(this._element).hasClass(ClassName$5.FADE); 4762 4763 if (transition) { 4764 this._isTransitioning = true; 4765 } 4766 4767 this._setEscapeEvent(); 4768 4769 this._setResizeEvent(); 4770 4771 $(document).off(Event$5.FOCUSIN); 4772 $(this._element).removeClass(ClassName$5.SHOW); 4773 $(this._element).off(Event$5.CLICK_DISMISS); 4774 $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS); 4775 4776 if (transition) { 4777 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4778 $(this._element).one(Util.TRANSITION_END, function (event) { 4779 return _this2._hideModal(event); 4780 }).emulateTransitionEnd(transitionDuration); 4781 } else { 4782 this._hideModal(); 4783 } 4784 }; 4785 4786 _proto.dispose = function dispose() { 4787 [window, this._element, this._dialog].forEach(function (htmlElement) { 4788 return $(htmlElement).off(EVENT_KEY$5); 4789 }); 4790 /** 4791 * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API` 4792 * Do not move `document` in `htmlElements` array 4793 * It will remove `Event.CLICK_DATA_API` event that should remain 4794 */ 4795 4796 $(document).off(Event$5.FOCUSIN); 4797 $.removeData(this._element, DATA_KEY$5); 4798 this._config = null; 4799 this._element = null; 4800 this._dialog = null; 4801 this._backdrop = null; 4802 this._isShown = null; 4803 this._isBodyOverflowing = null; 4804 this._ignoreBackdropClick = null; 4805 this._isTransitioning = null; 4806 this._scrollbarWidth = null; 4807 }; 4808 4809 _proto.handleUpdate = function handleUpdate() { 4810 this._adjustDialog(); 4811 } // Private 4812 ; 4813 4814 _proto._getConfig = function _getConfig(config) { 4815 config = _objectSpread({}, Default$3, config); 4816 Util.typeCheckConfig(NAME$5, config, DefaultType$3); 4817 return config; 4818 }; 4819 4820 _proto._showElement = function _showElement(relatedTarget) { 4821 var _this3 = this; 4822 4823 var transition = $(this._element).hasClass(ClassName$5.FADE); 4824 4825 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 4826 // Don't move modal's DOM position 4827 document.body.appendChild(this._element); 4828 } 4829 4830 this._element.style.display = 'block'; 4831 4832 this._element.removeAttribute('aria-hidden'); 4833 4834 this._element.setAttribute('aria-modal', true); 4835 4836 if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) { 4837 this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0; 4838 } else { 4839 this._element.scrollTop = 0; 4840 } 4841 4842 if (transition) { 4843 Util.reflow(this._element); 4844 } 4845 4846 $(this._element).addClass(ClassName$5.SHOW); 4847 4848 if (this._config.focus) { 4849 this._enforceFocus(); 4850 } 4851 4852 var shownEvent = $.Event(Event$5.SHOWN, { 4853 relatedTarget: relatedTarget 4854 }); 4855 4856 var transitionComplete = function transitionComplete() { 4857 if (_this3._config.focus) { 4858 _this3._element.focus(); 4859 } 4860 4861 _this3._isTransitioning = false;
4862 $(_this3._element).trigger(shownEvent); 4863 }; 4864 4865 if (transition) { 4866 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 4867 $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 4868 } else { 4869 transitionComplete(); 4870 } 4871 }; 4872 4873 _proto._enforceFocus = function _enforceFocus() { 4874 var _this4 = this; 4875 4876 $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop 4877 .on(Event$5.FOCUSIN, function (event) { 4878 if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) { 4879 _this4._element.focus(); 4880 } 4881 }); 4882 }; 4883 4884 _proto._setEscapeEvent = function _setEscapeEvent() { 4885 var _this5 = this; 4886 4887 if (this._isShown && this._config.keyboard) { 4888 $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) { 4889 if (event.which === ESCAPE_KEYCODE$1) { 4890 event.preventDefault(); 4891 4892 _this5.hide(); 4893 } 4894 }); 4895 } else if (!this._isShown) { 4896 $(this._element).off(Event$5.KEYDOWN_DISMISS); 4897 } 4898 }; 4899 4900 _proto._setResizeEvent = function _setResizeEvent() { 4901 var _this6 = this; 4902 4903 if (this._isShown) { 4904 $(window).on(Event$5.RESIZE, function (event) { 4905 return _this6.handleUpdate(event); 4906 }); 4907 } else { 4908 $(window).off(Event$5.RESIZE); 4909 } 4910 }; 4911 4912 _proto._hideModal = function _hideModal() { 4913 var _this7 = this; 4914 4915 this._element.style.display = 'none'; 4916 4917 this._element.setAttribute('aria-hidden', true); 4918 4919 this._element.removeAttribute('aria-modal'); 4920 4921 this._isTransitioning = false; 4922 4923 this._showBackdrop(function () { 4924 $(document.body).removeClass(ClassName$5.OPEN); 4925 4926 _this7._resetAdjustments(); 4927 4928 _this7._resetScrollbar(); 4929 4930 $(_this7._element).trigger(Event$5.HIDDEN); 4931 }); 4932 }; 4933 4934 _proto._removeBackdrop = function _removeBackdrop() { 4935 if (this._backdrop) { 4936 $(this._backdrop).remove(); 4937 this._backdrop = null; 4938 } 4939 }; 4940 4941 _proto._showBackdrop = function _showBackdrop(callback) { 4942 var _this8 = this; 4943 4944 var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : ''; 4945 4946 if (this._isShown && this._config.backdrop) { 4947 this._backdrop = document.createElement('div'); 4948 this._backdrop.className = ClassName$5.BACKDROP; 4949 4950 if (animate) { 4951 this._backdrop.classList.add(animate); 4952 } 4953 4954 $(this._backdrop).appendTo(document.body); 4955 $(this._element).on(Event$5.CLICK_DISMISS, function (event) { 4956 if (_this8._ignoreBackdropClick) { 4957 _this8._ignoreBackdropClick = false; 4958 return; 4959 } 4960 4961 if (event.target !== event.currentTarget) { 4962 return; 4963 } 4964 4965 if (_this8._config.backdrop === 'static') { 4966 _this8._element.focus(); 4967 } else { 4968 _this8.hide(); 4969 } 4970 }); 4971 4972 if (animate) { 4973 Util.reflow(this._backdrop); 4974 } 4975 4976 $(this._backdrop).addClass(ClassName$5.SHOW); 4977 4978 if (!callback) { 4979 return; 4980 } 4981 4982 if (!animate) { 4983 callback(); 4984 return; 4985 } 4986 4987 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 4988 $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 4989 } else if (!this._isShown && this._backdrop) { 4990 $(this._backdrop).removeClass(ClassName$5.SHOW); 4991 4992 var callbackRemove = function callbackRemove() { 4993 _this8._removeBackdrop(); 4994 4995 if (callback) { 4996 callback(); 4997 } 4998 }; 4999 5000 if ($(this._element).hasClass(ClassName$5.FADE)) { 5001 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 5002 5003 $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 5004 } else { 5005 callbackRemove(); 5006 } 5007 } else if (callback) { 5008 callback(); 5009 } 5010 } // ---------------------------------------------------------------------- 5011 // the following methods are used to handle overflowing modals 5012 // todo (fat): these should probably be refactored out of modal.js 5013 // ---------------------------------------------------------------------- 5014 ; 5015
5016 _proto._adjustDialog = function _adjustDialog() { 5017 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 5018 5019 if (!this._isBodyOverflowing && isModalOverflowing) { 5020 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 5021 } 5022 5023 if (this._isBodyOverflowing && !isModalOverflowing) { 5024 this._element.style.paddingRight = this._scrollbarWidth + "px"; 5025 } 5026 }; 5027 5028 _proto._resetAdjustments = function _resetAdjustments() { 5029 this._element.style.paddingLeft = ''; 5030 this._element.style.paddingRight = ''; 5031 }; 5032 5033 _proto._checkScrollbar = function _checkScrollbar() { 5034 var rect = document.body.getBoundingClientRect(); 5035 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; 5036 this._scrollbarWidth = this._getScrollbarWidth(); 5037 }; 5038 5039 _proto._setScrollbar = function _setScrollbar() { 5040 var _this9 = this; 5041 5042 if (this._isBodyOverflowing) { 5043 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 5044 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 5045 var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); 5046 var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding 5047 5048 $(fixedContent).each(function (index, element) { 5049 var actualPadding = element.style.paddingRight; 5050 var calculatedPadding = $(element).css('padding-right'); 5051 $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"); 5052 }); // Adjust sticky content margin 5053 5054 $(stickyContent).each(function (index, element) { 5055 var actualMargin = element.style.marginRight; 5056 var calculatedMargin = $(element).css('margin-right'); 5057 $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"); 5058 }); // Adjust body padding 5059 5060 var actualPadding = document.body.style.paddingRight; 5061 var calculatedPadding = $(document.body).css('padding-right'); 5062 $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 5063 } 5064 5065 $(document.body).addClass(ClassName$5.OPEN); 5066 }; 5067 5068 _proto._resetScrollbar = function _resetScrollbar() { 5069 // Restore fixed content padding 5070 var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); 5071 $(fixedContent).each(function (index, element) { 5072 var padding = $(element).data('padding-right'); 5073 $(element).removeData('padding-right'); 5074 element.style.paddingRight = padding ? padding : ''; 5075 }); // Restore sticky content 5076 5077 var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT)); 5078 $(elements).each(function (index, element) { 5079 var margin = $(element).data('margin-right'); 5080 5081 if (typeof margin !== 'undefined') { 5082 $(element).css('margin-right', margin).removeData('margin-right'); 5083 } 5084 }); // Restore body padding 5085 5086 var padding = $(document.body).data('padding-right'); 5087 $(document.body).removeData('padding-right'); 5088 document.body.style.paddingRight = padding ? padding : ''; 5089 }; 5090 5091 _proto._getScrollbarWidth = function _getScrollbarWidth() { 5092 // thx d.walsh 5093 var scrollDiv = document.createElement('div'); 5094 scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER; 5095 document.body.appendChild(scrollDiv); 5096 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 5097 document.body.removeChild(scrollDiv); 5098 return scrollbarWidth; 5099 } // Static 5100 ; 5101 5102 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 5103 return this.each(function () { 5104 var data = $(this).data(DATA_KEY$5); 5105 5106 var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {}); 5107 5108 if (!data) { 5109 data = new Modal(this, _config); 5110 $(this).data(DATA_KEY$5, data); 5111 } 5112 5113 if (typeof config === 'string') { 5114 if (typeof data[config] === 'undefined') {
5115 throw new TypeError("No method named \"" + config + "\""); 5116 } 5117 5118 data[config](relatedTarget); 5119 } else if (_config.show) { 5120 data.show(relatedTarget); 5121 } 5122 }); 5123 }; 5124 5125 _createClass(Modal, null, [{ 5126 key: "VERSION", 5127 get: function get() { 5128 return VERSION$5; 5129 } 5130 }, { 5131 key: "Default", 5132 get: function get() { 5133 return Default$3; 5134 } 5135 }]); 5136 5137 return Modal; 5138 }(); 5139 /** 5140 * ------------------------------------------------------------------------ 5141 * Data Api implementation 5142 * ------------------------------------------------------------------------ 5143 */ 5144 5145 5146 $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) { 5147 var _this10 = this; 5148 5149 var target; 5150 var selector = Util.getSelectorFromElement(this); 5151 5152 if (selector) { 5153 target = document.querySelector(selector); 5154 } 5155 5156 var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data()); 5157 5158 if (this.tagName === 'A' || this.tagName === 'AREA') { 5159 event.preventDefault(); 5160 } 5161 5162 var $target = $(target).one(Event$5.SHOW, function (showEvent) { 5163 if (showEvent.isDefaultPrevented()) { 5164 // Only register focus restorer if modal will actually get shown 5165 return; 5166 } 5167 5168 $target.one(Event$5.HIDDEN, function () { 5169 if ($(_this10).is(':visible')) { 5170 _this10.focus(); 5171 } 5172 }); 5173 }); 5174 5175 Modal._jQueryInterface.call($(target), config, this); 5176 }); 5177 /** 5178 * ------------------------------------------------------------------------ 5179 * jQuery 5180 * ------------------------------------------------------------------------ 5181 */ 5182 5183 $.fn[NAME$5] = Modal._jQueryInterface; 5184 $.fn[NAME$5].Constructor = Modal; 5185 5186 $.fn[NAME$5].noConflict = function () { 5187 $.fn[NAME$5] = JQUERY_NO_CONFLICT$5; 5188 return Modal._jQueryInterface; 5189 }; 5190 5191 /** 5192 * -------------------------------------------------------------------------- 5193 * Bootstrap (v4.3.1): tools/sanitizer.js 5194 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5195 * -------------------------------------------------------------------------- 5196 */ 5197 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 5198 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 5199 var DefaultWhitelist = { 5200 // Global attributes allowed on any supplied element below. 5201 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 5202 a: ['target', 'href', 'title', 'rel'], 5203 area: [], 5204 b: [], 5205 br: [], 5206 col: [], 5207 code: [], 5208 div: [], 5209 em: [], 5210 hr: [], 5211 h1: [], 5212 h2: [], 5213 h3: [], 5214 h4: [], 5215 h5: [], 5216 h6: [], 5217 i: [], 5218 img: ['src', 'alt', 'title', 'width', 'height'], 5219 li: [], 5220 ol: [], 5221 p: [], 5222 pre: [], 5223 s: [], 5224 small: [], 5225 span: [], 5226 sub: [], 5227 sup: [], 5228 strong: [], 5229 u: [], 5230 ul: [] 5231 /** 5232 * A pattern that recognizes a commonly useful subset of URLs that are safe. 5233 * 5234 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5235 */ 5236 5237 }; 5238 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; 5239 /** 5240 * A pattern that matches safe data URLs. Only matches image, video and audio types. 5241 * 5242 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5243 */ 5244 5245 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i; 5246 5247 function allowedAttribute(attr, allowedAttributeList) { 5248 var attrName = attr.nodeName.toLowerCase(); 5249 5250 if (allowedAttributeList.indexOf(attrName) !== -1) { 5251 if (uriAttrs.indexOf(attrName) !== -1) { 5252 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 5253 } 5254 5255 return true; 5256 } 5257 5258 var regExp = allowedAttributeList.filter(function (attrRegex) {
5259 return attrRegex instanceof RegExp; 5260 }); // Check if a regular expression validates the attribute. 5261 5262 for (var i = 0, l = regExp.length; i < l; i++) { 5263 if (attrName.match(regExp[i])) { 5264 return true; 5265 } 5266 } 5267 5268 return false; 5269 } 5270 5271 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 5272 if (unsafeHtml.length === 0) { 5273 return unsafeHtml; 5274 } 5275 5276 if (sanitizeFn && typeof sanitizeFn === 'function') { 5277 return sanitizeFn(unsafeHtml); 5278 } 5279 5280 var domParser = new window.DOMParser(); 5281 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 5282 var whitelistKeys = Object.keys(whiteList); 5283 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 5284 5285 var _loop = function _loop(i, len) { 5286 var el = elements[i]; 5287 var elName = el.nodeName.toLowerCase(); 5288 5289 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 5290 el.parentNode.removeChild(el); 5291 return "continue"; 5292 } 5293 5294 var attributeList = [].slice.call(el.attributes); 5295 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 5296 attributeList.forEach(function (attr) { 5297 if (!allowedAttribute(attr, whitelistedAttributes)) { 5298 el.removeAttribute(attr.nodeName); 5299 } 5300 }); 5301 }; 5302 5303 for (var i = 0, len = elements.length; i < len; i++) { 5304 var _ret = _loop(i, len); 5305 5306 if (_ret === "continue") continue; 5307 } 5308 5309 return createdDocument.body.innerHTML; 5310 } 5311 5312 /** 5313 * ------------------------------------------------------------------------ 5314 * Constants 5315 * ------------------------------------------------------------------------ 5316 */ 5317 5318 var NAME$6 = 'tooltip'; 5319 var VERSION$6 = '4.3.1'; 5320 var DATA_KEY$6 = 'bs.tooltip'; 5321 var EVENT_KEY$6 = "." + DATA_KEY$6; 5322 var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6]; 5323 var CLASS_PREFIX = 'bs-tooltip'; 5324 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 5325 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 5326 var DefaultType$4 = { 5327 animation: 'boolean', 5328 template: 'string', 5329 title: '(string|element|function)', 5330 trigger: 'string', 5331 delay: '(number|object)', 5332 html: 'boolean', 5333 selector: '(string|boolean)', 5334 placement: '(string|function)', 5335 offset: '(number|string|function)', 5336 container: '(string|element|boolean)', 5337 fallbackPlacement: '(string|array)', 5338 boundary: '(string|element)', 5339 sanitize: 'boolean', 5340 sanitizeFn: '(null|function)', 5341 whiteList: 'object' 5342 }; 5343 var AttachmentMap$1 = { 5344 AUTO: 'auto', 5345 TOP: 'top', 5346 RIGHT: 'right', 5347 BOTTOM: 'bottom', 5348 LEFT: 'left' 5349 }; 5350 var Default$4 = { 5351 animation: true, 5352 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 5353 trigger: 'hover focus', 5354 title: '', 5355 delay: 0, 5356 html: false, 5357 selector: false, 5358 placement: 'top', 5359 offset: 0, 5360 container: false, 5361 fallbackPlacement: 'flip', 5362 boundary: 'scrollParent', 5363 sanitize: true, 5364 sanitizeFn: null, 5365 whiteList: DefaultWhitelist 5366 }; 5367 var HoverState = { 5368 SHOW: 'show', 5369 OUT: 'out' 5370 }; 5371 var Event$6 = { 5372 HIDE: "hide" + EVENT_KEY$6, 5373 HIDDEN: "hidden" + EVENT_KEY$6, 5374 SHOW: "show" + EVENT_KEY$6, 5375 SHOWN: "shown" + EVENT_KEY$6, 5376 INSERTED: "inserted" + EVENT_KEY$6, 5377 CLICK: "click" + EVENT_KEY$6, 5378 FOCUSIN: "focusin" + EVENT_KEY$6, 5379 FOCUSOUT: "focusout" + EVENT_KEY$6, 5380 MOUSEENTER: "mouseenter" + EVENT_KEY$6, 5381 MOUSELEAVE: "mouseleave" + EVENT_KEY$6 5382 }; 5383 var ClassName$6 = { 5384 FADE: 'fade', 5385 SHOW: 'show' 5386 }; 5387 var Selector$6 = { 5388 TOOLTIP: '.tooltip', 5389 TOOLTIP_INNER: '.tooltip-inner', 5390 ARROW: '.arrow' 5391 }; 5392 var Trigger = { 5393 HOVER: 'hover', 5394 FOCUS: 'focus', 5395 CLICK: 'click', 5396 MANUAL: 'manual' 5397 /** 5398 * ------------------------------------------------------------------------ 5399 * Class Definition 5400 * ------------------------------------------------------------------------ 5401 */ 5402 5403 }; 5404 5405 var Tooltip = 5406 /*#__PURE__*/ 5407 function () { 5408 function Tooltip(element, config) { 5409 /** 5410 * Check for Popper dependency 5411 * Popper - https://popper.js.org 5412 */ 5413 if (typeof Popper === 'undefined') { 5414 throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); 5415 } // private 5416 5417 5418 this._isEnabled = true; 5419 this._timeout = 0; 5420 this._hoverState = ''; 5421 this._activeTrigger = {}; 5422 this._popper = null; // Protected 5423 5424 this.element = element; 5425 this.config = this._getConfig(config); 5426 this.tip = null; 5427 5428 this._setListeners(); 5429 } // Getters 5430 5431 5432 var _proto = Tooltip.prototype; 5433 5434 // Public 5435 _proto.enable = function enable() { 5436 this._isEnabled = true; 5437 }; 5438 5439 _proto.disable = function disable() { 5440 this._isEnabled = false;
5441 }; 5442 5443 _proto.toggleEnabled = function toggleEnabled() { 5444 this._isEnabled = !this._isEnabled; 5445 }; 5446 5447 _proto.toggle = function toggle(event) { 5448 if (!this._isEnabled) { 5449 return; 5450 } 5451 5452 if (event) { 5453 var dataKey = this.constructor.DATA_KEY; 5454 var context = $(event.currentTarget).data(dataKey); 5455 5456 if (!context) { 5457 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5458 $(event.currentTarget).data(dataKey, context); 5459 } 5460 5461 context._activeTrigger.click = !context._activeTrigger.click; 5462 5463 if (context._isWithActiveTrigger()) { 5464 context._enter(null, context); 5465 } else { 5466 context._leave(null, context); 5467 } 5468 } else { 5469 if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) { 5470 this._leave(null, this); 5471 5472 return; 5473 } 5474 5475 this._enter(null, this); 5476 } 5477 }; 5478 5479 _proto.dispose = function dispose() { 5480 clearTimeout(this._timeout); 5481 $.removeData(this.element, this.constructor.DATA_KEY); 5482 $(this.element).off(this.constructor.EVENT_KEY); 5483 $(this.element).closest('.modal').off('hide.bs.modal'); 5484 5485 if (this.tip) { 5486 $(this.tip).remove(); 5487 } 5488 5489 this._isEnabled = null; 5490 this._timeout = null; 5491 this._hoverState = null; 5492 this._activeTrigger = null; 5493 5494 if (this._popper !== null) { 5495 this._popper.destroy(); 5496 } 5497 5498 this._popper = null; 5499 this.element = null; 5500 this.config = null; 5501 this.tip = null; 5502 }; 5503 5504 _proto.show = function show() { 5505 var _this = this; 5506 5507 if ($(this.element).css('display') === 'none') { 5508 throw new Error('Please use show on visible elements'); 5509 } 5510 5511 var showEvent = $.Event(this.constructor.Event.SHOW); 5512 5513 if (this.isWithContent() && this._isEnabled) { 5514 $(this.element).trigger(showEvent); 5515 var shadowRoot = Util.findShadowRoot(this.element); 5516 var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 5517 5518 if (showEvent.isDefaultPrevented() || !isInTheDom) { 5519 return; 5520 } 5521 5522 var tip = this.getTipElement(); 5523 var tipId = Util.getUID(this.constructor.NAME);
5524 tip.setAttribute('id', tipId); 5525 this.element.setAttribute('aria-describedby', tipId); 5526 this.setContent(); 5527 5528 if (this.config.animation) { 5529 $(tip).addClass(ClassName$6.FADE); 5530 } 5531 5532 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 5533 5534 var attachment = this._getAttachment(placement); 5535 5536 this.addAttachmentClass(attachment); 5537 5538 var container = this._getContainer(); 5539 5540 $(tip).data(this.constructor.DATA_KEY, this); 5541 5542 if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { 5543 $(tip).appendTo(container); 5544 } 5545 5546 $(this.element).trigger(this.constructor.Event.INSERTED); 5547 this._popper = new Popper(this.element, tip, { 5548 placement: attachment, 5549 modifiers: { 5550 offset: this._getOffset(), 5551 flip: { 5552 behavior: this.config.fallbackPlacement 5553 }, 5554 arrow: { 5555 element: Selector$6.ARROW 5556 }, 5557 preventOverflow: { 5558 boundariesElement: this.config.boundary 5559 } 5560 }, 5561 onCreate: function onCreate(data) { 5562 if (data.originalPlacement !== data.placement) { 5563 _this._handlePopperPlacementChange(data); 5564 } 5565 }, 5566 onUpdate: function onUpdate(data) { 5567 return _this._handlePopperPlacementChange(data); 5568 } 5569 }); 5570 $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra 5571 // empty mouseover listeners to the body's immediate children; 5572 // only needed because of broken event delegation on iOS 5573 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 5574 5575 if ('ontouchstart' in document.documentElement) { 5576 $(document.body).children().on('mouseover', null, $.noop); 5577 } 5578 5579 var complete = function complete() { 5580 if (_this.config.animation) { 5581 _this._fixTransition(); 5582 } 5583 5584 var prevHoverState = _this._hoverState; 5585 _this._hoverState = null; 5586 $(_this.element).trigger(_this.constructor.Event.SHOWN); 5587 5588 if (prevHoverState === HoverState.OUT) { 5589 _this._leave(null, _this); 5590 } 5591 }; 5592 5593 if ($(this.tip).hasClass(ClassName$6.FADE)) { 5594 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 5595 $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5596 } else { 5597 complete(); 5598 } 5599 } 5600 }; 5601 5602 _proto.hide = function hide(callback) { 5603 var _this2 = this; 5604 5605 var tip = this.getTipElement(); 5606 var hideEvent = $.Event(this.constructor.Event.HIDE); 5607 5608 var complete = function complete() { 5609 if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { 5610 tip.parentNode.removeChild(tip); 5611 } 5612 5613 _this2._cleanTipClass(); 5614 5615 _this2.element.removeAttribute('aria-describedby'); 5616 5617 $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); 5618 5619 if (_this2._popper !== null) { 5620 _this2._popper.destroy(); 5621 } 5622 5623 if (callback) { 5624 callback(); 5625 } 5626 }; 5627 5628 $(this.element).trigger(hideEvent); 5629 5630 if (hideEvent.isDefaultPrevented()) { 5631 return; 5632 } 5633 5634 $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra 5635 // empty mouseover listeners we added for iOS support 5636 5637 if ('ontouchstart' in document.documentElement) { 5638 $(document.body).children().off('mouseover', null, $.noop); 5639 } 5640 5641 this._activeTrigger[Trigger.CLICK] = false;
5642 this._activeTrigger[Trigger.FOCUS] = false; 5643 this._activeTrigger[Trigger.HOVER] = false; 5644 5645 if ($(this.tip).hasClass(ClassName$6.FADE)) { 5646 var transitionDuration = Util.getTransitionDurationFromElement(tip); 5647 $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5648 } else { 5649 complete(); 5650 } 5651 5652 this._hoverState = ''; 5653 }; 5654 5655 _proto.update = function update() { 5656 if (this._popper !== null) { 5657 this._popper.scheduleUpdate(); 5658 } 5659 } // Protected 5660 ; 5661 5662 _proto.isWithContent = function isWithContent() { 5663 return Boolean(this.getTitle()); 5664 }; 5665 5666 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 5667 $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 5668 }; 5669 5670 _proto.getTipElement = function getTipElement() { 5671 this.tip = this.tip || $(this.config.template)[0]; 5672 return this.tip; 5673 }; 5674 5675 _proto.setContent = function setContent() { 5676 var tip = this.getTipElement(); 5677 this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle()); 5678 $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW); 5679 }; 5680 5681 _proto.setElementContent = function setElementContent($element, content) { 5682 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 5683 // Content is a DOM node or a jQuery 5684 if (this.config.html) { 5685 if (!$(content).parent().is($element)) { 5686 $element.empty().append(content); 5687 } 5688 } else { 5689 $element.text($(content).text()); 5690 } 5691 5692 return; 5693 } 5694 5695 if (this.config.html) { 5696 if (this.config.sanitize) { 5697 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 5698 } 5699 5700 $element.html(content); 5701 } else { 5702 $element.text(content); 5703 } 5704 }; 5705 5706 _proto.getTitle = function getTitle() { 5707 var title = this.element.getAttribute('data-original-title'); 5708 5709 if (!title) { 5710 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 5711 } 5712 5713 return title; 5714 } // Private 5715 ; 5716 5717 _proto._getOffset = function _getOffset() { 5718 var _this3 = this; 5719 5720 var offset = {}; 5721 5722 if (typeof this.config.offset === 'function') { 5723 offset.fn = function (data) { 5724 data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); 5725 return data; 5726 }; 5727 } else { 5728 offset.offset = this.config.offset; 5729 } 5730 5731 return offset; 5732 }; 5733 5734 _proto._getContainer = function _getContainer() { 5735 if (this.config.container === false) { 5736 return document.body; 5737 } 5738 5739 if (Util.isElement(this.config.container)) { 5740 return $(this.config.container); 5741 } 5742 5743 return $(document).find(this.config.container); 5744 }; 5745 5746 _proto._getAttachment = function _getAttachment(placement) { 5747 return AttachmentMap$1[placement.toUpperCase()]; 5748 }; 5749 5750 _proto._setListeners = function _setListeners() { 5751 var _this4 = this; 5752 5753 var triggers = this.config.trigger.split(' ');
5754 triggers.forEach(function (trigger) { 5755 if (trigger === 'click') { 5756 $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) { 5757 return _this4.toggle(event); 5758 }); 5759 } else if (trigger !== Trigger.MANUAL) { 5760 var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; 5761 var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; 5762 $(_this4.element).on(eventIn, _this4.config.selector, function (event) { 5763 return _this4._enter(event); 5764 }).on(eventOut, _this4.config.selector, function (event) { 5765 return _this4._leave(event); 5766 }); 5767 } 5768 }); 5769 $(this.element).closest('.modal').on('hide.bs.modal', function () { 5770 if (_this4.element) { 5771 _this4.hide(); 5772 } 5773 }); 5774 5775 if (this.config.selector) { 5776 this.config = _objectSpread({}, this.config, { 5777 trigger: 'manual', 5778 selector: '' 5779 }); 5780 } else { 5781 this._fixTitle(); 5782 } 5783 }; 5784 5785 _proto._fixTitle = function _fixTitle() { 5786 var titleType = typeof this.element.getAttribute('data-original-title'); 5787 5788 if (this.element.getAttribute('title') || titleType !== 'string') { 5789 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 5790 this.element.setAttribute('title', ''); 5791 } 5792 }; 5793 5794 _proto._enter = function _enter(event, context) { 5795 var dataKey = this.constructor.DATA_KEY; 5796 context = context || $(event.currentTarget).data(dataKey); 5797 5798 if (!context) { 5799 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5800 $(event.currentTarget).data(dataKey, context); 5801 } 5802 5803 if (event) { 5804 context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; 5805 } 5806 5807 if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) { 5808 context._hoverState = HoverState.SHOW; 5809 return; 5810 } 5811 5812 clearTimeout(context._timeout); 5813 context._hoverState = HoverState.SHOW; 5814 5815 if (!context.config.delay || !context.config.delay.show) { 5816 context.show(); 5817 return; 5818 } 5819 5820 context._timeout = setTimeout(function () { 5821 if (context._hoverState === HoverState.SHOW) { 5822 context.show(); 5823 } 5824 }, context.config.delay.show); 5825 }; 5826 5827 _proto._leave = function _leave(event, context) { 5828 var dataKey = this.constructor.DATA_KEY; 5829 context = context || $(event.currentTarget).data(dataKey); 5830 5831 if (!context) { 5832 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5833 $(event.currentTarget).data(dataKey, context); 5834 } 5835 5836 if (event) { 5837 context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; 5838 } 5839 5840 if (context._isWithActiveTrigger()) { 5841 return; 5842 } 5843 5844 clearTimeout(context._timeout); 5845 context._hoverState = HoverState.OUT; 5846 5847 if (!context.config.delay || !context.config.delay.hide) { 5848 context.hide(); 5849 return; 5850 } 5851 5852 context._timeout = setTimeout(function () { 5853 if (context._hoverState === HoverState.OUT) { 5854 context.hide(); 5855 } 5856 }, context.config.delay.hide); 5857 }; 5858 5859 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 5860 for (var trigger in this._activeTrigger) { 5861 if (this._activeTrigger[trigger]) { 5862 return true; 5863 } 5864 } 5865 5866 return false;
5867 }; 5868 5869 _proto._getConfig = function _getConfig(config) { 5870 var dataAttributes = $(this.element).data(); 5871 Object.keys(dataAttributes).forEach(function (dataAttr) { 5872 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 5873 delete dataAttributes[dataAttr]; 5874 } 5875 }); 5876 config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 5877 5878 if (typeof config.delay === 'number') { 5879 config.delay = { 5880 show: config.delay, 5881 hide: config.delay 5882 }; 5883 } 5884 5885 if (typeof config.title === 'number') { 5886 config.title = config.title.toString(); 5887 } 5888 5889 if (typeof config.content === 'number') { 5890 config.content = config.content.toString(); 5891 } 5892 5893 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 5894 5895 if (config.sanitize) { 5896 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 5897 } 5898 5899 return config; 5900 }; 5901 5902 _proto._getDelegateConfig = function _getDelegateConfig() { 5903 var config = {}; 5904 5905 if (this.config) { 5906 for (var key in this.config) { 5907 if (this.constructor.Default[key] !== this.config[key]) { 5908 config[key] = this.config[key]; 5909 } 5910 } 5911 } 5912 5913 return config; 5914 }; 5915 5916 _proto._cleanTipClass = function _cleanTipClass() { 5917 var $tip = $(this.getTipElement()); 5918 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 5919 5920 if (tabClass !== null && tabClass.length) { 5921 $tip.removeClass(tabClass.join('')); 5922 } 5923 }; 5924 5925 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 5926 var popperInstance = popperData.instance; 5927 this.tip = popperInstance.popper; 5928 5929 this._cleanTipClass(); 5930 5931 this.addAttachmentClass(this._getAttachment(popperData.placement)); 5932 }; 5933 5934 _proto._fixTransition = function _fixTransition() { 5935 var tip = this.getTipElement(); 5936 var initConfigAnimation = this.config.animation; 5937 5938 if (tip.getAttribute('x-placement') !== null) { 5939 return; 5940 } 5941 5942 $(tip).removeClass(ClassName$6.FADE); 5943 this.config.animation = false; 5944 this.hide(); 5945 this.show(); 5946 this.config.animation = initConfigAnimation; 5947 } // Static 5948 ; 5949 5950 Tooltip._jQueryInterface = function _jQueryInterface(config) { 5951 return this.each(function () { 5952 var data = $(this).data(DATA_KEY$6); 5953 5954 var _config = typeof config === 'object' && config; 5955 5956 if (!data && /dispose|hide/.test(config)) { 5957 return; 5958 } 5959 5960 if (!data) { 5961 data = new Tooltip(this, _config); 5962 $(this).data(DATA_KEY$6, data); 5963 } 5964 5965 if (typeof config === 'string') { 5966 if (typeof data[config] === 'undefined') { 5967 throw new TypeError("No method named \"" + config + "\""); 5968 } 5969 5970 data[config](); 5971 } 5972 }); 5973 }; 5974 5975 _createClass(Tooltip, null, [{ 5976 key: "VERSION", 5977 get: function get() { 5978 return VERSION$6; 5979 } 5980 }, { 5981 key: "Default", 5982 get: function get() { 5983 return Default$4; 5984 } 5985 }, { 5986 key: "NAME", 5987 get: function get() { 5988 return NAME$6; 5989 } 5990 }, { 5991 key: "DATA_KEY", 5992 get: function get() { 5993 return DATA_KEY$6; 5994 } 5995 }, { 5996 key: "Event", 5997 get: function get() { 5998 return Event$6; 5999 } 6000 }, { 6001 key: "EVENT_KEY", 6002 get: function get() { 6003 return EVENT_KEY$6; 6004 } 6005 }, { 6006 key: "DefaultType", 6007 get: function get() { 6008 return DefaultType$4; 6009 } 6010 }]); 6011 6012 return Tooltip; 6013 }(); 6014 /** 6015 * ------------------------------------------------------------------------ 6016 * jQuery 6017 * ------------------------------------------------------------------------ 6018 */ 6019 6020 6021 $.fn[NAME$6] = Tooltip._jQueryInterface; 6022 $.fn[NAME$6].Constructor = Tooltip; 6023 6024 $.fn[NAME$6].noConflict = function () { 6025 $.fn[NAME$6] = JQUERY_NO_CONFLICT$6; 6026 return Tooltip._jQueryInterface; 6027 }; 6028 6029 /** 6030 * ------------------------------------------------------------------------ 6031 * Constants 6032 * ------------------------------------------------------------------------ 6033 */ 6034 6035 var NAME$7 = 'popover'; 6036 var VERSION$7 = '4.3.1'; 6037 var DATA_KEY$7 = 'bs.popover'; 6038 var EVENT_KEY$7 = "." + DATA_KEY$7; 6039 var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
6040 var CLASS_PREFIX$1 = 'bs-popover'; 6041 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 6042 6043 var Default$5 = _objectSpread({}, Tooltip.Default, { 6044 placement: 'right', 6045 trigger: 'click', 6046 content: '', 6047 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 6048 }); 6049 6050 var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, { 6051 content: '(string|element|function)' 6052 }); 6053 6054 var ClassName$7 = { 6055 FADE: 'fade', 6056 SHOW: 'show' 6057 }; 6058 var Selector$7 = { 6059 TITLE: '.popover-header', 6060 CONTENT: '.popover-body' 6061 }; 6062 var Event$7 = { 6063 HIDE: "hide" + EVENT_KEY$7, 6064 HIDDEN: "hidden" + EVENT_KEY$7, 6065 SHOW: "show" + EVENT_KEY$7, 6066 SHOWN: "shown" + EVENT_KEY$7, 6067 INSERTED: "inserted" + EVENT_KEY$7, 6068 CLICK: "click" + EVENT_KEY$7, 6069 FOCUSIN: "focusin" + EVENT_KEY$7, 6070 FOCUSOUT: "focusout" + EVENT_KEY$7, 6071 MOUSEENTER: "mouseenter" + EVENT_KEY$7, 6072 MOUSELEAVE: "mouseleave" + EVENT_KEY$7 6073 /** 6074 * ------------------------------------------------------------------------ 6075 * Class Definition 6076 * ------------------------------------------------------------------------ 6077 */ 6078 6079 }; 6080 6081 var Popover = 6082 /*#__PURE__*/ 6083 function (_Tooltip) { 6084 _inheritsLoose(Popover, _Tooltip); 6085 6086 function Popover() { 6087 return _Tooltip.apply(this, arguments) || this; 6088 } 6089 6090 var _proto = Popover.prototype; 6091 6092 // Overrides 6093 _proto.isWithContent = function isWithContent() { 6094 return this.getTitle() || this._getContent(); 6095 }; 6096 6097 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 6098 $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 6099 }; 6100 6101 _proto.getTipElement = function getTipElement() { 6102 this.tip = this.tip || $(this.config.template)[0]; 6103 return this.tip; 6104 }; 6105 6106 _proto.setContent = function setContent() { 6107 var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events 6108 6109 this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle()); 6110 6111 var content = this._getContent(); 6112 6113 if (typeof content === 'function') { 6114 content = content.call(this.element); 6115 } 6116 6117 this.setElementContent($tip.find(Selector$7.CONTENT), content); 6118 $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW); 6119 } // Private 6120 ; 6121 6122 _proto._getContent = function _getContent() { 6123 return this.element.getAttribute('data-content') || this.config.content; 6124 }; 6125 6126 _proto._cleanTipClass = function _cleanTipClass() { 6127 var $tip = $(this.getTipElement()); 6128 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 6129 6130 if (tabClass !== null && tabClass.length > 0) { 6131 $tip.removeClass(tabClass.join('')); 6132 } 6133 } // Static 6134 ; 6135 6136 Popover._jQueryInterface = function _jQueryInterface(config) { 6137 return this.each(function () { 6138 var data = $(this).data(DATA_KEY$7); 6139 6140 var _config = typeof config === 'object' ? config : null; 6141 6142 if (!data && /dispose|hide/.test(config)) { 6143 return; 6144 } 6145 6146 if (!data) { 6147 data = new Popover(this, _config); 6148 $(this).data(DATA_KEY$7, data); 6149 } 6150 6151 if (typeof config === 'string') { 6152 if (typeof data[config] === 'undefined') { 6153 throw new TypeError("No method named \"" + config + "\""); 6154 } 6155 6156 data[config](); 6157 } 6158 }); 6159 }; 6160 6161 _createClass(Popover, null, [{ 6162 key: "VERSION", 6163 // Getters 6164 get: function get() { 6165 return VERSION$7; 6166 } 6167 }, { 6168 key: "Default", 6169 get: function get() { 6170 return Default$5; 6171 } 6172 }, { 6173 key: "NAME", 6174 get: function get() { 6175 return NAME$7; 6176 } 6177 }, { 6178 key: "DATA_KEY", 6179 get: function get() { 6180 return DATA_KEY$7; 6181 } 6182 }, { 6183 key: "Event", 6184 get: function get() { 6185 return Event$7; 6186 } 6187 }, { 6188 key: "EVENT_KEY", 6189 get: function get() { 6190 return EVENT_KEY$7; 6191 } 6192 }, { 6193 key: "DefaultType", 6194 get: function get() { 6195 return DefaultType$5; 6196 } 6197 }]); 6198 6199 return Popover; 6200 }(Tooltip); 6201 /** 6202 * ------------------------------------------------------------------------ 6203 * jQuery 6204 * ------------------------------------------------------------------------ 6205 */ 6206 6207 6208 $.fn[NAME$7] = Popover._jQueryInterface; 6209 $.fn[NAME$7].Constructor = Popover; 6210 6211 $.fn[NAME$7].noConflict = function () { 6212 $.fn[NAME$7] = JQUERY_NO_CONFLICT$7; 6213 return Popover._jQueryInterface; 6214 }; 6215 6216 /** 6217 * ------------------------------------------------------------------------ 6218 * Constants 6219 * ------------------------------------------------------------------------ 6220 */ 6221 6222 var NAME$8 = 'scrollspy'; 6223 var VERSION$8 = '4.3.1'; 6224 var DATA_KEY$8 = 'bs.scrollspy'; 6225 var EVENT_KEY$8 = "." + DATA_KEY$8; 6226 var DATA_API_KEY$6 = '.data-api'; 6227 var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8]; 6228 var Default$6 = { 6229 offset: 10, 6230 method: 'auto', 6231 target: '' 6232 }; 6233 var DefaultType$6 = { 6234 offset: 'number', 6235 method: 'string', 6236 target: '(string|element)' 6237 }; 6238 var Event$8 = { 6239 ACTIVATE: "activate" + EVENT_KEY$8, 6240 SCROLL: "scroll" + EVENT_KEY$8, 6241 LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6 6242 }; 6243 var ClassName$8 = {
6244 DROPDOWN_ITEM: 'dropdown-item', 6245 DROPDOWN_MENU: 'dropdown-menu', 6246 ACTIVE: 'active' 6247 }; 6248 var Selector$8 = { 6249 DATA_SPY: '[data-spy="scroll"]', 6250 ACTIVE: '.active', 6251 NAV_LIST_GROUP: '.nav, .list-group', 6252 NAV_LINKS: '.nav-link', 6253 NAV_ITEMS: '.nav-item', 6254 LIST_ITEMS: '.list-group-item', 6255 DROPDOWN: '.dropdown', 6256 DROPDOWN_ITEMS: '.dropdown-item', 6257 DROPDOWN_TOGGLE: '.dropdown-toggle' 6258 }; 6259 var OffsetMethod = { 6260 OFFSET: 'offset', 6261 POSITION: 'position' 6262 /** 6263 * ------------------------------------------------------------------------ 6264 * Class Definition 6265 * ------------------------------------------------------------------------ 6266 */ 6267 6268 }; 6269 6270 var ScrollSpy = 6271 /*#__PURE__*/ 6272 function () { 6273 function ScrollSpy(element, config) { 6274 var _this = this; 6275 6276 this._element = element; 6277 this._scrollElement = element.tagName === 'BODY' ? window : element; 6278 this._config = this._getConfig(config); 6279 this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS); 6280 this._offsets = []; 6281 this._targets = []; 6282 this._activeTarget = null; 6283 this._scrollHeight = 0; 6284 $(this._scrollElement).on(Event$8.SCROLL, function (event) { 6285 return _this._process(event); 6286 }); 6287 this.refresh(); 6288 6289 this._process(); 6290 } // Getters 6291 6292 6293 var _proto = ScrollSpy.prototype; 6294 6295 // Public 6296 _proto.refresh = function refresh() { 6297 var _this2 = this; 6298 6299 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; 6300 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 6301 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; 6302 this._offsets = []; 6303 this._targets = []; 6304 this._scrollHeight = this._getScrollHeight(); 6305 var targets = [].slice.call(document.querySelectorAll(this._selector)); 6306 targets.map(function (element) { 6307 var target; 6308 var targetSelector = Util.getSelectorFromElement(element); 6309 6310 if (targetSelector) { 6311 target = document.querySelector(targetSelector); 6312 } 6313 6314 if (target) { 6315 var targetBCR = target.getBoundingClientRect(); 6316 6317 if (targetBCR.width || targetBCR.height) { 6318 // TODO (fat): remove sketch reliance on jQuery position/offset 6319 return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; 6320 } 6321 } 6322 6323 return null; 6324 }).filter(function (item) { 6325 return item; 6326 }).sort(function (a, b) { 6327 return a[0] - b[0]; 6328 }
6328).forEach(function (item) { 6329 _this2._offsets.push(item[0]); 6330 6331 _this2._targets.push(item[1]); 6332 }); 6333 }; 6334 6335 _proto.dispose = function dispose() { 6336 $.removeData(this._element, DATA_KEY$8); 6337 $(this._scrollElement).off(EVENT_KEY$8); 6338 this._element = null; 6339 this._scrollElement = null; 6340 this._config = null; 6341 this._selector = null; 6342 this._offsets = null; 6343 this._targets = null; 6344 this._activeTarget = null; 6345 this._scrollHeight = null; 6346 } // Private 6347 ; 6348 6349 _proto._getConfig = function _getConfig(config) { 6350 config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {}); 6351 6352 if (typeof config.target !== 'string') { 6353 var id = $(config.target).attr('id'); 6354 6355 if (!id) { 6356 id = Util.getUID(NAME$8); 6357 $(config.target).attr('id', id); 6358 } 6359 6360 config.target = "#" + id; 6361 } 6362 6363 Util.typeCheckConfig(NAME$8, config, DefaultType$6); 6364 return config; 6365 }; 6366 6367 _proto._getScrollTop = function _getScrollTop() { 6368 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 6369 }; 6370 6371 _proto._getScrollHeight = function _getScrollHeight() { 6372 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 6373 }; 6374 6375 _proto._getOffsetHeight = function _getOffsetHeight() { 6376 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 6377 }; 6378 6379 _proto._process = function _process() { 6380 var scrollTop = this._getScrollTop() + this._config.offset; 6381 6382 var scrollHeight = this._getScrollHeight(); 6383 6384 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 6385 6386 if (this._scrollHeight !== scrollHeight) { 6387 this.refresh(); 6388 } 6389 6390 if (scrollTop >= maxScroll) { 6391 var target = this._targets[this._targets.length - 1]; 6392 6393 if (this._activeTarget !== target) { 6394 this._activate(target); 6395 } 6396 6397 return; 6398 } 6399 6400 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 6401 this._activeTarget = null; 6402 6403 this._clear(); 6404 6405 return; 6406 } 6407 6408 var offsetLength = this._offsets.length; 6409 6410 for (var i = offsetLength; i--;) { 6411 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 6412 6413 if (isActiveTarget) { 6414 this._activate(this._targets[i]); 6415 } 6416 } 6417 }; 6418 6419 _proto._activate = function _activate(target) { 6420 this._activeTarget = target; 6421 6422 this._clear(); 6423 6424 var queries = this._selector.split(',').map(function (selector) { 6425 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 6426 }); 6427 6428 var $link = $([].slice.call(document.querySelectorAll(queries.join(',')))); 6429 6430 if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) { 6431 $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE); 6432 $link.addClass(ClassName$8.ACTIVE); 6433 } else { 6434 // Set triggered link as active 6435 $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
6436 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 6437 6438 $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item 6439 6440 $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE); 6441 } 6442 6443 $(this._scrollElement).trigger(Event$8.ACTIVATE, { 6444 relatedTarget: target 6445 }); 6446 }; 6447 6448 _proto._clear = function _clear() { 6449 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 6450 return node.classList.contains(ClassName$8.ACTIVE); 6451 }).forEach(function (node) { 6452 return node.classList.remove(ClassName$8.ACTIVE); 6453 }); 6454 } // Static 6455 ; 6456 6457 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 6458 return this.each(function () { 6459 var data = $(this).data(DATA_KEY$8); 6460 6461 var _config = typeof config === 'object' && config; 6462 6463 if (!data) { 6464 data = new ScrollSpy(this, _config); 6465 $(this).data(DATA_KEY$8, data); 6466 } 6467 6468 if (typeof config === 'string') { 6469 if (typeof data[config] === 'undefined') { 6470 throw new TypeError("No method named \"" + config + "\""); 6471 } 6472 6473 data[config](); 6474 } 6475 }); 6476 }; 6477 6478 _createClass(ScrollSpy, null, [{ 6479 key: "VERSION", 6480 get: function get() { 6481 return VERSION$8; 6482 } 6483 }, { 6484 key: "Default", 6485 get: function get() { 6486 return Default$6; 6487 } 6488 }]); 6489 6490 return ScrollSpy; 6491 }(); 6492 /** 6493 * ------------------------------------------------------------------------ 6494 * Data Api implementation 6495 * ------------------------------------------------------------------------ 6496 */ 6497 6498 6499 $(window).on(Event$8.LOAD_DATA_API, function () { 6500 var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY)); 6501 var scrollSpysLength = scrollSpys.length; 6502 6503 for (var i = scrollSpysLength; i--;) { 6504 var $spy = $(scrollSpys[i]); 6505 6506 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 6507 } 6508 }); 6509 /** 6510 * ------------------------------------------------------------------------ 6511 * jQuery 6512 * ------------------------------------------------------------------------ 6513 */ 6514 6515 $.fn[NAME$8] = ScrollSpy._jQueryInterface; 6516 $.fn[NAME$8].Constructor = ScrollSpy; 6517 6518 $.fn[NAME$8].noConflict = function () { 6519 $.fn[NAME$8] = JQUERY_NO_CONFLICT$8; 6520 return ScrollSpy._jQueryInterface; 6521 }; 6522 6523 /** 6524 * ------------------------------------------------------------------------ 6525 * Constants 6526 * ------------------------------------------------------------------------ 6527 */ 6528 6529 var NAME$9 = 'tab'; 6530 var VERSION$9 = '4.3.1'; 6531 var DATA_KEY$9 = 'bs.tab'; 6532 var EVENT_KEY$9 = "." + DATA_KEY$9; 6533 var DATA_API_KEY$7 = '.data-api'; 6534 var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9]; 6535 var Event$9 = { 6536 HIDE: "hide" + EVENT_KEY$9, 6537 HIDDEN: "hidden" + EVENT_KEY$9, 6538 SHOW: "show" + EVENT_KEY$9, 6539 SHOWN: "shown" + EVENT_KEY$9, 6540 CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7 6541 }; 6542 var ClassName$9 = { 6543 DROPDOWN_MENU: 'dropdown-menu', 6544 ACTIVE: 'active', 6545 DISABLED: 'disabled', 6546 FADE: 'fade', 6547 SHOW: 'show' 6548 }; 6549 var Selector$9 = { 6550 DROPDOWN: '.dropdown', 6551 NAV_LIST_GROUP: '.nav, .list-group', 6552 ACTIVE: '.active', 6553 ACTIVE_UL: '> li > .active', 6554 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', 6555 DROPDOWN_TOGGLE: '.dropdown-toggle', 6556 DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' 6557 /** 6558 * ------------------------------------------------------------------------ 6559 * Class Definition 6560 * ------------------------------------------------------------------------ 6561 */ 6562 6563 }; 6564 6565 var Tab = 6566 /*#__PURE__*/ 6567 function () { 6568 function Tab(element) { 6569 this._element = element; 6570 } // Getters 6571 6572 6573 var _proto = Tab.prototype; 6574 6575 // Public 6576 _proto.show = function show() { 6577 var _this = this; 6578 6579 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) { 6580 return; 6581 } 6582 6583 var target; 6584 var previous; 6585 var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0]; 6586 var selector = Util.getSelectorFromElement(this._element); 6587 6588 if (listElement) { 6589 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE; 6590 previous = $.makeArray($(listElement).find(itemSelector)); 6591 previous = previous[previous.length - 1]; 6592 } 6593 6594 var hideEvent = $.Event(Event$9.HIDE, { 6595 relatedTarget: this._element 6596 }); 6597 var showEvent = $.Event(Event$9.SHOW, { 6598 relatedTarget: previous 6599 }); 6600 6601 if (previous) { 6602 $(previous).trigger(hideEvent); 6603 } 6604 6605 $(this._element).trigger(showEvent); 6606 6607 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 6608 return; 6609 } 6610 6611 if (selector) { 6612 target = document.querySelector(selector); 6613 } 6614 6615 this._activate(this._element, listElement); 6616 6617 var complete = function complete() { 6618 var hiddenEvent = $.Event(Event$9.HIDDEN, { 6619 relatedTarget: _this._element 6620 }); 6621 var shownEvent = $.Event(Event$9.SHOWN, { 6622 relatedTarget: previous 6623 }); 6624 $(previous).trigger(hiddenEvent); 6625 $(_this._element).trigger(shownEvent); 6626 }; 6627 6628 if (target) { 6629 this._activate(target, target.parentNode, complete); 6630 } else { 6631 complete(); 6632 } 6633 }; 6634 6635 _proto.dispose = function dispose() { 6636 $.removeData(this._element, DATA_KEY$9); 6637 this._element = null; 6638 } // Private 6639 ; 6640 6641 _proto._activate = function _activate(element, container, callback) { 6642 var _this2 = this; 6643 6644 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE); 6645 var active = activeElements[0]; 6646 var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE); 6647 6648 var complete = function complete() { 6649 return _this2._transitionComplete(element, active, callback); 6650 }; 6651 6652 if (active && isTransitioning) { 6653 var transitionDuration = Util.getTransitionDurationFromElement(active); 6654 $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6655 } else { 6656 complete(); 6657 } 6658 }; 6659 6660 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 6661 if (active) { 6662 $(active).removeClass(ClassName$9.ACTIVE);
6663 var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0]; 6664 6665 if (dropdownChild) { 6666 $(dropdownChild).removeClass(ClassName$9.ACTIVE); 6667 } 6668 6669 if (active.getAttribute('role') === 'tab') { 6670 active.setAttribute('aria-selected', false); 6671 } 6672 } 6673 6674 $(element).addClass(ClassName$9.ACTIVE); 6675 6676 if (element.getAttribute('role') === 'tab') { 6677 element.setAttribute('aria-selected', true); 6678 } 6679 6680 Util.reflow(element); 6681 6682 if (element.classList.contains(ClassName$9.FADE)) { 6683 element.classList.add(ClassName$9.SHOW); 6684 } 6685 6686 if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) { 6687 var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0]; 6688 6689 if (dropdownElement) { 6690 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE)); 6691 $(dropdownToggleList).addClass(ClassName$9.ACTIVE); 6692 } 6693 6694 element.setAttribute('aria-expanded', true); 6695 } 6696 6697 if (callback) { 6698 callback(); 6699 } 6700 } // Static 6701 ; 6702 6703 Tab._jQueryInterface = function _jQueryInterface(config) { 6704 return this.each(function () { 6705 var $this = $(this); 6706 var data = $this.data(DATA_KEY$9); 6707 6708 if (!data) { 6709 data = new Tab(this); 6710 $this.data(DATA_KEY$9, data); 6711 } 6712 6713 if (typeof config === 'string') { 6714 if (typeof data[config] === 'undefined') { 6715 throw new TypeError("No method named \"" + config + "\""); 6716 } 6717 6718 data[config](); 6719 } 6720 }); 6721 }; 6722 6723 _createClass(Tab, null, [{ 6724 key: "VERSION", 6725 get: function get() { 6726 return VERSION$9; 6727 } 6728 }]); 6729 6730 return Tab; 6731 }(); 6732 /** 6733 * ------------------------------------------------------------------------ 6734 * Data Api implementation 6735 * ------------------------------------------------------------------------ 6736 */ 6737 6738 6739 $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) { 6740 event.preventDefault(); 6741 6742 Tab._jQueryInterface.call($(this), 'show'); 6743 }); 6744 /** 6745 * ------------------------------------------------------------------------ 6746 * jQuery 6747 * ------------------------------------------------------------------------ 6748 */ 6749 6750 $.fn[NAME$9] = Tab._jQueryInterface; 6751 $.fn[NAME$9].Constructor = Tab; 6752 6753 $.fn[NAME$9].noConflict = function () { 6754 $.fn[NAME$9] = JQUERY_NO_CONFLICT$9; 6755 return Tab._jQueryInterface; 6756 }; 6757 6758 /** 6759 * ------------------------------------------------------------------------ 6760 * Constants 6761 * ------------------------------------------------------------------------ 6762 */ 6763 6764 var NAME$a = 'toast'; 6765 var VERSION$a = '4.3.1'; 6766 var DATA_KEY$a = 'bs.toast'; 6767 var EVENT_KEY$a = "." + DATA_KEY$a; 6768 var JQUERY_NO_CONFLICT$a = $.fn[NAME$a]; 6769 var Event$a = { 6770 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a, 6771 HIDE: "hide" + EVENT_KEY$a, 6772 HIDDEN: "hidden" + EVENT_KEY$a, 6773 SHOW: "show" + EVENT_KEY$a, 6774 SHOWN: "shown" + EVENT_KEY$a 6775 }; 6776 var ClassName$a = { 6777 FADE: 'fade', 6778 HIDE: 'hide', 6779 SHOW: 'show', 6780 SHOWING: 'showing' 6781 }; 6782 var DefaultType$7 = { 6783 animation: 'boolean', 6784 autohide: 'boolean', 6785 delay: 'number' 6786 }; 6787 var Default$7 = { 6788 animation: true, 6789 autohide: true, 6790 delay: 500 6791 }; 6792 var Selector$a = { 6793 DATA_DISMISS: '[data-dismiss="toast"]' 6794 /** 6795 * ------------------------------------------------------------------------ 6796 * Class Definition 6797 * ------------------------------------------------------------------------ 6798 */ 6799 6800 }; 6801 6802 var Toast = 6803 /*#__PURE__*/ 6804 function () { 6805 function Toast(element, config) { 6806 this._element = element; 6807 this._config = this._getConfig(config); 6808 this._timeout = null; 6809 6810 this._setListeners(); 6811 } // Getters 6812 6813 6814 var _proto = Toast.prototype; 6815 6816 // Public 6817 _proto.show = function show() { 6818 var _this = this; 6819 6820 $(this._element).trigger(Event$a.SHOW); 6821 6822 if (this._config.animation) { 6823 this._element.classList.add(ClassName$a.FADE); 6824 } 6825 6826 var complete = function complete() { 6827 _this._element.classList.remove(ClassName$a.SHOWING); 6828 6829 _this._element.classList.add(ClassName$a.SHOW); 6830 6831 $(_this._element).trigger(Event$a.SHOWN); 6832 6833 if (_this._config.autohide) { 6834 _this.hide(); 6835 } 6836 }; 6837 6838 this._element.classList.remove(ClassName$a.HIDE); 6839 6840 this._element.classList.add(ClassName$a.SHOWING); 6841 6842 if (this._config.animation) { 6843 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6844 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6845 } else { 6846 complete(); 6847 } 6848 }; 6849 6850 _proto.hide = function hide(withoutTimeout) { 6851 var _this2 = this; 6852 6853 if (!this._element.classList.contains(ClassName$a.SHOW)) { 6854 return; 6855 } 6856 6857 $(this._element).trigger(Event$a.HIDE); 6858 6859 if (withoutTimeout) { 6860 this._close(); 6861 } else { 6862 this._timeout = setTimeout(function () { 6863 _this2._close(); 6864 }, this._config.delay); 6865 } 6866 }; 6867 6868 _proto.dispose = function dispose() { 6869 clearTimeout(this._timeout); 6870 this._timeout = null; 6871 6872 if (this._element.classList.contains(ClassName$a.SHOW)) { 6873 this._element.classList.remove(ClassName$a.SHOW); 6874 } 6875 6876 $(this._element).off(Event$a.CLICK_DISMISS); 6877 $.removeData(this._element, DATA_KEY$a); 6878 this._element = null; 6879 this._config = null; 6880 } // Private 6881 ; 6882 6883 _proto._getConfig = function _getConfig(config) { 6884 config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {}); 6885 Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType); 6886 return config; 6887 }; 6888 6889 _proto._setListeners = function _setListeners() { 6890 var _this3 = this; 6891 6892 $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () { 6893 return _this3.hide(true); 6894 }); 6895 }; 6896 6897 _proto._close = function _close() { 6898 var _this4 = this; 6899 6900 var complete = function complete() { 6901 _this4._element.classList.add(ClassName$a.HIDE); 6902 6903 $(_this4._element).trigger(Event$a.HIDDEN); 6904 }; 6905 6906 this._element.classList.remove(ClassName$a.SHOW); 6907 6908 if (this._config.animation) { 6909 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6910 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6911 } else { 6912 complete(); 6913 } 6914 } // Static 6915 ; 6916 6917 Toast._jQueryInterface = function _jQueryInterface(config) { 6918 return this.each(function () { 6919 var $element = $(this); 6920 var data = $element.data(DATA_KEY$a); 6921 6922 var _config = typeof config === 'object' && config; 6923 6924 if (!data) { 6925 data = new Toast(this, _config); 6926 $element.data(DATA_KEY$a, data); 6927 } 6928 6929 if (typeof config === 'string') { 6930 if (typeof data[config] === 'undefined') {
6931 throw new TypeError("No method named \"" + config + "\""); 6932 } 6933 6934 data[config](this); 6935 } 6936 }); 6937 }; 6938 6939 _createClass(Toast, null, [{ 6940 key: "VERSION", 6941 get: function get() { 6942 return VERSION$a; 6943 } 6944 }, { 6945 key: "DefaultType", 6946 get: function get() { 6947 return DefaultType$7; 6948 } 6949 }, { 6950 key: "Default", 6951 get: function get() { 6952 return Default$7; 6953 } 6954 }]); 6955 6956 return Toast; 6957 }(); 6958 /** 6959 * ------------------------------------------------------------------------ 6960 * jQuery 6961 * ------------------------------------------------------------------------ 6962 */ 6963 6964 6965 $.fn[NAME$a] = Toast._jQueryInterface; 6966 $.fn[NAME$a].Constructor = Toast; 6967 6968 $.fn[NAME$a].noConflict = function () { 6969 $.fn[NAME$a] = JQUERY_NO_CONFLICT$a; 6970 return Toast._jQueryInterface; 6971 }; 6972 6973 /** 6974 * -------------------------------------------------------------------------- 6975 * Bootstrap (v4.3.1): index.js 6976 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6977 * -------------------------------------------------------------------------- 6978 */ 6979 6980 (function () { 6981 if (typeof $ === 'undefined') { 6982 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 6983 } 6984 6985 var version = $.fn.jquery.split(' ')[0].split('.'); 6986 var minMajor = 1; 6987 var ltMajor = 2; 6988 var minMinor = 9; 6989 var minPatch = 1; 6990 var maxMajor = 4; 6991 6992 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 6993 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 6994 } 6995 })(); 6996 6997 exports.Util = Util; 6998 exports.Alert = Alert; 6999 exports.Button = Button; 7000 exports.Carousel = Carousel; 7001 exports.Collapse = Collapse; 7002 exports.Dropdown = Dropdown; 7003 exports.Modal = Modal; 7004 exports.Popover = Popover; 7005 exports.Scrollspy = ScrollSpy; 7006 exports.Tab = Tab; 7007 exports.Toast = Toast; 7008 exports.Tooltip = Tooltip; 7009 7010 Object.defineProperty(exports, '__esModule', { value: true }); 7011 7012})); 7013//# sourceMappingURL=bootstrap.bundle.js.map 7014 7015/* 7016 Close All Submenus On Resize 7017 ======================================= */ 7018 7019jQuery(function ($) { 7020 $(document).ready(function () { 7021 checkSize(); 7022 $(window).resize(checkSize); 7023 }); 7024 7025 function checkSize() { 7026 if ($(".navbar-toggler").css("display") == "none") { 7027 $('.navbar-nav').find('.open').removeClass('open'); 7028 } 7029 } 7030}); 7031 7032/* 7033 Make Menu Clickable 7034 ======================================= */ 7035 7036jQuery(function ($) { 7037 $(".dropdown-toggle").removeAttr('data-toggle dropdown'); 7038 7039 $(document).ready(function () { 7040 checkSize(); 7041 $(window).resize(checkSize); 7042 }); 7043 7044 function checkSize() { 7045 if ($(".navbar-toggler").css("display") == "none" && evolve_js_local_vars.main_menu === '1') { 7046 $('.dropdown-toggle').each(function () { 7047 // $(this).addClass('clicked'); 7048 // $(this).closest('li').addClass('open'); 7049 }); 7050 } 7051 7052 $('.dropdown.nav-item > a').click(function (event) { 7053 if ($(this).closest('li').find('.dropdown-menu').length) { 7054 if (!$(this).hasClass('clicked')) { 7055 $(this).closest('ul').find('.open').removeClass('open'); 7056 $(this).closest('ul').find('.clicked').removeClass('clicked'); 7057 $(this).closest('li').addClass('open'); 7058 event.preventDefault(); 7059 } 7060 $(this).addClass('clicked'); 7061 } 7062 }) 7063 } 7064}); 7065 7066/* 7067 Navbar Dropdown Hover Effect 7068 ======================================= */ 7069 7070jQuery(function ($) { 7071 'use strict'; 7072 7073 // DROPDOWNHOVER CLASS DEFINITION 7074 // ========================= 7075 7076 var Dropdownhover = function (element, options) { 7077 this.options = options; 7078 this.$element = $(element); 7079 7080 var that = this; 7081 7082 // Defining if navigation tree or single dropdown 7083 this.dropdowns = this.$element.hasClass('dropdown-toggle') ? this.$element.parent().find('.dropdown-menu').parent('.dropdown') : this.$element.find('.dropdown'); 7084 if (window.outerWidth >= 768) { 7085 this.dropdowns.each(function () { 7086 $(this).on('mouseenter.bs.dropdownhover', function (e) { 7087 that.show($(this).children('a, button')); 7088 e.preventDefault(); 7089 $(this).children('a').addClass('clicked'); 7090 }) 7091 }); 7092 this.dropdowns.each(function () { 7093 $(this).on('mouseleave.bs.dropdownhover', function (e) { 7094 that.hide($(this).children('a, button')); 7095 $(this).children('a').removeClass('clicked'); 7096 }) 7097 }) 7098 } 7099 }; 7100 7101 Dropdownhover.TRANSITION_DURATION = 300; 7102 Dropdownhover.DELAY = 150; 7103 Dropdownhover.TIMEOUT;
7104 7105 Dropdownhover.DEFAULTS = { 7106 animations: ['fadeInDown', 'fadeInRight', 'fadeInUp', 'fadeInLeft'], 7107 }; 7108 7109 // Opens dropdown menu when mouse is over the trigger element 7110 Dropdownhover.prototype.show = function (_dropdownLink) { 7111 7112 7113 var $this = $(_dropdownLink); 7114 7115 window.clearTimeout(Dropdownhover.TIMEOUT); 7116 // Close all dropdowns 7117 $('.dropdown').not($this.parents()).each(function () { 7118 $(this).removeClass('open'); 7119 }); 7120 7121 var effect = this.options.animations[0]; 7122 7123 if ($this.is('.disabled, :disabled')) return; 7124 7125 var $parent = $this.parent(); 7126 var isActive = $parent.hasClass('open'); 7127 7128 if (!isActive) { 7129 7130 var $dropdown = $this.next('.dropdown-hover'); 7131 var relatedTarget = {relatedTarget: this}; 7132 7133 $parent 7134 .addClass('open'); 7135 7136 var side = this.position($dropdown); 7137 side == 'top' ? effect = this.options.animations[2] : 7138 side == 'right' ? effect = this.options.animations[3] : 7139 side == 'left' ? effect = this.options.animations[1] : 7140 effect = this.options.animations[0]; 7141 7142 $dropdown.addClass('animated ' + effect); 7143 7144 var transition = $dropdown.hasClass('animated'); 7145 7146 transition ? 7147 $dropdown 7148 .one('bsTransitionEnd', function () { 7149 $dropdown.removeClass('animated ' + effect) 7150 }) 7151 .emulateTransitionEnd(Dropdownhover.TRANSITION_DURATION) : 7152 $dropdown.removeClass('animated ' + effect) 7153 } 7154 7155 return false 7156 }; 7157 7158 // Closes dropdown menu when moise is out of it 7159 Dropdownhover.prototype.hide = function (_dropdownLink) { 7160 7161 var that = this; 7162 var $this = $(_dropdownLink); 7163 var $parent = $this.parent(); 7164 Dropdownhover.TIMEOUT = window.setTimeout(function () { 7165 $parent.removeClass('open') 7166 }, Dropdownhover.DELAY) 7167 }; 7168 7169 // Calculating position of dropdown menu 7170 Dropdownhover.prototype.position = function (dropdown) { 7171 7172 var win = $(window); 7173 7174 // Reset css to prevent incorrect position 7175 dropdown.css({bottom: '', left: '', top: '', right: ''}).removeClass('dropdownhover-top'); 7176 7177 var viewport = { 7178 top: win.scrollTop(), 7179 left: win.scrollLeft() 7180 }; 7181 viewport.right = viewport.left + win.width(); 7182 viewport.bottom = viewport.top + win.height(); 7183 7184 var bounds = dropdown.offset(); 7185 if (bounds !== undefined) { 7186 bounds.right = bounds.left + dropdown.outerWidth(); 7187 bounds.bottom = bounds.top + dropdown.outerHeight(); 7188 var position = dropdown.position(); 7189 position.right = bounds.left + dropdown.outerWidth(); 7190 position.bottom = bounds.top + dropdown.outerHeight(); 7191 7192 var side = ''; 7193 7194 var isSubnow = dropdown.parents('.dropdown-hover').length; 7195 7196 if (isSubnow) { 7197 7198 if (position.left < 0) { 7199 side = 'left'; 7200 dropdown.removeClass('dropdownhover-right').addClass('dropdownhover-left') 7201 } else { 7202 side = 'right'; 7203 dropdown.addClass('dropdownhover-right').removeClass('dropdownhover-left') 7204 } 7205 7206 if (bounds.left < viewport.left) { 7207 side = 'right'; 7208 dropdown.css({ 7209 left: '100%', 7210 right: 'auto' 7211 }).addClass('dropdownhover-right').removeClass('dropdownhover-left') 7212 } else if (bounds.right > viewport.right) { 7213 side = 'left'; 7214 dropdown.css({ 7215 left: 'auto', 7216 right: '100%' 7217 }).removeClass('dropdownhover-right').addClass('dropdownhover-left') 7218 } 7219 7220 if (bounds.bottom > viewport.bottom) { 7221 dropdown.css({bottom: 'auto', top: -(bounds.bottom - viewport.bottom)}) 7222 } else if (bounds.top < viewport.top) { 7223 dropdown.css({bottom: -(viewport.top - bounds.top), top: 'auto'}) 7224 } 7225 7226 } else { // Defines special position styles for root dropdown menu 7227 7228 var parentLi = dropdown.parent('.dropdown'); 7229 var pBounds = parentLi.offset(); 7230 pBounds.right = pBounds.left + parentLi.outerWidth(); 7231 pBounds.bottom = pBounds.top + parentLi.outerHeight(); 7232 7233 if (bounds.right > viewport.right) { 7234 dropdown.css({left: -(bounds.right - viewport.right), right: 'auto'}) 7235 } 7236 7237 if (bounds.bottom > viewport.bottom && (pBounds.top - viewport.top) > (viewport.bottom - pBounds.bottom) || dropdown.position().top < 0) { 7238 side = 'top'; 7239 dropdown.css({ 7240 bottom: '100%', 7241 top: 'auto' 7242 }).addClass('dropdownhover-top').removeClass('dropdownhover-bottom') 7243 } else { 7244 side = 'bottom'; 7245 dropdown.addClass('dropdownhover-bottom') 7246 } 7247 } 7248 7249 return side; 7250 } 7251 7252 }; 7253 7254 7255 // DROPDOWNHOVER PLUGIN DEFINITION 7256 // ========================== 7257 7258 function Plugin(option) { 7259 return this.each(function () { 7260 var $this = $(this); 7261 var data = $this.data('bs.dropdownhover'); 7262 var settings = $this.data(); 7263 if ($this.data('animations') !== undefined && $this.data('animations') !== null) 7264 settings.animations = $.isArray(settings.animations) ? settings.animations : settings.animations.split(' '); 7265 7266 var options = $.extend({}, Dropdownhover.DEFAULTS, settings, typeof option == 'object' && option); 7267 7268 if (!data) $this.data('bs.dropdownhover', (data = new Dropdownhover(this, options))) 7269 7270 }) 7271 } 7272 7273 var old = $.fn.dropdownhover; 7274 7275 $.fn.dropdownhover = Plugin; 7276 $.fn.dropdownhover.Constructor = Dropdownhover; 7277 7278 7279 // DROPDOWNHOVER NO CONFLICT 7280 // ==================== 7281 7282 $.fn.dropdownhover.noConflict = function () { 7283 $.fn.dropdownhover = old; 7284 return this 7285 }; 7286 7287 7288 // APPLY TO STANDARD DROPDOWNHOVER ELEMENTS 7289 // =================================== 7290 7291 var resizeTimer; 7292 $('body').on("click touchstart", function () { 7293 //navbar 7294 // var id = event.target.id; 7295 if ($(event.target).closest('.navbar').length == 0) { 7296 $('.navbar-nav .open').removeClass('open'); 7297 } 7298 }) 7299 $(document).ready(function () { 7300 $('.navbar-nav .open').removeClass('open'); 7301 $('[data-hover="dropdown"]').each(function () { 7302 var $target = $(this); 7303 Plugin.call($target, $target.data()) 7304 }) 7305 }); 7306 $(window).on('resize', function () { 7307 clearTimeout(resizeTimer); 7308 resizeTimer = setTimeout(function () { 7309 if ($(window).width() >
7309= 768) // Breakpoin plugin is activated (728px) 7310 $('[data-hover="dropdown"]').each(function () { 7311 var $target = $(this); 7312 Plugin.call($target, $target.data()) 7313 }); 7314 else // Disabling and clearing plugin data if screen is less 768px 7315 $('[data-hover="dropdown"]').each(function () { 7316 $(this).removeData('bs.dropdownhover'); 7317 if ($(this).hasClass('dropdown-toggle')) 7318 $(this).parent('.dropdown').find('.dropdown').andSelf().off('mouseenter.bs.dropdownhover mouseleave.bs.dropdownhover'); 7319 else 7320 $(this).find('.dropdown').off('mouseenter.bs.dropdownhover mouseleave.bs.dropdownhover') 7321 }) 7322 }, 200) 7323 }) 7324 7325}); 7326 7327/* 7328 Mega Menu 7329 ======================================= */ 7330 7331jQuery(function ($) { 7332 7333 $(".mega-menu-column-title").on("click", function (e) { 7334 e.preventDefault(); 7335 }); 7336 7337 var sticky_header_enabled = $('.sticky-header .mega-menu-fullwidth'); 7338 7339 if (sticky_header_enabled.length) { 7340 sticky_header_enabled.addClass('sticky-mega-menu-fullwidth').removeClass('mega-menu-fullwidth'); 7341 } 7342 7343 var mega_menu_class = $('.mega-menu-fullwidth'); 7344 7345 if (mega_menu_class.length || sticky_header_enabled.length) { 7346 7347 // Primary Menu 7348 7349 if (mega_menu_class.length) { 7350 var header_class = $('.header-mega-menu'); 7351 var header_position = header_class.offset().left; 7352 var mega_menu_position_vis = mega_menu_class.is(":visible"); 7353 if (!mega_menu_position_vis) 7354 mega_menu_class.show(); 7355 7356 var mega_menu_position = mega_menu_class.offset().left; 7357 7358 if (!mega_menu_position_vis) 7359 mega_menu_class.hide().css('display', ''); 7360 7361 var mega_menu_position_hover = mega_menu_position - header_position; 7362 } 7363 7364 // Sticky Header Menu 7365 7366 if (sticky_header_enabled.length) { 7367 var sticky_mega_menu_class = $('.sticky-mega-menu-fullwidth'); 7368 7369 var sticky_header_class = $('.sticky-header-mega-menu .container'); 7370 var sticky_header_position = sticky_header_class.offset().left; 7371 var sticky_mega_menu_position_vis = sticky_mega_menu_class.is(":visible"); 7372 if (!sticky_mega_menu_position_vis) 7373 sticky_mega_menu_class.show(); 7374 7375 var sticky_mega_menu_position = sticky_mega_menu_class.offset().left; 7376 7377 if (!sticky_mega_menu_position_vis) 7378 sticky_mega_menu_class.hide().css('display', ''); 7379 7380 var sticky_mega_menu_position_hover = sticky_mega_menu_position - sticky_header_position; 7381 } 7382 7383 if (window.outerWidth >= 768) { 7384 7385 if (mega_menu_class.length) { 7386 header_class.on('mouseover mouseout', function () { 7387 mega_menu_class.css({ 7388 'left': ('-' + mega_menu_position_hover + 'px'), 7389 'width': (header_class.width() + 60 + 'px') 7390 }); 7391 }); 7392 } 7393 7394 if (sticky_header_enabled.length) { 7395 sticky_header_class.on('mouseover mouseout', function () { 7396 sticky_mega_menu_class.css({ 7397 'left': ('-' + sticky_mega_menu_position_hover + 'px'), 7398 'width': (sticky_header_class.width() + 60 + 'px') 7399 }); 7400 }); 7401 } 7402 } 7403 } 7404}) 7405; 7406 7407/* 7408 Sticky Header 7409 ======================================= */ 7410 7411if (evolve_js_local_vars.sticky_header === '1') { 7412 7413 jQuery(function ($) { 7414 if ($('.sticky-header').length >= 1) { 7415 $(window).scroll(function () { 7416 var header = $(document).scrollTop(); 7417 var headerHeight = $('.header-height').height(); 7418 if (header > headerHeight) { 7419 $('.sticky-header').addClass('fadein'); 7420 } else { 7421 $('.sticky-header').removeClass('fadein'); 7422 } 7423 }); 7424 } 7425 }); 7426 7427} 7428 7429/* 7430 Bootstrap Slider 7431 ======================================= */ 7432 7433jQuery(function ($) { 7434 if (true) { 7435 $('#posts-slider img.d-block').each(function () { 7436 if ($(this).attr('data-lazy-src')) { 7437 $(this).attr('src', $(this).attr('data-lazy-src')); 7438 } 7439 }); 7440 7441 $('.carousel').on('slide.bs.carousel', function (event) { 7442 var height = $(event.relatedTarget).height(); 7443 if(height < 366) { 7444 height = 366; 7445 } 7446 var $innerCarousel = $(event.target).find('.carousel-inner'); 7447 $innerCarousel.animate({ 7448 height: height 7449 }); 7450 }); 7451 7452 var finishTime; 7453
7454 function resizeBootstrapSlider() { 7455 resizeBootstrapSliderFinish(); 7456 finishTime = setTimeout(function () { 7457 var height = $('.carousel-resize .active').height(); 7458 var $innerCarousel = $('.carousel-resize .active').closest('.carousel-resize'); 7459 $innerCarousel.animate({ 7460 height: height 7461 }); 7462 }, 100); 7463 } 7464 7465 function resizeBootstrapSliderFinish() { 7466 clearTimeout(finishTime); 7467 } 7468 7469 $(window).resize(function () { 7470 resizeBootstrapSlider(); 7471 }); 7472 } 7473 7474 $('.product-carousel').carousel({ 7475 interval: false, 7476 wrap: false 7477 }); 7478 7479 $(document).ready(function () { 7480 checkbootstrap('#carousel-slider-product .carousel-inner'); 7481 checkbootstrap('.multiple-items'); 7482 }); 7483 7484 $('#carousel-slider-product').on('slid.bs.carousel', function () { 7485 checkbootstrap('#carousel-slider-product .carousel-inner'); 7486 }); 7487 7488 var $carouselslidermultiple = $('.carousel-multiple-items'); 7489 7490 $carouselslidermultiple.carousel({ 7491 interval: false, 7492 }); 7493 7494 $carouselslidermultiple.on('slid.bs.carousel', function () { 7495 checkbootstrap('#carousel-slider-thumbnails'); 7496 checkbootstrap('.carousel-portfolio'); 7497 checkbootstrap('.carousel-shortcode'); 7498 }); 7499 7500 $carouselslidermultiple.on('slide.bs.carousel', function (e) { 7501 var $e = $(e.relatedTarget); 7502 var idx = $e.index(); 7503 var itemsPerSlide = 3; 7504 if (window.outerWidth <= 768) { 7505 itemsPerSlide = 2; 7506 } else if (window.outerWidth <= 575) { 7507 itemsPerSlide = 1; 7508 } 7509 7510 var totalItems = $('.carousel-item').length; 7511 7512 if (idx >= totalItems - (itemsPerSlide - 1)) { 7513 var it = itemsPerSlide - (totalItems - idx); 7514 for (var i = 0; i < it; i++) { 7515 // append slides to end 7516 if (e.direction == "left") { 7517 $('.carousel-item').eq(i).appendTo('.carousel-inner'); 7518 } 7519 else { 7520 $('.carousel-item').eq(0).appendTo('.carousel-inner'); 7521 } 7522 } 7523 } 7524 }); 7525 7526 function checkbootstrap(type) { 7527 var id = type; 7528 var $this = $(id); 7529 if (id === '.carousel-portfolio' || id === '.carousel-shortcode') { 7530 $this.children('.carousel-control').show().css('display', 'flex').addClass('carousel-arrow'); 7531 } else { 7532 if ($(id + ' .carousel-item:first').hasClass('active')) { 7533 $this.children('.carousel-control-prev').hide().removeClass('carousel-arrow'); 7534 $this.children('.carousel-control-next').show().css('display', 'flex').addClass('carousel-arrow'); 7535 } else if ($(id + ' .carousel-item:last').hasClass('active')) { 7536 $this.children('.carousel-control-next').hide().removeClass('carousel-arrow'); 7537 $this.children('.carousel-control-prev').show().css('display', 'flex').addClass('carousel-arrow'); 7538 } else { 7539 $this.children('.carousel-control').show().css('display', 'flex').addClass('carousel-arrow'); 7540 } 7541 } 7542 } 7543 7544 $carouselslidermultiple.find('.carousel-arrow').hide(); 7545 $carouselslidermultiple.hover(function () { 7546 $(this).find('.carousel-arrow').stop(true, true).fadeIn(200).show(10); 7547 }, function () { 7548 $(this).find('.carousel-arrow').stop(true, true).fadeOut(200).hide(10); 7549 }); 7550}); 7551 7552/* 7553 Parallax Slider 7554 ======================================= */ 7555 7556if (evolve_js_local_vars.parallax_slider === '1') { 7557 7558 jQuery(function ($) { 7559 7560 //Function to animate slider captions 7561 function doAnimations(elems) { 7562 //Cache the animationend event in a variable 7563 var animEndEv = 'webkitAnimationEnd animationend'; 7564 7565 elems.each(function () { 7566 var $this = $(this), 7567 $animationType = $this.data('animation');
7568 $this.addClass($animationType).one(animEndEv, function () { 7569 $this.removeClass($animationType); 7570 }); 7571 }); 7572 } 7573 7574 //Variables on page load 7575 var $myCarousel = $('#parallax-slider'), 7576 $firstAnimatingElems = $myCarousel.find('.carousel-item:first').find("[data-animation ^= 'animated']"); 7577 7578 //Initialize carousel 7579 $myCarousel.carousel(); 7580 7581 //Animate captions in first slide on page load 7582 doAnimations($firstAnimatingElems); 7583 7584 //Pause carousel 7585 $myCarousel.carousel('pause'); 7586 7587 7588 //Other slides to be animated on carousel slide event 7589 $myCarousel.on('slide.bs.carousel', function (e) { 7590 var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']"); 7591 doAnimations($animatingElems); 7592 }); 7593 7594 }); 7595} 7596 7597/* 7598 Tooltips 7599 ======================================= */ 7600 7601jQuery(function ($) { 7602 $('[data-toggle="tooltip"]').tooltip() 7603}); 7604 7605/* 7606 WPML Menu Items 7607 ======================================= */ 7608 7609if (evolve_js_local_vars.wpml_menu === '1') { 7610 jQuery(document).ready(function () { 7611 jQuery('.navbar .menu-item-language a').each(function () { 7612 var el = jQuery(this); 7613 plan_text = el.text(); 7614 if (jQuery(this).find('img').length) { 7615 img_src = jQuery(this).find('img').attr('src'); 7616 jQuery(this).find('img').remove(); 7617 if (evolve_js_local_vars.wpml_menu_effect === '1') { 7618 el.html('<img src="' + img_src + '"> <span class="link-effect" data-hover=" ' + plan_text + '">' + plan_text + '</span>'); 7619 } else { 7620 el.html('<img src="' + img_src + '"> ' + plan_text); 7621 7622 } 7623 } else { 7624 if (evolve_js_local_vars.wpml_menu_effect === '1') { 7625 el.html('<span class="link-effect" data-hover="' + plan_text + '">' + plan_text + '</span>'); 7626 } else { 7627 el.html(plan_text); 7628 } 7629 } 7630 }); 7631 }); 7632} 7633 7634/* 7635 Tabs Widget 7636 ======================================= */ 7637jQuery(function ($) { 7638 $('.nav-tabs li:first-child a').tab('show') 7639}); 7640 7641/* 7642 WooCommerce 7643 ======================================= */ 7644 7645if (typeof evolve_js_local_vars.woocommerce !== 'undefined') { 7646 7647 jQuery(function ($) { 7648 7649 /* 7650 Product Catalog 7651 --------------------------------------- */ 7652 7653 $('.catalog-ordering .orderby .current-item').html($('.catalog-ordering .orderby .current').html()); 7654 $('.catalog-ordering .sort-count .current-item').html($('.catalog-ordering .sort-count .current').html()); 7655 7656 $('.rtl .woocommerce .wc-forward').each(function () { 7657 $(this).val($('.rtl .woocommerce .wc-forward').val().replace('\u2192', '\u2190')); 7658 }); 7659 7660 $('.woocommerce-checkout-nav a, .continue-checkout').click(function (e) { 7661 e.preventDefault(); 7662 7663 var data_name = $(this).attr('data-name'); 7664 var name = data_name; 7665 if (data_name != '#order-review') { 7666 name = '.' + data_name; 7667 } 7668 7669 $('.woocommerce-checkout-nav li').removeClass('active'); 7670 $('.woocommerce-checkout-nav').find('[data-name=' + data_name + ']').parent().addClass('active'); 7671 }); 7672 7673 $('a.add_to_cart_button').click(function (e) { 7674 var link = this; 7675 $(link).closest('.products .product').find('.cart-loading').find('div').removeClass('ok').addClass('loader'); 7676 $(this).closest('.products .product').find('.cart-loading').addClass('fadein'); 7677 setTimeout(function () { 7678 $(link).closest('.products .product').find('.cart-loading').find('div').removeClass('fadein').removeClass('loader').addClass('ok').addClass('fadein'); 7679 7680 setTimeout(function () { 7681 $(link).closest('.products .product').find('.cart-loading').removeClass('fadein').closest('.products .product').find('.product-images img').animate({opacity: 1}); 7682 }, 2000); 7683 }, 2000); 7684 }); 7685 7686 $('.products .product').mouseenter(function () {
7687 if ($(this).find('.cart-loading').find('div').hasClass('ok')) { 7688 $(this).find('.cart-loading').addClass('fadein'); 7689 } 7690 }).mouseleave(function () { 7691 if ($(this).find('.cart-loading').find('div').hasClass('ok')) { 7692 $(this).find('.cart-loading').stop().removeClass('fadein'); 7693 } 7694 }); 7695 7696 /* 7697 Checkout and Account Tabs 7698 --------------------------------------- */ 7699 7700 $('.woocommerce .woocommerce-input-wrapper').addClass('col-sm-8'); 7701 7702 $('#checkout-tab a[href="#checkout-billing"]').tab('show'); 7703 $('#account-tab a[href="#account-dashboard"]').tab('show'); 7704 7705 $('.continue').click(function () { 7706 $('.nav-pills > .active').next('a').trigger('click'); 7707 }); 7708 7709 $(".view-orders-link").click(function () { 7710 $("a#account-orders-tab").click(); 7711 }); 7712 7713 $(".edit-address-link").click(function () { 7714 $("a#account-address-tab").click(); 7715 }); 7716 7717 $(".edit-account-link").click(function () { 7718 $("a#account-edit-tab").click(); 7719 }); 7720 7721 /* 7722 Single Product Tabs 7723 --------------------------------------- */ 7724 7725 $('.woocommerce-tabs a:first-child').tab('show') 7726 7727 $(".woocommerce-review-link").click(function () { 7728 $("a#reviews").click(); 7729 }); 7730 7731 if (window.location.hash === "#reviews") { 7732 $('.woocommerce-tabs a[href="#tab-reviews"]').tab('show'); 7733 } 7734 7735 /* 7736 Edit Address Form 7737 --------------------------------------- */ 7738 7739 $('#account-tab a.account-tab').click(function (e) { 7740 e.preventDefault(); 7741 7742 $('.editaddress_billing').hide(); 7743 $('.editaddress_shipping').hide(); 7744 7745 }); 7746 7747 $(document).ready(function ($) { 7748 7749 $('.woo_editaddress').click(function (e) { 7750 e.preventDefault(); 7751 7752 var editaddress = $(this).attr('id'); 7753 7754 if (editaddress == 'editaddress_billing') { 7755 $('.editaddress_billing').fadeIn(); 7756 $('.editaddress_shipping').hide(); 7757 } else if (editaddress == 'editaddress_shipping') { 7758 $('.editaddress_shipping').fadeIn(); 7759 $('.editaddress_billing').hide(); 7760 } 7761 }); 7762 7763 $('#saveaddress').click(function () { 7764 var formvalue = $('#formvalue').val(); 7765 7766 if (formvalue == 'billing') { 7767 $('.editaddress_billing').fadeIn(); 7768 $('.editaddress_shipping').hide(); 7769 } else if (formvalue == 'shipping') { 7770 $('.editaddress_shipping').fadeIn(); 7771 $('.editaddress_billing').hide(); 7772 } 7773 }); 7774 7775 }); 7776 7777 /* 7778 Change Lightbox img When Change Variation img In WooCommerce Product Description Page 7779 --------------------------------------- */ 7780 7781 $('.attachment-shop_single').on('load', function () { 7782 var img_src = $(".woocommerce-product-gallery__image .attachment-shop_single").attr('src'); 7783 $(".woocommerce-product-gallery__image").attr("href", img_src); 7784 }); 7785 7786 }); 7787} 7788 7789/* 7790 Infinite Scroll 7791 ======================================= */ 7792 7793if (typeof componentz_js_local_vars !== 'undefined') { 7794 var $infinite_local_vars; 7795 $infinite_local_vars = componentz_js_local_vars; 7796} else { 7797 $infinite_local_vars = evolve_js_local_vars; 7798} 7799 7800if ($infinite_local_vars.infinite_scroll_enabled === '1') { 7801 7802 /*! 7803 * Infinite Ajax Scroll v2.3.1 7804 * A jQuery plugin for infinite scrolling 7805 * https://infiniteajaxscroll.com 7806 * 7807 * Commercial use requires one-time purchase of a commercial license 7808 * https://infiniteajaxscroll.com/docs/license.html 7809 * 7810 * Non-commercial use is licensed under the MIT License 7811 * 7812 * Copyright (c) 2018 Webcreate (Jeroen Fiege) 7813 */ 7814 var IASCallbacks = function (a) { 7815 return this.list = [], this.fireStack = [], this.isFiring = !1, this.isDisabled = !1, this.Deferred = a.Deferred, this.fire = function (a) { 7816 var b = a[0], c = a[1], d = a[2]; 7817 this.isFiring = !0; 7818 for (var e = 0, f = this.list.length; f > e; e++) if (void 0 != this.list[e] && !1 === this.list[e].fn.apply(b, d)) { 7819 c.reject(); 7820 break 7821 } 7822 this.isFiring = !1, c.resolve(), this.fireStack.length && this.fire(this.fireStack.shift()) 7823 }, this.inList = function (a, b) { 7824 b = b || 0; 7825 for (var c = b, d = this.list.length; d > c; c++) if (this.list[c].fn === a || a.guid && this.list[c].fn.guid && a.guid === this.list[c].fn.guid) return c; 7826 return -1 7827 }, this 7828 }; 7829 IASCallbacks.prototype = { 7830 add: function (a, b) { 7831 var c = {fn: a, priority: b}; 7832 b = b || 0; 7833 for (var d = 0, e = this.list.length; e > d; d++) if (b > this.list[d].priority) return this.list.splice(d, 0, c), this; 7834 return this.list.push(c), this 7835 }, remove: function (a) { 7836 for (var b = 0; (b = this.inList(a, b)) > -1;) this.list.splice(b, 1); 7837 return this 7838 }, has: function (a) { 7839 return this.inList(a) > -1 7840 }, fireWith: function (a, b) { 7841 var c = this.Deferred(); 7842 return this.isDisabled ? c.reject() : (b = b || [], b = [a, c, b.slice ? b.slice() : b], this.isFiring ? this.fireStack.push(b) : this.fire(b), c) 7843 }, disable: function () { 7844 this.isDisabled = !0 7845 }, enable: function () { 7846 this.isDisabled = !1 7847 } 7848 }, function (a) { 7849 "use strict"; 7850 var b = -1, c = function (c, d) { 7851 return this.itemsContainerSelector = d.container, this.itemSelector = d.item, this.nextSelector = d.next, this.paginationSelector = d.pagination, this.$scrollC
7851ontainer = c, this.$container = window === c.get(0) ? a(document) : c, this.defaultDelay = d.delay, this.negativeMargin = d.negativeMargin, this.nextUrl = null, this.isBound = !1, this.isPaused = !1, this.isInitialized = !1, this.jsXhr = !1, this.listeners = { 7852 next: new IASCallbacks(a), 7853 load: new IASCallbacks(a), 7854 loaded: new IASCallbacks(a), 7855 render: new IASCallbacks(a), 7856 rendered: new IASCallbacks(a), 7857 scroll: new IASCallbacks(a), 7858 noneLeft: new IASCallbacks(a), 7859 ready: new IASCallbacks(a) 7860 }, this.extensions = [], this.scrollHandler = function () { 7861 if (this.isBound && !this.isPaused) { 7862 var a = this.getCurrentScrollOffset(this.$scrollContainer), c = this.getScrollThreshold(); 7863 b != c && (this.fire("scroll", [a, c]), a >= c && this.next()) 7864 } 7865 }, this.getItemsContainer = function () { 7866 return a(this.itemsContainerSelector, this.$container) 7867 }, this.getLastItem = function () { 7868 return a(this.itemSelector, this.getItemsContainer().get(0)).last() 7869 }, this.getFirstItem = function () { 7870 return a(this.itemSelector, this.getItemsContainer().get(0)).first() 7871 }, this.getScrollThreshold = function (a) { 7872 var c; 7873 return a = a || this.negativeMargin, a = a >= 0 ? -1 * a : a, c = this.getLastItem(), 0 === c.length ? b : c.offset().top + c.height() + a 7874 }, this.getCurrentScrollOffset = function (a) { 7875 var b = 0, c = a.height(); 7876 return b = window === a.get(0) ? a.scrollTop() : a.offset().top, (-1 != navigator.platform.indexOf("iPhone") || -1 != navigator.platform.indexOf("iPod")) && (c += 80), b + c 7877 }, this.getNextUrl = function (b) { 7878 return b = b || this.$container, a(this.nextSelector, b).last().attr("href") 7879 }, this.load = function (b, c, d) { 7880 function e(b) { 7881 f = a(this.itemsContainerSelector, b).eq(0), 0 === f.length && (f = a(b).filter(this.itemsContainerSelector).eq(0)), f && f.find(this.itemSelector).each(function () { 7882 i.push(this) 7883 }), h.fire("loaded", [b, i]), c && (g = +new Date - j, d > g ? setTimeout(function () { 7884 c.call(h, b, i) 7885 }, d - g) : c.call(h, b, i)) 7886 } 7887 7888 var f, g, h = this, i = [], j = +new Date; 7889 d = d || this.defaultDelay; 7890 var k = {url: b, ajaxOptions: {dataType: "html"}}; 7891 return h.fire("load", [k]), this.jsXhr = a.ajax(k.url, k.ajaxOptions).done(a.proxy(e, h)), this.jsXhr 7892 }, this.render = function (b, c) { 7893 var d = this, e = this.getLastItem(), f = 0, g = this.fire("render", [b]); 7894 g.done(function () { 7895 a(b).hide(), e.after(b), a(b).fadeIn(400, function () { 7896 ++f < b.length || (d.fire("rendered", [b]), c && c()) 7897 }) 7898 }), g.fail(function () { 7899 c && c() 7900 }) 7901 }, this.hidePagination = function () { 7902 this.paginationSelector && a(this.paginationSelector, this.$container).hide() 7903 }, this.restorePagination = function () { 7904 this.paginationSelector && a(this.paginationSelector, this.$container).show() 7905 }, this.throttle = function (b, c) { 7906 var d, e, f = 0; 7907 return d = function () { 7908 function a() { 7909 f = +new Date, b.apply(d, g) 7910 } 7911 7912 var d = this, g = arguments, h = +new Date - f; 7913 e ? clearTimeout(e) : a(), h > c ? a() : e = setTimeout(a, c) 7914 }, a.guid && (d.guid = b.guid = b.guid || a.guid++), d 7915 }, this.fire = function (a, b) { 7916 return this.listeners[a].fireWith(this, b) 7917 }, this.pause = function () { 7918 this.isPaused = !0 7919 }, this.resume = function () { 7920 this.isPaused = !1 7921 }, this 7922 }; 7923 c.prototype.initialize = function () { 7924 if (this.isInitialized) return !1;
7925 var a = !!("onscroll" in this.$scrollContainer.get(0)), 7926 b = this.getCurrentScrollOffset(this.$scrollContainer), 7927 c = this.getScrollThreshold(); 7928 return a ? (this.hidePagination(), this.bind(), this.nextUrl = this.getNextUrl(), this.nextUrl || this.fire("noneLeft", [this.getLastItem()]), this.nextUrl && b >= c ? (this.next(), this.one("rendered", function () { 7929 this.isInitialized = !0, this.fire("ready") 7930 })) : (this.isInitialized = !0, this.fire("ready")), this) : !1 7931 }, c.prototype.reinitialize = function () { 7932 this.isInitialized = !1, this.unbind(), this.initialize() 7933 }, c.prototype.bind = function () { 7934 if (!this.isBound) { 7935 this.$scrollContainer.on("scroll", a.proxy(this.throttle(this.scrollHandler, 150), this)); 7936 for (var b = 0, c = this.extensions.length; c > b; b++) this.extensions[b].bind(this); 7937 this.isBound = !0, this.resume() 7938 } 7939 }, c.prototype.unbind = function () { 7940 if (this.isBound) { 7941 this.$scrollContainer.off("scroll", this.scrollHandler); 7942 for (var a = 0, b = this.extensions.length; b > a; a++) "undefined" != typeof this.extensions[a].unbind && this.extensions[a].unbind(this); 7943 this.isBound = !1 7944 } 7945 }, c.prototype.destroy = function () { 7946 try { 7947 this.jsXhr.abort() 7948 } catch (a) { 7949 } 7950 this.unbind(), this.$scrollContainer.data("ias", null) 7951 }, c.prototype.on = function (b, c, d) { 7952 if ("undefined" == typeof this.listeners[b]) throw new Error('There is no event called "' + b + '"'); 7953 return d = d || 0, this.listeners[b].add(a.proxy(c, this), d), this.isInitialized && ("ready" === b ? a.proxy(c, this)() : "noneLeft" !== b || this.nextUrl || a.proxy(c, this)()), this 7954 }, c.prototype.one = function (a, b) { 7955 var c = this, d = function () { 7956 c.off(a, b), c.off(a, d) 7957 }; 7958 return this.on(a, b), this.on(a, d), this 7959 }, c.prototype.off = function (a, b) { 7960 if ("undefined" == typeof this.listeners[a]) throw new Error('There is no event called "' + a + '"'); 7961 return this.listeners[a].remove(b), this 7962 }, c.prototype.next = function () { 7963 var a = this.nextUrl, b = this; 7964 if (!a) return !1; 7965 this.pause(); 7966 var c = this.fire("next", [a]); 7967 return c.done(function () { 7968 b.load(a, function (a, c) { 7969 b.render(c, function () { 7970 b.nextUrl = b.getNextUrl(a), b.nextUrl || b.fire("noneLeft", [b.getLastItem()]), b.resume() 7971 }) 7972 }) 7973 }), c.fail(function () { 7974 b.resume() 7975 }), !0 7976 }, c.prototype.extension = function (a) { 7977 if ("undefined" == typeof a.bind) throw new Error('Extension doesn\'t have required method "bind"'); 7978 return "undefined" != typeof a.initialize && a.initialize(this), this.extensions.push(a), this.isBound && this.reinitialize(), this 7979 }, a.ias = function (b) { 7980 var c = a(window); 7981 return c.ias.apply(c, arguments) 7982 }, a.fn.ias = function (b) { 7983 var d = Array.prototype.slice.call(arguments), e = this; 7984 return this.each(function () { 7985 var f = a(this), g = f.data("ias"), 7986 h = a.extend({}, a.fn.ias.defaults, f.data(), "object" == typeof b && b); 7987 if (g || (f.data("ias", g = new c(f, h)), h.initialize && a(document).ready(a.proxy(g.initialize, g))), "string" == typeof b) { 7988 if ("function" != typeof g[b]) throw new Error('There is no method called "' + b + '"'); 7989 d.shift(), g[b].apply(g, d) 7990 } 7991 e = g 7992 }), e 7993 }, a.fn.ias.defaults = { 7994 item: ".item", 7995 container: ".listing", 7996 next: ".next", 7997 pagination: !1, 7998 delay: 600, 7999 negativeMargin: 10, 8000 initialize: !0 8001 } 8002 }(jQuery); 8003 var IASHistoryExtension = function (a) { 8004 return a = jQuery.extend({}, this.defaults, a), this.ias = null, this.prevSelector = a.prev, this.prevUrl = null, this.listeners = {prev: new IASCallbacks(jQuery)}, this.onPageChange = function (a, b, c) { 8005 if (window.history && window.history.replaceState) { 8006 var d = history.state; 8007 history.replaceState(d, document.title, c) 8008 } 8009 }, this.onScroll = function (a, b) {
8010 var c = this.getScrollThresholdFirstItem(); 8011 this.prevUrl && (a -= this.ias.$scrollContainer.height(), c >= a && this.prev()) 8012 }, this.onReady = function () { 8013 var a = this.ias.getCurrentScrollOffset(this.ias.$scrollContainer), b = this.getScrollThresholdFirstItem(); 8014 a -= this.ias.$scrollContainer.height(), b >= a && this.prev() 8015 }, this.getPrevUrl = function (a) { 8016 return a || (a = this.ias.$container), jQuery(this.prevSelector, a).last().attr("href") 8017 }, this.getScrollThresholdFirstItem = function () { 8018 var a; 8019 return a = this.ias.getFirstItem(), 0 === a.length ? -1 : a.offset().top 8020 }, this.renderBefore = function (a, b) { 8021 var c = this.ias, d = c.getFirstItem(), e = 0; 8022 c.fire("render", [a]), jQuery(a).hide(), d.before(a), jQuery(a).fadeIn(400, function () { 8023 ++e < a.length || (c.fire("rendered", [a]), b && b()) 8024 }) 8025 }, this 8026 }; 8027 IASHistoryExtension.prototype.initialize = function (a) { 8028 var b = this; 8029 this.ias = a, jQuery.extend(a.listeners, this.listeners), a.prev = function () { 8030 return b.prev() 8031 }, this.prevUrl = this.getPrevUrl() 8032 }, IASHistoryExtension.prototype.bind = function (a) { 8033 a.on("pageChange", jQuery.proxy(this.onPageChange, this)), a.on("scroll", jQuery.proxy(this.onScroll, this)), a.on("ready", jQuery.proxy(this.onReady, this)) 8034 }, IASHistoryExtension.prototype.unbind = function (a) { 8035 a.off("pageChange", this.onPageChange), a.off("scroll", this.onScroll), a.off("ready", this.onReady) 8036 }, IASHistoryExtension.prototype.prev = function () { 8037 var a = this.prevUrl, b = this, c = this.ias; 8038 if (!a) return !1; 8039 c.pause(); 8040 var d = c.fire("prev", [a]); 8041 return d.done(function () { 8042 c.load(a, function (a, d) { 8043 b.renderBefore(d, function () { 8044 b.prevUrl = b.getPrevUrl(a), c.resume(), b.prevUrl && b.prev() 8045 }) 8046 }) 8047 }), d.fail(function () { 8048 c.resume() 8049 }), !0 8050 }, IASHistoryExtension.prototype.defaults = {prev: ".prev"}; 8051 var IASNoneLeftExtension = function (a) { 8052 return a = jQuery.extend({}, this.defaults, a), this.ias = null, this.uid = (new Date).getTime(), this.html = a.html.replace("{text}", a.text), this.showNoneLeft = function () { 8053 var a = jQuery(this.html).attr("id", "ias_noneleft_" + this.uid), b = this.ias.getLastItem(); 8054 b.after(a), a.fadeIn() 8055 }, this 8056 }; 8057 IASNoneLeftExtension.prototype.bind = function (a) { 8058 this.ias = a, a.on("noneLeft", jQuery.proxy(this.showNoneLeft, this)) 8059 }, IASNoneLeftExtension.prototype.unbind = function (a) { 8060 a.off("noneLeft", this.showNoneLeft) 8061 }, IASNoneLeftExtension.prototype.defaults = { 8062 // text: "You reached the end.", 8063 html: '<div class="ias-noneleft alert alert-success">{text}</div>' 8064 }; 8065 var IASPagingExtension = function () { 8066 return this.ias = null, this.pagebreaks = [[0, document.location.toString()]], this.lastPageNum = 1, this.enabled = !0, this.listeners = {pageChange: new IASCallbacks(jQuery)}, this.onScroll = function (a, b) { 8067 if (this.enabled) { 8068 var c, d = this.ias, e = this.getCurrentPageNum(a), f = this.getCurrentPagebreak(a); 8069 this.lastPageNum !== e && (c = f[1], d.fire("pageChange", [e, a, c])), this.lastPageNum = e 8070 } 8071 }, this.onNext = function (a) { 8072 var b = this.ias.getCurrentScrollOffset(this.ias.$scrollContainer); 8073 this.pagebreaks.push([b, a]); 8074 var c = this.getCurrentPageNum(b) + 1; 8075 this.ias.fire("pageChange", [c, b, a]), this.lastPageNum = c 8076 }, this.onPrev = function (a) { 8077 var b = this, c = b.ias, d = c.getCurrentScrollOffset(c.$scrollContainer), 8078 e = d - c.$scrollContainer.height(), 8079 f = c.getFirstItem(); 8080 this.enabled = !1, this.pagebreaks.unshift([0, a]), c.one("rendered", function () { 8081 for (var d = 1, g = b.pagebreaks.length; g > d; d++) b.pagebreaks[d][0] = b.pagebreaks[d][0] + f.offset().top;
8082 var h = b.getCurrentPageNum(e) + 1; 8083 c.fire("pageChange", [h, e, a]), b.lastPageNum = h, b.enabled = !0 8084 }) 8085 }, this 8086 }; 8087 IASPagingExtension.prototype.initialize = function (a) { 8088 this.ias = a, jQuery.extend(a.listeners, this.listeners) 8089 }, IASPagingExtension.prototype.bind = function (a) { 8090 try { 8091 a.on("prev", jQuery.proxy(this.onPrev, this), this.priority) 8092 } catch (b) { 8093 } 8094 a.on("next", jQuery.proxy(this.onNext, this), this.priority), a.on("scroll", jQuery.proxy(this.onScroll, this), this.priority) 8095 }, IASPagingExtension.prototype.unbind = function (a) { 8096 try { 8097 a.off("prev", this.onPrev) 8098 } catch (b) { 8099 } 8100 a.off("next", this.onNext), a.off("scroll", this.onScroll) 8101 }, IASPagingExtension.prototype.getCurrentPageNum = function (a) { 8102 for (var b = this.pagebreaks.length - 1; b > 0; b--) if (a > this.pagebreaks[b][0]) return b + 1; 8103 return 1 8104 }, IASPagingExtension.prototype.getCurrentPagebreak = function (a) { 8105 for (var b = this.pagebreaks.length - 1; b >= 0; b--) if (a > this.pagebreaks[b][0]) return this.pagebreaks[b]; 8106 return null 8107 }, IASPagingExtension.prototype.priority = 500; 8108 var IASSpinnerExtension = function (a) { 8109 return a = jQuery.extend({}, this.defaults, a), this.ias = null, this.uid = (new Date).getTime(), this.src = a.src, this.html = a.html.replace("{src}", this.src), this.showSpinner = function () { 8110 var a = this.getSpinner() || this.createSpinner(), b = this.ias.getLastItem(); 8111 b.after(a), a.fadeIn() 8112 }, this.showSpinnerBefore = function () { 8113 var a = this.getSpinner() || this.createSpinner(), b = this.ias.getFirstItem(); 8114 b.before(a), a.fadeIn() 8115 }, this.removeSpinner = function () {
8116 this.hasSpinner() && this.getSpinner().remove() 8117 }, this.getSpinner = function () { 8118 var a = jQuery("#ias_spinner_" + this.uid); 8119 return a.length > 0 ? a : !1 8120 }, this.hasSpinner = function () { 8121 var a = jQuery("#ias_spinner_" + this.uid); 8122 return a.length > 0 8123 }, this.createSpinner = function () { 8124 var a = jQuery(this.html).attr("id", "ias_spinner_" + this.uid); 8125 return a.hide(), a 8126 }, this 8127 }; 8128 IASSpinnerExtension.prototype.bind = function (a) { 8129 this.ias = a, a.on("next", jQuery.proxy(this.showSpinner, this)), a.on("render", jQuery.proxy(this.removeSpinner, this)); 8130 try { 8131 a.on("prev", jQuery.proxy(this.showSpinnerBefore, this)) 8132 } catch (b) { 8133 } 8134 }, IASSpinnerExtension.prototype.unbind = function (a) { 8135 a.off("next", this.showSpinner), a.off("render", this.removeSpinner); 8136 try { 8137 a.off("prev", this.showSpinnerBefore) 8138 } catch (b) { 8139 } 8140 }, IASSpinnerExtension.prototype.defaults = { 8141 src: "data:image/gif;
8141base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAkKAAAALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQJCgAAACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg8DgQBgfrEsJAEAg4YhZIEiwgKtHiMBgtpg3wbUZXGO7kOb1MUKRFMysCChAoggJCIg0GC2aNe4gqQldfL4l/Ag1AXySJgn5LcoE3QXI3IQAh+QQJCgAAACwAAAAAEAAQAAAFdiAgAgLZNGU5joQhCEjxIssqEo8bC9BRjy9Ag7GILQ4QEoE0gBAEBcOpcBA0DoxSK/e8LRIHn+i1cK0IyKdg0VAoljYIg+GgnRrwVS/8IAkICyosBIQpBAMoKy9dImxPhS+GKkFrkX+TigtLlIyKXUF+NjagNiEAIfkECQoAAAAsAAAAABAAEAAABWwgIAICaRhlOY4EIgjH8R7LKhKHGwsMvb4AAy3WODBIBBKCsYA9TjuhDNDKEVSERezQEL0WrhXucRUQGuik7bFlngzqVW9LMl9XWvLdjFaJtDFqZ1cEZUB0dUgvL3dgP4WJZn4jkomWNpSTIyEAIfkECQoAAAAsAAAAABAAEAAABX4gIAICuSxlOY6CIgiD8RrEKgqGOwxwUrMlAoSwIzAGpJpgoSDAGifDY5kopBYDlEpAQBwevxfBtRIUGi8xwWkDNBCIwmC9Vq0aiQQDQuK+VgQPDXV9hCJjBwcFYU5pLwwHXQcMKSmNLQcIAExlbH8JBwttaX0ABAcNbWVbKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICSRBlOY7CIghN8zbEKsKoIjdFzZaEgUBHKChMJtRwcWpAWoWnifm6ESAMhO8lQK0EEAV3rFopIBCEcGwDKAqPh4HUrY4ICHH1dSoTFgcHUiZjBhAJB2AHDykpKAwHAwdzf19KkASIPl9cDgcnDkdtNwiMJCshACH5BAkKAAAALAAAAAAQABAAAAV3ICACAkkQZTmOAiosiyAoxCq+KPxCNVsSMRgBsiClWrLTSWFoIQZHl6pleBh6suxKMIhlvzbAwkBWfFWrBQTxNLq2RG2yhSUkDs2b63AYDAoJXAcFRwADeAkJDX0AQCsEfAQMDAIPBz0rCgcxky0JRWE1AmwpKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICKZzkqJ4nQZxLqZKv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAkKAAAALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQJCgAAACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQJCgAAACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==", 8142 html: '<div class="infinite-scroll"><div class="loader"></div></div>' 8143 }; 8144 var IASTriggerExtension = function (a) { 8145 return a = jQuery.extend({}, this.defaults, a), this.ias = null, this.html = a.html.replace("{text}", a.text), this.htmlPrev = a.htmlPrev.replace("{text}", a.textPrev), this.enabled = !0, this.count = 0, this.offset = a.offset, this.$triggerNext = null, this.$triggerPrev = null, this.showTriggerNext = function () { 8146 if (!this.enabled) return !0; 8147 if (!1 === this.offset || ++this.count < this.offset) return !0; 8148 var a = this.$triggerNext || (this.$triggerNext = this.createTrigger(this.next, this.html)), 8149 b = this.ias.getLastItem(); 8150 return b.after(a), a.fadeIn(), !1 8151 }, this.showTriggerPrev = function () { 8152 if (!this.enabled) return !0; 8153 var a = this.$triggerPrev || (this.$triggerPrev = this.createTrigger(this.prev, this.htmlPrev)), 8154 b = this.ias.getFirstItem(); 8155 return b.before(a), a.fadeIn(), !1 8156 }, this.onRendered = function () { 8157 this.enabled = !0 8158 }, this.createTrigger = function (a, b) { 8159 var c, d = (new Date).getTime(); 8160 return b = b || this.html, c = jQuery(b).attr("id", "ias_trigger_" + d), c.hide(), c.on("click", jQuery.proxy(a, this)), c 8161 }, this 8162 }; 8163 IASTriggerExtension.prototype.bind = function (a) { 8164 this.ias = a, a.on("next", jQuery.proxy(this.showTriggerNext, this), this.priority), a.on("rendered", jQuery.proxy(this.onRendered, this), this.priority); 8165 try { 8166 a.on("prev", jQuery.proxy(this.showTriggerPrev, this), this.priority) 8167 } catch (b) { 8168 } 8169 }, IASTriggerExtension.prototype.unbind = function (a) { 8170 a.off("next", this.showTriggerNext), a.off("rendered", this.onRendered); 8171 try { 8172 a.off("prev", this.showTriggerPrev) 8173 } catch (b) { 8174 } 8175 }, IASTriggerExtension.prototype.next = function () { 8176 this.enabled = !1, this.ias.pause(), this.$triggerNext && (this.$triggerNext.remove(), this.$triggerNext = null), this.ias.next() 8177 }, IASTriggerExtension.prototype.prev = function () { 8178 this.enabled = !1, this.ias.pause(), this.$triggerPrev && (this.$triggerPrev.remove(), this.$triggerPrev = null), this.ias.prev() 8179 }, IASTriggerExtension.prototype.defaults = { 8180 text: "Load more items", 8181 html: '<div id="infinite-trigger" class="ias-trigger ias-trigger-next" style="cursor: pointer;"><a class="btn" href="#infinite-trigger">{text}</a></div>', 8182 textPrev: "Load previous items", 8183 htmlPrev: '<div id="infinite-trigger" class="ias-trigger ias-trigger-prev" style="cursor: pointer;"><a class="btn" href="#infinite-trigger">{text}</a></div>', 8184 offset: 0 8185 }, IASTriggerExtension.prototype.priority = 1e3; 8186 8187 // Define Infinite Scroll For Theme 8188 8189 var ias = jQuery.ias({ 8190 container: ".posts", 8191 item: "article", 8192 pagination: ".infinite", 8193 next: ".nav-previous a", 8194 }); 8195 ias.extension(new IASSpinnerExtension({})); 8196 ias.extension(new IASTriggerExtension({ 8197 text: $infinite_local_vars.infinite_scroll_text, 8198 offset: 3 8199 })); 8200 ias.extension(new IASNoneLeftExtension({text: $infinite_local_vars.infinite_scroll_text_finished,})); 8201} 8202 8203/* 8204 Back To Top Button (Scroll to Top) 8205 ======================================= */ 8206 8207if (evolve_js_local_vars.scroll_to_top === '1') { 8208 8209 jQuery(function ($) { 8210 $(window).scroll(function () { 8211 if ($(this).scrollTop() > 50) { 8212 $('#backtotop').fadeIn(); 8213 } else { 8214 $('#backtotop').fadeOut(); 8215 } 8216 }); 8217 $('#backtotop').click(function () { 8218 $('body,html').animate({ 8219 scrollTop: 0 8220 }, 600); 8221 return false;
8222 }); 8223 }); 8224 8225} 8226 8227/* 8228 Post/Comment Edit Link 8229 ======================================= */ 8230 8231jQuery(function ($) { 8232 $("article").mouseover(function () { 8233 $(this).find("span.edit-post").addClass('fadein'); 8234 } 8235 ).mouseout(function () { 8236 $(this).find("span.edit-post").removeClass('fadein'); 8237 } 8238 ); 8239 $("li.comment").mouseover(function () { 8240 $(this).find("span.edit-comment").addClass('fadein'); 8241 } 8242 ).mouseout(function () { 8243 $(this).find("span.edit-comment").removeClass('fadein'); 8244 } 8245 ) 8246}); 8247 8248/* 8249 Buttons Animate.css 8250 ======================================= */ 8251 8252if (evolve_js_local_vars.buttons_effect !== 'disable') { 8253 8254 jQuery(function ($) { 8255 $('.btn, .button, .widget .button, button, input#submit, input[type=submit]').hover( 8256 function () { 8257 $(this).addClass(evolve_js_local_vars.buttons_effect) 8258 }, 8259 function () { 8260 $(this).removeClass(evolve_js_local_vars.buttons_effect) 8261 } 8262 ) 8263 }); 8264 8265} 8266 8267/* 8268 Counter Circle 8269 ======================================= */ 8270 8271if (evolve_js_local_vars.counter_circle === '1') { 8272 8273 /* 8274 easyPieChart - v2.1.7 8275 https://github.com/rendro/easy-pie-chart 8276 */ 8277 8278 (function (root, factory) { 8279 if (typeof exports === 'object') { 8280 module.exports = factory(require('jquery')); 8281 } else if (typeof define === 'function' && define.amd) { 8282 define(['jquery'], factory); 8283 } else { 8284 factory(root.jQuery); 8285 } 8286 }(this, function ($) { 8287 /** 8288 * Renderer to render the chart on a canvas object 8289 * @param {DOMElement} el DOM element to host the canvas (root of the plugin) 8290 * @param {object} options options object of the plugin 8291 */ 8292 var CanvasRenderer = function (el, options) { 8293 var cachedBackground; 8294 var canvas = document.createElement('canvas'); 8295 8296 el.appendChild(canvas); 8297 8298 if (typeof(G_vmlCanvasManager) === 'object') { 8299 G_vmlCanvasManager.initElement(canvas); 8300 } 8301 8302 var ctx = canvas.getContext('2d'); 8303 8304 canvas.width = canvas.height = options.size; 8305 8306 // canvas on retina devices 8307 var scaleBy = 1; 8308 if (window.devicePixelRatio > 1) { 8309 scaleBy = window.devicePixelRatio; 8310 canvas.style.width = canvas.style.height = [options.size, 'px'].join(''); 8311 canvas.width = canvas.height = options.size * scaleBy; 8312 ctx.scale(scaleBy, scaleBy); 8313 } 8314 8315 // move 0,0 coordinates to the center 8316 ctx.translate(options.size / 2, options.size / 2); 8317 8318 // rotate canvas -90deg 8319 ctx.rotate((-1 / 2 + options.rotate / 180) * Math.PI); 8320 8321 var radius = (options.size - options.lineWidth) / 2; 8322 if (options.scaleColor && options.scaleLength) { 8323 radius -= options.scaleLength + 2; // 2 is the distance between scale and bar 8324 } 8325 8326 // IE polyfill for Date 8327 Date.now = Date.now || function () { 8328 return +(new Date()); 8329 }; 8330 8331 /** 8332 * Draw a circle around the center of the canvas 8333 * @param {strong} color Valid CSS color string 8334 * @param {number} lineWidth Width of the line in px 8335 * @param {number} percent Percentage to draw (float between -1 and 1) 8336 */ 8337 var drawCircle = function (color, lineWidth, percent) { 8338 percent = Math.min(Math.max(-1, percent || 0), 1); 8339 var isNegative = percent <= 0 ? true : false; 8340 8341 ctx.beginPath(); 8342 ctx.arc(0, 0, radius, 0, Math.PI * 2 * percent, isNegative); 8343 8344 ctx.strokeStyle = color; 8345 ctx.lineWidth = lineWidth; 8346 8347 ctx.stroke(); 8348 }; 8349 8350 /** 8351 * Draw the scale of the chart 8352 */ 8353 var drawScale = function () { 8354 var offset; 8355 var length; 8356 8357 ctx.lineWidth = 1; 8358 ctx.fillStyle = options.scaleColor; 8359 8360 ctx.save(); 8361 for (var i = 24; i > 0; --i) { 8362 if (i % 6 === 0) { 8363 length = options.scaleLength; 8364 offset = 0; 8365 } else { 8366 length = options.scaleLength * 0.6; 8367 offset = options.scaleLength - length; 8368 } 8369 ctx.fillRect(-options.size / 2 + offset, 0, length, 1); 8370 ctx.rotate(Math.PI / 12); 8371 }
8372 ctx.restore(); 8373 }; 8374 8375 /** 8376 * Request animation frame wrapper with polyfill 8377 * @return {function} Request animation frame method or timeout fallback 8378 */ 8379 var reqAnimationFrame = (function () { 8380 return window.requestAnimationFrame || 8381 window.webkitRequestAnimationFrame || 8382 window.mozRequestAnimationFrame || 8383 function (callback) { 8384 window.setTimeout(callback, 1000 / 60); 8385 }; 8386 }()); 8387 8388 /** 8389 * Draw the background of the plugin including the scale and the track 8390 */ 8391 var drawBackground = function () { 8392 if (options.scaleColor) drawScale(); 8393 if (options.trackColor) drawCircle(options.trackColor, options.trackWidth || options.lineWidth, 1); 8394 }; 8395 8396 /** 8397 * Canvas accessor 8398 */ 8399 this.getCanvas = function () { 8400 return canvas; 8401 }; 8402 8403 /** 8404 * Canvas 2D context 'ctx' accessor 8405 */ 8406 this.getCtx = function () { 8407 return ctx; 8408 }; 8409 8410 /** 8411 * Clear the complete canvas 8412 */ 8413 this.clear = function () { 8414 ctx.clearRect(options.size / -2, options.size / -2, options.size, options.size); 8415 }; 8416 8417 /** 8418 * Draw the complete chart 8419 * @param {number} percent Percent shown by the chart between -100 and 100 8420 */ 8421 this.draw = function (percent) { 8422 // do we need to render a background 8423 if (!!options.scaleColor || !!options.trackColor) { 8424 // getImageData and putImageData are supported 8425 if (ctx.getImageData && ctx.putImageData) { 8426 if (!cachedBackground) { 8427 drawBackground(); 8428 cachedBackground = ctx.getImageData(0, 0, options.size * scaleBy, options.size * scaleBy); 8429 } else { 8430 ctx.putImageData(cachedBackground, 0, 0); 8431 } 8432 } else { 8433 this.clear(); 8434 drawBackground(); 8435 } 8436 } else { 8437 this.clear(); 8438 } 8439 8440 ctx.lineCap = options.lineCap; 8441 8442 // if barcolor is a function execute it and pass the percent as a value 8443 var color; 8444 if (typeof(options.barColor) === 'function') { 8445 color = options.barColor(percent); 8446 } else { 8447 color = options.barColor; 8448 } 8449 8450 // draw bar 8451 drawCircle(color, options.lineWidth, percent / 100); 8452 }.bind(this); 8453 8454 /** 8455 * Animate from some percent to some other percentage 8456 * @param {number} from Starting percentage 8457 * @param {number} to Final percentage 8458 */ 8459 this.animate = function (from, to) { 8460 var startTime = Date.now(); 8461 options.onStart(from, to); 8462 var animation = function () { 8463 var process = Math.min(Date.now() - startTime, options.animate.duration); 8464 var currentValue = options.easing(this, process, from, to - from, options.animate.duration); 8465 this.draw(currentValue); 8466 options.onStep(from, to, currentValue); 8467 if (process >= options.animate.duration) { 8468 options.onStop(from, to); 8469 } else { 8470 reqAnimationFrame(animation); 8471 } 8472 }.bind(this); 8473 8474 reqAnimationFrame(animation); 8475 }.bind(this); 8476 }; 8477 8478 var EasyPieChart = function (el, opts) { 8479 var defaultOptions = { 8480 barColor: '#ef1e25', 8481 trackColor: '#f9f9f9', 8482 scaleColor: '#dfe0e0', 8483 scaleLength: 5, 8484 lineCap: 'round', 8485 lineWidth: 3, 8486 trackWidth: undefined, 8487 size: 110, 8488 rotate: 0, 8489 animate: { 8490 duration: 1000, 8491 enabled: true 8492 }, 8493 easing: function (x, t, b, c, d) { // more can be found here: http://gsgd.co.uk/sandbox/jquery/easing/ 8494 t = t / (d / 2); 8495 if (t < 1) { 8496 return c / 2 * t * t + b; 8497 } 8498 return -c / 2 * ((--t) * (t - 2) - 1) + b; 8499 }, 8500 onStart: function (from, to) { 8501 return; 8502 }, 8503 onStep: function (from, to, currentValue) { 8504 return; 8505 }, 8506 onStop: function (from, to) { 8507 return; 8508 } 8509 }; 8510 8511 // detect present renderer 8512 if (typeof(CanvasRenderer) !== 'undefined') { 8513 defaultOptions.renderer = CanvasRenderer; 8514 } else if (typeof(SVGRenderer) !== 'undefined') { 8515 defaultOptions.renderer = SVGRenderer; 8516 } else { 8517 throw new Error('Please load either the SVG- or the CanvasRenderer'); 8518 } 8519 8520 var options = {}; 8521 var currentValue = 0; 8522 8523 /** 8524 * Initialize the plugin by creating the options object and initialize rendering 8525 */ 8526 var init = function () { 8527 this.el = el; 8528 this.options = options; 8529 8530 // merge user options into default options 8531 for (var i in defaultOptions) { 8532 if (defaultOptions.hasOwnProperty(i)) { 8533 options[i] = opts && typeof(opts[i]) !== 'undefined' ? opts[i] : defaultOptions[i]; 8534 if (typeof(options[i]) === 'function') { 8535 options[i] = options[i].bind(this); 8536 } 8537 } 8538 } 8539 8540 // check for jQuery easing 8541 if (typeof(options.easing) === 'string' && typeof(jQuery) !== 'undefined' && jQuery.isFunction(jQuery.easing[options.easing])) { 8542 options.easing = jQuery.easing[options.easing]; 8543 } else { 8544 options.easing = defaultOptions.easing; 8545 } 8546 8547 // process earlier animate option to avoid bc breaks 8548 if (typeof(options.animate) === 'number') { 8549 options.animate = { 8550 duration: options.animate, 8551 enabled: true 8552 }; 8553 } 8554 8555 if (typeof(options.animate) === 'boolean' && !options.animate) { 8556 options.animate = { 8557 duration: 1000, 8558 enabled: options.animate 8559 }; 8560 } 8561 8562 // create renderer 8563 this.renderer = new options.renderer(el, options); 8564 8565 // initial draw 8566 this.renderer.draw(currentValue); 8567 8568 // initial update 8569 if (el.dataset && el.dataset.percent) { 8570 this.update(parseFloat(el.dataset.percent)); 8571 } else if (el.getAttribute && el.getAttribute('data-percent')) { 8572 this.update(parseFloat(el.getAttribute('data-percent'))); 8573 } 8574 }.bind(this); 8575 8576 /** 8577 * Update the value of the chart 8578 * @param {number} newValue Number between 0 and 100 8579 * @return {object} Instance of the plugin for method chaining 8580 */ 8581 this.update = function (newValue) { 8582 newValue = parseFloat(newValue); 8583 if (options.animate.enabled) { 8584 this.renderer.animate(currentValue, newValue); 8585 } else { 8586 this.renderer.draw(newValue); 8587 } 8588 currentValue = newValue; 8589 return this; 8590 }.bind(this); 8591 8592 /** 8593 * Disable animation 8594 * @return {object} Instance of the plugin for method chaining 8595 */ 8596 this.disableAnimation = function () { 8597 options.animate.enabled = false;
8598 return this; 8599 }; 8600 8601 /** 8602 * Enable animation 8603 * @return {object} Instance of the plugin for method chaining 8604 */ 8605 this.enableAnimation = function () { 8606 options.animate.enabled = true; 8607 return this; 8608 }; 8609 8610 init(); 8611 }; 8612 8613 $.fn.easyPieChart = function (options) { 8614 return this.each(function () { 8615 var instanceOptions; 8616 8617 if (!$.data(this, 'easyPieChart')) { 8618 instanceOptions = $.extend({}, options, $(this).data()); 8619 $.data(this, 'easyPieChart', new EasyPieChart(this, instanceOptions)); 8620 } 8621 }); 8622 }; 8623 8624 })); 8625 8626 (function (jQuery) { 8627 8628 "use strict"; 8629 8630 jQuery.fn.draw_circles = function () { 8631 var circle = jQuery(this); 8632 var countdown = circle.children('.counter-circle-content').attr('data-countdown'); 8633 var filledcolor = circle.children('.counter-circle-content').attr('data-filledcolor'); 8634 var unfilledcolor = circle.children('.counter-circle-content').attr('data-unfilledcolor'); 8635 var scale = circle.children('.counter-circle-content').attr('data-scale'); 8636 var size = circle.children('.counter-circle-content').attr('data-size'); 8637 var speed = circle.children('.counter-circle-content').attr('data-speed'); 8638 var stroksize = circle.children('.counter-circle-content').attr('data-strokesize'); 8639 8640 var percentage = circle.children('.counter-circle-content').attr('data-percent'); 8641 8642 if (scale) { 8643 scale = jQuery('body').css('color'); 8644 } 8645 8646 if (countdown) { 8647 circle.children('.counter-circle-content').attr('data-percent', 100); 8648 8649 circle.children('.counter-circle-content').easyPieChart({ 8650 barColor: filledcolor, 8651 trackColor: unfilledcolor, 8652 scaleColor: scale, 8653 scaleLength: 5, 8654 lineCap: 'round', 8655 lineWidth: stroksize, 8656 size: size, 8657 rotate: 0, 8658 animate: { 8659 duration: speed, enabled: true 8660 } 8661 }); 8662 circle.children('.counter-circle-content').data('easyPieChart').enableAnimation(); 8663 circle.children('.counter-circle-content').data('easyPieChart').update(percentage); 8664 } else { 8665 circle.children('.counter-circle-content').easyPieChart({ 8666 barColor: filledcolor, 8667 trackColor: unfilledcolor, 8668 scaleColor: scale, 8669 scaleLength: 5, 8670 lineCap: 'round', 8671 lineWidth: stroksize, 8672 size: size, 8673 rotate: 0, 8674 animate: { 8675 duration: speed, enabled: true 8676 } 8677 }); 8678 } 8679 }; 8680 })(jQuery); 8681} 8682 8683/* 8684 jQuery Waypoints 8685 ======================================= */ 8686 8687jQuery((function () { 8688 var __indexOf = [].indexOf || function (item) { 8689 for (var i = 0, l = this.length; i < l; i++) { 8690 if (i in this && this[i] === item) 8691 return i; 8692 } 8693 return -1; 8694 }, 8695 __slice = [].slice; 8696 8697 (function (root, factory) { 8698 if (typeof define === 'function' && define.amd) { 8699 return define('waypoints', ['jquery'], function ($) { 8700 return factory($, root); 8701 }); 8702 } else { 8703 return factory(root.jQuery, root); 8704 } 8705 })(this, function ($, window) { 8706 var $w, Context, Waypoint, allWaypoints, contextCounter, contextKey, contexts, isTouch, jQMethods, methods, 8707 resizeEvent, scrollEvent, waypointCounter, waypointKey, wp, wps; 8708 8709 $w = $(window); 8710 isTouch = __indexOf.call(window, 'ontouchstart') >= 0; 8711 allWaypoints = { 8712 horizontal: {}, 8713 vertical: {} 8714 }; 8715 contextCounter = 1; 8716 contexts = {}; 8717 contextKey = 'waypoints-context-id'; 8718 resizeEvent = 'resize.waypoints'; 8719 scrollEvent = 'scroll.waypoints'; 8720 waypointCounter = 1; 8721 waypointKey = 'waypoints-waypoint-ids'; 8722 wp = 'waypoint'; 8723 wps = 'waypoints'; 8724 Context = (function () { 8725 function Context($element) { 8726 var _this = this; 8727 8728 this.$element = $element; 8729 this.element = $element[0]; 8730 this.didResize = false;
8731 this.didScroll = false; 8732 this.id = 'context' + contextCounter++; 8733 this.oldScroll = { 8734 x: $element.scrollLeft(), 8735 y: $element.scrollTop() 8736 }; 8737 this.waypoints = { 8738 horizontal: {}, 8739 vertical: {} 8740 }; 8741 $element.data(contextKey, this.id); 8742 contexts[this.id] = this; 8743 $element.bind(scrollEvent, function () { 8744 var scrollHandler; 8745 8746 if (!(_this.didScroll || isTouch)) { 8747 _this.didScroll = true; 8748 scrollHandler = function () { 8749 _this.doScroll(); 8750 return _this.didScroll = false; 8751 }; 8752 return window.setTimeout(scrollHandler, $[wps].settings.scrollThrottle); 8753 } 8754 }); 8755 $element.bind(resizeEvent, function () { 8756 var resizeHandler; 8757 8758 if (!_this.didResize) { 8759 _this.didResize = true; 8760 resizeHandler = function () { 8761 $[wps]('refresh'); 8762 return _this.didResize = false; 8763 }; 8764 return window.setTimeout(resizeHandler, $[wps].settings.resizeThrottle); 8765 } 8766 }); 8767 } 8768 8769 Context.prototype.doScroll = function () { 8770 var axes, 8771 _this = this; 8772 8773 axes = { 8774 horizontal: { 8775 newScroll: this.$element.scrollLeft(), 8776 oldScroll: this.oldScroll.x, 8777 forward: 'right', 8778 backward: 'left' 8779 }, 8780 vertical: { 8781 newScroll: this.$element.scrollTop(), 8782 oldScroll: this.oldScroll.y, 8783 forward: 'down', 8784 backward: 'up' 8785 } 8786 }; 8787 if (isTouch && (!axes.vertical.oldScroll || !axes.vertical.newScroll)) { 8788 $[wps]('refresh'); 8789 } 8790 $.each(axes, function (aKey, axis) { 8791 var direction, isForward, triggered; 8792 8793 triggered = []; 8794 isForward = axis.newScroll > axis.oldScroll; 8795 direction = isForward ? axis.forward : axis.backward; 8796 $.each(_this.waypoints[aKey], function (wKey, waypoint) { 8797 var _ref, _ref1; 8798 8799 if ((axis.oldScroll < (_ref = waypoint.offset) && _ref <= axis.newScroll)) { 8800 return triggered.push(waypoint); 8801 } else if ((axis.newScroll < (_ref1 = waypoint.offset) && _ref1 <= axis.oldScroll)) { 8802 return triggered.push(waypoint); 8803 } 8804 }); 8805 triggered.sort(function (a, b) { 8806 return a.offset - b.offset; 8807 }); 8808 if (!isForward) { 8809 triggered.reverse(); 8810 } 8811 return $.each(triggered, function (i, waypoint) { 8812 if (waypoint.options.continuous || i === triggered.length - 1) { 8813 return waypoint.trigger([direction]); 8814 } 8815 }); 8816 }); 8817 return this.oldScroll = { 8818 x: axes.horizontal.newScroll, 8819 y: axes.vertical.newScroll 8820 }; 8821 }; 8822 8823 Context.prototype.refresh = function () { 8824 var axes, cOffset, isWin, 8825 _this = this; 8826 8827 isWin = $.isWindow(this.element); 8828 cOffset = this.$element.offset(); 8829 this.doScroll(); 8830 axes = { 8831 horizontal: { 8832 contextOffset: isWin ? 0 : cOffset.left, 8833 contextScroll: isWin ? 0 : this.oldScroll.x, 8834 contextDimension: this.$element.width(), 8835 oldScroll: this.oldScroll.x, 8836 forward: 'right', 8837 backward: 'left', 8838 offsetProp: 'left' 8839 }, 8840 vertical: { 8841 contextOffset: isWin ? 0 : cOffset.top, 8842 contextScroll: isWin ? 0 : this.oldScroll.y, 8843 contextDimension: isWin ? $[wps]('viewportHe
8843ight') : this.$element.height(), 8844 oldScroll: this.oldScroll.y, 8845 forward: 'down', 8846 backward: 'up', 8847 offsetProp: 'top' 8848 } 8849 }; 8850 return $.each(axes, function (aKey, axis) { 8851 return $.each(_this.waypoints[aKey], function (i, waypoint) { 8852 var adjustment, elementOffset, oldOffset, _ref, _ref1; 8853 8854 adjustment = waypoint.options.offset; 8855 oldOffset = waypoint.offset; 8856 elementOffset = $.isWindow(waypoint.element) ? 0 : waypoint.$element.offset()[axis.offsetProp]; 8857 if ($.isFunction(adjustment)) { 8858 adjustment = adjustment.apply(waypoint.element); 8859 } else if (typeof adjustment === 'string') { 8860 adjustment = parseFloat(adjustment); 8861 if (waypoint.options.offset.indexOf('%') > -1) { 8862 adjustment = Math.ceil(axis.contextDimension * adjustment / 100); 8863 } 8864 } 8865 waypoint.offset = elementOffset - axis.contextOffset + axis.contextScroll - adjustment; 8866 if ((waypoint.options.onlyOnScroll && (oldOffset != null)) || !waypoint.enabled) { 8867 return; 8868 } 8869 if (oldOffset !== null && (oldOffset < (_ref = axis.oldScroll) && _ref <= waypoint.offset)) { 8870 return waypoint.trigger([axis.backward]); 8871 } else if (oldOffset !== null && (oldOffset > (_ref1 = axis.oldScroll) && _ref1 >= waypoint.offset)) { 8872 return waypoint.trigger([axis.forward]); 8873 } else if (oldOffset === null && axis.oldScroll >= waypoint.offset) { 8874 return waypoint.trigger([axis.forward]); 8875 } 8876 }); 8877 }); 8878 }; 8879 8880 Context.prototype.checkEmpty = function () { 8881 if ($.isEmptyObject(this.waypoints.horizontal) && $.isEmptyObject(this.waypoints.vertical)) { 8882 this.$element.unbind([resizeEvent, scrollEvent].join(' ')); 8883 return delete contexts[this.id]; 8884 } 8885 }; 8886 8887 return Context; 8888 8889 })(); 8890 Waypoint = (function () { 8891 function Waypoint($element, context, options) { 8892 var idList, _ref; 8893 8894 options = $.extend({}, $.fn[wp].defaults, options); 8895 if (options.offset === 'bottom-in-view') { 8896 options.offset = function () { 8897 var contextHeight; 8898 8899 contextHeight = $[wps]('viewportHeight'); 8900 if (!$.isWindow(context.element)) { 8901 contextHeight = context.$element.height(); 8902 } 8903 return contextHeight - $(this).outerHeight(); 8904 }; 8905 } 8906 this.$element = $element; 8907 this.element = $element[0]; 8908 this.axis = options.horizontal ? 'horizontal' : 'vertical'; 8909 this.callback = options.handler; 8910 this.context = context; 8911 this.enabled = options.enabled; 8912 this.id = 'waypoints' + waypointCounter++; 8913 this.offset = null; 8914 this.options = options; 8915 context.waypoints[this.axis][this.id] = this; 8916 allWaypoints[this.axis][this.id] = this; 8917 idList = (_ref = $element.data(waypointKey)) != null ? _ref : []; 8918 idList.push(this.id); 8919 $element.data(waypointKey, idList); 8920 } 8921 8922 Waypoint.prototype.trigger = function (args) { 8923 if (!this.enabled) { 8924 return; 8925 } 8926 if (this.callback != null) { 8927 this.callback.apply(this.element, args); 8928 } 8929 if (this.options.triggerOnce) { 8930 return this.destroy(); 8931 } 8932 }; 8933 8934 Waypoint.prototype.disable = function () { 8935 return this.enabled = false;
8936 }; 8937 8938 Waypoint.prototype.enable = function () { 8939 this.context.refresh(); 8940 return this.enabled = true; 8941 }; 8942 8943 Waypoint.prototype.destroy = function () { 8944 delete allWaypoints[this.axis][this.id]; 8945 delete this.context.waypoints[this.axis][this.id]; 8946 return this.context.checkEmpty(); 8947 }; 8948 8949 Waypoint.getWaypointsByElement = function (element) { 8950 var all, ids; 8951 8952 ids = $(element).data(waypointKey); 8953 if (!ids) { 8954 return []; 8955 } 8956 all = $.extend({}, allWaypoints.horizontal, allWaypoints.vertical); 8957 return $.map(ids, function (id) { 8958 return all[id]; 8959 }); 8960 }; 8961 8962 return Waypoint; 8963 8964 })(); 8965 methods = { 8966 init: function (f, options) { 8967 var _ref; 8968 8969 if (options == null) { 8970 options = {}; 8971 } 8972 if ((_ref = options.handler) == null) { 8973 options.handler = f; 8974 } 8975 this.each(function () { 8976 var $this, context, contextElement, _ref1; 8977 8978 $this = $(this); 8979 contextElement = (_ref1 = options.context) != null ? _ref1 : $.fn[wp].defaults.context; 8980 if (!$.isWindow(contextElement)) { 8981 contextElement = $this.closest(contextElement); 8982 } 8983 contextElement = $(contextElement); 8984 context = contexts[contextElement.data(contextKey)]; 8985 if (!context) { 8986 context = new Context(contextElement); 8987 } 8988 return new Waypoint($this, context, options); 8989 }); 8990 $[wps]('refresh'); 8991 return this; 8992 }, 8993 disable: function () { 8994 return methods._invoke(this, 'disable'); 8995 }, 8996 enable: function () { 8997 return methods._invoke(this, 'enable'); 8998 }, 8999 destroy: function () { 9000 return methods._invoke(this, 'destroy'); 9001 }, 9002 prev: function (axis, selector) { 9003 return methods._traverse.call(this, axis, selector, function (stack, index, waypoints) { 9004 if (index > 0) { 9005 return stack.push(waypoints[index - 1]); 9006 } 9007 }); 9008 }, 9009 next: function (axis, selector) { 9010 return methods._traverse.call(this, axis, selector, function (stack, index, waypoints) { 9011 if (index < waypoints.length - 1) { 9012 return stack.push(waypoints[index + 1]); 9013 } 9014 }); 9015 }, 9016 _traverse: function (axis, selector, push) { 9017 var stack, waypoints; 9018 9019 if (axis == null) { 9020 axis = 'vertical'; 9021 } 9022 if (selector == null) { 9023 selector = window; 9024 } 9025 waypoints = jQMethods.aggregate(selector); 9026 stack = []; 9027 this.each(function () { 9028 var index; 9029 9030 index = $.inArray(this, waypoints[axis]); 9031 return push(stack, index, waypoints[axis]); 9032 }); 9033 return this.pushStack(stack); 9034 }, 9035 _invoke: function ($elements, method) { 9036 $elements.each(function () { 9037 var waypoints; 9038 9039 waypoints = Waypoint.getWaypointsByElement(this); 9040 return $.each(waypoints, function (i, waypoint) { 9041 waypoint[method](); 9042 return true; 9043 }); 9044 }); 9045 return this; 9046 } 9047 }; 9048 $.fn[wp] = function () { 9049 var args, method; 9050 9051 method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; 9052 if (methods[method]) { 9053 return methods[method].apply(this, args); 9054 } else if ($.isFunction(method)) { 9055 return methods.init.apply(this, arguments); 9056 } else if ($.isPlainObject(method)) { 9057 return methods.init.apply(this, [null, method]); 9058 }
9058 else if (!method) { 9059 return $.error("jQuery Waypoints needs a callback function or handler option."); 9060 } else { 9061 return $.error("The " + method + " method does not exist in jQuery Waypoints."); 9062 } 9063 }; 9064 $.fn[wp].defaults = { 9065 context: window, 9066 continuous: true, 9067 enabled: true, 9068 horizontal: false, 9069 offset: 0, 9070 triggerOnce: false 9071 }; 9072 jQMethods = { 9073 refresh: function () { 9074 return $.each(contexts, function (i, context) { 9075 return context.refresh(); 9076 }); 9077 }, 9078 viewportHeight: function () { 9079 var _ref; 9080 9081 return (_ref = window.innerHeight) != null ? _ref : $w.height(); 9082 }, 9083 aggregate: function (contextSelector) { 9084 var collection, waypoints, _ref; 9085 9086 collection = allWaypoints; 9087 if (contextSelector) { 9088 collection = (_ref = contexts[$(contextSelector).data(contextKey)]) != null ? _ref.waypoints : void 0; 9089 } 9090 if (!collection) { 9091 return []; 9092 } 9093 waypoints = { 9094 horizontal: [], 9095 vertical: [] 9096 }; 9097 $.each(waypoints, function (axis, arr) { 9098 $.each(collection[axis], function (key, waypoint) { 9099 return arr.push(waypoint); 9100 }); 9101 arr.sort(function (a, b) { 9102 return a.offset - b.offset; 9103 }); 9104 waypoints[axis] = $.map(arr, function (waypoint) { 9105 return waypoint.element; 9106 }); 9107 return waypoints[axis] = $.unique(waypoints[axis]); 9108 }); 9109 return waypoints; 9110 }, 9111 above: function (contextSelector) { 9112 if (contextSelector == null) { 9113 contextSelector = window; 9114 } 9115 return jQMethods._filter(contextSelector, 'vertical', function (context, waypoint) { 9116 return waypoint.offset <= context.oldScroll.y; 9117 }); 9118 }, 9119 below: function (contextSelector) { 9120 if (contextSelector == null) { 9121 contextSelector = window; 9122 } 9123 return jQMethods._filter(contextSelector, 'vertical', function (context, waypoint) { 9124 return waypoint.offset > context.oldScroll.y; 9125 }); 9126 }, 9127 left: function (contextSelector) { 9128 if (contextSelector == null) { 9129 contextSelector = window; 9130 } 9131 return jQMethods._filter(contextSelector, 'horizontal', function (context, waypoint) { 9132 return waypoint.offset <= context.oldScroll.x; 9133 }); 9134 }, 9135 right: function (contextSelector) { 9136 if (contextSelector == null) { 9137 contextSelector = window; 9138 } 9139 return jQMethods._filter(contextSelector, 'horizontal', function (context, waypoint) { 9140 return waypoint.offset > context.oldScroll.x; 9141 }); 9142 }, 9143 enable: function () { 9144 return jQMethods._invoke('enable'); 9145 }, 9146 disable: function () { 9147 return jQMethods._invoke('disable'); 9148 }, 9149 destroy: function () { 9150 return jQMethods._invoke('destroy'); 9151 }, 9152 extendFn: function (methodName, f) { 9153 return methods[methodName] = f; 9154 }, 9155 _invoke: function (method) { 9156 var waypoints; 9157 9158 waypoints = $.extend({}, allWaypoints.vertical, allWaypoints.horizontal); 9159 return $.each(waypoints, function (key, waypoint) { 9160 waypoint[method](); 9161 return true; 9162 }); 9163 }, 9164 _filter: function (selector, axis, test) { 9165 var context, waypoints; 9166 9167 context = contexts[$(selector).data(contextKey)]; 9168 if (!context) { 9169 return []; 9170 } 9171 waypoints = []; 9172 $.each(context.waypoints[axis], function (i, waypoint) { 9173 if (test(context, waypoint)) { 9174 return waypoints.push(waypoint); 9175 } 9176 }); 9177 waypoints.sort(function (a, b) { 9178 return a.offset - b.offset; 9179 }); 9180 return $.map(waypoints, function (waypoint) { 9181 return waypoint.element; 9182 }); 9183 } 9184 }; 9185 $[wps] = function () { 9186 var args, method; 9187 9188 method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; 9189 if (jQMethods[method]) {
9190 return jQMethods[method].apply(null, args); 9191 } else { 9192 return jQMethods.aggregate.call(null, method); 9193 } 9194 }; 9195 $[wps].settings = { 9196 resizeThrottle: 100, 9197 scrollThrottle: 30 9198 }; 9199 return $w.on("load", function () { 9200 return $[wps]('refresh'); 9201 }); 9202 }); 9203 9204}).call(this)); 9205 9206// Theme Defined Waypoints 9207 9208jQuery(window).on("load", function () { 9209 9210 jQuery('.counter-circle').waypoint(function () { 9211 jQuery(this).draw_circles(); 9212 }, { 9213 triggerOnce: true, 9214 offset: 'bottom-in-view' 9215 }); 9216 9217 jQuery('.component-animated').waypoint(function () { 9218 9219 jQuery(this).css('visibility', 'visible'); 9220 9221 // this code is executed for each appeared element 9222 var animation_type = jQuery(this).data('animationtype'); 9223 var animation_duration = jQuery(this).data('animationduration'); 9224 9225 jQuery(this).addClass(animation_type); 9226 9227 if (animation_duration) { 9228 jQuery(this).css('-webkit-animation-duration', animation_duration + 's'); 9229 jQuery(this).css('animation-duration', animation_duration + 's'); 9230 } 9231 }, {triggerOnce: true, offset: 'bottom-in-view'}); 9232}); 9233 9234/* 9235 Footer Reveal Effect 9236 ======================================= */ 9237 9238if (evolve_js_local_vars.footer_reveal === '1') { 9239 9240 /* footer-reveal.js 9241 * 9242 * Licensed under the MIT license. 9243 * http://www.opensource.org/licenses/mit-license.php 9244 * 9245 * Copyright 2014 Iain Andrew 9246 * https://github.com/IainAndrew 9247 */ 9248 9249 jQuery(function ($) { 9250 $.fn.footerReveal = function (options) { 9251 9252 var $this = $(this), 9253 $prev = $this.prev(), 9254 $win = $(window), 9255 9256 defaults = $.extend({ 9257 shadow: false, 9258 shadowOpacity: 0.6, 9259 zIndex: -100 9260 }, options), 9261 9262 settings = $.extend(true, {}, defaults, options); 9263 9264 if ($this.outerHeight() <= $win.outerHeight() && $this.offset().top >= $win.outerHeight()) { 9265 $this.css({ 9266 'z-index': defaults.zIndex, 9267 position: 'fixed', 9268 bottom: 0 9269 }); 9270 9271 if (defaults.shadow) { 9272 $prev.css({ 9273 '-webkit-box-shadow': ' 0 0 9px rgba(0,0,0,' + defaults.shadowOpacity + ')', 9274 'box-shadow': ' 0 0 9px rgba(0,0,0,' + defaults.shadowOpacity + ')' 9275 }); 9276 } 9277 9278 $win.on('load resize footerRevealResize', function () { 9279 $this.css({ 9280 'width': $prev.outerWidth() 9281 }); 9282 $prev.css({ 9283 'margin-bottom': $this.outerHeight() 9284 }); 9285 }); 9286 } 9287 return this; 9288 }; 9289 9290 var widths = $('#wrapper').width(); 9291 $('.footer').footerReveal({width: widths}); 9292 }); 9293 9294} 9295 9296/* 9297 Premium Features 9298 ======================================= */ 9299 9300/* 9301 Contact Form Google Map 9302 --------------------------------------- */ 9303 9304if (evolve_js_local_vars.google_maps === '1') { 9305 9306 /** 9307 * jQuery goMap 9308 * 9309 * @url http://www.pittss.lv/jquery/gomap/ 9310 * @author Jevgenijs Shtrauss <[email protected]> 9311 * @version 1.3.3 2014.11.27 9312 * This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 9313 */ 9314 9315 (function ($) { 9316 var geocoder = new google.maps.Geocoder(); 9317 9318 function MyOverlay(map) { 9319 this.setMap(map); 9320 }; 9321 MyOverlay.prototype = new google.maps.OverlayView(); 9322 MyOverlay.prototype.onAdd = function () { 9323 }; 9324 MyOverlay.prototype.onRemove = function () { 9325 }; 9326 MyOverlay.prototype.draw = function () { 9327 }; 9328 9329 $.goMap = {}; 9330 9331 $.fn.goMap = function (options) { 9332 return this.each(function () { 9333 var goMap = $(this).data('goMap'); 9334 if (!goMap) { 9335 var goMapBase = $.extend(true, {}, $.goMapBase); 9336 $(this).data('goMap', goMapBase.init(this, options)); 9337 $.goMap = goMapBase; 9338 } 9339 else { 9340 $.goMap = goMap; 9341 } 9342 }); 9343 }; 9344 9345 $.goMapBase = { 9346 defaults: { 9347 address: '', // Street, City, Country 9348 latitude: 56.9, 9349 longitude: 24.1, 9350 zoom: 4, 9351 delay: 200, 9352 hideByClick: true, 9353 oneInfoWindow: true, 9354 prefixId: 'gomarker', 9355 polyId: 'gopoly', 9356 groupId: 'gogroup', 9357 navigationControl: true, // Show or hide navigation control 9358 navigationControlOptions: { 9359 position: 'TOP_LEFT', // TOP, TOP_LEFT, TOP_RIGHT, BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT, LEFT, RIGHT 9360 style: 'DEFAULT' // DEFAULT, SMALL, LARGE 9361 }, 9362 mapTypeControl: true, // Show or hide map control 9363 mapTypeControlOptions: { 9364 position: 'TOP_RIGHT', // TOP, TOP_LEFT, TOP_RIGHT, BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT, LEFT, RIGHT 9365 style: 'DEFAULT'// DEFAULT, DROPDOWN_MENU, HORIZONTAL_BAR 9366 }, 9367 scaleControl: false, // Show or hide scale 9368 scrollwheel: true, // Mouse scroll whell 9369 directions: false, 9370 directionsResult: null, 9371 disableDoubleClickZoom: false, 9372 streetViewControl: false, 9373 markers: [], 9374 overlays: [], 9375 polyline: {
9376 color: '#FF0000', 9377 opacity: 1.0, 9378 weight: 2 9379 }, 9380 polygon: { 9381 color: '#FF0000', 9382 opacity: 1.0, 9383 weight: 2, 9384 fillColor: '#FF0000', 9385 fillOpacity: 0.2 9386 }, 9387 circle: { 9388 color: '#FF0000', 9389 opacity: 1.0, 9390 weight: 2, 9391 fillColor: '#FF0000', 9392 fillOpacity: 0.2 9393 }, 9394 rectangle: { 9395 color: '#FF0000', 9396 opacity: 1.0, 9397 weight: 2, 9398 fillColor: '#FF0000', 9399 fillOpacity: 0.2 9400 }, 9401 maptype: 'HYBRID', // Map type - HYBRID, ROADMAP, SATELLITE, TERRAIN 9402 html_prepend: '<div class="gomapMarker">', 9403 html_append: '</div>', 9404 addMarker: false 9405 }, 9406 map: null, 9407 count: 0, 9408 markers: [], 9409 polylines: [], 9410 polygons: [], 9411 circles: [], 9412 rectangles: [], 9413 tmpMarkers: [], 9414 geoMarkers: [], 9415 lockGeocode: false, 9416 bounds: null, 9417 overlays: null, 9418 overlay: null, 9419 mapId: null, 9420 plId: null, 9421 pgId: null, 9422 cId: null, 9423 rId: null, 9424 opts: null, 9425 centerLatLng: null, 9426 9427 init: function (el, options) { 9428 var opts = $.extend(true, {}, $.goMapBase.defaults, options); 9429 this.mapId = $(el); 9430 this.opts = opts; 9431 9432 if (opts.address) 9433 this.geocode({address: opts.address, center: true}); 9434// else if (opts.latitude != $.goMapBase.defaults.latitude && opts.longitude != $.goMapBase.defaults.longitude) 9435// this.centerLatLng = new google.maps.LatLng(opts.latitude, opts.longitude); 9436 else if ($.isArray(opts.markers) && opts.markers.length > 0) { 9437 if (opts.markers[0].address) 9438 this.geocode({address: opts.markers[0].address, center: true}); 9439 else 9440 this.centerLatLng = new google.maps.LatLng(opts.markers[0].latitude, opts.markers[0].longitude); 9441 } 9442 else 9443 this.centerLatLng = new google.maps.LatLng(opts.latitude, opts.longitude); 9444 9445 var myOptions = { 9446 center: this.centerLatLng, 9447 disableDoubleClickZoom: opts.disableDoubleClickZoom, 9448 mapTypeControl: opts.mapTypeControl, 9449 streetViewControl: opts.streetViewControl, 9450 mapTypeControlOptions: { 9451 position: google.maps.ControlPosition[opts.mapTypeControlOptions.position.toUpperCase()], 9452 style: google.maps.MapTypeControlStyle[opts.mapTypeControlOptions.style.toUpperCase()] 9453 }, 9454 mapTypeId: google.maps.MapTypeId[opts.maptype.toUpperCase()], 9455 panControl: opts.navigationControl, 9456 zoomControl: opts.navigationControl, 9457 panControlOptions: { 9458 position: google.maps.ControlPosition[opts.navigationControlOptions.position.toUpperCase()] 9459 }, 9460 zoomControlOptions: { 9461 position: google.maps.ControlPosition[opts.navigationControlOptions.position.toUpperCase()], 9462 style: google.maps.ZoomControlStyle[opts.navigationControlOptions.style.toUpperCase()] 9463 }, 9464 scaleControl: opts.scaleControl, 9465 scrollwheel: opts.scrollwheel, 9466 zoom: opts.zoom 9467 }; 9468 9469 this.map = new google.maps.Map(el, myOptions); 9470 this.overlay = new MyOverlay(this.map); 9471 9472 this.overlays = { 9473 polyline: {id: 'plId', array: 'polylines', create: 'createPolyline'}, 9474 polygon: {id: 'pgId', array: 'polygons', create: 'createPolygon'}, 9475 circle: {id: 'cId', array: 'circles', create: 'createCircle'}, 9476 rectangle: {id: 'rId', array: 'rectangles', create: 'createRectangle'} 9477 }; 9478 9479 this.plId = $('<div style="display:none;"/>').appendTo(this.mapId); 9480 this.pgId = $('<div style="display:none;"/>').appendTo(this.mapId); 9481 this.cId = $('<div style="display:none;"/>').appendTo(this.mapId); 9482 this.rId = $('<div style="display:none;"/>').appendTo(this.mapId); 9483 9484 for (var j = 0, l = opts.markers.length; j < l; j++) 9485 this.createMarker(opts.markers[j]); 9486 9487 for (var j = 0, l = opts.overlays.length; j < l; j++) 9488 this[this.overlays[opts.overlays[j].type].create](opts.overlays[j]); 9489 9490 var goMap = this; 9491 if (opts.addMarker == true || opts.addMarker == 'multi') { 9492 google.maps.event.addListener(goMap.map, 'click', function (event) { 9493 var options = { 9494 position: event.latLng, 9495 draggable: true 9496 }; 9497 9498 var marker = goMap.createMarker(options); 9499 9500 google.maps.event.addListener(marker, 'dblclick', function (event) { 9501 marker.setMap(null); 9502 goMap.removeMarker(marker.id); 9503 }); 9504 9505 }); 9506 } 9507 else if (opts.addMarker == 'single') { 9508 google.maps.event.addListener(goMap.map, 'click', function (event) { 9509 if (!goMap.singleMarker) { 9510 var options = { 9511 position: event.latLng, 9512 draggable: true 9513 }; 9514 9515 var marker = goMap.createMarker(options); 9516 goMap.singleMarker = true; 9517 9518 google.maps.event.addListener(marker, 'dblclick', function (event) { 9519 marker.setMap(null); 9520 goMap.removeMarker(marker.id); 9521 goMap.singleMarker = false;
9522 }); 9523 } 9524 }); 9525 } 9526 delete opts.markers; 9527 delete opts.overlays; 9528 9529 return this; 9530 }, 9531 9532 ready: function (f) { 9533 google.maps.event.addListenerOnce(this.map, 'bounds_changed', function () { 9534 return f(); 9535 }); 9536 }, 9537 9538 geocode: function (address, options) { 9539 var goMap = this; 9540 setTimeout(function () { 9541 geocoder.geocode({'address': address.address}, function (results, status) { 9542 if (status == google.maps.GeocoderStatus.OK && address.center) 9543 goMap.map.setCenter(results[0].geometry.location); 9544 9545 if (status == google.maps.GeocoderStatus.OK && options && options.markerId) 9546 options.markerId.setPosition(results[0].geometry.location); 9547 9548 else if (status == google.maps.GeocoderStatus.OK && options) { 9549 if (goMap.lockGeocode) { 9550 goMap.lockGeocode = false; 9551 options.position = results[0].geometry.location; 9552 options.geocode = true; 9553 goMap.createMarker(options); 9554 } 9555 } 9556 else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) { 9557 goMap.geocode(address, options); 9558 } 9559 }); 9560 }, this.opts.delay); 9561 }, 9562 9563 geoMarker: function () { 9564 if (this.geoMarkers.length > 0 && !this.lockGeocode) { 9565 this.lockGeocode = true; 9566 var current = this.geoMarkers.splice(0, 1); 9567 this.geocode({address: current[0].address}, current[0]); 9568 } 9569 else if (this.lockGeocode) { 9570 var goMap = this; 9571 setTimeout(function () { 9572 goMap.geoMarker(); 9573 }, this.opts.delay); 9574 } 9575 }, 9576 9577 setMap: function (options) { 9578 delete options.mapTypeId; 9579 9580 if (options.address) { 9581 this.geocode({address: options.address, center: true}); 9582 delete options.address; 9583 } 9584 else if (options.latitude && options.longitude) { 9585 options.center = new google.maps.LatLng(options.latitude, options.longitude); 9586 delete options.longitude; 9587 delete options.latitude; 9588 } 9589 9590 if (options.mapTypeControlOptions && options.mapTypeControlOptions.position) 9591 options.mapTypeControlOptions.position = google.maps.ControlPosition[options.mapTypeControlOptions.position.toUpperCase()]; 9592 9593 if (options.mapTypeControlOptions && options.mapTypeControlOptions.style) 9594 options.mapTypeControlOptions.style = google.maps.MapTypeControlStyle[options.mapTypeControlOptions.style.toUpperCase()]; 9595 9596 if (typeof options.navigationControl !== 'undefined') { 9597 options.panControl = options.navigationControl; 9598 options.zoomControl = options.navigationControl; 9599 } 9600 9601 if (options.navigationControlOptions && options.navigationControlOptions.position) { 9602 options.panControlOptions = {position: google.maps.ControlPosition[options.navigationControlOptions.position.toUpperCase()]}; 9603 options.zoomControlOptions = {position: google.maps.ControlPosition[options.navigationControlOptions.position.toUpperCase()]}; 9604 } 9605 9606 if (options.navigationControlOptions && options.navigationControlOptions.style) { 9607 if (typeof options.zoomControlOptions === 'undefined') 9608 options.zoomControlOptions = {style: google.maps.ZoomControlStyle[options.navigationControlOptions.style.toUpperCase()]}; 9609 else 9610 options.zoomControlOptions.style = google.maps.ZoomControlStyle[options.navigationControlOptions.style.toUpperCase()]; 9611 } 9612 this.map.setOptions(options); 9613 }, 9614 9615 getMap: function () { 9616 return this.map; 9617 }, 9618 9619 createListener: function (type, event, data) { 9620 var target; 9621 9622 if (typeof type != 'object') 9623 type = {type: type}; 9624 9625 if (type.type == 'map') 9626 target = this.map; 9627 else if (type.type == 'marker' && type.marker) 9628 target = $(this.mapId).data(type.marker); 9629 else if (type.type == 'info' && type.marker) 9630 target = $(this.mapId).data(type.marker + 'info'); 9631 9632 if (target) 9633 return google.maps.event.addListener(target, event, data); 9634 else if ((type.type == 'marker' || type.type == 'info') && this.getMarkerCount() != this.getTmpMarkerCount()) 9635 var goMap = this; 9636 setTimeout(function () { 9637 goMap.createListener(type, event, data); 9638 }, this.opts.delay); 9639 }, 9640 9641 removeListener: function (listener) { 9642 google.maps.event.removeListener(listener); 9643 }, 9644 9645 setInfoWindow: function (marker, html) { 9646 var goMap = this; 9647 html.content = goMap.opts.html_prepend + html.content + goMap.opts.html_append; 9648 var infowindow = new google.maps.InfoWindow(html); 9649 infowindow.show = false;
9650 9651 $(goMap.mapId).data(marker.id + 'info', infowindow); 9652 9653 if (html.popup) { 9654 goMap.openWindow(infowindow, marker, html); 9655 infowindow.show = true; 9656 } 9657 9658 google.maps.event.addListener(marker, 'click', function () { 9659 if (infowindow.show && goMap.opts.hideByClick) { 9660 infowindow.close(); 9661 infowindow.show = false; 9662 } 9663 else { 9664 goMap.openWindow(infowindow, marker, html); 9665 infowindow.show = true; 9666 } 9667 }); 9668 }, 9669 9670 openWindow: function (infowindow, marker, html) { 9671 var goMap = this; 9672 if (this.opts.oneInfoWindow) 9673 this.clearInfo(); 9674 9675 if (html.ajax) { 9676 infowindow.open(this.map, marker); 9677 $.ajax({ 9678 url: html.ajax, 9679 success: function (html) { 9680 infowindow.setContent(goMap.opts.html_prepend + html + goMap.opts.html_append); 9681 } 9682 }); 9683 } 9684 else if (html.id) { 9685 infowindow.setContent(goMap.opts.html_prepend + $(html.id).html() + goMap.opts.html_append); 9686 infowindow.open(this.map, marker); 9687 } 9688 else 9689 infowindow.open(this.map, marker); 9690 }, 9691 9692 setInfo: function (id, text) { 9693 var info = $(this.mapId).data(id + 'info'); 9694 9695 if (typeof text == 'object') 9696 info.setOptions(goMap.opts.html_prepend + text + goMap.opts.html_append); 9697 else 9698 info.setContent(goMap.opts.html_prepend + text + goMap.opts.html_append); 9699 }, 9700 9701 getInfo: function (id, hideDiv) { 9702 var info = $(this.mapId).data(id + 'info').getContent(); 9703 if (hideDiv) 9704 return $(info).html(); 9705 else 9706 return info; 9707 }, 9708 9709 clearInfo: function () { 9710 for (var i = 0, l = this.markers.length; i < l; i++) { 9711 var info = $(this.mapId).data(this.markers[i] + 'info'); 9712 if (info) { 9713 info.close(); 9714 info.show = false; 9715 } 9716 } 9717 }, 9718 9719 fitBounds: function (type, markers) { 9720 var goMap = this; 9721 if (this.getMarkerCount() != this.getTmpMarkerCount()) 9722 setTimeout(function () { 9723 goMap.fitBounds(type, markers); 9724 }, this.opts.delay); 9725 else { 9726 this.bounds = new google.maps.LatLngBounds(); 9727 9728 if (!type || (type && type == 'all')) { 9729 for (var i = 0, l = this.markers.length; i < l; i++) { 9730 this.bounds.extend($(this.mapId).data(this.markers[i]).position); 9731 } 9732 } 9733 else if (type && type == 'visible') { 9734 for (var i = 0, l = this.markers.length; i < l; i++) { 9735 if (this.getVisibleMarker(this.markers[i])) 9736 this.bounds.extend($(this.mapId).data(this.markers[i]).position); 9737 } 9738 9739 } 9740 else if (type && type == 'markers' && $.isArray(markers)) { 9741 for (var i = 0, l = markers.length; i < l; i++) { 9742 this.bounds.extend($(this.mapId).data(markers[i]).position); 9743 } 9744 } 9745 this.map.fitBounds(this.bounds); 9746 } 9747 }, 9748 9749 getBounds: function () { 9750 return this.map.getBounds(); 9751 }, 9752 9753 createPolyline: function (poly) { 9754 poly.type = 'polyline';
9755 return this.createOverlay(poly); 9756 }, 9757 9758 createPolygon: function (poly) { 9759 poly.type = 'polygon'; 9760 return this.createOverlay(poly); 9761 }, 9762 9763 createCircle: function (poly) { 9764 poly.type = 'circle'; 9765 return this.createOverlay(poly); 9766 }, 9767 9768 createRectangle: function (poly) { 9769 poly.type = 'rectangle'; 9770 return this.createOverlay(poly); 9771 }, 9772 9773 createOverlay: function (poly) { 9774 var overlay = []; 9775 if (!poly.id) { 9776 this.count++; 9777 poly.id = this.opts.polyId + this.count; 9778 } 9779 switch (poly.type) { 9780 case 'polyline': 9781 if (poly.coords.length > 0) { 9782 for (var j = 0, l = poly.coords.length; j < l; j++) 9783 overlay.push(new google.maps.LatLng(poly.coords[j].latitude, poly.coords[j].longitude)); 9784 9785 overlay = new google.maps.Polyline({ 9786 map: this.map, 9787 path: overlay, 9788 strokeColor: poly.color ? poly.color : this.opts.polyline.color, 9789 strokeOpacity: poly.opacity ? poly.opacity : this.opts.polyline.opacity, 9790 strokeWeight: poly.weight ? poly.weight : this.opts.polyline.weight 9791 }); 9792 } 9793 else 9794 return false; 9795 break; 9796 case 'polygon': 9797 if (poly.coords.length > 0) { 9798 for (var j = 0, l = poly.coords.length; j < l; j++) 9799 overlay.push(new google.maps.LatLng(poly.coords[j].latitude, poly.coords[j].longitude)); 9800 9801 overlay = new google.maps.Polygon({ 9802 map: this.map, 9803 path: overlay, 9804 strokeColor: poly.color ? poly.color : this.opts.polygon.color, 9805 strokeOpacity: poly.opacity ? poly.opacity : this.opts.polygon.opacity, 9806 strokeWeight: poly.weight ? poly.weight : this.opts.polygon.weight, 9807 fillColor: poly.fillColor ? poly.fillColor : this.opts.polygon.fillColor, 9808 fillOpacity: poly.fillOpacity ? poly.fillOpacity : this.opts.polygon.fillOpacity 9809 }); 9810 } 9811 else 9812 return false; 9813 break; 9814 case 'circle': 9815 overlay = new google.maps.Circle({ 9816 map: this.map, 9817 center: new google.maps.LatLng(poly.latitude, poly.longitude), 9818 radius: poly.radius, 9819 strokeColor: poly.color ? poly.color : this.opts.circle.color, 9820 strokeOpacity: poly.opacity ? poly.opacity : this.opts.circle.opacity, 9821 strokeWeight: poly.weight ? poly.weight : this.opts.circle.weight, 9822 fillColor: poly.fillColor ? poly.fillColor : this.opts.circle.fillColor, 9823 fillOpacity: poly.fillOpacity ? poly.fillOpacity : this.opts.circle.fillOpacity 9824 }); 9825 break; 9826 case 'rectangle': 9827 overlay = new google.maps.Rectangle({ 9828 map: this.map, 9829 bounds: new google.maps.LatLngBounds(new google.maps.LatLng(poly.sw.latitude, poly.sw.longitude), new google.maps.LatLng(poly.ne.latitude, poly.ne.longitude)), 9830 strokeColor: poly.color ? poly.color : this.opts.circle.color, 9831 strokeOpacity: poly.opacity ? poly.opacity : this.opts.circle.opacity, 9832 strokeWeight: poly.weight ? poly.weight : this.opts.circle.weight,
9833 fillColor: poly.fillColor ? poly.fillColor : this.opts.circle.fillColor, 9834 fillOpacity: poly.fillOpacity ? poly.fillOpacity : this.opts.circle.fillOpacity 9835 }); 9836 break; 9837 default: 9838 return false; 9839 break; 9840 } 9841 this.addOverlay(poly, overlay); 9842 return overlay; 9843 }, 9844 9845 addOverlay: function (poly, overlay) { 9846 $(this[this.overlays[poly.type].id]).data(poly.id, overlay); 9847 this[this.overlays[poly.type].array].push(poly.id); 9848 }, 9849 9850 setOverlay: function (type, overlay, options) { 9851 overlay = $(this[this.overlays[type].id]).data(overlay); 9852 9853 if (options.coords && options.coords.length > 0) { 9854 var array = []; 9855 for (var j = 0, l = options.coords.length; j < l; j++) 9856 array.push(new google.maps.LatLng(options.coords[j].latitude, options.coords[j].longitude)); 9857 9858 options.path = array; 9859 delete options.coords; 9860 } 9861 else if (options.ne && options.sw) { 9862 options.bounds = new google.maps.LatLngBounds(new google.maps.LatLng(options.sw.latitude, options.sw.longitude), new google.maps.LatLng(options.ne.latitude, options.ne.longitude)); 9863 delete options.ne; 9864 delete options.sw; 9865 } 9866 else if (options.latitude && options.longitude) { 9867 9868 options.center = new google.maps.LatLng(options.latitude, options.longitude); 9869 delete options.latitude; 9870 delete options.longitude; 9871 } 9872 overlay.setOptions(options); 9873 }, 9874 9875 showHideOverlay: function (type, overlay, display) { 9876 if (typeof display === 'undefined') { 9877 if (this.getVisibleOverlay(type, overlay)) 9878 display = false; 9879 else 9880 display = true; 9881 } 9882 9883 if (display) 9884 $(this[this.overlays[type].id]).data(overlay).setMap(this.map); 9885 else 9886 $(this[this.overlays[type].id]).data(overlay).setMap(null); 9887 }, 9888 9889 getVisibleOverlay: function (type, overlay) { 9890 if ($(this[this.overlays[type].id]).data(overlay).getMap()) 9891 return true; 9892 else 9893 return false; 9894 }, 9895 9896 getOverlaysCount: function (type) { 9897 return this[this.overlays[type].array].length; 9898 }, 9899 9900 removeOverlay: function (type, overlay) { 9901 var index = $.inArray(overlay, this[this.overlays[type].array]), current; 9902 if (index > -1) { 9903 current = this[this.overlays[type].array].splice(index, 1); 9904 var markerId = current[0]; 9905 $(this[this.overlays[type].id]).data(markerId).setMap(null); 9906 $(this[this.overlays[type].id]).removeData(markerId); 9907 9908 return true; 9909 } 9910 return false; 9911 }, 9912 9913 clearOverlays: function (type) { 9914 for (var i = 0, l = this[this.overlays[type].array].length; i < l; i++) { 9915 var markerId = this[this.overlays[type].array][i]; 9916 $(this[this.overlays[type].id]).data(markerId).setMap(null); 9917 $(this[this.overlays[type].id]).removeData(markerId); 9918 } 9919 this[this.overlays[type].array] = []; 9920 }, 9921 9922 showHideMarker: function (marker, display) { 9923 if (typeof display === 'undefined') { 9924 if (this.getVisibleMarker(marker)) { 9925 $(this.mapId).data(marker).setVisible(false); 9926 var info = $(this.mapId).data(marker + 'info'); 9927 if (info && info.show) { 9928 info.close(); 9929 info.show = false;
9930 } 9931 } 9932 else 9933 $(this.mapId).data(marker).setVisible(true); 9934 } 9935 else 9936 $(this.mapId).data(marker).setVisible(display); 9937 }, 9938 9939 showHideMarkerByGroup: function (group, display) { 9940 for (var i = 0, l = this.markers.length; i < l; i++) { 9941 var markerId = this.markers[i]; 9942 var marker = $(this.mapId).data(markerId); 9943 if (marker.group == group) { 9944 if (typeof display === 'undefined') { 9945 if (this.getVisibleMarker(markerId)) { 9946 marker.setVisible(false); 9947 var info = $(this.mapId).data(markerId + 'info'); 9948 if (info && info.show) { 9949 info.close(); 9950 info.show = false; 9951 } 9952 } 9953 else 9954 marker.setVisible(true); 9955 } 9956 else 9957 marker.setVisible(display); 9958 } 9959 } 9960 }, 9961 9962 getVisibleMarker: function (marker) { 9963 return $(this.mapId).data(marker).getVisible(); 9964 }, 9965 9966 getMarkerCount: function () { 9967 return this.markers.length; 9968 }, 9969 9970 getTmpMarkerCount: function () { 9971 return this.tmpMarkers.length; 9972 }, 9973 9974 getVisibleMarkerCount: function () { 9975 return this.getMarkers('visiblesInMap').length; 9976 }, 9977 9978 getMarkerByGroupCount: function (group) { 9979 return this.getMarkers('group', group).length; 9980 }, 9981 9982 getMarkers: function (type, name) { 9983 var array = []; 9984 switch (type) { 9985 case "json": 9986 for (var i = 0, l = this.markers.length; i < l; i++) { 9987 var temp = "'" + i + "': '" + $(this.mapId).data(this.markers[i]).getPosition().toUrlValue() + "'"; 9988 array.push(temp); 9989 } 9990 array = "{'markers':{" + array.join(",") + "}}"; 9991 break; 9992 case "data": 9993 for (var i = 0, l = this.markers.length; i < l; i++) { 9994 var temp = "marker[" + i + "]=" + $(this.mapId).data(this.markers[i]).getPosition().toUrlValue(); 9995 array.push(temp); 9996 } 9997 array = array.join("&"); 9998 break; 9999 case "visiblesInBounds": 10000 for (var i = 0, l = this.markers.length; i < l; i++) { 10001 if (this.isVisible($(this.mapId).data(this.markers[i]).getPosition())) 10002 array.push(this.markers[i]); 10003 } 10004 break; 10005 case "visiblesInMap": 10006 for (var i = 0, l = this.markers.length; i < l; i++) { 10007 if (this.getVisibleMarker(this.markers[i])) 10008 array.push(this.markers[i]); 10009 } 10010 break; 10011 case "group": 10012 if (name) 10013 for (var i = 0, l = this.markers.length; i < l; i++) { 10014 if ($(this.mapId).data(this.markers[i]).group == name) 10015 array.push(this.markers[i]); 10016 } 10017 break; 10018 case "markers": 10019 for (var i = 0, l = this.markers.length; i < l; i++) { 10020 var temp = $(this.mapId).data(this.markers[i]); 10021 array.push(temp); 10022 } 10023 break; 10024 default: 10025 for (var i = 0, l = this.markers.length; i < l; i++) { 10026 var temp = $(this.mapId).data(this.markers[i]).getPosition().toUrlValue(); 10027 array.push(temp); 10028 } 10029 break; 10030 } 10031 return array; 10032 }, 10033 10034 getVisibleMarkers: function () { 10035 return this.getMarkers('visiblesInBounds'); 10036 }, 10037 10038 createMarker: function (marker) { 10039 if (!marker.geocode) { 10040 this.count++; 10041 if (!marker.id) 10042 marker.id = this.opts.prefixId + this.count; 10043 this.tmpMarkers.push(marker.id); 10044 } 10045 if (marker.address && !marker.geocode) { 10046 this.geoMarkers.push(marker); 10047 this.geoMarker(); 10048 } 10049 else if (marker.latitude && marker.longitude || marker.position) { 10050 var options = {map: this.map}; 10051 options.id = marker.id; 10052 options.group = marker.group ? marker.group : this.opts.groupId; 10053 options.zIndex = marker.zIndex ? marker.zIndex : 0; 10054 options.zIndexOrg = marker.zIndexOrg ? marker.zIndexOrg : 0; 10055 10056 if (marker.visible == false) 10057 options.visible = marker.visible; 10058 10059 if (marker.title) 10060 options.title = marker.title; 10061 10062 if (marker.draggable) 10063 options.draggable = marker.draggable; 10064 10065 if (marker.icon && marker.icon.image) { 10066 options.icon = marker.icon.image; 10067 if (marker.icon.shadow) 10068 options.shadow = marker.icon.shadow; 10069 } 10070 else if (marker.icon) 10071 options.icon = marker.icon; 10072 10073 else if (this.opts.icon && this.opts.icon.image) { 10074 options.icon = this.opts.icon.image; 10075 if (this.opts.icon.shadow) 10076 options.shadow = this.opts.icon.shadow; 10077 } 10078 else if (this.opts.icon) 10079 options.icon = this.opts.icon; 10080 10081 options.position = marker.position ? marker.position : new google.maps.LatLng(marker.latitude, marker.longitude); 10082 10083 var cmarker = new google.maps.Marker(options); 10084 10085 if (marker.html) { 10086 if (!marker.html.content && !marker.html.ajax && !marker.html.id) 10087 marker.html = {content: marker.html}; 10088 else if (!marker.html.content) 10089 marker.html.content = null; 10090 10091 this.setInfoWindow(cmarker, marker.html); 10092 } 10093 this.addMarker(cmarker); 10094 return cmarker; 10095 } 10096 }, 10097 10098 addMarker: function (marker) { 10099 $(this.mapId).data(marker.id, marker); 10100 this.markers.push(marker.id); 10101 }, 10102 10103 setMarker: function (marker, options) { 10104 var tmarker = $(this.mapId).data(marker); 10105 10106 delete options.id; 10107 delete options.visible; 10108 10109 if (options.icon) { 10110 var toption = options.icon; 10111 delete options.icon; 10112 10113 if (toption && toption == 'default') { 10114 if (this.opts.icon && this.opts.icon.image) { 10115 options.icon = this.opts.icon.image; 10116 if (this.opts.icon.shadow) 10117 options.shadow = this.opts.icon.shadow; 10118 } 10119 else if (this.opts.icon) 10120 options.icon = this.opts.icon; 10121 } 10122 else if (toption && toption.image) { 10123 options.icon = toption.image; 10124 if (toption.shadow) 10125 options.shadow = toption.shadow; 10126 } 10127 else if (toption) 10128 options.icon = toption; 10129 } 10130 10131 if (options.address) { 10132 this.geocode({address: options.address}, {markerId: tmarker}); 10133 delete options.address; 10134 delete options.latitude; 10135 delete options.longitude; 10136 delete options.position; 10137 } 10138 else if (options.latitude && options.longitude || options.position) { 10139 if (!options.position) 10140 options.position = new google.maps.LatLng(options.latitude, options.longitude); 10141 } 10142 tmarker.setOptions(options); 10143 }, 10144 10145 removeMarker: function (marker) { 10146 var index = $.inArray(marker, this.markers), current; 10147 if (index > -1) { 10148 this.tmpMarkers.splice(index, 1); 10149 current = this.markers.splice(index, 1); 10150 var markerId = current[0]; 10151 var marker = $(this.mapId).data(markerId); 10152 var info = $(this.mapId).data(markerId + 'info'); 10153 10154 marker.setVisible(false); 10155 marker.setMap(null); 10156 $(this.mapId).removeData(markerId); 10157 10158 if (info) { 10159 info.close(); 10160 info.show = false;
10161 $(this.mapId).removeData(markerId + 'info'); 10162 } 10163 return true; 10164 } 10165 return false; 10166 }, 10167 10168 clearMarkers: function () { 10169 for (var i = 0, l = this.markers.length; i < l; i++) { 10170 var markerId = this.markers[i]; 10171 var marker = $(this.mapId).data(markerId); 10172 var info = $(this.mapId).data(markerId + 'info'); 10173 10174 marker.setVisible(false); 10175 marker.setMap(null); 10176 $(this.mapId).removeData(markerId); 10177 10178 if (info) { 10179 info.close(); 10180 info.show = false; 10181 $(this.mapId).removeData(markerId + 'info'); 10182 } 10183 } 10184 this.singleMarker = false; 10185 this.lockGeocode = false; 10186 this.markers = []; 10187 this.tmpMarkers = []; 10188 this.geoMarkers = []; 10189 }, 10190 10191 isVisible: function (latlng) { 10192 return this.map.getBounds().contains(latlng); 10193 } 10194 } 10195 })(jQuery); 10196 10197 jQuery(function ($) { 10198 $('#contact-form-google-map').goMap({ 10199 address: evolve_js_local_vars.google_maps_markers, 10200 maptype: evolve_js_local_vars.google_maps_type, 10201 zoom: parseInt(evolve_js_local_vars.google_maps_zoom_level), 10202 scrollwheel: (evolve_js_local_vars.google_maps_scrollwheel == 1) ? true : false, 10203 scaleControl: (evolve_js_local_vars.google_maps_scale == 1) ? true : false, 10204 navigationControl: (evolve_js_local_vars.google_maps_zoomcontrol == "1") ? true : false, 10205 markers: evolve_js_local_vars.google_maps_pin_marker 10206 }) 10207 }); 10208} 10209 10210/* 10211 Portfolio 10212 --------------------------------------- */ 10213 10214jQuery(function ($) { 10215 var selectedClass = ""; 10216 var closestPortfolio = ""; 10217 $(".portfolio-filter").each(function (index) { 10218 $(this).on("click", function () { 10219 selectedClass = $(this).attr("data-filter"); 10220 closestPortfolio = $(this).parent().parent().next('.portfolio'); 10221 closestPortfolio.fadeTo(100, 0.1); 10222 closestPortfolio.find('article').not("." + selectedClass).fadeOut().addClass('filter-item'); 10223 setTimeout(function () { 10224 $("." + selectedClass).fadeIn().removeClass('filter-item'); 10225 closestPortfolio.fadeTo(300, 1); 10226 }, 300); 10227 $(".ias-noneleft").animate({marginTop: '3rem', opacity: 0.5}, 700).fadeTo(100, 1); 10228 }); 10229 }); 10230}); 10231 10232/* 10233 Extended Bootstrap Modal 10234 --------------------------------------- */ 10235 10236/*! 10237 * Lightbox for Bootstrap by @ashleydw 10238 * https://github.com/ashleydw/lightbox 10239 * 10240 * License: https://github.com/ashleydw/lightbox/blob/master/LICENSE 10241 */ 10242 10243if (evolve_js_local_vars.lightbox_support === '1') { 10244 10245 +function ($) { 10246 10247 'use strict'; 10248 10249 var _createClass = (function () { 10250 function defineProperties(target, props) { 10251 for (var i = 0; i < props.length; i++) { 10252 var descriptor = props[i]; 10253 descriptor.enumerable = descriptor.enumerable || false; 10254 descriptor.configurable = true; 10255 if ('value' in descriptor) descriptor.writable = true; 10256 Object.defineProperty(target, descriptor.key, descriptor); 10257 } 10258 } 10259 10260 return function (Constructor, protoProps, staticProps) { 10261 if (protoProps) defineProperties(Constructor.prototype, protoProps); 10262 if (staticProps) defineProperties(Constructor, staticProps); 10263 return Constructor; 10264 }; 10265 })(); 10266 10267 function _classCallCheck(instance, Constructor) { 10268 if (!(instance instanceof Constructor)) { 10269 throw new TypeError('Cannot call a class as a function'); 10270 } 10271 } 10272 10273 var Lightbox = (function ($) { 10274 10275 var NAME = 'ekkoLightbox'; 10276 var JQUERY_NO_CONFLICT = $.fn[NAME]; 10277 10278 var Default = { 10279 title: '', 10280 footer: '', 10281 maxWidth: 9999, 10282 maxHeight: 9999, 10283 showArrows: true, //display the left / right arrows or not 10284 wrapping: true, //if true, gallery loops infinitely 10285 type: null, //force the lightbox into image / youtube mode. if null, or not image|youtube|vimeo; detect it 10286 alwaysShowClose: false, //always show the close button, even if there is no title 10287 loadingMessage: '<div class="ekko-lightbox-loader"><div><div></div><div></div></div></div>', // http://tobiasahlin.com/spinkit/ 10288 leftArrow: '<span>❮
10288</span>', 10289 rightArrow: '<span>❯</span>', 10290 strings: { 10291 close: 'Close', 10292 fail: 'Failed to load image:', 10293 type: 'Could not detect remote target type. Force the type using data-type' 10294 }, 10295 doc: document, // if in an iframe can specify top.document 10296 onShow: function onShow() { 10297 }, 10298 onShown: function onShown() { 10299 }, 10300 onHide: function onHide() { 10301 }, 10302 onHidden: function onHidden() { 10303 }, 10304 onNavigate: function onNavigate() { 10305 }, 10306 onContentLoaded: function onContentLoaded() { 10307 } 10308 }; 10309 10310 var Lightbox = (function () { 10311 _createClass(Lightbox, null, [{ 10312 key: 'Default', 10313 10314 /** 10315 Class properties: 10316 _$element: null -> the <a> element currently being displayed 10317 _$modal: The bootstrap modal generated 10318 _$modalDialog: The .modal-dialog 10319 _$modalContent: The .modal-content 10320 _$modalBody: The .modal-body 10321 _$modalHeader: The .modal-header 10322 _$modalFooter: The .modal-footer 10323 _$lightboxContainerOne: Container of the first lightbox element 10324 _$lightboxContainerTwo: Container of the second lightbox element 10325 _$lightboxBody: First element in the container 10326 _$modalArrows: The overlayed arrows container 10327 _$galleryItems: Other <a>'s available for this gallery 10328 _galleryName: Name of the current data('gallery') showing 10329 _galleryIndex: The current index of the _$galleryItems being shown 10330 _config: {} the options for the modal 10331 _modalId: unique id for the current lightbox 10332 _padding / _border: CSS properties for the modal container; these are used to calculate the available space for the content 10333 */ 10334 10335 get: function get() { 10336 return Default; 10337 } 10338 }]); 10339 10340 function Lightbox($element, config) { 10341 var _this = this; 10342 10343 _classCallCheck(this, Lightbox); 10344 10345 this._config = $.extend({}, Default, config); 10346 this._$modalArrows = null; 10347 this._galleryIndex = 0; 10348 this._galleryName = null; 10349 this._padding = null; 10350 this._border = null; 10351 this._titleIsShown = false; 10352 this._footerIsShown = false; 10353 this._wantedWidth = 0; 10354 this._wantedHeight = 0; 10355 this._touchstartX = 0; 10356 this._touchendX = 0; 10357 10358 this._modalId = 'ekkoLightbox-' + Math.floor(Math.random() * 1000 + 1); 10359 this._$element = $element instanceof jQuery ? $element : $($element); 10360 10361 this._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3; 10362 10363 var h4 = '<h4 class="modal-title">' + (this._config.title || " ") + '</h4>'; 10364 var btn = '<button type="button" class="close" data-dismiss="modal" aria-label="' + this._config.strings.close + '"><span aria-hidden="true">×</span></button>'; 10365 10366 var header = '<div class="modal-header' + (this._config.title || this._config.alwaysShowClose ? '' : ' hide') + '">' + (this._isBootstrap3 ? btn + h4 : h4 + btn) + '</div>'; 10367 var footer = '<div class="modal-footer' + (this._config.footer ? '' : ' hide') + '">' + (this._config.footer || " ") + '</div>'; 10368 var body = '<div class="modal-body"><div class="ekko-lightbox-container"><div class="ekko-lightbox-item fade in show"></div><div class="ekko-lightbox-item fade"></div></div></div>'; 10369 var dialog = '<div class="modal-dialog" role="document"><div class="modal-content">' + header + body + footer + '</div></div>'; 10370 $(this._config.doc.body).append('<div id="' + this._modalId + '" class="ekko-lightbox modal fade" tabindex="-1" tabindex="-1" role="dialog" aria-hidden="true">' + dialog + '</div>'); 10371 10372 this._$modal = $('#' + this._modalId, this._config.doc); 10373 this._$modalDialog = this._$modal.find('.modal
10373-dialog').first(); 10374 this._$modalContent = this._$modal.find('.modal-content').first(); 10375 this._$modalBody = this._$modal.find('.modal-body').first(); 10376 this._$modalHeader = this._$modal.find('.modal-header').first(); 10377 this._$modalFooter = this._$modal.find('.modal-footer').first(); 10378 10379 this._$lightboxContainer = this._$modalBody.find('.ekko-lightbox-container').first(); 10380 this._$lightboxBodyOne = this._$lightboxContainer.find('> div:first-child').first(); 10381 this._$lightboxBodyTwo = this._$lightboxContainer.find('> div:last-child').first(); 10382 10383 this._border = this._calculateBorders(); 10384 this._padding = this._calculatePadding(); 10385 10386 this._galleryName = this._$element.data('gallery'); 10387 if (this._galleryName) { 10388 this._$galleryItems = $(document.body).find('*[data-gallery="' + this._galleryName + '"]'); 10389 this._galleryIndex = this._$galleryItems.index(this._$element); 10390 $(document).on('keydown.ekkoLightbox', this._navigationalBinder.bind(this)); 10391 10392 // add the directional arrows to the modal 10393 if (this._config.showArrows && this._$galleryItems.length > 1) { 10394 this._$lightboxContainer.append('<div class="ekko-lightbox-nav-overlay"><a href="#">' + this._config.leftArrow + '</a><a href="#">' + this._config.rightArrow + '</a></div>'); 10395 this._$modalArrows = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay').first(); 10396 this._$lightboxContainer.on('click', 'a:first-child', function (event) { 10397 event.preventDefault(); 10398 return _this.navigateLeft(); 10399 }); 10400 this._$lightboxContainer.on('click', 'a:last-child', function (event) { 10401 event.preventDefault(); 10402 return _this.navigateRight(); 10403 }); 10404 this.updateNavigation(); 10405 } 10406 } 10407 10408 this._$modal.on('show.bs.modal', this._config.onShow.bind(this)).on('shown.bs.modal', function () { 10409 _this._toggleLoading(true); 10410 _this._handle(); 10411 return _this._config.onShown.call(_this); 10412 }).on('hide.bs.modal', this._config.onHide.bind(this)).on('hidden.bs.modal', function () { 10413 if (_this._galleryName) { 10414 $(document).off('keydown.ekkoLightbox'); 10415 $(window).off('resize.ekkoLightbox'); 10416 } 10417 _this._$modal.remove(); 10418 return _this._config.onHidden.call(_this); 10419 }).modal(this._config); 10420 10421 $(window).on('resize.ekkoLightbox', function () { 10422 _this._resize(_this._wantedWidth, _this._wantedHeight); 10423 }); 10424 this._$lightboxContainer.on('touchstart', function () { 10425 _this._touchstartX = event.changedTouches[0].screenX; 10426 }).on('touchend', function () { 10427 _this._touchendX = event.changedTouches[0].screenX; 10428 _this._swipeGesure(); 10429 }); 10430 } 10431 10432 _createClass(Lightbox, [{ 10433 key: 'element', 10434 value: function element() { 10435 return this._$element; 10436 } 10437 }, { 10438 key: 'modal', 10439 value: function modal() { 10440 return this._$modal; 10441 } 10442 }, { 10443 key: 'navigateTo', 10444 value: function navigateTo(index) { 10445 10446 if (index < 0 || index > this._$galleryItems.length - 1) return this; 10447 10448 this._galleryIndex = index; 10449 10450 this.updateNavigation(); 10451 10452 this._$element = $(this._$galleryItems.get(this._galleryIndex)); 10453 this._handle(); 10454 } 10455 }, { 10456 key: 'navigateLeft', 10457 value: function navigateLeft() { 10458 10459 if (!this._$galleryItems) return; 10460 10461 if (this._$galleryItems.length === 1) return; 10462 10463 if (this._galleryIndex === 0) { 10464 if (this._config.wrapping) this._galleryIndex = this._$galleryItems.length - 1; else return; 10465 } else //circular 10466 this._galleryIndex--; 10467 10468 this._config.onNavigate.call(this, 'left', this._galleryIndex); 10469 return this.navigateTo(this._galleryIndex); 10470 } 10471 }, { 10472 key: 'navigateRight', 10473 value: function navigateRight() { 10474 10475 if (!this._$galleryItems) return; 10476 10477 if (this._$galleryItems.length === 1) return; 10478 10479 if (this._galleryIndex === this._$galleryItems.length - 1) { 10480 if (this._config.wrapping) this._galleryIndex = 0; else return; 10481 } else //circular 10482 this._galleryIndex++; 10483 10484 this._config.onNavigate.call(this, 'right', this._galleryIndex); 10485 return this.navigateTo(this._galleryIndex); 10486 } 10487 }, { 10488 key: 'updateNavigation', 10489 value: function updateNavigation() { 10490 if (!this._config.wrapping) {
10491 var $nav = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay'); 10492 if (this._galleryIndex === 0) $nav.find('a:first-child').addClass('disabled'); else $nav.find('a:first-child').removeClass('disabled'); 10493 10494 if (this._galleryIndex === this._$galleryItems.length - 1) $nav.find('a:last-child').addClass('disabled'); else $nav.find('a:last-child').removeClass('disabled'); 10495 } 10496 } 10497 }, { 10498 key: 'close', 10499 value: function close() { 10500 return this._$modal.modal('hide'); 10501 } 10502 10503 // helper private methods 10504 }, { 10505 key: '_navigationalBinder', 10506 value: function _navigationalBinder(event) { 10507 event = event || window.event; 10508 if (event.keyCode === 39) return this.navigateRight(); 10509 if (event.keyCode === 37) return this.navigateLeft(); 10510 } 10511 10512 // type detection private methods 10513 }, { 10514 key: '_detectRemoteType', 10515 value: function _detectRemoteType(src, type) { 10516 10517 type = type || false; 10518 10519 if (!type && this._isImage(src)) type = 'image'; 10520 if (!type && this._getYoutubeId(src)) type = 'youtube'; 10521 if (!type && this._getVimeoId(src)) type = 'vimeo'; 10522 if (!type && this._getInstagramId(src)) type = 'instagram'; 10523 if (type == 'audio' || type == 'video' || !type && this._isMedia(src)) type = 'media'; 10524 if (!type || ['image', 'youtube', 'vimeo', 'instagram', 'media', 'url'].indexOf(type) < 0) type = 'url'; 10525 10526 return type; 10527 } 10528 }, { 10529 key: '_getRemoteContentType', 10530 value: function _getRemoteContentType(src) { 10531 var response = $.ajax({ 10532 type: 'HEAD', 10533 url: src, 10534 async: false 10535 }); 10536 var contentType = response.getResponseHeader('Content-Type'); 10537 return contentType; 10538 } 10539 }, { 10540 key: '_isImage', 10541 value: function _isImage(string) { 10542 return string && string.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); 10543 } 10544 }, { 10545 key: '_isMedia', 10546 value: function _isMedia(string) { 10547 return string && string.match(/(\.(mp3|mp4|ogg|webm|wav)((\?|#).*)?$)/i); 10548 } 10549 }, { 10550 key: '_containerToUse', 10551 value: function _containerToUse() { 10552 var _this2 = this; 10553 10554 // if currently showing an image, fade it out and remove 10555 var $toUse = this._$lightboxBodyTwo; 10556 var $current = this._$lightboxBodyOne; 10557 10558 if (this._$lightboxBodyTwo.hasClass('in')) { 10559 $toUse = this._$lightboxBodyOne; 10560 $current = this._$lightboxBodyTwo; 10561 } 10562 10563 $current.removeClass('in show'); 10564 setTimeout(function () { 10565 if (!_this2._$lightboxBodyTwo.hasClass('in')) _this2._$lightboxBodyTwo.empty(); 10566 if (!_this2._$lightboxBodyOne.hasClass('in')) _this2._$lightboxBodyOne.empty(); 10567 }, 500); 10568 10569 $toUse.addClass('in show'); 10570 return $toUse; 10571 } 10572 }, { 10573 key: '_handle', 10574 value: function _handle() { 10575 10576 var $toUse = this._containerToUse(); 10577 this._updateTitleAndFooter(); 10578 10579 var currentRemote = this._$element.attr('data-remote') || this._$element.attr('href'); 10580 var currentType = this._detectRemoteType(currentRemote, this._$element.attr('data-type') || false); 10581 10582 if (['image', 'youtube', 'vimeo', 'instagram', 'media', 'url'].indexOf(currentType) < 0) return this._error(this._config.strings.type); 10583 10584 switch (currentType) { 10585 case 'image': 10586 this._preloadImage(currentRemote, $toUse); 10587 this._preloadImageByIndex(this._galleryIndex, 3); 10588 break; 10589 case 'youtube': 10590 this._showYoutubeVideo(currentRemote, $toUse); 10591 break; 10592 case 'vimeo': 10593 this._showVimeoVideo(this._getVimeoId(currentRemote), $toUse); 10594 break; 10595 case 'instagram': 10596 this._showInstagramVideo(this._getInstagramId(currentRemote), $toUse); 10597 break; 10598 case 'media': 10599 this._showHtml5Media(currentRemote, $toUse); 10600 break; 10601 default: 10602 // url 10603 this._loadRemoteContent(currentRemote, $toUse); 10604 break; 10605 } 10606 10607 return this; 10608 } 10609 }, { 10610 key: '_getYoutubeId', 10611 value: function _getYoutubeId(string) { 10612 if (!string) return false;
10613 var matches = string.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/); 10614 return matches && matches[2].length === 11 ? matches[2] : false; 10615 } 10616 }, { 10617 key: '_getVimeoId', 10618 value: function _getVimeoId(string) { 10619 return string && string.indexOf('vimeo') > 0 ? string : false; 10620 } 10621 }, { 10622 key: '_getInstagramId', 10623 value: function _getInstagramId(string) { 10624 return string && string.indexOf('instagram') > 0 ? string : false; 10625 } 10626 10627 // layout private methods 10628 }, { 10629 key: '_toggleLoading', 10630 value: function _toggleLoading(show) { 10631 show = show || false; 10632 if (show) { 10633 this._$modalDialog.css('display', 'none'); 10634 this._$modal.removeClass('in show'); 10635 $('.modal-backdrop').append(this._config.loadingMessage); 10636 } else { 10637 this._$modalDialog.css('display', 'block'); 10638 this._$modal.addClass('in show'); 10639 $('.modal-backdrop').find('.ekko-lightbox-loader').remove(); 10640 } 10641 return this; 10642 } 10643 }, { 10644 key: '_calculateBorders', 10645 value: function _calculateBorders() { 10646 return { 10647 top: this._totalCssByAttribute('border-top-width'), 10648 right: this._totalCssByAttribute('border-right-width'), 10649 bottom: this._totalCssByAttribute('border-bottom-width'), 10650 left: this._totalCssByAttribute('border-left-width') 10651 }; 10652 } 10653 }, { 10654 key: '_calculatePadding', 10655 value: function _calculatePadding() { 10656 return { 10657 top: this._totalCssByAttribute('padding-top'), 10658 right: this._totalCssByAttribute('padding-right'), 10659 bottom: this._totalCssByAttribute('padding-bottom'), 10660 left: this._totalCssByAttribute('padding-left') 10661 }; 10662 } 10663 }, { 10664 key: '_totalCssByAttribute', 10665 value: function _totalCssByAttribute(attribute) { 10666 return parseInt(this._$modalDialog.css(attribute), 10) + parseInt(this._$modalContent.css(attribute), 10) + parseInt(this._$modalBody.css(attribute), 10); 10667 } 10668 }, { 10669 key: '_updateTitleAndFooter', 10670 value: function _updateTitleAndFooter() { 10671 var title = this._$element.data('title') || ""; 10672 var caption = this._$element.data('footer') || ""; 10673 10674 this._titleIsShown = false; 10675 if (title || this._config.alwaysShowClose) { 10676 this._titleIsShown = true; 10677 this._$modalHeader.css('display', '').find('.modal-title').html(title || " "); 10678 } else this._$modalHeader.css('display', 'none'); 10679 10680 this._footerIsShown = false; 10681 if (caption) { 10682 this._footerIsShown = true; 10683 this._$modalFooter.css('display', '').html(caption); 10684 } else this._$modalFooter.css('display', 'none'); 10685 10686 return this; 10687 } 10688 }, { 10689 key: '_showYoutubeVideo', 10690 value: function _showYoutubeVideo(remote, $containerForElement) { 10691 var id = this._getYoutubeId(remote); 10692 var query = remote.indexOf('&') > 0 ? remote.substr(remote.indexOf('&')) : ''; 10693 var width = this._$element.data('width') || 560; 10694 var height = this._$element.data('height') || width / (560 / 315); 10695 return this._showVideoIframe('//www.youtube.com/embed/' + id + '?badge=0&autoplay=1&html5=1' + query, width, height, $containerForElement); 10696 } 10697 }, { 10698 key: '_showVimeoVideo', 10699 value: function _showVimeoVideo(id, $containerForElement) { 10700 var width = this._$element.data('width') || 500; 10701 var height = this._$element.data('height') || width / (560 / 315); 10702 return this._showVideoIframe(id + '?autoplay=1', width, height, $containerForElement); 10703 } 10704 }, { 10705 key: '_showInstagramVideo', 10706 value: function _showInstagramVideo(id, $containerForElement) {
10707 // instagram load their content into iframe's so this can be put straight into the element 10708 var width = this._$element.data('width') || 612; 10709 var height = width + 80; 10710 id = id.substr(-1) !== '/' ? id + '/' : id; // ensure id has trailing slash 10711 $containerForElement.html('<iframe width="' + width + '" height="' + height + '" src="' + id + 'embed/" frameborder="0" allowfullscreen></iframe>'); 10712 this._resize(width, height); 10713 this._config.onContentLoaded.call(this); 10714 if (this._$modalArrows) //hide the arrows when showing video 10715 this._$modalArrows.css('display', 'none'); 10716 this._toggleLoading(false); 10717 return this; 10718 } 10719 }, { 10720 key: '_showVideoIframe', 10721 value: function _showVideoIframe(url, width, height, $containerForElement) { 10722 // should be used for videos only. for remote content use loadRemoteContent (data-type=url) 10723 height = height || width; // default to square 10724 $containerForElement.html('<div class="embed-responsive embed-responsive-16by9"><iframe width="' + width + '" height="' + height + '" src="' + url + '" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>'); 10725 this._resize(width, height); 10726 this._config.onContentLoaded.call(this); 10727 if (this._$modalArrows) this._$modalArrows.css('display', 'none'); //hide the arrows when showing video 10728 this._toggleLoading(false); 10729 return this; 10730 } 10731 }, { 10732 key: '_showHtml5Media', 10733 value: function _showHtml5Media(url, $containerForElement) { 10734 // should be used for videos only. for remote content use loadRemoteContent (data-type=url) 10735 var contentType = this._getRemoteContentType(url); 10736 if (!contentType) { 10737 return this._error(this._config.strings.type); 10738 } 10739 var mediaType = ''; 10740 if (contentType.indexOf('audio') > 0) { 10741 mediaType = 'audio'; 10742 } else { 10743 mediaType = 'video'; 10744 } 10745 var width = this._$element.data('width') || 560; 10746 var height = this._$element.data('height') || width / (560 / 315); 10747 $containerForElement.html('<div class="embed-responsive embed-responsive-16by9"><' + mediaType + ' width="' + width + '" height="' + height + '" preload="auto" autoplay controls class="embed-responsive-item"><source src="' + url + '" type="' + contentType + '">' + this._config.strings.type + '</' + mediaType + '></div>'); 10748 this._resize(width, height); 10749 this._config.onContentLoaded.call(this); 10750 if (this._$modalArrows) this._$modalArrows.css('display', 'none'); //hide the arrows when showing video 10751 this._toggleLoading(false); 10752 return this; 10753 } 10754 }, { 10755 key: '_loadRemoteContent', 10756 value: function _loadRemoteContent(url, $containerForElement) { 10757 var _this3 = this; 10758 10759 var width = this._$element.data('width') || 560; 10760 var height = this._$element.data('height') || 560; 10761 10762 var disableExternalCheck = this._$element.data('disableExternalCheck') || false; 10763 this._toggleLoading(false); 10764 10765 // external urls are loading into an iframe 10766 // local ajax can be loaded into the container itself 10767 if (!disableExternalCheck && !this._isExternal(url)) { 10768 $containerForElement.load(url, $.proxy(function () { 10769 return _this3._$element.trigger('loaded.bs.modal'); 10770 l; 10771 })); 10772 } else { 10773 $containerForElement.html('<iframe src="' + url + '" frameborder="0" allowfullscreen></iframe>'); 10774 this._config.onContentLoaded.call(this); 10775 } 10776 10777 if (this._$modalArrows) //hide the arrows when remote content 10778 this._$modalArrows.css('display', 'none'); 10779 10780 this._resize(width, height); 10781 return this; 10782 } 10783 }, { 10784 key: '_isExternal', 10785 value: function _isExternal(url) { 10786 var match = url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/); 10787 if (typeof match[1] === "string" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol) return true; 10788 10789 if (typeof match[2] === "string" && match[2].length > 0 && match[2].replace(new RegExp(':(' + ({ 10790 "http:": 80, 10791 "https:": 443 10792 })[location.protocol] + ')?$'), "") !== location.host) return true; 10793 10794 return false;
10795 } 10796 }, { 10797 key: '_error', 10798 value: function _error(message) { 10799 console.error(message); 10800 this._containerToUse().html(message); 10801 this._resize(300, 300); 10802 return this; 10803 } 10804 }, { 10805 key: '_preloadImageByIndex', 10806 value: function _preloadImageByIndex(startIndex, numberOfTimes) { 10807 10808 if (!this._$galleryItems) return; 10809 10810 var next = $(this._$galleryItems.get(startIndex), false); 10811 if (typeof next == 'undefined') return; 10812 10813 var src = next.attr('data-remote') || next.attr('href'); 10814 if (next.attr('data-type') === 'image' || this._isImage(src)) this._preloadImage(src, false); 10815 10816 if (numberOfTimes > 0) return this._preloadImageByIndex(startIndex + 1, numberOfTimes - 1); 10817 } 10818 }, { 10819 key: '_preloadImage', 10820 value: function _preloadImage(src, $containerForImage) { 10821 var _this4 = this; 10822 10823 $containerForImage = $containerForImage || false; 10824 10825 var img = new Image(); 10826 if ($containerForImage) { 10827 (function () { 10828 10829 // if loading takes > 200ms show a loader 10830 var loadingTimeout = setTimeout(function () { 10831 $containerForImage.append(_this4._config.loadingMessage); 10832 }, 200); 10833 10834 img.onload = function () { 10835 if (loadingTimeout) clearTimeout(loadingTimeout); 10836 loadingTimeout = null; 10837 var image = $('<img />'); 10838 image.attr('src', img.src); 10839 image.addClass('img-fluid'); 10840 10841 // backward compatibility for bootstrap v3 10842 image.css('width', '100%'); 10843 10844 $containerForImage.html(image); 10845 if (_this4._$modalArrows) _this4._$modalArrows.css('display', ''); // remove display to default to css property 10846 10847 _this4._resize(img.width, img.height); 10848 _this4._toggleLoading(false); 10849 return _this4._config.onContentLoaded.call(_this4); 10850 }; 10851 img.onerror = function () { 10852 _this4._toggleLoading(false); 10853 return _this4._error(_this4._config.strings.fail + (' ' + src)); 10854 }; 10855 })(); 10856 } 10857 10858 img.src = src; 10859 return img; 10860 } 10861 }, { 10862 key: '_swipeGesure', 10863 value: function _swipeGesure() { 10864 if (this._touchendX < this._touchstartX) { 10865 return this.navigateRight(); 10866 } 10867 if (this._touchendX > this._touchstartX) { 10868 return this.navigateLeft(); 10869 } 10870 } 10871 }, { 10872 key: '_resize', 10873 value: function _resize(width, height) { 10874 10875 height = height || width; 10876 this._wantedWidth = width; 10877 this._wantedHeight = height; 10878 10879 var imageAspecRatio = width / height; 10880 10881 // if width > the available space, scale down the expected width and height 10882 var widthBorderAndPadding = this._padding.left + this._padding.right + this._border.left + this._border.right; 10883 10884 // force 10px margin if window size > 575px 10885 var addMargin = this._config.doc.body.clientWidth > 575 ? 20 : 0; 10886 var discountMargin = this._config.doc.body.clientWidth > 575 ? 0 : 20; 10887 10888 var maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth - addMargin, this._config.maxWidth); 10889 10890 if (width + widthBorderAndPadding > maxWidth) { 10891 height = (maxWidth - widthBorderAndPadding - discountMargin) / imageAspecR
10891atio; 10892 width = maxWidth; 10893 } else width = width + widthBorderAndPadding; 10894 10895 var headerHeight = 0, 10896 footerHeight = 0; 10897 10898 // as the resize is performed the modal is show, the calculate might fail 10899 // if so, default to the default sizes 10900 if (this._footerIsShown) footerHeight = this._$modalFooter.outerHeight(true) || 55; 10901 10902 if (this._titleIsShown) headerHeight = this._$modalHeader.outerHeight(true) || 67; 10903 10904 var borderPadding = this._padding.top + this._padding.bottom + this._border.bottom + this._border.top; 10905 10906 //calculated each time as resizing the window can cause them to change due to Bootstraps fluid margins 10907 var margins = parseFloat(this._$modalDialog.css('margin-top')) + parseFloat(this._$modalDialog.css('margin-bottom')); 10908 10909 var maxHeight = Math.min(height, $(window).height() - borderPadding - margins - headerHeight - footerHeight, this._config.maxHeight - borderPadding - headerHeight - footerHeight); 10910 10911 if (height > maxHeight) { 10912 // if height > the available height, scale down the width 10913 width = Math.ceil(maxHeight * imageAspecR
10913atio) + widthBorderAndPadding; 10914 } 10915 10916 this._$lightboxContainer.css('height', maxHeight); 10917 this._$modalDialog.css('flex', 1).css('maxWidth', width); 10918 10919 var modal = this._$modal.data('bs.modal'); 10920 if (modal) { 10921 // v4 method is mistakenly protected 10922 try { 10923 modal._handleUpdate(); 10924 } catch (Exception) { 10925 modal.handleUpdate(); 10926 } 10927 } 10928 return this; 10929 } 10930 }], [{ 10931 key: '_jQueryInterface', 10932 value: function _jQueryInterface(config) { 10933 var _this5 = this; 10934 10935 config = config || {}; 10936 return this.each(function () { 10937 var $this = $(_this5); 10938 var _config = $.extend({}, Lightbox.Default, $this.data(), typeof config === 'object' && config); 10939 10940 new Lightbox(_this5, _config); 10941 }); 10942 } 10943 }]); 10944 10945 return Lightbox; 10946 })(); 10947 10948 $.fn[NAME] = Lightbox._jQueryInterface; 10949 $.fn[NAME].Constructor = Lightbox; 10950 $.fn[NAME].noConflict = function () { 10951 $.fn[NAME] = JQUERY_NO_CONFLICT; 10952 return Lightbox._jQueryInterface; 10953 }; 10954 10955 return Lightbox; 10956 })(jQuery); 10957//# sourceMappingURL=ekko-lightbox.js.map 10958 10959 }(jQuery); 10960 10961// Define Lightbox Bootstrap For Theme 10962 10963 jQuery(function ($) { 10964 if (evolve_js_local_vars.lightbox_images === '1') { 10965 $(function () { 10966 var link = $('.post-content a, .thumbnail-post a'); 10967 var link_data = link; 10968 var link_title = link.not(".zoom"); 10969 10970 link_data.filter(function () { 10971 return this.href && this.href.match(/\.(?:jpe?g|gif|bmp|a?png)/i); 10972 }).attr({"data-toggle": "lightbox", "data-type": "image"}); 10973 10974 link_title.each(function () { 10975 if ($(this).find("img").attr("alt")) { 10976 $(this).attr("data-title", $(this).find("img").attr("alt")); 10977 } else { 10978 $(this).attr("data-title", " "); 10979 } 10980 }); 10981 10982 if (evolve_js_local_vars.lightbox_images_gallery === '1') { 10983 link.filter(function () { 10984 return this.href && this.href.match(/\.(?:jpe?g|gif|bmp|a?png)/i); 10985 }).attr('data-gallery', 'image-gallery'); 10986 } 10987 }); 10988 } 10989 if (evolve_js_local_vars.lightbox_videos === '1') { 10990 $(function () { 10991 var link = $('.post-content a'); 10992 10993 link.filter(function () { 10994 return this.href && this.href.match(/^(http:\/\/|https:\/\/)(|player\.vimeo\.com|vimeo\.com|youtu\.be|www\.youtube\.com)\/([\w\/]+)([\?].*)?$/); 10995 }).attr({"data-toggle": "lightbox", "data-title": " "}); 10996 10997 link.filter(function () { 10998 var match = this.href.match(/http:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/); 10999 if (match != null) { 11000 this.setAttribute('data-remote', 'https://player.vimeo.com/video/' + match[2]); 11001 } 11002 }); 11003 }); 11004 } 11005 if (evolve_js_local_vars.lightbox_instagram === '1') { 11006 $(function () { 11007 var link = $('.post-content a'); 11008 11009 link.filter(function () { 11010 return this.href && this.href.match(/^(http:\/\/|https:\/\/)(|instagram\.com||www\.instagram\.com)\/([\p\/]+)/); 11011 }).attr({"data-toggle": "lightbox", "data-title": " "}); 11012 }); 11013 } 11014 $(document).on('click', '[data-toggle="lightbox"]', function (event) { 11015 event.preventDefault(); 11016 $(this).ekkoLightbox({ 11017 wrapping: (evolve_js_local_vars.lightbox_wrapping === '1') ? true : false, 11018 showArrows: (evolve_js_local_vars.lightbox_arrows === '1') ? true : false, 11019 maxWidth: evolve_js_local_vars.lightbox_maxwidth, 11020 maxHeight: evolve_js_local_vars.lightbox_maxheight, 11021 leftArrow: '<div class="carousel-control-button carousel-control-prev-icon" aria-hidden="true"></div><span class="screen-reader-text sr-only">' + evolve_js_local_vars.slider_arrow_prev + '</span>', 11022 rightArrow: '<div class="carousel-control-button carousel-control-next-icon" aria-hidden="true"></div><span class="screen-reader-text sr-only">' + evolve_js_local_vars.slider_arrow_next + '</span>' 11023 }); 11024 }); 11025 }); 11026} 11027 11028/* 11029 Side Navigation 11030 --------------------------------------- */ 11031 11032jQuery(function ($) { 11033 $('ul.sub-items').each(function () { 11034 var get_ID = $(this).prev().children('.open-close').attr('href').substring(1); 11035 $(this).attr({"id": get_ID, "aria-labelledby": get_ID}); 11036 }); 11037 11038 var current_page_item = $('.current_page_item'); 11039 var current_page_parent = $('.current_page_parent'); 11040 var current_page_ancestor = $('.current_page_ancestor'); 11041 11042 current_page_item.each(function () { 11043 current_page_item.children('ul.sub-items').addClass('show'); 11044 current_page_item.children().children('a.open-close').removeClass('collapsed'); 11045 }); 11046 current_page_parent.each(function () { 11047 current_page_parent.children('ul.sub-items').addClass('show'); 11048 current_page_parent.children().children('a.open-close').removeClass('collapsed'); 11049 }); 11050 current_page_ancestor.each(function () { 11051 current_page_ancestor.children('ul.sub-items').addClass('show'); 11052 current_page_ancestor.children().children('a.open-close').removeClass('collapsed'); 11053 }); 11054 11055 $(document).ready(function () {
11056 $(".show-hide-all").on("click", function () { 11057 var accordionId = $(this).attr("side-nav-id"), 11058 numPanelOpen = $(accordionId + ' ul.sub-items.show').length; 11059 11060 $(this).toggleClass("active"); 11061 11062 if (numPanelOpen == 0) { 11063 openAllPanels(accordionId); 11064 } else { 11065 closeAllPanels(accordionId); 11066 } 11067 }); 11068 openAllPanels = function (aId) { 11069 $(aId + ' ul.sub-items').collapse('show'); 11070 }; 11071 closeAllPanels = function (aId) { 11072 $(aId + ' ul.sub-items').collapse('hide'); 11073 } 11074 }); 11075}); 11076 11077if (evolve_js_local_vars.sticky_sidebar === '1') { 11078 11079 'use strict'; 11080 11081 /** 11082 * Copyright Marc J. Schmidt. See the LICENSE file at the top-level 11083 * directory of this distribution and at 11084 * https://github.com/marcj/css-element-queries/blob/master/LICENSE. 11085 */ 11086 (function (root, factory) { 11087 if (typeof define === "function" && define.amd) { 11088 define(factory); 11089 } else if (typeof exports === "object") { 11090 module.exports = factory(); 11091 } else { 11092 root.ResizeSensor = factory(); 11093 } 11094 }(typeof window !== 'undefined' ? window : this, function () { 11095 11096 // Make sure it does not throw in a SSR (Server Side Rendering) situation 11097 if (typeof window === "undefined") { 11098 return null; 11099 } 11100 // Only used for the dirty checking, so the event callback count is limited to max 1 call per fps per sensor. 11101 // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and 11102 // would generate too many unnecessary events. 11103 var requestAnimationFrame = window.requestAnimationFrame || 11104 window.mozRequestAnimationFrame || 11105 window.webkitRequestAnimationFrame || 11106 function (fn) { 11107 return window.setTimeout(fn, 20); 11108 }; 11109 11110 /** 11111 * Iterate over each of the provided element(s). 11112 * 11113 * @param {HTMLElement|HTMLElement[]} elements 11114 * @param {Function} callback 11115 */ 11116 function forEachElement(elements, callback) { 11117 var elementsType = Object.prototype.toString.call(elements); 11118 var isCollectionTyped = ('[object Array]' === elementsType 11119 || ('[object NodeList]' === elementsType) 11120 || ('[object HTMLCollection]' === elementsType) 11121 || ('[object Object]' === elementsType) 11122 || ('undefined' !== typeof jQuery && elements instanceof jQuery) //jquery 11123 || ('undefined' !== typeof Elements && elements instanceof Elements) //mootools 11124 ); 11125 var i = 0, j = elements.length; 11126 if (isCollectionTyped) { 11127 for (; i < j; i++) { 11128 callback(elements[i]); 11129 } 11130 } else { 11131 callback(elements); 11132 } 11133 } 11134 11135 /** 11136 * Get element size 11137 * @param {HTMLElement} element 11138 * @returns {Object} {width, height} 11139 */ 11140 function getElementSize(element) { 11141 if (!element.getBoundingClientRect) { 11142 return { 11143 width: element.offsetWidth, 11144 height: element.offsetHeight 11145 } 11146 } 11147 11148 var rect = element.getBoundingClientRect(); 11149 return { 11150 width: Math.round(rect.width), 11151 height: Math.round(rect.height) 11152 } 11153 } 11154 11155 /** 11156 * Class for dimension change detection. 11157 * 11158 * @param {Element|Element[]|Elements|jQuery} element 11159 * @param {Function} callback 11160 * 11161 * @constructor 11162 */ 11163 var ResizeSensor = function (element, callback) { 11164 /** 11165 * 11166 * @constructor 11167 */ 11168 function EventQueue() { 11169 var q = []; 11170 this.add = function (ev) { 11171 q.push(ev); 11172 }; 11173 11174 var i, j; 11175 this.call = function (sizeInfo) { 11176 for (i = 0, j = q.length; i < j; i++) { 11177 q[i].call(this, sizeInfo); 11178 } 11179 }; 11180 11181 this.remove = function (ev) { 11182 var newQueue = []; 11183 for (i = 0, j = q.length; i < j; i++) { 11184 if (q[i] !== ev) newQueue.push(q[i]); 11185 } 11186 q = newQueue; 11187 }; 11188 11189 this.length = function () { 11190 return q.length; 11191 } 11192 } 11193 11194 /** 11195 * 11196 * @param {HTMLElement} element 11197 * @param {Function} resized 11198 */ 11199 function attachResizeEvent(element, resized) { 11200 if (!element) return; 11201 if (element.resizedAttached) { 11202 element.resizedAttached.add(resized); 11203 return; 11204 } 11205 11206 element.resizedAttached = new EventQueue(); 11207 element.resizedAttached.add(resized); 11208 11209 element.resizeSensor = document.createElement('div'); 11210 element.resizeSensor.dir = 'ltr'; 11211 element.resizeSensor.className = 'resize-sensor'; 11212 var style = 'pointer-events: none; position: absolute; left: 0px; top: 0px; right: 0; bottom: 0; ' + 11213 'overflow: hidden; z-index: -1; visibility: hidden; max-width: 100%;'; 11214 var styleChild = 'position: absolute; left: 0; top: 0; transition: 0s;'; 11215 11216 element.resizeSensor.style.cssText = style; 11217 element.resizeSensor.innerHTML = 11218 '<div class="resize-sensor-expand" style="' + style + '">' + 11219 '<div style="' + styleChild + '"></div>' + 11220 '</div>' + 11221 '<div class="resize-sensor-shrink" style="' + style + '">' + 11222 '<div style="' + styleChild + ' width: 200%; height: 200%"></div>' + 11223 '</div>'; 11224 element.appendChild(element.resizeSensor); 11225 11226 var computedStyle = window.getComputedStyle(element); 11227 var position = computedStyle ? computedStyle.getPropertyValue('position') : null; 11228 if ('absolute' !== position && 'relative' !== position && 'fixed' !== position) { 11229 element.style.position = 'relative'; 11230 } 11231 11232 var expand = element.resizeSensor.childNodes[0]; 11233 var expandChild = expand.childNodes[0]; 11234 var shrink = element.resizeSensor.childNodes[1]; 11235 var dirty, rafId; 11236 var size = getElementSize(element); 11237 var lastWidth = size.width; 11238 var lastHeight = size.height; 11239 var initialHiddenCheck = true; 11240 var lastAnimationFrame = 0; 11241 11242 var resetExpandShrink = function () { 11243 var width = element.offsetWidth; 11244 var height = element.offsetHeight; 11245 11246 expandChild.style.width = (width + 10) + 'px'; 11247 expandChild.style.height = (height + 10) + 'px'; 11248 11249 expand.scrollLeft = width + 10; 11250 expand.scrollTop = height + 10; 11251 11252 shrink.scrollLeft = width + 10; 11253 shrink.scrollTop = height + 10; 11254 }; 11255 11256 var reset = function () { 11257 // Check if element is hidden 11258 if (initialHiddenCheck) { 11259 var invisible = element.offsetWidth === 0 && element.offsetHeight === 0; 11260 if (invisible) { 11261 // Check in next frame 11262 if (!lastAnimationFrame) { 11263 lastAnimationFrame = requestAnimationFrame(function () { 11264 lastAnimationFrame = 0; 11265 11266 reset(); 11267 }); 11268 } 11269 11270 return; 11271 } else { 11272 // Stop checking 11273 initialHiddenCheck = false;
11274 } 11275 } 11276 11277 resetExpandShrink(); 11278 }; 11279 element.resizeSensor.resetSensor = reset; 11280 11281 var onResized = function () { 11282 rafId = 0; 11283 11284 if (!dirty) return; 11285 11286 lastWidth = size.width; 11287 lastHeight = size.height; 11288 11289 if (element.resizedAttached) { 11290 element.resizedAttached.call(size); 11291 } 11292 }; 11293 11294 var onScroll = function () { 11295 size = getElementSize(element); 11296 dirty = size.width !== lastWidth || size.height !== lastHeight; 11297 11298 if (dirty && !rafId) { 11299 rafId = requestAnimationFrame(onResized); 11300 } 11301 11302 reset(); 11303 }; 11304 11305 var addEvent = function (el, name, cb) { 11306 if (el.attachEvent) { 11307 el.attachEvent('on' + name, cb); 11308 } else { 11309 el.addEventListener(name, cb); 11310 } 11311 }; 11312 11313 addEvent(expand, 'scroll', onScroll); 11314 addEvent(shrink, 'scroll', onScroll); 11315 11316 // Fix for custom Elements 11317 requestAnimationFrame(reset); 11318 } 11319 11320 forEachElement(element, function (elem) { 11321 attachResizeEvent(elem, callback); 11322 }); 11323 11324 this.detach = function (ev) { 11325 ResizeSensor.detach(element, ev); 11326 }; 11327 11328 this.reset = function () { 11329 element.resizeSensor.resetSensor(); 11330 }; 11331 }; 11332 11333 ResizeSensor.reset = function (element) { 11334 forEachElement(element, function (elem) { 11335 elem.resizeSensor.resetSensor(); 11336 }); 11337 }; 11338 11339 ResizeSensor.detach = function (element, ev) { 11340 forEachElement(element, function (elem) { 11341 if (!elem) return; 11342 if (elem.resizedAttached && typeof ev === "function") { 11343 elem.resizedAttached.remove(ev); 11344 if (elem.resizedAttached.length()) return; 11345 } 11346 if (elem.resizeSensor) { 11347 if (elem.contains(elem.resizeSensor)) { 11348 elem.removeChild(elem.resizeSensor); 11349 } 11350 delete elem.resizeSensor; 11351 delete elem.resizedAttached; 11352 } 11353 }); 11354 }; 11355 11356 if (typeof MutationObserver !== "undefined") { 11357 var observer = new MutationObserver(function (mutations) { 11358 for (var i in mutations) { 11359 if (mutations.hasOwnProperty(i)) { 11360 var items = mutations[i].addedNodes; 11361 for (var j = 0; j < items.length; j++) { 11362 if (items[j].resizeSensor) { 11363 ResizeSensor.reset(items[j]); 11364 } 11365 } 11366 } 11367 } 11368 }); 11369 11370 document.addEventListener("DOMContentLoaded", function (event) { 11371 observer.observe(document.body, { 11372 childList: true, 11373 subtree: true, 11374 }); 11375 }); 11376 } 11377 11378 return ResizeSensor; 11379 11380 })); 11381} 11382 11383jQuery(function ($) { 11384 $('.btn-search').click(function (e) { 11385 e.preventDefault(); 11386 }); 11387 $('.dropdown.my-account').click(function (e) { 11388 // e.preventDefault(); 11389 $(this).addClass('open-nw') 11390 11391 }); 11392 $('.dropdown.my-account').hover(function (e) { 11393 // e.preventDefault(); 11394 $(this).addClass('open-nw') 11395 11396 }); 11397 11398 $(document).click( function(e){ 11399 if ( $(e.target).closest('.dropdown.my-account').length ) { 11400 // клик внÑÑÑи ÑлеменÑа 11401 return; 11402 } 11403 // клик ÑнаÑÑжи ÑлеменÑа 11404 $('.dropdown.my-account').removeClass('open-nw'); 11405 }); 11406}); 11407 11408if (evolve_js_local_vars.search_box_effect === 'big-in-center') { 11409 (function (window) { 11410 11411 'use strict'; 11412 var openCtrl = document.getElementById('btn-search'), 11413 closeCtrl = document.getElementById('btn-search-close'), 11414 searchContainer = document.querySelector('.search-wrapper'), 11415 inputSearch = searchContainer.querySelector('.search-wrapper-input'); 11416
11417 function init() { 11418 initEvents(); 11419 } 11420 11421 function initEvents() { 11422 11423 openCtrl.addEventListener('click', openSearch); 11424 closeCtrl.addEventListener('click', closeSearch); 11425 document.addEventListener('keyup', function (ev) { 11426 // escape key. 11427 if (ev.keyCode == 27) { 11428 closeSearch(); 11429 } 11430 }); 11431 } 11432 11433 function openSearch() { 11434 searchContainer.classList.add('search-open'); 11435 inputSearch.focus(); 11436 } 11437 11438 function closeSearch() { 11439 searchContainer.classList.remove('search-open'); 11440 inputSearch.blur(); 11441 inputSearch.value = ''; 11442 } 11443 11444 init(); 11445 11446 })(window); 11447}
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.