!function(){"use strict";const t=window.matchMedia("(prefers-reduced-motion: reduce)");let e=!1;function o(){e="undefined"==typeof UxBuilder&&t.matches}o(),t.addEventListener?.("change",o),document.documentElement.style,window.getComputedStyle(document.documentElement)["scroll-behavior"],jQuery(document).ready((function(t){t("body").on("submit","form.cart",(function(e){const o=t(this).parents(".type-product");if(!o||!o.is(".product-type-simple, .product-type-variable"))return;e.preventDefault();const a=t(this),r=a.find(".single_add_to_cart_button");let d=a.serialize();d+="&action=flatsome_ajax_add_to_cart",r.val()&&(d+="&add-to-cart="+r.val()),r.addClass("loading"),t(document.body).trigger("adding_to_cart",[r,d]),t.ajax({url:window.flatsomeVars.ajaxurl,data:d,method:"POST",success:function(e){if(!e)return;const{product_url:o,notices:a,fragments:d,cart_hash:n,error:c=""}=e;if("undefined"==typeof wc_add_to_cart_params||"yes"!==wc_add_to_cart_params.cart_redirect_after_add)if(c&&o)window.location=o;else{if(r.removeClass("loading"),a.indexOf("error")>0){jQuery.fn.magnificPopup&&jQuery.magnificPopup.close();const e=t(".woocommerce-notices-wrapper");return e.append(a),void t.scrollTo(e,{offset:-window.flatsomeVars.scrollPaddingTop-15})}t(document.body).trigger("added_to_cart",[d,n,r])}else window.location=wc_add_to_cart_params.cart_url}})}))}))}();