1'use strict';(function($){var woosc_timer=0;$(function(){woosc_load_color();woosc_change_count('first');woosc_check_buttons();woosc_hide_empty();woosc_hide_similarities();woosc_highlight_differences();if(woosc_vars.open_bar==='yes'){woosc_load_data('bar');woosc_open_bar()} 2$('.woosc-settings-fields').sortable({handle:'.label',update:function(event,ui){woosc_save_settings()},});if(woosc_vars.button_action==='show_message'){$.notiny.addTheme('woosc',{notification_class:'notiny-theme-woosc',})} 3woosc_quick_table()});$(window).on('resize',function(){woosc_quick_table()});$(document).on('click touch','.woosc_table .woosq-btn, .woosc_table .woosq-link',function(e){e.preventDefault();woosc_close()});$(document).on('click touch','.woosc-sidebar .woosq-btn, .woosc-sidebar .woosq-link',function(e){e.preventDefault();woosc_close_sidebar()});$(document).on('click touch','.woosc-table-settings',function(e){e.preventDefault();$('.woosc-settings').toggleClass('open')});$(document).on('click touch','.woosc-bar-share',function(e){e.preventDefault();$('.woosc-share').toggleClass('open');$('.woosc-share-content').addClass('woosc-loading');var data={action:'woosc_share',};jQuery.post(woosc_vars.ajax_url,data,function(response){$('.woosc-share-content').html(response).removeClass('woosc-loading')})});$(document).on('click touch','#woosc_copy_url, #woosc_copy_btn',function(e){e.preventDefault();woosc_copy_to_clipboard('#woosc_copy_url')});$(document).on('click touch','.woosc-bar-search',function(e){e.preventDefault();$('.woosc-search').toggleClass('open');if($('.woosc-search-result').text()===''){if(woosc_timer!=null){clearTimeout(woosc_timer)} 4woosc_timer=setTimeout(woosc_search,300);return!1}});$(document).on('click touch','.woosc-popup',function(e){if($(e.target).closest('.woosc-popup-content').length===0){$(this).toggleClass('open')}});$(document).on('keyup','#woosc_search_input',function(){if($('#woosc_search_input').val()!==''){if(woosc_timer!=null){clearTimeout(woosc_timer)} 5woosc_timer=setTimeout(woosc_search,300);return!1}});$(document).on('click touch','.woosc-item-add',function(e){e.preventDefault();var product_id=$(this).attr('data-id');$('.woosc-search').toggleClass('open');woosc_add_product(product_id);woosc_load_data('table');woosc_open_table()});$(document).on('click touch','.woosc-popup-close',function(e){e.preventDefault();$(this).closest('.woosc-popup').toggleClass('open')});$(document).on('woovr_selected',function(e,selected){var id=selected.attr('data-id');var pid=selected.attr('data-pid');if(id>0){$('.woosc-btn-'+pid).removeClass('woosc-btn-added woosc-added').attr('data-id',id)}else{$('.woosc-btn-'+pid).removeClass('woosc-btn-added woosc-added').attr('data-id',pid)}});$(document).on('found_variation',function(e,t){var product_id=$(e.target).attr('data-product_id');$('.woosc-btn-'+product_id).removeClass('woosc-btn-added woosc-added').attr('data-id',t.variation_id);$('.woosc-btn-'+product_id+':not(.woosc-btn-has-icon)').html(woosc_vars.button_text);$('.woosc-btn-has-icon.woosc-btn-'+product_id).find('.woosc-btn-icon').removeClass(woosc_vars.button_added_icon).addClass(woosc_vars.button_normal_icon);$('.woosc-btn-has-icon.woosc-btn-'+product_id).find('.woosc-btn-text').html(woosc_vars.button_text)});$(document).on('reset_data',function(e){var product_id=$(e.target).attr('data-product_id');$('.woosc-btn-'+product_id).removeClass('woosc-btn-added woosc-added').attr('data-id',product_id);$('.woosc-btn-'+product_id+':not(.woosc-btn-has-icon)').html(woosc_vars.button_text);$('.woosc-btn-has-icon.woosc-btn-'+product_id).find('.woosc-btn-icon').removeClass(woosc_vars.button_added_icon).addClass(woosc_vars.button_normal_icon);$('.woosc-btn-has-icon.woosc-btn-'+product_id).find('.woosc-btn-text').html(woosc_vars.button_text)});$(document).on('click touch','.woosc-bar-remove',function(e){e.preventDefault();var r=confirm(woosc_vars.remove_all);if(r==!0){woosc_remove_product('all');woosc_load_data('table')}});$(document).on('click touch','.woosc-btn',function(e){e.preventDefault();var $this=$(this);var id=$this.attr('data-id');var pid=$this.attr('data-pid');var product_id=$this.attr('data-product_id');var product_name=$this.attr('data-product_name');var product_image=$this.attr('data-product_image');if(typeof pid!==typeof undefined&&pid!==!1){id=pid} 6if(typeof product_id!==typeof undefined&&product_id!==!1){id=product_id} 7$this.addClass('');if($this.hasClass('woosc-btn-added woosc-added')){if(woosc_vars.click_again==='yes'){woosc_remove_product(id);if(woosc_vars.button_action==='show_message'){$.notiny({theme:'woosc',position:woosc_vars.message_position,image:product_image,text:woosc_vars.message_removed.replace('{name}','<strong>'+product_name+'</strong>'),})}}else{if(woosc_vars.button_action==='show_message'){$.notiny({theme:'woosc',position:woosc_vars.message_position,image:product_image,text:woosc_vars.message_exists.replace('{name}','<strong>'+product_name+'</strong>'),})}}}else{$this.addClass('woosc-btn-adding woosc-adding');woosc_add_product(id);if(woosc_vars.button_action==='show_message'){$.notiny({theme:'woosc',position:woosc_vars.message_position,image:product_image,text:woosc_vars.message_added.replace('{name}','<strong>'+product_name+'</strong>'),})}} 8if(woosc_vars.button_action==='show_bar'){woosc_load_data('bar');woosc_open_bar()} 9if(woosc_vars.button_action==='show_table'){woosc_load_data('table');woosc_open_bar();woosc_open_table()} 10if((woosc_vars.button_action==='show_message')||(woosc_vars.button_action==='none')){
10if($('.woosc-bar').hasClass('woosc-bar-open')){woosc_load_data('bar')}} 11if(woosc_vars.button_action==='show_sidebar'){woosc_load_data('sidebar');woosc_open_sidebar()}});$(document).on('click touch','#woosc-area .woosc-bar-item-remove, #woosc-area .woosc-remove',function(e){e.preventDefault();var product_id=$(this).attr('data-id');$(this).parent().addClass('removing');woosc_remove_product(product_id);woosc_load_data('table');woosc_check_buttons()});$(document).on('click touch','.woosc-page .woosc-remove',function(e){e.preventDefault();var product_id=$(this).attr('data-id');woosc_remove_product(product_id);location.reload()});$(document).on('click touch','.woosc-sidebar-item-remove',function(e){e.preventDefault();var product_id=$(this).closest('.woosc-sidebar-item').attr('data-id');woosc_remove_product(product_id);$(this).closest('.woosc-sidebar-item').slideUp();woosc_check_buttons()});$(document).on('click touch','.woosc-bar-btn',function(e){e.preventDefault();if(!$('.woosc-table-items').hasClass('woosc-table-items-loaded')){woosc_load_data('table')} 12woosc_toggle_table()});$(document).on('click touch',function(e){if(((woosc_vars.click_outside==='yes')||((woosc_vars.click_outside==='yes_empty')&&(parseInt($('.woosc-bar').attr('data-count'))===0)))&&($(e.target).closest('.wpc_compare_count').length===0)&&($(e.target).closest('.woosc-popup').length===0)&&($(e.target).closest('.woosc-btn').length===0)&&($(e.target).closest('.woosc-table').length===0)&&($(e.target).closest('.woosc-bar').length===0)&&($(e.target).closest('.woosc-menu-item a').length===0)&&($(e.target).closest('.woosc-menu a').length===0)&&($(e.target).closest('.woosc-sidebar-btn').length===0)&&((woosc_vars.open_button==='')||($(e.target).closest(woosc_vars.open_button).length===0))){woosc_close()}});$(document).on('click touch','.woosc-area-open-sidebar',function(e){if(($(e.target).closest('.woosc-sidebar').length===0)){woosc_close_sidebar()}});$(document).on('click touch','.woosc-sidebar-close, .woosc-sidebar-continue',function(e){woosc_close_sidebar()});$(document).on('click touch','.woosc-sidebar-btn',function(e){e.preventDefault();woosc_close_sidebar();woosc_toggle()});$(document).on('click touch','#woosc-table-close',function(e){e.preventDefault();woosc_close_table()});$(document).on('change','.woosc-settings-field, .woosc-settings-tool',function(){woosc_save_settings()});if(woosc_vars.open_button!==''){$(document).on('click touch',woosc_vars.open_button,function(e){e.preventDefault();if(woosc_vars.open_button_action==='open_page'){if((woosc_vars.page_url!=='')&&(woosc_vars.page_url!=='#')){window.location.href=woosc_vars.page_url}}else{if(woosc_vars.open_button_action==='open_popup'){if(!$('.woosc-table-items').hasClass('woosc-table-items-loaded')){woosc_load_data('table')} 13woosc_open_bar();woosc_open_table()} 14if(woosc_vars.open_button_action==='open_sidebar'){if(!$('.woosc-sidebar-items').hasClass('woosc-sidebar-items-loaded')){woosc_load_data('sidebar')} 15woosc_open_sidebar()}}})} 16$(document).on('click touch','.woosc-menu-item a, .woosc-menu a',function(e){if(woosc_vars.menu_action==='open_popup'){e.preventDefault();if(!$('.woosc-table-items').hasClass('woosc-table-items-loaded')){woosc_load_data('table')} 17woosc_open_bar();woosc_open_table()} 18if(woosc_vars.menu_action==='open_sidebar'){e.preventDefault();if(!$('.woosc-sidebar-items').hasClass('woosc-sidebar-items-loaded')){woosc_load_data('sidebar')} 19woosc_open_sidebar()}});function woosc_search(){$('.woosc-search-result').html('').addClass('woosc-loading');woosc_timer=null;var data={action:'woosc_search',keyword:$('#woosc_search_input').val(),};$.post(woosc_vars.ajax_url,data,function(response){$('.woosc-search-result').html(response).removeClass('woosc-loading')})} 20function woosc_set_cookie(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));var expires='expires='+d.toUTCString();document.cookie=cname+'='+cvalue+'; '+expires+'; path=/'} 21function woosc_get_cookie(cname){var name=cname+'=';var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1)} 22if(c.indexOf(name)==0){return decodeURIComponent(c.substring(name.length,c.length))}} 23return''} 24function woosc_get_products(){var cookie_products=woosc_get_cookie_products();if(woosc_get_cookie(cookie_products)!=''){return woosc_get_cookie(cookie_products)}else{return''}} 25function woosc_save_products(){var cookie_products=woosc_get_cookie_products();var products=[];$('.woosc-bar-item').each(function(){var pid=$(this).attr('data-id');if(pid!==''){products.push(pid)}});var products_str=products.join();woosc_set_cookie(cookie_products,products_str,7);woosc_load_data('table')} 26function woosc_save_settings(){var fields=[];var settings=[];var cookie_fields='woosc_fields';var cookie_settings='woosc_settings';if(woosc_vars.user_id!==''){cookie_fields='woosc_fields_'+woosc_vars.user_id;cookie_settings='woosc_settings_'+woosc_vars.user_id} 27$('.woosc-settings-field').each(function(){var _val=$(this).val();if($(this).prop('checked')){fields.push(_val);$('.woosc_table .tr-'+_val).removeClass('tr-hide')}else{$('.woosc_table .tr-'+_val).addClass('tr-hide')}});$('.woosc-settings-tool').each(function(){var _val=$(this).val();if($(this).prop('checked')){settings.push(_val)}});woosc_set_cookie(cookie_fields,fields.join(','),7);woosc_set_cookie(cookie_settings,settings.join(','),7);woosc_load_data('table')} 28function woosc_add_product(product_id){var count;var limit=!1;var limit_notice=woosc_vars.limit_notice;var cookie_products=woosc_get_cookie_products();if(woosc_get_cookie(cookie_products)!==''){var products=woosc_get_cookie(cookie_products).split(',');if(products.length<woosc_vars.limit){products=$.grep(products,function(value){return value!=product_id});if(woosc_vars.adding==='append'){products.push(product_id)}else{products.unshift(product_id)} 29var products_str=products.join();woosc_set_cookie(cookie_products,products_str,7)}else{limit=!0;limit_notice=limit_notice.replace('{limit}',woosc_vars.limit)} 30count=products.length}else{woosc_set_cookie(cookie_products,product_id,7);count=1} 31woosc_change_count(count);$(document.body).trigger('woosc_added',[count]);if(limit){$('.woosc-btn[data-id="'+product_id+'"]').removeClass('woosc-btn-adding woosc-adding');alert(limit_notice)}else{$('.woosc-btn[data-id="'+product_id+'"]').removeClass('woosc-btn-adding woosc-adding').addClass('woosc-btn-added woosc-added');$('.woosc-btn[data-id="'+product_id+'"]:not(.woosc-btn-has-icon)').html(woosc_vars.button_text_added);$('.woosc-btn-has-icon[data-id="'+product_id+'"]').find('.woosc-btn-icon').removeClass(woosc_vars.button_normal_icon).addClass(woosc_vars.button_added_icon);$('.woosc-btn-has-icon[data-id="'+product_id+'"]').find('.woosc-btn-text').html(woosc_vars.button_text_added)}} 32function woosc_remove_product(product_id){var count=0;var cookie_products=woosc_get_cookie_products();if(product_id!=='all'){if(woosc_get_cookie(cookie_products)!=''){var products=woosc_get_cookie(cookie_products).split(',');products=$.grep(products,function(value){return value!=product_id});var products_str=products.join();woosc_set_cookie(cookie_products,products_str,7);count=products.length} 33$('.woosc-btn[data-id="'+product_id+'"]').removeClass('woosc-btn-added woosc-added');$('.woosc-btn[data-id="'+product_id+'"]:not(.woosc-btn-has-icon)').html(woosc_vars.button_text);$('.woosc-btn-has-icon[data-id="'+product_id+'"]').find('.woosc-btn-icon').removeClass(woosc_vars.button_added_icon).addClass(woosc_vars.button_normal_icon);$('.woosc-btn-has-icon[data-id="'+product_id+'"]').find('.woosc-btn-text').html(woosc_vars.button_text)}else{if(woosc_get_cookie(cookie_products)!=''){woosc_set_cookie(cookie_products,'',7);count=0} 34$('.woosc-btn').removeClass('woosc-btn-added woosc-added');$('.woosc-btn:not(.woosc-btn-has-icon)').html(woosc_vars.button_text);$('.woosc-btn-has-icon').find('.woosc-btn-icon').removeClass(woosc_vars.button_added_icon).addClass(woosc_vars.button_normal_icon);$('.woosc-btn-has-icon').find('.woosc-btn-text').html(woosc_vars.button_text)} 35woosc_change_count(count);$(document.body).trigger('woosc_removed',[count])} 36function woosc_check_buttons(){var cookie_products=woosc_get_cookie_products();if(woosc_get_cookie(cookie_products)!=''){var products=woosc_get_cookie(cookie_products).split(',');$('.woosc-btn').removeClass('woosc-btn-added woosc-added');$('.woosc-btn:not(.woosc-btn-has-icon)').html(woosc_vars.button_text);$('.woosc-btn.woosc-btn-has-icon').find('.woosc-btn-icon').removeClass(woosc_vars.button_added_icon).addClass(woosc_vars.button_normal_icon);$('.woosc-btn.woosc-btn-has-icon').find('.woosc-btn-text').html(woosc_vars.button_text);
36products.forEach(function(entry){$('.woosc-btn-'+entry).addClass('woosc-btn-added woosc-added');$('.woosc-btn-'+entry+':not(.woosc-btn-has-icon)').html(woosc_vars.button_text_added);$('.woosc-btn-has-icon.woosc-btn-'+entry).find('.woosc-btn-icon').removeClass(woosc_vars.button_normal_icon).addClass(woosc_vars.button_added_icon);$('.woosc-btn-has-icon.woosc-btn-'+entry).find('.woosc-btn-text').html(woosc_vars.button_text_added)})}} 37function woosc_load_data(get_data){var data={action:'woosc_load_data',get_data:get_data,};if(get_data==='table'){$('.woosc-table-inner').addClass('woosc-loading')} 38if(get_data==='sidebar'){$('.woosc-sidebar').addClass('woosc-loading')} 39$.post(woosc_vars.ajax_url,data,function(response){if(get_data==='bar'||get_data==='table'){$('.woosc-bar-items').html(response.bar).addClass('woosc-bar-items-loaded')} 40if(get_data==='table'){$('.woosc-table-items').html(response.table).addClass('woosc-table-items-loaded');if($(window).width()>=768){if((woosc_vars.freeze_column==='yes')&&(woosc_vars.freeze_row==='yes')){$('#woosc_table').tableHeadFixer({'head':!0,left:1})}else if(woosc_vars.freeze_column==='yes'){$('#woosc_table').tableHeadFixer({'head':!1,left:1})}else if(woosc_vars.freeze_row==='yes'){$('#woosc_table').tableHeadFixer({'head':!0})}}else{if(woosc_vars.freeze_row==='yes'){$('#woosc_table').tableHeadFixer({'head':!0})}} 41if(woosc_vars.scrollbar==='yes'){$('.woosc-table-items').perfectScrollbar({theme:'wpc'})} 42$('.woosc-table-inner').removeClass('woosc-loading');woosc_hide_empty();woosc_hide_similarities();woosc_highlight_differences()} 43if(get_data==='sidebar'){$('.woosc-sidebar-items').html(response.sidebar).addClass('woosc-sidebar-items-loaded');$('.woosc-sidebar').removeClass('woosc-loading');if(woosc_vars.scrollbar==='yes'){$('.woosc-sidebar-items').perfectScrollbar({theme:'wpc'})}}})} 44function woosc_quick_table(){let ww=$(window).width();if(ww>=1024){$('.woosc-quick-table .woosc_table').tableHeadFixer({'head':!1,left:2})} 45if(ww>=768&&ww<1024){$('.woosc-quick-table .woosc_table').tableHeadFixer({'head':!1,left:1})} 46if(ww<768){$('.woosc-quick-table .woosc_table').tableHeadFixer({'head':!1,left:0})}} 47function woosc_open_bar(){woosc_close_sidebar();$('#woosc-area').addClass('woosc-area-open-bar');$('.woosc-bar').addClass('woosc-bar-open');$('.woosc-bar-items').sortable({handle:'img',update:function(event,ui){woosc_save_products()},});$(document.body).trigger('woosc_bar_open')} 48function woosc_close_bar(){$('#woosc-area').removeClass('woosc-area-open-bar');$('.woosc-bar').removeClass('woosc-bar-open');$(document.body).trigger('woosc_bar_close')} 49function woosc_open_sidebar(){woosc_close_bar();woosc_close_table();$('#woosc-area').addClass('woosc-area-open-sidebar');$('.woosc-sidebar').addClass('woosc-sidebar-open');$(document.body).trigger('woosc_sidebar_open')} 50function woosc_close_sidebar(){$('#woosc-area').removeClass('woosc-area-open-sidebar');$('.woosc-sidebar').removeClass('woosc-sidebar-open');$(document.body).trigger('woosc_sidebar_close')} 51function woosc_open_table(){woosc_close_sidebar();$('#woosc-area').addClass('woosc-area-open-table');$('.woosc-table').addClass('woosc-table-open');$('.woosc-bar-btn').addClass('woosc-bar-btn-open');if(woosc_vars.bar_bubble==='yes'){$('.woosc-bar').removeClass('woosc-bar-bubble')} 52$(document.body).trigger('woosc_table_open')} 53function woosc_close_table(){$('#woosc-area').removeClass('woosc-area-open woosc-area-open-table');$('.woosc-table').removeClass('woosc-table-open');$('.woosc-bar-btn').removeClass('woosc-bar-btn-open');if(woosc_vars.bar_bubble==='yes'){$('.woosc-bar').addClass('woosc-bar-bubble')} 54$(document.body).trigger('woosc_table_close')} 55function woosc_toggle_table(){if($('.woosc-table').hasClass('woosc-table-open')){woosc_close_table()}else{woosc_open_table()}} 56function woosc_open(){$('#woosc-area').addClass('woosc-area-open');woosc_load_data('table');woosc_open_bar();woosc_open_table();$(document.body).trigger('woosc_open')} 57function woosc_close(){$('#woosc-area').removeClass('woosc-area-open');woosc_close_bar();woosc_close_table();$(document.body).trigger('woosc_close')}
58function woosc_toggle(){if($('#woosc-area').hasClass('woosc-area-open')){woosc_close()}else{woosc_open()} 59$(document.body).trigger('woosc_toggle')} 60function woosc_load_color(){var bg_color=$('#woosc-area').attr('data-bg-color');var btn_color=$('#woosc-area').attr('data-btn-color');$('.woosc-table').css('background-color',bg_color);$('.woosc-bar').css('background-color',bg_color);$('.woosc-bar-btn').css('background-color',btn_color);$('.woosc-sidebar-btn').css('background-color',btn_color)} 61function woosc_change_count(count){if(count==='first'){var products=woosc_get_products();if(products!=''){var products_arr=products.split(',');count=products_arr.length}else{count=0}} 62$('.woosc-menu-item').each(function(){if($(this).hasClass('menu-item-type-woosc')){$(this).find('.woosc-menu-item-inner').attr('data-count',count)}else{$(this).addClass('menu-item-type-woosc').find('a').wrapInner('<span class="woosc-menu-item-inner" data-count="'+count+'"></span>')}});$('#woosc-area').attr('data-count',count);$('.woosc-bar').attr('data-count',count);$('.woosc-sidebar-count').html(' ('+count+')');$('.woosc-bar-items').removeClass('woosc-bar-items-loaded');$('.woosc-sidebar-items').removeClass('woosc-sidebar-items-loaded');$('.woosc-table-items').removeClass('woosc-table-items-loaded');$(document.body).trigger('woosc_change_count',[count])} 63function woosc_hide_empty(){$('.woosc_table > tbody > tr').each(function(){var $tr=$(this);var _td=0;var _empty=!0;$tr.children('td').each(function(){if((_td>0)&&($(this).html().length>0)){_empty=!1;return!1} 64_td++});if(_empty){$tr.addClass('tr-empty').remove()}})} 65function woosc_highlight_differences(){if($('#woosc_highlight_differences').prop('checked')){$('.woosc_table > tbody > tr').each(function(){var $tr=$(this);var _td=0;var _val=$(this).children('td').eq(1).html();var _differences=!1;$tr.children('td:not(.td-placeholder)').each(function(){if((_td>1)&&($(this).html()!==_val)){_differences=!0;return!1} 66_td++});if(_differences){$tr.addClass('tr-highlight')}})}else{$('.woosc_table tr').removeClass('tr-highlight')}} 67function woosc_hide_similarities(){if($('#woosc_hide_similarities').prop('checked')){$('.woosc_table > tbody > tr').each(function(){var $tr=$(this);var _td=0;var _val=$(this).children('td').eq(1).html();var _similarities=!0;$tr.children('td:not(.td-placeholder)').each(function(){if((_td>1)&&($(this).html()!==_val)){_similarities=!1;return!1} 68_td++});if(_similarities){$tr.addClass('tr-similar')}})}else{$('.woosc_table tr').removeClass('tr-similar')}} 69function woosc_copy_to_clipboard(el){el=(typeof el==='string')?document.querySelector(el):el;if(navigator.userAgent.match(/ipad|ipod|iphone/i)){var editable=el.contentEditable;var readOnly=el.readOnly;el.contentEditable=!0;el.readOnly=!0;var range=document.createRange();range.selectNodeContents(el);var selection=window.getSelection();selection.removeAllRanges();selection.addRange(range);el.setSelectionRange(0,999999);el.contentEditable=editable;el.readOnly=readOnly}else{el.select()} 70document.execCommand('copy');alert(woosc_vars.copied_text.replace('%s',el.value))} 71function woosc_get_cookie_products(){return woosc_vars.user_id!==''?'woosc_products_'+woosc_vars.user_id:'woosc_products'}})(jQuery)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.