PageSourceSearch

https://www.tarpsandall.com/static/version1790237564/frontend/Tarp…/Swissup_Breeze/bundles/6/default.min.js

js tarpsandall.com collected 2026-10-04 13:25:57 UTC 91,273 bytes, 208 lines download raw bytes

1(function(){'use strict';$.mixin('collapsible',{isLayeredNavigation:function(){return this.element.hasClass('filter')&&this.element.has('.filter-options').length;},create:function(original){if(this.isLayeredNavigation()){this.filters=this.element.find('.filter-content');this.focusTrap=this.createFocusTrap(this.filters);this._on(document,'breeze:resize-x',()=>{if(this.filters.css('position')!=='fixed'){this.close();}});this.closeBtn=$('<button>').addClass('button-close filter-content-close mobile-category-close-icon');this.filters.prepend(this.closeBtn);$('.button-close.filter-content-close.mobile-category-close-icon').css('display','block');this._on(this.closeBtn,{click:this.close});}
2original();},open:function(original){if(this.isLayeredNavigation()){if(this.filters.css('visibility')!=='hidden'){return;}
3$.breeze.scrollbar.hide();this.filters.one('transitionend',this.focusTrap.activate);}
4original();},close:function(original){if(this.isLayeredNavigation()){$.breeze.scrollbar.reset();this.focusTrap.deactivate();}
5original();}});if($('body').var('--swatches-over-image')){$(document).on('click','a [class^="swatch-opt-"]',function(e){e.preventDefault();});}
6$(document).on('breeze:load',function(){if($('body').var('--swatches-over-image')){$.async(['.products-grid .product-item-details [class^="swatch-opt-"]','[data-appearance="carousel"] .product-item-details [class^="swatch-opt-"]',].join(','),function(el){$(el).appendTo($(el).closest('.product-item-info').find('.product-item-photo'));});}
7$.async('.breeze-carousel .products-grid',(el)=>{$(el).pagebuilderCarousel({arrows:true});$(el).parents('.hide.show-on-ready').removeClass('hide');});if($('body').var('--header-panel-slideout')){$('.panel.header').clone().removeClass('header panel').addClass('mobile-header-panel').data('breeze-temporary',true).appendTo($('.navigation-wrapper'));}});})();(function(){'use strict';$(document).on('breeze:load',function(){window.onclick=function(e){var clickClassName=e.target.className;if(clickClassName=="action submit primary successModalclosebtn closebtn"){$("#forgotpsw_popup_sucess").customerForgotSuccessPopup('closeModal');}
8if(clickClassName=="action remind primary re-loginopen"){$(".customer-login-link").trigger("click");return false;}
9var container=$(".main-flag .select-flag");if(!container.is(e.target)&&container.has(e.target).length===0){$(".sub-flag").hide();}}
10$(document).on('click',function(e){if($(e.target).hasClass('minicart-action-plus')){let $qtyInput
10=$(e.target).parent().find(".cart-item-qty");let currentQty=parseInt($qtyInput.val())||0;$qtyInput.val(currentQty+1).trigger("change");$(e.target).parent().find(".update-cart-item").trigger("click");}
11if($(e.target).hasClass('minicart-action-minus')){let $qtyInput=$(e.target).parent().find(".cart-item-qty");let currentQty=parseInt($qtyInput.val())||0;if(currentQty>1){$qtyInput.val(currentQty-1).trigger("change");$(e.target).parent().find(".update-cart-item").trigger("click");}}});if($('body').hasClass('catalog-product-view')){$(document).on('click','#customer-popup-sign-in',function(e){e.preventDefault();$(".customer-login-link").trigger("click");});}
12$(document).on('click','.warranty-wrapper .main-warranty-section',function(){$(this).toggleClass("active");$(this).closest('.product-warranty-table-content').find('.product-warranty-list').toggle();});$(document).on('click','.warranty-wrapper .product-warranty-year .minicart-select-warranty-year',function(){var id=$(this).attr('data-value');var itemId=$(this).attr('data-item-id');var price=$(this).attr('data-orig-price');var finalprice=$(this).attr('data-price');var type='add';var title=$(this).attr('data-title');addRemoveWarranty(id,itemId,price,type,title,finalprice);});$(document).on('click','#minicart-remove-item-warranty',function(){var id=$(this).attr('data-id');var itemId=$(this).attr('data-item-id');var price=$(this).attr('data-price');var finalprice=$(this).attr('data-price');var type='remove';var title='';addRemoveWarranty(id,itemId,price,type,title,finalprice);});function addRemoveWarranty(id,itemId,price,type,title,finalprice){$(".minicart-loading-mask").show();var payload={'id':id,'item_id':itemId,'price':price,'type':type,'title':title,'finalprice':finalprice};$.ajax({url:window.checkout.warrantyAddRemoveUrl,type:"POST",data:{'_':window.btoa(JSON.stringify(payload))},cache:false,success:function(response){if(response.status=='success'){$.sections.reload(['cart'],false);}else{console.error(response.error);$(".minicart-loading-mask").hide();}},error:function(xhr,status,error){console.error(xhr.responseText);$(".minicart-loading-mask").hide();}});}
13var check_header_uk_cookie=$.cookies.get('header_uk_cookie_section');if(!check_header_uk_cookie){$('.cookie-notice').show();var date=new Date();var minutes=2592000000;date.setTime(date.getTime()+(minutes));$.cookies.set('header_uk_cookie_section',1,{expires:date});}else{$('.cookie-notice').hide();}
14$(".cookie-close").click(function(){$('.cookie-notice').hide();});$(document).on("ajaxComplete",function(event,xhr,settings){if(xhr!=undefined){let url=xhr.response.req.url;if(url.indexOf('customer/section/load')!=-1){$(".minicart-loading-mask").hide();}}});if(window.checkout!=undefined){var mainstoreId=window.checkout.storeId;}else{var mainstoreId=null;}
15var langArray=[];$("input").focus(function(){$(".flag_dropdown_options").hide();});var email=$('#popup_email_address').val();if(email){$('#popup_email_address').trigger('focusout');}
16$(document).on({mouseenter:function(){$(this).addClass('aa-cursor');},mouseleave:function(){$(this).removeClass('aa-cursor');}},'#algolia-autocomplete-container .aa-dropdown-menu .autocomplete-wrapper .aa-suggestions .aa-suggestion');setTimeout(function(){$('.lang-select').each(function(){var formId=$(this).closest("form").attr('id');var selectId=$('.lang-select').closest(".country-code-field").find(".countries").attr('id');$('#'+formId+' #'+selectId+' option').each(function(){var cellstoreid=$(this).attr('data-store-id');var img=$(this).attr("data-thumbnail");var flagdata=$(this).attr('value');var item='';if(mainstoreId==cellstoreid){var getcountryCode=$(this).attr('id');if(getcountryCode){item='<li class="flag_select"><img src="'+img+'" value="'+flagdata+'"/><span>'+flagdata+'</span></li>';}}else{item='<li><img src="'+img+'" value="'+flagdata+'"/><span>'+flagdata+'</span></li>';}
17if(cellstoreid==6&&mainstoreId==5){$('.btn-select').html(langArray[0]);$('#'+formId+' #countryCode').val("+1");}
18langArray.push(item);if(mainstoreId==cellstoreid){var countryCode=$(this).attr('id');if(countryCode){var curr_img=$(this).attr("data-thumbnail");var curr_value=$(this).attr('value');var curr_item='<li><img src="'+curr_img+'" /><span>'+curr_value+'</span></li>';$('#'+formId+' .btn-select').html(curr_item);$('#'+formId+' #countryCode').val(countryCode);$('#'+formId+" #countryCode").prop("readonly",true);}}
19var flagId=$('#'+formId).find("#a_flag_image").attr('class');$('.'+flagId).append(item);});var flagId=$('#'+formId).find("#a_flag_image").attr('id');$('#'+formId+' #'+flagId+' li').click(function(){$('#'+formId+' #a_flag_image li').removeClass('flag_select');$(this).addClass('flag_select');var img=$(this).find('img').attr("src");var value=$(this).find('img').attr('value');var text=this.innerText;$("#"+formId+" #"+selectId).val(value);$("#"+formId+" #"+selectId).attr("id","currentCNT");var e=document.getElementById("currentCNT");var countryCode=e.options[e.selectedIndex].id;if(countryCode){$('#'+formId+' #countryCode').val(countryCode);$('#'+formId+" #countryCode").prop("readonly",true);$('#'+formId+" .flag-code").removeClass('country-error other-country');}else{$('#'+formId+' #countryCode').val('');$('#'+formId+" #countryCode").prop("readonly",false);$('#'+formId+" .flag-code").addClass('other-country');}
20if($('#'+formId+' #countryCode').hasClass('mage-error')){$('#'+formId+" .flag-code").addClass('country-error');}else{$('#'+formId+" .flag-code").removeClass('country-error');}
21$("#"+formId+" #currentCNT").attr("id","countries")
22var item='<li><img src="'+img+'" alt="" /><span>'+text+'</span></li>';$('#'+formId+' .btn-select').html(item);$('#'+formId+' .btn-select').attr('value',value);$(".flag_dropdown_options").hide();});});$("#more_info, #more_info .fa-info-circle").on("click",function(){$('#signup_header_popup').show();});$("#newsletter_box_close").on("click",function(){$('#signup_header_popup').hide();});},2000);$(".sub-flag").hide();
22$(".main-flag .select-flag").click(function(){$(".sub-flag").toggle();});if(document.getElementById("sms_notification_checkbox")!=null){document.getElementById("sms_notification_checkbox").addEventListener("change",function(){if(this.checked){$("#sms_notification").val(1);}else{$('#sms_notification').val(0);}});}
23$(".btn-select").click(function(){var formId=$(this).closest("form").attr('id');$('#'+formId+' .flag_dropdown_options').toggle();if(mainstoreId==5&&$('#'+formId+' #countries').val()=="US"){var firstLI=document.querySelectorAll("#sms-newsletter-validate-detail ul#a_flag_image li");firstLI[0].classname="flag_select";}});var sessionLang=localStorage.getItem('lang');if(sessionLang){var langIndex=langArray.indexOf(sessionLang);$('.btn-select').html(langArray[langIndex]);$('.btn-select').attr('value',sessionLang);}else{var langIndex=langArray.indexOf('ch');$('.btn-select').html(langArray[langIndex]);}
24$.widget('customerAuthenticationPopup','modal',{component:'Swissup_Breeze/js/components/ui/modal',options:{modalClass:'customer-popup-login',responsive:true,buttons:[],overlayClass:'customer-modals-overlay'},_create:function(){this._super();this.openModal();}});$.widget('customerAuthenticationRegPopup','modal',{component:'Swissup_Breeze/js/components/ui/modal',options:{modalClass:'customer-register-link',responsive:true,buttons:[],overlayClass:'customer-modals-overlay'},_create:function(){this._super();this.openModal();}});$.widget('customerForgotPasswordPopup','modal',{component:'Swissup_Breeze/js/components/ui/modal',options:{modalClass:'customer-popup-forgotpassword',responsive:true,buttons:[],overlayClass:'customer-modals-overlay'},_create:function(){this._super();this.openModal();}});$.widget('customerForgotSuccessPopup','modal',{component:'Swissup_Breeze/js/components/ui/modal',options:{modalClass:'customer-popup-forgotpassword',responsive:true,buttons:[],overlayClass:'customer-modals-overlay'},_create:function(){this._super();this.openModal();}});$(".header.links .customer-login-link").removeAttr("href");$(".header.links .customer-register-link").removeAttr("href");[document.querySelector('.customer-login-link'),document.querySelector('#customer-popup-sign-in'),document.querySelector('#login')].forEach(item=>{if(item!=null){item.addEventListener('click',event=>{if($('#customer-popup-login-form input.mage-error').length>0){$('#customer-popup-login-form .error-text').css('display','none');}
25$("#customer-popup-register").customerAuthenticationRegPopup("closeModal");$("#forgotpsw_popup_sucess").customerForgotSuccessPopup('closeModal');if($("#customer-popup-login").parent().hasClass("modal-content")){$("#customer-popup-login").customerAuthenticationPopup("openModal");}else{$("#customer-popup-login").customerAuthenticationPopup();}})}});function changeTimezone(date,ianatz){var invdate=new Date(date.toLocaleString('en-US',{timeZone:ianatz}));var diff=date.getTime()-invdate.getTime();return new Date(date.getTime()-diff);}
26function startTimerForSlide(slide){if(!slide)return;let endDate=slide.dataset.todate;if(!endDate)return;const saleCounter=slide.querySelector(".sale-counter");if(!saleCounter)return;const daysEl=slide.querySelector(".days .number");const hoursEl=slide.querySelector(".hours .number");const minutesEl=slide.querySelector(".mins .number");const secondsEl=slide.querySelector(".sec .number");const couponTimezone=document.getElementById('coupon_timezone');if(!couponTimezone)return;const ruleDate=new Date(endDate);const countDownDate=changeTimezone(ruleDate,"UTC").getTime();const timer=setInterval(function(){if(!document.body.contains(slide)||!saleCounter){clearInterval(timer);return;}
27let now=changeTimezone(new Date(),couponTimezone.value).getTime();let distance=countDownDate-now;if(distance<0){saleCounter.style.display="none";clearInterval(timer);return;}
28saleCounter.style.display="block";let days=Math.floor(distance /(1000*60*60*24));let hours=Math.floor((distance%(1000*60*60*24))/(1000*60*60));let minutes=Math.floor((distance%(1000*60*60))/(1000*60));let seconds=Math.floor((distance%(1000*60))/ 1000);if(daysEl)daysEl.textContent=days;if(hoursEl)hoursEl.textContent=hours;if(minutesEl)minutesEl.textContent=minutes;if(secondsEl)secondsEl.textContent=seconds;},1000);}
29var backColor=$('#ticker_background_color').text().trim();if(backColor){$('.page-header .panel.wrapper').css('background-color',backColor);}
30console.log('extend.js loaded');var slideCount=$('.top-tickers .swiper-slide').length;var toptickerContainer=document.querySelector('.top-tickers');if(toptickerContainer&&toptickerContainer.swiper===undefined){var topticker=new Swiper('.top-tickers',{loop:slideCount>1,slidesPerView:'auto',spaceBetween:15,autoplay:{delay:5500}
30,pagination:{el:'.swiper-pagination',clickable:true},navigation:{nextEl:'.swiper-tt-button-next',prevEl:'.swiper-tt-button-prev'},on:{init(swiper){document.querySelectorAll('.top-tickers .swiper-slide').forEach(function(slide){startTimerForSlide(slide);});},}});setTimeout(function(){if(slideCount>1){$('.swiper-tt-button-next, .swiper-tt-button-prev').removeClass('hide');}},1000);}
31$(".copytext").on("click",function(){var couponElement=$(this);var copyText=couponElement.attr("data-id");$(".code-copied").show();$(this).addClass("copied");$(".copied").hover(function(){$(".code-copied").show();$(".code-copied").css('opacity',1);},function(){$(".code-copied").fadeOut(1000);$(".code-copied").css('opacity',0);});$(this).removeClass("copytext");var $temp=$("<input>");$("body .coupon-code-content").append($temp);$temp.val($(".copycontent").text()).select();document.execCommand("copy");$temp.remove();var element=document.getElementById("code-copied");fade(element);});function fade(element){var op=1;var timer=setInterval(function(){if(op<=0.1){clearInterval(timer);element.style.display='none';}
32element.style.opacity=op;element.style.filter='alpha(opacity='+op*100+")";op-=op*0.1;},100);}
33$("#customer-popup-login-form").submit(function(e){e.preventDefault();var form=$('#customer-popup-login-form');if(form.validation('isValid')){var data=new FormData(e.target);const value=Object.fromEntries(data.entries());var url=form.attr('action');var addToCartButton=$(form).find(".action.primary").not('.noloader');addToCartButton.addClass("disabled processing-loader");addToCartButton.find('span').css('opacity',0);$.request.post({url:url,dataType:'json',data:value,success:function(data){if(data.errors){initilizeLogInOrSignUpFailed('adb_login_failed','email',data.message);$('#customer-popup-login .messages').html('<div class="message-error error message" ><div>'+data.message+'</div></div>');}else{if(data.redirectUrl){$.sections.invalidate(['customer']);$.sections.reload(['customer'],true);initilizeLogInOrSignUpSuccess('adb_login_successful','email');window.location.href=data.redirectUrl;}else{initilizeLogInOrSignUpSuccess('adb_login_successful','email');location.reload();}}},complete:function(){addToCartButton.removeClass("disabled processing-loader");addToCartButton.find('span').css('opacity','');}});return false;}
34return false;});setTimeout(function(){var customerData=$.sections.get('customer');if(!customerData().email){var urlParams=new URLSearchParams(window.location.search);if(typeof urlParams=='object'){var is_login_popup=urlParams.get('is_login_popup');if(is_login_popup==1){var $loginTrigger=$('#open-otp-login, .customer-login-link').first();if($loginTrigger.length){$loginTrigger.trigger('click');}else{if($("#customer-popup-login").parent().hasClass("modal-content")){$("#customer-popup-login").customerAuthenticationPopup("openModal");}else{$("#customer-popup-login").customerAuthenticationPopup();}}}}}},2000);[document.querySelector('.customer-register-link'),document.querySelector('#register'),document.querySelector("#customer-popup-registration")].forEach(item=>{if(item!=null){item.addEventListener('click',event=>{if($('#customer-popup-form-register input.mage-error').length>0){$('#customer-popup-form-register .error-text').css('display','none');}
35$("#customer-popup-login").customerAuthenticationPopup("closeModal");if($("#customer-popup-register").parent().hasClass("modal-content")){$("#customer-popup-register").customerAuthenticationRegPopup("openModal");}else{$("#customer-popup-register").customerAuthenticationRegPopup();}})}});function initilizeLogInOrSignUpFailed(action,type,message=null){window.digitalData=window.digitalData||[];var customerData=$.sections.get('customer')();let user_data=customerData;if(action=='adb_login_failed'||action=='adb_sign_up_failed'){digitalData={event:action,user:{loginType:type,timeStamp:Date.now(),},other:{errorMessage:message}}}else{digitalData={event:action,user:{loginType:type,timeStamp:Date.now(),userID:(!_.isEmpty(user_data.customerId))?user_data.customerId:"NAIDL",},other:{errorMessage:message}}}
36if(typeof _satellite!='undefined'){if(!_.isUndefined(_satellite.track)){console.log(digitalData);_satellite.track(action);}}}
37function initilizeLogInOrSignUpSuccess(action,type){window.digitalData=window.digitalData||[];var customerData=$.sections.get('customer')();let user_data=customerData;if(action=='adb_login_successful'){digitalData={event:action,user:{loginType:type,timeStamp:Date.now(),userID:(!_.isEmpty(user_data.customerId))?user_data.customerId:"NAIDL",}}}else{digitalData={event:action,user:{loginType:type,timeStamp:Date.now()}}}
38if(typeof _satellite!='undefined'){if(!_.isUndefined(_satellite.track)){console.log(digitalData);_satellite.track(action);}}}
39$("#customer-popup-form-register").submit(function(e){e.preventDefault();var form=$('#customer-popup-form-register');let isCaptchaValid=1;if($("#g-recaptcha-response").length){if($("#customer-popup-form-register .g-recaptcha-response").val()==''){isCaptchaValid=0;}}
40if(form.validation('isValid')&&isCaptchaValid==1){var digit_regex=/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{3,17})$/;var Mobile_phone=$("#Mobile_phone").val();var othercountryCode=$("#countryCode").val();if(digit_regex.test(Mobile_phone)&&Mobile_phone.length>=5&&$(this).val().length<=17){if(othercountryCode!=''){var originalnumber=othercountryCode+Mobile_phone;$('#cell_phone').val(originalnumber);}}
41if($('#sms_notification_checkbox').is(':checked')){var email=$('#popup_email_address').val();let isSmsContent=$('#sms_notification').val();let isCellPhone=$('#cell_phone').val();var smsconcent_url=$("#smsconcent_url").val();$.ajax({url:smsconcent_url,data:{isSmsContent:isSmsContent,isCellPhone:isCellPhone,email:email},method:'post',dataType:'json'});}
42var data=new FormData(e.target);const value=Object.fromEntries(data.entries());var url=form.attr('data-action');var addToCartButton=$(form).find(".action.primary").not('.noloader');addToCartButton.addClass("disabled processing-loader");addToCartButton.find('span').css('opacity',0);$.request.post({url:url,dataType:'json',data:value,success:function(data){if(data.errors==true){$('#customer-popup-form-register .messages').html('<div class="message-error error message" ><div>'+data.message+'</div></div>');initilizeLogInOrSignUpFailed('adb_sign_up_failed','email',data.message);}else{initilizeLogInOrSignUpFailed('adb_sign_up_successful','email',data.message);if(data.redirectUrl){window.location.href=data.redirectUrl;}else{location.reload();}}},complete:function(){addToCartButton.removeClass("disabled processing-loader");addToCartButton.find('span').css('opacity','');}});return false;}
43else{if(isCaptchaValid==1){var countryCode=$("#countryCode").val();setTimeout(function(){if($("#customer-popup-form-register #countryCode").hasClass('mage-error')||countryCode==''){$(".flag-code").addClass('country-error');return false;}else{$(".flag-code").removeClass('country-error');}},100);}
44return false;}
45return false;});[document.querySelector('.forgot_password .forgotpswdbtnModal')].forEac
45h(item=>{if(item!=null){item.addEventListener('click',event=>{$("#customer-popup-login").customerAuthenticationPopup("closeModal");if($("#customer-popup-forgotpassword").parent().hasClass("modal-content")){$("#customer-popup-forgotpassword").customerForgotPasswordPopup("openModal");}else{$("#customer-popup-forgotpassword").customerForgotPasswordPopup();}})}});$("#form-forgotpassword").submit(function(e){e.stopImmediatePropagation();var form=$('#form-forgotpassword');if(form.validation('isValid')){var data=new FormData(e.target);const value=Object.fromEntries(data.entries());var url=form.attr('action');var addToCartButton=$(form).find(".action.primary").not('.noloader');addToCartButton.addClass("disabled");addToCartButton.addClass("processing-loader");addToCartButton.find('span').css('opacity',0);$.request.post({url:url,dataType:'json',data:value,success:function(data){if(data.errors){$('#form-forgotpassword .messages').html('<div class="message-error error message" ><div>'+data.message+'</div></div>');}else{$('#form-forgotpassword .messages').html('');$('.forgotpswdbtnsucessModal').trigger("click");}},complete:function(){addToCartButton.removeClass("disabled processing-loader");addToCartButton.find('span').css('opacity','');}});return false;}
46return false;});[document.querySelector('.forgotpswdbtnsucessModal')].forEach(item=>{if(item!=null){item.addEventListener('click',event=>{$("#customer-popup-forgotpassword").customerForgotPasswordPopup("closeModal");if($("#forgotpsw_popup_sucess").parent().hasClass("modal-content")){$("#forgotpsw_popup_sucess").customerForgotSuccessPopup("openModal");}else{$("#forgotpsw_popup_sucess").customerForgotSuccessPopup();}})}});$("#customer-popup-login-form .toggle-password").click(function(){$(this).toggleClass("fa-eye fa-eye-slash");var input=$(this).parent().find("input");if(input.attr("type")=="password"){input.attr("type","text");}else{input.attr("type","password");}});$("#showpassword").click(function(){$('.show-password').trigger('click');});$(".show-password").click(function(){var formID=$(this).closest("form").attr("id");var pass=$('#'+formID+' .showpassword').find('input[type=password]');if(pass.length===0){var pass=$('#'+formID+' .showpassword').find('input[type=text]');}
47$(pass).each(function(){var id=$(this).attr('id');var x=document.getElementById(id);if(x.type==="password"){x.type="text";}else{x.type="password";}})});let smsnotification=document.getElementById("sms_notification_checkbox");if(smsnotification!=null){smsnotification.addEventListener("change",function(){if(this.checked){$("#sms_notification").val(1);}else{$('#sms_notification').val(0);}});}
48let email_address=document.getElementById("email_address");if(email_address!=null){email_address.addEventListener("focusout",function(){var email=$(this).val();var regex=/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(regex.test(email)){var subscribercheckurl=window.BASE_URL+'general/index/checksubscriber';$.ajax({url:subscribercheckurl,data:'email='+email,method:'post',dataType:'json',success:function(data){if(data.output==0){$('.newsletter').show();}else{$('.newsletter').hide();}}});}else{$('.newsletter').hide();}});}
49$(window).on('load',function(){var email=$('#email_address').val();if(email){$('#email_address').trigger('focusout');}});$.widget('warrantyPopup','modal',{component:'Swissup_Breeze/js/components/ui/modal',options:{modalClass:'warranty-popup',responsive:true,buttons:[],header:false},_create:function(){this._super();this.openModal();}});$(".content-compare .warranty-field img").on("click",function(){if($("#warranty-section").parent().hasClass("modal-content")){$("#warranty-section").warrantyPopup("openModal");}else{$("#warranty-section").warrantyPopup();}});});})();(function(){'use strict';$(document).on('breeze:load',function(){$(document).ready(function(){let scrollPosition=0;$('#open-cert-modal').on('click',function(e){e.preventDefault();$('#cert-modal-overlay').fadeIn(200);scrollPosition=window.scrollY;$('body').css({position:'fixed',top:`${-(scrollPosition)}px`,width:'100%',overflow:'hidden'});});$('#close-cert-modal, #cert-modal-overlay').on('click',function(e){if(e.target===this){$('#cert-modal-overlay').fadeOut(200);$('body').attr('style','');window.scrollTo(0,scrollPosition);}});let minicartScrollPosition=0;$('[data-block="minicart"]').on('dropdownDialog:open',function(){minicartScrollPosition=window.scrollY;$('body').css({position:'fixed',top:`-${minicartScrollPosition}px`,width:'100%',overflow:'hidden'});}).on('dropdownDialog:close',function(){$('body').attr('style','');window.scrollTo(0,minicartScrollPosition);});});$(document).ready(function(){$(document).on('click','.separator-icon',function(e){e.stopPropagation();var $actions=$(this).closest('.product.actions').find('.product-item-actions');$('.product-item-actions').not($actions).removeClass('active');$actions.toggleClass('active');});$(document).on('click',function(e){if(!$(e.target).closest('.product.actions').length){$('.product-item-actions').removeClass('active');}});});$(document).ready(function(){function closeSearch(){$('.search-icon').show();$('.block.block-content').removeClass('active');document.body.classList.remove('alogolia-autocomplete-open');if(typeof algoliaAutocompleteInstance!=='undefined'&&algoliaAutocompleteInstance&&typeof algoliaAutocompleteInstance.setIsOpen==='function'){algoliaAutocompleteInstance.setIsOpen(false);}
50var $input=$('#algoliaAutocomplete form input, #algoliaAutocomplete input');if($input.length>0){$input.blur();}}
50
51$(document).on('click','.search-icon',function(e){e.stopPropagation();$(this).hide();$('.block.block-content').addClass('active');setTimeout(function(){$('#algoliaAutocomplete input').focus();},100);});$(document).on('click','.block.block-search .block-title, .block.block-search .aa-ClearIcon, .block-title',function(e){e.stopPropagation();closeSearch();});$(document).on('click',function(e){if(!$(e.target).closest('.block.block-content, .search-icon').length){if($('.block.block-content').hasClass('active')||document.body.classList.contains('alogolia-autocomplete-open')){closeSearch();}}});});const params=new URLSearchParams(window.location.search);const limit=params.get('product_list_limit');if(limit==='all'){$('.toolbar.toolbar-products .pages').hide();}else{$('.toolbar.toolbar-products .pages').show();}
52var isIOS=!!navigator.userAgent.match(/iPhone|iPad|iPod/i);var isSafari=!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/);if(isIOS||isSafari){$("body").addClass("mac");}
53var page=$("#maincontent");var page_height=page.height();var scrwidth=$(window).width();if(scrwidth<767){var trigger_height=page_height / 1.3;}else{var trigger_height=page_height / 2;}
54if($('#backtotop').length){var scrollTrigger=page_height-trigger_height,backToTop=function(){var scrollTop=$(window).scrollTop();if(scrollTop>scrollTrigger){$('#backtotop').show();}else{$('#backtotop').hide();}};backToTop();$(window).on('scroll',function(){backToTop();});$('#backtotop').on('click',function(e){e.preventDefault();window.scrollTo({top:0,behavior:'smooth'});});}
55var header=document.querySelector(".page-header");var body=document.querySelector("body");if(header&&!header.dataset.stickyBound){header.dataset.stickyBound="1";(function(hdr,bdy){var ticking=false;var updateHeaderPosition=function(){var panelWrapper=hdr.querySelector(".panel.wrapper");if(!panelWrapper||panelWrapper.offsetHeight===0){hdr.classList.remove("sticky");if(bdy){bdy.classList.remove("sticky-header");}
56return;}
57var headerOffset=hdr.offsetTop+panelWrapper.offsetHeight;var scrollPosition=window.pageYOffset||document.documentElement.scrollTop;if(scrollPosition>headerOffset+10){hdr.classList.add("sticky");if(bdy){bdy.classList.add("sticky-header");}}else if(scrollPosition<headerOffset-10){hdr.classList.remove("sticky");if(bdy){bdy.classList.remove("sticky-header");}}};window.addEventListener("scroll",function(){if(ticking){return;}
58ticking=true;window.requestAnimationFrame(function(){updateHeaderPosition();ticking=false;});},{passive:true});})(header,body);}
59$(".text-section .readmorelink").click(function(){$('#readMorecontent').css('display','block');$('#readContent').css('display','none');});$(".text-section .readlesslink").click(function(){$('#readMorecontent').css('display','none');$('#readContent').css('display','block');});$(".category-description.cat-description-text .readmorelink").click(function(){$('#readMorecontent').css('display','block');$('#readContent').css('display','none');});$(".category-description.cat-description-text .readlesslink").click(function(){$('#readMorecontent').css('display','none');$('#readContent').css('display','block');});$("#login-form .toggle-password").click(function(){$(this).toggleClass("fa-eye fa-eye-slash");var input=$(this).parent().find("input");if(input.attr("type")=="password"){input.attr("type","text");}else{input.attr("type","password");}});$('.accordian').tabs({active:0,collapsible:true,collapsibleElement:'[data-role=collapsible]',header:'[data-role=title]',content:'[data-role=content]',trigger:'[data-role=trigger]',function(event,ui){if(ui.newTab.length&&ui.newTab[0]===ui.oldTab[0]){event.preventDefault();$(ui.newPanel).slideToggle();}}});if($('.main-banner-center #banner-slider_main .swiper-container').length&&typeof Swiper=='function'){let mainBannerSlides=$("#banner-slider_main").data('slidecount');let loop=mainBannerSlides>1?true:false;let autoplay=mainBannerSlides>1?{'delay':5000,"stopOnLastSlide":false}:false;window.swiperMainBanner=new Swiper(".main-banner-center #banner-slider_main .swiper-container",{"slidesPerView":1,"slidesToScroll":1,"freeMode":false,"loop":loop,"spaceBetween":10,"lazy":true,"preloadImages":true,"wat
59chOverflow":true,'navigation':{'nextEl':'#swiper-button-banner-next','prevEl':'#swiper-button-banner-prev'},"pagination":{"el":'#home-slider-swiper-pagination',"type":'bullets',"clickable":true,},"breakpoints":{'1024':{"slidesPerView":1}},"autoplay":autoplay});}
60const $slider=$('.certificates-section .swiper-container');const slideCount=$slider.find('.swiper-slide').length;if($slider.length&&typeof Swiper==='function'){if(slideCount>=5){new Swiper('.certificates-section .swiper-container',{slidesPerView:5,slidesPerGroup:1,spaceBetween:10,loop:true,freeMode:false,autoplay:{delay:2500,disableOnInteraction:false,}});}else{$slider.addClass('no-slider');}}
61let trustedSwiper;function initTrustedSwiper(){const $sliders=$('.trusted-by-section .swiper-container');const slideCounts=$sliders.find('.swiper-slide').length;if($(window).width()<=1050){if(!trustedSwiper&&slideCounts>=5){trustedSwiper=new Swiper('.trusted-by-section .swiper-container',{slidesPerView:5,slidesPerGroup:1,spaceBetween:10,loop:true,freeMode:false,autoplay:{delay:2500,disableOnInteraction:false,}});}}else if(trustedSwiper){trustedSwiper.destroy(true,true);trustedSwiper=null;}}
62initTrustedSwiper();$(window).on('resize',initTrustedSwiper);if($('#testimonial-homepage .swiper-container').length&&typeof Swiper=='function'){window.swiperTestimonialBanner=new Swiper("#testimonial-homepage .swiper-container",{"slidesPerView":1.4,"slidesToScroll":1,"freeMode":false,"loop":true,"spaceBetween":30,"navigation":true,"lazy":true,"preloadImages":true,"watchOverflow":true,"autoplay":{'delay':3000,},'navigation':{'nextEl':'#swiper-testimonial-button-banner-next','prevEl':'#swiper-testimonial-button-banner-prev'},"breakpoints":{"1200":{"pagination":false,"spaceBetween":65,"slidesPerView":4},"991":{"slidesPerView":3},"768":{"slidesPerView":3}},"pagination":{"el":"#reviews-slider-swiper-pagination","type":"bullets","clickable":true},});}
63if($('#testimonial-homepage-revamp .swiper-container').length&&typeof Swiper=='function'){let swiperTestimonialBanner;function initTestimonialSwiper(){if(swiperTestimonialBanner){swiperTestimonialBanner.destroy(true,true);}
64window.swiperTestimonialBanner=new Swiper("#testimonial-homepage-revamp .swiper-container",{"slidesPerView":4,"loop":true,"spaceBetween":24,"breakpoints":{320:{"slidesPerView":1.4,"spaceBetween":10,"centeredSlides":true,},820:{"slidesPerView":3,"spaceBetween":17,"centeredSlides":true,},1025:{"slidesPerView":4,"spaceBetween":24,"centeredSlides":false,}},});}
65initTestimonialSwiper();$(window).on('orientationchange resize',function(){clearTimeout(window.swiperResize);window.swiperResize=setTimeout(initTestimonialSwiper,300);});}
66if($('#academy-grid .swiper-container').length&&typeof Swiper=='function'){function initAcademySwiper(){if
66($(window).width()<=1025){if(!window.swiperAcademyGrid){window.swiperAcademyGrid=new Swiper("#academy-grid .swiper-container",{"slidesPerView":1.4,"slidesToScroll":1,"freeMode":false,"loop":false,"spaceBetween":24,"navigation":false,"lazy":true,"preloadImages":true,"watchOverflow":true,"autoplay":{'delay':2500,'disableOnInteraction':false,},"breakpoints":{'320':{"pagination":false,"spaceBetween":6,"centeredSlides":true,"effect":"coverflow","grabCursor":true,"slidesPerView":1.4,"loop":true},'820':{"pagination":false,"spaceBetween":17,"centeredSlides":true,"effect":"coverflow","grabCursor":true,"slidesPerView":3,"loop":true},'1025':{"pagination":false,"spaceBetween":24,"slidesPerView":4}},});}}else{if(window.swiperAcademyGrid){window.swiperAcademyGrid.destroy(true,true);window.swiperAcademyGrid=null;}}}
67initAcademySwiper();$(window).on('resize',initAcademySwiper);}
68var fadeOutTimeout;$(".coupon-copy-button").click(function(){window.sessionStorage.removeItem('copycode');window.sessionStorage.removeItem('couponelement');var couponElement=$(this);var copyText=couponElement.attr("data-coupon");$("#code-copied-"+copyText).show();sessionStorage.setItem("copycode",copyText);sessionStorage.setItem("couponelement",this.id);var textArea=document.createElement("textarea");textArea.value=copyText;document.body.appendChild(textArea);textArea.select();document.execCommand('copy');document.body.removeChild(textArea);if(sessionStorage.getItem("couponelement")){var couponElement=sessionStorage.getItem("couponelement");$("button.coupon-copy-button").show();$("button.coupon-copy-button").next('.coupon-copied-button').hide();$("button#"+couponElement+".coupon-copy-button").hide();$("button#"+couponElement+".coupon-copy-button").next('.coupon-copied-button').show();}
69$('.code-copied').hide();var elements=document.querySelectorAll(`[id="code-copied-${copyText}"]`);elements.forEach(function(element){element.style.opacity=1;element.style.display='block';clearTimeout(fadeOutTimeout);fadeOutTimeout=setTimeout(function(){fadeOut(element,1000);},2000);});});window.onbeforeunload=function(){sessionStorage.removeItem('copycode');sessionStorage.removeItem('couponelement');};$(".coupon-copied-button").on("click mouseout",function(event){var couponElement=$(this);var copyText=couponElement.attr("data-id");$("#code-copied-"+copyText).show();if(event.type==="click"){sessionStorage.setItem("copycode",copyText);sessionStorage.setItem("couponelement",this.id);var textArea=document.createElement("textarea");textArea.value=copyText;document.body.appendChild(textArea);textArea.select();document.execCommand('copy');document.body.removeChild(textArea);}
70var elements=document.querySelectorAll(`[id="code-copied-${copyText}"]`);if(elements[0]){setTimeout(function(){fadeOut(elements[0],1000);},2000);}
71elements.forEach(function(element){element.style.opacity=1;element.style.display='block';clearTimeout(fadeOutTimeout);fadeOutTimeout=setTimeout(function(){fadeOut(element,1000);},2000);});});$(document).on("mouseenter",".coupon-copied-button",function(){var couponElement=$(this);var copyText=couponElement.attr("data-id");$("#code-copied-"+copyText).show();var elements=document.querySelectorAll(`[id="code-copied-${copyText}"]`);elements.forEach(function(element){clearTimeout(fadeOutTimeout);fadeIn(element,500);});});function fadeIn(element,duration){element.style.display='block';var startTime=performance.now();function animate(currentTime){var elapsed=currentTime-startTime;var progress=elapsed / duration;element.style.opacity=Math.min(progress,1);if(progress<1){requestAnimationFrame(animate);}}
72requestAnimationFrame(animate);}
73function fadeOut(element,duration){var startTime=performance.now();var startOpacity=parseFloat(window.getComputedStyle(element).opacity);function animate(currentTime){var elapsed=currentTime-startTime;var progress=elapsed / duration;element.style.opacity=Math.max(startOpacity-progress,0);if(progress<1){requestAnimationFrame(animate);}else{element.style.display='none';}}
74requestAnimationFrame(animate);}
75if(sessionStorage.getItem("copycode")){var couponElement=sessionStorage.getItem("couponelement");var copyText=sessionStorage.getItem("copycode");var textArea=document.createElement("textarea");textArea.value=copyText;document.body.appendChild(textArea);textArea.select();document.execCommand('copy');document.body.removeChild(textArea);$("button#"+couponElement+".coupon-copy-button").hide();$("button#"+couponElement+".coupon-copy-button").next('.coupon-copied-button').show();}
76if($('.catalog-category-view').length&&$('.catalog-category-view #banner-slider_main').length>0){if(typeof Swiper=='function'){var categorySwiper=new Swiper(".catalog-category-view #banner-slider_main .swiper-container",{"slidesPerView":1,"slidesToScroll":1,"freeMode":false,"loop":false,"spaceBetween":10,"lazy":false,"preloadImages":true,"wat
76chOverflow":true,'navigation':{'nextEl':'#swiper-button-banner-next','prevEl':'#swiper-button-banner-prev'},"pagination":{"el":'#category-slider-swiper-pagination',"type":'bullets',"clickable":true,},"breakpoints":{'1024':{"slidesPerView":1}},"autoplay":{'delay':5000,"stopOnLastSlide":true,}});}
77setTimeout(()=>{if(typeof Swiper=='function'){new Swiper(".catalog-category-view .widget-recent .recent.swiper-container",{"slidesPerView":"5","slidesToScroll":1,"freeMode":false,"loop":true,"spaceBetween":20,"lazy":true,"preloadImages":false,"navigation":{"nextEl":"#swiper-button-recent-view-next","prevEl":"#swiper-button-recent-view-prev"},"breakpoints":{"1200":{"slidesPerView":3},"767":{"slidesPerView":2.5,"freeMode":true,"loop":true},"480":{"slidesPerView":1.5},"320":{"slidesPerView":1.5}}});}},1000);}
78if($('.tarps-category .product-list').length&&typeof Swiper=='function'){var CatSwiper=new Swiper(".tarps-category .product-list .swiper-container",{"slidesPerView":5,"slidesToScroll":1,"freeMode":false,"loop":false,"spaceBetween":0,"lazy":true,"preloadImages":false,'navigation':{'nextEl':'#swiper-button-shop-cat-next','prevEl':'#swiper-button-shop-cat-prev'},"pagination":{"el":'#shop-cat-swiper-pagination',"type":'bullets',"clickable":true,},"breakpoints":{'1024':{"slidesPerView":5},'769':{"slidesPerView":4},'641':{"slidesPerView":3},'481':{"slidesPerView":2},'320':{'navigation':false,"slidesPerView":2.2}}});}
79function quoteFormHasRecaptcha($form){return $form.find('.field-recaptcha, .g-recaptcha').length>0;}
80function getQuoteFormRecaptchaResponse($form){var response='',recaptchaId,widgetId,textarea,$context;$form=$form&&$form.length?$form:$('#request-form');if(!$form.length){return'';}
81response=$form.find('textarea[name="g-recaptcha-response"], input[name="g-recaptcha-response"]').val()||'';if(response){return response;}
82response=$form.find('input[name="token"]').val()||'';if(response){return response;}
83$form.find('.field-recaptcha textarea[name="g-recaptcha-response"]').each(function(){if(this.value){response=this.value;return false;}});if(response){return response;}
84$context=$form.closest('#quote-form-modal, .quote-form-modal-popup, .modal-inner-wrap');if($context.length){$context.find('textarea[name="g-recaptcha-response"]').each(function(){if(this.value){response=this.value;return false;}});}
85if(response){return response;}
86textarea=document.getElementById('g-recaptcha-response');if(textarea&&textarea.value&&$.contains($form[0],textarea)){return textarea.value;}
87if(typeof window.grecaptcha!=='undefined'&&window.grecaptcha.getResponse){widgetId=$form.data('recaptcha-widget-id');if(widgetId!==undefined){try{response=window.grecaptcha.getResponse(widgetId)||'';}catch(err){}
88if(response){return response;}}
89recaptchaId=$form.find('.g-recaptcha[id]').first().attr('id');if(recaptchaId){try{response=window.grecaptcha.getResponse(recaptchaId)||'';}catch(err2){}
90if(response){return response;}}}
91$('#recaptcha-invisible textarea[name="g-recaptcha-response"]').each(function(){if(this.value){response=this.value;return false;}});return response||'';}
92function requestQuoteFormRecaptchaExecution($form,event){var widgetId=$form.data('widget-id');if(widgetId===undefined||!$form.data('prevent-submit')||typeof window.grecaptcha==='undefined'){return false;}
93event.preventDefault();event.stopImmediatePropagation();if($form.data('quote-recaptcha-executing')){return true;}
94$form.data('quote-recaptcha-executing',true);try{window.grecaptcha.execute(widgetId);}catch(err){$form.data('quote-recaptcha-executing',false);}
95return true;}
96function appendRecaptchaToPayload($form,data){var response=getQuoteFormRecaptchaResponse($form);if(!response){return data;}
97if(data.indexOf('g-recaptcha-response=')===-1){data+=(data?'&':'')+'g-recaptcha-response='+encodeURIComponent(response);}
98return data;}
99function showQuoteFormMessage(messageHtml){$('#request-form .scg-msg > .messages').html(messageHtml);}
100$("#request-form").submit(function(e){var msg=document.querySelector('#request-form .scg-msg .messages');if(msg){msg.innerHTML='';}
101var form=$('#request-form');form.data('quote-recaptcha-executing',false);if(form.validation('isValid')){if(quoteFormHasRecaptcha(form)&&!getQuoteFormRecaptchaResponse(form)){if(requestQuoteFormRecaptchaExecution(form,e)){return false;}
102showQuoteFormMessage('<div class="message-error error message"><div>'
103+$.mage.__('Please complete the CAPTCHA verification.')
104+'</div></div>');e.preventDefault();e.stopImmediatePropagation();return false;}
105$('#request-form').spinner(true,{css:{}});var data=appendRecaptchaToPayload(form,form.serialize());if(data.indexOf('form_key=')===-1&&$.mage&&$.mage.cookies&&$.mage.cookies.get('form_key')){data+='&form_key='+encodeURIComponent($.mage.cookies.get('form_key'));}
106var dataarray={email:$("#email").val(),ph_no:$("#ph_no").val(),category_name:$("#category_name").val(),comment:$("#comment").val()};if(window.datalayerConfig?.is_datalayer_enabled){requestForQuotationEvents('adb_request_for_quotation',dataarray);}
107$.request.post({url:form.attr('action'),dataType:'json',data:data,success:function(data){if(data.status==="SUCCESS"){$("#request-form")[0].reset();showQuoteFormMessage('<div class="message-success success message"><div>'+data.msg+'</div></div>');$("#category_name").addClass("empty");}else if(data.status==="ERROR"){showQuoteFormMessage('<div class="message-error error message"><div>'+data.msg+'</div></div>');}},error:function(data){$("#request-form")[0].reset();showQuoteFormMessage('<div class="message-error error message" ><div>'+data.msg+'</div></div>');$("#category_name").addClass("empty");},complete:function(){$('#request-form').spinner(false);}});e.stopImmediatePropagation();return false;}});function requestForQuotationEvents(action,data){window.digitalData=window.digitalData||[];digitalData={event:action,user:{userEmailID:data['email'],userPhoneNo:data['ph_no'],userRequestProduct:data['category_name'],userMessage:data['comment']}}
108function replaceNullsWithNAIDL(obj){for(var prop in obj){if(obj.hasOwnProperty(prop)){if(obj[prop]===null||obj[prop]==""||obj[prop]=="null"){obj[prop]="NAIDL";}else if(typeof obj[prop]==='object'){replaceNullsWithNAIDL(obj[prop]);}}}}
109replaceNullsWithNAIDL(digitalData);console.warn(digitalData);if(typeof _satellite!='undefined'){_satellite.track(action);}}
110if($('.most-loved-products-slider').length>0&&typeof Swiper=='function'){var mostLovedProductsSwiper=new Swiper(".most-loved-products-slider.swiper-container",{"slidesPerView":3,"slidesToScroll":1,"freeMode":false,"loop":true,"spaceBetween":24,"lazy":true,"preloadImages":false,'navigation':{'nextEl':'#swiper-button-loved-product-next','prevEl':'#swiper-button-loved-product-prev'},"breakpoints":{'320':{"slidesPerView":1.5,"spaceBetween":16,"centeredSlides":true,"effect":"coverflow","grabCursor":true},'767':{"slidesPerView":1.5,"spaceBetween":16,"centeredSlides":true,"effect":"coverflow","grabCursor":true},'992':{"slidesPerView":2,"spaceBetween":16},'1200':{"slidesPerView":3},}});}
111if($('.tarps-by-usage .tarps-by-usage-list').length>0&&typeof Swiper=='function'){var tarpsbyusageSwiper=new Swiper("#tarps-by-usage-wrapper.swiper-container",{"slidesPerView":4,"slidesToScroll":1,"freeMode":false,"loop":false,"spaceBetween":24,"lazy":true,"pagination":false,"preloadImages":false,"navigation":{'nextEl':'#swiper-button-shop-use-next','prevEl':'#swiper-button-shop-use-prev'},"pagination":{'el':'#shop-use-swiper-pagination','type':'bullets','clickable':true,},"breakpoints":{'1280':{"slidesPerView":4},'769':{"slidesPerView":3},'641':{"slidesPerView":3,"spaceBetween":12,},'320':{"slidesPerView":2,"navigation":false,"spaceBetween":12}}});}
112function checkCartWaiting(){var liList=document.getElementById("cart-waiting");if(liList!==null){var items=liList.getElementsByTagName("li");if(items.length===1){liList.classList.add("cart-waiting-one");}}}
113setTimeout(checkCartWaiting,1000);if($("body").hasClass("cms-index-index")){document.addEventListener('click',function(event){if(event.target.matches('.product-waiting-delete')){setTimeout(checkCartWaiting,500);}});}
114if($('.our-materials-wrapper .our-materials-list').length>0&&typeof Swiper=='function'){var ourmaterialsSwiper=new Swiper(".our-materials-list.swiper-container",{"slidesPerView":4,"slidesToScroll":1,"freeMode":false,"loop":false,"spaceBetween":24,"lazy":true,"preloadImages":false,"navigation":{'nextEl':'#swiper-button-material-next','prevEl':'#swiper-button-material-prev'},"pagination":{'el':'#material-swiper-pagination','type':'bullets','clickable':true,},"breakpoints":{'1181':{"slidesPerView":4},'769':{"slidesPerView":3},'481':{"slidesPerView":2},'320':{"slidesPerView":1}}});}
115var loadmoreorder=document.querySelector('.ordersloadmore');
115if(loadmoreorder){$(".ordersloadmore").slice(0,2).show();$('#load').hide();if($('.ordersloadmore[style*="display:none"]').length>=1){$('#load').show();}
116$("#load").click(function(e){e.preventDefault();$('.ordersloadmore[style*="display:none"]').slice(0,1).show();if($('.ordersloadmore[style*="display:none"]').length==0){$('#load').hide();}});}
117$('#newsletter-popup-detail').on('keyup keypress',function(e){var keyCode=e.keyCode||e.which;if(keyCode===13){e.preventDefault();return false;}});function initilizeSubscriptionSuccessful(email){window.digitalData=window.digitalData||[];let action='adb_subscription_successful';let emailId="";if(email.length>0){emailId=window.btoa(unescape(email)).substr(0,36);}
118digitalData={event:action,user:{encryptedEmailid:emailId,emailID:email,timeStamp:Date.now()}}
119if(typeof _satellite!='undefined'){console.log(digitalData);_satellite.track(action);}}
120function initilizeSubscriptionStart(email){window.digitalData=window.digitalData||[];let action='adb_news_letter';digitalData={event:action,user:{userEmailID:email,timeStamp:Date.now()}}
121if(typeof _satellite!='undefined'){console.log(digitalData);_satellite.track(action);}}
122function initilizeSubscriptionError(error){window.digitalData=window.digitalData||[];let action='adb_subscription_error';digitalData={event:action,other:{errorMessage:error},user:{timeStamp:Date.now()}}
123if(typeof _satellite!='undefined'){console.log(digitalData);_satellite.track(action);}}
124$("#newsletter-validate-detail").submit(function(e){e.preventDefault();var form=$('#newsletter-validate-detail');var submitBtn=$('#footer_newsletter_subscribe_btn');if($('#newsletter-validate-detail').valid()){$('#fooeter_newsletter_subscribe_response_error').html('');$('#fooeter_newsletter_subscribe_response_success').html('');var reloadurl=$('#newsletter-validate-detail').attr('action');var processRunning=$t('Processing');var email=$('#newsletter').val();var listId=$('#listId').val();var addToCartButton=$(form).find(".action.primary").not('.noloader');addToCartButton.addClass("disabled");addToCartButton.find('span').css('opacity',0);addToCartButton.spinner(true,{css:{width:20,height:20,background:'none'}});initilizeSubscriptionStart(email);$.ajax({url:reloadurl,data:{'email':email},method:'post',dataType:'json',success:function(data){if(data.errorMsg){$('#fooeter_newsletter_subscribe_response_success').html('');$('#fooeter_newsletter_subscribe_response_error').html(data.errorMsg);if(listId){setTimeout(function(){$(".left-footer").hide();},2000);}}else{$('#fooeter_newsletter_subscribe_response_error').html('');$('#fooeter_newsletter_subscribe_response_success').html(data.successMsg);if(listId){setTimeout(function(){$(".left-footer").hide();},2000);}
125if(window.geq!=undefined){geq.suppress();}}},complete:function(){addToCartButton.removeClass("disabled");addToCartButton.find('span').css('opacity','');addToCartButton.spinner(false);}});}else{return false;}});$.widget('smsPopupNewsletter','modal',{component:'Swissup_Breeze/js/components/ui/modal',options:{modalClass:'newsletter-sms-popup-modal',responsive:true,buttons:[]},_create:function(){this._super();this.openModal();}});$('#sms_newsletter_subscribe_btn').on('click',function(e){var checkbox=$('#checkboxMsg');var errorDiv=$('#footer_sms_concent_response_error');if(!checkbox.prop('checked')){errorDiv.text('This field is required.');errorDiv.show();e.preventDefault();return;}else{errorDiv.hide();}
126setTimeout(function(){if($("#sms-newsletter-validate-detail #countryCode").hasClass('mage-error')||$('#sms-newsletter-validate-detail #countryCode').val()==''){$("#sms-newsletter-validate-detail .flag-code").addClass('country-error');$('#sms-newsletter-validate-detail #countryCode-error').attr('style','display: block !important');}else{$("#sms-newsletter-validate-detail .flag-code").removeClass('country-error');$('#sms-newsletter-validate-detail #countryCode-error').attr('style','display: none !important');}},100);var submitsmsBtn=$('#sms_newsletter_subscribe_btn');var submitBtn=$('#footer_newsletter_subscribe_btn');if($('#sms-newsletter-validate-detail').valid()){$('#fooeter_newsletter_subscribe_response_error').html('');$('#fooeter_newsletter_subscribe_response_success').html('');$('#fooeter_sms_concent_response_error').html('');var reloadurl=$('#sms-newsletter-validate-detail').attr('action');var sms_mobile_phone=$('#sms_mobile_phone').val();var flagcountryCode=$('#countryCode').val();var discount_amt=$('#discount_amt').val();var email=$('#newsletter').val();var sms_cell_phone=flagcountryCode+sms_mobile_phone;submitsmsBtn.prop('disabled',true);e.preventDefault();$.ajax({url:reloadurl,data:{'sms_mobile_phone':sms_mobile_phone,'sms_cell_phone':sms_cell_phone,'flagcountryCode':flagcountryCode,'discount_amt':
126discount_amt,'email':email},method:'post',dataType:'json',showLoader:true,success:function(data){if(data.errorMsg){$('#fooeter_newsletter_subscribe_response_success').html('');$(".mobile").addClass('country-error');$('#fooeter_sms_concent_response_error').html(data.errorMsg);}else{$('#fooeter_newsletter_subscribe_response_error').html('');$(".mobile").removeClass('country-error');$('#fooeter_newsletter_subscribe_response_success').html(data.successMsg);setTimeout(function(){$("#newsletter-sms-popup-modal").hide();$("#newsletter_info").show();$('#fooeter_newsletter_subscribe_response_success').appendTo('#newsletter_info .right-news');},2000);}
127submitsmsBtn.prop('disabled',false);submitBtn.prop('disabled',false);}});}else{return false;}});$('#newsletter-validate-detail').on('keyup keypress',function(e){var keyCode=e.keyCode||e.which;if(keyCode===13){e.preventDefault();return false;}});$(document).on('keydown',function(e){if(e.keyCode===27){$(".product-tie-down-popup,  #signup_header_popup, .sofar-big").hide();}});function changeTimezone(date,ianatz){var invdate=new Date(date.toLocaleString('en-US',{timeZone:ianatz}));var diff=date.getTime()-invdate.getTime();return new Date(date.getTime()-diff);}
128var rule_date=document.getElementById('to_date');if(rule_date){var textColor=$('#ticker-text-color').text().trim();if(textColor){}
129var backColor=$('#ticker_background_color').text().trim();if(backColor){$('.page-header .panel.wrapper').css('background-color',backColor);}}
130var ourmaterial=document.querySelector('.our-materials');if(ourmaterial){if(document.querySelector('.fabric')!=undefined){document.querySelector('.fabric').removeAttribute("href");$(".fabric").click(function(){document.querySelector('.our-materials').offsetTop;document.querySelector('.our-materials').scrollIntoView({behavior:'smooth'});});}}else{if(document.querySelector('.fabric')!=undefined){document.querySelector('.fabric').removeAttribute("href");$(".fabric").click(function(){window.location.href=window.BASE_URL+'#our-materials';});}}
131$(document).off('change.taxExemptionUpload','.tax_exemption_file').on('change.taxExemptionUpload','.tax_exemption_file',function(event){var formId=$(this).closest('form').find('[name=tax_exemption_id]').val();var files=$(this).prop('files'),validateCount=0,extension=['jpeg','jpg','gif','png','doc','docx','bmp','tif','pdf','xls','xlsx','odt','zip','xlsm'],formData=new FormData();var exemptionFiles=[];if($('#tax_exemption_'+formId).val()!=''){exemptionFiles=$('#tax_exemption_'+formId).val().split(",");}
132if(files.length+exemptionFiles.length>5){$.alert({title:'Upload Tax Exempted Certificate',content:$t('You can upolad maximum 5 Exempted Certificates'),actions:{always:function(){}}});$('#tax_exemption_'+formId).val('');$('#tax_exemption_file_'+formId).val('');validateCount=1;}
133$.each(files,function(index,item){if(item.name!=undefined&&item.size!=undefined){var ext=item.name.split('.').pop().toLowerCase();var sizeInMB=(item.size /(1024*1024)).toFixed(2);if(sizeInMB>20){$.alert({title:'Upload Tax Exempted Certificate',content:$t('Please Upload below 20MB size for Tax Exempted Certificates'),actions:{always:function(){}}});$('#tax_exemption_'+formId).val('');$('#tax_exemption_file_'+formId).val('');validateCount=1;}
134if(_.contains(extension,ext)==false){$.alert({title:'Upload Tax Exempted Certificate',content:$t('Please Upload Valid '+extension+' one of file formats,One of Your file do not have valid format'),actions:{always:function(){}}});$('#tax_exemption_'+formId).val('');$('#tax_exemption_file_'+formId).val('');validateCount=1;}
135formData.append("tax_exemption[]",item);}else{$.alert({title:'Upload Tax Exempted Certificate',content:$t('Something Went wrong with One of Your Tax Exempted Certificate'),actions:{always:function(){}}});validateCount=1;}});if(validateCount==1){return false;}
136$('.loader-reference-images').show();$.ajax({url:window.taxExemptionUploadUrl,type:'POST',dataType:'json',data:formData,cache:false,contentType:false,processData:false,success:function(result){if(!result.error){$('#tax_exemption_files_'+formId+' .tax_exemption_files').append(result.html);$('#submit-certificate-'+formId).show();$('#pay-tax-amount-'+formId).hide();var finalArray=[];$.each(result.file,function(_index,item){finalArray.push(item['image_path']);});if($('#tax_exemption_'+formId).length>0){var hiddenImages=$('#tax_exemption_'+formId).val();if(hiddenImages.length>0){hiddenImages=hiddenImages.split(',');$.each(hiddenImages,function(_index,item){finalArray.push(item);});var arrString=finalArray.join(",");$('#tax_exemption_'+formId).val(arrString);}
137else{var arrString=finalArray.join(",");$('#tax_exemption_'+formId).val(arrString);}}}else{$.alert({content:$t(result.error)});$('#tax_exemption_'+formId).val('');$('#tax_exemption_file_'+formId).val('');return false;}
138$('.loader-reference-images').hide();$('#tax_exemption_file_'+formId).val('');},error:function(result){$.alert({content:$t(result.error)});$('.loader-reference-images').hide();$('#tax_exemption_'+formId).val('');$('#tax_exemption_file_'+formId).val('');return false;},dontHide:false});});$(document).off('click.taxExemptionSave','.save-certificate').on('click.taxExemptionSave','.save-certificate',function(){$('.loader-reference-images').show();var formId=$(this).closest('form').find('[name=tax_exemption_id]').val();var formData=new FormData();formData.append('tax_exemption',$('#tax_exemption_'+formId).val()||'');formData.append('tax_exemption_id',$('#tax_exemption_id_'+formId).val()||'');formData.append('order_id',$('#order_id_'+formId).val()||'');if($.mage&&$.mage.cookies&&$.mage.cookies.get('form_key')){formData.append('form_key',$.mage.cookies.get('form_key'));}
139$.ajax({url:window.taxExemptionSaveUrl,type:'POST',dataType:'json',data:formData,cache:false,contentType:false,processData:false,success:function(data){$('.loader-reference-images').hide();data=data||{};if(data.error&&data.error!==0&&data.error!=='0'){$.alert({content:$t(typeof data.error==='string'?data.error:'Something went wrong. Please try again.')});return;}
140$('#upload-certificate-'+formId).hide();$('#submit-certificate-'+formId).hide();$('#pay-tax-amount-'+formId).hide();$('#upload-success-'+formId).show();},error:function(){$('.loader-reference-images').hide();$.alert({content:$t('Something went wrong. Please try again.')});}});});$(".live-chat").click(function(){if($('#fc_frame_dummy').length>0){$('#fc_frame_dummy').trigger('click');}});const downloadButtons=document.querySelectorAll('.download-btn');
140downloadButtons.forEach(function(btn){btn.addEventListener('click',function(e){const url=btn.dataset.href;const filename=btn.dataset.filename||'downloaded_file';console.log(url);fetch(url).then(response=>{if(response.status===200){return response.blob();}else if(response.status===204){throw new Error("File not available for download.");}else{throw new Error("Unexpected error occurred.");}}).then(blob=>{const link=document.createElement('a');link.href=URL.createObjectURL(blob);link.download=filename;document.body.appendChild(link);link.click();document.body.removeChild(link);}).catch(error=>{console.warn("Download failed:",error);});});});});})();(function(){'use strict';var globalPriceFormat={requiredPrecision:2,integerRequired:1,decimalSymbol:',',groupSymbol:',',groupLength:','};function stringPad(string,times){return(new Array(times+1)).join(string);}
141function formatPriceLocale(amount,format,isShowSign){var s='',precision,pattern,locale,r;format=_.extend(globalPriceFormat,format);precision=isNaN(format.requiredPrecision=Math.abs(format.requiredPrecision))?2:format.requiredPrecision;pattern=format.pattern||'%s';locale=window.LOCALE||'en-US';if(isShowSign===undefined||isShowSign===true){s=amount<0?'-':isShowSign?'+':'';}else if(isShowSign===false){s='';}
142pattern=pattern.indexOf('{sign}')<0?s+pattern:pattern.replace('{sign}',s);amount=Number(Math.round(Math.abs(+amount||0)+'e+'+precision)+('e-'+precision));r=amount.toLocaleString(locale,{minimumFractionDigits:precision});return pattern.replace('%s',r).replace(/^\s\s*/,'').replace(/\s\s*$/,'');}
143function formatPrice(amount,format,isShowSign){var s='',precision,integerRequired,decimalSymbol,groupSymbol,groupLength,pattern,i,pad,j,re,r,am;format=_.extend(globalPriceFormat,format);precision=isNaN(format.requiredPrecision=Math.abs(format.requiredPrecision))?2:format.requiredPrecision;integerRequired=isNaN(format.integerRequired=Math.abs(format.integerRequired))?1:format.integerRequired;decimalSymbol=format.decimalSymbol===undefined?',':format.decimalSymbol;groupSymbol=format.groupSymbol===undefined?'.':format.groupSymbol;groupLength=format.groupLength===undefined?3:format.groupLength;pattern=format.pattern||'%s';if(isShowSign===undefined||isShowSign===true){s=amount<0?'-':isShowSign?'+':'';}else if(isShowSign===false){s='';}
144pattern=pattern.indexOf('{sign}')<0?s+pattern:pattern.replace('{sign}',s);i=parseInt(amount=Number(Math.round(Math.abs(+amount||0)+'e+'+precision)+('e-'+precision)),10)+'';pad=i.length<integerRequired?integerRequired-i.length:0;i=stringPad('0',pad)+i;j=i.length>groupLength?i.length%groupLength:0;re=new RegExp('(\\d{'+groupLength+'})(?=\\d)','g');am=Number(Math.round(Math.abs(amount-i)+'e+'+precision)+('e-'+precision));r=(j?i.substr(0,j)+groupSymbol:'')+
145i.substr(j).replace(re,'$1'+groupSymbol)+
146(precision?decimalSymbol+am.toFixed(precision).replace(/-/,0).slice(2):'');return pattern.replace('%s',r).replace(/^\s\s*/,'').replace(/\s\s*$/,'');}
147function objectDeepClone(obj){return JSON.parse(JSON.stringify(obj));}
148function findOptionId(element){var re,id,name;if(!element){return id;}
149name=$(element).attr('name');if(name.indexOf('[')!==-1){re=/\[([^\]]+)?\]/;}else{re=/_([^\]]+)?_/;}
150id=re.exec(name)&&re.exec(name)[1];if(id){return id;}}
151$.catalog=$.catalog||{};$.catalog.priceUtils={formatPriceLocale:formatPriceLocale,formatPrice:formatPrice,deepClone:objectDeepClone,strPad:stringPad,findOptionId:findOptionId};$.breezemap['Magento_Catalog/js/price-utils']=$.catalog.priceUtils;})();(function(){'use strict';$.view('topRibbon',{component:'CP_Newslettersubscriber/js/topRibbon',defaults:{template:'CP_Newslettersubscriber/topRibbon',topTickerMessage:ko.observable(null),couponName:ko.observable(null),topTickerDescription:ko.observable(null),headerFlag:ko.observable(null),toDate:ko.observable(null),},initialize:function(){this._super();var serviceUrl=$("#topRibbonAjax").val();var $this=this;$.ajax({url:serviceUrl,type:'POST',async:false,success:function(response){$this.topTickerMessage(response.topTickerMessage);$this.couponName(response.couponName);$this.topTickerDescription(response.topTickerDescription);$this.headerFlag(response.headerFlag);$this.toDate(response.to_date);if(_.isEmpty(response.topTickerMessage)&&_.isEmpty($this.getCouponName)){$("body .page-wrapper .page-header .panel.wrapper").css("display","none");}
152else{$("body .page-wrapper .page-header .panel.wrapper").css("display","block");if(!_.isEmpty(response.to_date)){$this.startCountdown(response.to_date);}}}});},geti18nText:function(text){return $t(text)},getTopTickerMessage:function(){return this.geti18nText(this.topTickerMessage());},getCouponName:function(){return this.couponName();},getTopTickerDescription:function(){return this.geti18nText(this.topTickerDescription());},getHeaderFlag:function(){return this.headerFlag();},getToDate:function(){return this.toDate();},startCountdown:function(toDate){var targetDate=new Date(toDate);if(isNaN(targetDate.getTime())){console.error("Invalid to_date format:",toDate);return;}
153function updateCountdown(){var now=new Date();var timeDiff=targetDate-now;if(timeDiff<=0){$('#count-down').html('<li>Offer Expired</li>');return;}
154var days=Math.floor(timeDiff /(1000*60*60*24));var hours=Math.floor((timeDiff%(1000*60*60*24))/(1000*60*60));var minutes=Math.floor((timeDiff%(1000*60*60))/(1000*60));var seconds=Math.floor((timeDiff%(1000*60))/ 1000);$('#sale-days').text(days);$('#sale-hrs').text(hours);$('#sale-min').text(minutes);$('#sale-sec').text(seconds);}
155updateCountdown();setInterval(updateCountdown,1000);}});})();(function(){'use strict';$.widget('mage.voiceSearch',{component:'CP_General/js/voice-search',classValues:{voiceSearchInput:'#algoliaAutocomplete form input',voiceSearchMicCircle:'.voice-search-mic-circle',voiceSearchStop:'.stop-voice-search'},speechRecognition:null,isVoiceSearchActive:false,create:function(){const SPEECHRECOGNITION=window.SpeechRecognition||window.webkitSpeechRecognition||window.mozSpeechRecognition||window.msSpeechRecognition||window.oSpeechRecognition;if(typeof SPEECHRECOGNITION==="undefined"){$("#search-voice-input").hide();}else{this.initializeWebSpeechApi();}
156$('#search').on('blur',function(){if($(this).val()!==''){$('#search').addClass('active');}});$('#search').on('focus',function(){let searchInput=document.getElementById("search");searchInput.selectionStart=searchInput.value.length;searchInput.selectionEnd=searchInput.value.length;});},initializeWebSpeechApi:function(){let webSpeechApi=window.SpeechRecognition||window.webkitSpeechRecognition;this.speechRecognition=new webSpeechApi();
156this.speechRecognition.lang=window.getStoreLangCode;this.speechRecognition.onaudioend=this.finishCaptureAudio.bind(this);this.speechRecognition.onaudiostart=this.onAudioStart.bind(this);this.speechRecognition.onend=this.disconnectVoiceRecognizeService.bind(this);this.speechRecognition.onerror=this.apiErrors.bind(this);this.speechRecognition.onnomatch=this.noSignificantRecognition.bind(this);this.speechRecognition.onresult=this.readyToConnectApp.bind(this);this.speechRecognition.onsoundend=this.onSoundEnd.bind(this);this.speechRecognition.onsoundstart=this.onSoundStart.bind(this);this.speechRecognition.onspeechend=this.stopSpeechRecognitionService.bind(this);this.speechRecognition.onspeechstart=this.onSpeechStart.bind(this);this.speechRecognition.onstart=this.onStart.bind(this);this.element.on({click:this.voiceSearchButtonClick.bind(this),mousedown:this.mouseMoveDownAction.bind(this),});$(this.classValues.voiceSearchMicCircle).on({click:this.voiceSearchMicCircleClick.bind(this),mousedown:this.mouseMoveDownAction.bind(this),});$(this.classValues.voiceSearchStop).on({click:this.voiceSearchStopClick.bind(this),mousedown:this.mouseMoveDownAction.bind(this),});},mouseMoveDownAction:function(event){event.preventDefault();},voiceSearchMicCircleClick:function(event){var $widget=this;$('.voice-search-mic-label').hide();if(this.isVoiceSearchActive){this.stopWebSpeechRecognization();}else{this.startWebSpeechRecognization();}},voiceSearchStopClick:function(event){var $widget=this;if(this.isVoiceSearchActive){this.stopWebSpeechRecognization();}},voiceSearchButtonClick:function(event){var $widget=this;if(this.isVoiceSearchActive){this.stopWebSpeechRecognization();}else{voiceSearchPopup();$(this.classValues.voiceSearchInput).val('');this.startWebSpeechRecognization();}},onStart:function(){},onAudioStart:function(){},onSoundStart:function(){},onSoundEnd:function(){},finishCaptureAudio:function(){},onSpeechStart:function(){$('.voice-search-mic-container').removeClass('voice-search-mic-state-listening');$('.voice-search-mic-container').addClass('voice-search-mic-state-speaking');$('.voice-search-body-text .yt-core-attributed-string').text('Listening...');},startWebSpeechRecognization:function(){try{this.speechRecognition.start();}catch(error){this.speechRecognition.stop();this.speechRecognition.start();}
157$('.voice-search-body-text .yt-core-attributed-string').text('Speak now...');$('.voice-search-mic-container').removeClass('voice-search-mic-state-try-again');$('.voice-search-mic-container').addClass('voice-search-mic-state-listening');$('.voice-search-body-text .voice-search-error-text').text('');$('.voice-search-mic-label').hide();this.isVoiceSearchActive=true;this.showDefaultMessage=true;$('#search').blur();$('#search').removeClass('active');},stopWebSpeechRecognization:function(){$('.voice-search-mic-container').removeClass('voice-search-mic-state-listening');$('.voice-search-mic-container').removeClass('voice-search-mic-state-speaking');$('.voice-search-mic-container').addClass('voice-search-mic-state-try-again');this.speechRecognition.stop();this.isVoiceSearchActive=false;},disconnectVoiceRecognizeService:function(event){this.stopWebSpeechRecognization();if(this.showDefaultMessage==true){this.errorMessageDisplay("Can't identify the  phrase or word.");}},apiErrors:function(event){let webSpeechErrorCode=event.error,consoleLogError=false,messageText='';switch(webSpeechErrorCode){case'no-speech':messageText='No speech was detected.';break;case'not-allowed':messageText='Unable to start voice search. Please check your browser permissions and allow this website to use the microphone.';break;case'language-not-supported':messageText='The language was not supported.';break;case'aborted':messageText='Voice capture has been aborted.';break;case'audio-capture':messageText='Audio capture failed.';break;case'network':messageText='Network connectivity is required for voice input.';break;case'service-not-allowed':messageText='The user agent disallowed the requested speech recognition service.';break;case'bad-grammar':messageText='There was an error in the speech recognition grammar.';break;default:messageText='An error has occurred with the speech to text services.';consoleLogError=true;break;}
158if(consoleLogError&&event.message){console.error(event.message);}
159this.errorMessageDisplay(messageText);this.stopWebSpeechRecognization();},noSignificantRecognition:function(event){this.showDefaultMessage=false;this.errorMessageDisplay("Can't identify the  phrase or word.");},readyToConnectApp:function(event){let lastIndex=event.results.length-1,finilzedVoiceInput=event.results[lastIndex][0].transcript;if(finilzedVoiceInput){this.showDefaultMessage=false;let $searchInput=$(this.classValues.voiceSearchInput);finilzedVoiceInput=finilzedVoiceInput.toLowerCase();$searchInput.val(finilzedVoiceInput);$('.yt-core-attributed-string').html(finilzedVoiceInput);$('.voice-search-mic-container').removeClass('voice-search-mic-state-listening');$('.voice-search-mic-container').removeClass('voice-search-mic-state-speaking');$('.voice-search-mic-container').addClass('voice-search-mic-state-try-again');setTimeout(function(){$('.yt-core-attributed-string').html('Please wait we are redirecting to search results.');},1000);$searchInput.closest('form').submit();setTimeout(function(){$('.voice-search-popup-modal .action-close').trigger('click');},2000);}else{this.showDefaultMessage=false;this.noSignificantRecognition(event);}},stopSpeechRecognitionService:function(){this.stopWebSpeechRecognization();},errorMessageDisplay:function(message){this.showDefaultMessage=false;const collection=document.getElementsByClassName("message-error");$('.voice-search-mic-container').removeClass('voice-search-mic-state-listening');$('.voice-search-mic-container').removeClass('voice-search-mic-state-speaking');$('.voice-search-mic-container').addClass('voice-search-mic-state-try-again');$('.yt-core-attributed-string').html('');$('.voice-search-body-text .voice-search-error-text').text(message);$('.voice-search-mic-label').show();}});
159$.widget('voiceSearchPopup','modal',{component:'Swissup_Breeze/js/components/ui/modal',options:{modalClass:'voice-search-popup-modal',responsive:true,buttons:[]},_create:function(){this._super();this.openModal();},_close:function(){this._super();$('.voice-search-mic-label').hide();$('.stop-voice-search').trigger('click');}});function voiceSearchPopup(){if($("#voice-search-popup-modal").parent().hasClass("modal-content")){$("#voice-search-popup-modal").voiceSearchPopup("openModal");}else{$("#voice-search-popup-modal").voiceSearchPopup();}};return $.mage.voiceSearch;})();(function(){'use strict';$(document).ready(function(){if(window.carCoverParams!==undefined){var elements=document.getElementsByClassName('car-cover-product-page-filters');var element2=document.getElementsByClassName('carcover-product-filters');if(elements.length>0||element2.length>0){CarCoverFilterProduct.init(window.carCoverParams);}}});var CarCoverFilterProduct={options:{carCoverParams:null,fieldSelector:'.custom-vehicle-options .vehicle-fields',carYearEleId:'#vehicle-year',carMakeEleId:'#vehicle-make',carModelEleId:'#vehicle-model',carBodyTyEleId:'#vehicle-bodytype',carYearCustomEleId:'.year-toggle',carMakeCustomEleId:'.make-toggle',carModelCustomEleId:'.model-toggle',carBodyTypeCustomEleId:'.bodytype-toggle',carType:'.vehicle-type',productOriginalName:null,productNameElementMobile:'.page-title-wrapper div.page-title-mobile > span',productNameElementDesktop:'.product-info-main .page-title-wrapper h1.page-title',pLDimensionEleName:'product_dimensions[L]',pWDimensionEleName:'product_dimensions[W]',pHDimensionEleName:'product_dimensions[H]',carCoverDefaultPrice:0},init:function(data){var current=this;this.options.carCoverParams=data;this.options.productOriginalName=data.carcoverProductName;this.options.carCoverDefaultPrice=(isNaN(window.carCoverDefaultPrice)||window.carCoverDefaultPrice===undefined)?0:Number(window.carCoverDefaultPrice);this.bindEvents();this.checkInitialConditions();$.async('#measurement-component',function(node){try{setTimeout(function(){let h=document.querySelector('input[name="'+current.options.pHDimensionEleName+'"]');current.dispatchEventChange(h);},1000);}catch(e){console.error(e)}});},checkInitialConditions:function(){var makeElement=$(this.options.carMakeEleId);var modelElement=$(this.options.carModelEleId);if(makeElement.val()&&!modelElement.val()){makeElement.trigger('change');}},bindEvents:function(){var options=this.options;var current=this;$(options.fieldSelector).on('change',function(){let selectedfield=this.name;let url=current.getUrl(selectedfield);if($(this).val()==''){return;}
160$('#'+this.id+'-error').length&&$('#'+this.id+'-error').remove();$.get({url:url,data:{product_id:(typeof document.querySelector=='function')?document.querySelector("#product_id").value:null,selectedField:this.name,selectedValue:this.value,vtype:$('#vtype').val(),form_key:current.getFormKey(),dataType:'json'},success:function(response){$('.loader-overlay').removeClass('active');current.onComplete(response,selectedfield);current.setCarCoverDimensions(selectedfield);var makeElement=$(options.carMakeEleId);var modelElement=$(options.carModelEleId);if(selectedfield=="vehicle-make"&&(makeElement.val()&&modelElement.val())){$(options.carModelEleId).trigger('change');}},complete:function(response){},error:function(error){$('.loader-overlay').removeClass('active');$('body').trigger('processStop');console.error(error);},beforeSend:function(){$('.loader-overlay').addClass('active');$('body').trigger('processStart');}});});$(document).on('click','.year-toggle, .dropdown-arrow',function(){current.showOptions('select-year','options-year','dropdown-year-search');});$(document).on('click','.make-toggle, .dropdown-arrow',function(){current.showOptions('select-make','options-make','dropdown-make-search');});$(document).on('click','.model-toggle, .dropdown-arrow',function(){current.showOptions('select-model','options-model','dropdown-model-search');});$(document).on('click','.bodytype-toggle, .dropdown-arrow',function(){current.showOptions('select-bodytype','options-bodytype','dropdown-bodytype-search');});$(document).on('keydown','.dropdown-year-search',function(){current.searchValues(event,'dropdown-year-search','select-year','options-year');});$(document).on('keydown','.dropdown-make-search',function(){current.searchValues(event,'dropdown-make-search','select-make','options-make');});$(document).on('keydown','.dropdown-model-search',function(){current.searchValues(event,'dropdown-model-search','select-model','options-model');});$(document).on('keydown','.dropdown-bodytype-search',function(){current.searchValues(event,'dropdown-bodytype-search','select-bodytype','options-bodytype');});$(document).on('input','.dropdown-year-search',function(){current.searchValues(event,'dropdown-year-search','select-year','options-year');});$(document).on('input','.dropdown-make-search',function(){current.searchValues(event,'dropdown-make-search','select-make','options-make');});$(document).on('input','.dropdown-model-search',function(){current.searchValues(event,'dropdown-model-search','select-model','options-model');});$(document).on('input','.dropdown-bodytype-search',function(){current.searchValues(event,'dropdown-bodytype-search','select-bodytype','options-bodytype');});$(document).on('click','.custom-vehicle-year',function(){current.selectValue(event,'year-toggle','options-year','select-year','vehicle-year');});$(document).on('click','.custom-vehicle-make',function(){current.selectValue(event,'make-toggle','options-make','select-make','vehicle-make');});$(document).on('click','.custom-vehicle-model',function(){current.selectValue(event,'model-toggle','options-model','select-model','vehicle-model');});$(document).on('click','.custom-vehicle-bodytype',function(){current.selectValue(event,'bodytype-toggle','options-bodytype','select-bodytype','vehicle-bodytype');});$('#custom_make').on('change',function(){var makeValue=$(this).val();if($('#vehicle-make option[value="'+makeValue+'"]').length==0){$('#vehicle-make').append('<option value="'+makeValue+'">'+makeValue+'</option>');}
161$('#vehicle-make').val(makeValue);});$('#custom_model').on('change',function(){var modelValue=$(this).val();if($('#vehicle-model option[value="'+modelValue+'"]').length==0){$('#vehicle-model').append('<option value="'+modelValue+'">'+modelValue+'</option>');}
162$('#vehicle-model').val(modelValue);});$('#custom_body_type').on('change',function(){var bodyTypeValue=$(this).val();var newOption='<option value="'+bodyTypeValue+'" trimlength="185.80" trimwidth="72.00" trimheight="55.5" trimprice="0.00" selected>'+bodyTypeValue+'</option>';if($('#vehicle-bodytype option[value="'+bodyTypeValue+'"]').length==0){$('#vehicle-bodytype').append(newOption);}
163$('#vehicle-bodytype').val(bodyTypeValue);$('#vehicle-bodytype option').each(function(){if($(this).val()!=bodyTypeValue){$(this).prop('selected',false);}});});$('#custom_year').on('change',function(){var yearValue=$(this).val();if($('#vehicle-year option[value="'+yearValue+'"]').length==0){$('#vehicle-year').append('<option value="'+yearValue+'">'+yearValue+'</option>');}
164$('#vehicle-year').val(yearValue);});let selectedValueMake;let selectedValueModel;let selectedTextBody;let selectedValueYear;let autofill=false;$('#custom_option_columns').click(function(){const vehicleMakeElement=document.getElementById('vehicle-make');if(vehicleMakeElement){selectedValueMake=vehicleMakeElement.value;}
165const vehicleModelElement=document.getElementById('vehicle-model');if(vehicleModelElement){selectedValueModel=vehicleModelElement.value;}
166const vehicleBodytypeElement=document.getElementById('vehicle-bodytype');if(vehicleBodytypeElement){const selectedIndex=vehicleBodytypeElement.selectedIndex;if(selectedIndex>=0){const selectedValue=vehicleBodytypeElement.options[selectedIndex].value;selectedTextBody=selectedValue?vehicleBodytypeElement.options[selectedIndex].text:'';}}
167const vehicleYearElement=document.getElementById('vehicle-year');if(vehicleYearElement){selectedValueYear=vehicleYearElement.value;}
168$(this).parent('.selectionexactModal-title').toggleClass('active');$('.custom-Preference').toggle();if($('.custom-Preference').is(':visible')){$('.car_cover_default_column').removeClass('required-entry');$('#is_custom_option').val('1');current.resetOptions();current.removeOptions();if(autofill!==true){const inputFieldMake=document.getElementById('custom_make');if(inputFieldMake){inputFieldMake.value=selectedValueMake;if($('#vehicle-make option[value="'+selectedValueMake+'"]').length==0){$('#vehicle-make').append('<option value="'+selectedValueMake+'">'+selectedValueMake+'</option>');}
169$('#vehicle-make').val(selectedValueMake);}
170const inputFieldModel=document.getElementById('custom_model');if(inputFieldModel){inputFieldModel.value=selectedValueModel;if($('#vehicle-model option[value="'+selectedValueModel+'"]').length==0){$('#vehicle-model').append('<option value="'+selectedValueModel+'">'+selectedValueModel+'</option>');}
171$('#vehicle-model').val(selectedValueModel);}
172const inputFieldBody=document.getElementById('custom_body_type');if(inputFieldBody){inputFieldBody.value=selectedTextBody;var newOption='<option value="'+selectedTextBody+'" trimlength="185.80" trimwidth="72.00" trimheight="55.5" trimprice="0.00" selected>'+selectedTextBody+'</option>';if($('#vehicle-bodytype option[value="'+selectedTextBody+'"]').length==0){$('#vehicle-bodytype').append(newOption);}
173$('#vehicle-bodytype').val(selectedTextBody);$('#vehicle-bodytype option').each(function(){if($(this).val()!=selectedTextBody){$(this).prop('selected',false);}});}
174const inputFieldYear=document.getElementById('custom_year');if(inputFieldYear){inputFieldYear.value=selectedValueYear;if($('#vehicle-year option[value="'+selectedValueYear+'"]').length==0){$('#vehicle-year').append('<option value="'+selectedValueYear+'">'+selectedValueYear+'</option>');}
175$('#vehicle-year').val(selectedValueYear);}
176autofill=true;}}else{$('.car_cover_default_column').addClass('required-entry');$('#is_custom_option').val('0');const customMakeField=document.getElementById('custom_make');if(customMakeField){customMakeField.value='';}
177const customModelField=document.getElementById('custom_model');if(customModelField){customModelField.value='';}
178const customBodyTypeField=document.getElementById('custom_body_type');if(customBodyTypeField){customBodyTypeField.value='';$('#vehicle-bodytype').empty();selectedTextBody='';}
179const customYearField=document.getElementById('custom_year');if(customYearField){customYearField.value='';}
180current.resetOptions();current.removeOptions();current.removeErrorMessage();}
181console.log($('#is_custom_option').val());});},removeOptions:function(){const makeVehicleModel=document.querySelector(".custom-vehicle-make");const makeFirstOption=makeVehicleModel.querySelector("option:first-child");if(makeFirstOption){const makeFirstOptionText=makeFirstOption.textContent.trim();const makeToggleDiv=document.querySelector(".make-toggle");if(makeToggleDiv){makeToggleDiv.textContent=window.carCoverParams.makeLabel;}}
182const customVehicleModel=document.querySelector(".custom-vehicle-model");const children=customVehicleModel.children;for(let i=children.length-1;i>0;i--){customVehicleModel.removeChild(children[i]);}
183const modelFirstOption=customVehicleModel.querySelector("option");if(modelFirstOption){modelFirstOption.textContent=window.carCoverParams.modelabelReset;modelFirstOption.style.display="block";}
184const modelFirstOptionText='Select Car Model';const modelToggleDiv=document.querySelector(".model-toggle");if(modelToggleDiv){modelToggleDiv.textContent=window.carCoverParams.modelabelReset;}
185const customVehicleBodyType=document.querySelector(".custom-vehicle-bodytype");if(customVehicleBodyType){const childrenBodyType=customVehicleBodyType.children;for(let i=childrenBodyType.length-1;i>0;i--){customVehicleBodyType.removeChild(childrenBodyType[i]);}
186const bodyTypeFirstOption=customVehicleBodyType.querySelector("option");if(bodyTypeFirstOption){bodyTypeFirstOption.style.display="block";const bodyTypeFirstOptionText=bodyTypeFirstOption.textContent.trim();const BodyTypeToggleDiv=document.querySelector(".bodytype-toggle");if(BodyTypeToggleDiv){BodyTypeToggleDiv.textContent=window.carCoverParams.bodyTypeLabel;}}}
187const yearVehicleModel=document.querySelector(".custom-vehicle-year");const yearFirstOption=yearVehicleModel.querySelector("option:first-child");if(yearFirstOption){const yearFirstOptionText='Select Car Year';const makeToggleDiv=document.querySelector(".year-toggle");if(makeToggleDiv){makeToggleDiv.textContent=window.carCoverParams.yearLabel;}}},removeErrorMessage:function(){const yearerrorMessage=document.querySelector("#custom_year-error");
187if(yearerrorMessage){yearerrorMessage.remove();}
188const makeerrorMessage=document.querySelector("#custom_make-error");if(makeerrorMessage){makeerrorMessage.remove();}
189const modelerrorMessage=document.querySelector("#custom_model-error");if(modelerrorMessage){modelerrorMessage.remove();}
190const typeerrorMessage=document.querySelector("#custom_body_type-error");if(typeerrorMessage){typeerrorMessage.remove();}},resetOptions:function(){var selectElement=document.getElementById('vehicle-bodytype');if(selectElement){selectElement.options.length=0;}
191document.getElementById('vehicle-model').options.length=0;$('.car_cover_default_column').each(function(){$(this).prop('selectedIndex',0);});},showOptions:function(field,selector,searchSelector){let dropdown=document.querySelector('.'+field);let dropdownOptions=dropdown.querySelector('.'+selector);let dropdownSearch=dropdown.querySelector('.'+searchSelector);$(".dropdown-options:not(."+selector+")").removeClass('open');dropdownOptions.classList.toggle('open');dropdownSearch.focus();},searchValues:function(event,searchField,field,optionsList){let dropdown=document.querySelector('.'+field);let dropdownSearch=dropdown.querySelector('.'+searchField);var searchValue=dropdownSearch.value.toLowerCase();let dropdownOptions=dropdown.querySelector('.'+optionsList);let options=dropdownOptions.querySelectorAll('.option');for(var i=0;i<options.length;i++){var optionText=options[i].textContent.toLowerCase();if(optionText.indexOf(searchValue)>-1){options[i].style.display='block';}else{options[i].style.display='none';}}},selectValue:function(event,toggle,options,field,inputId){let dropdown=document.querySelector('.'+field);let dropdownToggle=dropdown.querySelector('.'+toggle);let dropdownOptions=dropdown.querySelector('.'+options);let target=event.target;let input=document.getElementById(inputId);if(target.classList.contains('option')){let selectedValue=target.getAttribute('value');let selectedText=target.textContent;dropdownToggle.textContent=selectedText;dropdownOptions.classList.remove('open');input.value=selectedValue;let event=new Event('change');input.dispatchEvent(event);let selectDropdown=document.getElementById(inputId);var selectedIndex=selectDropdown.selectedIndex;selectDropdown.selectedIndex=selectedIndex;$('#custom_make').val('');$('#custom_model').val('');$('#custom_body_type').val('');$('#custom_year').val('');}
192var element=document.getElementById(inputId+'-error');if(element){element.parentNode.removeChild(element);}},onComplete:function(response,selectedfield){let response_data=response.data;var options=this.options;if(selectedfield=="vehicle-type"){$(options.carYearEleId).html(response_data);$(".custom-vehicle-year").html(response_data);$(options.carYearEleId).removeAttr("disabled");}
193if(selectedfield=="vehicle-make"){$(options.carModelEleId).html(response_data);$(".custom-vehicle-model").html(response_data);$(options.carModelEleId).removeAttr("disabled");}
194if(selectedfield==="vehicle-model"){if(response&&typeof response.url!=="undefined"&&response.url!==""){window.location=response.url;}
195$(options.carBodyTyEleId).html(response_data);$(".custom-vehicle-bodytype").html(response_data);$(options.carBodyTyEleId).removeAttr("disabled");}},resetOption:function(element,label){$(element).html('<option value="">'+label+'</option>');},getUrl:function(selectedfield){var current=this;var options=this.options;var params=options.carCoverParams;var url=params.carcoverUrl;var y=options.carYearEleId;var mk=options.carMakeEleId;var md=options.carModelEleId;var bd=options.carBodyTyEleId;var yc=options.carYearCustomEleId;var mkc=options.carMakeCustomEleId;var mdc=options.carModelCustomEleId;var bdc=options.carBodyTypeCustomEleId;var yt=".custom-vehicle-year";var mkt=".custom-vehicle-make";var mdt=".custom-vehicle-model"
196var bdt=".custom-vehicle-bodytype"
197var ydtoption=params.yearLabel;var mdtoption=params.makeLabel;var mddtoption=params.modelLabel;var bddtoption=params.bodyTypeLabel;if(selectedfield=="vehicle-type"){current.resetOption(y,ydtoption);current.resetOption(mk,mdtoption);current.resetOption(md,mddtoption);current.resetOption(bd,bddtoption);}
198if(selectedfield=="vehicle-make"){let type=current.getSelectedOption(options.carType);url=url+"?type="+type;current.resetOption(md,mddtoption);current.resetOption(bd,bddtoption);$(mdc).html(mddtoption);$(bdc).html(bddtoption);$(mdt).empty();$(bdt).empty();}
199if(selectedfield=="vehicle-model"){let make=current.getSelectedOption(options.carMakeEleId);let type=current.getSelectedOption(options.carType);url=url+"?make="+make+"&type="+type;current.resetOption(bd,bddtoption);$(bdc).html(bddtoption);$(bdt).empty();}
200if(selectedfield=="vehicle-bodytype"){let make=current.getSelectedOption(options.carMakeEleId);let type=current.getSelectedOption(options.carType);let model=current.getSelectedOption(options.carModelEleId);url=url+"?make="+make+"&type="+type+"&model="+model;}
201current.setProductName();return url;},getSelectedOption:function(elementId){return $(elementId).length&&$(elementId).val();},setCarCoverDimensions:function(selectedfield){var current=this;if(selectedfield=="vehicle-bodytype"){let bt=document.getElementById('vehicle-bodytype');let selectedOption=bt.options[bt.selectedIndex];let trimlength=selectedOption.getAttribute('trimlength');let trimwidth=selectedOption.getAttribute('trimwidth');let trimheight=selectedOption.getAttribute('trimheight');let price=selectedOption.getAttribute('trimprice');
201let l=document.querySelector('input[name="'+this.options.pLDimensionEleName+'"]');l.value=trimlength;let w=document.querySelector('input[name="'+this.options.pWDimensionEleName+'"]');w.value=trimwidth;let h=document.querySelector('input[name="'+this.options.pHDimensionEleName+'"]');h.value=trimheight;window.carCoverDefaultPrice=(isNaN(price)||price===undefined)?0:Number(price);current.dispatchEventChange(h);}},dispatchEventChange:function(obj){var event=new Event('change');obj!==null&&obj.dispatchEvent(event);},setProductName:function(){if(this.options.productOriginalName==null){console.warn('CarCoverProduct not initialize');return};var name=[];var allSelectedCount=0;if($(this.options.carYearEleId).val()!==''){name[0]=$(this.options.carYearEleId).val();allSelectedCount++;}
202if($(this.options.carMakeEleId).val()!==''){name[1]=$(this.options.carMakeEleId).val();allSelectedCount++;}
203if($(this.options.carModelEleId).val()!==''){name[2]=$(this.options.carModelEleId).val();allSelectedCount++;}
204name[3]=this.options.productOriginalName;if(allSelectedCount==3){$(this.options.productNameElementMobile).text(name.join(" "));$(this.options.productNameElementDesktop).text(name.join(" "));}},getFormKey:function(){var current=this;var formKeys=[];var selectors=[".product-add-form","#search-visenze-upload-form",".form-login","form","[name='form_key']"];selectors.forEach(function(selector){var formKey=current.getFormKeyValue(selector);if(formKey&&formKey.trim()!==''){formKeys.push(formKey.trim());}});if(formKeys.length===0){console.log('No form keys found');return null;}
205var mostCommonFormKey=current.getMostCommonValue(formKeys);return mostCommonFormKey;},getFormKeyValue:function(selector){try{var element=$(selector);if(element.length===0){console.log("Element not found for selector: "+selector);return null;}
206var formKeyInput;if(selector==="[name='form_key']"){formKeyInput=element.first();}else{formKeyInput=element.find('[name="form_key"]').first();if(formKeyInput.length===0&&element.attr('name')==='form_key'){formKeyInput=element;}}
207if(formKeyInput.length===0){console.log("No form_key input found for selector: "+selector);return null;}
208var formKey=formKeyInput.val();return formKey&&formKey.trim()!==''?formKey.trim():null;}catch(error){console.error("Error getting form key for selector "+selector+":",error);return null;}},getMostCommonValue:function(values){if(values.length===0)return null;if(values.length===1)return values[0];var counts={};values.forEach(function(value){counts[value]=(counts[value]||0)+1;});var maxCount=0;var mostCommon=values[0];Object.keys(counts).forEach(function(value){if(counts[value]>maxCount){maxCount=counts[value];mostCommon=value;}});return mostCommon;}};})();

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.