!function(e,t){"use strict";ElementsKit_Helper.registerWidget("elementskit-whatsapp.default",(function(e){const t=e.find(".elementskit-whatsapp__popup--btn"),n=e.find(".elementskit-whatsapp__input--field"),i=e.find(".elementskit-whatsapp__input--btn"),o=i.attr("href"),l=i.attr("target"),d=e.find(".elementskit-whatsapp__input--button"),s=e.find(".elementskit-whatsapp__content"),a=e.find(".elementskit-whatsapp__header--close"),p=e.find(".ekit-whatsapp-loader"),w="elementskit-whatsapp__active",c=()=>{setTimeout((()=>{p.remove(),e.find(".elementskit-whatsapp__chat--title").fadeIn()}),3e3)},r=()=>{let e=n.val(),t=o.replace(/text=/g,`text=${e}`);i.attr("href",t)},h=({url:e,title:t,w:n,h:i})=>{const o=window.screenLeft!==undefined?window.screenLeft:window.screenX,l=window.screenTop!==undefined?window.screenTop:window.screenY,d=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,s=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=d/window.screen.availWidth,p=(d-n)/2/a+o,w=(s-i)/2/a+l;window.open(e,t,`scrollbars=yes, width=${n/a}, height=${i/a}, top=${w}, left=${p}`)};"show"==s.data("show")&&(s.addClass(w),p.length>0&&c()),t.click((function(){s.toggleClass(w),p.length>0&&c()})),a.click((function(){s.removeClass(w)})),i.on("click",(function(){r(),"popup"==l&&h({url:o,title:"popup",w:700,h:600}),n.val("")})),n.keypress((function(e){13==e.which&&(r(),"_self"==l?window.location.assign(o):"_blank"==l?window.open(o):h({url:o,title:"popup",w:700,h:600}),n.val(""))})),d.length>0&&"popup"==d.attr("target")&&d.on("click",(function(){h({url:d.attr("href"),title:"popup",w:700,h:600})}))}))}(jQuery,window.elementorFrontend);