astraToggleSetupPro=function(e,a,t){var l,n,o,r=!1;if(0<(l="off-canvas"===e||"full-width"===e?(n=document.querySelectorAll("#ast-mobile-popup, #ast-mobile-header"),(o=a.classList.contains("ast-header-break-point")?document.querySelectorAll("#ast-mobile-header .main-header-menu-toggle"):document.querySelectorAll("#ast-desktop-header .main-header-menu-toggle")).length):a.classList.contains("ast-header-break-point")?(n=document.querySelectorAll("#ast-mobile-header"),(r=!(0<(l=(o=document.querySelectorAll("#ast-mobile-header .main-header-menu-toggle")).length)))?1:l):(n=document.querySelectorAll("#ast-desktop-header"),(o=document.querySelectorAll("#ast-desktop-header .main-header-menu-toggle")).length))||r)for(var s=0;s .menu-link, ul.main-header-menu .ast-menu-toggle"):n[i].querySelectorAll("ul.main-header-menu .ast-menu-toggle")).length)for(var g=0;g #ast-desktop-header .ast-desktop-header-content"),r=(n=null!=n&&""!==n?n.querySelector(".main-header-menu-toggle"):document.querySelector("#masthead > #ast-desktop-header .main-header-menu-toggle"),document.querySelector("#masthead > #ast-desktop-header .ast-desktop-header-content .main-header-bar-navigation"));if("desktop"===e.currentTarget.trigger_type)return null!==r&&""!==r&&void 0!==r&&(astraToggleClass(r,"toggle-on"),r.classList.contains("toggle-on")?r.style.display="block":r.style.display=""),astraToggleClass(n,"toggled"),void(n.classList.contains("toggled")?(a.classList.add("ast-main-header-nav-open"),"dropdown"===t&&(o.style.display="block")):(a.classList.remove("ast-main-header-nav-open"),o.style.display="none"));e=document.querySelectorAll("#masthead > #ast-mobile-header .main-header-bar-navigation"),menu_toggle_all=document.querySelectorAll("#masthead > #ast-mobile-header .main-header-menu-toggle"),r="0",n=!1;if(null!==l.closest("#ast-fixed-header")&&(e=document.querySelectorAll("#ast-fixed-header > #ast-mobile-header .main-header-bar-navigation"),menu_toggle_all=document.querySelectorAll("#ast-fixed-header .main-header-menu-toggle"),r="0",n=!0),void 0===e[r])return!1;for(var s=e[r].querySelectorAll(".menu-item-has-children"),d=0;d div"});const articleSingle=document.querySelector(".ast-article-single");if(articleSingle&&articleSingle.classList.contains("ast-product-single-variable")){const a=document.querySelector(".woocommerce-product-gallery .woocommerce-product-gallery__image"),b=document.querySelectorAll(".woocommerce-product-gallery .ast-woocommerce-product-gallery__image img");a&&b&&(observer=new MutationObserver(e=>{e.forEach(e=>{e.attributeName.includes("data-thumb")&&b.forEach(e=>{e.getAttribute("srcset").includes(a.getAttribute("data-thumb"))&&e.click()})})})).observe(a,{attributes:!0})}function triggerFirstSlide(){const i=document.querySelector(".woocommerce-product-gallery-thumbnails__wrapper div"),e=jQuery(".single_variation_wrap");e&&i&&e.on("show_variation",function(e,t){i.click()})}document.addEventListener("DOMContentLoaded",function(){triggerFirstSlide()});const getHeaderHeightIfSticky=()=>{const e=document.querySelector("body");var o=document.querySelector(".ast-above-sticky-header-active"),c=document.querySelector(".ast-primary-sticky-header-active"),a=document.querySelector(".ast-below-sticky-header-active"),r=document.querySelector(".admin-bar");const s=document.querySelectorAll(".ast-sticky-active");let i,n;if(e&&(e.classList.contains("woocommerce-shop")||e.classList.contains("ast-woo-shop-archive"))&&(i=document.querySelector(".woocommerce-shop.ast-left-sidebar #content .ast-container, .woocommerce-shop.ast-right-sidebar #content .ast-container, .ast-woo-shop-archive.ast-left-sidebar #content .ast-container, .ast-woo-shop-archive.ast-right-sidebar #content .ast-container"),n=document.querySelector(".woocommerce-shop.ast-left-sidebar #content .ast-container > .widget-area, .woocommerce-shop.ast-right-sidebar #content .ast-container > .widget-area, .ast-woo-shop-archive.ast-left-sidebar #content .ast-container > .widget-area, .ast-woo-shop-archive.ast-right-sidebar #content .ast-container > .widget-area")),e&&e.classList.contains("woocommerce-cart")&&astraAddon.cart_sticky_cart_totals&&(i=document.querySelector("#ast-cart-wrapper"),n=document.querySelector("#ast-cart-wrapper .cart-collaterals")),e&&e.classList.contains("single-product")&&(i=document.querySelector("#ast-sticky-row-summary"),n=document.querySelector("#ast-sticky-row-summary .summary")),e&&e.classList.contains("woocommerce-checkout")&&astraAddon.checkout_order_review_sticky&&(i=document.querySelector(".woocommerce-checkout"),n=document.querySelector("#ast-order-review-wrapper")),s){let t=0;s.forEach(e=>{t+=e.clientHeight}),i&&(o||c||a)&&n&&t?(n.style.position="sticky",n.style.top=r?t+50+"px":t+20+"px"):i&&n&&(n.style.position="sticky",n.style.top=r?"3em":"1em")}};window.onscroll=function(e){getHeaderHeightIfSticky()};function CartCrossSellsSummaryHeight(){const e=document.querySelector("body"),t=document.querySelector(".cross-sells");if(e.classList.contains("woocommerce-cart")&&t){const r=t.querySelectorAll(".products > li");r&&r.forEach(e=>{if(e){const t=e.querySelectorAll(".astra-shop-summary-wrap");t&&t.forEach(e=>{var t=e.querySelector(".price"),r=e.querySelector("a.button"),o=e.querySelector("a.ast-quick-view-button");(t||r)&&(t=(t?t.clientHeight:0)+(r?r.clientHeight:0)+(o?o.clientHeight:0)+15)&&(e.style.minHeight=t+"px")})}})}}function CartCrossSellsSummaryHeightResize(){let t;window.addEventListener("resize",function(e){clearTimeout(t),t=setTimeout(function(){CartCrossSellsSummaryHeight()},500)})}window.addEventListener("DOMContentLoaded",e=>{CartCrossSellsSummaryHeight()}),CartCrossSellsSummaryHeightResize();function customCoupon(){const o=document.querySelector("div.woocommerce"),e=document.querySelector("body");o&&(e.classList.contains("woocommerce-checkout")||e.classList.contains("woocommerce-cart"))&&o.addEventListener("click",function(o){const e=document.querySelector("#coupon_code"),t=document.querySelector('button[name="apply_coupon"]');var c=document.querySelector("#ast-coupon-code");const n=document.querySelector("#ast-checkout-coupon .coupon");n&&o.target&&"ast-coupon-trigger"===o.target.id&&(n.style.display="flex",o.target.style.display="none"),e&&t&&c&&o.target&&"ast-apply-coupon"===o.target.id&&(e.value=c.value,t.click())})}window.addEventListener("DOMContentLoaded",o=>{customCoupon()});function cartQuantityUpdater(){const e=document.querySelector("body");pageParentClass=document.querySelector("div.woocommerce");let t;e.classList.contains("woocommerce-cart")&&pageParentClass&&pageParentClass.addEventListener("change",function(e){e.target&&e.target.classList.contains("qty")&&(null!=t&&clearTimeout(t),""!=e.target.value&&(t=setTimeout(function(){document.querySelector('[name="update_cart"]').click()},1e3)))})}window.addEventListener("DOMContentLoaded",e=>{cartQuantityUpdater()});function modernLayoutInputs(){const e=document.querySelectorAll(".woocommerce input, .woocommerce select, .woocommerce textarea");e&&e.forEach(e=>{e.addEventListener("input",function(e){addAnimateClass(e.currentTarget)}),addPlaceholder(e),addRequiredFields(e),addAnimateClass(e)})}function addAnimateClass(e){var t,s="ast-animate-input";const o=e.closest(".form-row");o&&((""!==(t="select"===e.tagName||e.classList.contains("select2-hidden-accessible")?e.querySelector(":selected").textContent:e.value)||" "!==t&&"select"===e.tagName)&&o.classList.add(s),"hidden"===t&&o.classList.remove(s),""===t?o.classList.remove(s):o.classList.add(s))}function addPlaceholder(e){var t;e.closest(".form-row")&&!e.getAttribute("placeholder")&&(t=e.closest(".form-row").querySelector("label"))&&e.setAttribute("placeholder",t.textContent)}function addRequiredFields(t){const s=t.closest(".form-row");if(s){var o=s.classList.contains("validate-required");let e=t.getAttribute("placeholder");o&&""!==e&&!e.includes("*")&&(e+=" *"),t.setAttribute("placeholder",e)}}document.addEventListener("DOMContentLoaded",function(e){const t=document.querySelector("body");t&&!t.classList.contains("cartflows_step-template")&&modernLayoutInputs()});function slideInAndOutContent(e,n){const t=document.querySelector(e),i=document.querySelector(".ast-order-review-toggle-text");t&&t.addEventListener("click",function(e){const t=document.querySelector(n);var o=t.querySelector("*");if(t)if(e.currentTarget.classList.contains("active"))e.currentTarget.classList.remove("active"),t.style.maxHeight=0,setTimeout(()=>{t.style.display="none"},300),i&&(i.textContent=astraAddon.order_review_toggle_texts.toggle_show_text);else if(o&&(e.currentTarget.classList.add("active"),t.style.display="block",t.style.maxHeight=o.clientHeight+"px",i)){i.textContent=astraAddon.order_review_toggle_texts.toggle_hide_text;const s=document.querySelector("#ast-order-review-content"),a=document.querySelector("#order_review");["change",'select.shipping_method, input[name^="shipping_method"]'].forEach(e=>s.addEventListener(e,function(){a.querySelectorAll('input[name^="shipping_method"][type="radio"]:checked').forEach(e=>{e.removeAttribute("checked")}),document.querySelector("body").dispatchEvent(new CustomEvent("update_checkout",{detail:{update_shipping_method:!0}}))}))}})}validateEmail=function(e){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)};let xhrCountEmail=0,delayTimerEmail;function validateInlineEmail(){const s=document.querySelector("#billing_email");if(s){const a=s.value;if(void 0===a||astraAddon.is_logged_in)return;const n=document.querySelector(".ast-create-account-section"),i=document.querySelector(".woocommerce-billing-fields__customer-login-label"),c=document.querySelector(".ast-email-validation-block"),l=document.querySelector("#ast-customer-login-url");if(""!==a){if(c&&c.remove(),!validateEmail(a))return s.insertAdjacentHTML("afterend",` ${astraAddon.email_validation_msgs.error_msg} `),!1;clearTimeout(delayTimerEmail);const r=++xhrCountEmail;delayTimerEmail=setTimeout(async function(){let o=new XMLHttpRequest;o.open("POST",astra.ajax_url,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send("action=astra_woo_check_email_exist&email_address="+a+"&security="+astraAddon.check_email_exist_nonce),o.onload=function(){if(o.readyState==XMLHttpRequest.DONE&&(200<=o.status||400<=o.status)){document.cookie="ast_modern_checkout_useremail="+a;var e=JSON.parse(o.responseText);if(r===xhrCountEmail)if(c&&c.remove(),e.data.success&&l&&l.classList.contains("active"))s.insertAdjacentHTML("afterend",''+astraAddon.email_validation_msgs.success_msg+"");else if(e.data.success)e.data.is_login_allowed&&(s.insertAdjacentHTML("afterend",''+astraAddon.email_validation_msgs.success_msg+""),l&&!l.classList.contains("active")&&l.click()),n&&(n.style.display="none"),i&&(i.style.display="block");else{if(l&&l.classList.contains("active")&&l.click(),n){const t=n.querySelector(".create-account label.checkbox");t&&(t.style.display="block"),n.style.display="block"}i&&(i.style.display="none")}}}},300)}else l&&l.classList.contains("active")&&l.click(),c&&(c.style.display="none"),i&&(i.style.display="block"),n&&(n.style.display="none")}return!1}function woocommerceUserLogin(){const e=document.querySelector(".ast-customer-login-section__login-button");e&&e.addEventListener("click",function(){var e=document.querySelector("#billing_email"),t=document.querySelector("#billing_password");if(e||!t){let o=new XMLHttpRequest;o.open("POST",astra.ajax_url,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send("action=astra_woocommerce_login_user&email="+e.value+"&password="+t.value+"&security="+astraAddon.woocommerce_login_nonce),o.onload=function(){if(o.readyState==XMLHttpRequest.DONE&&(200<=o.status||400<=o.status)){var e=JSON.parse(o.responseText);if(e.data.success)location.reload();else{const t=document.querySelector(".ast-customer-info__notice");t&&(t.classList.add("active"),t.innerHTML=e.data.error)}}}}})}document.addEventListener("DOMContentLoaded",function(e){const t=document.querySelector("body");if(!astraAddon.cartflows_version&&t&&t.classList.contains("woocommerce-checkout")){const o=document.querySelector("#billing_email");o.addEventListener("input",validateInlineEmail),validateInlineEmail(),t&&!t.classList.contains("ast-woo-two-step-modern-checkout")&&slideInAndOutContent("#ast-order-review-toggle","#ast-order-review-content"),slideInAndOutContent("#ast-customer-login-url","#ast-customer-login-section"),woocommerceUserLogin()}});!function(){var e,t;function o(e){var t=(t=document.body.className).replace(e,"");document.body.className=t}function d(e){e.style.display="block",setTimeout(function(){e.style.opacity=1},1)}function n(e){e.style.opacity="",setTimeout(function(){e.style.display=""},200)}e="iPhone"==navigator.userAgent.match(/iPhone/i)?"iphone":"",t="iPod"==navigator.userAgent.match(/iPod/i)?"ipod":"",document.body.className+=" "+e,document.body.className+=" "+t;for(var a=document.querySelectorAll("a.astra-search-icon:not(.slide-search)"),s=0;a.length>s;s++)a[s].onclick=function(e){var t,a,o,n;if(e.preventDefault(),e=e||window.event,this.classList.contains("header-cover"))for(var s=document.querySelectorAll(".ast-search-box.header-cover"),c=astraAddon.is_header_builder_active||!1,r=0;r