class ApbctCore{ajax_parameters={};restParameters={};selector=null;elements=[];eventCallback;eventSelector;event;constructor(e){this.select(e)}select(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"==typeof e?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}addElement(e){"object"==typeof e?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}push(e){this.elements.push(e)}reduce(){this.elements=this.elements.slice(0,-1)}deselect(){this.elements=[]}css(t,o){if(o=o||!1,"object"==typeof t){for(const c in t)if(Object.hasOwn(t,c)){var n=c.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""));for(let e=0;eMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){var t={};for(let e=0;e{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((e,t)=>{e.addEventListener("paste",()=>{this.data[t].isUseBuffer=!0})}),this.fields.forEach((e,t)=>{e.addEventListener("onautocomplete",()=>{this.data[t].isAutoFill=!0})}),this.fields.forEach((e,o)=>{e.addEventListener("input",()=>{this.data[o].countOfKey++;var e,t=+new Date;1===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].firstKeyTimestamp=t):(e=t-this.data[o].lastKeyTimestamp,2===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].lastDelta=e):2{apbctLocalStorage.set(e,t)})}function apbctPrepareBlockForAjaxForms(){function n(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{ctParseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}"undefined"!=typeof jQuery&&("function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}))}function apbct_ready(){apbctPrepareBlockForAjaxForms(),ctPreloadLocalStorage(),apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=apbctGenerateUniqueID(),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1)),apbctWriteReferrersToSessionStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),"alternative"!==ctPublic.data__cookies_type&&(ctStartFieldsListening(),setTimeout(ctStartFieldsListening,1e3)),window.addEventListener("animationstart",apbctOnAnimationStart,!0),window.addEventListener("input",apbctOnInput,!0),document.ctTypoData=new CTTypoData,document.ctTypoData.gatheringFields(),document.ctTypoData.setListeners(),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ctDate.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ctDate.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(let e=0;e{window.XMLHttpRequest.prototype.send=defaultSend},0)}),e.target.onsubmit_prev instanceof Function&&!ctOnsubmitPrevCallExclude(e.target)&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);var n=document.querySelectorAll("[data-original-string]");if((ctPublic.encodedEmailNodes=n).length)for(let e=0;ectSearchFormOnSubmitHandler(e,c))}function ctAjaxSetupAddCleanTalkDataBeforeSendAjax(){"undefined"!=typeof jQuery&&jQuery.ajaxSetup({beforeSend:function(e,t){let o=!1;var n;"string"==typeof t.data&&(-1!==t.data.indexOf("twt_cc_signup")&&(o="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(o="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(o="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(o="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment"))&&(o="action=new_activity_comment"),(o="string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")?"wc-ajax=add_to_cart":o)&&(n=getNoCookieData(),t.data=(n="data%5Bct_no_cookie_hidden_field%5D="+n+"&")+t.data)}})}function ctOnsubmitPrevCallExclude(e){return!!e.classList.contains("hb-booking-search-form")}function ctSearchFormOnSubmitHandler(n,c){try{var a=c.querySelector('[name="ct_no_cookie_hidden_field"]');const r=c.querySelector('[id*="apbct__email_id__"]'),s=c.querySelector('[name*="ct_bot_detector_event_token"]');let t=null,o=null;if(null!==r&&null!==r.value&&null!==r.getAttribute("apbct_event_id")&&(t=r.value,o=r.getAttribute("apbct_event_id")),"alternative"!==ctPublic.data__cookies_type&&"native"!==ctPublic.data__cookies_type||null!==s&&s.parentNode.removeChild(s),null!==a||null!==r){n.preventDefault();var i=()=>{var e;null!==r&&r.parentNode.removeChild(r),null!==s&&s.parentNode.removeChild(s),c.apbctSearchPrevOnsubmit instanceof Function?c.apbctSearchPrevOnsubmit():(null!==(e=c.querySelector('[name="ct_no_cookie_hidden_field"]'))&&e.parentNode.removeChild(e),HTMLFormElement.prototype.submit.call(c))};let e="{}";null!==a&&(e=atob(a.value.replace("_ct_no_cookie_data_","")));var l=JSON.parse(e);null!==t&&null!==o&&(l.apbct_search_form__honeypot_value=t,l.apbct_search_form__honeypot_id=o),"string"==typeof l.apbct_pixel_url&&-1!==l.apbct_pixel_url.indexOf("%3A")&&(l.apbct_pixel_url=decodeURIComponent(l.apbct_pixel_url)),0!==(e=JSON.stringify(l)).length?ctSetAlternativeCookie(e,{callback:i,onErrorCallback:i,forceAltCookies:!0}):i()}}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler);ctPublic.encodedEmailNodesIsMixed=!1,document.body.classList.add("apbct-popup-fade");var t,o=document.getElementById("apbct_popup");o?(o.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctPublic.wl_brandname+" is decoding the email addresses."):((o=document.createElement("div")).setAttribute("class","apbct-popup"),o.setAttribute("id","apbct_popup"),(t=document.createElement("p")).setAttribute("id","apbct_popup_text"),t.style.color="black",t.innerText="Please wait while "+ctPublic.wl_brandname+" is decoding the email addresses.",o.append(t),document.body.append(o)),apbctAjaxEmailDecodeBulk(e,ctPublic.encodedEmailNodes,this)}function apbctAjaxEmailDecodeBulk(t,o,n){var e={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer,encodedEmails:""},c={};for(let e=0;e{e.encoded_email===a[o].dataset.originalString&&(t=e)}),!1===t.is_allowed)break;var e,n;void 0!==a[o].href&&0===a[o].href.indexOf("mailto:")?(e=a[o].href.replace("mailto:",""),n=a[o].innerHTML,a[o].innerHTML=n.replace(e,t.decoded_email),a[o].href="http://mdae-technology.azurewebsites.net/?page=mailto:"+t.decoded_email):ctProcessDecodedDataResult(t,a[o]),a[o].removeEventListener("click",ctFillDecodedEmailHandler)}var t=document.getElementById("apbct_popup");null!==t&&(document.body.classList.remove("apbct-popup-fade"),t.setAttribute("style","display:none"),ctPublic.encodedEmailNodesIsMixed)&&o.click()},3e3):c.success?(resetEncodedNodes(),ctShowDecodeComment("Blocked: "+c.data[0].comment)):(resetEncodedNodes(),ctShowDecodeComment("Cannot connect with CleanTalk server: "+c.data[0].comment))}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(t=[]){let o={};o.apbct_headless=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),o.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),o.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),o.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),o.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),o.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),o.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),o.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var e=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),a=apbctLocalStorage.get("apbct_page_hits"),i=apbctSessionStorage.get("apbct_prev_referer"),l=apbctSessionStorage.get("apbct_site_referer"),r=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_js_errors"),s=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),d=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),u=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),p=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),m=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url");if(o.ct_mouse_moved=void 0!==e?e:d,o.ct_has_scrolled=void 0!==n?n:u,o.ct_cookies_type=void 0!==c?c:p,o.apbct_pixel_url=void 0!==s?s:m,o.apbct_page_hits=a,o.apbct_prev_referer=i,o.apbct_site_referer=l,o.apbct_ct_js_errors=r,o.apbct_pixel_url||(o.apbct_pixel_url=ctPublic.pixel__url),"object"==typeof t&&t!==[])for(let e=0;e)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";let t=document.getElementById("apbct_popup");var o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){let t=[],n="",c=0,a="",i=0,o=[];for(var l in e.elements)isNaN(+l)||(t[l]=e.elements[l]);return(t=t.filter(function(e){return-1===o.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(o.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),c++):(a+=" "+e.getAttribute("name"),i++))}),a=a.trim(),{visible_fields:n=n.trim(),visible_fields_count:c,invisible_fields:a,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10$1')):(c.innerHTML="Loading...",this.load("get_options_template")),c.setAttribute("id","cleantalk-modal-content"),t.append(c),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(let e=0;e{o.forEach(e=>{t.outerHTML===e.outerHTML&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})})}function ctProtectOutsideIframe(){var e=document.querySelectorAll("iframe");0{e.parentNode.style.color="white",e.parentNode.innerHTML+=t.apbct.comment}),document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.remove()}))}})}},e.parentNode.style.position="relative",e.parentNode.appendChild(t);let o=apbctLocalStorage.get("apbct_iframes_protected");!1===o&&(o=[]),void 0!==e.id&&(o.push(e.id),apbctLocalStorage.set("apbct_iframes_protected",o))}function catchNextendSocialLoginForm(){var e=document.getElementById("nsl-custom-login-form-main");e&&blockBtnNextendSocialLogin(e)}function blockBtnNextendSocialLogin(e){var t=e.querySelectorAll(".nsl-container-buttons a"),e=e.querySelectorAll('a[data-plugin="nsl"] .nsl-button');t.forEach(e=>{e.setAttribute("data-oauth-login-blocked","true"),e.addEventListener("click",e=>{e.preventDefault()})}),e.forEach(t=>{t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),ctCheckAjax(t)})})}function allowAjaxNextendSocialLogin(e){e.parentElement.setAttribute("data-oauth-login-blocked","false"),e.parentElement.click()}function forbiddenAjaxNextendSocialLogin(e,t){var o,e=e.parentElement;"false"==e.getAttribute("data-oauth-login-blocked")&&e.setAttribute("data-oauth-login-blocked","true"),document.querySelector(".ct-forbidden-msg")||((o=document.createElement("div")).className="ct-forbidden-msg",o.style.background="red",o.style.color="white",o.style.padding="5px",o.innerHTML=t,e.insertAdjacentElement("beforebegin",o))}function ctCheckAjax(t){apbct_public_sendAJAX({action:"cleantalk_nsl_ajax_check",ct_no_cookie_hidden_field:document.getElementsByName("ct_no_cookie_hidden_field")[0].value},{async:!1,callback:function(e){!1===e.apbct.blocked?allowAjaxNextendSocialLogin(t):forbiddenAjaxNextendSocialLogin(t,e.apbct.comment)}})}function isIntegratedForm(e){var t="string"==typeof e.action?e.action:"",o=null!==e.getAttribute("id")?e.getAttribute("id"):"";return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_")||-1!==o.indexOf("ihf-contact-request-form")||-1!==t.indexOf("crm.zoho.com")||-1!==o.indexOf("delivra-external-form")||e.hasAttribute("data-hs-cf-bound"))}function sendAjaxCheckingFormData(s){var e={};e[0]=apbct_collect_visible_fields(s),apbct_visible_fields_set_cookie(e);const o={ct_bot_detector_event_token:apbctLocalStorage.get("bot_detector_event_token")};e=s.elements;(e=Array.prototype.slice.call(e)).forEach(function(e,t){""===e.name?o["input_"+t]=e.value:o[e.name]=e.value}),apbct_public_sendAJAX(o,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){if(void 0!==s.dataset.mailingListId){let e=s.querySelector('[type="submit"]');return e.remove(),s.apbctParent.appendChild(s.submitButtonOriginal),void(e=s.querySelector('[type="submit"]')).click()}if(s.hasAttribute("action")&&-1!==s.getAttribute("action").indexOf("webto.salesforce.com")){let e=s.querySelector('[type="submit"]');return e.remove(),s.apbctParent.appendChild(s.submitButtonOriginal),s.onsubmit=s.onsubmitOriginal,void(e=s.querySelector('[type="submit"]')).click()}var c=s,a=(s.parentElement.removeChild(s),s.apbctPrev),i=s.apbctFormOriginal;let e=!1;apbctReplaceInputsValuesFromOtherForm(c,i),-1!==i.id.indexOf("mautic")&&(e=!0),a.after(i);for(const l of i.querySelectorAll('input[name="apbct_visible_fields"]'))l.remove();for(const r of i.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))r.remove();let t=i.querySelectorAll("button[type=submit]");if(0!==t.length)return t[0].click(),void(e&&setTimeout(function(){ctProtectExternal()},1500));if(0!==(t=i.querySelectorAll("input[type=submit]")).length)return void t[0].click();if(0!==(t=i.querySelectorAll('button[data-element="submit"]')).length)return void t[0].click();0!==(t=i.querySelectorAll('input[type="image"][name="submit"]')).length&&t[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function catchDynamicRenderedForm(){catchDynamicRenderedFormHandler(document.getElementsByTagName("form"));var t=document.getElementsByTagName("iframe");if(0e.selected).map(e=>e.value):"checkbox"===e.type||"radio"===e.type?e.checked||null:e.value}function ctCheckInternal(t){var e={},o=t.elements;let n;for(n in o)"submit"!==o[n].type&&void 0!==o[n].value&&""!==o[n].value&&(e[o[n].name]=t.elements[n].value);e.action="ct_check_internal",apbct_public_sendAJAX(e,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctCheckInternalIsExcludedForm(t){return["wp-login.php","wp-comments-post.php"].some(e=>null!==t.match(new RegExp(ctPublic.blog_home+".*"+e)))}document.addEventListener("DOMContentLoaded",function(){let o="",n="";+ctPublic.settings__forms__check_internal&&setTimeout(()=>{for(let e=0;e