jQuery(function($){var nbt_ajax_cart_load={block:function($el){$el.block({message:null,overlayCSS:{background:'#fff',opacity:0.6}});},unblock:function($el){$el.unblock();}}
var nbt_ajax_cart={init:function(){$(document).on('click','.add_to_cart_button',this.add_to_cart);$(document).on('click','.nbt-ac-icon',this.show_cart_content);$(document).on('click','.mini_cart_item .remove',this.remove_to_cart);$(document).on('click','.single_add_to_cart_button:not(.disabled)',this.add_to_cart_single);$(".cart_list").mCustomScrollbar({theme:"dark"});this.load_cal();$(document).mouseup(function(e)
{if($(".nbt-mini-cart").length){var container=$(".nbt-mini-cart");var icon=$(".nbt-ac-icon");if(!container.is(e.target)&&container.has(e.target).length===0&&!icon.is(e.target)&&icon.has(e.target).length===0)
{container.hide();container.removeClass('open');}}});},show_cart_content:function(){var $el=$(this).next();if($el.hasClass('open')){$el.hide();$el.removeClass('open');}else{$el.show();$el.addClass('open');}},load_cal:function(){if($(".nbt-mini-cart").length){var $width=$(window).width()-300;var position=$('.nbt-ajax-cart').offset();if($width<position.left){$(".nbt-mini-cart").addClass('nbt-ajaxcart-right');$(".nbt-mini-cart").css({right:0});}else{$(".nbt-mini-cart").addClass('nbt-ajaxcart-left');$(".nbt-mini-cart").css({left:0});}}},add_to_cart:function(){var $li=$(this).closest('li');nbt_ajax_cart_load.block($li);if(!$(this).hasClass('product_type_variable')){$('.nbt-cart-list-wrap ul').remove();$.ajax({url:wc_add_to_cart_params.ajax_url,data:{action:'nbt_add_to_cart',product_id:$(this).attr('data-product_id')},type:'POST',datatype:'json',success:function(response){nbt_ajax_cart_load.unblock($li);var rs=JSON.parse(response);if(rs.complete!=undefined){$('.nbt-ac-count').text(rs.count);$('.nbt-mini-cart-wrap').html(rs.html);$(".cart_list").mCustomScrollbar({theme:"dark"});if(rs.url_checkout!=undefined){$('.nbt-mini-cart-wrap .wc-forward').attr('href',rs.url_checkout);}
if(rs.error!=undefined){alert(rs.title);}else{nbt_ajax_cart.notification(rs);}}else{window.location.href=rs.url;}},error:function(){alert('There was an error when processing data, please try again !');nbt_ajax_cart_load.unblock($li);}});return false;}},remove_to_cart:function(){var $this=$(this).closest('li');nbt_ajax_cart_load.block($('.nbt-mini-cart'));$.ajax({url:wc_add_to_cart_params.ajax_url,data:{action:'nbt_remove_to_cart',product_id:$(this).attr('data-product_id'),variation_id:$(this).attr('data-variation_id')},type:'POST',datatype:'json',success:function(response){var rs=JSON.parse(response);if(rs.complete!=undefined){$this.remove();if(!rs.count){$('.nbt-mini-cart-wrap').html(rs.html);}
$('.nbt-ac-count').text(rs.count);$('.nbt-mini-cart-wrap .total').html(rs.subtotal);}
nbt_ajax_cart_load.unblock($('.nbt-mini-cart'));},error:function(){alert('There was an error when processing data, please try again !');nbt_ajax_cart_load.unblock();}});return false;},add_to_cart_single:function(){var $this=$(this);nbt_ajax_cart_load.block($this);$('.nbt-cart-list-wrap ul').remove();if($('body').hasClass('single-product')){product_id=$('[name="add-to-cart"]').val();variation_id=$('[name="variation_id"]').val()}else{product_id=$this.val();variation_id='';}
$.ajax({url:wc_add_to_cart_params.ajax_url,data:{action:'nbt_add_to_cart_single',product_id:product_id,variation_id:variation_id,quantity:$('[name="quantity"]').val()},type:'POST',datatype:'json',success:function(response){var rs=JSON.parse(response);if(rs.complete!=undefined){$('.nbt-ac-count').text(rs.count);$('.nbt-mini-cart-wrap').html(rs.html);$('.nbt-mini-cart-wrap .total').html(rs.subtotal);$(".cart_list").mCustomScrollbar({theme:"dark"});if(rs.error!=undefined){alert(rs.title);}else{if(rs.url_checkout!=undefined){window.location.href=rs.url_checkout;}else{nbt_ajax_cart.notification(rs);}}
if(rs.url_checkout!=undefined){$('.nbt-mini-cart-wrap .wc-forward').attr('href',rs.url_checkout);}}
nbt_ajax_cart_load.unblock($this);},error:function(){alert('There was an error when processing data, please try again !');nbt_ajax_cart_load.unblock($this);}});return false;},notification:function(rs){$('.ajaxcart-notification').remove();$('body').append('<div id="growls" class="ajaxcart-notification default" style="top: '+rs.top+'px;"><div class="growl growl-notice growl-medium"><div class="growl-message"><div class="growl-close">×</div>'+rs.title+'</div></div>');$('.ajaxcart-notification').hide().show('slow').delay(2000).hide('slow');}}
nbt_ajax_cart.init();});
jQuery(function($){var nbt_ajax_search_load={block:function($el){$el.block({message:null,overlayCSS:{background:'#fff',opacity:0.6}});},unblock:function($el){$el.unblock();}}
var nbt_ajax_search={init:function(){$(document).on('click','.nbt-icon-search',this.open_ajax_search);$(window).load(function(){var typingTimer;var doneTypingInterval=1000;var $input=$('.nbt-input-search');$input.on('keyup',function(){$('.nbt-icon-loading').show();$('.nbt-search-results').hide();clearTimeout(typingTimer);typingTimer=setTimeout(doneTyping,doneTypingInterval);});$input.on('keydown',function(){clearTimeout(typingTimer);});function doneTyping(){nbt_ajax_search.search_now(typingTimer);}});$(document).mouseup(function(e){if($(".nbt-icon-search.open").length){var container=$(".nbt-search-wrapper");var icon=$(".nbt-icon-search");if(!container.is(e.target)&&container.has(e.target).length===0&&!icon.is(e.target)&&icon.has(e.target).length===0){container.hide();$('.nbt-icon-search').removeClass('open');}}});},search_now:function(typingTimer){$('.nbt-icon-loading').show();$('.nbt-search-results').html('');$.ajax({url:wc_add_to_cart_params.ajax_url,data:{action:'nbt_search_now',search:$('.nbt-input-search').val()},type:'POST',datatype:'json',success:function(response){$('.nbt-icon-plugins').addClass('open');var rs=JSON.parse(response);if(rs.complete!=undefined){$('.nbt-search-results').append(rs.result);$(".nbt-rs-lists").mCustomScrollbar({theme:"dark"});}else{}
$('.nbt-search-results').show();$('.nbt-icon-loading').hide();clearTimeout(typingTimer);},error:function(){clearTimeout(typingTimer);alert('There was an error when processing data, please try again !');$('.nbt-icon-loading').hide();}});},open_ajax_search:function(){$('.nbt-search-results').html('');$('.nbt-input-search').val('');var $wrapper=$(this).closest('.nbt-icon-plugins').find('.nbt-search-wrapper');if($(this).hasClass('open')){$wrapper.hide();$(this).removeClass('open');}else{$wrapper.show();$(this).addClass('open');}
return false;},add_to_cart:function(){nbt_ajax_cart_load.block($('body'));$.ajax({url:wc_add_to_cart_params.ajax_url,data:{action:'nbt_add_to_cart',product_id:$(this).attr('data-product_id')},type:'POST',datatype:'json',success:function(response){var rs=JSON.parse(response);if(rs.complete!=undefined){$.growl.notice({message:rs.msg,duration:'2500'});$('.cart_list').scrollbar();}else{window.location.href=rs.url;}
nbt_ajax_cart_load.unblock($('body'));},error:function(){alert('There was an error when processing data, please try again !');nbt_ajax_cart_load.unblock($('body'));}});return false;},}
nbt_ajax_search.init();});
jQuery(function($){var nbtcs_load={block:function($el){$('.nbt-page-loading').remove();$el.append('<div class="nbt-page-loading"><span class="nbt-loading-svg"></span></div>');},unblock:function($el){$('.nbt-page-loading').remove();}}
var nbtcs_main={init:function(){$(document).on('click','.nbtcs-w-wrapper .selected',this.show_language);$(document).on('click','.nbtcs-select a',this.set_language);$(document).mouseup(function(e)
{if($(".nbtcs-w-wrapper").length){var container=$(".nbtcs-select");var icon=$(".nbtcs-w-wrapper .selected");if(!container.is(e.target)&&container.has(e.target).length===0&&!icon.is(e.target)&&icon.has(e.target).length===0)
{container.hide();container.removeClass('open');}
if(icon.is(e.target)){}}});},show_language:function(){if($(this).hasClass('active')){$('.nbtcs-select').hide();$(this).removeClass('active');}else{$('.nbtcs-select').show();$(this).addClass('active');}},set_language:function(){nbtcs_load.block($('body'));if(typeof nbt_solutions!=='undefined'&&nbt_solutions.ajax_url!=undefined){ajax_url=nbt_solutions.ajax_url;}else{ajax_url=nbtcs.ajax_url;}
$.ajax({url:ajax_url,data:{action:'nbtmcs_save_select',currency:$(this).attr('data-value'),href:$(this).attr('href'),},type:'POST',datatype:'json',success:function(response){var rs=JSON.parse(response);if(rs.complete!=undefined){location.reload();}
$('.nbtcs-select').hide();},error:function(){alert('There was an error when processing data, please try again !');nbtcs_load.unblock($('body'));}});return false;}}
nbtcs_main.init();});
var x=false;jQuery(function($){var nbtcs_frontend={init:function(){$('.variations_form').addClass('swatches-support');$('.variations_form').on('click','.swatch',this.select_attributes);$('.variations_form').on('click','.reset_variations',this.reset_attributes);$(document).ajaxComplete(this.ajax_quick_view);$(document).ajaxStop(function(){x=false;});},ajax_quick_view:function(event,request,settings){if(!x&&settings.data&&settings.data.includes("action=yith_load_product_quick_view")){nbtcs_frontend.init();x=true;}},select_attributes:function(){var selected=[];var $el=$(this),$select=$el.closest('.value').find('select'),attribute_name=$select.data('attribute_name')||$select.attr('name'),value=$el.data('value');$select.trigger('focusin');if(!$select.find('option[value="'+value+'"]').length){$el.siblings('.swatch').removeClass('selected');$select.val('').change();$('.variations_form').trigger('tawcvs_no_matching_variations',[$el]);return;}
clicked=attribute_name;if(selected.indexOf(attribute_name)===-1){selected.push(attribute_name);}
if($el.hasClass('swatch-radio')){$select.val(value);}else{if($el.hasClass('selected')){$select.val('');$el.removeClass('selected');delete selected[selected.indexOf(attribute_name)];}else{$el.addClass('selected').siblings('.selected').removeClass('selected');$select.val(value);}}
$select.change();},select_attributes_radio:function(){var $el=$(this);alert(2);},reset_attributes:function(){$(this).closest('.variations_form').find('.swatch.selected').removeClass('selected');$(this).closest('.variations_form').find('[type="radio"]').prop('checked',false);selected=[];}}
nbtcs_frontend.init();});
jQuery(document).ready(function($){var x=false;var nbtou_load={block:function($el){$el.block({message:null,overlayCSS:{background:'#fff',opacity:0.6}});},unblock:function($el){$el.unblock();}}
var nbtfaq_js={init:function(){$(document).on('click','.nbt-faq-title',this.faq_triggle);},faq_triggle:function(e){e.preventDefault();if($(this).hasClass('active')){$(this).removeClass('active');$(this).closest('li').find('.nbt-faq-content').slideUp();}else{$(this).addClass('active');$(this).closest('li').find('.nbt-faq-content').slideDown();}}}
nbtfaq_js.init();});
jQuery(function($){var vertical=$('.twist-wrap').attr('data-gallery_layout');var nbtgs_js={init:function(){if(jQuery().venobox){this.call_venobox();}
if(jQuery().slick){this.call_slick();}
if(jQuery().zoom){$('.woocommerce-product-gallery__image img').wrap('<span class="slider-inline-block" style="display:inline-block"></span>').parent().zoom({touch:false});$('.woocommerce-product-gallery__image img').load(function(){$('.nbt-gallery-horizontal .slider-nav, .woocommerce div.product div.images.twist-wrap .wc-product-gallery-image').show();var imageObj=$('.woocommerce-product-gallery__image a');if(!(imageObj.width()==1&&imageObj.height()==1)){$('.twist-pgs .woocommerce-product-gallery__image , #slide-nav-pgs .slick-slide .product-gallery__image_thumb').trigger('click');$('.woocommerce-product-gallery__image img').trigger('zoom.destroy');$('.woocommerce-product-gallery__image img').wrap('<span class="slider-inline-block" style="display:inline-block"></span>').parent().zoom({touch:false});var src=$('.woocommerce-product-gallery__image.slick-active img').attr('src');$('.slider-nav .slick-current img').attr('src',src);}});}},call_venobox:function(){$('.venobox').venobox({framewidth:'800px',autoplay:true,titleattr:'data-title',titleBackground:'#000000',titleBackground:'#000000',titleColor:'#fff',numerationColor:'#fff',arrowsColor:'5',titlePosition:'bottom',numeratio:true,spinner:'double-bounce',spinColor:'#fff',border:'5px',bgcolor:'#000000',infinigall:false,numerationPosition:'bottom'});},call_slick:function(){$('.wc-product-image-gallery .twist-pgs').slick({accessibility:false,lazyLoad:'progressive',slidesToShow:1,slidesToScroll:1,arrows:true,fade:false,swipe:true,prevArrow:'<i class="btn-prev dashicons dashicons-arrow-left-alt2"></i>',nextArrow:'<i class="btn-next dashicons dashicons-arrow-right-alt2"></i>',rtl:false,infinite:false,autoplay:true,pauseOnDotsHover:true,autoplaySpeed:'5000',asNavFor:'#slide-nav-pgs',dots:false,});$('.wc-product-image-gallery #slide-nav-pgs').slick({accessibility:false,isSyn:false,slidesToShow:4,slidesToScroll:4,infinite:false,asNavFor:'.twist-pgs',prevArrow:'<i class="btn-prev dashicons dashicons-arrow-left-alt2"></i>',nextArrow:'<i class="btn-next dashicons dashicons-arrow-right-alt2"></i>',dots:false,centerMode:false,rtl:false,vertical:JSON.parse(vertical),draggable:true,focusOnSelect:true,responsive:[{breakpoint:767,settings:{slidesToShow:3,slidesToScroll:3,vertical:false,autoplay:false,isMobile:true,arrows:false}},]});}}
nbtgs_js.init();});