"use strict";function smoothScrollingTo(targetHash,timeSpeed=1000,repeat=1){if(typeof jQuery!=="function"){window.addEventListener("load",function(){smoothScrollingTo(targetHash,timeSpeed,repeat)});return!1}
const styles=getComputedStyle(document.documentElement);let smoothScrollMax=repeat;let offsetScroll=0;const heightHeader=Number(styles.getPropertyValue("--height-header").replace(/px$/,"")||0);const heightAdminbar=Number(styles.getPropertyValue("--height-wpadminbar").replace(/px$/,"")||0);if(targetHash!==""&&jQuery(`#${targetHash}`)[0]){offsetScroll=jQuery(`#${targetHash}`).offset().top-heightAdminbar-heightHeader-20}
jQuery("html,body").animate({scrollTop:offsetScroll,},timeSpeed,function(){let offsetScrollAfter=0;if(targetHash!==""&&jQuery(`#${targetHash}`)[0]){offsetScrollAfter=jQuery(`#${targetHash}`).offset().top-heightAdminbar-heightHeader-20}
if(offsetScroll!==offsetScrollAfter&&smoothScrollMax>0){smoothScrollingTo(targetHash,500,smoothScrollMax);smoothScrollMax--;return!1}})}(function($){$(document).ready(function(){const hash2Prevent=[];if(history.scrollRestoration){history.scrollRestoration="manual"}
setTimeout(function(){window.scrollTo(0,0)},1);function activeCtaHash(hash){const activeCtaClass="cta-hash--active";$("a[href*='#']").removeClass(activeCtaClass);$("a[href*='#']").each(function(){const $this=$(this);const thisHash=$this.attr("href").split("#")[1];if(thisHash===hash){$this.addClass(activeCtaClass)}})}
function actionHash(){if(location.href.indexOf("#")!=-1){const currentHash=location.hash.split("#")[1];if(!hash2Prevent.includes(currentHash)){activeCtaHash(currentHash)}}}
if(location.href.indexOf("#")!=-1){const currentHash=location.hash.split("#")[1];if(!hash2Prevent.includes(currentHash)){setTimeout(function(){smoothScrollingTo(currentHash)},2)}
actionHash()}
function isWpBakeryElement(element){if($(element).closest(".vc_tta-tabs").length>0)return!0;if($(element).closest(".vc_tta-accordion").length>0)return!0;return!1}
$(".site a[href*='#']").on("click",function(e){const currentHash=$(this).attr("href").split("#")[1];if(!hash2Prevent.includes(currentHash)&&!isWpBakeryElement(this)){smoothScrollingTo(currentHash)}});$(window).on("hashchange",function(){actionHash()})})})(jQuery)