").append(f.clone()).html()),void 0!==h[e+1]&&(g=h.eq(e+1).addClass("quick-view-next"),g=a("
").append(g.clone()).html()),woodmartThemeModule.quickViewLoad(c,i,f,g)})},woodmartThemeModule.quickViewCarousel=function(){a(".product-quick-view .woocommerce-product-gallery__wrapper").trigger("destroy.owl.carousel"),a(".product-quick-view .woocommerce-product-gallery__wrapper").addClass("owl-carousel").owlCarousel({rtl:a("body").hasClass("rtl"),items:1,dots:!1,nav:!0,navText:!1})},woodmartThemeModule.quickViewLoad=function(c,d,e,f){var g={id:c,action:"woodmart_quick_view"},h=function(c){a.magnificPopup.open({items:{src:'",type:"inline"},tClose:woodmart_settings.close,tLoading:woodmart_settings.loading,removalDelay:500,callbacks:{beforeOpen:function(){this.st.mainClass=b.popupEffect+" quick-view-wrapper"},open:function(){a(".variations_form").each(function(){a(this).wc_variation_form().find(".variations select:eq(0)").change()}),a(".variations_form").trigger("wc_variation_form"),a("body").trigger("woodmart-quick-view-displayed"),woodmartThemeModule.swatchesVariations(),woodmartThemeModule.btnsToolTips(),setTimeout(function(){woodmartThemeModule.nanoScroller()},300),woodmartThemeModule.quickViewCarousel()}}})};a.ajax({url:woodmart_settings.ajaxurl,data:g,method:"get",success:function(b){
woodmart_settings.quickview_in_popup_fix?(a.magnificPopup.close(),setTimeout(function(){h(b)},500)):h(b)},complete:function(){d.removeClass("loading")},error:function(){}})},woodmartThemeModule.swatchesVariations=function(){var c=a(".variations_form"),d=!1,e=!1;a(".variations_form .label").on("click",function(b){a(this).siblings(".value").hasClass("with-swatches")&&b.preventDefault()}),c.each(function(){var c=a(this);c.data("swatches")||(c.data("swatches",!0),c.data("product_variations")||c.find(".swatches-select").find("> div").addClass("swatch-enabled"),a(".swatches-select > div").hasClass("active-swatch")&&c.addClass("variation-swatch-selected"),c.on("click",".swatches-select > div",function(){var b=a(this).data("value"),d=a(this).parent().data("id"),e=a(this).data("title");f(c),a(this).hasClass("active-swatch")||a(this).hasClass("swatch-disabled")||(c.find("select#"+d).val(b).trigger("change"),a(this).parent().find(".active-swatch").removeClass("active-swatch"),a(this).addClass("active-swatch"),f(c),("yes"===woodmart_settings.swatches_labels_name&&a(window).width()>=769||a(window).width()<=768)&&a(this).parents("tr").find(".wd-attr-selected").html(e))}).on("click",".reset_variations",function(b){c.find(".active-swatch").removeClass("active-swatch"),("yes"===woodmart_settings.swatches_labels_name&&a(window).width()>=769||a(window).width()<=768)&&c.find(".wd-attr-selected").html("")}).on("reset_data",function(){var e=!0,h=!1;c.find(".variations select").each(function(){a(this).data("attribute_name")||a(this).attr("name");0===(a(this).val()||"").length?e=!1:h=!0}),e&&a(this).parent().find(".active-swatch").removeClass("active-swatch"),c.removeClass("variation-swatch-selected");var j=a(".woocommerce-product-gallery__wrapper.owl-carousel");if(f(c),n("default",c),j.hasClass("owl-carousel")){"yes"==woodmart_settings.product_slider_auto_height?(!g()&&i("default",c)&&d&&j.trigger("destroy.owl.carousel"),a(".product-images").imagesLoaded(function(){j=j.owlCarousel(b.mainCarouselArg),j.trigger("refresh.owl.carousel")})):(j=j.owlCarousel(b.mainCarouselArg),j.trigger("refresh.owl.carousel"));var k="centered"==woodmart_settings.product_gallery.thumbs_slider.position?woodmart_settings.centered_gallery_start:0;g()&&(k=0),j.trigger("to.owl.carousel",k)}}).on("reset_image",function(){var b=a(".thumbnails .product-image-thumbnail img").first();g()||h(c)||b.wc_reset_variation_attr("src")}).on("show_variation",function(f,j,k){if(("yes"===woodmart_settings.swatches_labels_name&&a(window).width()>=769||a(window).width()<=768)&&!e&&(c.find(".active-swatch").each(function(){var b=a(this).data("title");a(this).parents("tr").find(".wd-attr-selected").html(b)}),e=!0),j.image.src){var m=c.parents(".single-product-content").find('.thumbnails .product-image-thumbnail img[data-o_src="'+j.image.thumb_src+'"]').length>0,o=c.parents(".single-product-content").find(".thumbnails .product-image-thumbnail img").first();m&&o.wc_reset_variation_attr("src"),h(c)||n(j.variation_id,c)||(o.attr("src")!=j.image.thumb_src&&o.wc_set_variation_attr("src",j.image.src),woodmartThemeModule.initZoom()),c.addClass("variation-swatch-selected"),h(c)||g()||l();var p=a(".woocommerce-product-gallery__wrapper.owl-carousel");if(p.hasClass("owl-carousel")){"yes"==woodmart_settings.product_slider_auto_height?(!g()&&i(j.variation_id,c)&&d&&p.trigger("destroy.owl.carousel"),a(".product-images").imagesLoaded(function(){p=p.owlCarousel(b.mainCarouselArg),p.trigger("refresh.owl.carousel")})):(p=p.owlCarousel(b.mainCarouselArg),p.trigger("refresh.owl.carousel"));var q=a(".images .thumbnails");p.trigger("to.owl.carousel",0),q.hasClass("owl-carousel")?(q.owlCarousel().trigger("to.owl.carousel",0),q.find(".active-thumb").removeClass("active-thumb"),q.find(".product-image-thumbnail").eq(0).addClass("active-thumb")):q.hasClass("slick-slider")&&(q.slick("slickGoTo",0),q.find(".product-image-thumbnail").eq(0).hasClass("active-thumb")||(q.find(".active-thumb").removeClass("active-thumb"),q.find(".product-image-thumbnail").eq(0).addClass("active-thumb")))}}}))});var f=function(b){b.data("product_variations")&&b.find(".variations select").each(function(){var b=a(this),c=b.parent().find(".swatches-select"),d=b.html();d=a(d),c.find("> div").removeClass("swatch-enabled").addClass("swatch-disabled"),d.each(function(b){var d=a(this).val();a(this).hasClass("enabled")?c.find('div[data-value="'+d+'"]').removeClass("swatch-disabled").addClass("swatch-enabled"):c.find('div[data-value="'+d+'"]').addClass("swatch-disabled").removeClass("swatch-enabled")})})},g=function(){return a(".single-product-content").hasClass("product-quick-view")},h=function(a){return a.parent().hasClass("quick-shop-form")},i=function(a,b){return"old"===woodmart_settings.variation_gallery_storage_method?j(a):k(a,b)},j=function(a){if("undefined"!=typeof woodmart_variation_gallery_data||"undefined"!=typeof woodmart_qv_variation_gallery_data){var b=g()?woodmart_qv_variation_gallery_data:woodmart_variation_gallery_data;return void 0!==b&&b&&b[a]}},k=function(a,b){var c=m(b);return void 0!==c&&c&&c[a]&&c[a].length>1},l=function(){if(1==woodmart_settings.swatches_scroll_top_desktop&&a(window).width()>=1024||1==woodmart_settings.swatches_scroll_top_mobile&&a(window).width()<=1024){var b=a("html, body");b.stop(!0),a(window).on("mousedown wheel DOMMouseScroll mousewheel keyup touchmove",function(){b.stop(!0)}),b.animate({scrollTop:a(".product-image-summary").offset().top-150},800),a(".woodmart-swatch").tooltip("hide")}},m=function(a){var b=a.data("product_variations"),c=[];return b?(b.forEach(function(a){c[a.variation_id]=a.additional_variation_images,c.default=a.additional_variation_images_default}),c):c},n=function(b,c){if("old"===woodmart_settings.variation_gallery_storage_method){if(!i(b,c)||h(c)||"default"===b&&!d)return!1;o(b,c)}else{if(!i(b,c)||h(c)||"default"===b&&!d)return!1;var e=m(c);p(e[b],c)}return woodmartThemeModule.productImagesGallery(),woodmartThemeModule.quickViewCarousel(),a(window).trigger("main_gallery_replaced"),a(".woocommerce-product-gallery__image").trigger("zoom.destroy"),g()||woodmartThemeModule.initZoom(),d="default"!==b,a(window).resize(),!0},o=function(a,b){var c=g()?woodmart_qv_variation_gallery_data:woodmart_variation_gallery_data,d=c[a],e=b.parents(".single-product-content").find(".woocommerce-product-gallery__wrapper");e.empty();for(var f=0;f
';g()||(h+=''),h+=d[f].image,g()||(h+=""),h+="",e.append(h)}},p=function(a,b){var c=b.parents(".single-product-content").find(".woocommerce-product-gallery__wrapper");c.empty();for(var d in a){var e='
",c.append(e)}}},woodmartThemeModule.swatchesOnGrid=function(){a("body").on("click",".swatch-on-grid",function(){var b,c,d,e=a(this).data("image-src"),f=a(this).data("image-srcset"),g=a(this).data("image-sizes");if(void 0!==e&&""!==e){var h=a(this).parents(".product-grid-item"),i=h.find(".product-image-link > img"),j=i.data("original-src"),k=i.data("original-srcset"),l=i.data("original-sizes");void 0===j&&i.data("original-src",i.attr("src")),void 0===k&&i.data("original-srcset",i.attr("srcset")),void 0===l&&i.data("original-sizes",i.attr("sizes")),a(this).hasClass("active-swatch")?(b=j,c=k,d=l,a(this).removeClass("active-swatch"),h.removeClass("product-swatched")):(a(this).parent().find(".active-swatch").removeClass("active-swatch"),a(this).addClass("active-swatch"),h.addClass("product-swatched"),b=e,c=f,d=g),i.attr("src")!=b&&(h.addClass("wd-loading-image"),i.attr("src",b).attr("srcset",c).attr("image_sizes",d).one("load",function(){h.removeClass("wd-loading-image")}))}})},woodmartThemeModule.productsTabs=function(){var b=!1;a(".woodmart-products-tabs").each(function(){var d=a(this),e=d.find(".woodmart-tab-content"),f=[];e.find(".owl-carousel").length<1&&(f[0]={html:e.html()}),d.find(".products-tabs-title li").on("click",function(d){d.preventDefault();var g=a(this),h=g.data("atts"),i=g.index();b||g.hasClass("active-tab-title")||(b=!0,c(h,i,e,g,f,function(b){b.html&&(e.html(b.html),a(document).trigger("wood-images-loaded"),a(document).trigger("wood-products-tabs-loaded"),woodmartThemeModule.productHover(),woodmartThemeModule.btnsToolTips(),woodmartThemeModule.shopMasonry(),woodmartThemeModule.countDownTimer(),woodmartThemeModule.productLoaderPosition(),woodmartThemeModule.productsLoadMore(),woodmartThemeModule.productMoreDescription(),woodmartThemeModule.gridQuantity())}))});var g=d.find(".tabs-navigation-wrapper"),h=g.find("ul");g.on("click",".open-title-menu",function(){var b=a(this);h.hasClass("list-shown")?(b.removeClass("toggle-active"),h.stop().slideUp(300).removeClass("list-shown")):(b.addClass("toggle-active"),h.addClass("list-shown"),setTimeout(function(){a("body").one("click",function(c){var d=c.target;if(!a(d).is(".tabs-navigation-wrapper")&&!a(d).parents().is(".tabs-navigation-wrapper"))return b.removeClass("toggle-active"),h.removeClass("list-shown"),!1})},10))}).on("click","li",function(){var b=g.find(".open-title-menu"),c=a(this).text();h.hasClass("list-shown")&&(b.removeClass("toggle-active").text(c),h.removeClass("list-shown"))})});var c=function(c,d,e,f,g,h){if(f.parent().find(".active-tab-title").removeClass("active-tab-title"),f.addClass("active-tab-title"),g[d])return e.addClass("loading"),void setTimeout(function(){h(g[d]),e.removeClass("loading"),b=!1},300);e.addClass("loading").parent().addClass("element-loading"),f.addClass("loading"),a.ajax({url:woodmart_settings.ajaxurl,data:{atts:c,action:"woodmart_get_products_tab_shortcode"},dataType:"json",method:"POST",success:function(a){g[d]=a,h(a)},error:function(a){console.log("ajax error")},complete:function(){e.removeClass("loading").parent().removeClass("element-loading"),f.removeClass("loading"),b=!1,woodmartThemeModule.compare()}})}},woodmartThemeModule.productsLoadMore=function(){var c,d=!1;a(".woodmart-products-element").each(function(){function b(){r=a(window).height()/2,s=a(window).outerWidth(!0),p=f.outerWidth(!0),j=a(window).scrollTop(),k=f.offset().top-r,l=f.offset().left-z,m=p+f.offset().left+z-x.outerWidth(),q=w.outerHeight(),o=f.height()-q,n=k+o,a(window).width()<=1024&&(l+=35,m-=35),w.css({left:l+"px"}),x.css({left:m+"px"}),j
n?(v.removeClass("show-arrow"),y.addClass("hidden-loader")):(v.addClass("show-arrow"),y.removeClass("hidden-loader"))}var f=a(this),g=[],h=f.find(".woodmart-products-holder"),i=h.data("atts");if(h.hasClass("pagination-arrows")){g[1]={items:h.html(),status:"have-posts"},f.on("recalc",function(){t()}),a(window).resize(function(){t()});var j,k,l,m,n,o,p,q,r,s,t=function(){var a=h.outerHeight();i.elementor&&(a-=parseInt(i.spacing)),f.stop().css({minHeight:a})},u=a("body"),v=f.find(".products-footer"),w=v.find(".woodmart-products-load-prev"),x=v.find(".woodmart-products-load-next"),y=f.find(".woodmart-products-loader"),z=50;u.hasClass("rtl")&&(w=x,x=v.find(".woodmart-products-load-prev")),a(window).scroll(function(){b()}),setTimeout(function(){b()},500),f.find(".woodmart-products-load-prev, .woodmart-products-load-next").off("click").on("click",function(b){if(b.preventDefault(),!d&&!a(this).hasClass("disabled")){d=!0,clearInterval(c);var f=a(this),h=f.parent().parent().prev(),i=f.parent().find(".woodmart-products-load-next"),j=f.parent().find(".woodmart-products-load-prev"),k=h.data("atts"),l="woodmart_get_products_shortcode",m=woodmart_settings.ajaxurl,n="json",o="POST",p=h.attr("data-paged");if(p++,f.hasClass("woodmart-products-load-prev")){if(p<2)return;p-=2}e("arrows",k,m,l,n,o,p,h,f,g,function(b){var d=h.hasClass("products-bordered-grid");if(d||h.addClass("woodmart-animated-products"),b.items&&(h.html(b.items).attr("data-paged",p),h.imagesLoaded().progress(function(){h.parent().trigger("recalc")}),a(document).trigger("wood-images-loaded"),woodmartThemeModule.productHover(),woodmartThemeModule.btnsToolTips(),woodmartThemeModule.productMoreDescription(),woodmartThemeModule.gridQuantity()),a(window).width()<768&&a("html, body").stop().animate({scrollTop:h.offset().top-150},400),!d){var e=0;c=setInterval(function(){h.find(".product-grid-item").eq(e).addClass("woodmart-animated"),e++},100)}p>1?j.removeClass("disabled"):j.addClass("disabled"),"no-more-posts"==b.status?i.addClass("disabled"):i.removeClass("disabled")})}})}}),woodmartThemeModule.clickOnScrollButton(b.shopLoadMoreBtn,!1,woodmart_settings.infinit_scroll_offset),a(document).off("click",".woodmart-products-load-more").on("click",".woodmart-products-load-more",function(c){if(c.preventDefault(),!d){d=!0;var g=a(this),h=g.parent().siblings(".woodmart-products-holder"),i=h.data("source"),j="woodmart_get_products_"+i,k=woodmart_settings.ajaxurl,l="POST",m=h.data("atts"),n=h.data("paged");n++,"main_loop"==i&&(k=a(this).attr("href"),l="GET"),e("load-more",m,k,j,"json",l,n,h,g,[],function(c){c.items&&(h.hasClass("grid-masonry")?f(h,c.items):h.append(c.items),h.imagesLoaded().progress(function(){woodmartThemeModule.clickOnScrollButton(b.shopLoadMoreBtn,!0,woodmart_settings.infinit_scroll_offset)}),a(document).trigger("wood-images-loaded"),h.data("paged",n),woodmartThemeModule.productHover(),woodmartThemeModule.btnsToolTips(),woodmartThemeModule.productMoreDescription(),woodmartThemeModule.gridQuantity()),"main_loop"==i&&(g.attr("href",c.nextPage),"no-more-posts"==c.status&&g.hide().remove()),"no-more-posts"==c.status&&g.hide()})}});var e=function(b,c,e,f,g,h,i,j,k,l,m){var n={atts:c,paged:i,action:f,woo_ajax:1};if(l[i])return j.addClass("loading"),void setTimeout(function(){m(l[i]),j.removeClass("loading"),d=!1},300);if("arrows"==b&&j.addClass("loading").parent().addClass("element-loading"),k.addClass("loading"),"woodmart_get_products_main_loop"==f){n={loop:j.find(".product").last().data("loop"),woo_ajax:1}}a.ajax({url:e,data:n,dataType:g,method:h,success:function(a){l[i]=a,m(a)},error:function(a){console.log("ajax error")},complete:function(){"arrows"==b&&j.removeClass("loading").parent().removeClass("element-loading"),k.removeClass("loading"),d=!1,woodmartThemeModule.compare(),woodmartThemeModule.productHover(),woodmartThemeModule.countDownTimer(),woodmartThemeModule.productMoreDescription(),woodmartThemeModule.gridQuantity()}})},f=function(b,c){var c=a(c);b.append(c).isotope("appended",c),b.imagesLoaded().progress(function(){b.isotope("layout")})}},woodmartThemeModule.compare=function(){var b=a("body"),c=a("a.compare");b.on("click","a.compare",function(){a(this).addClass("loading")}),b.on("yith_woocompare_open_popup",function(){c.removeClass("loading"),b.addClass("compare-opened")}),b.on("click","#cboxClose, #cboxOverlay",function(){b.removeClass("compare-opened")})},woodmartThemeModule.woodmartCompare=function(){function b(b){e.length>0&&e.find(".compare-count").text(b.count),a(".woodmart-compare-table").length>0&&a(".woodmart-compare-table").replaceWith(b.table)}var c="woodmart_compare_list";woodmart_settings.is_multisite&&(c+="_"+woodmart_settings.current_blog_id);var d=a("body"),e=a(".woodmart-compare-info-widget"),f=Cookies.get(c);if(e.length>0&&void 0!==f)try{var g=JSON.parse(f);e.find(".compare-count").text(g.length)}catch(h){console.log("cant parse cookies json")}d.on("click",".woodmart-compare-btn a",function(c){var d=a(this),e=d.data("id"),f=d.data("added-text");if(d.hasClass("added"))return!0;c.preventDefault(),d.addClass("loading"),jQuery.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_add_to_compare",id:e},dataType:"json",method:"GET",success:function(c){c.table?(b(c),a(document).trigger("added_to_compare")):console.log("something wrong loading compare data ",c)},error:function(a){console.log("We cant add to compare. Something wrong with AJAX response. Probably some PHP conflict.")},complete:function(){d.removeClass("loading").addClass("added"),d.find("span").length>0?d.find("span").text(f):d.text(f)}})}),d.on("click",".woodmart-compare-remove",function(c){c.preventDefault();var d=a(this),e=d.data("id");d.addClass("loading"),jQuery.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_remove_from_compare",id:e},dataType:"json",method:"GET",success:function(a){a.table?b(a):console.log("something wrong loading compare data ",a)},error:function(a){console.log("We cant remove product compare. Something wrong with AJAX response. Probably some PHP conflict.")},complete:function(){d.addClass("loading")}})})},woodmartThemeModule.wishList=function(){a("body").on("click",".add_to_wishlist",function(){a(this).parent().addClass("feid-in")})},woodmartThemeModule.product360Button=function(){a(".product-360-button a").magnificPopup({type:"inline",mainClass:"mfp-fade",preloader:!1,tClose:woodmart_settings.close,tLoading:woodmart_settings.loading,fixedContentPos:!1,callbacks:{open:function(){a(window).resize()}}})},woodmartThemeModule.productVideo=function(){a(".product-video-button a").magnificPopup({tClose:woodmart_settings.close,tLoading:woodmart_settings.loading,type:"iframe",iframe:{patterns:{youtube:{index:"youtube.com/",id:"v=",src:"//www.youtube.com/embed/%id%?rel=0&autoplay=1"}}},preloader:!1,fixedContentPos:!1})},woodmartThemeModule.loginTabs=function(){var b=a(".woodmart-register-tabs"),c=b.find(".woodmart-switch-to-register"),d=a(".col-register-text h2"),e=(b.find(".col-login"),b.find(".login-info")),f=(b.find(".col-register"),"active-register"),g=c.data("login"),h=c.data("register"),i=c.data("login-title"),j=c.data("reg-title");c.on("click",function(c){c.preventDefault(),m()?l():k();a(".main-page-wrapper").offset().top;a(window).width()<768&&a("html, body").stop().animate({scrollTop:b.offset().top-90},400)});var k=function(){b.addClass(f),c.text(g),e.length>0&&d.text(i)},l=function(){b.removeClass(f),c.text(h),e.length>0&&d.text(j)},m=function(){return b.hasClass(f)}},woodmartThemeModule.headerCategoriesMenu=function(){if(!(a(window).width()>1024)){var b=a(".header-categories-nav"),c=b.find(".categories-menu-dropdown"),d=b.find(".menu-item-has-children"),e=b.find(".menu-opener"),f=200;d.find("> a").before(''),c.on("click",".drop-category",function(){var b=a(this).parent().find("> .sub-menu-dropdown, >.sub-sub-menu");b.hasClass("child-open")?(a(this).removeClass("act-icon"),b.slideUp(f).removeClass("child-open")):(a(this).addClass("act-icon"),b.slideDown(f).addClass("child-open"))}),b.on("click",".menu-opener",function(a){a.preventDefault(),g()?i():h()}),c.on("click","a",function(a){i(),c.stop().attr("style","")});var g=function(){return c.hasClass("categories-opened")},h=function(){c.addClass("categories-opened").stop().slideDown(f),e.addClass("button-open")},i=function(){c.removeClass("categories-opened").stop().slideUp(f),e.removeClass("button-open")}}},woodmartThemeModule.categoriesMenu=function(){if(!(a(window).width()>1024)){var b=a(".woodmart-product-categories"),c=(b.find("li > ul"),a(".woodmart-show-categories"),200);a("body").on("click",".icon-drop-category",function(b){b.preventDefault(),a(this).closest(".has-sub").find("> ul").hasClass("child-open")?a(this).removeClass("woodmart-act-icon").closest(".has-sub").find("> ul").slideUp(c).removeClass("child-open"):a(this).addClass("woodmart-act-icon").closest(".has-sub").find("> ul").slideDown(c).addClass("child-open")}),a("body").on("click",".woodmart-show-categories",function(a){a.preventDefault(),d()?f():e()}),a("body").on("click",".woodmart-product-categories a",function(c){a(c.target).hasClass("icon-drop-category")||(f(),b.stop().attr("style",""))});var d=function(){return a(".woodmart-product-categories").hasClass("categories-opened")},e=function(){a(".woodmart-product-categories").addClass("categories-opened").stop().slideDown(c),a(".woodmart-show-categories").addClass("button-open")},f=function(){a(".woodmart-product-categories").removeClass("categories-opened").stop().slideUp(c),a(".woodmart-show-categories").removeClass("button-open")}}},woodmartThemeModule.categoriesMenuBtns=function(){if(!(a(window).width()>1024)){var b=a(".woodmart-product-categories"),c=b.find("li > ul");b.addClass("responsive-cateogires"),c.parent().addClass("has-sub").find("> .category-nav-link").prepend('')}},woodmartThemeModule.filtersArea=function(){var c=a(".filters-area"),d=(a(".open-filters"),200);a("body").on("click",".open-filters",function(a){a.preventDefault(),e()?f():(woodmartThemeModule.openFilters(d),setTimeout(function(){woodmartThemeModule.shopLoader()},d))}),"no"==woodmart_settings.shop_filters_close&&a("body").on("click",b.ajaxLinks,function(){e()&&f()});var e=function(){return c=a(".filters-area"),c.hasClass("filters-opened")},f=function(){c=a(".filters-area"),c.removeClass("filters-opened"),c.stop().slideUp(d),a(".open-filters").removeClass("btn-opened")}},woodmartThemeModule.openFilters=function(b){var c=a(".filters-area");c.stop().slideDown(b),a(".open-filters").addClass("btn-opened"),setTimeout(function(){c.addClass("filters-opened"),a("body").removeClass("body-filters-opened"),woodmartThemeModule.nanoScroller(),a(document).trigger("wood-images-loaded")},b)},woodmartThemeModule.shopPageInit=function(){woodmartThemeModule.shopMasonry(),woodmartThemeModule.ajaxSearch(),woodmartThemeModule.productHover(),woodmartThemeModule.btnsToolTips(),woodmartThemeModule.compare(),woodmartThemeModule.filterDropdowns(),woodmartThemeModule.sortByWidget(),woodmartThemeModule.categoriesMenuBtns(),woodmartThemeModule.categoriesAccordion(),woodmartThemeModule.woocommercePriceSlider(),woodmartThemeModule.countDownTimer(),woodmartThemeModule.nanoScroller(),woodmartThemeModule.shopLoader(),woodmartThemeModule.stickySidebarBtn(),woodmartThemeModule.productFilters(),woodmartThemeModule.productMoreDescription(),woodmartThemeModule.gridQuantity(),woodmartThemeModule.swatchesLimit(),woodmartThemeModule.categoriesDropdowns(),woodmartThemeModule.clickOnScrollButton(b.shopLoadMoreBtn,!1,woodmart_settings.infinit_scroll_offset),a("body > .tooltip").remove(),a(document.body).on("updated_wc_div",function(){a(document).trigger("wood-images-loaded")}),a(document).trigger("resize.vcRowBehaviour")},woodmartThemeModule.ajaxFilters=function(){if(a("body").hasClass("woodmart-ajax-shop-on")&&void 0!==a.fn.pjax&&!a("body").hasClass("single-product")){var c=this,d=!1;a(".products");a("body").on("click",".post-type-archive-product .products-footer .woocommerce-pagination a",function(a){e(!0)}),a(document).pjax(b.ajaxLinks,".main-page-wrapper",{timeout:woodmart_settings.pjax_timeout,scrollTo:!1}),"click"==woodmart_settings.price_filter_action?a(document).on("click",".widget_price_filter form .button",function(){var b=a(".widget_price_filter form");return a.pjax({container:".main-page-wrapper",timeout:woodmart_settings.pjax_timeout,url:b.attr("action"),data:b.serialize(),scrollTo:!1}),!1}):"submit"==woodmart_settings.price_filter_action&&a(document).on("submit",".widget_price_filter form",function(b){var c=a(".main-page-wrapper");a.pjax.submit(b,c)}),a(document).on("pjax:error",function(a,b,c,d){console.log("pjax error "+c)}),a(document).on("pjax:start",function(b,c){a(".site-content").removeClass("ajax-loaded"),a(".site-content").addClass("ajax-loading"),woodmartThemeModule.hideShopSidebar()}),a(document).on("pjax:complete",function(b,d,f){c.shopPageInit(),e(!1),a(document).trigger("wood-images-loaded"),a(".woodmart-sidebar-content").scroll(function(){a(document).trigger("wood-images-loaded")}),a(".site-content").removeClass("ajax-loading"),"undefined"!=typeof woodmart_wpml_js_data&&woodmart_wpml_js_data.languages&&a.each(woodmart_wpml_js_data.languages,function(b,c){a(".wpml-ls-item-"+c.code+" .wpml-ls-link").attr("href",c.url)})}),a(document).on("pjax:beforeReplace",function(b,c){a(".filters-area").hasClass("filters-opened")&&"yes"==woodmart_settings.shop_filters_close&&(d=!0,a("body").addClass("body-filters-opened"))}),a(document).on("pjax:end",function(b,c,e){d&&(a(".filters-area").css("display","block"),woodmartThemeModule.openFilters(200),d=!1),a(".site-content").removeClass("ajax-loading"),a(".site-content").addClass("ajax-loaded")});var e=function(b){if("no"==woodmart_settings.ajax_scroll&&0==b)return!1;var c=a(woodmart_settings.ajax_scroll_class),d=c.offset().top-woodmart_settings.ajax_scroll_offset;a("html, body").stop().animate({scrollTop:d},400)}}},woodmartThemeModule.cartWidget=function(){var b=a(".cart-widget-opener"),c=(b.find("a"),a("body")),d=a(".cart-widget-side"),e=a(".woodmart-close-side");b.on("click",function(a){i()||j()||a.preventDefault(),h()?f():setTimeout(function(){g()},10)}),c.on("click touchstart",".woodmart-close-side",function(){h()&&f()}),c.on("click",".close-side-widget",function(a){a.preventDefault(),h()&&f()}),a(document).keyup(function(a){27===a.keyCode&&h()&&f()});var f=function(){d.removeClass("woodmart-cart-opened"),e.removeClass("woodmart-close-side-opened")},g=function(){if(i()||j())return!1;d.addClass("woodmart-cart-opened"),e.addClass("woodmart-close-side-opened")},h=function(){return d.hasClass("woodmart-cart-opened")},i=function(){return a("body").hasClass("woocommerce-cart")},j=function(){return a("body").hasClass("woocommerce-checkout")}},woodmartThemeModule.woocommerceQuantity=function(){String.prototype.getDecimals||(String.prototype.getDecimals=function(){var a=this,b=(""+a).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return b?Math.max(0,(b[1]?b[1].length:0)-(b[2]?+b[2]:0)):0}),a(document).on("click",".plus, .minus",function(){var b=a(this).closest(".quantity").find(".qty"),c=parseFloat(b.val()),d=parseFloat(b.attr("max")),e=parseFloat(b.attr("min")),f=b.attr("step");c&&""!==c&&"NaN"!==c||(c=0),""!==d&&"NaN"!==d||(d=""),""!==e&&"NaN"!==e||(e=0),"any"!==f&&""!==f&&void 0!==f&&"NaN"!==parseFloat(f)||(f="1"),a(this).is(".plus")?d&&c>=d?b.val(d):b.val((c+parseFloat(f)).toFixed(f.getDecimals())):e&&c<=e?b.val(e):c>0&&b.val((c-parseFloat(f)).toFixed(f.getDecimals())),b.trigger("change")})},woodmartThemeModule.onRemoveFromCart=function(){"no"!==woodmart_settings.woocommerce_ajax_add_to_cart&&a(document).on("click",".widget_shopping_cart .remove",function(b){b.preventDefault(),a(this).parent().addClass("removing-process")})},woodmartThemeModule.woocommerceComments=function(){var b=window.location.hash,c=window.location.href;(b.toLowerCase().indexOf("comment-")>=0||"#reviews"===b||"#tab-reviews"===b||c.indexOf("comment-page-")>0||c.indexOf("cpage=")>0)&&(setTimeout(function(){window.scrollTo(0,0)},1),setTimeout(function(){a(b).length>0&&a("html, body").stop().animate({scrollTop:a(b).offset().top-100},400)},10))},woodmartThemeModule.woocommerceWrappTable=function(){a(".shop_table:not(.shop_table_responsive):not(.woocommerce-checkout-review-order-table)").wrap("")},woodmartThemeModule.productLoaderPosition=function(){var b=function(){a(".woodmart-products-loader").each(function(){var b=a(this),c=b.parent();0!=b.length&&b.css("left",c.offset().left+c.outerWidth()/2)})};a(window).on("resize",b),b()},woodmartThemeModule.initZoom=function(){function b(a){a.find("img").data("large_image_width")>a.width()&&(a.trigger("zoom.destroy"),a.zoom(d))}var c=a(".woocommerce-product-gallery__wrapper:not(.quick-view-gallery)");if("yes"!=woodmart_settings.zoom_enable)return!1;var d={touch:!1};"ontouchstart"in window&&(d.on="click"),a(".woocommerce-product-gallery").hasClass("thumbs-position-bottom")||a(".woocommerce-product-gallery").hasClass("thumbs-position-left")?c.on("changed.owl.carousel",function(a){b(c.find(".product-image-wrap").eq(a.item.index).find(".woocommerce-product-gallery__image"))}):c.find(".product-image-wrap").each(function(){b(a(this).find(".woocommerce-product-gallery__image"))})},woodmartThemeModule.productMoreDescription=function(){a(".woodmart-more-desc").each(function(){var b=a(this),c=b.find(".woodmart-more-desc-inner"),d=b.outerHeight(),e=c.outerHeight(),f=e-d;b.hasClass("woodmart-more-desc-active")||(f>30?(b.addClass("woodmart-more-desc-active"),b.append('more')):f>0&&b.css("height",d+f))}),a("body").on("click",".woodmart-more-desc-btn",function(b){b.preventDefault(),a(this).parent().addClass("woodmart-more-desc-full"),woodmartThemeModule.productHoverRecalc(a(this).parents(".woodmart-hover-base"))})},woodmartThemeModule.productHoverRecalc=function(a){if(!a.hasClass("product-in-carousel")){var b=a.find(".fade-in-block").outerHeight();a.find(".content-product-imagin").css({marginBottom:-b}),a.addClass("hover-ready")}},woodmartThemeModule.productHover=function(){a(".woodmart-hover-base").each(function(){var b=a(this);b.imagesLoaded(function(){woodmartThemeModule.productHoverRecalc(b)})}),a(window).width()<=1024&&(a(".woodmart-hover-base").on("click",function(b){var c="state-hover";a(this).hasClass(c)||"no"!=woodmart_settings.base_hover_mobile_click||(b.preventDefault(),a("."+c).removeClass(c),a(this).addClass(c))}),a(document).on("click touchstart",function(b){0==a(b.target).closest(".state-hover").length&&a(".state-hover").removeClass("state-hover")})),a(".woodmart-hover-base").each(function(){var b=a(this),c=b.find(".woodmart-add-btn"),d=b.outerWidth();woodmart_settings.hover_width_small&&(d<255||a(window).width()<=1024?(b.addClass("add-small-content"),b.hasClass("woodmart-hover-base")&&c.addClass("wd-action-btn wd-add-cart-btn wd-style-icon")):b.hasClass("woodmart-hover-base")&&(a("body").hasClass("catalog-mode-on")||a("body").hasClass("login-see-prices"))&&b.find(".wd-bottom-actions .wd-action-btn").removeClass("wd-style-icon").addClass("wd-style-text"))})},woodmartThemeModule.shopMasonry=function(){if(void 0!==a.fn.isotope&&void 0!==a.fn.packery&&void 0!==a.fn.imagesLoaded){var b=a(".elements-grid.grid-masonry");b.imagesLoaded(function(){b.isotope({isOriginLeft:!a("body").hasClass("rtl"),itemSelector:".category-grid-item, .product-grid-item"})}),a(window).resize(function(){var b=a(".categories-masonry"),c=b.hasClass("categories-style-masonry")?".category-grid-item":".col-lg-3.category-grid-item";b.imagesLoaded(function(){b.packery({resizable:!1,isOriginLeft:!a("body").hasClass("rtl"),packery:{gutter:0,columnWidth:c},itemSelector:".category-grid-item"})})})}},woodmartThemeModule.categoriesAccordion=function(){if("no"!=woodmart_settings.categories_toggle){var b=a(".widget_product_categories"),c=b.find(".product-categories"),d=300;c.find(".cat-parent").each(function(){a(this).find(" > .woodmart-cats-toggle").length>0||0!=a(this).find(" > .children").length&&0!=a(this).find(" > .children > *").length&&a(this).append('')}),c.on("click",".woodmart-cats-toggle",function(){var b=a(this),c=b.prev();c.hasClass("list-shown")?(b.removeClass("toggle-active"),c.stop().slideUp(d).removeClass("list-shown")):(c.parent().parent().find("> li > .list-shown").slideUp().removeClass("list-shown"),c.parent().parent().find("> li > .toggle-active").removeClass("toggle-active"),b.addClass("toggle-active"),c.stop().slideDown(d).addClass("list-shown"))}),c.find("li.current-cat.cat-parent, li.current-cat-parent").length>0&&c.find("li.current-cat.cat-parent, li.current-cat-parent").find("> .woodmart-cats-toggle").click()}},woodmartThemeModule.woocommercePriceSlider=function(){
if("undefined"==typeof woocommerce_price_slider_params||a(".price_slider_amount #min_price").length<1||!a.fn.slider)return!1;var b=a(".price_slider");if(void 0===b.slider("instance")){a("input#min_price, input#max_price").hide(),a(".price_slider, .price_label").show();var c=a(".price_slider_amount #min_price").data("min"),d=a(".price_slider_amount #max_price").data("max"),e=parseInt(c,10),f=parseInt(d,10);a(".products").attr("data-min_price")&&a(".products").attr("data-min_price").length>0&&(e=parseInt(a(".products").attr("data-min_price"),10)),a(".products").attr("data-max_price")&&a(".products").attr("data-max_price").length>0&&(f=parseInt(a(".products").attr("data-max_price"),10)),b.slider({range:!0,animate:!0,min:c,max:d,values:[e,f],create:function(){a(".price_slider_amount #min_price").val(e),a(".price_slider_amount #max_price").val(f),a(document.body).trigger("price_slider_create",[e,f])},slide:function(b,c){a("input#min_price").val(c.values[0]),a("input#max_price").val(c.values[1]),a(document.body).trigger("price_slider_slide",[c.values[0],c.values[1]])},change:function(b,c){a(document.body).trigger("price_slider_change",[c.values[0],c.values[1]])}}),setTimeout(function(){a(document.body).trigger("price_slider_create",[e,f]),b.find(".ui-slider-range").length>1&&b.find(".ui-slider-range").first().remove()},10)}}}(jQuery),jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.isEditMode()&&(elementorFrontend.hooks.addAction("frontend/element_ready/wd_products.default",function(a,b){woodmartThemeModule.swatchesOnGrid(),woodmartThemeModule.quickViewInit(),woodmartThemeModule.quickShop(),woodmartThemeModule.btnsToolTips(),woodmartThemeModule.countDownTimer(),woodmartThemeModule.addToCart(),woodmartThemeModule.owlCarouselInit(),woodmartThemeModule.lazyLoading(),woodmartThemeModule.productHover(),woodmartThemeModule.productMoreDescription(),woodmartThemeModule.gridQuantity(),woodmartThemeModule.shopMasonry(),woodmartThemeModule.productsLoadMore()}),elementorFrontend.hooks.addAction("frontend/element_ready/wd_products_tabs.default",function(a,b){woodmartThemeModule.productsTabs(),woodmartThemeModule.swatchesOnGrid(),woodmartThemeModule.quickViewInit(),woodmartThemeModule.quickShop(),woodmartThemeModule.btnsToolTips(),woodmartThemeModule.countDownTimer(),woodmartThemeModule.addToCart(),woodmartThemeModule.owlCarouselInit(),woodmartThemeModule.lazyLoading(),woodmartThemeModule.productHover(),woodmartThemeModule.productMoreDescription(),woodmartThemeModule.gridQuantity(),woodmartThemeModule.shopMasonry(),woodmartThemeModule.productsLoadMore()}),elementorFrontend.hooks.addAction("frontend/element_ready/wd_product_categories.default",function(a,b){woodmartThemeModule.owlCarouselInit(),woodmartThemeModule.lazyLoading()}),elementorFrontend.hooks.addAction("frontend/element_ready/wd_products_brands.default",function(a,b){woodmartThemeModule.owlCarouselInit(),woodmartThemeModule.lazyLoading(),woodmartThemeModule.shopMasonry()}),elementorFrontend.hooks.addAction("frontend/element_ready/wd_product_filters.default",function(a,b){woodmartThemeModule.productFilters()}))}),jQuery(document).ready(function(){woodmartThemeModule.init()});