function fusionCalcWoocommerceTabsLayout(e){jQuery(e).each((function(){var e=jQuery(this).parent().width(),t=jQuery(this).find("li").length,o=(e-e%t)/t,r=e-o*(t-1);jQuery(this).css("width",e+"px"),jQuery(this).find("li").css("width",o+"px"),jQuery(this).find("li:last").css("width",r+"px").addClass("no-border-right")}))}function reinitAftarAjax(){jQuery('.fusion-update-cart, a[href="#updateCart"]').off("click"),jQuery('.fusion-update-cart, a[href="#updateCart"]').on("click",(function(e){return e.preventDefault(),jQuery(".cart .actions > .button").trigger("click"),!1})),setTimeout((function(){jQuery(".crossfade-images").each((function(){fusionResizeCrossfadeImagesContainer(jQuery(this))}))}),1e3)}jQuery(window).on("load",(function(){jQuery(".woocommerce-store-notice__dismiss-link").on("click",(function(){var e=fusion.getAdminbarHeight();jQuery("#wrapper").css("margin-top",""),jQuery(".fusion-header").css("top",e)})),jQuery(".variations_form").find(".variations .single_variation_wrap .woocommerce-variation-description").remove(),"function"==typeof jQuery.fn.equalHeights&&0<jQuery(".double-sidebars.woocommerce .social-share > li").length&&jQuery(".double-sidebars.woocommerce .social-share > li").equalHeights(),jQuery(".adsw-attribute-option").length&&jQuery("body").on("show_variation",".variations_form",(function(){jQuery(".product-type-variable .variations_form > .single_variation_wrap .woocommerce-variation-price").css("display","inline-block"),jQuery(".product-type-variable .variations_form > .single_variation_wrap .woocommerce-variation-price .price").css("margin-top","0"),jQuery(".product-type-variable .variations_form > .single_variation_wrap .woocommerce-variation-availability").css("display","inline-block")}))})),jQuery(document).ready((function(){var e;jQuery(window).on("updated_cart_totals updated_wc_div",(function(){const e=jQuery(".awb-dynamic-free-shipping-min-amount"),t=jQuery(".awb-dynamic-free-shipping-min-amount-progress");(t.length||t.length)&&jQuery.ajax({type:"POST",url:avadaWooCommerceVars.ajaxurl,data:{action:"live_update_cart_free_shipping_amount",security:avadaWooCommerceVars.cart_nonce},success:function(o){o.success&&(e.length&&e.each((function(){"missing"===jQuery(this).data("type")?jQuery(this).replaceWith(o.data.free_shipping_missing):jQuery(this).html(o.data.free_shipping_percentage)})),t.length&&t.each((function(){jQuery(this).find(".progress").attr("aria-valuenow",o.data.free_shipping_percentage);const e=jQuery(this).find(".fusion-progressbar-value");if(e.length){const t=jQuery(this).data("value-type");let r="";r="min-amount-percentage"===t?e.text().includes("%")?o.data.free_shipping_percentage+"%":o.data.free_shipping_percentage:"sub-totals-discounts"===t?o.data.sub_totals_discounts:o.data.sub_totals,e.html(r)}jQuery(window).trigger("fusion-dynamic-content-render",jQuery(this).parent())})))}})})),jQuery("body").on("change",".woocommerce-cart-form .qty",(function(e){const t=jQuery(this),o=t.closest("tr"),r=o.length?o.index():0,a=parseInt(t.val()),i=t.attr("name").replace("cart[","").replace("][qty]",""),n=t.closest(".cart_item").find(".product-subtotal"),c=jQuery(".fusion-dynamic-cart-count-wrapper"),s=jQuery(".fusion-widget-cart-number"),u=jQuery(".fusion-menu-cart-items"),d=jQuery(".awb-woo-mini-cart"),l=jQuery(".fusion-dynamic-cart-total-wrapper"),m=jQuery(".awb-dynamic-free-shipping-min-amount"),h=jQuery(".awb-dynamic-free-shipping-min-amount-progress"),y=jQuery(".woocommerce-cart-form .shop_table").prev("h2");jQuery(".post-content").find(".fusion-woo-cart-totals-wrapper table, .fusion-button, .cart_totals table").addClass("awb-disabled"),jQuery.ajax({type:"POST",url:avadaWooCommerceVars.ajaxurl,data:{action:"live_update_cart",cart_item_key:i,quantity:a,security:avadaWooCommerceVars.cart_nonce},success:function(e){if(e.success){const t=parseInt(e.data.cart_items);if(c.length){let e=1===t?c.data("singular"):c.data("plural");c.contents().filter((function(){return 3===this.nodeType})).first().replaceWith(e),c.children(".fusion-dynamic-cart-count").text(t)}if(s.length&&s.html(t),u.length){const e=u.find('.fusion-menu-cart-item[data-cart-item-key="'+i+'"]');e.length&&e.find(".fusion-menu-cart-item-quantity .awb-quantity").html(a)}if(d.length){let t=d.find(".woocommerce-mini-cart li").eq(r);t.length&&t.find(".quantity").contents().filter((function(){return 3===this.nodeType})).first().each((function(){let e=this.nodeValue.match(/^(\d+)(\D*)/);e&&(this.nodeValue=a+e[2])})),d.find(".woocommerce-mini-cart__total").find(".woocommerce-Price-amount").html(jQuery(e.data.fragments[".cart_totals"]).find(".woocommerce-Price-amount").html())}l.length&&(l.children(".fusion-dynamic-cart-sub-totals").length&&l.children(".fusion-dynamic-cart-sub-totals").html(e.data.sub_totals),l.children(".fusion-dynamic-cart-sub-totals-discounts").length&&l.children(".fusion-dynamic-cart-sub-totals-discounts").html(e.data.sub_totals_discounts),l.children(".fusion-dynamic-cart-totals").length&&l.children(".fusion-dynamic-cart-totals").html(e.data.totals),l.children(".fusion-dynamic-cart-totals-tax").length&&l.children(".fusion-dynamic-cart-totals-tax").html(e.data.totals_tax)),m.length&&m.each((function(){"missing"===jQuery(this).data("type")?jQuery(this).replaceWith(e.data.free_shipping_missing):jQuery(this).html(e.data.free_shipping_percentage)})),h.length&&h.each((function(){jQuery(this).find(".progress").attr("aria-valuenow",e.data.free_shipping_percentage);const t=jQuery(this).find(".fusion-progressbar-value");if(t.length){const o=jQuery(this).data("value-type");let r="";r="min-amount-percentage"===o?t.text().includes("%")?e.data.free_shipping_percentage+"%":e.data.free_shipping_percentage:"sub-totals-discounts"===o?e.data.sub_totals_discounts:e.data.sub_totals,t.html(r)}jQuery(window).trigger("fusion-dynamic-content-render",jQuery(this).parent())})),y.length&&y.html(y.html().replace(/\d+/,t)),n.html(e.data.item_sub_totals),jQuery(".cart_totals").html(jQuery(e.data.fragments[".cart_totals"]).html())}jQuery(document.body).trigger("updated_cart_totals")},complete:function(){jQuery(".post-content").find(".fusion-woo-cart-totals-wrapper table, .fusion-button, .cart_totals table").removeClass("awb-disabled")}})}));let t=!1;jQuery(document).on("click",".woocommerce-cart-form .product-remove > a",(function(e){t=!0})),jQuery(document).on("click",".woocommerce-cart .restore-item",(function(e){t=!0})),jQuery(window).on("updated_wc_div",(function(){if(t){const e=jQuery(".fusion-dynamic-cart-count-wrapper"),o=jQuery(".fusion-widget-cart-number");let r=0;if(jQuery(".woocommerce-cart-form").first().find(".cart_item input.qty").each((function(){let e=parseInt(jQuery(this).val(),10);isNaN(e)||(r+=e)})),e.length){let t=1===r?e.data("singular"):e.data("plural");e.contents().filter((function(){return 3===this.nodeType})).first().replaceWith(t),e.children(".fusion-dynamic-cart-count").text(r)}o.length&&o.html(r),t=!1}})),jQuery('.fusion-update-cart, a[href="#updateCart"]').on("click",(function(e){return e.preventDefault(),jQuery(".cart .actions > .button").trigger("click"),!1})),jQuery(".fusion-apply-coupon").on("click",(function(e){e.preventDefault(),jQuery(".cart .actions .coupon #coupon_code").val(jQuery("#avada_coupon_code").val()),jQuery(".cart .actions .coupon .button").trigger("click")})),jQuery(window).on("updated_wc_div",(function(){!jQuery(".fusion-woo-notices-tb").length&&jQuery("#coupon_code").length&&jQuery("#coupon_code").hasClass("has-error")&&jQuery(".woocommerce-notices-wrapper").append('<div class="avada-woocommerce-error wc-block-components-notice-banner is-error" role="alert"><div class="wc-block-components-notice-banner__content">'+jQuery("#coupon-error-notice").html()+"</div></div>")})),jQuery(".woocommerce-store-notice").length&&jQuery(".woocommerce-store-notice").is(":visible")&&!jQuery(".fusion-top-frame").is(":visible")&&(jQuery("#wrapper").css("margin-top",jQuery(".woocommerce-store-notice").outerHeight()),0<jQuery("#slidingbar-area").outerHeight()&&jQuery(".header-wrapper").css("margin-top","0"),jQuery(".sticky-header").length&&jQuery(".sticky-header").css("margin-top",jQuery(".woocommerce-store-notice").outerHeight())),jQuery(".catalog-ordering .orderby .current-li a").html(jQuery(".catalog-ordering .orderby ul li.current a").html()),jQuery(".catalog-ordering .sort-count .current-li a").html(jQuery(".catalog-ordering .sort-count ul li.current a").html()),jQuery(".woocommerce .avada-myaccount-data th.woocommerce-orders-table__cell-order-actions").text(avadaWooCommerceVars.order_actions),jQuery("body.rtl .avada-myaccount-data .my_account_orders .woocommerce-orders-table__cell-order-status").each((function(){jQuery(this).css("text-align","right")})),jQuery(".woocommerce input").each((function(){jQuery(this).has("#coupon_code")||(e=jQuery(this).attr("id"),jQuery(this).attr("placeholder",jQuery(this).parent().find("label[for="+e+"]").text()))})),jQuery(".woocommerce #reviews #comments .comment_container .comment-text").length&&jQuery(".woocommerce #reviews #comments .comment_container").append('<div class="clear"></div>'),jQuery(".woocommerce-tabs #comments > h2").each((function(){jQuery(this).replaceWith((function(){return"<h3>"+jQuery(this).html()+"</h3>"}))})),"block"===jQuery("body .sidebar").css("display")&&fusionCalcWoocommerceTabsLayout(".woocommerce-tabs .tabs-horizontal"),jQuery(".sidebar .products,.fusion-footer-widget-area .products,#slidingbar-area .products").each((function(){jQuery(this).removeClass("products-4"),jQuery(this).removeClass("products-3"),jQuery(this).removeClass("products-2"),jQuery(this).addClass("products-1")})),jQuery(".subcategory-products").each((function(){jQuery(this).addClass("products-"+avadaWooCommerceVars.woocommerce_shop_page_columns)})),jQuery(".woocommerce-tabs ul.tabs li a").off("click"),jQuery("body").on("click",".woocommerce-tabs > ul.tabs li a",(function(){var e=jQuery(this),t=e.closest(".woocommerce-tabs");return jQuery("ul.tabs li",t).removeClass("active"),jQuery("> div.panel",t).hide(),jQuery("div"+e.attr("href"),t).show(),e.parent().addClass("active"),!1})),jQuery(".continue-checkout").length||jQuery(document).on("checkout_error",(function(){var e=fusion.getAdminbarHeight(),t=jQuery(".fusion-header-wrapper").find("div"),o=0;jQuery("html, body").stop(),t.each((function(){"fixed"===jQuery(this).css("position")&&(o=jQuery(this).height())})),jQuery(".woocommerce-NoticeGroup-checkout").length&&jQuery("html, body").animate({scrollTop:jQuery(".woocommerce-NoticeGroup-checkout").offset().top-e-o-10},500)})),jQuery("body").on("click",".woocommerce-checkout-nav a,.continue-checkout",(function(e){var t,o,r,a=fusion.getAdminbarHeight(),i=jQuery(".fusion-header-wrapper").find("div"),n=0;i.each((function(){"fixed"===jQuery(this).css("position")&&(n=jQuery(this).height())})),e.preventDefault(),jQuery(".avada-woocommerce-error").remove(),0<jQuery(".validate-required:visible").length&&jQuery.each(jQuery(".validate-required:visible"),(function(e,t){var o=jQuery(t).find(":input");"hidden"===o.attr("type")||"radio"===o.attr("type")?jQuery(t).addClass("woocommerce-validated"):o.trigger("change")})),jQuery(".woocommerce").trigger("avada_checkout_continue_field_validation"),jQuery(".woocommerce .woocommerce-billing-fields, .woocommerce .woocommerce-shipping-fields, .woocommerce .woocommerce-account-fields").find(".input-text, select, input:checkbox").closest(".validate-required:not(.woocommerce-validated)").is(":visible")?(jQuery(".avada-woocommerce-error").length||jQuery(".woocommerce .avada-checkout .woocommerce-checkout").prepend('<div class="avada-woocommerce-error wc-block-components-notice-banner is-error" role="alert"><div class="wc-block-components-notice-banner__content">'+avadaWooCommerceVars.woocommerce_checkout_error+"</div></div>"),jQuery(document.body).trigger("avada_checkout_error",[avadaWooCommerceVars.woocommerce_checkout_error]),0<jQuery(".avada-woocommerce-error").length&&jQuery("html, body").animate({scrollTop:jQuery(".avada-woocommerce-error").offset().top-a-n-10},500)):(o=t=jQuery(this).attr("data-name"),o="order_review"===t?"#"+t:"."+t,jQuery("form.checkout .col-1, form.checkout .col-2, form.checkout #order_review_heading, form.checkout #order_review").hide(),jQuery("form.checkout").find(o).fadeIn(),"order_review"===o&&jQuery("form.checkout").find("#order_review_heading ").fadeIn(),jQuery(".woocommerce-checkout-nav li").removeClass("is-active"),jQuery(".woocommerce-checkout-nav").find("[data-name="+t+"]").parent().addClass("is-active"),jQuery(this).hasClass("continue-checkout")&&0<jQuery(window).scrollTop()&&(r=jQuery(".woo-tabs-horizontal").length?jQuery(".woocommerce-checkout-nav"):jQuery(".woocommerce-content-box.avada-checkout"),jQuery("html, body").animate({scrollTop:r.offset().top-a-n},500))),calcSelectArrowDimensions()})),jQuery("body").on("click","input[name=ship_to_different_address]",(function(){jQuery(this).is(":checked")&&setTimeout((function(){calcSelectArrowDimensions()}),1)})),Modernizr.mq("only screen and (max-width: 479px)")&&jQuery(".overlay-full.layout-text-left .slide-excerpt p").each((function(){var e,t=jQuery(this).html().split(/[\s\.\?]+/),o="";if(t.length>11){for(e=0;e<10;e++)o+=t[e]+" ";jQuery(this).html(o)}})),jQuery(".wc-tabs li").on("click",(function(){var e=jQuery(this).attr("aria-controls");setTimeout((function(){jQuery("#"+e).find(".awb-carousel").length&&"function"==typeof generateSwiperCarousel&&generateSwiperCarousel(),jQuery("#"+e).find(".fusion-gallery").each((function(){jQuery(this).isotope()})),jQuery("#"+e).find(".fusion-blog-shortcode").each((function(){jQuery(this).find(".fusion-blog-layout-grid").isotope()})),jQuery("#"+e).find(".crossfade-images").each((function(){fusionResizeCrossfadeImagesContainer(jQuery(this))})),"function"==typeof jQuery.fn.fusionCalcFlipBoxesHeight&&jQuery("#"+e).find(".flip-box-inner-wrapper").each((function(){jQuery(this).fusionCalcFlipBoxesHeight()})),jQuery("#"+e).find(".fusion-portfolio").each((function(){jQuery(this).find(".fusion-portfolio-wrapper").isotope()})),"function"==typeof jQuery.fn.reinitializeGoogleMap&&jQuery("#"+e).find(".shortcode-map").each((function(){jQuery(this).reinitializeGoogleMap()}))}),150)}))})),jQuery(document).ready((function(){var e=jQuery("#calc_shipping_country").parents(".avada-shipping-calculator-form").find("#calc_shipping_state_field");e.length&&("hidden"===e.find("#calc_shipping_state").attr("type")?e.hide():e.show())})),jQuery(window).on("updated_wc_div",(function(){reinitAftarAjax()})),jQuery(window).on("fusion-dynamic-content-render",(function(e,t){var o=jQuery(t).find(".fusion-woo-slider");0<o.length&&o.parents(".fusion-tabs").css("height",""),0<(o=jQuery(t).find(".crossfade-images")).length&&o.each((function(){fusionResizeCrossfadeImagesContainer(jQuery(this))}))})),jQuery(window).on("updated_wc_div",(function(){jQuery(".cart_totals.fusion-animated").removeClass("fusion-animated")}));