(function(){"use strict";var n,o,i,a,l,e=function(t,n){return this instanceof e?t instanceof e?t:("string"==typeof t&&(t=this.select(t,n)),t&&t.nodeName&&(t=[t]),void(this.nodes=this.slice(t))):new e(t,n)};e.prototype={get length(){return this.nodes.length}},e.prototype.nodes=[],e.prototype.addClass=function(){return this.eacharg(arguments,function(e,t){e.classList.add(t)})},e.prototype.adjacent=function(t,n,s){return"number"==typeof n&&(n=0===n?[]:new Array(n).join().split(",").map(Number.call,Number)),this.each(function(o,i){var a=document.createDocumentFragment();e(n||{}).map(function(n,s){var a="function"==typeof t?t.call(this,n,s,o,i):t;return"string"==typeof a?this.generate(a):e(a)}).each(function(t){this.isInPage(t)?a.appendChild(e(t).clone().first()):a.appendChild(t)}),s.call(this,o,a)})},e.prototype.after=function(e,t){return this.adjacent(e,t,function(e,t){e.parentNode.insertBefore(t,e.nextSibling)})},e.prototype.append=function(e,t){return this.adjacent(e,t,function(e,t){e.appendChild(t)})},e.prototype.args=function(e,t,n){return"function"==typeof e&&(e=e(t,n)),"string"!=typeof e&&(e=this.slice(e).map(this.str(t,n))),e.toString().split(/[\s,]+/).filter(function(e){return e.length})},e.prototype.array=function(t){t=t;var n=this;return this.nodes.reduce(function(s,o,i){var a;return t?((a=t.call(n,o,i))||(a=!1),"string"==typeof a&&(a=e(a)),a instanceof e&&(a=a.nodes)):a=o.innerHTML,s.concat(!1!==a?a:[])},[])},e.prototype.attr=function(e,t,n){return n=n?"data-":"",this.pairs(e,t,function(e,t){return e.getAttribute(n+t)},function(e,t,s){e.setAttribute(n+t,s)})},e.prototype.before=function(e,t){return this.adjacent(e,t,function(e,t){e.parentNode.insertBefore(t,e)})},e.prototype.children=function(e){return this.map(function(e){return this.slice(e.children)}).filter(e)},e.prototype.clone=function(){return this.map(function(e){var n=e.cloneNode(!0),s=this.getAll(n);return this.getAll(e).each(function(e,t){for(var n in this.mirror)this.mirror[n]&&this.mirror[n](e,s.nodes[t])}),n})},e.prototype.getAll=function(t){return e([t].concat(e("*",t).nodes))},e.prototype.mirror={},e.prototype.mirror.events=function(t,n){if(t._e)for(var s in t._e)t._e[s].forEach(function(t){e(n).on(s,t.callback)})},e.prototype.mirror.select=function(t,n){e(t).is("select")&&(n.value=t.value)},e.prototype.mirror.textarea=function(t,n){e(t).is("textarea")&&(n.value=t.value)},e.prototype.closest=function(t){return this.map(function(n){do if(e(n).is(t))return n;while((n=n.parentNode)&&n!==document)})},e.prototype.data=function(e,t){return this.attr(e,t,!0)},e.prototype.each=function(e){return this.nodes.forEach(e.bind(this)),this},e.prototype.eacharg=function(e,t){return this.each(function(n,s){this.args(e,n,s).forEach(function(e){t.call(this,n,e)},this)})},e.prototype.empty=function(){return this.each(function(e){for(;e.firstChild;)e.removeChild(e.firstChild)})},e.prototype.filter=function(t){var n=function(e){return e.matches=e.matches||e.msMatchesSelector||e.webkitMatchesSelector,e.matches(t||"*")};return"function"==typeof t&&(n=t),t instanceof e&&(n=function(e){return-1!==t.nodes.indexOf(e)}),e(this.nodes.filter(n))},e.prototype.find=function(t){return this.map(function(n){return e(t||"*",n)})},e.prototype.first=function(){return this.nodes[0]||!1},e.prototype.generate=function(t){return/^\s* ]/.test(t)?e(document.createElement("table")).html(t).children().children().nodes:/^\s* ]/.test(t)?e(document.createElement("table")).html(t).children().children().children().nodes:/^\s*t&&(e(),n=Date.now())}}function d(e){var t=new Date,n=t.getTimezoneOffset()+60*e;return new Date(t.getTime()+6e4*n)}function u(e,t){var n=new XMLHttpRequest;n.open("GET",e),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("X-Widget","WhatsApp"),n.onload=function(){if(n.status!=200)s("XHR server error");else{try{var e=JSON.parse(n.responseText)}catch{s("Bad JSON")}!!e&&t(e)}},n.onerror=function(){s("XHR error "+n.statusText)},n.send()}function h(e,t){e=e||"",t=t||"click";var o,n=window[window.wwwa_ga||"ga"],s=window[window.wwwa_data_layer||"dataLayer"];typeof n=="function"&&typeof n.getAll=="function"&&(n("set","transport","beacon"),o=n.getAll(),o.forEach(function(n){n.send("event","WW-WA",t,e)})),typeof gtag=="function"&&typeof s=="object"&&s.forEach(function(n){n[0]=="config"&&n[1].substring(0,2)=="G-"&>ag("event",t,{event_category:"WW-WA",event_label:e,send_to:n[1],transport_type:"beacon"})}),typeof s=="object"&&s.push({event:"WW-WA",eventAction:t,eventLabel:e}),typeof fbq=="function"&&fbq("trackCustom","WW-WA",{eventAction:t,eventLabel:e})}function r(e,t,s){t=t||"",s&&(t=window.location.href+` `+t);var o="https://wa.me/"+encodeURIComponent(e)+"?text="+encodeURIComponent(t);h(o),n(document).trigger("wwwa/open",o,e),window.open(o,"wwwa","noopener")}function m(e){if(!e.code||e.code!=200){s("(response message) "+(e.data||"No data"));return}var l,u,h,m,p,g,v,b,j,y,_,O,x,C,A,w={id:null,premium:!1,domain:"",devices:"all",position:"right",color:"#0dc152",text:"white",z_index:999,cta:"Need help? Let's chat with us!",style:"tab",tooltip:!0,icon:"1",title:"Chat Support",logo:!1,subtitle:"",mode:"direct",first_message:"",reply_to:"Reply to",referer:!1,offline:!1,mobile:"fullscreen",auto_open:"no",delay:1,scroll:1,auto_mobile:!1,agents:[]},c=Object.assign({},w,e.data);if(location.protocol.match(/https?:/)&&c.domain!=location.host.replace("www.","")){s("Domain mismatch");return}g=["wwwa","wwwa--"+c.position,"wwwa--style_"+c.style,"wwwa--"+c.mobile,"wwwa--"+c.text],c.devices!="all"&&g.push("wwwa--"+c.devices),c.style=="icon"&&c.tooltip&&g.push("wwwa--tip"),c.premium||g.push("wwwa--brand"),p='
',c.style=="icon"&&(p+='
'),p+='
'+(c.cta?'
'+c.cta+"
":"")+'
',O="",c.premium||(A="https://widgetwhats.com/powered/?site="+encodeURIComponent(n("meta[property$=site_name]").attr("content")||n("title").text())+"&url="+encodeURIComponent(window.location.href),O='Powered by Widgetᵂ');for(b="",_="",m=0;m
'+u.role+'
'+u.name+'
'+(h?"online":"offline")+"
",c.mode=="reply"&&h&&(_+='
'+u.name+" "+u.desc+'
'+u.message.split("
").join('
')+'
')}if(b==""){s("No visible agents");return}p+='
'+(c.logo?''+c.title+'':'
'+c.title+"
")+'
'+c.subtitle+'
'+b+"
"+_+O+"
",p+="",n("body").append(p),i=n("#wwwa"),a=t(".wwwa__cta"),o=t(".wwwa__popup"),x=i.nodes[0].style,c.color!==w.color&&x.setProperty("--color",c.color),c.z_index!==w.z_index&&x.setProperty("--z",c.z_index);function E(){o.hasClass("wwwa__popup--open")?(localStorage.setItem("wwwa_closed_"+c.id,"yes"),o.removeClass("wwwa__popup--open"),t(".wwwa__agents").removeClass("wwwa__agents--active"),n(document).trigger("wwwa/popup/hide")):(t(".wwwa__agentlist img[loading=lazy]").attr("loading","eager"),o.show().addClass("wwwa__popup--open"),n(document).trigger("wwwa/popup/show"))}if(a.on("click",E),t(".wwwa__agents .wwwa__header__close").on("click",E),t(".wwwa__chat .wwwa__header__close").on("click",function(){t(".wwwa__chat--active").removeClass("wwwa__chat--active").hide(),t(".wwwa__agents").show().addClass("wwwa__agents--active")}),c.mode=="reply"?(t(".wwwa__agent--online").on("click",function(){var e=new Date;t(".wwwa__chat--active").removeClass("wwwa__chat--active"),t(".wwwa__msg").data("time",e.getHours()+":"+("0"+e.getMinutes()).slice(-2)),t(".wwwa__agents").hide(),t("#wwwa__agent__"+this.dataset.agent).show().addClass("wwwa__chat--active")}),t(".wwwa__input__send").on("click",function(){var e=c.agents[n(this).closest(".wwwa__chat").nodes[0].id.split("__")[2]],t=n(this).siblings(".wwwa__input__field").nodes[0].value;r(e.number,t,c.referer)}),i.on("keypress",".wwwa__input__field",function(e){if(e.which==13){var t=this.value,s=c.agents[n(e.target).closest(".wwwa__chat").nodes[0].id.split("__")[2]];r(s.number,t,c.referer)}})):t(".wwwa__agent--online").on("click",function(){var e=c.agents[this.dataset.agent];r(e.number,c.first_message,c.referer)}),c.auto_open!="no"&&(c.auto_mobile||window.innerWidth>767)){function k(){!o.hasClass("wwwa__popup--open")&&"yes"!==localStorage.getItem("wwwa_closed_"+c.id)&&a.trigger("click")}c.auto_open=="delay"?setTimeout(k,c.delay*1e3):(j=f(function(){window.pageYOffset/(document.body.clientHeight-window.innerHeight)>=c.scroll/100&&(window.removeEventListener("scroll",j),k())},300),window.addEventListener("scroll",j),setTimeout(j,1e3))}n(document).trigger("wwwa/loaded",c)}function c(){if(window.wwwa_loaded)return;window.wwwa_loaded=!0;var e=parseInt(window.wwwaID||n("script[data-wwwa]").data("wwwa")||0);e>0?(n("head").append(''),u("https://my.widgetwhats.com/whatsapp/"+e+"/",m)):s("ID is not defined")}/complete|interactive|loaded/.test(document.readyState)?c():document.addEventListener("DOMContentLoaded",c)})()