(function ($) { /** * Initialize the Insight Banner Slick Slider * @param {jQuery} $scope - Context (block or document) */ function initInsightBannerWithSlick($scope) { $scope.find('.insight-banner-with-slider-right').each(function () { const $sliderWrapper = $(this); const $slickElement = $sliderWrapper.find('.insight-banner-with-slick-slider'); // Destroy previous slick if needed if ($slickElement.hasClass('slick-initialized')) { try { $slickElement.slick('unslick'); } catch (e) { console.warn('[ACF] Unslick failed:', e); } } // Read attributes const showArrows = $sliderWrapper.data('arrows-visiblity') === 'yes'; const autoPlay = $sliderWrapper.data('auto-rotating') === 'yes'; // Initialize Slick $slickElement.slick({ slidesToShow: 1, slidesToScroll: 1, arrows: showArrows, dots: false, infinite: true, autoplay: autoPlay, autoplaySpeed: 6000, pauseOnHover: true, pauseOnFocus: true, adaptiveHeight: true, prevArrow: $sliderWrapper.find('.prevarrow'), nextArrow: $sliderWrapper.find('.nextarrow'), responsive: [ { breakpoint: 992, // below 992px (tablet + mobile) settings: { centerMode: true, arrows: false, dots: true, } }, { breakpoint: 768, // below 768px (mobile) settings: { centerMode: true, arrows: false, dots: true, } }, { breakpoint: 480, // smaller mobile settings: { centerMode: true, arrows: false, dots: true, } } ] }); $slickElement.on('init', function(){ $(this).find('iframe[loading="eager"]').each(function(){ this.src = this.src; // force reload once slider is ready }); }) // Handle Vimeo/YouTube & HTML5 videos $slickElement.on('beforeChange', function (event, slick, currentSlide) { const $currentSlide = $(slick.$slides[currentSlide]); const $iframe = $currentSlide.find('iframe'); const $video = $currentSlide.find('video'); if ($iframe.length) { const src = $iframe.attr('src'); $iframe.attr('src', src); // reload iframe to stop playback } if ($video.length) { $video.get(0).pause(); } }); $slickElement.on('afterChange', function (event, slick, currentSlide) { const $video = $(slick.$slides[currentSlide]).find('video'); if ($video.length) $video.get(0).play(); }); }); } /** * Gutenberg / ACF block editor integration */ if (window.acf) { // Render block preview for the Insight Banner block acf.addAction('render_block_preview/type=insight-banner-with-slider', function ($block) { const $slider = $block.find('.insight-banner-with-slick-slider'); // Destroy slick safely if it already exists if ($slider.length && $slider.hasClass('slick-initialized')) { try { $slider.slick('unslick'); } catch (e) { console.warn('[ACF] Unslick before render failed:', e); } } // Delay init slightly for DOM stability setTimeout(() => { initInsightBannerWithSlick($block); // Fade-in + show arrows (optional, for nice editor preview UX) $block.find('.insight-banner-with-slider-wrapper').css({ visibility: 'visible', opacity: 1, transition: 'opacity 1s ease', }); }, 500); }); // When user changes repeater/relationship fields that affect the block, re-render preview acf.addAction('change', function ($el) { if ($el.closest('[data-key="acf_ibcs_all_slider_slides"]').length) { const $block = $el.closest('.block-editor-block-preview'); if ($block.length) { acf.doAction('render_block_preview/type=insight-banner-slider', $block); } } }); } // Initialize on frontend (outside editor) $(document).ready(function () { jQuery('.insight-banner-with-slider-wrapper').fadeOut(0); initInsightBannerWithSlick($(document)); jQuery('.insight-banner-with-slider-wrapper').fadeIn(500, function () { var $this = jQuery(this); $this.css({ visibility: 'visible', opacity: 1, transition: 'opacity 2s ease', }); }); if (jQuery('.insight-banner-with-slick-slider').hasClass('slick-initialized')) { jQuery('.insight-banner-with-slider-arrows').css({ visibility: 'visible', opacity: 1, transition: 'opacity 2s ease' }); } jQuery('.insight-banner-with-slick-slider').on('init', function () { jQuery('.insight-banner-with-slider-arrows').css({ visibility: 'visible', opacity: 1, transition: 'opacity 2s ease' }); }); }); })(jQuery); jQuery(document).ready(function ($) { // Check if we're NOT in the WordPress block editor (Gutenberg) if (typeof wp !== 'undefined' && wp.data) { var isGutenberg = wp.data.select('core/edit-post') !== undefined; if (isGutenberg) { return; // Exit if inside block editor } } // Front-end click handler jQuery(document).on('click', '.insight-banner-with-slick-slide.insight', function () { var url = jQuery(this).data('url'); if (url && isValidInnerPagesCarouselSliderMediaUrl(url)) { window.open(url, '_self'); } }); function isValidInnerPagesCarouselSliderMediaUrl(url) { return /^https?:\/\//i.test(url); } });; !function(t){"use strict";var e=[];function r(){t(".casestudy-slider__inner").each(function(r){let a=t(this).find(".casestudy-slider__slide-main"),s=a.attr("data-slide-autoplay")||!0,i=a.attr("data-slide-arrows")||!1,d=a.attr("data-slide-dots")||!0;a.attr("data-slide-desktop"),a.attr("data-slide-tablet"),a.attr("data-slide-mobile");var n=!!t("body").hasClass("rtl");let o={autoplay:"true"===s,autoplaySpeed:8e3,pauseOnHover:"true"===s,dots:"true"===d,infinite:!0,arrows:"true"===i,slidesToShow:1,slidesToScroll:1,swipeToSlide:!0,focusOnSelect:!0,adaptiveHeight:!0,centerMode:!0,prevArrow:t(this).find(".prevarrow"),nextArrow:t(this).find(".nextarrow"),rtl:n};e[r]?e[r].slick("refresh"):e[r]=a.slick(o)})}t(document).ready(function(){r(),t(window).on("resize",function(){t(".sutherland-front-side").length>0&&r()})}),t(document).on("click",".casestudy-slider__content",function(){var e=t(this).data("url");e&&function(t){return/^https?:\/\//i.test(t)}(e)&&window.open(e,"_self")})}(jQuery);; jQuery(document).ready(function(){jQuery(".accordion-inner-sections .accordion-header").on("click",function(){jQuery(this).parents(".accordion-inners").find(".accordion-inner-sections .accordion-content").not(jQuery(this).next(".accordion-inner-sections .accordion-content")).slideUp(),jQuery(this).parents(".accordion-inners").find(".accordion-inner-sections .accordion-header").not(jQuery(this)).removeClass("active"),jQuery(this).next(".accordion-inner-sections .accordion-content").slideToggle(),jQuery(this).parents(".accordion-inner-sections").toggleClass("active"),jQuery(this).toggleClass("active")})});; !function(t){"use strict";function e(){jQuery(".our-differentiators-colums:not('.no-accordian') .accordian-text-descriptions").hide()}window.matchMedia("(max-width: 1024px)").matches&&jQuery(document).ready(e),jQuery(".our-differentiators-colums:not('.no-accordian') .accordian-text-title").on("click",function(){window.matchMedia("(max-width: 1024px)").matches&&(jQuery(this).next(".accordian-text-descriptions").slideToggle(),jQuery(this).toggleClass("active"))});var i=t(window).outerWidth();jQuery(window).on("resize",function(){var o=t(window).outerWidth();o!=i&&(o<1024?(jQuery(document).ready(e),jQuery(".accordian-text-title").hasClass("active")&&jQuery(".accordian-text-title").removeClass("active")):(jQuery(".our-differentiators-colums:not('.no-accordian') .accordian-text-descriptions").show(),jQuery(".our-differentiators-colums:not('.no-accordian') .accordian-text-descriptions").show()))})}(jQuery);; !function(){"use strict";document.addEventListener("DOMContentLoaded",function(){const e=document.querySelector(".wp-block-sutherland-featured-cta");if("IntersectionObserver"in window){let n=new IntersectionObserver(function(t){t.forEach(function(t){t.isIntersecting&&(e.classList.add("bg-loaded"),n.unobserve(e))})});n.observe(e)}else e.classList.add("bg-loaded")})}(jQuery);; !function(e){"use strict";var t=[];function r(){e(".insight-slider__inner").each(function(r){let i=e(this).find(".insight-slider__slide-main"),s=i.attr("data-slide-autoplay")||!0,o=i.attr("data-slide-arrows")||!0,n=i.attr("data-slide-dots")||!0;var a=!!e("body").hasClass("rtl");let d={autoplay:"true"===s,autoplaySpeed:7e3,pauseOnHover:"true"===s||!0===s,dots:"true"===n||!0===n,infinite:!0,arrows:"true"===o||!0===o,slidesToShow:2,slidesToScroll:1,swipeToSlide:!0,focusOnSelect:!0,centerMode:!0,prevArrow:e(this).find(".prevarrow"),nextArrow:e(this).find(".nextarrow"),rtl:a,responsive:[{breakpoint:1599,settings:{slidesToShow:1}}]};t[r]?t[r].slick("refresh"):t[r]=i.slick(d)})}e(document).ready(function(){document.querySelectorAll(".insights-block-wapper").forEach(function(e){e.removeAttribute("aria-describedby")}),r(),e(window).on("resize",function(){e(".sutherland-front-side").length>0&&r()})})}(jQuery);; !function(){"use strict";jQuery(document).ready(function(){var e=setInterval(function(){if(!jQuery("form.mktoForm").hasClass("mb-mk-loaded")&&void 0!==window.MktoForms2&&void 0!==window.loadMarketoForm){clearInterval(e);let o=jQuery("form.mktoForm").attr("data-munchkin"),t=jQuery("form.mktoForm").attr("data-formid");window.loadMarketoForm(o,t)}},500)}),document.addEventListener("DOMContentLoaded",function(){const e=document.querySelector(".wp-block-sutherland-contactus-form .marketo-form__column"),o=e.style.backgroundImage;if(e.style.backgroundImage="none","IntersectionObserver"in window){let t=new IntersectionObserver(function(n){n.forEach(function(n){n.isIntersecting&&(e.style.backgroundImage=o,t.unobserve(e))})});t.observe(e)}else e.style.backgroundImage=o})}(jQuery);;