(function(m){"use strict";var c=c||{};c.init=function(){c.$body=m(document.body),c.$window=m(window),c.$header=m("#site-header");this.preloader();this.toggleModals();this.toggleOffPopup();this.stickyHeader();this.instanceSearch();this.focusSearchField();this.menuSideBar();this.scrollSection();this.miniCartQuantity();this.miniCartHasShipping();this.closeTopbar();this.ajaxCounter();this.blogFilterAjax();this.blogLoadingAjax();this.postFound();this.postsRelated();this.addWishlist();this.productLoopHover();this.productLoopATCForm();this.productLoopHoverSlider();this.productLoopHoverZoom();this.productQuickView();this.productQuantityDropdown();this.productQuantityNumber();this.updateQuantityAuto();this.productLoopFormAJAX();this.productAttribute();this.productLoaded();this.productVideoPopup();this.productLightBox();this.reviewProduct();this.stickyAddToCart();this.openMiniCartPanel();this.addedToCartNotice();this.productPopupATC();this.addedToWishlistNotice();this.addedToCompareNotice();this.addToCartSingleAjax();this.cartPageQuantity();this.crossSellProductsCarousel();this.accountOrder();this.loginPanel();this.loginPanelAuthenticate();this.newsletterPopup();this.backToTop();this.recentlyViewedProducts();this.footerDropdown();this.historyBack();this.inlineStyle();this.lazyLoadImages()};c.preloader=function(){var t=m("#preloader");if(!t.length){return}var o=false;m(document.body).on("click","a[href^=mailto], a[href^=tel]",function(){o=true});m(window).on("beforeunload",function(e){if(!o){t.fadeIn()}o=false});setTimeout(function(){t.fadeOut()},200);window.onpageshow=function(e){if(e.persisted){setTimeout(function(){t.fadeOut()},200)}}};c.toggleModals=function(){m(document.body).on("click",'[data-toggle="modal"]',function(e){var t="#"+m(this).data("target");if(m(t).hasClass("open")){c.closeModal(t)}else if(c.openModal(t)){e.preventDefault()}}).on("click",".rz-modal .button-close, .rz-modal .off-modal-layer",function(e){e.preventDefault();c.closeModal(this)}).on("keyup",function(e){if(e.keyCode===27){c.closeModal()}})};c.openModal=function(e){var t=m(e);if(!t.length){return false}t.fadeIn();t.addClass("open");m(document.body).addClass("modal-opened "+t.attr("id")+"-opened").trigger("razzi_modal_opened",[t]);if(t.attr("id")=="search-modal"){m(".ra-search-modal .search-field").focus()}else if(t.attr("id")=="account-modal"){m('.woocommerce-account .input-text[name="username"]').focus()}var o=window.innerWidth-document.documentElement.clientWidth;if(document.documentElement.clientWidth<767){o=0}m(document.body).css({"padding-right":o,overflow:"hidden"});if(m(document.body).hasClass("header-transparent")){c.$header.css({right:o})}if(m(document.body).hasClass("header-sticky")){m(document.body).find("#site-header.minimized").css({right:o,transition:"none"})}return true};c.closeModal=function(e){if(!e){m(".rz-modal").removeClass("open").fadeOut();m(".rz-modal").each(function(){var e=m(this);if(!e.hasClass("open")){return}e.removeClass("open").fadeOut();m(document.body).removeClass(e.attr("id")+"-opened")})}else{e=m(e).closest(".rz-modal");e.removeClass("open loaded").fadeOut();m(document.body).removeClass(e.attr("id")+"-opened")}m(document.body).removeAttr("style");c.$header.removeAttr("style");m(document.body).removeClass("modal-opened").trigger("razzi_modal_closed",[e])};c.toggleOffPopup=function(){m(document.body).on("click",'[data-toggle="off-popup"]',function(e){var t="#"+m(this).data("target");if(m(t).hasClass("open")){c.closeOffPopup(t)}else if(c.openOffPopup(t)){e.preventDefault()}}).on("click",".offscreen-popup .button-close, .offscreen-popup .backdrop",function(e){e.preventDefault();c.closeOffPopup(this)}).on("keyup",function(e){if(e.keyCode===27){c.closeOffPopup()}})};c.openOffPopup=function(e){var t=m(e);if(!t.length){return false}t.fadeIn();t.addClass("open");m(document.body).addClass("offpopup-opened "+t.attr("id")+"-opened").trigger("razzi_off_popup_opened",[t]);return true};c.closeOffPopup=function(e){if(!e){m(".offscreen-popup").each(function(){var e=m(this);if(!e.hasClass("open")){return}e.removeClass("open").fadeOut();m(document.body).removeClass(e.attr("id")+"-opened")})}else{e=m(e).closest(".offscreen-popup");e.removeClass("open").fadeOut();m(document.body).removeClass(e.attr("id")+"-opened")}m(document.body).removeClass("offpopup-opened").trigger("razzi_off_popup_closed",[e])};c.instanceSearch=function(){if(razziData.header_ajax_search!="1"){return}var l=m("#search-modal, .header-search");l.on("change",".product-cat-dd",function(){var e=m(this).find("option:selected").text().trim();l.find(".product-cat-label .label").html(e)});l.find(".products-search").on("submit",function(){if(m(this).find(".product-cat-dd").val()=="0"){m(this).find(".product-cat-dd").removeAttr("name")}});var u=null,p={},f=l.find("form");l.on("keyup",".search-field",function(e){var t=false;if(typeof e.which=="undefined"){t=true}else if(typeof e.which=="number"&&e.which>0){t=!e.ctrlKey&&!e.metaKey&&!e.altKey}if(!t){return}if(u){u.abort()}l.find(".result-list-found, .result-list-not-found").html("");l.find(".result-title").addClass("not-found");var o=m(this).closest(".form-search"),i=o.find("input.search-field");if(i.val().length<2){o.removeClass("searching searched actived found-products found-no-product invalid-length")}a(o)}).on("change",".product-cat-dd",function(){if(u){u.abort()}l.find(".result-list-found").html("");l.find(".result-title").addClass("not-found");var e=m(this).closest(".form-search");a(e)}).on("focus",".product-cat-dd",function(){if(u){u.abort()}l.find(".product-cat-label").addClass("border-color-dark")}).on("focusout",".product-cat-dd",function(){if(u){u.abort()}l.find(".product-cat-label").removeClass("border-color-dark")}).on("focusout",".search-field",function(){var e=m(this).closest(".form-search"),t=e.find("input.search-field");if(t.val().length<2){e.removeClass("searching searched actived found-products found-no-product invalid-length")}});l.on("click",".close-search-results",function(e){e.preventDefault();l.find(".search-field").val("");l.find(".form-search").removeClass("searching searched actived found-products found-no-product invalid-length");l.find(".result-title").addClass("not-found");l.find(".result-list-found").html("")});m(document).on("click",function(e){if(m("#search-modal").find(".form-search").hasClass("actived")){return}var t=e.target;if(m(t).closest(".products-search").length<1){f.removeClass("searching actived found-products found-no-product invalid-length")}});function a(o){var e=o.find("input.search-field"),t=e.val(),i=0,a=o.find(".search-results");if(l.hasClass("ra-search-form")){a=l.find(".search-results")}if(o.find(".product-cat-dd").length>0){i=o.find(".product-cat-dd").val()}if(t.trim().length<2){o.removeClass("searching found-products found-no-product").addClass("invalid-length");return}o.removeClass("found-products found-no-product").addClass("searching");var r=t+i,n=f.attr("action")+"?"+f.serialize();if(r in p){var s=p[r];o.removeClass("searching");o.addClass("found-products");a.html(s.products);m(document.body).trigger("razzi_ajax_search_request_success",[a]);o.removeClass("invalid-length");o.addClass("searched actived")}else{var d={term:t,cat:i,ajax_search_number:razziData.header_search_number,search_type:razziData.search_content_type},c=razziData.ajax_url.toString().replace("%%endpoint%%","razzi_instance_search_form");u=m.post(c,d,function(e){var t=e.data;o.removeClass("searching");o.addClass("found-products");a.html(t);o.removeClass("invalid-length");m(document.body).trigger("razzi_ajax_search_request_success",[a]);p[r]={found:true,products:t};a.find(".view-more a").attr("href",n);o.addClass("searched actived")})}}};c.getOptionsDropdown=function(){var e={onChange:function(e,t){c.updateCartAJAX(e,t)}};return e};c.updateCartAJAX=function(e,t){var o=m(t).closest(".woocommerce-mini-cart-item"),i=o.find("a.remove").data("cart_item_key"),a=o.find(".woocommerce-cart-item__qty").data("nonce"),r=wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","update_cart_item");if(m.fn.block){o.block({message:null,overlayCSS:{opacity:.6,background:"#fff"}})}m.post(r,{cart_item_key:i,qty:e,security:a},function(e){if(!e||!e.fragments){return}if(m.fn.unblock){o.unblock()}m(document.body).trigger("added_to_cart",[e.fragments,e.cart_hash]);if(m(".single-product div.product").find(".razzi-free-shipping-bar").length&&m(e.fragments["div.widget_shopping_cart_content"]).length&&m(e.fragments["div.widget_shopping_cart_content"]).find(".razzi-free-shipping-bar").length){m(".single-product div.product").find(".razzi-free-shipping-bar").replaceWith(m(e.fragments["div.widget_shopping_cart_content"]).find(".razzi-free-shipping-bar"))}}).fail(function(){if(m.fn.unblock){o.unblock()}return})};c.miniCartQuantity=function(){if(typeof wc_add_to_cart_params===undefined){m(".woocommerce-mini-cart-item .quantity .qty").prop("disabled",true);m(document.body).on("wc_fragments_refreshed removed_from_cart",function(){m(".woocommerce-mini-cart-item .quantity .qty").prop("disabled",true)});return}if(m.fn.quantityDropdown&&!c.$body.hasClass("product-qty-number")){var e=c.getOptionsDropdown();m(".woocommerce-mini-cart-item .quantity .qty").quantityDropdown(e);m(document.body).on("wc_fragments_refreshed removed_from_cart added_to_cart",function(){m(".woocommerce-mini-cart-item .quantity .qty").quantityDropdown(e)})}};c.miniCartHasShipping=function(){if(m("#cart-modal").find(".razzi-free-shipping-bar").length){m("#cart-modal").addClass("has-free-shipping-bar")}};c.cartPageQuantity=function(){if(typeof wc_add_to_cart_params===undefined){m(".woocommerce-cart-form__cart-item .quantity .qty").prop("disabled",true);m(document.body).on("wc_fragments_refreshed removed_from_cart",function(){m(".woocommerce-cart-form__cart-item .quantity .qty").prop("disabled",true)});return}if(m.fn.quantityDropdown&&!c.$body.hasClass("product-qty-number")){var e="";m(".woocommerce-cart-form__cart-item .quantity .qty").quantityDropdown(e);m(document.body).on("wc_fragments_refreshed removed_from_cart added_to_cart",function(){m(".woocommerce-cart-form__cart-item .quantity .qty").quantityDropdown(e)})}};c.productQuantityDropdown=function(){if(m.fn.quantityDropdown&&!c.$body.hasClass("product-qty-number")){m("div.product, .razzi-sticky-add-to-cart").find(".quantity .qty").quantityDropdown();m(document.body).on("wc_fragments_refreshed removed_from_cart added_to_cart",function(){m("div.product, .razzi-sticky-add-to-cart").find(".quantity .qty").quantityDropdown()})}};c.productQuantityNumber=function(){if(!c.$body.hasClass("product-qty-number")){return}c.$body.on("click",".razzi-qty-button",function(e){e.preventDefault();var t=m(this),o=t.siblings(".qty"),i=0,a=parseFloat(o.attr("min")),r=parseFloat(o.attr("max")),n=parseFloat(o.attr("step"));if(o.val()!==""){i=parseFloat(o.val())}else if(o.attr("placeholder")!==""){i=parseFloat(o.attr("placeholder"))}a=a?a:0;r=r?r:i+1;if(t.hasClass("decrease")&&i>a){o.val(i-n);o.trigger("change")}if(t.hasClass("increase")&&i');t.after('
');t.addClass("swiper-wrapper");t.find("li.product").addClass("swiper-slide");new Swiper(e.find(".linked-products-carousel"),{loop:false,spaceBetween:30,scrollbar:{el:e.find(".swiper-scrollbar"),hide:false,draggable:true},on:{init:function(){this.$el.css("opacity",1)}},breakpoints:{300:{slidesPerView:razziData.mobile_portrait,slidesPerGroup:razziData.mobile_portrait,spaceBetween:20},480:{slidesPerView:razziData.mobile_landscape,slidesPerGroup:razziData.mobile_landscape},768:{spaceBetween:20,slidesPerView:3,slidesPerGroup:3},992:{slidesPerView:3,slidesPerGroup:3},1200:{slidesPerView:4,slidesPerGroup:4}}})};c.blogFilterAjax=function(){c.$body.find("#razzi-posts__taxs-list").on("click","a",function(e){e.preventDefault();var t=m(this),o=t.attr("href");c.$body.trigger("razzi_blog_filter_ajax",o,m(this));c.$body.on("razzi_ajax_filter_request_success",function(e,t){m(this).addClass("selected");c.postFound()})});c.$body.on("razzi_blog_filter_ajax",function(e,t){var o=m(".razzi-posts__wrapper"),i=m("#razzi-posts__taxs-list"),a=m("#page-header");m(".razzi-posts__loading").addClass("show");if("?"==t.slice(-1)){t=t.slice(0,-1)}t=t.replace(/%2C/g,",");history.pushState(null,null,t);if(c.ajaxXHR){c.ajaxXHR.abort()}c.ajaxXHR=m.get(t,function(e){o.replaceWith(m(e).find(".razzi-posts__wrapper"));i.html(m(e).find("#razzi-posts__taxs-list").html());a.replaceWith(m(e).find("#page-header"));m(".razzi-posts__loading").removeClass("show");m(".razzi-posts__wrapper .blog-wrapper").addClass("animated razziFadeInUp");c.$body.trigger("razzi_ajax_filter_request_success",[e,t])},"html")})};c.blogLoadingAjax=function(){c.$body.on("click","#razzi-blog-previous-ajax a",function(e){e.preventDefault();var r=m(".razzi-posts__found");if(m(this).data("requestRunning")){return}m(this).data("requestRunning",true);var t=m(this).closest("#primary"),n=t.find(".razzi-posts__list"),s=n.children(".blog-wrapper").length,d=m(this).parents(".load-navigation");d.addClass("loading");m.get(m(this).attr("href"),function(e){var t=m(e).find(".razzi-posts__list").children(".blog-wrapper"),o=t.length+s,i=m(e).find(".load-navigation").html();d.addClass("loading");d.html(i);n.append(t);d.find("a").data("requestRunning",false);for(var a=0;a a").prepend('');t.find(".click-item li.menu-item-has-children > a").on("click",function(e){e.preventDefault();m(this).closest("li").siblings().find("ul.sub-menu, ul.dropdown-submenu").slideUp();m(this).closest("li").siblings().removeClass("active");m(this).closest("li").children("ul.sub-menu, ul.dropdown-submenu").slideToggle();m(this).closest("li").toggleClass("active");return false});t.find(".click-icon li.menu-item-has-children > a > .toggle-menu-children").on("click",function(e){e.preventDefault();m(this).closest("li").siblings().find("ul.sub-menu, ul.dropdown-submenu").slideUp();m(this).closest("li").siblings().removeClass("active");m(this).closest("li").children("ul.sub-menu, ul.dropdown-submenu").slideToggle();m(this).closest("li").toggleClass("active");return false});m(".header-v7 .main-navigation").find("li.menu-item > a").on("click",function(e){e.preventDefault();m(this).closest("li").siblings().removeClass("active");m(this).closest("li").toggleClass("active")})};c.closeTopbar=function(){m(document.body).on("click",".razzi-topbar__close",function(e){e.preventDefault();m("#topbar, #topbar-mobile").slideUp()})};c.ajaxCounter=function(){m(document).on("added_to_wishlist removed_from_wishlist",function(){var e=razziData.ajax_url.toString().replace("%%endpoint%%","update_wishlist_count");m.get(e,function(e){m(".wishlist-counter").html(e.count)})})};c.stickyHeader=function(){if(!c.$body.hasClass("header-sticky")){return}var t=c.$body.hasClass("header-transparent"),o=m("#site-header-minimized"),e=c.$header.find(".header-contents").hasClass("header-main")?c.$header.find(".header-main").outerHeight():0,i=c.$header.find(".header-contents").hasClass("header-bottom")?c.$header.find(".header-bottom").outerHeight():0,a=c.$header.find(".header-contents").hasClass("header-mobile")?c.$header.find(".header-mobile").outerHeight():0,r=e+i,n=c.$header.outerHeight(true),s=c.$body.outerHeight(true),d=c.$window.height();if(c.$header.hasClass("header-bottom-no-sticky")){r=e}else if(c.$header.hasClass("header-main-no-sticky")){r=i}if(c.$body.hasClass("header-v6")){r=i}if(t){c.$header.addClass("has-transparent")}if(c.$body.hasClass("header-v12")&&c.$header.find(".header-department").length&&c.$header.find(".header-department").hasClass("show_menu_department")){if(c.$header.find(".department-content").length){n+=c.$header.find(".department-content").outerHeight(true)+100}}c.$window.on("scroll",function(){var e=c.$window.scrollTop();if(s<=n+d){return}if(e>n){c.$header.addClass("minimized");m("#razzi-header-minimized").addClass("minimized");c.$body.addClass("sticky-minimized");if(t){c.$body.removeClass("header-transparent")}if(c.$window.width()>992){o.css("height",r)}else{o.css("height",a)}}else{c.$header.removeClass("minimized");m("#razzi-header-minimized").removeClass("minimized");c.$body.removeClass("sticky-minimized");if(t){c.$body.addClass("header-transparent")}o.removeAttr("style")}})};c.addWishlist=function(){c.$body.on("click","a.add_to_wishlist",function(){m(this).addClass("loading")});c.$body.on("added_to_wishlist",function(e,t){e.preventDefault();m("ul.products li.product .yith-wcwl-add-button a").removeClass("loading")});c.$body.on("added_to_wishlist removed_from_wishlist cart_page_refreshed",function(){var e=razziData.ajax_url.toString().replace("%%endpoint%%","update_wishlist_item");m.post(e,function(e){if(e==0){c.$header.find(".header-wishlist .wishlist-counter").addClass("hidden");c.$body.find(".rz-navigation-bar .wishlist-counter").addClass("hidden")}else{c.$header.find(".header-wishlist .wishlist-counter").removeClass("hidden");c.$body.find(".rz-navigation-bar .wishlist-counter").removeClass("hidden")}c.$header.find(".header-wishlist .wishlist-counter").html(e);c.$body.find(".rz-navigation-bar .wishlist-counter").html(e)})})};c.productLoopHover=function(){if(typeof razziData.product_loop_layout==="undefined"){return}if(razziData.product_loop_layout!=="8"){return}var a=false;c.$window.on("resize",function(){if(c.$window.width()<992){a=true}else{a=false}}).trigger("resize");c.$body.on("mouseover",".product-inner",function(){if(a){return}if(m(this).hasClass("has-transform")){return}if(m(this).closest("ul.products").hasClass("shortcode-element")){return}var e=m(this).find(".product-loop__buttons"),t=m(this).find(".product-summary");m(this).addClass("has-transform");r(e,t,0)});m(document).on("found_variation",function(e,t){if(a){return}if(!m(e["target"]).closest(".product-inner").hasClass("has-transform")){return}var o=m(e["target"]).closest(".product-inner").find(".product-loop__buttons"),i=m(e["target"]).closest(".product-inner").find(".product-summary");r(o,i,100)});m(document).on("reset_data",function(e,t){if(a){return}if(!m(e["target"]).closest(".product-inner").hasClass("has-transform")){return}var o=m(e["target"]).closest(".product-inner").find(".product-loop__buttons"),i=m(e["target"]).closest(".product-inner").find(".product-summary");r(o,i,100)});function r(t,o,e){setTimeout(function(){var e=t.outerHeight();o.css({"-webkit-transform":"translateY(-"+e+"px)",transform:"translateY(-"+e+"px)"})},e)}m(document.body).on("tawcvs_initialized",function(e,t){if(t.hasClass("variations_form_loop")&&m.fn.tooltip){t.find(".swatch").tooltip({disabled:true})}})};c.productLoopFormAJAX=function(){if(typeof razziData.product_loop_layout==="undefined"){return}if(typeof razziData.product_loop_variation_ajax==="undefined"){return}if(razziData.product_loop_layout!=="9"){return}if(razziData.product_loop_variation_ajax!=="1"){return}c.$body.on("click",".product-quick-shop-button",function(e){e.preventDefault();if(m(this).hasClass("has-content")){return}m(this).addClass("has-content");var t=m(this).data("product_id"),o=m(this).closest("li.product").find(".product-inner"),i=m(this).closest("li.product").find(".product-loop__form");o.addClass("loading");m.ajax({url:razziData.ajax_url.toString().replace("%%endpoint%%","razzi_product_loop_form"),type:"POST",data:{nonce:razziData.nonce,product_id:t},success:function(e){if(!e||e.data===""){return}i.prepend(e.data);var t=i.find(".variations_form");if(typeof m.fn.wc_variation_form!=="undefined"){t.each(function(){m(this).wc_variation_form()})}m(document.body).trigger("init_variation_swatches");setTimeout(function(){o.removeClass("loading").addClass("show-variations_form")},400)}})})};c.productLoopATCForm=function(){if(typeof razziData.product_loop_variation==="undefined"){return}if(razziData.product_loop_variation!=="1"){return}c.$body.on("click",".product-close-variations-form",function(e){e.preventDefault();m(this).closest(".product-inner").removeClass("show-variations_form")});c.$body.on("click",".product-quick-shop-button",function(e){e.preventDefault();if(typeof razziData.product_loop_variation_ajax==="undefined"){m(this).closest(".product-inner").addClass("show-variations_form")}else if(m(this).hasClass("has-content")){m(this).closest(".product-inner").addClass("show-variations_form")}});c.$body.on("click","a.product_type_variable",function(e){e.preventDefault();m(this).closest("li.product").find(".variations_form .single_add_to_cart_button").trigger("click")});c.$body.on("click","li.product .variations_form .single_add_to_cart_button",function(e){e.preventDefault();var t=m(this),o=t.closest(".variations_form"),i=t.closest("li.product").find("a.product_type_variable");if(m(this).is(".disabled")){return}c.addToCartFormAJAX(t,o,i);return false})};c.addToCartSingleAjax=function(){var e=m("div.product, .razzi-sticky-add-to-cart");if(e.length<1){return}if(!e.hasClass("product-add-to-cart-ajax")){return}e.find("form.cart").on("click",".single_add_to_cart_button",function(e){var t=m(this),o=t.closest("form.cart");if(t.closest(".product").hasClass("product-type-external")){return}if(o.hasClass("buy-now-clicked")){return}if(t.is(".disabled")){return}if(o.length>0){e.preventDefault()}else{return}c.addToCartFormAJAX(t,o,t)})};c.addToCartFormAJAX=function(r,e,n){if(r.data("requestRunning")){return}r.data("requestRunning",true);var s=false;n.addClass("loading");if(s){return}s=true;var t=e.serializeArray(),d=e.attr("action");if(r.val()!=""){t.push({name:r.attr("name"),value:r.val()})}m(document.body).trigger("adding_to_cart",[r,t]);m.ajax({url:d,method:"post",data:t,error:function(e){window.location=d},success:function(e){if(!e){window.location=d}if(typeof wc_add_to_cart_params!=="undefined"){if(wc_add_to_cart_params.cart_redirect_after_add==="yes"){window.location=wc_add_to_cart_params.cart_url;return}}var t="",o="info";if(m(e).find(".woocommerce-message").length||m(e).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner.is-success").length){m(document.body).trigger("wc_fragment_refresh");if(m(".single-product div.product form.cart:not(.form-pbt)").find(".razzi-free-shipping-bar").length&&m(e).find("div.product form.cart:not(.form-pbt) .razzi-free-shipping-bar").length){m(".single-product div.product form.cart:not(.form-pbt)").find(".razzi-free-shipping-bar").replaceWith(m(e).find("div.product form.cart:not(.form-pbt) .razzi-free-shipping-bar"))}}else{if(!m.fn.notify){return}var i='',a='';if(m(e).find(".woocommerce-error").length>0){t=m(e).find(".woocommerce-error").html();o="error";i=''}else if(m(e).find(".woocommerce-info").length>0){t=m(e).find(".woocommerce-info").html()}else if(m(e).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner.is-error").length){o="error";t=m(e).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner.is-error .wc-block-components-notice-banner__content").html();i=''}else if(m(e).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner").length>0){t=m(e).find(".woocommerce-notices-wrapper .wc-block-components-notice-banner .wc-block-components-notice-banner__content").html()}m.notify.addStyle("razzi",{html:"
"+i+'
    '+t+"
"+a+"
"});m.notify(" ",{autoHideDelay:5e3,className:o,style:"razzi",showAnimation:"fadeIn",hideAnimation:"fadeOut"})}r.data("requestRunning",false);r.removeClass("loading");n.removeClass("loading");s=false}})};c.productLoopHoverSlider=function(){var e=c.$body.find("ul.products .product-thumbnails--slider"),t={loop:false,autoplay:false,speed:800,watchOverflow:true,lazy:true,breakpoints:{}};e.find(".woocommerce-loop-product__link").addClass("swiper-slide");c.$body.find("ul.products").imagesLoaded(function(){setTimeout(function(){e.each(function(){t.navigation={nextEl:m(this).find(".rz-product-loop-swiper-next"),prevEl:m(this).find(".rz-product-loop-swiper-prev")};new Swiper(m(this),t)})},200)})};c.productLoopHoverZoom=function(){if(typeof razziData.product_loop_hover==="undefined"||!m.fn.zoom){return}if(razziData.product_loop_hover!=="zoom"){return}var e=c.$body.find("ul.products .product-thumbnail-zoom");e.each(function(){var e=m(this);e.zoom({url:e.attr("data-zoom_image")})})};c.productQuickView=function(){m(document.body).on("click",".quick-view-button",function(e){e.preventDefault();var t=m(this),o=t.data("id"),i=m("#quick-view-modal"),a=i.find(".woocommerce"),r=razziData.ajax_url.toString().replace("%%endpoint%%","product_quick_view");i.addClass("loading").removeClass("loaded");a.find(".product").html("");m.post(r,{action:"razzi_get_product_quickview",product_id:o},function(e){a.find(".product").replaceWith(e.data);if(e.success){n()}i.removeClass("loading").addClass("loaded");c.productQuantityDropdown();c.addToCartSingleAjax();c.$body.trigger("product_video_popup");c.$body.trigger("razzi_product_quick_view_loaded");if(a.find(".deal-expire-countdown").length>0){m(document.body).trigger("razzi_countdown",[m(".deal-expire-countdown")])}m(document.body).trigger("yith_wcwl_init")}).fail(function(){window.location.href=t.attr("href")});function n(){var e=a.find(".product"),t=e.find(".woocommerce-product-gallery"),o=e.find(".variations_form");e.removeClass("layout-v2 layout-v3 layout-v4 layout-v5");s();t.on("razzi_update_product_gallery_on_quickview",function(){s()});if(typeof wc_add_to_cart_variation_params!=="undefined"){o.each(function(){m(this).wc_variation_form()})}m(document.body).trigger("init_variation_swatches")}function s(){var e=a.find(".product"),t=e.find(".woocommerce-product-gallery");t.on("click",".woocommerce-product-gallery__image a",function(e){e.preventDefault()});t.removeAttr("style");if(t.find(".woocommerce-product-gallery__wrapper").children().length>1){t.addClass("swiper-container");t.find(".woocommerce-product-gallery__wrapper").addClass("swiper-wrapper");t.find(".woocommerce-product-gallery__image").addClass("swiper-slide");t.after('');t.after('');var o={loop:false,autoplay:false,speed:800,watchOverflow:true,navigation:{nextEl:".rz-quickview-button-next",prevEl:".rz-quickview-button-prev"},on:{init:function(){t.css("opacity",1)}}};t.imagesLoaded(function(){new Swiper(t,o)})}}})};c.productLoaded=function(){c.$body.on("razzi_products_loaded",function(e,t){var o=t.find(".variations_form");if(typeof m.fn.wc_variation_form!=="undefined"){o.each(function(){m(this).wc_variation_form()})}m(document.body).trigger("init_variation_swatches");c.productLoopHoverSlider();c.productLoopHoverZoom();m(document).trigger("yith_wcwl_reload_fragments")})};c.accountOrder=function(){if(!c.$body.hasClass("woocommerce-account")){return}m(".woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link > a").append('');m("table.my_account_orders").on("click",".item-plus",function(){m(this).closest("ul").find("li").show();m(this).closest("ul").find(".item-plus").hide()})};c.loginPanel=function(){m(document.body).on("click","#account-modal .create-account",function(e){e.preventDefault();m(this).closest("form.login").fadeOut(function(){m(this).next("form.register").fadeIn()})}).on("click","#account-modal a.login",function(e){e.preventDefault();m(this).closest("form.register").fadeOut(function(){m(this).prev("form.login").fadeIn()})})};c.loginPanelAuthenticate=function(){m("#account-modal").on("submit","form.login",function e(t){var o=m("input[name=username]",this).val(),i=m("input[name=password]",this).val(),a=m("input[name=rememberme]",this).is(":checked"),r=m("input[name=woocommerce-login-nonce]",this).val(),n=m("[type=submit]",this),s=m(this),d=s.next(".woocommerce-error");if(!o){m("input[name=username]",this).focus();return false}if(!i){m("input[name=password]",this).focus();return false}s.find(".woocommerce-error").remove();n.html('');if(d.length){d.fadeOut()}var c=razziData.ajax_url.toString().replace("%%endpoint%%","razzi_login_authenticate");m.post(c,{security:r,username:o,password:i,remember:a},function(e){if(!e.success){if(!d.length){d=m('');new Swiper(e.find(".recommendation-products-carousel"),{loop:false,spaceBetween:20,watchOverflow:true,navigation:{nextEl:e.find(".rz-swiper-button-next"),prevEl:e.find(".rz-swiper-button-prev")},pagination:{el:e.find(".swiper-pagination"),clickable:true},on:{init:function(){this.$el.css("opacity",1)}},breakpoints:{300:{slidesPerView:razziData.mobile_portrait,slidesPerGroup:razziData.mobile_portrait,spaceBetween:20},480:{slidesPerView:razziData.mobile_landscape,slidesPerGroup:razziData.mobile_landscape},768:{spaceBetween:20,slidesPerView:3,slidesPerGroup:3},992:{slidesPerView:3,slidesPerGroup:3},1200:{slidesPerView:4,slidesPerGroup:4}}})}};c.addedToWishlistNotice=function(){if(typeof razziData.added_to_wishlist_notice==="undefined"||!m.fn.notify){return}c.$body.on("added_to_wishlist",function(e,t){var o=t.data("product-title");i(o)});function i(e){e+=" "+razziData.added_to_wishlist_notice.added_to_wishlist_text;e+=''+razziData.added_to_wishlist_notice.wishlist_view_text+"";var t='',o='';m.notify.addStyle("razzi",{html:"
"+t+e+o+"
"});m.notify(" ",{autoHideDelay:razziData.added_to_wishlist_notice.wishlist_notice_auto_hide,className:"success",style:"razzi",showAnimation:"fadeIn",hideAnimation:"fadeOut"})}};c.addedToCompareNotice=function(){if(typeof razziData.added_to_compare_notice==="undefined"||!m.fn.notify){return}c.$body.on("added_to_compare",function(e,t){var o=t.data("product-title");i(o)});function i(e){e+=" "+razziData.added_to_compare_notice.added_to_compare_text;e+=''+razziData.added_to_compare_notice.compare_view_text+"";var t='',o='';m.notify.addStyle("razzi",{html:"
"+t+e+o+"
"});m.notify(" ",{autoHideDelay:razziData.added_to_compare_notice.compare_notice_auto_hide,className:"success",style:"razzi",showAnimation:"fadeIn",hideAnimation:"fadeOut"})}};c.newsletterPopup=function(){if(!razziData.popup){return}var t=m("#newsletter-popup-modal"),o=parseInt(razziData.popup_frequency),e=parseInt(razziData.popup_visible_delay);if(!t.length){return}if(document.cookie.match(/^(.*;)?\s*razzi_newsletter_popup_prevent\s*=\s*[^;]+(.*)?$/)){return}if(o>0&&document.cookie.match(/^(.*;)?\s*razzi_newsletter_popup\s*=\s*[^;]+(.*)?$/)){return}e=Math.max(e,0);e="delay"===razziData.popup_visible?e:0;function i(e,t){var o=new Date,i=o.getTime();if(t){o.setTime(o.getTime()+1*24*60*60*1e3);document.cookie="razzi_newsletter_popup_prevent="+i+";expires="+o.toGMTString()+";path=/"}else{document.cookie="razzi_newsletter_popup_prevent="+i+";expires="+o.toGMTString()+";path=/";o.setTime(o.getTime()+e*24*60*60*1e3);document.cookie="razzi_newsletter_popup="+i+";expires="+o.toGMTString()+";path=/"}}setTimeout(function(){c.openModal(t)},e*1e3);t.on("click",".n-close",function(e){e.preventDefault();m(this).addClass("active");setTimeout(function(){i(o,true);c.closeModal(t)},800)});m(document.body).on("razzi_modal_closed",function(e,t){if(!m(t).closest(".rz-modal").hasClass("newsletter-popup-modal")){return}if(m(t).find(".n-close").hasClass("active")){return}i(o,false)})};c.backToTop=function(){var e=m("#gotop");c.$window.on("scroll",function(){if(c.$window.scrollTop()>c.$window.height()){e.addClass("show-scroll")}else{e.removeClass("show-scroll")}});c.$body.on("click","#gotop",function(e){e.preventDefault();m("html, body").animate({scrollTop:0},800)})};c.recentlyViewedProducts=function(){var t=m("#razzi-history-products");if(t.length<1){return}if(t.hasClass("loaded")){return}if(t.hasClass("no-ajax")){i();o();return}c.$window.on("scroll",function(){if(c.$body.find("#razzi-history-products").is(":in-viewport")){e()}}).trigger("scroll");function e(){if(t.hasClass("loaded")){return}if(t.data("requestRunning")){return}t.data("requestRunning",true);var e=razziData.ajax_url.toString().replace("%%endpoint%%","razzi_get_recently_viewed");m.post(e,function(e){t.find(".recently-products ").html(e.data);if(t.find(".product-list").hasClass("no-products")){t.addClass("no-products")}c.$body.trigger("razzi_products_loaded",[t,false]);i();o();t.addClass("loaded");t.data("requestRunning",false)})}function o(){var e=t.find("li.product");e.on("mousemove",function(e){var t=m(this),o=e.pageX-t.offset().left+10,i=o-t.find(".product-infor").outerWidth(),a=e.pageY-t.offset().top+10;if(t.is(":last-child")){t.find(".product-infor").show().css({left:i,top:a})}else{t.find(".product-infor").show().css({left:o,top:a})}}).on("mouseout",function(){m(this).find(".product-infor").hide()})}function i(){var e=m("#razzi-history-products"),t=e.find("ul.products"),o=e.data("col");if(!e.length){return}o=o?o:4;t.wrap('');if(razziData.recently_viewed_navigation=="scrollbar"){t.after('
')}else{t.after('
')}t.addClass("swiper-wrapper");t.find("li.product").addClass("swiper-slide");new Swiper(e.find(".history-products-carousel"),{loop:false,scrollbar:{el:e.find(".swiper-scrollbar"),hide:false,draggable:true},pagination:{el:".swiper-pagination",type:"bullets",clickable:true},on:{init:function(){if(e.hasClass("no-ajax")){e.find(".recently-products").css("opacity",1)}}},speed:1e3,spaceBetween:30,breakpoints:{300:{slidesPerView:razziData.mobile_portrait==""?2:razziData.mobile_portrait,slidesPerGroup:razziData.mobile_portrait==""?2:razziData.mobile_portrait,spaceBetween:15},480:{slidesPerView:razziData.mobile_landscape==""?3:razziData.mobile_landscape,slidesPerGroup:razziData.mobile_landscape==""?3:razziData.mobile_landscape,spaceBetween:15},768:{spaceBetween:20,slidesPerView:3,slidesPerGroup:3},992:{slidesPerView:4,slidesPerGroup:4},1200:{slidesPerView:o,slidesPerGroup:o}}})}};c.footerDropdown=function(){m(".footer-widgets .widget").find(".widget-title").append('');var e=m(".footer-widgets .widget"),t=e.find(".widget-title");c.$window.on("resize",function(){if(c.$window.width()<768){t.next("div").addClass("clicked");t.parent().addClass("dropdown")}else{t.next("div").removeClass("clicked");t.next("div").removeAttr("style");t.parent().removeClass("dropdown")}}).trigger("resize");e.on("click",".widget-title",function(e){e.preventDefault();if(!t.parent().hasClass("dropdown")){return}m(this).next(".clicked").stop().slideToggle();m(this).toggleClass("active");return false})};c.scrollSection=function(){var r=m("#rz-base-url").data("url");m("#primary-menu").on("click","a",function(e){e.preventDefault();var t=m(this).attr("href"),o=this.hash;if(o==""){if(m(this).attr("target")){window.open(t,"_blank")}else{window.location.href=t}return false}else if(o!==""&&m(o).length<1){var i=r+o;if(t!==r){i=t}window.location.href=i;return false}else if(o!==""&&m(o).length>0){if(m(o).hasClass(".elementor-section")||m(o).closest(".elementor-section").length>0){return}var a=m(o).offset().top;if(c.$body.hasClass("header-sticky")){a=a-m(".site-header").outerHeight()}m("html, body").animate({scrollTop:a},800);return false}})};c.inlineStyle=function(){c.$window.on("resize",function(){if(c.$window.width()<601){m("#wpadminbar").css("z-index","999")}else{m("#wpadminbar").removeAttr("style")}}).trigger("resize");m(document).ready(function(){if(m(".razzi-swiper-carousel-elementor ul").hasClass("product-loop-layout-10")||m(".razzi-swiper-carousel-elementor ul").hasClass("product-loop-layout-11")||m(".linked-products-carousel ul").hasClass("product-loop-layout-10")||m(".linked-products-carousel ul").hasClass("product-loop-layout-11")){m(".razzi-swiper-carousel-elementor .product-loop-layout-10").parent().addClass("swiper-container__extra");m(".razzi-swiper-carousel-elementor .product-loop-layout-11").parent().addClass("swiper-container__extra");m(".linked-products-carousel .product-loop-layout-10").parent().addClass("swiper-container__extra");m(".linked-products-carousel .product-loop-layout-11").parent().addClass("swiper-container__extra")}})};c.historyBack=function(){c.$header.find(".razzi-history-back").on("click",function(e){if(document.referrer!=""){e.preventDefault();window.history.go(-1);m(window).on("popstate",function(e){window.location.reload(true)})}})};c.focusSearchField=function(){m(".header-search .search-field").on("focus",function(){var e=m(this).closest(".header-search").find(".quick-links");if(!e.length){return}e.addClass("open");m(this).addClass("focused")});m(document.body).on("click","div",function(e){var t=m(e.target);if(t.is(".header-search")||t.closest(".header-search").length){return}m(".quick-links",".header-search").removeClass("open");m(".search-field",".header-search").removeClass("focused")})};c.stickyAddToCart=function(){var e=m("#razzi-sticky-add-to-cart");e=!e.length?m("#rz-navigation-bar"):e;if(!e.length){return}var o=m("form.cart:not(.form-cart-pbt)",e.closest(".single-product")),i=e.find(".razzi-sticky-atc__product-image img"),a=e.find(".razzi-sticky-add-to-cart__content-price"),r=false;o.on("reset_data",function(){i.attr("src",i.data("o_src"));a.show().siblings(".variation-price, .stock").remove()}).on("found_variation",function(e,t){if(t.image&&t.image.gallery_thumbnail_src&&t.image.gallery_thumbnail_src.length>1){i.attr("src",t.image.gallery_thumbnail_src)}if(t.availability_html&&t.availability_html.length){a.hide().siblings(".stock, .variation-price").remove();a.after(t.availability_html);if(t.price_html&&t.price_html.length){a.after(m(t.price_html).addClass("variation-price"))}}else{a.siblings(".stock").remove();if(t.price_html&&t.price_html.length){a.hide().siblings(".variation-price").remove();a.after(m(t.price_html).addClass("variation-price"))}}}).on("change",":input",function(){if(r){return}r=true;var e=m(this).closest("form.cart"),t=o.not(e);t.find(':input[name="'+this.name+'"]').val(this.value).trigger("change");if(!c.$body.hasClass("product-qty-number")){t.find(':input[name="'+this.name+'"]').siblings(".qty-dropdown").find(".current .value").html(this.value)}r=false})};c.productAttribute=function(){c.$body.on("click",".product-variation-item--attrs",function(e){e.preventDefault();m(this).siblings(".product-variation-item--attrs").removeClass("selected");m(this).addClass("selected");var t=m(this).data("product_variations"),o=m(this).closest(".product-inner").find(".woocommerce-LoopProduct-link").first(),i=o.find("img").first(),a=m(this).closest(".product-inner").find(".price");o.addClass("image-loading");if(t.img_src&&t.img_src!="undefined"){i.attr("src",t.img_src)}if(t.img_srcset&&t.img_srcset!="undefined"){i.attr("srcset",t.img_srcset)}if(t.price&&t.price!="undefined"){a.replaceWith(t.price)}if(t.img_zoom_src&&t.img_zoom_src!="undefined"){o.find(".zoomImg").attr("src",t.img_zoom_src)}i.load(function(){o.removeClass("image-loading")})});c.$body.on("mouseover",".product-variation-items",function(e){e.preventDefault();m(this).closest(".product-inner").find(".product-thumbnail").addClass("hover-swatch")}).on("mouseout",".product-variation-items",function(e){e.preventDefault();m(this).closest(".product-inner").find(".product-thumbnail").removeClass("hover-swatch")})};c.productVideoPopup=function(){e();m(document.body).on("product_video_popup",function(){e()});function e(){var e=m(".woocommerce-product-gallery").find(".razzi-product-video--icon");if(e.length<1){return}var t={type:"iframe",mainClass:"mfp-fade",removalDelay:300,preloader:false,fixedContentPos:false,iframe:{markup:'
'+'
'+''+"
",patterns:{youtube:{index:"youtube.com/",id:"v=",src:"https://www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"}},srcAction:"iframe_src"}};e.magnificPopup(t)}};c.lazyLoadImages=function(){var t;m(document.body).on("post-load razzi_posts_loaded razzi_products_loaded razzi_lazy_load_images razzi_ajax_filter_request_success",function(){try{t=new Event("jetpack-lazy-images-load",{bubbles:true,cancelable:true})}catch(e){t=document.createEvent("Event");t.initEvent("jetpack-lazy-images-load",true,true)}setTimeout(function(){document.body.dispatchEvent(t)},100)})};m(function(){c.init()})})(jQuery);