function anonymous( ) { document.addEventListener('codeblackbelt:frequently-bought-together:rendered',function(){if(window.InstantClick&&window.InstantClick.on){window.InstantClick.on('change',function(){delete window.codeblackbelt['frequently-bought-togetherLoaded'];});} manageVariantChange();});var VARIANT_SELECTOR='.single-option-selector';var VARIANT_EVENT='change';function changeVariant(variant){API.selectThisItemVariant(variant);} function setEventVariant(){var elements=document.querySelectorAll(VARIANT_SELECTOR);elements.forEach(function(element){element.addEventListener(VARIANT_EVENT,function(e){setTimeout(()=>{var url=new URL(window.location.href);var variant=url.searchParams.get("variant");if(variant){return changeVariant(variant);} variant=e.currentTarget.value;if(variant){return changeVariant(variant);}},500);});});} function manageVariantChange(){try{let origin=window.Theme;let pxu=window.PXUTheme;if((typeof origin!=='undefined'&&origin.version&&parseInt(origin.version)>=7)||(typeof pxu!=='undefined'&&pxu.version&&parseInt(pxu.version)>=7)){var API=window["codeblackbelt"]["frequently-bought-togetherApi"];API.watch('.single-option-selector',function(){setEventVariant();});}}catch(error){}} //# sourceURL=frequently-bought-together-custom-javascript.js }