jQuery(document).ready(function(c){"use strict";c(document).on("click","a.compare:not(.added)",function(o){o.preventDefault();var e,t=c(this),a=c(".yith-woocompare-widget ul.products-list"),r=t.parents(".yith-woocompare-related"),i=!!r.length,n=i?r.data("iframe"):"no";e={action:yith_woocompare.actionadd,id:t.data("product_id"),context:"frontend",is_related:i,iframe:n},"undefined"!=typeof c.fn.block&&(t.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"20px 20px",opacity:.6}}),a.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"20px 20px",opacity:.6}})),c.ajax({type:"post",url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionadd),async:!1,data:e,dataType:i?"html":"json",success:function(o){i?(c("#yith-woocompare").replaceWith(c(o).filter("#yith-woocompare")),d(!1),c(document).trigger("yith_woocompare_page_refreshed",[!1]),t.addClass("added").attr("href","#").text(yith_woocompare.added_label)):(o.added&&t.addClass("added").attr("href",o.table_url).text(yith_woocompare.is_page?yith_woocompare.view_label:yith_woocompare.added_label),d(o.widget_table),"yes"!=yith_woocompare.auto_open||o.only_one||yith_woocompare.is_page||c("body").trigger("yith_woocompare_open_popup",{response:o.table_url,button:t}),c("body").trigger("yith_woocompare_product_added"));p(),"undefined"!=typeof c.fn.block&&(t.unblock(),a.unblock())}})}),yith_woocompare.is_page||c(document).on("click","a.compare.added",function(o){o.preventDefault();var e=this.href;void 0!==e&&c("body").trigger("yith_woocompare_open_popup",{response:e,button:c(this)})}),c("body").on("yith_woocompare_open_popup",function(o,e){var t=e.response;e.button;yith_woocompare.force_showing_popup||768<=c(window).width()?(c.colorbox({href:t,iframe:!0,width:"80%",height:"80%",fixed:!0,className:"yith_woocompare_colorbox",close:yith_woocompare.close_label,onClosed:function(){yith_woocompare.im_in_page?location.reload():(d(!1),p())},onComplete:function(){a(),c.dataTableFunction()}}),c(window).resize(function(){c.colorbox.resize({width:"90%",height:"90%"})})):window.location=yith_woocompare.page_url}),c(document).on("click",".compare-list .remove a, a.yith_woocompare_clear",function(o){o.preventDefault();var i=c(this),n=i.data("product_id"),e={action:yith_woocompare.actionremove,id:n,iframe:i.data("iframe"),context:"frontend"};"undefined"!=typeof c.fn.block&&i.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"20px 20px",opacity:.6}}),c.ajax({type:"post",url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionremove),async:!1,data:e,dataType:"html",success:function(o){var e=c(o).filter("#yith-woocompare");c("#yith-woocompare").replaceWith(e);var t="all"==n?".compare.added":'.compare[data-product_id="'+n+'"]',a=i.data("product_id"),r=yith_woocompare.custom_label_for_compare_button?i.closest("tbody").find("tr"+yith_woocompare.selector_for_custom_label_compare_button).find("td.product_"+a).text():yith_woocompare.button_text;c(t,window.parent.document).removeClass("added").html(r),d(!1),p(),c(document).trigger("yith_woocompare_product_removed",[""])}})}),c(".yith-woocompare-open a, a.yith-woocompare-open").on("click",function(o){yith_woocompare.is_page||(o.preventDefault(),c("body").trigger("yith_woocompare_open_popup",{response:function i(o,e){o=escape(o),e=escape(e);var t=document.location.search,a=o+"="+e,r=new RegExp("(&|\\?)"+o+"=[^&]*");t=t.replace(r,"$1"+a),RegExp.$1||(t+=(0 a",function(o){o.preventDefault();var e=c(this),t=e.closest("#yith-woocompare"),a=e.data("cat_id"),r=e.closest("#yith-woocompare-cat-nav > ul"),i=r.data("product_ids"),n=r.data("iframe");c.ajax({url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionfilter),data:{action:yith_woocompare.actionfilter,yith_compare_cat:a,yith_compare_prod:i,context:"frontend",iframe:n},dataType:"html",success:function(o){var e=c(o).filter("#yith-woocompare");t.replaceWith(e),c(document).trigger("yith_woocompare_page_refreshed",[e])}})});var a=function(){if("undefined"!=typeof c.fn.owlCarousel){var o=c("#yith-woocompare-related"),e=o.find(".related-products"),t=o.find(".related-slider-nav");if(!o.length)return;e.owlCarousel({autoplay:yith_woocompare.autoplay_related,autoplayHoverPause:!0,loop:!0,margin:15,responsiveClass:!0,responsive:{0:{items:2},480:{items:3},768:{items:yith_woocompare.num_related}}}),t.length&&(t.find(".related-slider-nav-prev").click(function(){e.trigger("prev.owl.carousel")}),t.find(".related-slider-nav-next").click(function(){e.trigger("next.owl.carousel")}))}};function i(o){for(var e=o+"=",t=document.cookie.split(";"),a=0;a