jQuery(document).ready(function(i){i(document).on("click",".product a.compare:not(.added)",function(o){o.preventDefault();var e=i(this),t={action:yith_woocompare.actionadd,id:e.data("product_id"),context:"frontend"},a=i(".yith-woocompare-widget ul.products-list");void 0!==i.fn.block&&(e.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),a.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}})),i.ajax({type:"post",url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionadd),async:!1,data:t,dataType:"json",success:function(o){void 0!==i.fn.block&&(e.unblock(),a.unblock()),e.addClass("added").attr("href",o.table_url).text(yith_woocompare.added_label),a.html(o.widget_table),"yes"==yith_woocompare.auto_open&&i("body").trigger("yith_woocompare_open_popup",{response:o.table_url,button:e})}})}),i(document).on("click",".product a.compare.added",function(o){o.preventDefault();var e=this.href;void 0!==e&&i("body").trigger("yith_woocompare_open_popup",{response:e,button:i(this)})}),i("body").on("yith_woocompare_open_popup",function(o,e){var t=e.response;if(768<=i(window).width())i.colorbox({href:t,iframe:!0,width:"90%",height:"90%",className:"yith_woocompare_colorbox",close:yith_woocompare.close_label,onClosed:function(){var e=i(".yith-woocompare-widget ul.products-list"),o={action:yith_woocompare.actionreload,context:"frontend"};void 0!==i.fn.block&&e.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),i.ajax({type:"post",url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionreload),data:o,success:function(o){void 0!==i.fn.block&&e.unblock().html(o),e.html(o)}})}}),i(window).resize(function(){i.colorbox.resize({width:"90%",height:"90%"})});else{var a=t.split("?");if(2<=a.length){for(var r=encodeURIComponent("iframe")+"=",c=a[1].split(/[&;]/g),n=c.length;0