let addScript=!1;function getCookie(e,t){const n=e+"=",i=decodeURIComponent(document.cookie).split(";");for(let e=0;e<i.length;e++){let t=i[e].trim();if(0===t.indexOf(n))return t.substring(n.length,t.length)}return t}function setCookie(e,t,n){const i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3);const o="expires="+i.toUTCString();document.cookie=e+"="+t+"; "+o+"; path=/"}function loadScript(e){if(addScript)return;let t=document.createElement("script");return t.src=e,t.className="phone-script",document.body.appendChild(t),new Promise(((e,n)=>{t.onload=function(){e()},t.onerror=function(){n()}}))}function initPhone(){let e=document.head.querySelector("[name~=isoCode][content]").content,t=document.getElementsByName("phone"),n=document.getElementsByName("area_code"),i=document.getElementsByClassName("iti");for(var o=0;o<t.length;o++){let s=intlTelInput(t[o],{initialCountry:e});i[o].style.width="100%",n[o].value="+"+s.getSelectedCountryData().dialCode,t[o].addEventListener("countrychange",(function(e){var t=window.intlTelInputGlobals.getInstance(this);$(this).closest("form").find(".area_code").val("+"+t.getSelectedCountryData().dialCode)}))}addScript=!0}$((function(){var e=1===parseInt(getCookie("show-risk",1));$(".dialog-modal-check").prop("checked",e),$(".dialog-modal-check").on("change",(function(e){var t=$(e.target).closest("html");t&&t.data("preview")||setCookie("show-risk",this.checked?1:0,365)}))})),setTimeout((function(){loadScript("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.8/js/intlTelInput.min.js").then((()=>{loadScript("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.8/js/utils.js").then((()=>{initPhone()})).catch((e=>{console.error("Script utils.js loading failed! Handle this error")}))})).catch((e=>{console.error("Script intlTelInput.min.js loading failed! Handle this error")}));var e=document.createElement("link");e.rel="stylesheet",e.href="data:text/css,"+escape("@import url('https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.8/css/intlTelInput.css');"),document.getElementsByTagName("head")[0].appendChild(e)}),800),$(".js-contact-form").submit((function(e){e.preventDefault(),$("#openModalLoading").addClass("open"),console.log("js-contact-form");let t=$(this),n=t.find("button").text();t.find("button").text("SENDING...");var i=t,o="    <p>Name: "+t.find("#name").val()+"</p>    <p>Email: "+t.find("#email").val()+"</p>    <p>Messagee: "+t.find("#message").val()+"</p>    ";$.ajax({url:"/send",method:"POST",data:{message:o,name:t.find("#name").val(),email:t.find("#email").val()},success:function(e){setTimeout((function(){"success"==e&&($("#exampleModal").addClass("open"),i[0].reset()),$("#openModalLoading").removeClass("open"),i.find("button").text(n)}),1200)},error:function(e){setTimeout((function(){$("#openModalLoading").removeClass("open"),i.find("button").text(n)}),1200)}})})),$('[data-dismiss="modal"]').on("click",(function(e){$(this).closest(".modal").removeClass("open")})),$(".header-hamburger").on("click",(function(){$(this).toggleClass("active"),$(this).closest(".header").find(".header-menu").slideToggle(300)})),jQuery(document).ready((function(e){e(".education-item-title").on("click",(function(){e(".education-item").removeClass("active"),e(this).closest(".education-item").addClass("active")})),e(".learn-list-title").on("click",(function(){e(".learn-list-title, .learn-list-content-item").removeClass("active"),e(this).addClass("active"),e(".learn-list-content-item").eq(e(this).index()).addClass("active")})),e(".assets-title").on("click",(function(){e(".assets-title, .assets-content-item").removeClass("active"),e(this).addClass("active"),e(".assets-content-item").eq(e(this).index()).addClass("active")})),e(".metrics-item-title").on("click",(function(){e(this).closest(".metrics-item").toggleClass("active")})),e(".faq-item-title").on("click",(function(){e(this).closest(".faq-item").toggleClass("active")}))}));
