1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { 40/******/ configurable: false, 41/******/ enumerable: true, 42/******/ get: getter 43/******/ }); 44/******/ } 45/******/ }; 46/******/ 47/******/ // getDefaultExport function for compatibility with non-harmony modules 48/******/ __webpack_require__.n = function(module) { 49/******/ var getter = module && module.__esModule ? 50/******/ function getDefault() { return module['default']; } : 51/******/ function getModuleExports() { return module; }; 52/******/ __webpack_require__.d(getter, 'a', getter); 53/******/ return getter; 54/******/ }; 55/******/ 56/******/ // Object.prototype.hasOwnProperty.call 57/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58/******/ 59/******/ // __webpack_public_path__ 60/******/ __webpack_require__.p = ""; 61/******/ 62/******/ // Load entry module and return exports 63/******/ return __webpack_require__(__webpack_require__.s = 1); 64/******/ }) 65/************************************************************************/ 66/******/ ([ 67/* 0 */ 68/***/ (function(module, exports, __webpack_require__) { 69 70"use strict"; 71 72 73Object.defineProperty(exports, "__esModule", { 74 value: true 75}); 76// Create csco object. 77var csco = { 78 addAction: function addAction(x, y, z) { 79 return; 80 } 81}; 82 83if ('undefined' !== typeof wp && 'undefined' !== typeof wp.hooks) { 84 csco.addAction = wp.hooks.addAction; 85} 86 87/** 88 * Window size 89 */ 90var $ = jQuery; 91var $window = $(window); 92var $doc = $(document); 93var $body = $('body'); 94 95var wndW = 0; 96var wndH = 0; 97var docH = 0; 98 99function csGetWndSize() { 100 exports.wndW = wndW = $window.width(); 101 exports.wndH = wndH = $window.height(); 102 exports.docH = docH = $doc.height(); 103} 104 105$window.on('resize load orientationchange', csGetWndSize); 106 107csGetWndSize(); 108 109/** 110 * Throttle scroll 111 * thanks: https://jsfiddle.net/mariusc23/s6mLJ/31/ 112 */ 113var csHideOnScrollList = []; 114 115var csDidScroll = void 0; 116var csLastST = 0; 117 118$window.on('scroll load resize orientationchange', function () { 119 if (csHideOnScrollList.length) { 120 csDidScroll = true; 121 } 122}); 123 124function csHasScrolled() { 125 var ST = $window.scrollTop(); 126 127 var type = null; 128 129 if (ST > csLastST) { 130 type = 'down'; 131 } else if (ST < csLastST) { 132 type = 'up'; 133 } else { 134 type = 'none'; 135 } 136 137 if (ST === 0) { 138 type = 'start'; 139 } else if (ST >= docH - wndH) { 140 type = 'end'; 141 } 142 143 csHideOnScrollList.forEach(function (item) { 144 if (typeof item === 'function') { 145 item(type, ST, csLastST, $window); 146 } 147 }); 148 149 csLastST = ST; 150} 151 152setInterval(function () { 153 if (csDidScroll) { 154 csDidScroll = false; 155 window.requestAnimationFrame(csHasScrolled); 156 } 157}, 250); 158 159function csThrottleScroll(callback) { 160 csHideOnScrollList.push(callback); 161} 162 163/** 164 * In Viewport checker 165 */ 166$.fn.isInViewport = function () { 167 var elementTop = $(this).offset().top; 168 var elementBottom = elementTop + $(this).outerHeight(); 169 170 var viewportTop = $(window).scrollTop(); 171 var viewportBottom = viewportTop + $(window).height(); 172 173 return elementBottom > viewportTop && elementTop < viewportBottom; 174}; 175 176/** 177 * Cookies 178 */ 179function csGetCookie(name) { 180 var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)")); 181 return matches ? decodeURIComponent(matches[1]) : undefined; 182} 183 184function csSetCookie(name, value) { 185 var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 186 187 188 props = { 189 path: '/' 190 }; 191 192 if (props.expires instanceof Date) { 193 props.expires = props.expires.toUTCString(); 194 } 195 196 var updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value); 197 198 for (var optionKey in props) { 199 updatedCookie += "; " + optionKey; 200 var optionValue = props[optionKey]; 201 if (optionValue !== true) { 202 updatedCookie += "=" + optionValue; 203 } 204 } 205 206 document.cookie = updatedCookie; 207} 208 209exports.$ = $; 210exports.$window = $window; 211exports.$doc = $doc; 212exports.$body = $body; 213exports.csco = csco; 214exports.wndW = wndW; 215exports.wndH = wndH; 216exports.docH = docH; 217exports.csThrottleScroll = csThrottleScroll; 218exports.csGetCookie = csGetCookie; 219exports.csSetCookie = csSetCookie; 220 221/***/ }), 222/* 1 */ 223/***/ (function(module, exports, __webpack_require__) { 224 225__webpack_require__(2); 226__webpack_require__(3); 227__webpack_require__(4); 228__webpack_require__(5); 229__webpack_require__(6); 230__webpack_require__(7); 231__webpack_require__(8); 232__webpack_require__(9); 233__webpack_require__(10); 234__webpack_require__(11); 235__webpack_require__(12); 236__webpack_require__(13); 237__webpack_require__(14); 238__webpack_require__(15); 239module.exports = __webpack_require__(16); 240 241 242/***/ }), 243/* 2 */ 244/***/ (function(module, exports, __webpack_require__) { 245 246"use strict"; 247 248 249var _utility = __webpack_require__(0); 250 251(function () {
252 (0, _utility.$)(document).on('click', '.cs-entry__comments-show button', function (e) { 253 (0, _utility.$)('.cs-entry__comments-collapse').show(); 254 (0, _utility.$)('.cs-entry__comments-show').remove(); 255 }); 256})(); /** ---------------------------------------------------------------------------- 257 * Comments Dropdown */ 258 259/***/ }), 260/* 3 */ 261/***/ (function(module, exports, __webpack_require__) { 262 263"use strict"; 264 265 266var _utility = __webpack_require__(0); 267 268(function () { 269 var ticking = false; 270 271 var update = function update() { 272 273 // Sidebar. 274 // -----------------------------------. 275 (0, _utility.$)('.cs-site-primary').each(function () { 276 277 var content = (0, _utility.$)(this).find('.entry-content'); 278 var sidebar = (0, _utility.$)(this).find('.cs-entry__metabar-inner'); 279 280 // Vars offset. 281 var offsetTop = 20; 282 var offsetBottom = -20; 283 284 // Search elements. 285 var elements = []; 286 287 elements.push('> .alignfull'); 288 elements.push('> .alignwide'); 289 290 var layouts = (0, _utility.$)(content).find(elements.join(',')); 291 292 if (0 === sidebar.length) { 293 return; 294 } 295 if (0 === layouts.length) { 296 return; 297 } 298 299 var disabled = false; 300 301 // Get sidebar values. 302 var sidebarTop = (0, _utility.$)(sidebar).offset().top; 303 var sidebarHeight = (0, _utility.$)(sidebar).outerHeight(true); 304 305 for (var i = 0; i < (0, _utility.$)(layouts).length; ++i) { 306 if ('none' === (0, _utility.$)(layouts[i]).css('transform')) { 307 continue; 308 } 309 310 // Get layout values. 311 var layoutTop = (0, _utility.$)(layouts[i]).offset().top; 312 var layoutHeight = (0, _utility.$)(layouts[i]).outerHeight(true); 313 314 // Calc points. 315 var pointTop = layoutTop - offsetTop; 316 var pointBottom = layoutTop + layoutHeight + offsetBottom; 317 318 // Detect sidebar location. 319 if (sidebarTop + sidebarHeight >= pointTop && sidebarTop <= pointBottom) { 320 disabled = true; 321 } 322 } 323 324 if (disabled) { 325 (0, _utility.$)(sidebar).css('opacity', '0'); 326 } else { 327 (0, _utility.$)(sidebar).css('opacity', '1'); 328 } 329 }); 330 331 // Ticking. 332 ticking = false; 333 }; 334 335 var requestTick = function requestTick() { 336 if (!ticking) { 337 window.requestAnimationFrame(update); 338 ticking = true; 339 } 340 }; 341 342 var onProcess = function onProcess() { 343 requestTick(); 344 }; 345 346 (0, _utility.$)(window).on('scroll', onProcess); 347 (0, _utility.$)(window).on('resize', onProcess); 348 (0, _utility.$)(window).on('image-load', onProcess); 349 (0, _utility.$)(window).on('post-load', onProcess); 350})(); /** ---------------------------------------------------------------------------- 351 * Detect Aligment */ 352 353/***/ }), 354/* 4 */ 355/***/ (function(module, exports, __webpack_require__) { 356 357"use strict"; 358 359 360var _utility = __webpack_require__(0); 361 362(function () { 363 364 var $entryType = (0, _utility.$)('.cnvs-block-posts-layout-tile-type-2 .cs-entry__outer, .cnvs-block-posts-layout-tile-type-3 .cs-entry__outer'), 365 isHovered = false; 366 367 function process(el) { 368 var currentWidth = _utility.$window.width(), 369 maxWidth = 1020, 370 $el = null; 371 372 if (el) { 373 $el = (0, _utility.$)(el); 374 } else { 375 $el = $entryType; 376 } 377 378 if (currentWidth < maxWidth) { 379 $entryType.attr('data-scheme', 'inverse'); 380 } else { 381 $entryType.removeAttr('data-scheme'); 382 383 if (isHovered) { 384 $el.attr('data-scheme', 'inverse'); 385 } else { 386 $entryType.removeAttr('data-scheme'); 387 } 388 } 389 } 390 391 $entryType.hover(function () { 392 isHovered = true; 393 process(this); 394 }, function () { 395 isHovered = false; 396 process(this); 397 }); 398 399 _utility.$window.resize(function () { 400 process(); 401 }); 402 403 process(); 404})(); /** ---------------------------------------------------------------------------- 405 * Comments Dropdown */ 406 407/***/ }), 408/* 5 */ 409/***/ (function(module, exports, __webpack_require__) { 410 411"use strict"; 412 413 414var _utility = __webpack_require__(0); 415 416var largeHoverBlock = (0, _utility.$)('.cnvs-block-posts-layout-large-type-8 .cs-layout-large__col, .cnvs-block-posts-layout-large-type-9 .cs-layout-large__col'); /** ---------------------------------------------------------------------------- 417 * Comments Dropdown */ 418 419(function () { 420 largeHoverBlock.hover(function () { 421 422 (0, _utility.$)(this).addClass('active').siblings().removeClass('active').closest('.cs-layout-large__wrap').find('.cs-overlay-background').removeClass('active').eq((0, _utility.$)(this).index()).addClass('active'); 423 }, function () { 424 425 (0, _utility.$)(this).closest('.cs-layout-large__wrap').find('.cs-overlay-background').removeClass('active').eq((0, _utility.$)(this).index()).addClass('active'); 426 }); 427})(); 428 429/***/ }), 430/* 6 */ 431/***/ (function(module, exports, __webpack_require__) { 432 433"use strict"; 434 435 436var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** 437 * AJAX Load More. 438 * 439 * Contains functions for AJAX Load More. 440 */ 441 442var _utility = __webpack_require__(0); 443
444if ('undefined' === typeof window.load_more_query) { 445 window.load_more_query = []; 446} 447 448/** 449 * Get next posts 450 */ 451function csco_ajax_get_posts(object) { 452 var container = (0, _utility.$)(object).closest('.cs-posts-area'); 453 454 var settings = (0, _utility.$)(object).data('settings'); 455 var page = (0, _utility.$)(object).data('page'); 456 457 (0, _utility.$)(object).data('loading', true); 458 459 // Set button text to Load More. 460 (0, _utility.$)(object).text(settings.translation.loading); 461 462 var data = { 463 action: 'csco_ajax_load_more', 464 page: page, 465 posts_per_page: settings.posts_per_page, 466 query_data: settings.query_data, 467 attributes: settings.attributes, 468 options: settings.options, 469 _ajax_nonce: settings.nonce 470 }; 471 472 // Request Url. 473 var csco_pagination_url; 474 475 if ('ajax_restapi' === settings.type) { 476 csco_pagination_url = settings.rest_url; 477 } else { 478 csco_pagination_url = settings.url; 479 } 480 481 // Send Request. 482 _utility.$.post(csco_pagination_url, data, function (res) { 483 if (res.success) { 484 485 // Get the posts. 486 var data = (0, _utility.$)(res.data.content); 487 488 // Check if there're any posts. 489 if (data.length) { 490 491 data.imagesLoaded(function () { 492 493 // Append new posts to list, standard and grid archives. 494 (0, _utility.$)(container).find('.cs-posts-area__main').append(data); 495 496 // WP Post Load trigger. 497 (0, _utility.$)(document.body).trigger('post-load'); 498 499 // Reinit Facebook widgets. 500 if ((0, _utility.$)('#fb-root').length && 'object' === (typeof FB === 'undefined' ? 'undefined' : _typeof(FB))) { 501 FB.XFBML.parse(); 502 } 503 504 // Set button text to Load More. 505 (0, _utility.$)(object).text(settings.translation.load_more); 506 507 // Increment a page. 508 page = page + 1; 509 510 (0, _utility.$)(object).data('page', page); 511 512 // Set the loading state. 513 (0, _utility.$)(object).data('loading', false); 514 }); 515 } 516 517 // Remove Button on Posts End. 518 if (res.data.posts_end || !data.length) { 519 520 // Remove Load More button. 521 (0, _utility.$)(object).remove(); 522 } 523 } else { 524 // console.log(res); 525 } 526 }).fail(function (xhr, textStatus, e) { 527 // console.log(xhr.responseText); 528 }); 529} 530 531/** 532 * Initialization Load More 533 */ 534function csco_load_more_init(infinite) { 535 (0, _utility.$)('.cs-posts-area').each(function () { 536 537 if ((0, _utility.$)(this).data('init')) { 538 return false; 539 } 540 541 var csco_ajax_settings; 542 543 if (typeof csco_ajax_pagination !== 'undefined') { 544 csco_ajax_settings = csco_ajax_pagination; 545 } 546 547 var archive_data = (0, _utility.$)(this).data('posts-area'); 548 549 if (archive_data) { 550 csco_ajax_settings = JSON.parse(window.atob(archive_data)); 551 } 552 553 if (csco_ajax_settings) { 554 555 if (!infinite && csco_ajax_settings.infinite_load) { 556 return false; 557 } 558 559 // Add load more button. 560 (0, _utility.$)(this).append('<div class="cs-posts-area__pagination"><button class="cs-load-more">' + csco_ajax_settings.translation.load_more + '</button></div>'); 561 562 // Set load more settings. 563 (0, _utility.$)(this).find('.cs-load-more').data('settings', csco_ajax_settings); 564 (0, _utility.$)(this).find('.cs-load-more').data('page', 2); 565 (0, _utility.$)(this).find('.cs-load-more').data('loading', false); 566 (0, _utility.$)(this).find('.cs-load-more').data('scrollHandling', { 567 allow: _utility.$.parseJSON(csco_ajax_settings.infinite_load), 568 delay: 400 569 }); 570 } 571 572 (0, _utility.$)(this).data('init', true); 573 }); 574} 575 576csco_load_more_init(true); 577 578_utility.csco.addAction('canvas.components.serverSideRender.onChange', 'posts-init-loadmore', function (props) { 579 if ('canvas/posts' === props.block) { 580 csco_load_more_init(false); 581 } 582}); 583 584// On Scroll Event. 585(0, _utility.$)(window).scroll(function () { 586 587 (0, _utility.$)('.cs-posts-area .cs-load-more').each(function () { 588 589 var loading = (0, _utility.$)(this).data('loading'); 590 var scrollHandling = (0, _utility.$)(this).data('scrollHandling'); 591 592 if ('undefined' === typeof scrollHandling) { 593 return; 594 } 595 596 if ((0, _utility.$)(this).length && !loading && scrollHandling.allow) { 597 598 scrollHandling.allow = false; 599 600 (0, _utility.$)(this).data('scrollHandling', scrollHandling); 601 602 var object = this; 603 604 setTimeout(function () { 605 var scrollHandling = (0, _utility.$)(object).data('scrollHandling'); 606 607 if ('undefined' === typeof scrollHandling) { 608 return; 609 } 610 611 scrollHandling.allow = true; 612 613 (0, _utility.$)(object).data('scrollHandling', scrollHandling); 614 }, scrollHandling.delay); 615 616 var offset = (0, _utility.$)(this).offset().top - (0, _utility.$)(window).scrollTop(); 617 if (4000 > offset) { 618 csco_ajax_get_posts(this); 619 } 620 } 621 }); 622}); 623 624// On Click Event. 625(0, _utility.$)('body').on('click', '.cs-load-more', function () { 626 var loading = (0, _utility.$)(this).data('loading'); 627 628 if (!loading) { 629 csco_ajax_get_posts(this); 630 } 631}); 632 633/***/ }), 634/* 7 */ 635/***/ (function(module, exports, __webpack_require__) { 636 637"use strict"; 638 639 640var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** 641 * AJAX Auto Load Next Post. 642 * 643 * Contains functions for AJAX Auto Load Next Post. 644 */ 645 646var _utility = __webpack_require__(0); 647 648/**
649 * Check if Load Nextpost is defined by the wp_localize_script 650 */ 651if (typeof csco_ajax_nextpost !== 'undefined') { 652 653 var objNextparent = (0, _utility.$)('.cs-site-primary > .cs-site-content'), 654 objNextsect = '.cs-nextpost-section', 655 objNextpost = null, 656 currentNTitle = document.title, 657 currentNLink = window.location.href, 658 loadingNextpost = false, 659 scrollNextpost = { 660 allow: true, 661 reallow: function reallow() { 662 scrollNextpost.allow = true; 663 }, 664 delay: 400 //(milliseconds) adjust to the highest acceptable value 665 }; 666 667 // Init. 668 if (csco_ajax_nextpost.next_post) { 669 (0, _utility.$)(objNextparent).after('<div class="cs-nextpost-inner"></div>'); 670 671 objNextpost = (0, _utility.$)('.cs-nextpost-inner'); 672 } 673} 674 675/** 676 * Get next post 677 */ 678function csco_ajax_get_nextpost() { 679 loadingNextpost = true; 680 681 // Set class loading. 682 var data = { 683 action: 'csco_ajax_load_nextpost', 684 post_type: csco_ajax_nextpost.post_type, 685 not_in: csco_ajax_nextpost.not_in, 686 current_user: csco_ajax_nextpost.current_user, 687 nonce: csco_ajax_nextpost.nonce, 688 next_post: csco_ajax_nextpost.next_post 689 }; 690 691 // Request Url. 692 var csco_ajax_nextpost_url; 693 if ('ajax_restapi' === csco_ajax_nextpost.type) { 694 csco_ajax_nextpost_url = csco_ajax_nextpost.rest_url; 695 } else { 696 csco_ajax_nextpost_url = csco_ajax_nextpost.url; 697 } 698 699 // Send Request. 700 _utility.$.post(csco_ajax_nextpost_url, data, function (res) { 701 702 csco_ajax_nextpost.next_post = false; 703 704 if (res.success) { 705 706 // Get the posts. 707 var data = (0, _utility.$)(res.data.content); 708 709 // Check if there're any posts. 710 if (data.length) { 711 // Set the loading state. 712 loadingNextpost = false; 713 714 // Set not_in. 715 csco_ajax_nextpost.not_in = res.data.not_in; 716 717 // Set next data. 718 csco_ajax_nextpost.next_post = res.data.next_post; 719 720 // Remove loader. 721 (0, _utility.$)(objNextpost).siblings('.cs-nextpost-loading').remove(); 722 723 // Append new post. 724 (0, _utility.$)(objNextpost).append(data); 725 726 // Reinit facebook. 727 if ((0, _utility.$)('#fb-root').length && 'object' === (typeof FB === 'undefined' ? 'undefined' : _typeof(FB))) { 728 FB.XFBML.parse(); 729 } 730 731 (0, _utility.$)(document.body).trigger('post-load'); 732 } 733 } else { 734 // console.log(res); 735 } 736 }).fail(function (xhr, textStatus, e) { 737 // console.log(xhr.responseText); 738 }); 739} 740 741/** 742 * Check if Load Nextpost is defined by the wp_localize_script 743 */ 744if (typeof csco_ajax_nextpost !== 'undefined') { 745 746 // On Scroll Event. 747 (0, _utility.$)(window).scroll(function () { 748 var scrollTop = (0, _utility.$)(window).scrollTop(); 749 750 // Init nextpost. 751 if (csco_ajax_nextpost.next_post) { 752 753 if (objNextpost.length && !loadingNextpost && scrollNextpost.allow) { 754 scrollNextpost.allow = false; 755 setTimeout(scrollNextpost.reallow, scrollNextpost.delay); 756 // Calc current offset. 757 var offset = objNextpost.offset().top + objNextpost.innerHeight() - scrollTop; 758 // Load nextpost. 759 if (4000 > offset) { 760 (0, _utility.$)(objNextpost).after('<div class="cs-nextpost-loading"></div>'); 761 762 csco_ajax_get_nextpost(); 763 } 764 } 765 } 766 767 // Reset browser data link. 768 var objFirst = (0, _utility.$)(objNextsect).first(); 769 770 if (objFirst.length) { 771 var firstTop = (0, _utility.$)(objFirst).offset().top; 772 // If there has been a change. 773 if (scrollTop < firstTop && window.location.href !== currentNLink) { 774 document.title = currentNTitle; 775 window.history.pushState(null, currentNTitle, currentNLink); 776 } 777 } 778 779 // Set browser data link. 780 (0, _utility.$)(objNextsect).each(function (index, elem) { 781 782 var elemTop = (0, _utility.$)(elem).offset().top; 783 var elemHeight = (0, _utility.$)(elem).innerHeight(); 784 785 if (scrollTop > elemTop && scrollTop < elemTop + elemHeight) { 786 // If there has been a change. 787 if (window.location.href !== (0, _utility.$)(elem).data('url')) { 788 // New title. 789 document.title = (0, _utility.$)(elem).data('title'); 790 // New link. 791 window.history.pushState(null, (0, _utility.$)(elem).data('title'), (0, _utility.$)(elem).data('url')); 792 // Google Analytics. 793 if (typeof gtag === 'function' && _typeof(window.gaData) === 'object') { 794 795 var trackingId = Object.keys(window.gaData)[0]; 796 if (trackingId) { 797 gtag('config', trackingId, { 798 'page_title': (0, _utility.$)(elem).data('title'), 799 'page_location': (0, _utility.$)(elem).data('url') 800 }); 801 802 gtag('event', 'page_view', { 'send_to': trackingId }); 803 } 804 } 805 } 806 } 807 }); 808 }); 809} 810 811/***/ }), 812/* 8 */ 813/***/ (function(module, exports, __webpack_require__) { 814 815"use strict"; 816 817 818var _utility = __webpack_require__(0); 819 820(function () { 821 /* 822 * Load Mega Menu Posts 823 */ 824 function cscoLoadMenuPosts(menuItem) { 825 var dataTerm = menuItem.children('a').data('term'), 826 dataPosts = menuItem.children('a').data('posts'), 827 dataNumberposts = menuItem.children('a').data('numberposts'), 828 menuContainer, 829 postsContainer; 830 831 // Containers. 832 if (menuItem.hasClass('cs-mega-menu-term')) { 833 menuContainer = menuItem; 834 postsContainer = menuContainer.find('.cs-mm__posts'); 835 } 836 837 if (menuItem.hasClass('cs-mega-menu-posts')) { 838 menuContainer = menuItem; 839 postsContainer = menuContainer.find('.cs-mm__posts'); 840 } 841 842 if (menuItem.hasClass('cs-mega-menu-child-term')) { 843 menuContainer = menuItem.closest('.sub-menu'); 844 postsContainer = menuContainer.find('.cs-mm__posts[data-term="' + dataTerm + '"]'); 845 } 846 847 // Check Menu Container. 848 if (!menuContainer || typeof menuContainer === 'undefined') { 849 return false;
850 } 851 852 // Check Container. 853 if (!postsContainer || typeof postsContainer === 'undefined') { 854 return false; 855 } 856 857 // Set Active. 858 menuContainer.find('.menu-item, .cs-mm__posts').removeClass('cs-active-item'); 859 860 menuItem.addClass('cs-active-item'); 861 862 if (postsContainer) { 863 postsContainer.addClass('cs-active-item'); 864 } 865 866 // Check Loading. 867 if (menuItem.hasClass('cs-mm-loading') || menuItem.hasClass('loaded')) { 868 return false; 869 } 870 871 // Create Data. 872 var data = { 873 'term': dataTerm, 874 'posts': dataPosts, 875 'per_page': dataNumberposts 876 }; 877 878 if ('undefined' === typeof csco_mega_menu) { 879 return; 880 } 881 882 // Get Results. 883 _utility.$.ajax({ 884 url: csco_mega_menu.rest_url, 885 type: 'GET', 886 data: data, 887 global: false, 888 async: true, 889 beforeSend: function beforeSend() { 890 menuItem.addClass('cs-mm-loading'); 891 postsContainer.addClass('cs-mm-loading'); 892 }, 893 success: function success(res) { 894 if (res.status && 'success' === res.status) { 895 896 // Set the loaded state. 897 menuItem.addClass('loaded'); 898 postsContainer.addClass('loaded'); 899 900 // Check if there're any posts. 901 if (res.content && res.content.length) { 902 903 (0, _utility.$)(res.content).imagesLoaded(function () { 904 905 // Append Data. 906 postsContainer.html(res.content); 907 }); 908 } 909 } 910 }, 911 complete: function complete() { 912 // Set the loading state. 913 menuItem.removeClass('cs-mm-loading'); 914 postsContainer.removeClass('cs-mm-loading'); 915 } 916 }); 917 } 918 919 /* 920 * Get First Tab 921 */ 922 function cscoGetFirstTab(container) { 923 924 var firstTab = false; 925 926 container.find('.cs-mega-menu-child').each(function (index, el) { 927 if ((0, _utility.$)(el).hasClass('cs-mega-menu-child')) { 928 firstTab = (0, _utility.$)(el); 929 return false; 930 } 931 }); 932 933 return firstTab; 934 } 935 936 /* 937 * Menu on document ready 938 */ 939 (0, _utility.$)(document).ready(function () { 940 941 /* 942 * Get Menu Posts on Hover 943 */ 944 (0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-posts').on('mouseenter', function () { 945 cscoLoadMenuPosts((0, _utility.$)(this)); 946 }); 947 (0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-term').on('mouseenter', function () { 948 cscoLoadMenuPosts((0, _utility.$)(this)); 949 }); 950 (0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-child').on('mouseenter', function () { 951 cscoLoadMenuPosts((0, _utility.$)(this)); 952 }); 953 954 /* 955 * Load First Tab on Mega Menu Hover 956 */ 957 (0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-terms').on('mouseenter', function () { 958 var tab = cscoGetFirstTab((0, _utility.$)(this)); 959 960 if (tab) { 961 cscoLoadMenuPosts(tab); 962 } 963 }); 964 }); 965 966 /* 967 * Load First Tab on Navbar Ready. 968 */ 969 (0, _utility.$)(document, '.cs-header__nav').ready(function () { 970 var tab = false; 971 972 // Autoload First Tab. 973 (0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-terms').each(function (index, el) { 974 tab = cscoGetFirstTab((0, _utility.$)(this)); 975 976 if (tab) { 977 cscoLoadMenuPosts(tab); 978 } 979 }); 980 981 // Autoload Posts. 982 (0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-posts').each(function (index, el) { 983 cscoLoadMenuPosts((0, _utility.$)(this)); 984 }); 985 986 // Autoload Term. 987 (0, _utility.$)('.cs-header__nav .menu-item.cs-mega-menu-term').each(function (index, el) { 988 cscoLoadMenuPosts((0, _utility.$)(this)); 989 }); 990 }); 991})(); /** ---------------------------------------------------------------------------- 992 * Mega Menu */ 993 994/***/ }), 995/* 9 */ 996/***/ (function(module, exports, __webpack_require__) { 997 998"use strict"; 999 1000 1001var _utility = __webpack_require__(0); 1002 1003var cscoNavigation = {}; /** ---------------------------------------------------------------------------- 1004 * Navigation */ 1005 1006(function () { 1007 var $this; 1008 cscoNavigation = { 1009 /** Initialize */ 1010 init: function init(e) { 1011 if ((0, _utility.$)('body').hasClass('wp-admin')) { 1012 return; 1013 } 1014 $this = cscoNavigation; 1015 // Init events. 1016 $this.events(e); 1017 }, 1018 /** Events */ 1019 events: function events(e) { 1020 // DOM Load 1021 window.addEventListener('load', function (e) { 1022 $this.smartLevels(e); 1023 $this.adaptTablet(e); 1024 $this.stickyScroll(e); 1025 }); 1026 // Resize 1027 window.addEventListener('resize', function (e) { 1028 $this.smartLevels(e); 1029 $this.adaptTablet(e); 1030 $this.stickyScroll(e); 1031 }); 1032 }, 1033 /** Smart multi-Level menu */ 1034 smartLevels: function smartLevels(e) { 1035 var windowWidth = _utility.$window.width(); 1036 // Reset Calc. 1037 (0, _utility.$)('.cs-header__nav-inner li').removeClass('cs-sm__level'); 1038 (0, _utility.$)('.cs-header__nav-inner li').removeClass('cs-sm-position-left cs-sm-position-right'); 1039 (0, _utility.$)('.cs-header__nav-inner li .sub-menu').removeClass('cs-mm__position-init'); 1040 // Set Settings. 1041 (0, _utility.$)('.cs-header__nav-inner > li.menu-item').not('.cs-mm').each(function (index, parent) { 1042 var position = 'cs-sm-position-right'; //right 1043 var objPrevWidth = 0; 1044 (0, _utility.$)(parent).find('.sub-menu').each(function (index, el) { 1045 // Reset child levels. 1046 (0, _utility.$)(el).parent().next('li').addClass('cs-sm__level'); 1047 if ((0, _utility.$)(el).parent().hasClass('cs-sm__level')) { 1048 (0, _utility.$)(el).parent().removeClass('cs-mm-level'); 1049 position = 'cs-sm-position-right'; //right 1050 objPrevWidth = 0; 1051 } 1052 // Find out position items. 1053 var offset = (0, _utility.$)(el).offset(); 1054 var objOffset = offset.left;
1055 if ('cs-sm-position-right' === position && (0, _utility.$)(el).outerWidth() + objOffset > windowWidth) { 1056 position = 'cs-sm-position-left'; 1057 } 1058 if ('cs-sm-position-left' === position && objOffset - ((0, _utility.$)(el).outerWidth() + objPrevWidth) < 0) { 1059 position = 'cs-sm-position-right'; //right 1060 } 1061 objPrevWidth = (0, _utility.$)(el).outerWidth(); 1062 (0, _utility.$)(el).addClass('cs-sm-position-init').parent().addClass(position); 1063 }); 1064 }); 1065 }, 1066 /** Adapting nav bar for tablet */ 1067 adaptTablet: function adaptTablet(e) { 1068 // Click outside. 1069 (0, _utility.$)(document).on('touchstart', function (e) { 1070 if (!(0, _utility.$)(e.target).closest('.cs-header__nav-inner').length) { 1071 (0, _utility.$)('.cs-header__nav-inner .menu-item-has-children').removeClass('submenu-visible'); 1072 } else { 1073 (0, _utility.$)(e.target).parents('.menu-item').siblings().find('.menu-item').removeClass('submenu-visible'); 1074 (0, _utility.$)(e.target).parents('.menu-item').siblings().closest('.menu-item').removeClass('submenu-visible'); 1075 } 1076 }); 1077 (0, _utility.$)('.cs-header__nav-inner .menu-item-has-children').each(function (e) { 1078 // Reset class. 1079 (0, _utility.$)(this).removeClass('submenu-visible'); 1080 // Remove expanded. 1081 (0, _utility.$)(this).find('> a > .expanded').remove(); 1082 // Add a caret. 1083 if ('ontouchstart' in document.documentElement) { 1084 (0, _utility.$)(this).find('> a').append('<span class="expanded"></span>'); 1085 } 1086 // Check touch device. 1087 (0, _utility.$)(this).addClass('ontouchstart' in document.documentElement ? 'touch-device' : ''); 1088 (0, _utility.$)('> a .expanded', this).on('touchstart', function (e) { 1089 e.preventDefault(); 1090 (0, _utility.$)(this).closest('.menu-item-has-children').toggleClass('submenu-visible'); 1091 }); 1092 if ('#' === (0, _utility.$)('> a', this).attr('href')) { 1093 (0, _utility.$)('> a', this).on('touchstart', function (e) { 1094 e.preventDefault(); 1095 if (!(0, _utility.$)(e.target).hasClass('expanded')) { 1096 (0, _utility.$)(this).closest('.menu-item-has-children').toggleClass('submenu-visible'); 1097 } 1098 }); 1099 } 1100 }); 1101 }, 1102 /** Make nav bar sticky */ 1103 stickyScroll: function stickyScroll(e) { 1104 // Get css variables 1105 var headerLargeHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')), 1106 headerCompactHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')); 1107 //Get header elements 1108 var headerStick = (0, _utility.$)('.cs-navbar-sticky-enabled .cs-header'), 1109 headerBefore = (0, _utility.$)('.cs-header-before'), 1110 headerStretch = (0, _utility.$)('.cs-header-stretch'), 1111 headerStretchInaccuracy = headerStretch.length > 0 ? 10 : 0, 1112 headerStickHeight = (0, _utility.$)('.cs-navbar-sticky-enabled .cs-header-stretch'), 1113 wpAdminBar = (0, _utility.$)('#wpadminbar'), 1114 headerSearch = (0, _utility.$)('.cs-search'), 1115 offCanvas = (0, _utility.$)('.cs-offcanvas'); 1116 //Comb out the heights 1117 var headerDelta = headerStickHeight.length > 0 ? headerLargeHeight - headerCompactHeight : 0, 1118 wpAdminBarHeight = wpAdminBar.length > 0 ? wpAdminBar.outerHeight() : 0, 1119 smartStart = headerBefore.length > 0 ? headerBefore.offset().top : headerStick.length > 0 ? headerStick.offset().top + wpAdminBarHeight : wpAdminBarHeight; 1120 //Set values to hide 1121 var scrollPoint = 200, 1122 scrollPrev = 200, 1123 scrollUpAmount = 0, 1124 windowWidth = _utility.$window.width(); 1125 (0, _utility.$)(window).scroll(function () { 1126 var scrolled = (0, _utility.$)(window).scrollTop(), 1127 headerStickPosition = headerStick.length > 0 ? headerStick.offset().top : 0; 1128 if (scrolled > smartStart + headerDelta + scrollPoint + headerStretchInaccuracy && scrolled > scrollPrev) { 1129 headerStick.addClass('cs-scroll-active'); 1130 headerSearch.slideUp(); 1131 (0, _utility.$)(document).trigger('sticky-nav-hide'); 1132 } else { 1133 if (scrollUpAmount >= scrollPoint || scrolled === 0) { 1134 headerStick.removeClass('cs-scroll-active'); 1135 (0, _utility.$)(document).trigger('sticky-nav-visible'); 1136 } 1137 } 1138 if (headerStickHeight.length > 0) { 1139 if (headerStickPosition <= scrolled + wpAdminBarHeight && scrolled > smartStart + headerDelta) { 1140 headerStick.addClass('cs-scroll-sticky'); 1141 (0, _utility.$)(document).trigger('stretch-nav-to-small'); 1142 } else { 1143 if (scrolled <= smartStart) { 1144 headerStick.removeClass('cs-scroll-sticky'); 1145 (0, _utility.$)(document).trigger('stretch-nav-to-big'); 1146 } 1147 } 1148 } else { 1149 if (headerStickPosition <= scrolled + wpAdminBarHeight && scrolled + wpAdminBarHeight > smartStart) { 1150 headerStick.addClass('cs-scroll-sticky'); 1151 if (headerStretch.length > 0) { 1152 (0, _utility.$)(document).trigger('stretch-nav-to-small'); 1153 } 1154 } else { 1155 headerStick.removeClass('cs-scroll-sticky'); 1156 if (headerStretch.length > 0) { 1157 (0, _utility.$)(document).trigger('stretch-nav-to-big'); 1158 } 1159 } 1160 } 1161 if (scrolled < scrollPrev) { 1162 scrollUpAmount += scrollPrev - scrolled; 1163 } else { 1164 scrollUpAmount = 0; 1165 } 1166 if (wpAdminBar.length > 0 && _utility.wndW <= 600 && scrolled >= wpAdminBarHeight) { 1167 offCanvas.addClass('cs-offcanvas_scrolled'); 1168 } else { 1169 offCanvas.removeClass('cs-offcanvas_scrolled'); 1170 } 1171 scrollPrev = scrolled; 1172 }); 1173 } 1174 }; 1175})(); 1176// Initialize. 1177cscoNavigation.init(); 1178 1179/***/ }), 1180/* 10 */ 1181/***/ (function(module, exports, __webpack_require__) { 1182 1183"use strict"; 1184 1185 1186var _utility = __webpack_require__(0); 1187 1188(function () { 1189 (0, _utility.$)('.cs-header__offcanvas-toggle, .cs-site-overlay, .cs-offcanvas__toggle').on('click', function (e) { 1190 e.preventDefault(); 1191 1192 // Transition. 1193 if (!_utility.$body.hasClass('cs-offcanvas-active')) { 1194 _utility.$body.addClass('cs-offcanvas-transition'); 1195 } else { 1196 setTimeout(function () { 1197 _utility.$body.removeClass('cs-offcanvas-transition'); 1198 }, 400); 1199 } 1200 1201 // Toogle offcanvas. 1202 _utility.$body.toggleClass('cs-offcanvas-active'); 1203 }); 1204})(); /** ---------------------------------------------------------------------------- 1205 * Offcanvas */ 1206
1207/***/ }), 1208/* 11 */ 1209/***/ (function(module, exports, __webpack_require__) { 1210 1211"use strict"; 1212 1213 1214var _utility = __webpack_require__(0); 1215 1216(function () { 1217 /** 1218 * Add max-width & max-height to <iframe> elements, depending on their width & height props. 1219 */ 1220 function initResponsiveEmbeds() { 1221 var proportion, parentWidth; 1222 1223 // Loop iframe elements. 1224 (0, _utility.$)('.entry-content').find('iframe').each(function (index, iframe) { 1225 // Don't handle if the parent automatically resizes itself. 1226 if ((0, _utility.$)(iframe).closest('div').is('[data-video-start], [data-video-end]')) { 1227 return; 1228 } 1229 // Only continue if the iframe has a width & height defined. 1230 if (iframe.width && iframe.height) { 1231 // Calculate the proportion/ratio based on the width & height. 1232 proportion = parseFloat(iframe.width) / parseFloat(iframe.height); 1233 // Get the parent element's width. 1234 parentWidth = parseFloat(window.getComputedStyle(iframe.parentElement, null).width.replace('px', '')); 1235 // Set the max-width & height. 1236 iframe.style.maxWidth = '100%'; 1237 iframe.style.maxHeight = Math.round(parentWidth / proportion).toString() + 'px'; 1238 } 1239 }); 1240 } 1241 1242 // Document ready. 1243 _utility.$doc.ready(function () { 1244 initResponsiveEmbeds(); 1245 }); 1246 1247 // Post load. 1248 _utility.$body.on('post-load', function () { 1249 initResponsiveEmbeds(); 1250 }); 1251 1252 // Document resize. 1253 _utility.$window.on('resize', function () { 1254 initResponsiveEmbeds(); 1255 }); 1256 1257 // Run on initial load. 1258 initResponsiveEmbeds(); 1259})(); /** ---------------------------------------------------------------------------- 1260 * Responsive Embeds */ 1261 1262/***/ }), 1263/* 12 */ 1264/***/ (function(module, exports, __webpack_require__) { 1265 1266"use strict"; 1267 1268 1269var _utility = __webpack_require__(0); 1270 1271var cscoDarkMode = {}; /** ---------------------------------------------------------------------------- 1272 * Color Scheme Toogle */ 1273 1274(function () { 1275 var $this; 1276 1277 cscoDarkMode = { 1278 1279 /** Initialize */ 1280 init: function init(e) { 1281 $this = cscoDarkMode; 1282 1283 // Init events. 1284 $this.events(e); 1285 }, 1286 1287 /** Events */ 1288 events: function events(e) { 1289 if ((0, _utility.$)('body').hasClass('wp-admin')) { 1290 return; 1291 } 1292 1293 // Window Load 1294 window.addEventListener('load', function (e) { 1295 $this.loadMode(e); 1296 }); 1297 1298 // Switch 1299 (0, _utility.$)(document).on('click', '.cs-site-scheme-toggle', function (e) { 1300 $this.changeMode(e); 1301 }); 1302 }, 1303 1304 /** Detect Color Scheme */ 1305 detectColorScheme: function detectColorScheme(color) { 1306 var level = 190; 1307 1308 // Set alpha channel. 1309 var alpha = 1; 1310 1311 var rgba = [255, 255, 255]; 1312 1313 var color_rgba = false; 1314 1315 // Trim color. 1316 color = color.trim(); 1317 1318 // If HEX format. 1319 if ('#' === color[0]) { 1320 // Remove '#' from start. 1321 color = color.replace('#', '').trim(); 1322 1323 if (3 === color.length) { 1324 color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2]; 1325 } 1326 1327 rgba[0] = parseInt(color.substr(0, 2), 16); 1328 rgba[1] = parseInt(color.substr(2, 2), 16); 1329 rgba[2] = parseInt(color.substr(4, 2), 16); 1330 } else if (color_rgba = color.replace(/\s/g, '').match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i)) { 1331 // Convert RGB or RGBA. 1332 rgba[0] = parseInt(color_rgba[1]); 1333 rgba[1] = parseInt(color_rgba[2]); 1334 rgba[2] = parseInt(color_rgba[3]); 1335 1336 if (color_rgba[4] !== undefined) { 1337 alpha = parseFloat(color_rgba[4]); 1338 } 1339 } 1340 1341 // Apply alpha channel. 1342 rgba.forEach(function myFunction(channel, key, stack) { 1343 stack[key] = String(channel + Math.ceil((255 - channel) * (1 - alpha))).padStart(2, '0'); 1344 }); 1345 1346 // Set default scheme. 1347 var scheme = 'default'; 1348 1349 // Get brightness. 1350 var brightness = (rgba[0] * 299 + rgba[1] * 587 + rgba[2] * 114) / 1000; 1351 1352 // If color gray. 1353 if (rgba[0] === rgba[1] && rgba[1] === rgba[2]) { 1354 if (brightness < level) { 1355 scheme = 'dark'; 1356 } 1357 } else { 1358 if (brightness < level) { 1359 scheme = 'inverse'; 1360 } 1361 } 1362 1363 return scheme; 1364 }, 1365 1366 /** Set Individual Scheme */ 1367 setIndividualScheme: function setIndividualScheme() { 1368 var list = { 1369 'body': '--cs-color-site-background', 1370 '.cs-topbar': '--cs-color-topbar-background', 1371 '.cs-header': '--cs-color-header-background', 1372 '.cs-header__nav-inner .sub-menu': '--cs-color-submenu-background', 1373 '.cs-header__multi-column-container': '--cs-color-submenu-background', 1374 '.cs-header__widgets': '--cs-color-submenu-background', 1375 '.cs-offcanvas__header': '--cs-color-header-background', 1376 '.cs-search': '--cs-color-search-background', 1377 '.cs-footer': '--cs-color-footer-background' 1378 }; 1379 1380 for (var key in list) { 1381 if ((0, _utility.$)(key).length <= 0) { 1382 continue; 1383 } 1384 1385 /* jshint ignore:start */ 1386 (0, _utility.$)(key).each(function (index, element) { 1387 var color = window.getComputedStyle((0, _utility.$)(element)[0]).getPropertyValue(list[key]); 1388 1389 var scheme = $this.detectColorScheme(color); 1390 1391 (0, _utility.$)(element).attr('data-scheme', scheme); 1392 }); 1393 /* jshint ignore:end */ 1394 } 1395 }, 1396 1397 /** Load Mode */ 1398 loadMode: function loadMode(e) { 1399
1400 if ('false' === csLocalize.darkMode) { 1401 return; 1402 } 1403 1404 if ('dark' === (0, _utility.csGetCookie)('_color_schema') && 'dark' !== _utility.$body.attr('site-data-scheme')) { 1405 1406 $this.changeScheme('dark', false); 1407 1408 // Detect color scheme on device. 1409 } else if (window.matchMedia && -1 === document.cookie.indexOf('_color_schema=')) { 1410 var systemSchema = 'default'; 1411 1412 if (window.matchMedia('(prefers-color-scheme: dark)').matches) { 1413 systemSchema = 'dark'; 1414 } 1415 1416 (0, _utility.csSetCookie)('_color_system_schema', systemSchema, { expires: 2592000 }); 1417 1418 $this.changeScheme(systemSchema, false); 1419 } 1420 }, 1421 1422 /** Change Mode */ 1423 changeMode: function changeMode(e) { 1424 if ('dark' === _utility.$body.attr('site-data-scheme')) { 1425 $this.changeScheme('default', true); 1426 } else { 1427 $this.changeScheme('dark', true); 1428 } 1429 }, 1430 1431 /** Change Scheme */ 1432 changeScheme: function changeScheme(scheme, cookie) { 1433 _utility.$body.addClass('cs-scheme-toggled'); 1434 1435 _utility.$body.attr('site-data-scheme', scheme); 1436 1437 $this.setIndividualScheme(); 1438 1439 if (cookie) { 1440 (0, _utility.csSetCookie)('_color_schema', scheme, { expires: 2592000 }); 1441 (0, _utility.csSetCookie)('_color_system_schema', null, { expires: 2592000 }); 1442 } 1443 1444 setTimeout(function () { 1445 _utility.$body.removeClass('cs-scheme-toggled'); 1446 }, 100); 1447 } 1448 }; 1449})(); 1450 1451// Initialize. 1452cscoDarkMode.init(); 1453 1454/***/ }), 1455/* 13 */ 1456/***/ (function(module, exports, __webpack_require__) { 1457 1458"use strict"; 1459 1460 1461var _utility = __webpack_require__(0); 1462 1463(function () { 1464 var focusSearchTimeout = void 0; 1465 1466 (0, _utility.$)('.cs-header__search-toggle').click(function (e) { 1467 if (!(0, _utility.$)('.cs-search').is(":visible")) { 1468 focusSearchTimeout = setTimeout(function () { 1469 (0, _utility.$)('.cs-search .cs-search__input').focus(); 1470 }, 300); 1471 } else { 1472 clearTimeout(focusSearchTimeout); 1473 } 1474 (0, _utility.$)('.cs-search').stop().slideToggle(); 1475 e.preventDefault(); 1476 }); 1477 1478 (0, _utility.$)('.cs-search__close').click(function (e) { 1479 (0, _utility.$)('.cs-search').slideUp(); 1480 e.preventDefault(); 1481 clearTimeout(focusSearchTimeout); 1482 }); 1483})(); /** ---------------------------------------------------------------------------- 1484 * Search Dropdown */ 1485 1486/***/ }), 1487/* 14 */ 1488/***/ (function(module, exports, __webpack_require__) { 1489 1490"use strict"; 1491 1492 1493var _utility = __webpack_require__(0); 1494 1495(function () { 1496 var stickyElementsSmart = [], 1497 stickyElements = []; 1498 1499 stickyElementsSmart.push('.cs-navbar-smart-enabled .cs-entry__metabar-inner'); 1500 stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled.cs-stick-to-top .cs-sidebar__inner'); 1501 stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child'); 1502 1503 stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled .cnvs-block-section-sidebar-sticky-top .cnvs-block-section-sidebar-inner'); 1504 stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled .cnvs-block-section-sidebar-sticky-top-last-block .cnvs-block-section-sidebar-inner > :last-child'); 1505 1506 stickyElements.push('.cs-navbar-sticky-enabled .cs-entry__metabar-inner'); 1507 stickyElements.push('.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled.cs-stick-to-top .cs-sidebar__inner'); 1508 stickyElements.push('.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child'); 1509 1510 stickyElements.push('.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled .cnvs-block-section-sidebar-sticky-top .cnvs-block-section-sidebar-inner'); 1511 stickyElements.push('.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled .cnvs-block-section-sidebar-sticky-top-last-block .cnvs-block-section-sidebar-inner > :last-child'); 1512 1513 _utility.$doc.ready(function () { 1514 1515 var headerStick = (0, _utility.$)('.cs-header'), 1516 wpAdminBar = (0, _utility.$)('#wpadminbar'), 1517 headerStickHeight = headerStick.outerHeight(), 1518 wpAdminBarHeight = wpAdminBar.outerHeight(), 1519 headerStretch = (0, _utility.$)('.cs-header-stretch'), 1520 headerStretchHeight = headerStretch.outerHeight(),
1521 allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20, 1522 windowWidth = (0, _utility.$)(window).width(); 1523 1524 // Sticky sidebar for mozilla. 1525 if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { 1526 stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-stick-to-bottom .cs-sidebar__inner'); 1527 stickyElements.push('.cs-sticky-sidebar-enabled.cs-stick-to-bottom .cs-sidebar__inner'); 1528 1529 stickyElementsSmart.push('.cnvs-block-section-sidebar-sticky-bottom .cnvs-block-section-sidebar-inner'); 1530 stickyElements.push('.cnvs-block-section-sidebar-sticky-bottom .cnvs-block-section-sidebar-inner'); 1531 } 1532 1533 // Join elements. 1534 stickyElementsSmart = stickyElementsSmart.join(','); 1535 stickyElements = stickyElements.join(','); 1536 1537 // Sticky nav visible. 1538 _utility.$doc.on('sticky-nav-visible', function () { 1539 1540 headerStickHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')); 1541 1542 if (headerStretchHeight) { 1543 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1544 } else { 1545 allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20; 1546 } 1547 1548 (0, _utility.$)(stickyElementsSmart).css('top', allHeight + 'px'); 1549 }); 1550 1551 // Sticky nav hide. 1552 _utility.$doc.on('sticky-nav-hide', function () { 1553 1554 headerStickHeight = 0; 1555 1556 allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20; 1557 (0, _utility.$)(stickyElementsSmart).css('top', allHeight + 'px'); 1558 }); 1559 1560 _utility.$doc.on('stretch-nav-to-small', function () { 1561 1562 headerStretchHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')); 1563 1564 if (headerStretchHeight) { 1565 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1566 } else { 1567 allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20; 1568 } 1569 1570 if (headerStretch.hasClass("cs-scroll-sticky") && !headerStretch.hasClass("cs-scroll-active")) { 1571 (0, _utility.$)(stickyElementsSmart).css('top', allHeight + 'px'); 1572 } 1573 }); 1574 1575 _utility.$doc.on('stretch-nav-to-big', function () { 1576 1577 headerStretchHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')); 1578 }); 1579 1580 // Add top style 1581 if (_utility.$body.hasClass('cs-navbar-smart-enabled') && windowWidth >= 1020) { 1582 1583 if (headerStretchHeight) { 1584 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1585 } else { 1586 allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20; 1587 } 1588 1589 (0, _utility.$)(stickyElementsSmart).css('top', allHeight + 'px'); 1590 } else if (_utility.$body.hasClass('cs-navbar-sticky-enabled') && windowWidth >= 1020) { 1591 1592 if (headerStretchHeight) { 1593 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1594 } else { 1595 allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20; 1596 } 1597 1598 (0, _utility.$)(stickyElements).css('top', allHeight + 'px'); 1599 } 1600 1601 // Remove top style rafter resize 1602 _utility.$window.resize(function () { 1603 var windowWidthResize = _utility.$window.width(); 1604 1605 if (windowWidthResize < 1020) { 1606 (0, _utility.$)(stickyElements).removeAttr('style'); 1607 (0, _utility.$)(stickyElementsSmart).removeAttr('style'); 1608 } 1609 }); 1610 }); 1611})(); /** ---------------------------------------------------------------------------- 1612 * Sticky Sidebar */ 1613 1614/***/ }), 1615/* 15 */ 1616/***/ (function(module, exports, __webpack_require__) { 1617 1618"use strict"; 1619 1620 1621var _utility = __webpack_require__(0); 1622 1623(function () { 1624 var initAPI = false; 1625 var process = false; 1626 var contex = []; 1627 var players = []; 1628 var attrs = []; 1629 1630 // Create deferred object 1631 var YTdeferred = _utility.$.Deferred(); 1632 window.onYouTubePlayerAPIReady = function () { 1633 // Resolve when youtube callback is called 1634 // passing YT as a parameter. 1635 YTdeferred.resolve(window.YT); 1636 }; 1637 1638 // Embedding youtube iframe api. 1639 function embedYoutubeAPI() { 1640 var tag = document.createElement('script'); 1641 tag.src = 'https://www.youtube.com/iframe_api'; 1642 1643 var firstScriptTag = document.getElementsByTagName('script')[0]; 1644 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 1645 } 1646 1647 // Video rescale.
1648 function rescaleVideoBackground() { 1649 (0, _utility.$)('.cs-video-init').each(function () { 1650 var w = (0, _utility.$)(this).parent().width(); 1651 var h = (0, _utility.$)(this).parent().height(); 1652 1653 var hideControl = 400; 1654 1655 var id = (0, _utility.$)(this).attr('data-uid'); 1656 1657 if (w / h > 16 / 9) { 1658 players[id].setSize(w, w / 16 * 9 + hideControl); 1659 } else { 1660 players[id].setSize(h / 9 * 16, h + hideControl); 1661 } 1662 }); 1663 } 1664 1665 // Init video background. 1666 function initVideoBackground() { 1667 if ((0, _utility.$)('body').hasClass('wp-admin')) { 1668 return; 1669 } 1670 1671 if (process) { 1672 return; 1673 } 1674 1675 process = true; 1676 1677 // Smart init API. 1678 if (!initAPI) { 1679 var elements = (0, _utility.$)('.cs-video-wrapper[data-video-id]'); 1680 1681 if (elements.length) { 1682 embedYoutubeAPI(); 1683 1684 initAPI = true; 1685 } 1686 } 1687 1688 if (!initAPI) { 1689 process = false; 1690 1691 return; 1692 } 1693 1694 // Whenever youtube callback was called = deferred resolved 1695 // your custom function will be executed with YT as an argument. 1696 YTdeferred.done(function (YT) { 1697 (0, _utility.$)('.cs-video-inner').each(function () { 1698 1699 // The state. 1700 var isInit = (0, _utility.$)(this).hasClass('cs-video-init'); 1701 1702 var id = null; 1703 1704 // Generate unique ID. 1705 if (!isInit) { 1706 id = Math.random().toString(36).substr(2, 9); 1707 } else { 1708 id = (0, _utility.$)(this).attr('data-uid'); 1709 } 1710 1711 // Create contex. 1712 contex[id] = this; 1713 1714 // The actived. 1715 var isActive = (0, _utility.$)(contex[id]).hasClass('active'); 1716 1717 // The monitor. 1718 var isInView = (0, _utility.$)(contex[id]).isInViewport(); 1719 1720 // Initialization. 1721 if (isInView && !isInit) { 1722 1723 // Add init class. 1724 (0, _utility.$)(contex[id]).addClass('cs-video-init'); 1725 1726 // Add unique ID. 1727 (0, _utility.$)(contex[id]).attr('data-uid', id); 1728 1729 // Get video attrs. 1730 var videoID = (0, _utility.$)(contex[id]).parent().data('video-id'); 1731 var videoStart = (0, _utility.$)(contex[id]).parent().data('video-start'); 1732 var videoEnd = (0, _utility.$)(contex[id]).parent().data('video-end'); 1733 1734 // Check video id. 1735 if (typeof videoID === 'undefined' || !videoID) { 1736 return; 1737 } 1738 1739 // Video attrs. 1740 attrs[id] = { 1741 'videoId': videoID, 1742 'startSeconds': videoStart, 1743 'endSeconds': videoEnd, 1744 'suggestedQuality': 'hd720' 1745 }; 1746 1747 // Creating a player. 1748 players[id] = new YT.Player(contex[id], { 1749 playerVars: { 1750 autoplay: 0, 1751 autohide: 1, 1752 modestbranding: 1, 1753 rel: 0, 1754 showinfo: 0, 1755 controls: 0, 1756 disablekb: 1, 1757 enablejsapi: 0, 1758 iv_load_policy: 3, 1759 playsinline: 1, 1760 loop: 1 1761 }, 1762 events: { 1763 'onReady': function onReady() { 1764 players[id].loadVideoById(attrs[id]); 1765 players[id].mute(); 1766 }, 1767 'onStateChange': function onStateChange(e) { 1768 if (e.data === 1) { 1769 (0, _utility.$)(contex[id]).parents('.cs-overlay, .cs-video-wrap').addClass('cs-video-bg-init'); 1770 (0, _utility.$)(contex[id]).addClass('active'); 1771 } else if (e.data === 0) { 1772 players[id].seekTo(attrs[id].startSeconds); 1773 } 1774 } 1775 } 1776 }); 1777 rescaleVideoBackground(); 1778 } 1779 1780 // Pause and play. 1781 var control = (0, _utility.$)(contex[id]).parents('.cs-overlay, .cs-video-wrap').find('.cs-player-state'); 1782 1783 if (isActive && isInit && !(0, _utility.$)(control).hasClass('cs-player-upause')) { 1784 1785 if (isInView && (0, _utility.$)(control).hasClass('cs-player-play')) { 1786 // Change icon. 1787 (0, _utility.$)(control).removeClass('cs-player-play').addClass('cs-player-pause'); 1788 // Pause video. 1789 players[id].playVideo(); 1790 } 1791 1792 if (!isInView && (0, _utility.$)(control).hasClass('cs-player-pause')) { 1793 // Change icon. 1794 (0, _utility.$)(control).removeClass('cs-player-pause').addClass('cs-player-play'); 1795 // Pause video. 1796 players[id].pauseVideo(); 1797 } 1798 } 1799 }); 1800 }); 1801 1802 process = false; 1803 } 1804 1805 // State Control. 1806 _utility.$doc.on('click', '.cs-player-state', function () { 1807 var container = (0, _utility.$)(this).parents('.cs-overlay, .cs-video-wrap').find('.cs-video-inner'); 1808 1809 var id = (0, _utility.$)(container).attr('data-uid'); 1810 1811 (0, _utility.$)(this).toggleClass('cs-player-pause cs-player-play'); 1812 1813 if ((0, _utility.$)(this).hasClass('cs-player-pause')) { 1814 (0, _utility.$)(this).removeClass('cs-player-upause'); 1815 players[id].playVideo(); 1816 } else { 1817 (0, _utility.$)(this).addClass('cs-player-upause'); 1818 players[id].pauseVideo(); 1819 } 1820 }); 1821 1822 // Stop Control. 1823 _utility.$doc.on('click', '.cs-player-stop', function () { 1824 var container = (0, _utility.$)(this).parents('.cs-overlay, .cs-video-wrap').find('.cs-video-inner'); 1825 1826 var id = (0, _utility.$)(container).attr('data-uid'); 1827 1828 (0, _utility.$)(this).siblings('.cs-player-state').removeClass('cs-player-pause').addClass('cs-player-play'); 1829 1830 (0, _utility.$)(this).siblings('.cs-player-state').addClass('cs-player-upause'); 1831 1832 players[id].pauseVideo(); 1833 }); 1834 1835 // Volume Control. 1836 _utility.$doc.on('click', '.cs-player-volume', function () { 1837 var container = (0, _utility.$)(this).parents('.cs-overlay, .cs-video-wrap').find('.cs-video-inner'); 1838 1839 var id = (0, _utility.$)(container).attr('data-uid'); 1840 1841 (0, _utility.$)(this).toggleClass('cs-player-mute cs-player-unmute'); 1842 1843 if ((0, _utility.$)(this).hasClass('cs-player-unmute')) { 1844 players[id].unMute(); 1845 } else { 1846 players[id].mute(); 1847 } 1848 }); 1849 1850 // Document scroll. 1851 _utility.$window.on('load scroll resize scrollstop', function () {
1852 initVideoBackground(); 1853 }); 1854 1855 // Document ready. 1856 _utility.$doc.ready(function () { 1857 initVideoBackground(); 1858 }); 1859 1860 // Post load. 1861 _utility.$body.on('post-load', function () { 1862 initVideoBackground(); 1863 }); 1864 1865 // Document resize. 1866 _utility.$window.on('resize', function () { 1867 rescaleVideoBackground(); 1868 }); 1869 1870 // Init. 1871 initVideoBackground(); 1872})(); /** ---------------------------------------------------------------------------- 1873 * Video Background */ 1874 1875/***/ }), 1876/* 16 */ 1877/***/ (function(module, exports, __webpack_require__) { 1878 1879"use strict"; 1880 1881 1882var _utility = __webpack_require__(0); 1883 1884(function () { 1885 _utility.$.fn.responsiveNav = function () { 1886 this.removeClass('menu-item-expanded'); 1887 if (this.prev().hasClass('submenu-visible')) { 1888 this.prev().removeClass('submenu-visible').slideUp(350); 1889 this.parent().removeClass('menu-item-expanded'); 1890 } else { 1891 this.parent().parent().find('.menu-item .sub-menu').removeClass('submenu-visible').slideUp(350); 1892 this.parent().parent().find('.menu-item-expanded').removeClass('menu-item-expanded'); 1893 this.prev().toggleClass('submenu-visible').hide().slideToggle(350); 1894 this.parent().toggleClass('menu-item-expanded'); 1895 } 1896 }; 1897 1898 // 1899 // Navigation Menu Widget 1900 // 1901 (0, _utility.$)(document).ready(function (e) { 1902 (0, _utility.$)('.widget_nav_menu .menu-item-has-children').each(function (e) { 1903 1904 // Add a caret. 1905 (0, _utility.$)(this).append('<span></span>'); 1906 1907 // Fire responsiveNav() when clicking a caret. 1908 (0, _utility.$)('> span', this).on('click', function (e) { 1909 e.preventDefault(); 1910 (0, _utility.$)(this).responsiveNav(); 1911 }); 1912 1913 // Fire responsiveNav() when clicking a parent item with # href attribute. 1914 if ('#' === (0, _utility.$)('> a', this).attr('href')) { 1915 (0, _utility.$)('> a', this).on('click', function (e) { 1916 e.preventDefault(); 1917 (0, _utility.$)(this).next().next().responsiveNav(); 1918 }); 1919 } 1920 }); 1921 }); 1922})(); /** ---------------------------------------------------------------------------- 1923 * Widget Nav Menu */ 1924 1925/***/ }) 1926/******/ ]);
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.