(()=>{"use strict";function e(e,t){for(;e;){if(t&&e.tagName?.toLowerCase()===t.toLowerCase())return!0;e=e.parentElement}return!1}class t{observer=null;abandonedEvents=["beforeunload"];constructor(){this.init(),this.initTracking(),this.observeDynamicForms()}getFormIdAndPosId(e){if(!e)return{formId:"",postId:""};const t=document.body.className.match(/page-id-(\d+)/)?.[1]||this.getPostId(e);return{formId:this.getFormId(e)?this.idPrefix+this.getFormId(e):"",postId:t}}observeDynamicForms(){this.observer=new MutationObserver((e=>{e.forEach((e=>{"childList"===e.type&&e.addedNodes.length>0&&e.addedNodes.forEach((e=>{e instanceof Element&&this.handleNewForm(e)}))}))})),this.observer.observe(document.body,{childList:!0,subtree:!0})}handleNewForm(e){const t=this.formSelectors.join(","),r=new Set;e.matches(t)&&r.add(e),e.querySelectorAll(t).forEach((e=>r.add(e))),r.forEach((e=>{this.trackViewedForms(e),this.trackAbandonedForms(e)}))}initTracking(){const e=this.formSelectors.join(","),t=new Set;document.querySelectorAll(e).forEach((e=>t.add(e))),t.forEach((e=>{this.trackViewedForms(e),this.trackAbandonedForms(e)}))}trackViewedForms(e){const t=new IntersectionObserver((r=>{r.forEach((async r=>{if(r.isIntersecting&&r.intersectionRatio>=this.viewedThreshold){const o=this.prepareFormData(e,this.viewedAction);if(o.has("form_id")){const e=await fetch(this.ajaxUrl,{method:"POST",body:o});!e.ok&&this.debugOn&&console.error("Error tracking form view:",e.statusText)}t.unobserve(r.target)}}))}),{threshold:[this.viewedThreshold]});t.observe(e)}trackAbandonedForms(e){let t=!1,r=!1;e.querySelectorAll("input, textarea").forEach((e=>{e.addEventListener("focus",(()=>t=!0))})),e.addEventListener("submit",(()=>r=!0)),this.abandonedEvents.forEach((o=>{window.addEventListener(o,(async()=>{if(t&&!r){const t=this.prepareFormData(e,this.abandonedAction);if(t.has("form_id")){const e=await fetch(this.ajaxUrl,{method:"POST",body:t});!e.ok&&this.debugOn&&console.error("Error tracking abandoned form:",e.statusText)}}}))}))}prepareFormData(t,r){const o=new FormData,{formId:n,postId:s}=this.getFormIdAndPosId(t);return n&&(o.append("action",r),o.append("nonce",this.nonce),o.append("form_id",n),o.append("page_id",s),o.append("location",function(t){return e(t,"header")?"header":e(t,"footer")?"footer":function(e){const t=["header","footer","popup"];for(;e;){const r=e.getAttribute("data-elementor-type");if(t.includes(r))return r;e=e.parentElement}return"page"}(t)}(t))),o}}class r extends t{init(){this.formSelectors=eSendElementorFormsSettings.formSelectors,this.ajaxUrl=eSendElementorFormsSettings.ajaxUrl,this.nonce=eSendElementorFormsSettings.nonce,this.viewedThreshold=eSendElementorFormsSettings.viewedThreshold,this.viewedAction=eSendElementorFormsSettings.viewedAction,this.abandonedAction=eSendElementorFormsSettings.abandonedAction,this.debugOn=eSendElementorFormsSettings.debugOn,this.idPrefix=eSendElementorFormsSettings.idPrefix,this.abandonedEvents=["elementor/popup/hide",...this.abandonedEvents]}getFormId(e){return e.querySelector('input[name="form_id"]')?.getAttribute("value")||(e.classList.contains("elementor-login")?"login":"")}getPostId(e){const t=e.querySelector('input[name="queried_id"]')?.getAttribute("value");return t||e.querySelector('input[name="post_id"]')?.getAttribute("value")||""}prepareFormData(e,t){const r=super.prepareFormData(e,t);return r.append("template_id",e.querySelector('input[name="post_id"]')?.getAttribute("value")||""),r}}window.addEventListener("elementor/frontend/init",(()=>{new r}))})();
!function(d,l){"use strict";l.querySelector&&d.addEventListener&&"undefined"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute("style"),"height"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):"link"===t.message&&(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document);
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var mousemoveStart=null;
var mousemoves=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_timestamp_array_for_request(keypresses);
var ak_bmc=prepare_timestamp_array_for_request(mouseclicks);
var ak_bte=prepare_timestamp_array_for_request(touchEvents);
var ak_bmm=prepare_timestamp_array_for_request(mousemoves);
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix')){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns)){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key)){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key)){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=(new Date()).getTime();
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_timestamp_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit));
for(var i=0; i < limit&&i < a.length; i++){
rv +=a[ random_starting_point + i ][0];
if(a[ random_starting_point + i ].length >=2){
rv +="," + a[ random_starting_point + i ][1];
}
rv +=";";
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();