astraSyncMobileMenuState=function(e){for(var t=document.querySelectorAll("#masthead #ast-mobile-header, #ast-fixed-header #ast-mobile-header"),o=0;o<t.length;o++){var a=t[o].querySelector(".main-header-bar-navigation"),s=t[o].querySelector(".main-header-menu-toggle");a&&(a.classList.toggle("toggle-on",e),a.style.display=e?"block":""),s&&(s.classList.toggle("toggled",e),s.setAttribute("aria-expanded",e?"true":"false"))}document.body.classList.toggle("ast-main-header-nav-open",e)},astraToggleSetupPro=function(e,t,o){var a,s,n,r=!1;if(0<(a="off-canvas"===e||"full-width"===e?(s=document.querySelectorAll("#ast-mobile-popup, #ast-mobile-header"),(n=t.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):t.classList.contains("ast-header-break-point")?(s=document.querySelectorAll("#ast-mobile-header"),(r=!(0<(a=(n=document.querySelectorAll("#ast-mobile-header .main-header-menu-toggle")).length)))?1:a):(s=document.querySelectorAll("#ast-desktop-header"),(n=document.querySelectorAll("#ast-desktop-header .main-header-menu-toggle")).length))||r)for(var i=0;i<a;i++)if(r||(n[i].setAttribute("data-index",i),o[i])||(o[i]=n[i],n[i].removeEventListener("click",astraNavMenuToggle),n[i].addEventListener("click",astraNavMenuToggle,!1)),void 0!==s[i])for(var l,c=0;c<s.length;c++)if(0<(l=document.querySelector("header.site-header").classList.contains("ast-builder-menu-toggle-link")?s[c].querySelectorAll("ul.main-header-menu .menu-item-has-children > .menu-link, ul.main-header-menu .ast-menu-toggle"):s[c].querySelectorAll("ul.main-header-menu .ast-menu-toggle")).length)for(var d=0;d<l.length;d++)l[d].removeEventListener("click",AstraToggleSubMenu),l[d].addEventListener("click",AstraToggleSubMenu,!1)},astraNavMenuTogglePro=function(e,t,o,a){e.preventDefault();var s=e.target.closest("#ast-desktop-header"),n=document.querySelector("#masthead > #ast-desktop-header .ast-desktop-header-content"),r=(s=null!=s&&""!==s?s.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)null!==r&&""!==r&&void 0!==r&&(astraToggleClass(r,"toggle-on"),r.classList.contains("toggle-on")?r.style.display="block":r.style.display=""),astraToggleClass(s,"toggled"),s.classList.contains("toggled")?(t.classList.add("ast-main-header-nav-open"),"dropdown"===o&&(n.style.display="block")):(t.classList.remove("ast-main-header-nav-open"),n.style.display="none");else{e=a.closest("#ast-fixed-header")||document.getElementById("masthead");if(e)for(var i=e.querySelectorAll("#ast-mobile-header .main-header-bar-navigation .menu-item-has-children"),l=0;l<i.length;l++){i[l].classList.remove("ast-submenu-expanded");for(var c=i[l].querySelectorAll(".sub-menu"),d=0;d<c.length;d++)c[d].style.display="none"}-1!==(a.getAttribute("class")||"").indexOf("main-header-menu-toggle")&&(r=!a.classList.contains("toggled"),astraSyncMobileMenuState(r))}};let accountMenuToggle=function(){let n=astraAddon.hf_account_action_type&&"menu"===astraAddon.hf_account_action_type,r=n&&astraAddon.hf_account_show_menu_on&&"click"===astraAddon.hf_account_show_menu_on;var e=document.querySelectorAll(".ast-header-account-wrap");e&&e.forEach(t=>{let o=t.querySelector(".ast-account-nav-menu");function e(e){(r||n&&document.querySelector("body").classList.contains("ast-header-break-point"))&&o&&!t.contains(e.target)&&(o.style.right="",o.style.left="")}t._accountPointerUpHandler||(t._accountPointerUpHandler=e,document.addEventListener("pointerup",e));var a,s=t.querySelector(".ast-header-account-link");s&&(a=function(e){(r||n&&document.querySelector("body").classList.contains("ast-header-break-point"))&&(headerSelectionPosition=e.target.closest(".site-header-section"))&&(headerSelectionPosition.classList.contains("site-header-section-left")?(o.style.left=""===o.style.left?"-100%":"",o.style.right=""===o.style.right?"auto":""):(o.style.right=""===o.style.right?"-100%":"",o.style.left=""===o.style.left?"auto":""))},s._accountClickHandler||(s._accountClickHandler=a,s.addEventListener("click",a)))})},astraColorSwitcher={...astraAddon?.colorSwitcher,init:function(){this?.isInit&&(this.switcherButtons=document.querySelectorAll(".ast-builder-color-switcher .ast-switcher-button"),this.switcherButtons?.length)&&(this.switcherButtons?.forEach(e=>{e?.addEventListener("click",this.toggle)}),this.isDarkPalette&&"system"===this.defaultMode&&this.detectSystemColorScheme(),this.isSwitched)&&this.switchLogo()},detectSystemColorScheme:function(){null===this.getCookie("astraColorSwitcherState")&&window.matchMedia("(prefers-color-scheme: dark)").matches&&!this.isSwitched&&this.toggle()},toggle:function(e){e?.preventDefault();e=astraColorSwitcher;e.isSwitched=!e.isSwitched,e.setCookie("astraColorSwitcherState",e.isSwitched,90),e?.forceReload?window.location.reload():(e.switchPaletteColors(),e.switchIcon(),e.switchLogo(),e.isDarkPalette&&e.handleDarkModeCompatibility())},switchPaletteColors:function(){(this.isSwitched?this?.palettes?.switched:this?.palettes?.default)?.forEach((e,t)=>{document.documentElement.style.setProperty("--ast-global-color-"+t,e),astraAddon?.is_elementor_active&&document.documentElement.style.setProperty("--e-global-color-astglobalcolor"+t,e)})},switchIcon:function(){this.switcherButtons?.forEach(o=>{var[a,s]=o?.querySelectorAll(".ast-switcher-icon");if(a&&s){let[e,t]=this.isSwitched?[s,a]:[a,s];o?.classList.add("ast-animate"),setTimeout(()=>{e?.classList.add("ast-current"),t?.classList.remove("ast-current")},100),setTimeout(()=>o?.classList.remove("ast-animate"),200)}a=this.isSwitched?"defaultText":"switchedText";o?.setAttribute("aria-label",o?.dataset?.[a]||"Switch color palette.")})},switchLogo:function(){this.isDarkPalette&&this?.logos?.switched&&this?.logos?.default&&this.switchColorSwitcherLogo()},switchColorSwitcherLogo:function(){var e,t;let o=[];for(e of[".custom-logo-link:not(.sticky-custom-logo):not(.transparent-custom-logo) .custom-logo",".site-branding .site-logo-img img:not(.ast-sticky-header-logo)",".ast-site-identity .site-logo-img img:not(.ast-sticky-header-logo)"]){var a=document.querySelectorAll(e);if(0<a.length&&0<(o=Array.from(a).filter(e=>!(e.closest(".ast-sticky-header-logo")||e.closest(".sticky-custom-logo")||e.closest(".transparent-custom-logo")||e.classList.contains("ast-sticky-header-logo")))).length)break}o.length&&(t=this.isSwitched?this.logos.switched:this.logos.default)&&this.updateLogoImages(o,t)},updateLogoImages:function(e,o){e.forEach(e=>{var t;e&&e.src!==o&&((t=new Image).onload=function(){e.src=o,e.hasAttribute("srcset")&&e.removeAttribute("srcset"),e.hasAttribute("data-src")&&e.setAttribute("data-src",o)},t.onerror=function(){e.src=o},t.src=o)})},handleDarkModeCompatibility:function(){document.body.classList.toggle("astra-dark-mode-enable")},setCookie:(e,t,o)=>{var a=new Date;a.setTime(a.getTime()+24*o*60*60*1e3),document.cookie=`${e}=${t}; expires=${a.toUTCString()}; path=/`},getCookie:e=>{var t;for(t of document.cookie.split("; ")){var[o,a]=t.split("=");if(o===e)return a}return null}};var accountPopupTrigger=function(){if("undefined"!=typeof astraAddon&&"login"===astraAddon.hf_account_logout_action){var e,o=document.querySelectorAll(".ast-account-action-login");if(o.length){let t=document.querySelector("#ast-hb-account-login-wrap");t&&(e=document.querySelector("#ast-hb-login-close"),o.forEach(function(e){e.addEventListener("click",function(e){e.preventDefault(),t.classList.add("show")})}),e)&&e.addEventListener("click",function(e){e.preventDefault(),t.classList.remove("show")})}}};document.addEventListener("astPartialContentRendered",function(){accountMenuToggle(),accountPopupTrigger()}),window.addEventListener("load",function(){accountMenuToggle(),accountPopupTrigger(),astraColorSwitcher.init()}),document.addEventListener("astLayoutWidthChanged",function(){accountMenuToggle(),accountPopupTrigger()}),document.addEventListener("click",function(e){var t,e=e.target.closest("a");e&&(t=e.getAttribute("href"))&&-1!==t.indexOf("#")&&e.closest("#masthead #ast-mobile-header, #ast-fixed-header #ast-mobile-header")&&setTimeout(function(){astraSyncMobileMenuState(!1)},20)});let accordionContainer=document.querySelector(".ast-woocommerce-accordion");if(accordionContainer){let c=accordionContainer.querySelectorAll(".ast-accordion-header"),i=accordionContainer.querySelectorAll(".ast-accordion-content"),a="active",o;c.forEach(function(e,n){(o=e.nextElementSibling).style.height=0==n?"auto":0,e.addEventListener("click",function(e){i.forEach(function(e,o){n!==o&&(e.style.height=0,e.classList.remove(a))}),c.forEach(function(e,o){n!==o&&e.classList.remove(a)});var o=e.target.nextElementSibling,t=o.querySelector(".ast-accordion-wrap").clientHeight;o.classList.contains(a)?(o.classList.remove(a),e.target.classList.remove(a),o.style.height=0):(o.classList.add(a),e.target.classList.add(a),o.style.height=t+"px")})})}function handleCommentLinkClick(){var e;"#respond"!==window.location.hash&&!window.location.hash.includes("#comment")||((e=document.querySelector(".woocommerce-tabs ul.tabs li.reviews_tab a")||document.querySelector('a[href="#tab-reviews"]'))&&e.click(),setTimeout(function(){var e=document.querySelector("#respond")||document.querySelector("#review_form");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},300))}function handleReviewLinkClick(){document.querySelectorAll("a.woocommerce-review-link").forEach(function(e){e.addEventListener("click",function(e){if(accordionContainer&&accordionContainer.classList.contains("ast-woocommerce-accordion")){e.preventDefault();e=accordionContainer.querySelectorAll(".ast-single-tab .ast-accordion-header");let t=null;e.forEach(function(e){var o=e.nextElementSibling;o&&"tab-reviews"===o.id&&(t=e)}),t&&(t.click(),setTimeout(function(){var e=accordionContainer.querySelector("#tab-reviews");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},300))}})})}document.addEventListener("DOMContentLoaded",handleCommentLinkClick),window.addEventListener("hashchange",handleCommentLinkClick),document.addEventListener("DOMContentLoaded",handleReviewLinkClick);let horizontalProductGallerySlider=jQuery(".ast-single-product-thumbnails").flexslider({animation:"slide",controlNav:!1,animationLoop:!1,slideshow:!1,itemWidth:80,itemMargin:15,maxItems:4,asNavFor:".woocommerce-product-gallery",selector:".woocommerce-product-gallery-thumbnails__wrapper > div"}),articleSingle=(window.addEventListener("resize",function(){horizontalProductGallerySlider.resize()}),document.querySelector(".ast-article-single"));if(articleSingle&&articleSingle.classList.contains("ast-product-single-variable")){let t=document.querySelector(".woocommerce-product-gallery .woocommerce-product-gallery__image"),r=document.querySelectorAll(".woocommerce-product-gallery .ast-woocommerce-product-gallery__image img");t&&r&&(observer=new MutationObserver(e=>{e.forEach(e=>{e.attributeName.includes("data-thumb")&&null!==r&&r.forEach(e=>{null!==e.getAttribute("srcset")&&e.getAttribute("srcset").includes(t.getAttribute("data-thumb"))&&e.click()})})})).observe(t,{attributes:!0})}function makeGalleryAccessible(){let i=document.querySelectorAll(".woocommerce-product-gallery-thumbnails__wrapper .ast-woocommerce-product-gallery__image");var e,t;i.length&&(i.forEach((e,a)=>{e.setAttribute("tabindex","0");var t=e.querySelector("img"),t=t&&t.getAttribute("alt")||"Product image "+(a+1);e.setAttribute("aria-label","View "+t),e.classList.contains("flex-active-slide")?e.setAttribute("aria-current","true"):e.setAttribute("aria-current","false"),e.addEventListener("keydown",function(e){var t,r;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.click(),i.forEach(e=>{e.setAttribute("aria-current","false")}),this.setAttribute("aria-current","true")),"Tab"!==e.key||e.shiftKey||a!==i.length-1||document.querySelector(".ast-single-product-thumbnails")&&-1!==(r=(t=Array.from(document.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>{e=window.getComputedStyle(e);return"none"!==e.display&&"hidden"!==e.visibility})).indexOf(this))&&r<t.length-1&&(e.preventDefault(),t[r+1].focus())}),e.addEventListener("click",function(){i.forEach(e=>{e.setAttribute("aria-current","false")}),this.setAttribute("aria-current","true")})}),e=document.querySelector(".flex-prev"),t=document.querySelector(".flex-next"),e&&(e.setAttribute("aria-label","Previous image"),e.classList.contains("flex-disabled")?e.setAttribute("aria-disabled","true"):(e.setAttribute("aria-disabled","false"),e.setAttribute("tabindex","0"))),t)&&(t.setAttribute("aria-label","Next image"),t.classList.contains("flex-disabled")?t.setAttribute("aria-disabled","true"):(t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")))}function triggerGalleryImageMutation(){let b=document.querySelector(".woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img");if(b){let u=b?.getAttributeNames().map(e=>({name:e,value:b.getAttribute(e)}))||[],o=(u.push({name:"srcset",value:""}),document.querySelector("#ast-vertical-slider-inner")),c=document.querySelector("#ast-vertical-navigation-prev"),s=document.querySelector("#ast-vertical-navigation-next"),n=!1,d=new MutationObserver(e=>{for(var t of e)if("attributes"===t.type&&"src"===t.attributeName){if(n)return;n=!0;var r=t.target?.getAttribute("src"),i=document.querySelectorAll(".woocommerce-product-gallery-thumbnails__wrapper .ast-woocommerce-product-gallery__image"),l=t.target?.getAttribute("data-src");let e=!1;for(let a=1;a<i.length;a++){let t=i[a],r=t?.querySelector("img");if(r)if(l===r?.getAttribute("data-original-src")){e=!0,d.disconnect(),u.forEach(({name:e,value:t})=>b?.setAttribute(e,t)),setTimeout(()=>{var e;t?.click(),o&&"function"==typeof MoveSlide?(e=r.clientHeight+10,o?.setAttribute("ast-translate",(a-4)*e),MoveSlide("next",c,s)):jQuery(".woocommerce-product-gallery").data("flexslider")?.flexAnimate(a),n=!1,d.observe(b,{attributes:!0})},50);break}}e||(d.disconnect(),i[0]&&((t=i[0])?.querySelector("img")?.setAttribute("src",r),t?.querySelector("img")?.setAttribute("data-original-src",l),t?.click()),o&&"function"==typeof MoveSlide&&MoveSlide("prev",c,s),setTimeout(()=>n=!1),d.observe(b,{attributes:!0}))}});b&&d.observe(b,{attributes:!0})}}document.addEventListener("DOMContentLoaded",function(){triggerGalleryImageMutation(),makeGalleryAccessible()});let encapsulateHtmlTag=(e,t,n)=>{e.parentNode.insertBefore(t,e),t.appendChild(e),t.className=n},filterAccordion=()=>{var e=document.querySelector(".ast-filter-wrap");if(e&&e.classList.contains("ast-accordion-layout")){e=document.querySelectorAll(".ast-filter-wrap .widget");let l="active";e&&e.forEach(function(e,t){e=e.querySelector(".ast-filter-wrap .widget-title");if(!e)return!1;e.classList.add(l);var n=e.nextElementSibling;n&&(encapsulateHtmlTag(n,document.createElement("div"),"ast-filter-content"),encapsulateHtmlTag(n,document.createElement("div"),"ast-filter-content-inner")),e.addEventListener("click",function(e){var t=e.target.nextElementSibling;t&&(t=t.querySelector(".ast-filter-content > *").clientHeight,(e=e.target).classList.contains(l)?(e.classList.remove(l),e.nextElementSibling.style.maxHeight=0):(e.classList.add(l),e.nextElementSibling.style.maxHeight=t+"px"))})})}e=document.querySelectorAll(".ast-woo-sidebar-widget");e&&e.forEach(e=>{var t=e.querySelector(".ast-filter-content"),e=e.querySelector(".ast-filter-content-inner");t&&e&&(e=e.clientHeight,t.style.maxHeight=e+"px")})};filterAccordion();function CartCrossSellsSummaryHeight(){var e=document.querySelector("body"),t=document.querySelector(".cross-sells");e.classList.contains("woocommerce-cart")&&t&&(e=t.querySelectorAll(".products > li"))&&e.forEach(e=>{e&&(e=e.querySelectorAll(".astra-shop-summary-wrap"))&&e.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(){var e=document.querySelector("div.woocommerce"),o=document.querySelector("body");if(e&&(o.classList.contains("woocommerce-checkout")||o.classList.contains("woocommerce-cart")))e.addEventListener("click",function(e){var o,c,t,r;e=e,o=document.querySelector("#coupon_code"),c=document.querySelector('button[name="apply_coupon"]'),t=document.querySelector("#ast-coupon-code"),(r=document.querySelector("#ast-checkout-coupon .coupon"))&&e.target&&"ast-coupon-trigger"===e.target.id&&(r.style.display="flex",e.target.style.display="none",t?.focus()),o&&c&&t&&e.target&&"ast-apply-coupon"===e.target.id&&(document.querySelector(".woocommerce-notices-wrapper .woocommerce-error.coupon-error-notice")?.remove(),o.value=t.value,c.click())}),e.addEventListener("keypress",function(e){13===(e.which||e.keyCode)&&document.querySelector("#ast-apply-coupon")?.click()}),jQuery(document.body).on("applied_coupon",()=>{var e=document.querySelector(".coupon-error-notice"),o=document.querySelector(".woocommerce-notices-wrapper");e&&o&&(e?.classList?.add("woocommerce-error"),o?.append(e))}),jQuery(document.body).on("applied_coupon_in_checkout",()=>{document.querySelector("#ast-checkout-coupon .coupon-error-notice")?.remove();var e=document.querySelector(".coupon-error-notice");e&&document.querySelector("#ast-checkout-coupon")?.append(e)})}window.addEventListener("DOMContentLoaded",e=>{customCoupon()});function cartQuantityUpdater(){var 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(){var 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,a="ast-animate-input",s=e.closest(".form-row");s&&((""!==(t="select"===e.tagName||e.classList.contains("select2-hidden-accessible")?e.querySelector(":selected").textContent:e.value)||" "!==t&&"select"===e.tagName)&&s.classList.add(a),"hidden"===t&&s.classList.remove(a),""===t?s.classList.remove(a):s.classList.add(a))}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){var a=t.closest(".form-row");if(a){a=a.classList.contains("validate-required");let e=t.getAttribute("placeholder");a&&""!==e&&!e.includes("*")&&(e+=" *"),t.setAttribute("placeholder",e)}}document.addEventListener("DOMContentLoaded",function(e){var t=document.querySelector("body");t&&!t.classList.contains("cartflows_step-template")&&modernLayoutInputs()});function slideInAndOutContent(e,n){e=document.querySelector(e);let a=document.querySelector(".ast-order-review-toggle-text");e&&e.addEventListener("click",function(e){let 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),a&&(a.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",a)){a.textContent=astraAddon.order_review_toggle_texts.toggle_hide_text;let t=document.querySelector("#ast-order-review-content"),o=document.querySelector("#order_review");["change",'select.shipping_method, input[name^="shipping_method"]'].forEach(e=>t.addEventListener(e,function(){o.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}}))}))}})}let xhrCountEmail=0,delayTimerEmail;function validateInlineEmail(){let r=document.querySelector("#billing_email");if(r){let n=r.value;if(void 0===n||astraAddon.is_logged_in)return;let a=document.querySelector(".ast-create-account-section"),s=document.querySelector(".woocommerce-billing-fields__customer-login-label"),c=document.querySelector(".ast-email-validation-block"),i=document.querySelector("#ast-customer-login-url");if(""!==n){c&&c.remove(),clearTimeout(delayTimerEmail);let o=++xhrCountEmail;delayTimerEmail=setTimeout(async function(){let t=new XMLHttpRequest;t.open("POST",astra.ajax_url,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.send("action=astra_woo_check_user_exist&user_name_email="+n+"&security="+astraAddon.check_user_exist_nonce),t.onload=function(){var e;t.readyState==XMLHttpRequest.DONE&&(200<=t.status||400<=t.status)&&(document.cookie="ast_modern_checkout_useremail="+n,e=JSON.parse(t.responseText),o===xhrCountEmail)&&(c&&c.remove(),e.data.success&&i&&i.classList.contains("active")?r.insertAdjacentHTML("afterend",'<span class="ast-email-validation-block success">'+astraAddon.user_validation_msgs.success_msg+"</span>"):e.data.success?(e.data.is_login_allowed&&(r.insertAdjacentHTML("afterend",'<span class="ast-email-validation-block success">'+astraAddon.user_validation_msgs.success_msg+"</span>"),i)&&!i.classList.contains("active")&&i.click(),a&&(a.style.display="none"),s&&(s.style.display="block")):(i&&i.classList.contains("active")&&i.click(),a&&((e=a.querySelector(".create-account label.checkbox"))&&(e.style.display="block"),a.style.display="block")))}},300)}else i&&i.classList.contains("active")&&i.click(),c&&(c.style.display="none"),s&&(s.style.display="block"),a&&(a.style.display="none")}return!1}function supportNativeEmailFunctionality(){var e=document.querySelector("#billing_email");if(e){e=e.value;if(void 0===e||astraAddon.is_logged_in)return;var t=document.querySelector(".ast-create-account-section");t&&(t.style.display=""!==e?"block":"none")}return!1}function woocommerceUserLogin(){var 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&user_name_email="+encodeURIComponent(e.value)+"&password="+encodeURIComponent(t.value)+"&security="+encodeURIComponent(astraAddon.woocommerce_login_nonce)),o.onload=function(){var e,t;o.readyState==XMLHttpRequest.DONE&&(200<=o.status||400<=o.status)&&((e=JSON.parse(o.responseText)).data.success?location.reload():(t=document.querySelector(".ast-customer-info__notice"))&&(t.classList.add("active"),t.innerHTML=DOMPurify.sanitize(e.data.error)))}}})}document.addEventListener("DOMContentLoaded",function(e){var t,o,n=document.querySelector("body");!astraAddon.cartflows_version&&n&&n.classList.contains("woocommerce-checkout")&&(t=astraAddon.is_complete_package,(o=document.querySelector("#billing_email"))&&(t?(o.addEventListener("input",validateInlineEmail),validateInlineEmail):(o.addEventListener("input",supportNativeEmailFunctionality),supportNativeEmailFunctionality))(),n&&!n.classList.contains("ast-woo-two-step-modern-checkout")&&slideInAndOutContent("#ast-order-review-toggle","#ast-order-review-content"),t)&&(slideInAndOutContent("#ast-customer-login-url","#ast-customer-login-section"),woocommerceUserLogin())}),document.addEventListener("DOMContentLoaded",function(){var e,t,o,n;document.body.classList.contains("ast-modern-checkout")&&(e=document.getElementById("wc-stripe-express-checkout-element"),t=document.querySelector(".wc-order-attribution-inputs"),o=document.getElementById("wc-stripe-express-checkout-button-separator"),n=document.querySelector("form.checkout"))&&(e&&n.parentNode.insertBefore(e,n),t&&n.parentNode.insertBefore(t,n),o)&&n.parentNode.insertBefore(o,n)});function display_mega_menu_on_load(){var e=document.querySelectorAll(".content-width-mega");if(0<e.length)for(var t=0;t<e.length;t++)"hover"===(e[t].getAttribute("data-megamenu-trigger")||"hover")&&e[t].addEventListener("mouseenter",function(e){e=e.target.querySelector(".astra-mega-menu-width-content");null!==e&&e.classList.remove("ast-hidden")});var a=document.querySelectorAll(".menu-container-width-mega");if(0<a.length)for(t=0;t<a.length;t++)"hover"===(a[t].getAttribute("data-megamenu-trigger")||"hover")&&a[t].addEventListener("mouseenter",function(e){e=e.target.querySelector(".astra-mega-menu-width-menu-container");null!==e&&e.classList.remove("ast-hidden")});var s=document.querySelectorAll(".full-width-mega");if(0<s.length)for(t=0;t<s.length;t++)"hover"===(s[t].getAttribute("data-megamenu-trigger")||"hover")&&s[t].addEventListener("mouseenter",function(e){var t=e.target.querySelector(".astra-full-megamenu-wrapper"),e=e.target.querySelector(".astra-mega-menu-width-full");null!==t&&t.classList.remove("ast-hidden"),null!==e&&e.classList.remove("ast-hidden")});var r=document.querySelectorAll(".full-stretched-width-mega");if(0<r.length)for(t=0;t<r.length;t++)"hover"===(r[t].getAttribute("data-megamenu-trigger")||"hover")&&r[t].addEventListener("mouseenter",function(e){var t=e.target.querySelector(".astra-full-megamenu-wrapper"),e=e.target.querySelector(".astra-mega-menu-width-full-stretched");null!==t&&t.classList.remove("ast-hidden"),null!==e&&e.classList.remove("ast-hidden")});var n=document.querySelectorAll(".custom-width-mega");if(0<n.length)for(t=0;t<n.length;t++)"hover"===(n[t].getAttribute("data-megamenu-trigger")||"hover")&&n[t].addEventListener("mouseenter",function(e){e=e.target.querySelector(".astra-mega-menu-width-custom");null!==e&&e.classList.remove("ast-hidden")})}document.addEventListener("DOMContentLoaded",display_mega_menu_on_load),document.addEventListener("astPartialContentRendered",display_mega_menu_on_load);var items=document.getElementsByClassName("astra-megamenu-li");function apply_megamenu_width_styles(){[].slice.call(items).forEach(g=>{function s(){var e,t,a,s,r,n,i,d,u,l=(m=jQuery(g).parents(".ast-container")).children(),m=m.parent(),o=jQuery(g);(o.hasClass("full-width-mega")||o.hasClass("full-stretched-width-mega"))&&(l=jQuery(l).closest(".ast-container")),parseInt(window.innerWidth)>parseInt(astra.break_point)&&"ast-hf-mobile-menu"!==o.parent().attr("id")&&"ast-desktop-toggle-menu"!==o.parent().attr("id")?(e=l.width(),t=l.offset(),l=(a=o.offset()).left-(t.left+parseFloat(l.css("paddingLeft"))),d=e-(a.left+t.left)+130,s=m.width(),r=m.offset(),r=a.left-(r.left+parseFloat(m.css("paddingLeft"))),o.hasClass("custom-width-mega")&&(i=(i=window.getComputedStyle(o.find(".astra-mega-menu-width-custom")[0],"::before").getPropertyValue("content")||1200).replace(/[^0-9]/g,""),(i=parseInt(i))<=e?(u=parseInt(e-i),n=parseInt(l-u),t.left):(u=parseInt(i-e),n=parseInt(l+u),t.left)),o.hasClass("menu-container-width-mega")&&(u=jQuery(g).parents(".main-navigation"),m.hasClass("ast-above-header")?u=jQuery(".ast-above-header-navigation"):m.hasClass("ast-below-header")&&(u=jQuery(".ast-below-header-actual-nav")),e=($target_container=u.length?u:o.parent("ul")).width()+"px",m=jQuery(window).width()-($target_container.offset().left+$target_container.outerWidth()),u=o.offset(),m=jQuery(window).width()-m-u.left,l=parseInt($target_container.width()-m),d=parseInt(e)-o.outerWidth()-parseInt($target_container.width()-m)),o.hasClass("full-width-mega")?(o.find(".astra-full-megamenu-wrapper").css({left:"-"+r+"px",width:s}),o.find(".astra-megamenu").css({width:e})):o.hasClass("full-stretched-width-mega")?o.find(".astra-full-megamenu-wrapper").css({left:"-"+r+"px",width:s}):o.hasClass("custom-width-mega")?astra.isRtl?o.find(".astra-mega-menu-width-custom").css({width:i+"px"}):o.find(".astra-mega-menu-width-custom").css({left:"-"+n+"px",width:i+"px"}):o.hasClass("content-width-mega")?astra.isRtl?(u=t.left+e-(a.left+o.outerWidth()),o.find(".astra-megamenu").css({right:"-"+u+"px",width:e}).data("astra-hover-right",u)):o.find(".astra-megamenu").css({left:"-"+l+"px",width:e}):astra.isRtl?(o.find(".astra-megamenu").css({right:"-"+d+"px",width:e}),o.data("astra-hover-right",d)):o.find(".astra-megamenu").css({left:"-"+l+"px",width:e})):astra.isRtl?(o.find(".astra-megamenu").css({right:"",width:"","background-image":""}),o.find(".astra-full-megamenu-wrapper").css({right:"",width:"","background-image":""})):(o.find(".astra-megamenu").css({left:"",width:"","background-image":""}),o.find(".astra-full-megamenu-wrapper").css({left:"",width:"","background-image":""}))}"click"===(jQuery(g).data("megamenu-trigger")||"hover")?(jQuery(g).find("> a").on("click",function(e){var t=jQuery(g),a=t.hasClass("megamenu-active");jQuery(".astra-megamenu-li.megamenu-active").removeClass("megamenu-active"),a||(e.preventDefault(),t.addClass("megamenu-active"),t.find(".ast-hidden").removeClass("ast-hidden"),s())}),jQuery(document).on("click",function(e){jQuery(e.target).closest(".astra-megamenu-li").length||jQuery(".astra-megamenu-li.megamenu-active").removeClass("megamenu-active")})):(jQuery(g).hover(s),jQuery(g).mouseenter(function(){document.dispatchEvent(new CustomEvent("astra_mega_menu_on_hover",{detail:{}}))}))})}apply_megamenu_width_styles(),document.addEventListener("astMenuHoverStyleChanged",function(){apply_megamenu_width_styles()}),[].slice.call(items).forEach(function(h){var e=jQuery(h).parents(".ast-container"),f=e.children(),c=e.parent(),p=jQuery(h);(p.hasClass("full-width-mega")||p.hasClass("full-stretched-width-mega"))&&(f=jQuery(f).closest(".ast-container"),p.find(".astra-full-megamenu-wrapper").removeClass("ast-hidden")),p.find(".menu-link").focusin(function(e){var t,a,s,r,n,i,d,u,l,m,o,g;astra.is_header_footer_builder_active||(p.find(".sub-menu").addClass("astra-megamenu-focus"),p.find(".astra-full-megamenu-wrapper").addClass("astra-megamenu-wrapper-focus")),p.find(".sub-menu").removeClass("ast-hidden"),parseInt(jQuery(window).width())>parseInt(astra.break_point)&&"ast-hf-mobile-menu"!==p.parent().attr("id")&&"ast-desktop-toggle-menu"!==p.parent().attr("id")?(t=f.width(),a=f.offset(),u=(s=p.offset()).left-(a.left+parseFloat(f.css("paddingLeft"))),l=t-(s.left+a.left)+130,r=c.width(),g=c.offset(),g=s.left-(g.left+parseFloat(c.css("paddingLeft"))),p.hasClass("custom-width-mega")&&(d=(d=window.getComputedStyle(p.find(".astra-mega-menu-width-custom")[0],"::before").getPropertyValue("content")||1200).replace(/[^0-9]/g,""),i=(d=parseInt(d))<=t?(i=parseInt(t-d),n=parseInt(u-i),a.left-n):(i=parseInt(d-t),n=parseInt(u+i),a.left+n)),p.hasClass("menu-container-width-mega")&&(o=jQuery(h).parents(".main-navigation"),c.hasClass("ast-above-header")?o=jQuery(".ast-above-header-navigation"):c.hasClass("ast-below-header")&&(o=jQuery(".ast-below-header-actual-nav")),t=($target_container=o.length?o:p.parent("ul")).width()+"px",o=jQuery(window).width()-($target_container.offset().left+$target_container.outerWidth()),m=p.offset(),o=jQuery(window).width()-o-m.left,u=parseInt($target_container.width()-o),l=parseInt(t)-p.outerWidth()-parseInt($target_container.width()-o)),p.hasClass("full-width-mega")?(p.find(".astra-full-megamenu-wrapper").css({left:"-"+g+"px",width:r}),p.find(".astra-megamenu").css({width:t})):p.hasClass("full-stretched-width-mega")?p.find(".astra-full-megamenu-wrapper").css({left:"-"+g+"px",width:r}):p.hasClass("custom-width-mega")?astra.isRtl?p.find(".astra-mega-menu-width-custom").css({right:"-"+i+"px",width:d+"px"}):p.find(".astra-mega-menu-width-custom").css({left:"-"+n+"px",width:d+"px"}):p.hasClass("content-width-mega")?astra.isRtl?(m=a.left+t-(s.left+p.outerWidth()),p.find(".astra-megamenu").css({right:"-"+m+"px",width:t}).data("astra-hover-right",m)):p.find(".astra-megamenu").css({left:"-"+u+"px",width:t}):(g=void 0!==(o=p.data("astra-hover-right"))?o:l,astra.isRtl?p.find(".astra-megamenu").css({right:"-"+g+"px",width:t}).data("astra-hover-right",g):p.find(".astra-megamenu").css({left:"-"+u+"px",width:t}))):astra.isRtl?(p.find(".astra-megamenu").css({right:"",width:"","background-image":""}),p.find(".astra-full-megamenu-wrapper").css({right:"",width:"","background-image":""})):(p.find(".astra-megamenu").css({left:"",width:"","background-image":""}),p.find(".astra-full-megamenu-wrapper").css({left:"",width:"","background-image":""}))}),astra.is_header_footer_builder_active||(p.find(".menu-link").keydown(function(e){9==e.which&&e.shiftKey&&(p.find(".sub-menu").removeClass("astra-megamenu-focus"),p.find(".astra-full-megamenu-wrapper").removeClass("astra-megamenu-wrapper-focus"))}),jQuery(h).find(".sub-menu .menu-item").last().focusout(function(){p.find(".sub-menu").removeClass("astra-megamenu-focus"),p.find(".astra-full-megamenu-wrapper").removeClass("astra-megamenu-wrapper-focus")}),jQuery(window).click(function(){p.find(".sub-menu").removeClass("astra-megamenu-focus"),p.find(".astra-full-megamenu-wrapper").removeClass("astra-megamenu-wrapper-focus")})),p.click(function(e){jQuery(e.target).hasClass("menu-item")&&e.stopImmediatePropagation()})});(()=>{var e;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)}r="iPhone"==navigator.userAgent.match(/iPhone/i)?"iphone":"",e="iPod"==navigator.userAgent.match(/iPod/i)?"ipod":"",document.body.className+=" "+r,document.body.className+=" "+e;for(var t=document.querySelectorAll("a.astra-search-icon:not(.slide-search)"),a=0;t.length>a;a++)t[a].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<s.length;r++)for(var l=s[r].parentNode.querySelectorAll("a.astra-search-icon"),i=0;i<l.length;i++)l[i]==this&&(d(s[r]),s[r].querySelector("input.search-field").focus(),c?(t=s[r],n=o=a=void 0,document.body.classList.contains("ast-header-break-point")&&(n=document.querySelector(".main-navigation"),a=document.querySelector(".main-header-bar"),o=document.querySelector(".ast-mobile-header-wrap"),null!==a)&&null!==n&&(n=n.offsetHeight,a=a.offsetHeight,o=o.offsetHeight,n=n&&!document.body.classList.contains("ast-no-toggle-menu-enable")?parseFloat(n)-parseFloat(a):parseFloat(a),t.parentNode.classList.contains("ast-mobile-header-wrap")&&(n=parseFloat(o)),t.style.maxHeight=Math.abs(n)+"px")):(a=s[r],t=o=void 0,document.body.classList.contains("ast-header-break-point")&&(t=document.querySelector(".main-navigation"),null!==(o=document.querySelector(".main-header-bar")))&&null!==t&&(t=t.offsetHeight,o=o.offsetHeight,t=t&&!document.body.classList.contains("ast-no-toggle-menu-enable")?parseFloat(t)-parseFloat(o):parseFloat(o),a.style.maxHeight=Math.abs(t)+"px")));else this.classList.contains("full-screen")&&(e=document.getElementById("ast-seach-full-screen-form")).classList.contains("full-screen")&&(d(e),document.body.className+=" full-screen",e.querySelector("input.search-field").focus())};for(var s=document.querySelectorAll(".ast-search-box .close"),a=0,c=s.length;a<c;++a)s[a].onclick=function(e){e=e||window.event;for(var t=this;;){if(t.parentNode.classList.contains("ast-search-box")){n(t.parentNode),o("full-screen");break}if(t.parentNode.classList.contains("site-header"))break;t=t.parentNode}};document.onkeydown=function(e){if(27==e.keyCode)for(var e=document.getElementById("ast-seach-full-screen-form"),t=(null!=e&&(n(e),o("full-screen")),document.querySelectorAll(".ast-search-box.header-cover")),a=0;a<t.length;a++)n(t[a])},window.addEventListener("resize",function(){if("BODY"===document.activeElement.tagName&&"INPUT"!=document.activeElement.tagName){var e=document.querySelectorAll(".ast-search-box.header-cover");if(!document.body.classList.contains("ast-header-break-point"))for(var t=0;t<e.length;t++)e[t].style.maxHeight="",e[t].style.opacity="",e[t].style.display=""}});var r=document.getElementById("close");r&&r.addEventListener("keydown",function(e){"Enter"===e.key?(e.preventDefault(),this.click()):"Tab"===e.key&&e.preventDefault()})})();