1"use strict"; 2 3function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 4 5function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 6 7function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 8 9function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 10 11function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 12 13function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 14 15function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } 16 17function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 18 19function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 20 21function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } 22 23(function ($) { 24 document.addEventListener('DOMContentLoaded', function () { 25 // VENDOR START 26 27 /** 28 * -------------------------------------------------------------------------- 29 * Bootstrap (v4.6.1): util.js 30 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 31 * -------------------------------------------------------------------------- 32 */ 33 34 /** 35 * Private TransitionEnd Helpers 36 */ 37 var TRANSITION_END = 'transitionend'; 38 var MAX_UID = 1000000; 39 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 40 41 function toType(obj) { 42 if (obj === null || typeof obj === 'undefined') { 43 return "".concat(obj); 44 } 45 46 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 47 } 48 49 function getSpecialTransitionEndEvent() { 50 return { 51 bindType: TRANSITION_END, 52 delegateType: TRANSITION_END, 53 handle: function handle(event) { 54 if ($(event.target).is(this)) { 55 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 56 } 57 58 return undefined; 59 } 60 }; 61 } 62 63 function transitionEndEmulator(duration) { 64 var _this = this; 65 66 var called = false; 67 $(this).one(Util.TRANSITION_END, function () { 68 called = true; 69 }); 70 setTimeout(function () { 71 if (!called) { 72 Util.triggerTransitionEnd(_this); 73 } 74 }, duration); 75 return this; 76 } 77 78 function setTransitionEndSupport() { 79 $.fn.emulateTransitionEnd = transitionEndEmulator; 80 $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 81 } 82 /** 83 * Public Util API 84 */ 85 86 87 var Util = { 88 TRANSITION_END: 'bsTransitionEnd', 89 getUID: function getUID(prefix) { 90 do { 91 // eslint-disable-next-line no-bitwise 92 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 93 } while (document.getElementById(prefix)); 94 95 return prefix; 96 }, 97 getSelectorFromElement: function getSelectorFromElement(element) { 98 var selector = element.getAttribute('data-target'); 99 100 if (!selector || selector === '#') { 101 var hrefAttr = element.getAttribute('href'); 102 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 103 } 104 105 try { 106 return document.querySelector(selector) ? selector : null; 107 } catch (_) { 108 return null; 109 } 110 }, 111 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 112 if (!element) { 113 return 0; 114 } // Get transition-duration of the element 115 116 117 var transitionDuration = $(element).css('transition-duration'); 118 var transitionDelay = $(element).css('transition-delay'); 119 var floatTransitionDuration = parseFloat(transitionDuration); 120 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 121 122 if (!floatTransitionDuration && !floatTransitionDelay) { 123 return 0; 124 } // If multiple durations are defined, take the first 125 126 127 transitionDuration = transitionDuration.split(',')[0]; 128 transitionDelay = transitionDelay.split(',')[0]; 129 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 130 }, 131 reflow: function reflow(element) { 132 return element.offsetHeight; 133 }, 134 triggerTransitionEnd: function triggerTransitionEnd(element) { 135 $(element).trigger(TRANSITION_END); 136 }, 137 supportsTransitionEnd: function supportsTransitionEnd() { 138 return Boolean(TRANSITION_END); 139 }, 140 isElement: function isElement(obj) { 141 return (obj[0] || obj).nodeType; 142 }, 143 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 144 for (var property in configTypes) { 145 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 146 var expectedTypes = configTypes[property]; 147 var value = config[property]; 148 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 149 150 if (!new RegExp(expectedTypes).test(valueType)) { 151 throw new Error("".concat(componentName.toUpperCase(), ": ") + "Option \"".concat(property, "\" provided type \"").concat(valueType, "\" ") + "but expected type \"".concat(expectedTypes, "\".")); 152 } 153 } 154 } 155 }, 156 findShadowRoot: function findShadowRoot(element) { 157 if (!document.documentElement.attachShadow) { 158 return null; 159 } // Can find the shadow root otherwise it'll return the document 160 161 162 if (typeof element.getRootNode === 'function') { 163 var root = element.getRootNode(); 164 return root instanceof ShadowRoot ? root : null; 165 } 166 167 if (element instanceof ShadowRoot) { 168 return element; 169 } // when we don't find a shadow root 170 171 172 if (!element.parentNode) { 173 return null; 174 } 175 176 return Util.findShadowRoot(element.parentNode); 177 }, 178 jQueryDetection: function jQueryDetection() { 179 if (typeof $ === 'undefined') { 180 throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript."); 181 } 182 183 var version = $.fn.jquery.split(' ')[0].split('.'); 184 var minMajor = 1; 185 var ltMajor = 2; 186 var minMinor = 9; 187 var minPatch = 1; 188 var maxMajor = 4; 189 190 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >
190= maxMajor) { 191 throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0"); 192 } 193 } 194 }; 195 Util.jQueryDetection(); 196 setTransitionEndSupport(); 197 /** 198 * -------------------------------------------------------------------------- 199 * Bootstrap (v4.6.1): tab.js 200 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 201 * -------------------------------------------------------------------------- 202 */ 203 204 /** 205 * Constants 206 */ 207 208 var NAME = 'tab'; 209 var VERSION = '4.6.1'; 210 var DATA_KEY = 'bs.tab'; 211 var EVENT_KEY = ".".concat(DATA_KEY); 212 var DATA_API_KEY = '.data-api'; 213 var JQUERY_NO_CONFLICT = $.fn[NAME]; 214 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 215 var CLASS_NAME_ACTIVE = 'active'; 216 var CLASS_NAME_DISABLED = 'disabled'; 217 var CLASS_NAME_FADE = 'fade'; 218 var CLASS_NAME_SHOW = 'show'; 219 var EVENT_HIDE = "hide".concat(EVENT_KEY); 220 var EVENT_HIDDEN = "hidden".concat(EVENT_KEY); 221 var EVENT_SHOW = "show".concat(EVENT_KEY); 222 var EVENT_SHOWN = "shown".concat(EVENT_KEY); 223 var EVENT_CLICK_DATA_API = "click".concat(EVENT_KEY).concat(DATA_API_KEY); 224 var SELECTOR_DROPDOWN = '.dropdown'; 225 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 226 var SELECTOR_ACTIVE = '.active'; 227 var SELECTOR_ACTIVE_UL = '> li > .active'; 228 var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 229 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 230 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 231 /** 232 * Class definition 233 */ 234 235 var Tab = /*#__PURE__*/function () { 236 function Tab(element) { 237 _classCallCheck(this, Tab); 238 239 this._element = element; 240 } // Getters 241 242 243 _createClass(Tab, [{ 244 key: "show", 245 value: // Public 246 function show() { 247 var _this2 = this; 248 249 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(CLASS_NAME_ACTIVE) || $(this._element).hasClass(CLASS_NAME_DISABLED)) { 250 return; 251 } 252 253 var target; 254 var previous; 255 var listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]; 256 var selector = Util.getSelectorFromElement(this._element); 257 258 if (listElement) { 259 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE; 260 previous = $.makeArray($(listElement).find(itemSelector)); 261 previous = previous[previous.length - 1]; 262 } 263 264 var hideEvent = $.Event(EVENT_HIDE, { 265 relatedTarget: this._element 266 }); 267 var showEvent = $.Event(EVENT_SHOW, { 268 relatedTarget: previous 269 }); 270 271 if (previous) { 272 $(previous).trigger(hideEvent); 273 } 274 275 $(this._element).trigger(showEvent); 276 277 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 278 return; 279 } 280 281 if (selector) { 282 target = document.querySelector(selector); 283 } 284 285 this._activate(this._element, listElement); 286 287 var complete = function complete() { 288 var hiddenEvent = $.Event(EVENT_HIDDEN, { 289 relatedTarget: _this2._element 290 }); 291 var shownEvent = $.Event(EVENT_SHOWN, { 292 relatedTarget: previous 293 }); 294 $(previous).trigger(hiddenEvent); 295 $(_this2._element).trigger(shownEvent); 296 }; 297 298 if (target) { 299 this._activate(target, target.parentNode, complete); 300 } else { 301 complete(); 302 } 303 } 304 }, { 305 key: "dispose", 306 value: function dispose() { 307 $.removeData(this._element, DATA_KEY); 308 this._element = null; 309 } // Private 310 311 }, { 312 key: "_activate", 313 value: function _activate(element, container, callback) { 314 var _this3 = this; 315 316 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(SELECTOR_ACTIVE_UL) : $(container).children(SELECTOR_ACTIVE); 317 var active = activeElements[0]; 318 var isTransitioning = callback && active && $(active).hasClass(CLASS_NAME_FADE); 319 320 var complete = function complete() { 321 return _this3._transitionComplete(element, active, callback); 322 }; 323 324 if (active && isTransitioning) { 325 var transitionDuration = Util.getTransitionDurationFromElement(active); 326 $(active).removeClass(CLASS_NAME_SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 327 } else { 328 complete(); 329 } 330 } 331 }, { 332 key: "_transitionComplete", 333 value: function _transitionComplete(element, active, callback) { 334 if (active) { 335 $(active).removeClass(CLASS_NAME_ACTIVE);
336 var dropdownChild = $(active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 337 338 if (dropdownChild) { 339 $(dropdownChild).removeClass(CLASS_NAME_ACTIVE); 340 } 341 342 if (active.getAttribute('role') === 'tab') { 343 active.setAttribute('aria-selected', false); 344 } 345 } 346 347 $(element).addClass(CLASS_NAME_ACTIVE); 348 349 if (element.getAttribute('role') === 'tab') { 350 element.setAttribute('aria-selected', true); 351 } 352 353 Util.reflow(element); 354 355 if (element.classList.contains(CLASS_NAME_FADE)) { 356 element.classList.add(CLASS_NAME_SHOW); 357 } 358 359 var parent = element.parentNode; 360 361 if (parent && parent.nodeName === 'LI') { 362 parent = parent.parentNode; 363 } 364 365 if (parent && $(parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 366 var dropdownElement = $(element).closest(SELECTOR_DROPDOWN)[0]; 367 368 if (dropdownElement) { 369 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE)); 370 $(dropdownToggleList).addClass(CLASS_NAME_ACTIVE); 371 } 372 373 element.setAttribute('aria-expanded', true); 374 } 375 376 if (callback) { 377 callback(); 378 } 379 } // Static 380 381 }], [{ 382 key: "VERSION", 383 get: function get() { 384 return VERSION; 385 } 386 }, { 387 key: "_jQueryInterface", 388 value: function _jQueryInterface(config) { 389 return this.each(function () { 390 var $this = $(this); 391 var data = $this.data(DATA_KEY); 392 393 if (!data) { 394 data = new Tab(this); 395 $this.data(DATA_KEY, data); 396 } 397 398 if (typeof config === 'string') { 399 if (typeof data[config] === 'undefined') { 400 throw new TypeError("No method named \"".concat(config, "\"")); 401 } 402 403 data[config](); 404 } 405 }); 406 } 407 }]); 408 409 return Tab; 410 }(); 411 /** 412 * Data API implementation 413 */ 414 415 416 $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 417 event.preventDefault(); 418 419 Tab._jQueryInterface.call($(this), 'show'); 420 }); 421 /** 422 * jQuery 423 */ 424 425 $.fn[NAME] = Tab._jQueryInterface; 426 $.fn[NAME].Constructor = Tab; 427 428 $.fn[NAME].noConflict = function () { 429 $.fn[NAME] = JQUERY_NO_CONFLICT; 430 return Tab._jQueryInterface; 431 }; // VENDOR END 432 433 /** 434 * 435 * iso widget toggle 436 * TODO::use for all widgets 437 * 438 */ 439 440 441 (function () { 442 $('[data-widget-trigger]').on('click', function () { 443 var widgetName = $(this).attr('data-widget-trigger'); 444 var widgetScope = $(this).attr('data-widget-trigger-scope'); //default scope = parent 445 446 if (widgetScope == 'undefinied' || widgetScope == '' || widgetScope == 'parent') { 447 var widgetScopeObj = $(this).parent(); 448 var widgetContent = widgetScopeObj.find("[data-widget-content='" + widgetName + "']"); 449 } else if (widgetScope == 'l-wrapper') { 450 var widgetScopeObj = $(this).parents('.l-wrapper'); 451 var widgetContent = widgetScopeObj.find("[data-widget-content='" + widgetName + "']"); 452 } //one widget found 453 454 455 if (widgetContent.length == 1) { 456 //show (widget is closed) 457 if (false == $(this).hasClass('opened')) { 458 //hide others 459 widgetScopeObj.find('[data-widget-content]').hide('fast'); 460 widgetScopeObj.find('[data-widget-trigger]').removeClass('opened'); 461 $(this).addClass('opened'); 462 widgetContent.show('fast'); 463 } //hide (widget is opened) 464 else { 465 $(this).removeClass('opened'); 466 widgetContent.hide('fast'); 467 } 468 } //console.log(widgetScope); 469 //console.log(widgetContent); 470 471 }); 472 })(); 473 /** 474 * 475 * top widgets 476 * 477 */ 478 479 480 (function () { 481 if ($('#widget_trigger__lang').length && $('#widget__lang').length) { 482 $('#widget_trigger__lang').click(function () { 483 if (!$('#widget__search').hasClass('u-hidden')) { 484 $('#widget__search').addClass('u-hidden'); 485 } 486 487 if (!$('#widget__menu').hasClass('u-hidden')) { 488 $('#widget__menu').addClass('u-hidden'); 489 } 490 491 $('#widget__lang').toggleClass('u-hidden'); 492 }); 493 } 494 495 if ($('#widget_trigger__search').length && $('#widget__search').length) { 496 $('#widget_trigger__search').click(function () { 497 if (!$('#widget__lang').hasClass('u-hidden')) { 498 $('#widget__lang').addClass('u-hidden'); 499 } 500 501 if (!$('#widget__menu').hasClass('u-hidden')) { 502 $('#widget__menu').addClass('u-hidden'); 503 } 504 505 $('#widget__search').toggleClass('u-hidden'); 506 }); 507 } 508 509 if ($('#widget_trigger__menu').length && $('#widget__menu').length) { 510 $('#widget_trigger__menu').click(function () { 511 if (!$('#widget__search').hasClass('u-hidden')) { 512 $('#widget__search').addClass('u-hidden'); 513 } 514 515 if (!$('#widget__lang').hasClass('u-hidden')) { 516 $('#widget__lang').addClass('u-hidden'); 517 } 518 519 $('#widget__menu').toggleClass('u-hidden'); 520 }); 521 } 522 523 if ($('#widget_trigger_close__menu').length && $('#widget__menu').length) { 524 $('#widget_trigger_close__menu').click(function () { 525 $('#widget__menu').addClass('u-hidden'); 526 }); 527 } 528 })(); 529 /** 530 * 531 * main menu dropdown 532 * 533 */ 534 535 536 (function () { 537 if ($('#main_menu').length) { 538 var container = $('#main_menu');
539 $('li.submenu', container).mouseenter(function (e) { 540 $(this).addClass('show-submenu'); 541 }); 542 $('li.submenu', container).mouseleave(function (e) { 543 $(this).removeClass('show-submenu'); 544 }); 545 } 546 })(); 547 /** 548 * 549 * mobile menu 550 * 551 */ 552 553 554 (function () { 555 //if ($('#widget__menu').length) { 556 //let container = $('#widget__menu'); 557 //$('.trigger-submenu', container).click(function (e) { 558 $('.trigger-submenu').click(function (e) { 559 $(this).toggleClass('opened'); 560 $(this).closest('li.submenu').toggleClass('opened'); 561 e.preventDefault(); 562 return false; 563 }); //} 564 })(); 565 /* 566 if ($('#home_clients_slider').length) { 567 var slick = $('#home_clients_slider').slick({ 568 "autoplay": true, 569 "autoplaySpeed": 4000, 570 "slide": ".ce_gallery", 571 "slidesToShow": 1, 572 "slidesToScroll": 1, 573 "dots": false, 574 "arrows": false 575 }); 576 } 577 if ($('#clients_slider').length) { 578 var slick = $('#clients_slider .text-group').slick({ 579 "autoplay": false, 580 "autoplaySpeed": 4000, 581 "slide": ".ce_text", 582 "slidesToShow": 3, 583 "slidesToScroll": 3, 584 "dots": false, 585 "arrows": false, 586 responsive: [ 587 { 588 breakpoint: 640, 589 settings: { 590 slidesToShow: 1, 591 slidesToScroll: 1 592 } 593 }, 594 { 595 breakpoint: 860, 596 settings: { 597 slidesToShow: 2, 598 slidesToScroll: 2 599 } 600 } 601 ] 602 }); 603 } 604 if ($('#wide_reach_slider').length) { 605 var slick = $('#wide_reach_slider .text-group').slick({ 606 "autoplay": false, 607 "autoplaySpeed": 4000, 608 "slide": ".ce_mainslider", 609 "slidesToShow": 1, 610 "slidesToScroll": 1, 611 "dots": false, 612 "arrows": true 613 }); 614 } 615 if ($('#about_team_slider').length) { 616 var slick = $('#about_team_slider').slick({ 617 "autoplay": true, 618 "autoplaySpeed": 4000, 619 "slide": ".person", 620 "slidesToShow": 1, 621 "slidesToScroll": 1, 622 "dots": false, 623 "arrows": false 624 }); 625 } 626 }); 627 */ 628 629 /** 630 * Menu Mobile Button 631 */ 632 633 634 (function () { 635 var MobileMenuButton = /*#__PURE__*/function () { 636 function MobileMenuButton(_ref) { 637 var btnEl = _ref.btnEl, 638 activeClassName = _ref.activeClassName; 639 640 _classCallCheck(this, MobileMenuButton); 641 642 this.btnEl = btnEl; 643 this.activeClassName = activeClassName; 644 this.isTablet = false; 645 } 646 647 _createClass(MobileMenuButton, [{ 648 key: "init", 649 value: function init() { 650 this.addEvents(); 651 this.keepFlagsUpToDate(); 652 } 653 }, { 654 key: "addEvents", 655 value: function addEvents() { 656 var _this4 = this; 657 658 this.btnEl.addEventListener('click', function () { 659 var menu = _this4.btnEl.dataset.menu; 660 var menuEl = document.querySelector(menu); 661 662 if (menu) { 663 [_this4.btnEl, menuEl].forEach(function (el) { 664 return el.classList.toggle(_this4.activeClassName); 665 }); 666 667 _this4.btnEl.setAttribute('aria-expanded', _this4.btnEl.classList.contains(_this4.activeClassName)); 668 } 669 }); 670 document.addEventListener('keydown', function (event) { 671 if (event.key !== 'Escape' && event.key !== 'Esc') return; 672 if (!_this4.btnEl.classList.contains(_this4.activeClassName)) return; 673 674 _this4.close(); 675 }); 676 } 677 }, { 678 key: "close", 679 value: function close() { 680 var _this5 = this; 681 682 var menu = this.btnEl.dataset.menu; 683 var menuEl = document.querySelector(menu); 684 [this.btnEl, menuEl].forEach(function (el) { 685 return el && el.classList.remove(_this5.activeClassName); 686 }); 687 this.btnEl.setAttribute('aria-expanded', false); 688 this.btnEl.focus(); 689 } 690 }, { 691 key: "keepFlagsUpToDate", 692 value: function keepFlagsUpToDate() { 693 var _this6 = this; 694 695 var isTabletMedia = window.matchMedia('(max-width: 1023px)'); 696 this.isTablet = isTabletMedia.matches; 697 isTabletMedia.addEventListener('change', function () { 698 _this6.isTablet = isTabletMedia.matches; 699 }); 700 } 701 }]); 702 703 return MobileMenuButton; 704 }(); 705 706 var mainNavBtn = document.querySelector('.js-mobile-menu-button'); 707 708 if (mainNavBtn) { 709 new MobileMenuButton({ 710 btnEl: mainNavBtn, 711 activeClassName: 'opened' 712 }).init(); 713 } 714 })(); 715 /** 716 * Sticky menu 717 */ 718 719 720 (function () { 721 var StickyMenu = /*#__PURE__*/function () { 722 function StickyMenu() { 723 _classCallCheck(this, StickyMenu); 724 725 var topBarEl = document.querySelector('.top-bar'); 726 this.topBarEl = topBarEl; 727 this.topBarWrapperEl = topBarEl ? topBarEl.closest('.row.small-collapse.large-uncollapse') : null; 728 this.mainMenuEl = document.querySelector('#main-menu'); 729 this.mainMenuTop = 0; 730 this.isDesktopMedia = window.matchMedia('(min-width: 768px)'); 731 } 732 733 _createClass(StickyMenu, [{ 734 key: "init",
735 value: function init() { 736 var _this7 = this; 737 738 var position = this.topBarEl ? $(this.topBarEl).position() : undefined; 739 if (!position) return; 740 this.mainMenuTop = position.top; 741 this.isDesktopMedia.addEventListener('change', function () { 742 if (_this7.isDesktopMedia.matches) { 743 $(document).on('scroll', _this7.handleFixedMenu.bind(_this7)); 744 745 _this7.handleFixedMenu(); 746 } else { 747 $(document).off('scroll', _this7.handleFixedMenu.bind(_this7)); 748 } 749 }); 750 this.isDesktopMedia.dispatchEvent(new Event('change')); 751 this.handleFixedMenu(); 752 } 753 }, { 754 key: "handleFixedMenu", 755 value: function handleFixedMenu() { 756 // Fix: disable fixedMenu on small content pages 757 if (document.documentElement.scrollHeight - window.innerHeight < 200) return; 758 759 try { 760 this.topBarEl.classList.toggle('fixedMenu', window.scrollY > this.mainMenuTop); 761 this.mainMenuEl.classList.toggle('fixedMenu', window.scrollY > this.mainMenuTop); 762 this.topBarWrapperEl.classList.toggle('fixedMenu', window.scrollY > this.mainMenuTop); 763 } catch (err) {} 764 } 765 }]); 766 767 return StickyMenu; 768 }(); 769 770 new StickyMenu().init(); 771 })(); 772 /** 773 * Toggle menu on hover 774 */ 775 776 777 (function () { 778 var TRIGGER_SELECTOR = '.js-toggle-menu-hover'; 779 var ACTIVE_CLASS = 'is-active'; 780 var $body = $('body'); 781 782 var handleClassToggle = function handleClassToggle(target, isActive) { 783 var menuSelector = target.dataset.menuSelector; 784 if (!menuSelector) return; 785 var menuEl = target.querySelector(menuSelector); 786 787 if (menuEl) { 788 menuEl.classList.toggle(ACTIVE_CLASS, isActive); 789 } 790 }; 791 792 $body.on('mouseenter', TRIGGER_SELECTOR, function (evt) { 793 evt.stopPropagation(); 794 handleClassToggle(evt.target, true); 795 }); 796 $body.on('mouseleave', TRIGGER_SELECTOR, function (_ref2) { 797 var target = _ref2.target; 798 var hideMenu = setTimeout(function () { 799 handleClassToggle(target.closest(TRIGGER_SELECTOR), false); 800 }, 1000); 801 $body.one('mouseenter', TRIGGER_SELECTOR, function () { 802 return clearTimeout(hideMenu); 803 }); 804 }); 805 })(); 806 /** 807 * Contrast 808 */ 809 810 811 (function () { 812 var STORAGE_KEY = 'is-wcag'; 813 var TRIGGER_SELECTOR = '.js-contrast'; 814 var ACTIVE_CLASS = 'theme-wcagTheme'; 815 $('body').on('click', TRIGGER_SELECTOR, function (evt) { 816 evt.preventDefault(); 817 setWcagTheme(); 818 saveThemePreference(); 819 }); 820 821 function setWcagTheme(isWcag) { 822 document.querySelector('body').classList.toggle(ACTIVE_CLASS, isWcag); 823 } 824 825 function saveThemePreference() { 826 var isWcag = document.querySelector('body').classList.contains(ACTIVE_CLASS); 827 window.localStorage.setItem(STORAGE_KEY, JSON.stringify(isWcag)); 828 } 829
830 function readIsWcagTheme() { 831 var storageData = window.localStorage.getItem(STORAGE_KEY); 832 return storageData ? JSON.parse(storageData) : null; 833 } 834 835 if (readIsWcagTheme()) { 836 setWcagTheme(true); 837 } 838 })(); 839 /** 840 * Font size -/+ 841 */ 842 843 844 (function () { 845 var Fontsize = /*#__PURE__*/function () { 846 function Fontsize() { 847 _classCallCheck(this, Fontsize); 848 849 this.parent = 'html'; 850 this.className = 'fontsize-'; 851 this.classActive = 'active'; 852 this.elementsMinus = '.js-font-minus'; 853 this.elementsPlus = '.js-font-plus'; 854 this.size = 100; 855 this.minSize = 100; 856 this.maxSize = 200; 857 } 858 859 _createClass(Fontsize, [{ 860 key: "init", 861 value: function init() { 862 var size = this.getCookie(); 863 864 if (!isNaN(size)) { 865 this.size = size; 866 this.change(); 867 this.onClick(); 868 } 869 } 870 }, { 871 key: "change", 872 value: function change() { 873 if (!isNaN(this.size)) { 874 this.removeClass(); 875 this.addClass(); 876 this.setCookie(); 877 } 878 } 879 }, { 880 key: "onClick", 881 value: function onClick() { 882 var _this8 = this; 883 884 $(document).on('click', this.elementsMinus, function (evt) { 885 evt.preventDefault(); 886 887 _this8.checkSizeMinus(); 888 }); 889 $(document).on('click', this.elementsPlus, function (evt) { 890 evt.preventDefault(); 891 892 _this8.checkSizePlus(); 893 }); 894 } 895 }, { 896 key: "checkSizeMinus", 897 value: function checkSizeMinus() { 898 var newSize = Math.round(Math.round(this.size) - 20); 899 900 if (newSize >= this.minSize) { 901 this.size = newSize; 902 this.change(); 903 this.unactive(); 904 } 905 } 906 }, { 907 key: "checkSizePlus", 908 value: function checkSizePlus() { 909 var newSize = Math.round(Math.round(this.size) + 20); 910 911 if (newSize <= this.maxSize) { 912 this.size = newSize; 913 this.change(); 914 this.unactive(); 915 } 916 } 917 }, { 918 key: "unactive", 919 value: function unactive() { 920 $(this).toggleClass('unactiv'); 921 } 922 }, { 923 key: "addClass", 924 value: function addClass() { 925 var className = this.className + this.size; 926 $(this.parent).addClass(className); 927 } 928 }, { 929 key: "removeClass", 930 value: function removeClass() { 931 $(this.parent).removeClass(this.className + '100'); 932 $(this.parent).removeClass(this.className + '120'); 933 $(this.parent).removeClass(this.className + '140'); 934 $(this.parent).removeClass(this.className + '160'); 935 $(this.parent).removeClass(this.className + '180'); 936 $(this.parent).removeClass(this.className + '200'); 937 } 938 }, { 939 key: "setCookie", 940 value: function setCookie() { 941 window.localStorage.setItem('fontsize', JSON.stringify(this.size)); 942 } 943 }, { 944 key: "getCookie", 945 value: function getCookie() { 946 return parseInt(window.localStorage.getItem('fontsize'), 10) || this.size; 947 } 948 }]); 949 950 return Fontsize; 951 }(); 952 953 new Fontsize().init(); 954 })(); 955 /** 956 * Searchbar 957 */ 958 959 960 (function () { 961 var MobileSearchBar = /*#__PURE__*/function () { 962 function MobileSearchBar(_ref3) { 963 var triggerEl = _ref3.triggerEl, 964 searchbarEl = _ref3.searchbarEl, 965 activeClassName = _ref3.activeClassName; 966 967 _classCallCheck(this, MobileSearchBar); 968 969 this.triggerEl = triggerEl; 970 this.searchbarEl = searchbarEl; 971 this.activeClassName = activeClassName; 972 this.isActive = false;
973 this.isTablet = false; 974 } 975 976 _createClass(MobileSearchBar, [{ 977 key: "init", 978 value: function init() { 979 this.addEvents(); 980 this.keepFlagsUpToDate(); 981 } 982 }, { 983 key: "addEvents", 984 value: function addEvents() { 985 var _this9 = this; 986 987 this.triggerEl.addEventListener('click', function (evt) { 988 if (_this9.isTablet) return; 989 if (_this9.isActive && _this9.searchbarEl.value.length) return; 990 evt.preventDefault(); 991 [_this9.triggerEl, _this9.searchbarEl].forEach(function (el) { 992 return el.classList.toggle(_this9.activeClassName); 993 }); 994 _this9.isActive = !_this9.isActive; 995 }); 996 } 997 }, { 998 key: "keepFlagsUpToDate", 999 value: function keepFlagsUpToDate() { 1000 var _this10 = this; 1001 1002 var isTabletMedia = window.matchMedia('(min-width: 1024px)'); 1003 this.isTablet = isTabletMedia.matches; 1004 isTabletMedia.addEventListener('change', function () { 1005 _this10.isTablet = isTabletMedia.matches; 1006 }); 1007 } 1008 }]); 1009 1010 return MobileSearchBar; 1011 }(); 1012 1013 var triggerEl = document.querySelector('.mod_search button[type="submit"]'); 1014 var searchbarEl = document.querySelector('.mod_search input[type="search"]'); 1015 1016 if (triggerEl && searchbarEl) { 1017 new MobileSearchBar({ 1018 triggerEl: triggerEl, 1019 searchbarEl: searchbarEl, 1020 activeClassName: 'active' 1021 }).init(); 1022 } 1023 })(); 1024 /** 1025 * Submenus 1026 */ 1027 1028 1029 (function () { 1030 var ACTIVE_CLASS = 'active'; 1031 1032 var eventCb = function eventCb(evt) { 1033 evt.preventDefault(); 1034 evt.target.closest('li.submenu').classList.toggle(ACTIVE_CLASS); 1035 }; 1036 1037 $('body').on('click', 'li.submenu > a.submenu > .open_submenu', eventCb); 1038 $('body').on('click', 'li.submenu > strong.submenu > .open_submenu', eventCb); 1039 })(); 1040 /** 1041 * Tabs 1042 */ 1043 1044 1045 (function () { 1046 var url = window.location.href.replace(/\/$/, ''); 1047 $('a[data-toggle="tab"]').on('click', function () { 1048 var _document$querySelect; 1049 1050 // window.history.replaceState(null, null, ${$(this).attr('href')}); 1051 document.querySelectorAll('.tabpanel').forEach(function (v) { 1052 return v.classList.remove('active'); 1053 }); 1054 (_document$querySelect = document.querySelector(".tabpanel[id=\"".concat($(this).attr('href').split('#').at(-1), "\"]"))) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.classList.add('active'); 1055 }); 1056 1057 if (window.location.hash) { 1058 var _document$querySelect2; 1059 1060 var hash = url.split('#'); 1061 var $el = $(".js-tabs a[href$=\"#".concat(hash[1], "\"]")); 1062 $el.tab('show'); // if ($el[0]) { 1063 // $el[0].scrollIntoView(); 1064 // } 1065 // url = window.location.href; 1066 // window.history.replaceState(null, null, url); 1067 1068 document.querySelectorAll('.tabpanel').forEach(function (v) { 1069 return v.classList.remove('active'); 1070 }); 1071 (_document$querySelect2 = document.querySelector(".tabpanel[id=\"".concat(hash[1], "\"]"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.classList.add('active'); 1072 } else { 1073 try { 1074 $('.js-tabs a[href*="#"]')[0].click(); 1075 } catch (err) {} 1076 } 1077 })(); 1078 1079 (function () { 1080 setTimeout(function () { 1081 $('.home-gallery.widget .images').slick({ 1082 infinite: true, 1083 slidesToShow: 5, 1084 slidesToScroll: 1, 1085 arrows: true, 1086 centerPadding: '0', 1087 variableWidth: true, 1088 initialSlide: 0, 1089 prevArrow: $('.home-gallery-header .slick-prev'), 1090 nextArrow: $('.home-gallery-header .slick-next'), 1091 responsive: [{ 1092 breakpoint: 640, 1093 settings: { 1094 slidesToShow: 1 1095 } 1096 }, { 1097 breakpoint: 1024, 1098 settings: { 1099 slidesToShow: 3 1100 } 1101 }] 1102 }); //fix lightbox duplicated elements 1103 // $(".slick-slide.slick-cloned a").removeAttr("data-lightbox"); 1104 1105 $(".slick-slide.slick-cloned a").removeClass("cboxElement"); 1106 $(".home-gallery .slick-cloned a").on("click", function (e) { 1107 var attr = $(this).attr("data-lightbox"); 1108 1109 if (Boolean(attr)) { 1110 e.preventDefault(); 1111 var slickTrack = $(this).parents(".slick-track"); 1112 var originalItemsCount = slickTrack.children(":not(.slick-cloned)").length; 1113 var clickedSlideIndex = $(this).parents(".slick-slide").attr("data-slick-index"); 1114 var targetIndex = clickedSlideIndex >= 0 ? clickedSlideIndex - originalItemsCount : clickedSlideIndex + originalItemsCount; 1115 slickTrack.find(".slick-slide[data-slick-index=" + targetIndex + "] a").trigger("click"); 1116 } 1117 }); 1118 }); 1119 })(); 1120 /* 1121 * Lazy loaded images 1122 */ 1123 1124 1125 (function () { 1126 $('.lazy-img').each(function () { 1127 $(this).offset().top < window.innerHeight + window.pageYOffset + 300 && ($(this).attr('src', $(this).data('src')), $(this).removeClass('lazy-img'), $(this).removeAttr('data-src')); 1128 }); 1129 })(); 1130 /** 1131 * Create table wrappers 1132 */ 1133 1134 1135 (function () { 1136 document.querySelectorAll('.ce_text table').forEach(function (tableEl) { 1137 var tableParentEl = tableEl.parentNode; 1138 var placeholder = document.createElement('span'); 1139 tableParentEl.insertBefore(placeholder, tableEl); 1140 tableParentEl.removeChild(tableEl); 1141 tableParentEl.insertBefore(createWrapper(tableEl), placeholder); 1142 tableParentEl.removeChild(placeholder); 1143 }); 1144 1145 function createWrapper(tableEl) { 1146 var wrapperEl = document.createElement('div'); 1147 wrapperEl.classList.add('wrapper-table'); 1148 wrapperEl.appendChild(tableEl); 1149 return wrapperEl; 1150 } 1151 })(); // Apply WYSIWYG table styles 1152 1153 1154 (function () { 1155 document.querySelectorAll('table').forEach(function (tableEl) { 1156 var _tableEl$style = tableEl.style, 1157 backgroundColor = _tableEl$style.backgroundColor, 1158 borderColor = _tableEl$style.borderColor, 1159 borderStyle = _tableEl$style.borderStyle; 1160 1161 if (backgroundColor) { 1162 ['tbody', 'tr'].forEach(function (tag) { 1163 $(tableEl).find(tag).css('background-color', 'inherit'); 1164 }); 1165 } 1166 1167 if (borderColor) { 1168 ['tbody', 'tfoot', 'thead', 'th', 'td'].forEach(function (tag) { 1169 $(tableEl).find(tag).css('border-color', 'inherit'); 1170 }); 1171 } 1172 1173 if (borderStyle) { 1174 ['tbody', 'tfoot', 'thead', 'th', 'td'].forEach(function (tag) { 1175 $(tableEl).find(tag).css('border-style', borderStyle); 1176 }); 1177 } 1178 }); 1179 })(); // Scroll to active tab on page load 1180 1181 1182 (function () { 1183 var tabListElems = document.querySelectorAll('.js-tabs'); 1184 1185 function cb(item, list) { 1186 try { 1187 list.scrollTo({ 1188 left: 0 1189 }); 1190 1191 var _item$getBoundingClie = item.getBoundingClientRect(), 1192 left = _item$getBoundingClie.left, 1193 width = _item$getBoundingClie.width; 1194 1195 list.scrollTo({ 1196 left: left - width / 2 + 8 1197 }); 1198 } catch (err) {} 1199 } 1200
1201 tabListElems.forEach(function (list) { 1202 var activeTab = list.querySelector('.tab-item.active'); 1203 if (!activeTab) return; 1204 cb(activeTab, list); 1205 }); 1206 document.querySelectorAll('.tab-item').forEach(function (el) { 1207 el.addEventListener('click', function (_ref4) { 1208 var target = _ref4.target; 1209 return cb(target, target.closest('.js-tabs')); 1210 }); 1211 }); 1212 })(); 1213 1214 (function () { 1215 $('body').on('click', '.js-scroll-to-elem', function (_ref5) { 1216 var _document$querySelect3; 1217 1218 var target = _ref5.target; 1219 var elem = target.dataset.elem; 1220 if (!elem) return; 1221 (_document$querySelect3 = document.querySelector(elem)) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.scrollIntoView(); 1222 }); 1223 })(); 1224 1225 (function () { 1226 $('.js-select2').select2(); 1227 })(); 1228 1229 (function () { 1230 $('.js-append-params-form').submit(function (evt) { 1231 evt.preventDefault(); 1232 var target = evt.target; 1233 var url = new URL(window.location.href); 1234 1235 _toConsumableArray(new Set(Object.values(target.elements))).forEach(function (inpt) { 1236 if (inpt instanceof HTMLSelectElement) { 1237 var name = inpt.name, 1238 selectedOptions = inpt.selectedOptions; 1239 if (!name) return; 1240 url.searchParams["delete"](name); 1241 1242 _toConsumableArray(selectedOptions).filter(function (v) { 1243 return v != null & v !== ''; 1244 }
1244).forEach(function (opt) { 1245 url.searchParams.append(name, opt.value); 1246 }); 1247 } else { 1248 var _name = inpt.name, 1249 value = inpt.value; 1250 if (!_name || value == null || value === '') return; 1251 url.searchParams["delete"](_name); 1252 url.searchParams.append(_name, value); 1253 } 1254 }); 1255 1256 window.location.replace(url.toString()); 1257 }); 1258 })(); 1259 1260 (function () { 1261 $('.js-submit-on-change').on('change', function (_ref6) { 1262 var target = _ref6.target; 1263 1264 try { 1265 target.closest('form').dispatchEvent(new Event('submit')); 1266 } catch (err) {} 1267 }); 1268 })(); 1269 1270 (function () { 1271 $(".news-module-gallery").slick({ 1272 infinite: !0, 1273 slidesToShow: 1, 1274 slidesToScroll: 1, 1275 asNavFor: ".news-module-gallery-nav", 1276 arrows: !1, 1277 fade: !0 1278 }); 1279 $(".news-module-gallery-nav").slick({ 1280 slidesToShow: 3, 1281 slidesToScroll: 1, 1282 asNavFor: ".news-module-gallery", 1283 dots: !1, 1284 centerMode: !0, 1285 focusOnSelect: !0, 1286 centerPadding: "0", 1287 arrows: !0, 1288 infinite: !0, 1289 vertical: !0, 1290 adaptiveHeight: !0, 1291 prevArrow: '<button class="slick-prev"></button>', 1292 nextArrow: '<button class="slick-next"></button>', 1293 responsive: [{ 1294 breakpoint: 640, 1295 settings: { 1296 vertical: !1 1297 } 1298 }] 1299 }); 1300 })(); 1301 1302 (function () { 1303 var CLASSES = { 1304 COLLAPSE_LIST: 'js-collapse-list', 1305 COLLAPSE_ITEM_WRAPPER: 'js-collapse-item-wrapper', 1306 COLLAPSE_ITEM_TOGGLE: 'js-collapse-item-toggle', 1307 COLLAPSE_ITEM_CONTENT: 'js-collapse-item-content', 1308 ACTIVE: 'active' 1309 }; 1310 $(document).on('click', ".".concat(CLASSES.COLLAPSE_ITEM_TOGGLE), function (_ref7) { 1311 var target = _ref7.target; 1312 1313 try { 1314 var collapseList = target.closest(".".concat(CLASSES.COLLAPSE_LIST)); 1315 var collapseItemWrapper = target.closest(".".concat(CLASSES.COLLAPSE_ITEM_WRAPPER)); 1316 var collapseItemContent = collapseItemWrapper.querySelector(".".concat(CLASSES.COLLAPSE_ITEM_CONTENT)); 1317 1318 if (collapseList) { 1319 collapseList.querySelectorAll(".".concat(CLASSES.COLLAPSE_ITEM_TOGGLE)).forEach(function (el) { 1320 return el !== target ? el.classList.remove(CLASSES.ACTIVE) : null; 1321 }); 1322 collapseList.querySelectorAll(".".concat(CLASSES.COLLAPSE_ITEM_CONTENT)).forEach(function (el) { 1323 return el !== collapseItemContent ? el.classList.remove(CLASSES.ACTIVE) : null; 1324 }); 1325 } 1326 1327 target.classList.toggle(CLASSES.ACTIVE); 1328 collapseItemContent.classList.toggle(CLASSES.ACTIVE); 1329 } catch (err) {} 1330 }); 1331 })(); // Open side menu submenus of active element 1332 1333 1334 (function () { 1335 var CLASSES = { 1336 ACTIVE: 'active' 1337 }; 1338 var SELECTORS = { 1339 ACTIVE_ELEMENT_TRAIL: '.left-off-canvas-menu .mod_navigation.menu-side li.submenu.trail', 1340 ACTIVE_MENU_ELEMENT: '.left-off-canvas-menu .mod_navigation.menu-side li.active' 1341 }; 1342 var activeMenuEl = document.querySelector(SELECTORS.ACTIVE_MENU_ELEMENT); 1343 if (!activeMenuEl) return; 1344 1345 function activateElementTrail(trailEl) { 1346 if (!trailEl) return; 1347 trailEl.classList.add(CLASSES.ACTIVE); 1348 return activateElementTrail(trailEl.parentElement.closest(SELECTORS.ACTIVE_ELEMENT_TRAIL)); 1349 } 1350 1351 activateElementTrail(activeMenuEl.closest(SELECTORS.ACTIVE_ELEMENT_TRAIL)); 1352 })(); 1353 }); 1354 /** 1355 * #_ftn refs 1356 */ 1357 1358 (function () { 1359 var FOOTNOTE_REF_ID_PREFIX = '_ftnref'; 1360 var FOOTNOTE_ID_PREFIX = '_ftn'; 1361 1362 var footnoteElems = _toConsumableArray(document.querySelectorAll("a[href*=\"#".concat(FOOTNOTE_REF_ID_PREFIX, "\"]"))); 1363 1364 var footnoteRefElems = _toConsumableArray(document.querySelectorAll("a[href*=\"#".concat(FOOTNOTE_ID_PREFIX, "\"]"))).filter(function (el) { 1365 return !footnoteElems.includes(el); 1366 }); 1367 1368 var setFootnoteElemId = setElementId(FOOTNOTE_REF_ID_PREFIX, FOOTNOTE_ID_PREFIX); 1369 var setFootnoteRefElemId = setElementId(FOOTNOTE_ID_PREFIX, FOOTNOTE_REF_ID_PREFIX);
1370 footnoteElems.forEach(setFootnoteElemId); 1371 footnoteRefElems.forEach(setFootnoteRefElemId); 1372 1373 function setElementId(hashIdPrefix, idPrefix) { 1374 return function (el) { 1375 var hash = el.href.split('#').at(-1); 1376 var id = hash.replace(hashIdPrefix, ''); 1377 el.id = idPrefix + id; 1378 }; 1379 } 1380 })(); 1381 1382 (function () { 1383 var btn = document.getElementById('left-off-canvas-menu-toggle'); 1384 if (!btn) return; 1385 btn.addEventListener('click', function () { 1386 var isOpen = btn.dataset.open === 'true'; 1387 var newState = !isOpen; 1388 btn.dataset.open = newState; 1389 var newLabel = btn.dataset[newState ? 'labelOpen' : 'labelClosed']; 1390 btn.innerText = newLabel; 1391 }); 1392 })(); 1393 1394 document.addEventListener('scroll', function () { 1395 $.getScript("https://www.ur.edu.pl/bundles/migocontaomigoapp/wa_ur_rek_filter.js"); 1396 }, { 1397 once: true 1398 }); 1399})(jQuery); 1400 1401(function () { 1402 'use strict'; 1403 /** Detect free variable `global` from Node.js. */ 1404 1405 var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global && global.Object === Object && global; 1406 var freeGlobal$1 = freeGlobal; 1407 /** Detect free variable `self`. */ 1408 1409 var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self; 1410 /** Used as a reference to the global object. */ 1411 1412 var root = freeGlobal$1 || freeSelf || Function('return this')(); 1413 var root$1 = root; 1414 /** Built-in value references. */ 1415 1416 var _Symbol = root$1.Symbol; 1417 var Symbol$1 = _Symbol; 1418 /** Used for built-in method references. */ 1419 1420 var objectProto$5 = Object.prototype; 1421 /** Used to check objects for own properties. */ 1422 1423 var hasOwnProperty$4 = objectProto$5.hasOwnProperty; 1424 /** 1425 * Used to resolve the 1426 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 1427 * of values. 1428 */ 1429 1430 var nativeObjectToString$1 = objectProto$5.toString; 1431 /** Built-in value references. */ 1432 1433 var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined; 1434 /** 1435 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 1436 * 1437 * @private 1438 * @param {*} value The value to query. 1439 * @returns {string} Returns the raw `toStringTag`. 1440 */ 1441 1442 function getRawTag(value) { 1443 var isOwn = hasOwnProperty$4.call(value, symToStringTag$1), 1444 tag = value[symToStringTag$1]; 1445 1446 try { 1447 value[symToStringTag$1] = undefined; 1448 var unmasked = true; 1449 } catch (e) {} 1450 1451 var result = nativeObjectToString$1.call(value); 1452 1453 if (unmasked) { 1454 if (isOwn) { 1455 value[symToStringTag$1] = tag; 1456 } else { 1457 delete value[symToStringTag$1]; 1458 } 1459 } 1460 1461 return result; 1462 } 1463 /** Used for built-in method references. */ 1464 1465 1466 var objectProto$4 = Object.prototype; 1467 /** 1468 * Used to resolve the 1469 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 1470 * of values. 1471 */ 1472 1473 var nativeObjectToString = objectProto$4.toString; 1474 /** 1475 * Converts `value` to a string using `Object.prototype.toString`. 1476 * 1477 * @private 1478 * @param {*} value The value to convert. 1479 * @returns {string} Returns the converted string. 1480 */ 1481 1482 function objectToString(value) { 1483 return nativeObjectToString.call(value); 1484 } 1485 /** `Object#toString` result references. */ 1486 1487 1488 var nullTag = '[object Null]', 1489 undefinedTag = '[object Undefined]'; 1490 /** Built-in value references. */ 1491 1492 var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined; 1493 /** 1494 * The base implementation of `getTag` without fallbacks for buggy environments. 1495 * 1496 * @private 1497 * @param {*} value The value to query. 1498 * @returns {string} Returns the `toStringTag`. 1499 */ 1500 1501 function baseGetTag(value) { 1502 if (value == null) { 1503 return value === undefined ? undefinedTag : nullTag; 1504 } 1505 1506 return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); 1507 } 1508 /** 1509 * Checks if `value` is object-like. A value is object-like if it's not `null` 1510 * and has a `typeof` result of "object". 1511 * 1512 * @static 1513 * @memberOf _ 1514 * @since 4.0.0 1515 * @category Lang 1516 * @param {*} value The value to check. 1517 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 1518 * @example 1519 * 1520 * _.isObjectLike({}); 1521 * // => true 1522 * 1523 * _.isObjectLike([1, 2, 3]); 1524 * // => true 1525 * 1526 * _.isObjectLike(_.noop); 1527 * // => false 1528 * 1529 * _.isObjectLike(null); 1530 * // => false 1531 */ 1532 1533 1534 function isObjectLike(value) { 1535 return value != null && _typeof(value) == 'object'; 1536 } 1537 /** `Object#toString` result references. */ 1538 1539 1540 var symbolTag = '[object Symbol]'; 1541 /** 1542 * Checks if `value` is classified as a `Symbol` primitive or object. 1543 * 1544 * @static 1545 * @memberOf _ 1546 * @since 4.0.0 1547 * @category Lang 1548 * @param {*} value The value to check. 1549 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 1550 * @example 1551 * 1552 * _.isSymbol(Symbol.iterator); 1553 * // => true 1554 * 1555 * _.isSymbol('abc'); 1556 * // => false 1557 */ 1558 1559 function isSymbol(value) { 1560 return _typeof(value) == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag; 1561 } 1562 /** 1563 * A specialized version of `_.map` for arrays without support for iteratee 1564 * shorthands. 1565 * 1566 * @private 1567 * @param {Array} [array] The array to iterate over. 1568 * @param {Function} iteratee The function invoked per iteration. 1569 * @returns {Array} Returns the new mapped array.
1570 */ 1571 1572 1573 function arrayMap(array, iteratee) { 1574 var index = -1, 1575 length = array == null ? 0 : array.length, 1576 result = Array(length); 1577 1578 while (++index < length) { 1579 result[index] = iteratee(array[index], index, array); 1580 } 1581 1582 return result; 1583 } 1584 /** 1585 * Checks if `value` is classified as an `Array` object. 1586 * 1587 * @static 1588 * @memberOf _ 1589 * @since 0.1.0 1590 * @category Lang 1591 * @param {*} value The value to check. 1592 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 1593 * @example 1594 * 1595 * _.isArray([1, 2, 3]); 1596 * // => true 1597 * 1598 * _.isArray(document.body.children); 1599 * // => false 1600 * 1601 * _.isArray('abc'); 1602 * // => false 1603 * 1604 * _.isArray(_.noop); 1605 * // => false 1606 */ 1607 1608 1609 var isArray = Array.isArray; 1610 var isArray$1 = isArray; 1611 /** Used as references for various `Number` constants. */ 1612 1613 var INFINITY$1 = 1 / 0; 1614 /** Used to convert symbols to primitives and strings. */ 1615 1616 var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined, 1617 symbolToString = symbolProto ? symbolProto.toString : undefined; 1618 /** 1619 * The base implementation of `_.toString` which doesn't convert nullish 1620 * values to empty strings. 1621 * 1622 * @private 1623 * @param {*} value The value to process. 1624 * @returns {string} Returns the string. 1625 */ 1626 1627 function baseToString(value) { 1628 // Exit early for strings to avoid a performance hit in some environments. 1629 if (typeof value == 'string') { 1630 return value; 1631 } 1632 1633 if (isArray$1(value)) { 1634 // Recursively convert values (susceptible to call stack limits). 1635 return arrayMap(value, baseToString) + ''; 1636 } 1637 1638 if (isSymbol(value)) { 1639 return symbolToString ? symbolToString.call(value) : ''; 1640 } 1641 1642 var result = value + ''; 1643 return result == '0' && 1 / value == -INFINITY$1 ? '-0' : result; 1644 } 1645 /** 1646 * Checks if `value` is the 1647 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 1648 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 1649 * 1650 * @static 1651 * @memberOf _ 1652 * @since 0.1.0 1653 * @category Lang 1654 * @param {*} value The value to check. 1655 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 1656 * @example 1657 * 1658 * _.isObject({}); 1659 * // => true 1660 * 1661 * _.isObject([1, 2, 3]); 1662 * // => true 1663 * 1664 * _.isObject(_.noop); 1665 * // => true 1666 * 1667 * _.isObject(null); 1668 * // => false 1669 */ 1670 1671 1672 function isObject(value) { 1673 var type = _typeof(value); 1674 1675 return value != null && (type == 'object' || type == 'function'); 1676 } 1677 /** 1678 * This method returns the first argument it receives. 1679 * 1680 * @static 1681 * @since 0.1.0 1682 * @memberOf _ 1683 * @category Util 1684 * @param {*} value Any value. 1685 * @returns {*} Returns `value`. 1686 * @example 1687 * 1688 * var object = { 'a': 1 }; 1689 * 1690 * console.log(_.identity(object) === object); 1691 * // => true 1692 */ 1693 1694 1695 function identity(value) { 1696 return value; 1697 } 1698 /** `Object#toString` result references. */ 1699 1700 1701 var asyncTag = '[object AsyncFunction]', 1702 funcTag = '[object Function]', 1703 genTag = '[object GeneratorFunction]', 1704 proxyTag = '[object Proxy]'; 1705 /** 1706 * Checks if `value` is classified as a `Function` object. 1707 * 1708 * @static 1709 * @memberOf _ 1710 * @since 0.1.0 1711 * @category Lang 1712 * @param {*} value The value to check. 1713 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 1714 * @example 1715 * 1716 * _.isFunction(_); 1717 * // => true 1718 * 1719 * _.isFunction(/abc/); 1720 * // => false 1721 */ 1722 1723 function isFunction(value) { 1724 if (!isObject(value)) { 1725 return false; 1726 } // The use of `Object#toString` avoids issues with the `typeof` operator 1727 // in Safari 9 which returns 'object' for typed arrays and other constructors. 1728 1729 1730 var tag = baseGetTag(value); 1731 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 1732 } 1733 /** Used to detect overreaching core-js shims. */ 1734 1735 1736 var coreJsData = root$1['__core-js_shared__']; 1737 var coreJsData$1 = coreJsData; 1738 /** Used to detect methods masquerading as native. */ 1739 1740 var maskSrcKey = function () { 1741 var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || '');
vendor: 44,012 bytes, lines 1742-3426
1742 return uid ? 'Symbol(src)_1.' + uid : ''; 1743 }(); 1744 /** 1745 * Checks if `func` has its source masked. 1746 * 1747 * @private 1748 * @param {Function} func The function to check. 1749 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 1750 */ 1751 1752 1753 function isMasked(func) { 1754 return !!maskSrcKey && maskSrcKey in func; 1755 } 1756 /** Used for built-in method references. */ 1757 1758 1759 var funcProto$1 = Function.prototype; 1760 /** Used to resolve the decompiled source of functions. */ 1761 1762 var funcToString$1 = funcProto$1.toString; 1763 /** 1764 * Converts `func` to its source code. 1765 * 1766 * @private 1767 * @param {Function} func The function to convert. 1768 * @returns {string} Returns the source code. 1769 */ 1770 1771 function toSource(func) { 1772 if (func != null) { 1773 try { 1774 return funcToString$1.call(func); 1775 } catch (e) {} 1776 1777 try { 1778 return func + ''; 1779 } catch (e) {} 1780 } 1781 1782 return ''; 1783 } 1784 /** 1785 * Used to match `RegExp` 1786 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 1787 */ 1788 1789 1790 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 1791 /** Used to detect host constructors (Safari). */ 1792 1793 var reIsHostCtor = /^\[object .+?Constructor\]$/; 1794 /** Used for built-in method references. */ 1795 1796 var funcProto = Function.prototype, 1797 objectProto$3 = Object.prototype; 1798 /** Used to resolve the decompiled source of functions. */ 1799 1800 var funcToString = funcProto.toString; 1801 /** Used to check objects for own properties. */ 1802 1803 var hasOwnProperty$3 = objectProto$3.hasOwnProperty; 1804 /** Used to detect if a method is native. */ 1805 1806 var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$3).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); 1807 /** 1808 * The base implementation of `_.isNative` without bad shim checks. 1809 * 1810 * @private 1811 * @param {*} value The value to check. 1812 * @returns {boolean} Returns `true` if `value` is a native function, 1813 * else `false`. 1814 */ 1815 1816 function baseIsNative(value) { 1817 if (!isObject(value) || isMasked(value)) { 1818 return false; 1819 } 1820 1821 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 1822 return pattern.test(toSource(value)); 1823 } 1824 /** 1825 * Gets the value at `key` of `object`. 1826 * 1827 * @private 1828 * @param {Object} [object] The object to query. 1829 * @param {string} key The key of the property to get. 1830 * @returns {*} Returns the property value. 1831 */ 1832 1833 1834 function getValue(object, key) { 1835 return object == null ? undefined : object[key]; 1836 } 1837 /** 1838 * Gets the native function at `key` of `object`. 1839 * 1840 * @private 1841 * @param {Object} object The object to query. 1842 * @param {string} key The key of the method to get. 1843 * @returns {*} Returns the function if it's native, else `undefined`. 1844 */ 1845 1846 1847 function getNative(object, key) { 1848 var value = getValue(object, key); 1849 return baseIsNative(value) ? value : undefined; 1850 } 1851 /** 1852 * A faster alternative to `Function#apply`, this function invokes `func` 1853 * with the `this` binding of `thisArg` and the arguments of `args`. 1854 * 1855 * @private 1856 * @param {Function} func The function to invoke. 1857 * @param {*} thisArg The `this` binding of `func`. 1858 * @param {Array} args The arguments to invoke `func` with. 1859 * @returns {*} Returns the result of `func`. 1860 */ 1861 1862 1863 function apply(func, thisArg, args) { 1864 switch (args.length) { 1865 case 0: 1866 return func.call(thisArg); 1867 1868 case 1: 1869 return func.call(thisArg, args[0]); 1870 1871 case 2: 1872 return func.call(thisArg, args[0], args[1]); 1873 1874 case 3: 1875 return func.call(thisArg, args[0], args[1], args[2]); 1876 } 1877 1878 return func.apply(thisArg, args); 1879 } 1880 /** 1881 * This method returns `undefined`. 1882 * 1883 * @static 1884 * @memberOf _ 1885 * @since 2.3.0 1886 * @category Util 1887 * @example 1888 * 1889 * _.times(2, _.noop); 1890 * // => [undefined, undefined] 1891 */ 1892 1893 1894 function noop() {// No operation performed. 1895 } 1896 /** Used to detect hot functions by number of calls within a span of milliseconds. */ 1897 1898 1899 var HOT_COUNT = 800, 1900 HOT_SPAN = 16; 1901 /* Built-in method references for those with the same name as other `lodash` methods. */ 1902 1903 var nativeNow = Date.now; 1904 /** 1905 * Creates a function that'll short out and invoke `identity` instead 1906 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` 1907 * milliseconds. 1908 * 1909 * @private 1910 * @param {Function} func The function to restrict. 1911 * @returns {Function} Returns the new shortable function. 1912 */ 1913 1914 function shortOut(func) { 1915 var count = 0, 1916 lastCalled = 0; 1917 return function () { 1918 var stamp = nativeNow(), 1919 remaining = HOT_SPAN - (stamp - lastCalled); 1920 lastCalled = stamp; 1921 1922 if (remaining > 0) { 1923 if (++count >= HOT_COUNT) { 1924 return arguments[0]; 1925 } 1926 } else { 1927 count = 0; 1928 } 1929 1930 return func.apply(undefined, arguments); 1931 }; 1932 } 1933 /** 1934 * Creates a function that returns `value`. 1935 * 1936 * @static 1937 * @memberOf _ 1938 * @since 2.4.0 1939 * @category Util 1940 * @param {*} value The value to return from the new function. 1941 * @returns {Function} Returns the new constant function. 1942 * @example 1943 * 1944 * var objects = _.times(2, _.constant({ 'a': 1 })); 1945 * 1946 * console.log(objects); 1947 * // => [{ 'a': 1 }, { 'a': 1 }] 1948 * 1949 * console.log(objects[0] === objects[1]); 1950 * // => true 1951 */ 1952 1953 1954 function constant(value) { 1955 return function () { 1956 return value; 1957 }; 1958 } 1959 1960 var defineProperty = function () { 1961 try { 1962 var func = getNative(Object, 'defineProperty'); 1963 func({}, '', {}); 1964 return func; 1965 } catch (e) {} 1966 }(); 1967 1968 var defineProperty$1 = defineProperty; 1969 /** 1970 * The base implementation of `setToString` without support for hot loop shorting. 1971 * 1972 * @private 1973 * @param {Function} func The function to modify. 1974 * @param {Function} string The `toString` result. 1975 * @returns {Function} Returns `func`. 1976 */ 1977 1978 var baseSetToString = !defineProperty$1 ? identity : function (func, string) { 1979 return defineProperty$1(func, 'toString', { 1980 'configurable': true, 1981 'enumerable': false, 1982 'value': constant(string), 1983 'writable': true 1984 }); 1985 }; 1986 var baseSetToString$1 = baseSetToString; 1987 /** 1988 * Sets the `toString` method of `func` to return `string`. 1989 * 1990 * @private 1991 * @param {Function} func The function to modify. 1992 * @param {Function} string The `toString` result. 1993 * @returns {Function} Returns `func`. 1994 */ 1995 1996 var setToString = shortOut(baseSetToString$1); 1997 var setToString$1 = setToString; 1998 /** 1999 * The base implementation of `_.findIndex` and `_.findLastIndex` without 2000 * support for iteratee shorthands. 2001 * 2002 * @private 2003 * @param {Array} array The array to inspect. 2004 * @param {Function} predicate The function invoked per iteration. 2005 * @param {number} fromIndex The index to search from. 2006 * @param {boolean} [fromRight] Specify iterating from right to left. 2007 * @returns {number} Returns the index of the matched value, else `-1`. 2008 */ 2009 2010 function baseFindIndex(array, predicate, fromIndex, fromRight) { 2011 var length = array.length, 2012 index = fromIndex + (fromRight ? 1 : -1); 2013 2014 while (fromRight ? index-- : ++index < length) { 2015 if (predicate(array[index], index, array)) { 2016 return index; 2017 } 2018 } 2019 2020 return -1; 2021 } 2022 /** 2023 * The base implementation of `_.isNaN` without support for number objects. 2024 * 2025 * @private 2026 * @param {*} value The value to check. 2027 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 2028 */ 2029 2030 2031 function baseIsNaN(value) { 2032 return value !== value; 2033 } 2034 /** 2035 * A specialized version of `_.indexOf` which performs strict equality 2036 * comparisons of values, i.e. `===`. 2037 * 2038 * @private 2039 * @param {Array} array The array to inspect. 2040 * @param {*} value The value to search for. 2041 * @param {number} fromIndex The index to search from. 2042 * @returns {number} Returns the index of the matched value, else `-1`. 2043 */ 2044 2045 2046 function strictIndexOf(array, value, fromIndex) { 2047 var index = fromIndex - 1, 2048 length = array.length; 2049 2050 while (++index < length) { 2051 if (array[index] === value) { 2052 return index; 2053 } 2054 } 2055 2056 return -1; 2057 } 2058 /** 2059 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 2060 * 2061 * @private 2062 * @param {Array} array The array to inspect. 2063 * @param {*} value The value to search for. 2064 * @param {number} fromIndex The index to search from. 2065 * @returns {number} Returns the index of the matched value, else `-1`. 2066 */ 2067 2068 2069 function baseIndexOf(array, value, fromIndex) { 2070 return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); 2071 } 2072 /** 2073 * A specialized version of `_.includes` for arrays without support for 2074 * specifying an index to search from. 2075 * 2076 * @private 2077 * @param {Array} [array] The array to inspect. 2078 * @param {*} target The value to search for. 2079 * @returns {boolean} Returns `true` if `target` is found, else `false`. 2080 */ 2081 2082 2083 function arrayIncludes(array, value) { 2084 var length = array == null ? 0 : array.length; 2085 return !!length && baseIndexOf(array, value, 0) > -1; 2086 } 2087 /** 2088 * Performs a 2089 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 2090 * comparison between two values to determine if they are equivalent. 2091 * 2092 * @static 2093 * @memberOf _ 2094 * @since 4.0.0 2095 * @category Lang 2096 * @param {*} value The value to compare. 2097 * @param {*} other The other value to compare. 2098 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 2099 * @example 2100 * 2101 * var object = { 'a': 1 }; 2102 * var other = { 'a': 1 }; 2103 * 2104 * _.eq(object, object); 2105 * // => true 2106 * 2107 * _.eq(object, other); 2108 * // => false 2109 * 2110 * _.eq('a', 'a'); 2111 * // => true 2112 * 2113 * _.eq('a', Object('a')); 2114 * // => false 2115 * 2116 * _.eq(NaN, NaN); 2117 * // => true 2118 */ 2119 2120 2121 function eq(value, other) { 2122 return value === other || value !== value && other !== other; 2123 } 2124 /* Built-in method references for those with the same name as other `lodash` methods. */ 2125 2126 2127 var nativeMax = Math.max; 2128 /** 2129 * A specialized version of `baseRest` which transforms the rest array. 2130 * 2131 * @private 2132 * @param {Function} func The function to apply a rest parameter to. 2133 * @param {number} [start=func.length-1] The start position of the rest parameter. 2134 * @param {Function} transform The rest array transform. 2135 * @returns {Function} Returns the new function. 2136 */ 2137 2138 function overRest(func, start, transform) { 2139 start = nativeMax(start === undefined ? func.length - 1 : start, 0); 2140 return function () { 2141 var args = arguments, 2142 index = -1, 2143 length = nativeMax(args.length - start, 0), 2144 array = Array(length); 2145 2146 while (++index < length) { 2147 array[index] = args[start + index]; 2148 } 2149 2150 index = -1; 2151 var otherArgs = Array(start + 1); 2152 2153 while (++index < start) { 2154 otherArgs[index] = args[index]; 2155 } 2156 2157 otherArgs[start] = transform(array); 2158 return apply(func, this, otherArgs); 2159 }; 2160 } 2161 /** 2162 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 2163 * 2164 * @private 2165 * @param {Function} func The function to apply a rest parameter to. 2166 * @param {number} [start=func.length-1] The start position of the rest parameter. 2167 * @returns {Function} Returns the new function. 2168 */ 2169 2170 2171 function baseRest(func, start) { 2172 return setToString$1(overRest(func, start, identity), func + ''); 2173 } 2174 /** Used as references for various `Number` constants. */ 2175 2176 2177 var MAX_SAFE_INTEGER = 9007199254740991; 2178 /** 2179 * Checks if `value` is a valid array-like length. 2180 * 2181 * **Note:** This method is loosely based on 2182 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 2183 * 2184 * @static 2185 * @memberOf _ 2186 * @since 4.0.0 2187 * @category Lang 2188 * @param {*} value The value to check. 2189 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 2190 * @example 2191 * 2192 * _.isLength(3); 2193 * // => true 2194 * 2195 * _.isLength(Number.MIN_VALUE); 2196 * // => false 2197 * 2198 * _.isLength(Infinity); 2199 * // => false 2200 * 2201 * _.isLength('3'); 2202 * // => false 2203 */ 2204 2205 function isLength(value) { 2206 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 2207 } 2208 /** 2209 * Checks if `value` is array-like. A value is considered array-like if it's 2210 * not a function and has a `value.length` that's an integer greater than or 2211 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 2212 * 2213 * @static 2214 * @memberOf _ 2215 * @since 4.0.0 2216 * @category Lang 2217 * @param {*} value The value to check. 2218 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 2219 * @example 2220 * 2221 * _.isArrayLike([1, 2, 3]); 2222 * // => true 2223 * 2224 * _.isArrayLike(document.body.children); 2225 * // => true 2226 * 2227 * _.isArrayLike('abc'); 2228 * // => true 2229 * 2230 * _.isArrayLike(_.noop); 2231 * // => false 2232 */ 2233 2234 2235 function isArrayLike(value) { 2236 return value != null && isLength(value.length) && !isFunction(value); 2237 } 2238 /** `Object#toString` result references. */ 2239 2240 2241 var argsTag = '[object Arguments]'; 2242 /** 2243 * The base implementation of `_.isArguments`. 2244 * 2245 * @private 2246 * @param {*} value The value to check. 2247 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 2248 */ 2249 2250 function baseIsArguments(value) { 2251 return isObjectLike(value) && baseGetTag(value) == argsTag; 2252 } 2253 /** Used for built-in method references. */ 2254 2255 2256 var objectProto$2 = Object.prototype; 2257 /** Used to check objects for own properties. */ 2258 2259 var hasOwnProperty$2 = objectProto$2.hasOwnProperty; 2260 /** Built-in value references. */ 2261 2262 var propertyIsEnumerable = objectProto$2.propertyIsEnumerable; 2263 /** 2264 * Checks if `value` is likely an `arguments` object. 2265 * 2266 * @static 2267 * @memberOf _ 2268 * @since 0.1.0 2269 * @category Lang 2270 * @param {*} value The value to check. 2271 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 2272 * else `false`. 2273 * @example 2274 * 2275 * _.isArguments(function() { return arguments; }()); 2276 * // => true 2277 * 2278 * _.isArguments([1, 2, 3]); 2279 * // => false 2280 */ 2281 2282 var isArguments = baseIsArguments(function () { 2283 return arguments; 2284 }()) ? baseIsArguments : function (value) { 2285 return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); 2286 }; 2287 var isArguments$1 = isArguments; 2288 /** 2289 * The base implementation of `_.unary` without support for storing metadata. 2290 * 2291 * @private 2292 * @param {Function} func The function to cap arguments for. 2293 * @returns {Function} Returns the new capped function. 2294 */ 2295 2296 function baseUnary(func) { 2297 return function (value) { 2298 return func(value); 2299 }; 2300 } 2301 /* Built-in method references that are verified to be native. */ 2302 2303 2304 var nativeCreate = getNative(Object, 'create'); 2305 var nativeCreate$1 = nativeCreate; 2306 /** 2307 * Removes all key-value entries from the hash. 2308 * 2309 * @private 2310 * @name clear 2311 * @memberOf Hash 2312 */ 2313 2314 function hashClear() { 2315 this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {}; 2316 this.size = 0; 2317 } 2318 /** 2319 * Removes `key` and its value from the hash. 2320 * 2321 * @private 2322 * @name delete 2323 * @memberOf Hash 2324 * @param {Object} hash The hash to modify. 2325 * @param {string} key The key of the value to remove. 2326 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 2327 */ 2328 2329 2330 function hashDelete(key) { 2331 var result = this.has(key) && delete this.__data__[key]; 2332 this.size -= result ? 1 : 0; 2333 return result; 2334 } 2335 /** Used to stand-in for `undefined` hash values. */ 2336 2337 2338 var HASH_UNDEFINED$2 = '__lodash_hash_undefined__'; 2339 /** Used for built-in method references. */ 2340 2341 var objectProto$1 = Object.prototype; 2342 /** Used to check objects for own properties. */ 2343 2344 var hasOwnProperty$1 = objectProto$1.hasOwnProperty; 2345 /** 2346 * Gets the hash value for `key`. 2347 * 2348 * @private 2349 * @name get 2350 * @memberOf Hash 2351 * @param {string} key The key of the value to get. 2352 * @returns {*} Returns the entry value. 2353 */ 2354 2355 function hashGet(key) { 2356 var data = this.__data__; 2357 2358 if (nativeCreate$1) { 2359 var result = data[key]; 2360 return result === HASH_UNDEFINED$2 ? undefined : result; 2361 } 2362 2363 return hasOwnProperty$1.call(data, key) ? data[key] : undefined; 2364 } 2365 /** Used for built-in method references. */ 2366 2367 2368 var objectProto = Object.prototype; 2369 /** Used to check objects for own properties. */ 2370 2371 var hasOwnProperty = objectProto.hasOwnProperty; 2372 /** 2373 * Checks if a hash value for `key` exists. 2374 * 2375 * @private 2376 * @name has 2377 * @memberOf Hash 2378 * @param {string} key The key of the entry to check. 2379 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2380 */ 2381 2382 function hashHas(key) { 2383 var data = this.__data__; 2384 return nativeCreate$1 ? data[key] !== undefined : hasOwnProperty.call(data, key); 2385 } 2386 /** Used to stand-in for `undefined` hash values. */ 2387 2388 2389 var HASH_UNDEFINED$1 = '__lodash_hash_undefined__'; 2390 /** 2391 * Sets the hash `key` to `value`. 2392 * 2393 * @private 2394 * @name set 2395 * @memberOf Hash 2396 * @param {string} key The key of the value to set. 2397 * @param {*} value The value to set. 2398 * @returns {Object} Returns the hash instance. 2399 */ 2400 2401 function hashSet(key, value) { 2402 var data = this.__data__; 2403 this.size += this.has(key) ? 0 : 1; 2404 data[key] = nativeCreate$1 && value === undefined ? HASH_UNDEFINED$1 : value; 2405 return this; 2406 } 2407 /** 2408 * Creates a hash object. 2409 * 2410 * @private 2411 * @constructor 2412 * @param {Array} [entries] The key-value pairs to cache. 2413 */ 2414 2415 2416 function Hash(entries) { 2417 var index = -1, 2418 length = entries == null ? 0 : entries.length; 2419 this.clear(); 2420 2421 while (++index < length) { 2422 var entry = entries[index]; 2423 this.set(entry[0], entry[1]); 2424 } 2425 } // Add methods to `Hash`. 2426 2427 2428 Hash.prototype.clear = hashClear; 2429 Hash.prototype['delete'] = hashDelete; 2430 Hash.prototype.get = hashGet; 2431 Hash.prototype.has = hashHas; 2432 Hash.prototype.set = hashSet; 2433 /** 2434 * Removes all key-value entries from the list cache. 2435 * 2436 * @private 2437 * @name clear 2438 * @memberOf ListCache 2439 */ 2440 2441 function listCacheClear() { 2442 this.__data__ = []; 2443 this.size = 0; 2444 } 2445 /** 2446 * Gets the index at which the `key` is found in `array` of key-value pairs. 2447 * 2448 * @private 2449 * @param {Array} array The array to inspect. 2450 * @param {*} key The key to search for. 2451 * @returns {number} Returns the index of the matched value, else `-1`. 2452 */ 2453 2454 2455 function assocIndexOf(array, key) { 2456 var length = array.length; 2457 2458 while (length--) { 2459 if (eq(array[length][0], key)) { 2460 return length; 2461 } 2462 } 2463 2464 return -1; 2465 } 2466 /** Used for built-in method references. */ 2467 2468 2469 var arrayProto = Array.prototype; 2470 /** Built-in value references. */ 2471 2472 var splice = arrayProto.splice; 2473 /** 2474 * Removes `key` and its value from the list cache. 2475 * 2476 * @private 2477 * @name delete 2478 * @memberOf ListCache 2479 * @param {string} key The key of the value to remove. 2480 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 2481 */ 2482 2483 function listCacheDelete(key) { 2484 var data = this.__data__, 2485 index = assocIndexOf(data, key); 2486 2487 if (index < 0) { 2488 return false; 2489 } 2490 2491 var lastIndex = data.length - 1; 2492 2493 if (index == lastIndex) { 2494 data.pop(); 2495 } else { 2496 splice.call(data, index, 1); 2497 } 2498 2499 --this.size; 2500 return true; 2501 } 2502 /** 2503 * Gets the list cache value for `key`. 2504 * 2505 * @private 2506 * @name get 2507 * @memberOf ListCache 2508 * @param {string} key The key of the value to get. 2509 * @returns {*} Returns the entry value. 2510 */ 2511 2512 2513 function listCacheGet(key) { 2514 var data = this.__data__, 2515 index = assocIndexOf(data, key); 2516 return index < 0 ? undefined : data[index][1]; 2517 } 2518 /** 2519 * Checks if a list cache value for `key` exists. 2520 * 2521 * @private 2522 * @name has 2523 * @memberOf ListCache 2524 * @param {string} key The key of the entry to check. 2525 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2526 */ 2527 2528 2529 function listCacheHas(key) { 2530 return assocIndexOf(this.__data__, key) > -1; 2531 } 2532 /** 2533 * Sets the list cache `key` to `value`. 2534 * 2535 * @private 2536 * @name set 2537 * @memberOf ListCache 2538 * @param {string} key The key of the value to set. 2539 * @param {*} value The value to set. 2540 * @returns {Object} Returns the list cache instance. 2541 */ 2542 2543 2544 function listCacheSet(key, value) { 2545 var data = this.__data__, 2546 index = assocIndexOf(data, key); 2547 2548 if (index < 0) { 2549 ++this.size; 2550 data.push([key, value]); 2551 } else { 2552 data[index][1] = value; 2553 } 2554 2555 return this; 2556 } 2557 /** 2558 * Creates an list cache object. 2559 * 2560 * @private 2561 * @constructor 2562 * @param {Array} [entries] The key-value pairs to cache. 2563 */ 2564 2565 2566 function ListCache(entries) { 2567 var index = -1, 2568 length = entries == null ? 0 : entries.length; 2569 this.clear(); 2570 2571 while (++index < length) { 2572 var entry = entries[index]; 2573 this.set(entry[0], entry[1]); 2574 } 2575 } // Add methods to `ListCache`. 2576 2577 2578 ListCache.prototype.clear = listCacheClear; 2579 ListCache.prototype['delete'] = listCacheDelete; 2580 ListCache.prototype.get = listCacheGet; 2581 ListCache.prototype.has = listCacheHas; 2582 ListCache.prototype.set = listCacheSet; 2583 /* Built-in method references that are verified to be native. */ 2584 2585 var Map = getNative(root$1, 'Map'); 2586 var Map$1 = Map; 2587 /** 2588 * Removes all key-value entries from the map. 2589 * 2590 * @private 2591 * @name clear 2592 * @memberOf MapCache 2593 */ 2594 2595 function mapCacheClear() { 2596 this.size = 0; 2597 this.__data__ = { 2598 'hash': new Hash(), 2599 'map': new (Map$1 || ListCache)(), 2600 'string': new Hash() 2601 }; 2602 } 2603 /** 2604 * Checks if `value` is suitable for use as unique object key. 2605 * 2606 * @private 2607 * @param {*} value The value to check. 2608 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 2609 */ 2610 2611 2612 function isKeyable(value) { 2613 var type = _typeof(value); 2614 2615 return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null; 2616 } 2617 /** 2618 * Gets the data for `map`. 2619 * 2620 * @private 2621 * @param {Object} map The map to query. 2622 * @param {string} key The reference key. 2623 * @returns {*} Returns the map data. 2624 */ 2625 2626 2627 function getMapData(map, key) { 2628 var data = map.__data__; 2629 return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; 2630 } 2631 /** 2632 * Removes `key` and its value from the map. 2633 * 2634 * @private 2635 * @name delete 2636 * @memberOf MapCache 2637 * @param {string} key The key of the value to remove. 2638 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 2639 */ 2640 2641 2642 function mapCacheDelete(key) { 2643 var result = getMapData(this, key)['delete'](key); 2644 this.size -= result ? 1 : 0; 2645 return result; 2646 } 2647 /** 2648 * Gets the map value for `key`. 2649 * 2650 * @private 2651 * @name get 2652 * @memberOf MapCache 2653 * @param {string} key The key of the value to get. 2654 * @returns {*} Returns the entry value. 2655 */ 2656 2657 2658 function mapCacheGet(key) { 2659 return getMapData(this, key).get(key); 2660 } 2661 /** 2662 * Checks if a map value for `key` exists. 2663 * 2664 * @private 2665 * @name has 2666 * @memberOf MapCache 2667 * @param {string} key The key of the entry to check. 2668 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2669 */ 2670 2671 2672 function mapCacheHas(key) { 2673 return getMapData(this, key).has(key); 2674 } 2675 /** 2676 * Sets the map `key` to `value`. 2677 * 2678 * @private 2679 * @name set 2680 * @memberOf MapCache 2681 * @param {string} key The key of the value to set. 2682 * @param {*} value The value to set. 2683 * @returns {Object} Returns the map cache instance. 2684 */ 2685 2686 2687 function mapCacheSet(key, value) { 2688 var data = getMapData(this, key), 2689 size = data.size; 2690 data.set(key, value); 2691 this.size += data.size == size ? 0 : 1; 2692 return this; 2693 } 2694 /** 2695 * Creates a map cache object to store key-value pairs. 2696 * 2697 * @private 2698 * @constructor 2699 * @param {Array} [entries] The key-value pairs to cache. 2700 */ 2701 2702 2703 function MapCache(entries) { 2704 var index = -1, 2705 length = entries == null ? 0 : entries.length; 2706 this.clear(); 2707 2708 while (++index < length) { 2709 var entry = entries[index]; 2710 this.set(entry[0], entry[1]); 2711 } 2712 } // Add methods to `MapCache`. 2713 2714 2715 MapCache.prototype.clear = mapCacheClear; 2716 MapCache.prototype['delete'] = mapCacheDelete; 2717 MapCache.prototype.get = mapCacheGet; 2718 MapCache.prototype.has = mapCacheHas; 2719 MapCache.prototype.set = mapCacheSet; 2720 /** 2721 * Converts `value` to a string. An empty string is returned for `null` 2722 * and `undefined` values. The sign of `-0` is preserved. 2723 * 2724 * @static 2725 * @memberOf _ 2726 * @since 4.0.0 2727 * @category Lang 2728 * @param {*} value The value to convert. 2729 * @returns {string} Returns the converted string. 2730 * @example 2731 * 2732 * _.toString(null); 2733 * // => '' 2734 * 2735 * _.toString(-0); 2736 * // => '-0' 2737 * 2738 * _.toString([1, 2, 3]); 2739 * // => '1,2,3' 2740 */ 2741 2742 function toString(value) { 2743 return value == null ? '' : baseToString(value); 2744 } 2745 /** 2746 * Appends the elements of `values` to `array`. 2747 * 2748 * @private 2749 * @param {Array} array The array to modify. 2750 * @param {Array} values The values to append. 2751 * @returns {Array} Returns `array`. 2752 */ 2753 2754 2755 function arrayPush(array, values) { 2756 var index = -1, 2757 length = values.length, 2758 offset = array.length; 2759 2760 while (++index < length) { 2761 array[offset + index] = values[index]; 2762 } 2763 2764 return array; 2765 } 2766 /** Built-in value references. */ 2767 2768 2769 var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : undefined; 2770 /** 2771 * Checks if `value` is a flattenable `arguments` object or array. 2772 * 2773 * @private 2774 * @param {*} value The value to check. 2775 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 2776 */ 2777 2778 function isFlattenable(value) { 2779 return isArray$1(value) || isArguments$1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); 2780 } 2781 /** 2782 * The base implementation of `_.flatten` with support for restricting flattening. 2783 * 2784 * @private 2785 * @param {Array} array The array to flatten. 2786 * @param {number} depth The maximum recursion depth. 2787 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 2788 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 2789 * @param {Array} [result=[]] The initial result value. 2790 * @returns {Array} Returns the new flattened array. 2791 */ 2792 2793 2794 function baseFlatten(array, depth, predicate, isStrict, result) { 2795 var index = -1, 2796 length = array.length; 2797 predicate || (predicate = isFlattenable); 2798 result || (result = []); 2799 2800 while (++index < length) { 2801 var value = array[index]; 2802 2803 if (depth > 0 && predicate(value)) { 2804 if (depth > 1) { 2805 // Recursively flatten arrays (susceptible to call stack limits). 2806 baseFlatten(value, depth - 1, predicate, isStrict, result); 2807 } else { 2808 arrayPush(result, value); 2809 } 2810 } else if (!isStrict) { 2811 result[result.length] = value; 2812 } 2813 } 2814 2815 return result; 2816 } 2817 /** 2818 * A specialized version of `_.reduce` for arrays without support for 2819 * iteratee shorthands. 2820 * 2821 * @private 2822 * @param {Array} [array] The array to iterate over. 2823 * @param {Function} iteratee The function invoked per iteration. 2824 * @param {*} [accumulator] The initial value. 2825 * @param {boolean} [initAccum] Specify using the first element of `array` as 2826 * the initial value. 2827 * @returns {*} Returns the accumulated value. 2828 */ 2829 2830 2831 function arrayReduce(array, iteratee, accumulator, initAccum) { 2832 var index = -1, 2833 length = array == null ? 0 : array.length; 2834 2835 if (initAccum && length) { 2836 accumulator = array[++index]; 2837 } 2838 2839 while (++index < length) { 2840 accumulator = iteratee(accumulator, array[index], index, array); 2841 } 2842 2843 return accumulator; 2844 } 2845 /** 2846 * The base implementation of `_.propertyOf` without support for deep paths. 2847 * 2848 * @private 2849 * @param {Object} object The object to query. 2850 * @returns {Function} Returns the new accessor function. 2851 */ 2852 2853 2854 function basePropertyOf(object) { 2855 return function (key) { 2856 return object == null ? undefined : object[key]; 2857 }; 2858 } 2859 /** Used to map Latin Unicode letters to basic Latin letters. */ 2860 2861 2862 var deburredLetters = { 2863 // Latin-1 Supplement block. 2864 '\xc0': 'A', 2865 '\xc1': 'A', 2866 '\xc2': 'A', 2867 '\xc3': 'A', 2868 '\xc4': 'A', 2869 '\xc5': 'A', 2870 '\xe0': 'a', 2871 '\xe1': 'a', 2872 '\xe2': 'a', 2873 '\xe3': 'a', 2874 '\xe4': 'a', 2875 '\xe5': 'a', 2876 '\xc7': 'C', 2877 '\xe7': 'c', 2878 '\xd0': 'D', 2879 '\xf0': 'd', 2880 '\xc8': 'E', 2881 '\xc9': 'E', 2882 '\xca': 'E', 2883 '\xcb': 'E', 2884 '\xe8': 'e', 2885 '\xe9': 'e', 2886 '\xea': 'e', 2887 '\xeb': 'e', 2888 '\xcc': 'I', 2889 '\xcd': 'I', 2890 '\xce': 'I', 2891 '\xcf': 'I', 2892 '\xec': 'i', 2893 '\xed': 'i', 2894 '\xee': 'i', 2895 '\xef': 'i', 2896 '\xd1': 'N', 2897 '\xf1': 'n', 2898 '\xd2': 'O', 2899 '\xd3': 'O', 2900 '\xd4': 'O', 2901 '\xd5': 'O', 2902 '\xd6': 'O', 2903 '\xd8': 'O', 2904 '\xf2': 'o', 2905 '\xf3': 'o', 2906 '\xf4': 'o', 2907 '\xf5': 'o', 2908 '\xf6': 'o', 2909 '\xf8': 'o', 2910 '\xd9': 'U', 2911 '\xda': 'U', 2912 '\xdb': 'U', 2913 '\xdc': 'U', 2914 '\xf9': 'u', 2915 '\xfa': 'u', 2916 '\xfb': 'u', 2917 '\xfc': 'u', 2918 '\xdd': 'Y', 2919 '\xfd': 'y', 2920 '\xff': 'y', 2921 '\xc6': 'Ae', 2922 '\xe6': 'ae', 2923 '\xde': 'Th', 2924 '\xfe': 'th', 2925 '\xdf': 'ss', 2926 // Latin Extended-A block. 2927 "\u0100": 'A', 2928 "\u0102": 'A', 2929 "\u0104": 'A', 2930 "\u0101": 'a', 2931 "\u0103": 'a', 2932 "\u0105": 'a', 2933 "\u0106": 'C', 2934 "\u0108": 'C', 2935 "\u010A": 'C', 2936 "\u010C": 'C', 2937 "\u0107": 'c', 2938 "\u0109": 'c', 2939 "\u010B": 'c', 2940 "\u010D": 'c', 2941 "\u010E": 'D', 2942 "\u0110": 'D', 2943 "\u010F": 'd', 2944 "\u0111": 'd', 2945 "\u0112": 'E', 2946 "\u0114": 'E', 2947 "\u0116": 'E', 2948 "\u0118": 'E', 2949 "\u011A": 'E', 2950 "\u0113": 'e', 2951 "\u0115": 'e', 2952 "\u0117": 'e', 2953 "\u0119": 'e', 2954 "\u011B": 'e', 2955 "\u011C": 'G', 2956 "\u011E": 'G', 2957 "\u0120": 'G', 2958 "\u0122": 'G', 2959 "\u011D": 'g', 2960 "\u011F": 'g', 2961 "\u0121": 'g', 2962 "\u0123": 'g', 2963 "\u0124": 'H', 2964 "\u0126": 'H', 2965 "\u0125": 'h', 2966 "\u0127": 'h', 2967 "\u0128": 'I', 2968 "\u012A": 'I', 2969 "\u012C": 'I', 2970 "\u012E": 'I', 2971 "\u0130": 'I', 2972 "\u0129": 'i', 2973 "\u012B": 'i', 2974 "\u012D": 'i', 2975 "\u012F": 'i', 2976 "\u0131": 'i', 2977 "\u0134": 'J', 2978 "\u0135": 'j', 2979 "\u0136": 'K', 2980 "\u0137": 'k', 2981 "\u0138": 'k', 2982 "\u0139": 'L', 2983 "\u013B": 'L', 2984 "\u013D": 'L', 2985 "\u013F": 'L', 2986 "\u0141": 'L', 2987 "\u013A": 'l', 2988 "\u013C": 'l', 2989 "\u013E": 'l', 2990 "\u0140": 'l', 2991 "\u0142": 'l', 2992 "\u0143": 'N', 2993 "\u0145": 'N', 2994 "\u0147": 'N', 2995 "\u014A": 'N', 2996 "\u0144": 'n', 2997 "\u0146": 'n', 2998 "\u0148": 'n', 2999 "\u014B": 'n', 3000 "\u014C": 'O', 3001 "\u014E": 'O', 3002 "\u0150": 'O', 3003 "\u014D": 'o', 3004 "\u014F": 'o', 3005 "\u0151": 'o', 3006 "\u0154": 'R', 3007 "\u0156": 'R', 3008 "\u0158": 'R', 3009 "\u0155": 'r', 3010 "\u0157": 'r', 3011 "\u0159": 'r', 3012 "\u015A": 'S', 3013 "\u015C": 'S', 3014 "\u015E": 'S', 3015 "\u0160": 'S', 3016 "\u015B": 's', 3017 "\u015D": 's', 3018 "\u015F": 's', 3019 "\u0161": 's', 3020 "\u0162": 'T', 3021 "\u0164": 'T', 3022 "\u0166": 'T', 3023 "\u0163": 't', 3024 "\u0165": 't', 3025 "\u0167": 't', 3026 "\u0168": 'U', 3027 "\u016A": 'U', 3028 "\u016C": 'U', 3029 "\u016E": 'U', 3030 "\u0170": 'U', 3031 "\u0172": 'U', 3032 "\u0169": 'u', 3033 "\u016B": 'u', 3034 "\u016D": 'u', 3035 "\u016F": 'u', 3036 "\u0171": 'u', 3037 "\u0173": 'u', 3038 "\u0174": 'W', 3039 "\u0175": 'w', 3040 "\u0176": 'Y', 3041 "\u0177": 'y', 3042 "\u0178": 'Y', 3043 "\u0179": 'Z', 3044 "\u017B": 'Z', 3045 "\u017D": 'Z', 3046 "\u017A": 'z', 3047 "\u017C": 'z', 3048 "\u017E": 'z', 3049 "\u0132": 'IJ', 3050 "\u0133": 'ij', 3051 "\u0152": 'Oe', 3052 "\u0153": 'oe', 3053 "\u0149": "'n", 3054 "\u017F": 's' 3055 }; 3056 /** 3057 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A 3058 * letters to basic Latin letters. 3059 * 3060 * @private 3061 * @param {string} letter The matched letter to deburr. 3062 * @returns {string} Returns the deburred letter. 3063 */ 3064 3065 var deburrLetter = basePropertyOf(deburredLetters); 3066 var deburrLetter$1 = deburrLetter; 3067 /** Used to match Latin Unicode letters (excluding mathematical operators). */ 3068 3069 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 3070 /** Used to compose unicode character classes. */ 3071 3072 var rsComboMarksRange$1 = "\\u0300-\\u036f", 3073 reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f", 3074 rsComboSymbolsRange$1 = "\\u20d0-\\u20ff", 3075 rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1; 3076 /** Used to compose unicode capture groups. */ 3077 3078 var rsCombo$1 = '[' + rsComboRange$1 + ']'; 3079 /** 3080 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and 3081 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). 3082 */ 3083 3084 var reComboMark = RegExp(rsCombo$1, 'g'); 3085 /** 3086 * Deburrs `string` by converting 3087 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) 3088 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) 3089 * letters to basic Latin letters and removing 3090 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). 3091 * 3092 * @static 3093 * @memberOf _ 3094 * @since 3.0.0 3095 * @category String 3096 * @param {string} [string=''] The string to deburr. 3097 * @returns {string} Returns the deburred string. 3098 * @example 3099 * 3100 * _.deburr('déjàvu'); 3101 * // => 'deja vu' 3102 */ 3103 3104 function deburr(string) { 3105 string = toString(string); 3106 return string && string.replace(reLatin, deburrLetter$1).replace(reComboMark, ''); 3107 } 3108 /** Used to match words composed of alphanumeric characters. */ 3109 3110 3111 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 3112 /** 3113 * Splits an ASCII `string` into an array of its words. 3114 * 3115 * @private 3116 * @param {string} The string to inspect. 3117 * @returns {Array} Returns the words of `string`. 3118 */ 3119 3120 function asciiWords(string) { 3121 return string.match(reAsciiWord) || []; 3122 } 3123 /** Used to detect strings that need a more robust regexp to match words. */ 3124 3125 3126 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; 3127 /** 3128 * Checks if `string` contains a word composed of Unicode symbols. 3129 * 3130 * @private 3131 * @param {string} string The string to inspect. 3132 * @returns {boolean} Returns `true` if a word is found, else `false`. 3133 */ 3134 3135 function hasUnicodeWord(string) { 3136 return reHasUnicodeWord.test(string); 3137 } 3138 /** Used to compose unicode character classes. */ 3139 3140 3141 var rsAstralRange = "\\ud800-\\udfff", 3142 rsComboMarksRange = "\\u0300-\\u036f", 3143 reComboHalfMarksRange = "\\ufe20-\\ufe2f", 3144 rsComboSymbolsRange = "\\u20d0-\\u20ff", 3145 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, 3146 rsDingbatRange = "\\u2700-\\u27bf", 3147 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', 3148 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', 3149 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', 3150 rsPunctuationRange = "\\u2000-\\u206f", 3151 rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", 3152 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', 3153 rsVarRange = "\\ufe0e\\ufe0f", 3154 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 3155 /** Used to compose unicode capture groups. */ 3156 3157 var rsApos$1 = "['\u2019]", 3158 rsBreak = '[' + rsBreakRange + ']', 3159 rsCombo = '[' + rsComboRange + ']', 3160 rsDigits = '\\d+', 3161 rsDingbat = '[' + rsDingbatRange + ']', 3162 rsLower = '[' + rsLowerRange + ']', 3163 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', 3164 rsFitz = "\\ud83c[\\udffb-\\udfff]", 3165 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', 3166 rsNonAstral = '[^' + rsAstralRange + ']', 3167 rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", 3168 rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", 3169 rsUpper = '[' + rsUpperRange + ']', 3170 rsZWJ = "\\u200d"; 3171 /** Used to compose unicode regexes. */ 3172 3173 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', 3174 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', 3175 rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?', 3176 rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?', 3177 reOptMod = rsModifier + '?', 3178 rsOptVar = '[' + rsVarRange + ']?', 3179 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', 3180 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', 3181 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', 3182 rsSeq = rsOptVar + reOptMod + rsOptJoin, 3183 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; 3184 /** Used to match complex or compound words. */ 3185 3186 var reUnicodeWord = RegExp([rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji].join('|'), 'g'); 3187 /** 3188 * Splits a Unicode `string` into an array of its words. 3189 * 3190 * @private 3191 * @param {string} The string to inspect. 3192 * @returns {Array} Returns the words of `string`. 3193 */ 3194 3195 function unicodeWords(string) { 3196 return string.match(reUnicodeWord) || []; 3197 } 3198 /** 3199 * Splits `string` into an array of its words. 3200 * 3201 * @static 3202 * @memberOf _ 3203 * @since 3.0.0 3204 * @category String 3205 * @param {string} [string=''] The string to inspect. 3206 * @param {RegExp|string} [pattern] The pattern to match words. 3207 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 3208 * @returns {Array} Returns the words of `string`. 3209 * @example 3210 * 3211 * _.words('fred, barney, & pebbles'); 3212 * // => ['fred', 'barney', 'pebbles'] 3213 * 3214 * _.words('fred, barney, & pebbles', /[^, ]+/g); 3215 * // => ['fred', 'barney', '&', 'pebbles'] 3216 */ 3217 3218 3219 function words(string, pattern, guard) { 3220 string = toString(string); 3221 pattern = guard ? undefined : pattern; 3222 3223 if (pattern === undefined) { 3224 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); 3225 } 3226 3227 return string.match(pattern) || []; 3228 } 3229 /** Used to compose unicode capture groups. */ 3230 3231 3232 var rsApos = "['\u2019]"; 3233 /** Used to match apostrophes. */ 3234 3235 var reApos = RegExp(rsApos, 'g'); 3236 /** 3237 * Creates a function like `_.camelCase`. 3238 * 3239 * @private 3240 * @param {Function} callback The function to combine each word. 3241 * @returns {Function} Returns the new compounder function. 3242 */ 3243 3244 function createCompounder(callback) { 3245 return function (string) { 3246 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); 3247 }; 3248 } 3249 /* Built-in method references that are verified to be native. */ 3250 3251 3252 var Set = getNative(root$1, 'Set'); 3253 var Set$1 = Set; 3254 /** Used to stand-in for `undefined` hash values. */ 3255 3256 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 3257 /** 3258 * Adds `value` to the array cache. 3259 * 3260 * @private 3261 * @name add 3262 * @memberOf SetCache 3263 * @alias push 3264 * @param {*} value The value to cache. 3265 * @returns {Object} Returns the cache instance. 3266 */ 3267 3268 function setCacheAdd(value) { 3269 this.__data__.set(value, HASH_UNDEFINED); 3270 3271 return this; 3272 } 3273 /** 3274 * Checks if `value` is in the array cache. 3275 * 3276 * @private 3277 * @name has 3278 * @memberOf SetCache 3279 * @param {*} value The value to search for. 3280 * @returns {number} Returns `true` if `value` is found, else `false`. 3281 */ 3282 3283 3284 function setCacheHas(value) { 3285 return this.__data__.has(value); 3286 } 3287 /** 3288 * 3289 * Creates an array cache object to store unique values. 3290 * 3291 * @private 3292 * @constructor 3293 * @param {Array} [values] The values to cache. 3294 */ 3295 3296 3297 function SetCache(values) { 3298 var index = -1, 3299 length = values == null ? 0 : values.length; 3300 this.__data__ = new MapCache(); 3301 3302 while (++index < length) { 3303 this.add(values[index]); 3304 } 3305 } // Add methods to `SetCache`. 3306 3307 3308 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 3309 SetCache.prototype.has = setCacheHas; 3310 /** 3311 * Checks if a `cache` value for `key` exists. 3312 * 3313 * @private 3314 * @param {Object} cache The cache to query. 3315 * @param {string} key The key of the entry to check. 3316 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 3317 */ 3318 3319 function cacheHas(cache, key) { 3320 return cache.has(key); 3321 } 3322 /** 3323 * Converts `set` to an array of its values. 3324 * 3325 * @private 3326 * @param {Object} set The set to convert. 3327 * @returns {Array} Returns the values. 3328 */ 3329 3330 3331 function setToArray(set) { 3332 var index = -1, 3333 result = Array(set.size); 3334 set.forEach(function (value) { 3335 result[++index] = value; 3336 }); 3337 return result; 3338 } 3339 /** 3340 * This method is like `_.isArrayLike` except that it also checks if `value` 3341 * is an object. 3342 * 3343 * @static 3344 * @memberOf _ 3345 * @since 4.0.0 3346 * @category Lang 3347 * @param {*} value The value to check. 3348 * @returns {boolean} Returns `true` if `value` is an array-like object, 3349 * else `false`. 3350 * @example 3351 * 3352 * _.isArrayLikeObject([1, 2, 3]); 3353 * // => true 3354 * 3355 * _.isArrayLikeObject(document.body.children); 3356 * // => true 3357 * 3358 * _.isArrayLikeObject('abc'); 3359 * // => false 3360 * 3361 * _.isArrayLikeObject(_.noop); 3362 * // => false 3363 */ 3364 3365 3366 function isArrayLikeObject(value) { 3367 return isObjectLike(value) && isArrayLike(value); 3368 } 3369 /** 3370 * This function is like `arrayIncludes` except that it accepts a comparator. 3371 * 3372 * @private 3373 * @param {Array} [array] The array to inspect. 3374 * @param {*} target The value to search for. 3375 * @param {Function} comparator The comparator invoked per element. 3376 * @returns {boolean} Returns `true` if `target` is found, else `false`. 3377 */ 3378 3379 3380 function arrayIncludesWith(array, value, comparator) { 3381 var index = -1, 3382 length = array == null ? 0 : array.length; 3383 3384 while (++index < length) { 3385 if (comparator(value, array[index])) { 3386 return true; 3387 } 3388 } 3389 3390 return false; 3391 } 3392 /** Used as the size to enable large array optimizations. */ 3393 3394 3395 var LARGE_ARRAY_SIZE$1 = 200; 3396 /** 3397 * The base implementation of methods like `_.difference` without support 3398 * for excluding multiple arrays or iteratee shorthands. 3399 * 3400 * @private 3401 * @param {Array} array The array to inspect. 3402 * @param {Array} values The values to exclude. 3403 * @param {Function} [iteratee] The iteratee invoked per element. 3404 * @param {Function} [comparator] The comparator invoked per element. 3405 * @returns {Array} Returns the new array of filtered values. 3406 */ 3407 3408 function baseDifference(array, values, iteratee, comparator) { 3409 var index = -1, 3410 includes = arrayIncludes, 3411 isCommon = true, 3412 length = array.length, 3413 result = [], 3414 valuesLength = values.length; 3415 3416 if (!length) { 3417 return result; 3418 } 3419 3420 if (iteratee) { 3421 values = arrayMap(values, baseUnary(iteratee)); 3422 } 3423 3424 if (comparator) { 3425 includes = arrayIncludesWith; 3426 isCommon = false;
3427 } else if (values.length >= LARGE_ARRAY_SIZE$1) { 3428 includes = cacheHas; 3429 isCommon = false; 3430 values = new SetCache(values); 3431 } 3432 3433 outer: while (++index < length) { 3434 var value = array[index], 3435 computed = iteratee == null ? value : iteratee(value); 3436 value = comparator || value !== 0 ? value : 0; 3437 3438 if (isCommon && computed === computed) { 3439 var valuesIndex = valuesLength; 3440 3441 while (valuesIndex--) { 3442 if (values[valuesIndex] === computed) { 3443 continue outer; 3444 } 3445 } 3446 3447 result.push(value); 3448 } else if (!includes(values, computed, comparator)) { 3449 result.push(value); 3450 } 3451 } 3452 3453 return result; 3454 } 3455 /** 3456 * Creates an array of `array` values not included in the other given arrays 3457 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3458 * for equality comparisons. The order and references of result values are 3459 * determined by the first array. 3460 * 3461 * **Note:** Unlike `_.pullAll`, this method returns a new array. 3462 * 3463 * @static 3464 * @memberOf _ 3465 * @since 0.1.0 3466 * @category Array 3467 * @param {Array} array The array to inspect. 3468 * @param {...Array} [values] The values to exclude. 3469 * @returns {Array} Returns the new array of filtered values. 3470 * @see _.without, _.xor 3471 * @example 3472 * 3473 * _.difference([2, 1], [2, 3]); 3474 * // => [1] 3475 */ 3476 3477 3478 var difference = baseRest(function (array, values) { 3479 return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; 3480 }); 3481 var difference$1 = difference; 3482 /* Built-in method references for those with the same name as other `lodash` methods. */ 3483 3484 var nativeMin = Math.min; 3485 /** 3486 * The base implementation of methods like `_.intersection`, without support 3487 * for iteratee shorthands, that accepts an array of arrays to inspect. 3488 * 3489 * @private 3490 * @param {Array} arrays The arrays to inspect. 3491 * @param {Function} [iteratee] The iteratee invoked per element. 3492 * @param {Function} [comparator] The comparator invoked per element. 3493 * @returns {Array} Returns the new array of shared values. 3494 */ 3495 3496 function baseIntersection(arrays, iteratee, comparator) { 3497 var includes = comparator ? arrayIncludesWith : arrayIncludes, 3498 length = arrays[0].length, 3499 othLength = arrays.length, 3500 othIndex = othLength, 3501 caches = Array(othLength), 3502 maxLength = Infinity, 3503 result = []; 3504 3505 while (othIndex--) { 3506 var array = arrays[othIndex]; 3507 3508 if (othIndex && iteratee) { 3509 array = arrayMap(array, baseUnary(iteratee)); 3510 } 3511 3512 maxLength = nativeMin(array.length, maxLength); 3513 caches[othIndex] = !comparator && (iteratee || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined; 3514 } 3515 3516 array = arrays[0]; 3517 var index = -1, 3518 seen = caches[0]; 3519 3520 outer: while (++index < length && result.length < maxLength) { 3521 var value = array[index], 3522 computed = iteratee ? iteratee(value) : value; 3523 value = comparator || value !== 0 ? value : 0; 3524 3525 if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) { 3526 othIndex = othLength; 3527 3528 while (--othIndex) { 3529 var cache = caches[othIndex]; 3530 3531 if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) { 3532 continue outer; 3533 } 3534 } 3535 3536 if (seen) { 3537 seen.push(computed); 3538 } 3539 3540 result.push(value); 3541 } 3542 } 3543 3544 return result; 3545 } 3546 /** 3547 * Casts `value` to an empty array if it's not an array like object. 3548 * 3549 * @private 3550 * @param {*} value The value to inspect. 3551 * @returns {Array|Object} Returns the cast array-like object. 3552 */ 3553 3554 3555 function castArrayLikeObject(value) { 3556 return isArrayLikeObject(value) ? value : []; 3557 } 3558 /** 3559 * Creates an array of unique values that are included in all given arrays 3560 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3561 * for equality comparisons. The order and references of result values are 3562 * determined by the first array. 3563 * 3564 * @static 3565 * @memberOf _ 3566 * @since 0.1.0 3567 * @category Array 3568 * @param {...Array} [arrays] The arrays to inspect. 3569 * @returns {Array} Returns the new array of intersecting values. 3570 * @example 3571 * 3572 * _.intersection([2, 1], [2, 3]); 3573 * // => [2] 3574 */ 3575 3576 3577 var intersection = baseRest(function (arrays) { 3578 var mapped = arrayMap(arrays, castArrayLikeObject); 3579 return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; 3580 }); 3581 var intersection$1 = intersection; 3582 /** 3583 * Converts `string` to 3584 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). 3585 * 3586 * @static 3587 * @memberOf _ 3588 * @since 3.0.0 3589 * @category String 3590 * @param {string} [string=''] The string to convert. 3591 * @returns {string} Returns the kebab cased string. 3592 * @example 3593 * 3594 * _.kebabCase('Foo Bar'); 3595 * // => 'foo-bar' 3596 * 3597 * _.kebabCase('fooBar'); 3598 * // => 'foo-bar' 3599 * 3600 * _.kebabCase('__FOO_BAR__'); 3601 * // => 'foo-bar' 3602 */ 3603 3604 var kebabCase = createCompounder(function (result, word, index) { 3605 return result + (index ? '-' : '') + word.toLowerCase(); 3606 }); 3607 var kebabCase$1 = kebabCase; 3608 /** Used as references for various `Number` constants. */ 3609 3610 var INFINITY = 1 / 0; 3611 /** 3612 * Creates a set object of `values`. 3613 * 3614 * @private 3615 * @param {Array} values The values to add to the set. 3616 * @returns {Object} Returns the new set. 3617 */ 3618 3619 var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == INFINITY) ? noop : function (values) { 3620 return new Set$1(values); 3621 }; 3622 var createSet$1 = createSet; 3623 /** Used as the size to enable large array optimizations. */ 3624 3625 var LARGE_ARRAY_SIZE = 200; 3626 /** 3627 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 3628 * 3629 * @private 3630 * @param {Array} array The array to inspect. 3631 * @param {Function} [iteratee] The iteratee invoked per element. 3632 * @param {Function} [comparator] The comparator invoked per element. 3633 * @returns {Array} Returns the new duplicate free array. 3634 */ 3635 3636 function baseUniq(array, iteratee, comparator) { 3637 var index = -1, 3638 includes = arrayIncludes, 3639 length = array.length, 3640 isCommon = true, 3641 result = [], 3642 seen = result; 3643 3644 if (comparator) { 3645 isCommon = false;
3646 includes = arrayIncludesWith; 3647 } else if (length >= LARGE_ARRAY_SIZE) { 3648 var set = iteratee ? null : createSet$1(array); 3649 3650 if (set) { 3651 return setToArray(set); 3652 } 3653 3654 isCommon = false; 3655 includes = cacheHas; 3656 seen = new SetCache(); 3657 } else { 3658 seen = iteratee ? [] : result; 3659 } 3660 3661 outer: while (++index < length) { 3662 var value = array[index], 3663 computed = iteratee ? iteratee(value) : value; 3664 value = comparator || value !== 0 ? value : 0; 3665 3666 if (isCommon && computed === computed) { 3667 var seenIndex = seen.length; 3668 3669 while (seenIndex--) { 3670 if (seen[seenIndex] === computed) { 3671 continue outer; 3672 } 3673 } 3674 3675 if (iteratee) { 3676 seen.push(computed); 3677 } 3678 3679 result.push(value); 3680 } else if (!includes(seen, computed, comparator)) { 3681 if (seen !== result) { 3682 seen.push(computed); 3683 } 3684 3685 result.push(value); 3686 } 3687 } 3688 3689 return result; 3690 } 3691 /** 3692 * Creates a duplicate-free version of an array, using 3693 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3694 * for equality comparisons, in which only the first occurrence of each element 3695 * is kept. The order of result values is determined by the order they occur 3696 * in the array. 3697 * 3698 * @static 3699 * @memberOf _ 3700 * @since 0.1.0 3701 * @category Array 3702 * @param {Array} array The array to inspect. 3703 * @returns {Array} Returns the new duplicate free array. 3704 * @example 3705 * 3706 * _.uniq([2, 1, 2]); 3707 * // => [2, 1] 3708 */ 3709 3710 3711 function uniq(array) { 3712 return array && array.length ? baseUniq(array) : []; 3713 } 3714 3715 function requiredArgs(required, args) { 3716 if (args.length < required) { 3717 throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present'); 3718 } 3719 } 3720 /** 3721 * @name toDate 3722 * @category Common Helpers 3723 * @summary Convert the given argument to an instance of Date. 3724 * 3725 * @description 3726 * Convert the given argument to an instance of Date. 3727 * 3728 * If the argument is an instance of Date, the function returns its clone. 3729 * 3730 * If the argument is a number, it is treated as a timestamp. 3731 * 3732 * If the argument is none of the above, the function returns Invalid Date. 3733 * 3734 * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. 3735 * 3736 * @param {Date|Number} argument - the value to convert 3737 * @returns {Date} the parsed date in the local time zone 3738 * @throws {TypeError} 1 argument required 3739 * 3740 * @example 3741 * // Clone the date: 3742 * const result = toDate(new Date(2014, 1, 11, 11, 30, 30)) 3743 * //=> Tue Feb 11 2014 11:30:30 3744 * 3745 * @example 3746 * // Convert the timestamp to date: 3747 * const result = toDate(1392098430000) 3748 * //=> Tue Feb 11 2014 11:30:30 3749 */ 3750 3751 3752 function toDate(argument) { 3753 requiredArgs(1, arguments); 3754 var argStr = Object.prototype.toString.call(argument); // Clone the date 3755 3756 if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') { 3757 // Prevent the date to lose the milliseconds when passed to new Date() in IE10 3758 return new Date(argument.getTime()); 3759 } else if (typeof argument === 'number' || argStr === '[object Number]') { 3760 return new Date(argument); 3761 } else { 3762 if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') { 3763 // eslint-disable-next-line no-console 3764 console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console 3765 3766 console.warn(new Error().stack); 3767 } 3768 3769 return new Date(NaN); 3770 } 3771 } 3772 /** 3773 * @name isAfter 3774 * @category Common Helpers 3775 * @summary Is the first date after the second one? 3776 * 3777 * @description 3778 * Is the first date after the second one? 3779 * 3780 * ### v2.0.0 breaking changes: 3781 * 3782 * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). 3783 * 3784 * @param {Date|Number} date - the date that should be after the other one to return true 3785 * @param {Date|Number} dateToCompare - the date to compare with 3786 * @returns {Boolean} the first date is after the second date 3787 * @throws {TypeError} 2 arguments required 3788 * 3789 * @example 3790 * // Is 10 July 1989 after 11 February 1987? 3791 * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) 3792 * //=> true 3793 */ 3794 3795 3796 function isAfter(dirtyDate, dirtyDateToCompare) { 3797 requiredArgs(2, arguments);
3798 var date = toDate(dirtyDate); 3799 var dateToCompare = toDate(dirtyDateToCompare); 3800 return date.getTime() > dateToCompare.getTime(); 3801 } 3802 /** 3803 * @name isBefore 3804 * @category Common Helpers 3805 * @summary Is the first date before the second one? 3806 * 3807 * @description 3808 * Is the first date before the second one? 3809 * 3810 * ### v2.0.0 breaking changes: 3811 * 3812 * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). 3813 * 3814 * @param {Date|Number} date - the date that should be before the other one to return true 3815 * @param {Date|Number} dateToCompare - the date to compare with 3816 * @returns {Boolean} the first date is before the second date 3817 * @throws {TypeError} 2 arguments required 3818 * 3819 * @example 3820 * // Is 10 July 1989 before 11 February 1987? 3821 * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11)) 3822 * //=> false 3823 */ 3824 3825 3826 function isBefore(dirtyDate, dirtyDateToCompare) { 3827 requiredArgs(2, arguments); 3828 var date = toDate(dirtyDate); 3829 var dateToCompare = toDate(dirtyDateToCompare); 3830 return date.getTime() < dateToCompare.getTime(); 3831 } 3832 3833 var CLASSES = { 3834 RECORDS_FILTER_FORM: 'js-records-filter-form' 3835 }; 3836 var DATA_ATTR = { 3837 RECORDS_SELECTOR: 'recordsSelector', 3838 FILTER_TYPE: 'filterType', 3839 RECORD_VALUE_SELECTOR: 'recordValueSelector', 3840 DATE_COMPARE_METHOD: 'dateCompareMethod', 3841 DATE_FROM: 'dateFrom', 3842 DATE_TO: 'dateTo' 3843 }; 3844 var FILTER_TYPES = { 3845 TEXT: 'text', 3846 DATE: 'date' 3847 }; 3848 var DATE_COMPARE_METHODS = { 3849 RECORD_DATE_AFTER: 'recordDateAfter', 3850 RECORD_DATE_BEFORE: 'recordDateBefore' 3851 }; 3852 document.addEventListener('DOMContentLoaded', function () { 3853 (function queryParams($) { 3854 document.querySelectorAll(".".concat(CLASSES.RECORDS_FILTER_FORM)).forEach(syncValuesWithQueryParams); 3855 document.addEventListener('submit', function (evt) { 3856 var isRecordsFilterForm = evt.target.tagName === 'FORM' && evt.target.classList.contains(CLASSES.RECORDS_FILTER_FORM); 3857 3858 if (isRecordsFilterForm) { 3859 setQueryParams(evt.target); 3860 } 3861 }); 3862 3863 function setQueryParams(formEl) { 3864 var url = new URL(window.location); 3865 var formFields = uniq(Object.values(formEl.elements).filter(function (v) { 3866 return v.name; 3867 })); 3868 formFields.forEach(function (field) { 3869 var name = field.name, 3870 value = field.value; 3871 url.searchParams.set(name, value); 3872 }); 3873 window.history.pushState(null, '', url.toString()); 3874 } 3875 3876 function syncValuesWithQueryParams(formEl) { 3877 var url = new URL(window.location); 3878 url.searchParams.forEach(function (value, name) { 3879 formEl.querySelector("[name=\"".concat(name, "\"]")).value = value; 3880 }); 3881 } 3882 })(jQuery); 3883 3884 (function core($) { 3885 document.querySelectorAll(".".concat(CLASSES.RECORDS_FILTER_FORM)).forEach(applyFormFilters); 3886 document.addEventListener('submit', function (evt) { 3887 var isRecordsFilterForm = evt.target.tagName === 'FORM' && evt.target.classList.contains(CLASSES.RECORDS_FILTER_FORM); 3888 3889 if (isRecordsFilterForm) { 3890 evt.preventDefault(); 3891 applyFormFilters(evt.target); 3892 } 3893 }); 3894 3895 function applyFormFilters(formEl) { 3896 var formFilters = Array.from(formEl.querySelectorAll(getDataAttrQuery(DATA_ATTR.FILTER_TYPE))); 3897 var records = Array.from(document.querySelectorAll(formEl.dataset[DATA_ATTR.RECORDS_SELECTOR])); 3898 var matchingRecordsByParticularFilters = formFilters.map(function (filterEl) { 3899 return getMatchingRecordsByFilter({ 3900 records: records, 3901 filterEl: filterEl 3902 }); 3903 }); 3904 var matchingRecordsByAllFilters = intersection$1.apply(void 0, _toConsumableArray(matchingRecordsByParticularFilters)); 3905 var incompatibleRecords = difference$1(records, matchingRecordsByAllFilters); 3906 showRecords(matchingRecordsByAllFilters); 3907 hideRecords(incompatibleRecords); 3908 } 3909 3910 function showRecords(records) { 3911 records.forEach(function (record) { 3912 record.style.display = 'block'; 3913 }); 3914 } 3915 3916 function hideRecords(records) { 3917 records.forEach(function (record) { 3918 record.style.display = 'none'; 3919 }); 3920 } 3921 3922 function getMatchingRecordsByFilter(_ref8) { 3923 var records = _ref8.records, 3924 filterEl = _ref8.filterEl; 3925 var filterType = filterEl.dataset[DATA_ATTR.FILTER_TYPE]; 3926 3927 switch (filterType) { 3928 case FILTER_TYPES.TEXT: 3929 return getMatchingRecordsByTextFilter({ 3930 records: records, 3931 filterEl: filterEl 3932 }); 3933 3934 case FILTER_TYPES.DATE: 3935 return getMatchingRecordsByDateFilter({ 3936 records: records, 3937 filterEl: filterEl 3938 }); 3939 3940 default: 3941 throwWarn("Found unsupported filter type: ".concat(filterType)); 3942 return []; 3943 } 3944 } 3945 3946 function getMatchingRecordsByTextFilter(_ref9) { 3947 var records = _ref9.records, 3948 filterEl = _ref9.filterEl; 3949 var filterValue = filterEl.value.toLowerCase(); 3950 return records.filter(function (record) { 3951 var recordValue = record.querySelector(filterEl.dataset[DATA_ATTR.RECORD_VALUE_SELECTOR]).textContent.toLowerCase(); 3952 return recordValue.includes(filterValue); 3953 }); 3954 } 3955 3956 function getMatchingRecordsByDateFilter(_ref10) { 3957 var records = _ref10.records, 3958 filterEl = _ref10.filterEl; 3959 var filterValue = filterEl.valueAsDate; 3960 if (!filterValue) return records; 3961 return records.filter(function (recordEl) { 3962 return getDateCompareMethod({ 3963 attr: filterEl.dataset[DATA_ATTR.DATE_COMPARE_METHOD], 3964 valueSelector: filterEl.dataset[DATA_ATTR.RECORD_VALUE_SELECTOR], 3965 recordEl: recordEl 3966 })(filterValue); 3967 }); 3968 } 3969 /** 3970 * Utils 3971 */ 3972 3973 3974 function getDateCompareMethod(_ref11) { 3975 var attr = _ref11.attr, 3976 valueSelector = _ref11.valueSelector, 3977 recordEl = _ref11.recordEl; 3978 3979 if (attr === DATE_COMPARE_METHODS.RECORD_DATE_AFTER) { 3980 return function (filterDate) { 3981 return isAfter(new Date(recordEl.querySelector(valueSelector).dateTime), filterDate); 3982 }; 3983 } 3984 3985 if (attr === DATE_COMPARE_METHODS.RECORD_DATE_BEFORE) { 3986 return function (filterDate) { 3987 return isBefore(new Date(recordEl.querySelector(valueSelector).dateTime), filterDate); 3988 }; 3989 } 3990 3991 return function () { 3992 throwWarn("Found unsupported date compare method: ".concat(attr)); 3993 }; 3994 } 3995 3996 function throwWarn(msg) { 3997 console.warn("[records-filter-form]: ".concat(msg)); 3998 } 3999 4000 function getDataAttrQuery(attr) { 4001 return "[data-".concat(kebabCase$1(attr), "]"); 4002 } 4003 })(jQuery); 4004 4005 (function hideHeadlinesWithoutResults($) { 4006 var LIST_SELECTOR = '.organized-results-list'; 4007 updateHeadlinesVisibility(); 4008 document.addEventListener('submit', function (evt) { 4009 var isRecordsFilterForm = evt.target.tagName === 'FORM' && evt.target.classList.contains(CLASSES.RECORDS_FILTER_FORM); 4010 4011 if (isRecordsFilterForm) { 4012 updateHeadlinesVisibility(evt.target); 4013 } 4014 }); 4015 4016 function updateHeadlinesVisibility() { 4017 var resultsList = document.querySelector(LIST_SELECTOR); 4018 if (!resultsList) return; 4019 resultsList.querySelectorAll(':scope > li').forEach(function (listItem) { 4020 var isVisible = Boolean(Array.from(listItem.querySelectorAll(':scope > ul > li')).find(function (el) { 4021 return el.style.display !== 'none'; 4022 })); 4023 listItem.style.display = isVisible ? 'block' : 'none'; 4024 }); 4025 } 4026 })(jQuery); 4027 }); 4028})();
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.