(()=>{"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,c)}return n}function t(t){for(var c=1;c1025?"no":"yes");var i=new Map,s=["__proto__","prototype","constructor"],u=function(e){return"string"==typeof e&&e.length>0&&!s.includes(e)};function _(){if(localStorage.getItem("ht_ctc_storage"))try{var e=JSON.parse(localStorage.getItem("ht_ctc_storage"));i=new Map(Object.entries(e||{}))}catch(e){i=new Map}else i=new Map}function l(e){return!(!u(e)||!i.has(e))&&i.get(e)}function d(e,t){if(_(),u(e)){i.set(e,t);var n=JSON.stringify(Object.fromEntries(i));localStorage.setItem("ht_ctc_storage",n)}}_();var f={defaultShow:function(e){(e instanceof Element?[e]:"string"==typeof e?document.querySelectorAll(e):[]).forEach(function(e){e.style.display="block"})},defaultHide:function(e){(e instanceof Element?[e]:"string"==typeof e?document.querySelectorAll(e):[]).forEach(function(e){e.style.display="none"})}};function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("function"!=typeof e){var o="string"==typeof c&&f[c]?f[c]:null;if(o)o(t,n);else(t instanceof Element?[t]:"string"==typeof t?document.querySelectorAll(t):[]).forEach(function(e){e.style.display="block",e.style.opacity="1"})}else void 0!==n&&""!==n?e(t).show(n):e(t).show()}function v(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("function"!=typeof e){var o="string"==typeof c&&f[c]?f[c]:null,r=t instanceof Element?[t]:"string"==typeof t?document.querySelectorAll(t):[];o?o(t,n):r.forEach(function(e){e.style.display="none",e.style.opacity="0"})}else e(t).hide(n)}var h={},y={};function m(){var e=document.querySelector(".ht_ctc_chat_data");e&&e.remove(),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:h}})),function(){if(a){document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(e){h.schedule&&"yes"===h.schedule?document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:h,display_chat:k,ht_ctc_chat:e,online_content:O}})):(k(e),O())}(a),a.addEventListener("click",function(){document.querySelector(".ht_ctc_chat_greetings_box")||j(a)}),function(){if(a){var e=document.querySelector(".ht_ctc_chat_greetings_box");e&&a.addEventListener("click",function(t){t.target.closest(".ht_ctc_chat_style")&&(e.classList.contains("ctc_greetings_opened")?w("user_closed"):g("user_opened"))}),a.addEventListener("click",function(e){e.target.closest(".ctc_greetings_close_btn")&&w("user_closed")})}}(),a&&a.addEventListener("click",function(e){if(e.target.closest(".ht_ctc_chat_greetings_box_link")){e.preventDefault();var t=document.querySelector("#ctc_opt");if(t)if(t.checked||l("g_optin"))j(a),b();else{var n=document.querySelector(".ctc_opt_in");n&&(n.style.display="block",n.style.opacity="0",setTimeout(function(){n.style.transition="opacity 0.4s",n.style.opacity="1"},10))}else j(a),b();document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))}});var e=document.querySelector("#ctc_opt");e&&e.addEventListener("change",function(){if(e.checked){var t=document.querySelector(".ctc_opt_in");t&&(t.style.transition="opacity 0.1s ease-out",t.style.opacity="0",setTimeout(function(){t.style.display="none"},100)),d("g_optin","y"),setTimeout(function(){j(a),b()},500)}})}}(),document.addEventListener("click",function(e){var t=e.target.closest(".ht-ctc-sc-chat");t&&j(t)}),document.addEventListener("click",function(e){var t=e.target.closest(".ctc_chat, #ctc_chat");t&&(j(t),t.classList.contains("ctc_woo_place")&&e.preventDefault());var n=e.target.closest('[href="#ctc_chat"]');n&&(e.preventDefault(),j(n))})}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";x();var t=document.querySelector(".ht-ctc-chat .ctc_cta_stick");t&&t.remove();var n=document.querySelector(".ht_ctc_chat_greetings_box");n&&(p(".ht_ctc_chat_greetings_box","init"===e?70:400,"defaultShow"),n.classList.add("ctc_greetings_opened"),n.classList.remove("ctc_greetings_closed")),d("g_action",e),"user_opened"===e&&d("g_user_action",e),function(){if(!document.querySelector(".ctc_greetings_modal"))return;if(!document.querySelector(".ht_ctc_modal_backdrop")){var e=function(t){"Escape"===t.key&&(w("user_closed"),document.removeEventListener("keydown",e))},t=document.createElement("div");t.className="ht_ctc_modal_backdrop",document.body.appendChild(t),t.addEventListener("click",function(){w("user_closed")}),document.addEventListener("keydown",e)}}()}function b(){S(),setTimeout(function(){w("chat_clicked")},500)}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"close";S(),v(".ht_ctc_chat_greetings_box","element"===e?70:400,"defaultHide");var t=document.querySelector(".ht_ctc_chat_greetings_box");t&&(t.classList.add("ctc_greetings_closed"),t.classList.remove("ctc_greetings_opened")),d("g_action",e),"user_closed"===e&&d("g_user_action",e)}function S(){var e=document.querySelector(".ht_ctc_modal_backdrop");e&&e.remove()}function k(e){if("yes"===r){if("show"===h.dis_m){var t=document.querySelector(".ht_ctc_desktop_chat");t&&t.remove(),e.style.cssText=h.pos_m+h.css,E(e)}}else if("show"===h.dis_d){var n=document.querySelector(".ht_ctc_mobile_chat");n&&n.remove(),e.style.cssText=h.pos_d+h.css,E(e)}}function E(e){var t=parseInt(h.se);isNaN(t)?p(e,"","defaultShow"):p(e,t,"defaultShow"),function(){var e=document.querySelector(".ht_ctc_chat_greetings_box");if(e){if(h.g_device){if("yes"!==r&&"mobile"===h.g_device)return void e.remove();if("yes"===r&&"desktop"===h.g_device)return void e.remove()}document.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:h,greetings_open:g,greetings_close:w}})),h.g_init&&"user_closed"!==l("g_user_action")&&("default"===h.g_init?"yes"!==r&&g("init"):"open"===h.g_init&&g("init"));var t=document.querySelectorAll('.ctc_greetings, #ctc_greetings, .ctc_greetings_now, [href="#ctc_greetings"]');t.length>0&&t.forEach(function(e){e.addEventListener("click",function(e){e.preventDefault(),w("element"),g("element")})})}}(),function(){if(document.querySelector(".ht_ctc_notification")&&"stop"!==l("n_badge")){var e=document.querySelector(".ctc_nb");if(e){var t=e.closest(".ht_ctc_style"),n=document.querySelector(".ht_ctc_badge");if(t&&n){var c,o,r=null===(c=t.querySelector(".ctc_nb"))||void 0===c?void 0:c.getAttribute("data-nb_top"),a=null===(o=t.querySelector(".ctc_nb"))||void 0===o?void 0:o.getAttribute("data-nb_right");null!==r&&(n.style.top=r),null!==a&&(n.style.right=a)}}var i=h.n_time?1e3*h.n_time:150;setTimeout(function(){p(".ht_ctc_notification",400,"defaultShow")},i)}}(),function(e){var t=e.classList.contains("ht_ctc_entry_animation")?1200:120;setTimeout(function(){e.classList.add("ht_ctc_animation",h.ani)},t);var n=document.querySelector(".ht-ctc-chat");n&&(n.addEventListener("mouseenter",function(){p(".ht-ctc-chat .ht-ctc-cta-hover",120,"defaultShow")}),n.addEventListener("mouseleave",function(){v(".ht-ctc-chat .ht-ctc-cta-hover",100,"defaultHide")}))}(e)}function O(){document.querySelector(".for_greetings_header_image_badge")&&(document.querySelectorAll(".for_greetings_header_image_badge").forEach(function(e){e.classList.add("g_header_badge_online")}),p(".for_greetings_header_image_badge","","defaultShow"))}function x(){var e=document.querySelector(".ht_ctc_notification");e&&(d("n_badge","stop"),e.remove())}function q(e){if(h.analytics&&"session"===h.analytics){if(sessionStorage.getItem("ht_ctc_analytics"))return;sessionStorage.setItem("ht_ctc_analytics","done")}function r(e){var t=h.chat_number&&""!==h.chat_number?h.chat_number:h.number;try{document.dispatchEvent(new CustomEvent("ht_ctc_event_apply_variables",{detail:{templateString:e}})),e=(e=(e=(e=void 0!==window.apply_variables_value?window.apply_variables_value:e).replace("{number}",t)).replace("{title}",o)).replace("{url}",n)}catch(e){}return e}var a;a="event_"+Math.floor(1e4+9e4*Math.random()),h.ctc_pixel_event_id=a,document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var i=h.chat_number&&""!==h.chat_number?h.chat_number:h.number,s=new Map,_=function(){return Object.fromEntries(s)},l="Click to Chat for WhatsApp",d="chat: "+i,f=o+", "+n;if(h.ga){var p=h.g_an_event_name&&""!==h.g_an_event_name?h.g_an_event_name:"click to chat";p=r(p),Array.isArray(y.g_an_params)&&y.g_an_params.forEach(function(e){if("string"==typeof e&&u(e)){var t=Object.getOwnPropertyDescriptor(y,e);if(t&&t.value&&"object"===c(t.value)){var n=t.value,o=n.key,a=n.value;"string"==typeof o&&(o=r(o),a=r(a),u(o)&&s.set(o,a))}}});var v=0,m="no",g=[];if("undefined"!=typeof dataLayer)try{var b=function(e,t){e&&"string"==typeof e&&""!==e.trim()&&(g.includes(e)||g.push(e))};"undefined"==typeof gtag&&(window.gtag=function(){dataLayer.push(arguments)},m="yes");var w=[];try{var S,k=null===(S=window.google_tag_data)||void 0===S?void 0:S.tidr;null!=k&&k.destination&&"object"===c(k.destination)&&Object.keys(k.destination).forEach(function(e){b(e)})}catch(e){}try{var E,O=null===(E=window.google_tag_data)||void 0===E||null===(E=E.tidr)||void 0===E?void 0:E.container;O&&"object"===c(O)&&Object.values(O).forEach(function(e){Array.isArray(e.destinations)&&e.destinations.forEach(function(e){"string"==typeof e&&e.startsWith("G-")&&b(e)})})}catch(e){}try{Array.isArray(window.dataLayer)&&window.dataLayer.forEach(function(e){Array.isArray(e)&&"config"===e[0]&&"string"==typeof e[1]?b(e[1]):null!=e&&e.send_to&&"string"==typeof e.send_to&&b(e.send_to)})}catch(e){}g.forEach(function(e){var t;t=(t=e).toUpperCase(),w.includes(t)||(w.push(t),(t.startsWith("G-")||t.startsWith("GT-"))&&(s.set("send_to",t),gtag("event",p,_()),v++))})}catch(e){}if(0===v&&"no"===m)if("undefined"!=typeof gtag)gtag("event",p,_());else if("undefined"!=typeof ga&&void 0!==ga.getAll){ga.getAll()[0].send("event",l,d,f)}else"undefined"!=typeof __gaTracker&&__gaTracker("send","event",l,d,f)}if("undefined"!=typeof dataLayer){dataLayer.push({event:"Click to Chat",type:"chat",number:i,title:o,url:n,event_category:l,event_label:f,event_action:d,ref:"dataLayer push"});var x=t(t({},_()),{},{event:null!=p?p:"chat_click",ref:"dataLayer push ga admin values"});dataLayer.push(x)}if(h.ads&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),h.fb&&"undefined"!=typeof fbq){var q=h.pixel_event_name&&""!==h.pixel_event_name?h.pixel_event_name:"Click to Chat by HoliThemes",j=y.pixel_event_type&&""!==y.pixel_event_type?y.pixel_event_type:"trackCustom",A=new Map;Array.isArray(y.pixel_params)&&y.pixel_params.forEach(function(e){if("string"==typeof e&&u(e)){var t=Object.getOwnPropertyDescriptor(y,e);if(t&&t.value&&"object"===c(t.value)){var n=t.value,o=n.key,a=n.value;"string"==typeof o&&(o=r(o),a=r(a),u(o)&&A.set(o,a))}}}),h.ctc_pixel_event_id="",fbq(j,q,Object.fromEntries(A),{eventID:a})}}function j(e){document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:h}}));var t=h.number,n=h.pre_filled;if(e.hasAttribute("data-number")&&""!==e.getAttribute("data-number")&&(t=e.getAttribute("data-number")),e.hasAttribute("data-pre_filled")){var c=e.getAttribute("data-pre_filled")||"";n=(h.prefix_pre_filled?h.prefix_pre_filled:"")+c}try{n=n.replaceAll("%","%25");var o=window.location.href;n=n.replace(/\[url]/gi,o),n=encodeURIComponent(decodeURI(n))}catch(e){}if(""!==t||h.custom_url_m&&""!==h.custom_url_m||h.custom_url_d&&""!==h.custom_url_d){var a="https://wa.me/"+t+"?text="+n,i=h.url_target_d?h.url_target_d:"_blank";"yes"===r?(h.url_structure_m&&"wa_colon"===h.url_structure_m&&(a="whatsapp://send?phone="+t+"&text="+n,i="_self"),h.custom_url_m&&""!==h.custom_url_m&&(a=h.custom_url_m)):(h.url_structure_d&&"web"===h.url_structure_d&&(a="https://web.whatsapp.com/send?phone="+t+"&text="+n),h.custom_url_d&&""!==h.custom_url_d&&(a=h.custom_url_d));var s="popup"===i?"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=788,height=514,left=100,top=100":"noopener";window.open(a,i,s),h.chat_number=t,q(),function(e){if(!h.hook_url)return;var t={},n={};if(h.hook_v){if(t=void 0!==A?A:h.hook_v,!Array.isArray(t))return;var c={},o=1;t.forEach(function(e){c["value"+o]=e,o++}),h.hook_v=c}document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:h,number:e}}));var r,a=h.hook_url;t=h.hook_v,"json"===h.webhook_format?(n["Content-Type"]="application/json",r=JSON.stringify(t)):(n["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8",r=new URLSearchParams(t).toString());fetch(a,{method:"POST",headers:n,body:r}).then(function(e){}).catch(function(e){})}(t),x()}else if(h.no_number){var u=document.querySelector(".ctc-no-number-message");u&&(u.style.display="block")}}"undefined"!=typeof ht_ctc_chat_var&&(h=ht_ctc_chat_var),"undefined"!=typeof ht_ctc_variables&&(y=ht_ctc_variables),0===Object.keys(h).length||0===Object.keys(y).length?function(){if(0===Object.keys(h).length&&document.querySelector(".ht_ctc_chat_data"))try{var e,t=(null===(e=document.querySelector(".ht_ctc_chat_data"))||void 0===e?void 0:e.getAttribute("data-settings"))||"";h=JSON.parse(t),window.ht_ctc_chat_var=h}catch(e){}0===Object.keys(y).length&&(y={g_an_event_name:"click to chat",pixel_event_name:"Click to Chat by HoliThemes",pixel_event_type:"trackCustom",g_an_params:["g_an_param_1","g_an_param_2","g_an_param_3"],g_an_param_1:{key:"number",value:"{number}"},g_an_param_2:{key:"title",value:"{title}"},g_an_param_3:{key:"url",value:"{url}"},pixel_params:["pixel_param_1","pixel_param_2","pixel_param_3","pixel_param_4"],pixel_param_1:{key:"Category",value:"Click to Chat for WhatsApp"},pixel_param_2:{key:"return_type",value:"chat"},pixel_param_3:{key:"ID",value:"{number}"},pixel_param_4:{key:"Title",value:"{title}"}},window.ht_ctc_variables=y);m()}():m();var A=h.hook_v?h.hook_v:""}"function"==typeof e?e(function(){n()}):"loading"!==document.readyState?n():document.addEventListener("DOMContentLoaded",n)}("undefined"!=typeof window&&"function"==typeof window.jQuery?window.jQuery:null)})();