1var G5_Woocommerce_Swatches=window.G5_Woocommerce_Swatches||{};(function(a){'use strict';window.G5_Woocommerce_Swatches=G5_Woocommerce_Swatches;var b=woocommerce_swatches_var.price_selector,c=woocommerce_swatches_var.localization;G5_Woocommerce_Swatches={init:function(){this.initSwatches(),this.events()},events:function(){a('body').on('gf_woocommerce_ajax_success gf_quick_view_success',function(){setTimeout(function(){G5_Woocommerce_Swatches.initSwatches()},500),setTimeout(function(){G5_Woocommerce_Swatches.initSwatches()},1e3)})},initSwatches:function(){a('.gf-swatches-wrap').each(function(){var d=a(this),f=d.find('.swatches-item:not(.swatches-disabled)'),g=d.find('.reset_variations'),h=d.closest('.product-item-wrap'),j=a.parseJSON(d.attr('data-product_variations'));d.find('.swatches-inner').length||d.addClass('swatches-empty'),f.length&&f.unbind('click').on('click',function(k){var l=a(this);return!l.hasClass('swatches-disabled')&&void(h.find('.swatches-item').removeClass('swatches-disabled swatches-enabled'),l.parent().find('.swatches-item.swatches-selected').removeClass('swatches-selected'),l.hasClass('swatches-selected')?(l.parent().removeClass('swatches-activated'),h.removeClass('gf-product-swatched'),!h.find('.swatches-selected').length&&g.trigger('click')):(l.parent().addClass('swatches-activated'),l.addClass('swatches-selected'),h.addClass('gf-product-swatched'),g.addClass('show').show()),G5_Woocommerce_Swatches.execVariable(d,j,g,l),k.preventDefault())}),g.unbind('click').on('click',function(){h.removeClass('gf-product-swatched'),d.removeAttr('data-variation_id'),d.find('.swatches-inner').removeClass('swatches-activated'),d.find('.swatches-item').removeClass('swatches-enabled swatches-disabled swatches-selected'),a('body').trigger('gf_reset_add_to_cart_button_text'),h.find('.add_to_cart_button').removeClass('ajax_add_to_cart swatches-text-changed added loading').text(c.select_options_text);var k=h.find(b).not('.price-cloned'),l=h.find('.price-cloned');return l.length&&(k.html(l.html()),l.remove()),G5_Woocommerce_Swatches.variationsImageUpdate(!1,h),a(this).removeClass('show').hide(),!1})}),a('.gf-swatches-single-wrap').each(function(){var d=a('form.gf-swatches.variations_form'),f=d.find('.swatches-item'),g=d.find('.swatches-item:not(.swatches-disabled)');f.each(function(){var h=a(this),j=h.attr('data-term'),k=h.parent().attr('data-attribute'),l=d.find('select#'+k),m=l.val();''!=m&&j==m&&a(this).addClass('swatches-selected')}),g.unbind('click').on('click',function(h){var j=a(this),k=j.attr('data-term'),l=j.parent().attr('data-attribute'),m=d.find('select#'+l);return!j.hasClass('swatches-disabled')&&void(m.val(k).trigger('change'),j.parent().find('.swatches-selected').removeClass('swatches-selected'),j.addClass('swatches-selected'),h.preventDefault())}),d.on('woocommerce_update_variation_values',function(){d.find('select').each(function(){var h=a(this),j=h.parent().find('.swatches-inner');j.find('.swatches-item').removeClass('swatches-enabled').addClass('swatches-disabled'),h.find('option.enabled').each(function(){var k=a(this).val();j.find('.swatches-item[data-term="'+k+'"]').removeClass('swatches-disabled').addClass('swatches-enabled')})})}),d.on('reset_data',function(){a(this).parent().find('.swatches-selected').removeClass('swatches-selected')})})},execVariable:function(d,f,g){var j=G5_Woocommerce_Swatches.getChosenAttributes(d),k=j.data;if(G5_Woocommerce_Swatches.updateAttributes(d,f),j.count===j.chosenCount){var l=G5_Woocommerce_Swatches.findMatchingVariations(f,k),m=l.shift();m?G5_Woocommerce_Swatches.foundVariation(d,m):g.trigger('click')}},getChosenAttributes:function(d){var f={},g=0,h=0,j=d.find('.swatches-inner');return j.each(function(){var k='attribute_'+a(this).attr('data-attribute'),l=a(this).find('.swatches-item.swatches-selected').attr('data-term')||'';0<l.length&&h++,g++,f[k]=l}),{count:g,chosenCount:h,data:f}},updateAttributes:function(d,f){var g=G5_Woocommerce_Swatches.getChosenAttributes(d),h=g.data,j=0,k=d.find('.swatches-inner');k.each(function(l,m){var n=a(m),o='attribute_'+n.attr('data-attribute'),p=n.find('.swatches-item.swatches-selected').attr('data-term'),q=!0,r=a.extend(!0,{},h);r[o]='',a(this).find('.swatches-item').removeClass('swatches-enabled');var s=G5_Woocommerce_Swatches.findMatchingVariations(f,r);for(var t in s)if('undefined'!=typeof s[t]){var u=s[t].attributes;for(var v in u)if(u.hasOwnProperty(v)){var w=u[v],x='';v===o&&(s[t].variation_is_active&&(x='enabled'),w?n.find('.swatches-item[data-term="'+w+'"]').addClass('swatches-'+x):n.find('.swatches-item').addClass('swatches-'+x))}}j=n.find('.swatches-item.swatches-enabled').length,p&&(0==j||0===n.find('.swatches-item.swatches-enabled[data-term="'+G5_Woocommerce_Swatches.addSlashes(p)+'"]').length)&&(q=!1),n.find('.swatches-item:not(.swatches-enabled)').addClass('swatches-disabled'),p?!q&&n.find('.swatches-item.swatches-selected').removeClass('swatches-selected'):n.find('.swatches-item.swatches-selected').removeClass('swatches-selected')})},findMatchingVariations:function(d,f){for(var j,g=[],h=0;h<d.length;h++)j=d[h],G5_Woocommerce_Swatches.isMatch(j.attributes,f)&&g.push(j);return g},isMatch:function(d,f){var g=!0;for(var h in d)if(d.hasOwnProperty(h)){var j=d[h],k=f[h];j!==void 0&&k!==void 0&&0!==j.length&&0!==k.length&&j!==k&&(g=!1)}return g},addSlashes:function(d){return d=d.replace(/'/g,'\\\''),d=d.replace(/"/g,'\\"'),d},foundVariation:function(d,f){var g=d.closest('.product'),h=g.find(b).not('.price-cloned'),j=h.clone().addClass('price-cloned').css('display','none');f.price_html?(!g.find('.price-cloned').length&&g.append(j),h.replaceWith(f.price_html)):g.find('.price-cloned').length&&(h.replaceWith(j.html()),j.remove()),d.attr('data-variation_id',f.variation_id),G5_Woocommerce_Swatches.variationsImageUpdate(f,g),G5_Woocommerce_Swatches.changeAddToCartBtnText(f,g)},variationsImageUpdate:function(d,f){var g=f.find('.wp-post-image');f.find('.product-thumb-secondary').length&&(g=f.find('.product-thumb-secondary').find('.wp-post-image')),d&&d.image.src?(G5_Woocommerce_Swatches.setVariationAttr(g,'src',d.image.thumb_src),G5_Woocommerce_Swatches.setVariationAttr(g,'srcset',d.image.thumb_srcset)):(G5_Woocommerce_Swatches.resetVariationAttr(g,'src'),G5_Woocommerce_Swatches.resetVariationAttr(g,'srcset'))},resetVariationAttr:function(d,f){void 0!==d.attr('data-o_'+f)&&d.attr(f,d.attr('data-o_'+f))},setVariationAttr:function(d,f,g){void 0===d.attr('data-o_'+f)&&d.attr('data-o_'+f,d.attr(f)?d.attr(f):''),!1===g?d.removeAttr(f):d.attr(f,g)},changeAddToCartBtnText:function(d,f){var g=f.find('.add_to_cart_button'),h=f.find('.added_to_cart'),j='';f.removeClass('active'),g.removeClass('added'),h.length&&h.remove(),g.data('product_id',d.variation_id),g.attr('data-product_id',d.variation_id),!0===d.is_
1in_stock?(j=c.add_to_cart_text,g.addClass('ajax_add_to_cart')):(j=c.read_more_text,g.removeClass('ajax_add_to_cart')),g.addClass('swatches-text-changed').text(j),a('body').trigger('gf_change_add_to_cart_button_text')}},a(document).ready(function(){G5_Woocommerce_Swatches.init()})})(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.