PageSourceSearch

https://coldest.com/cdn/shop/t/237/assets/coldest-hide-oos-swatches.js?v=175603342415895241811774642801

js coldest.com collected 2026-09-24 10:04:32 UTC 1,984 bytes, 2 lines download raw bytes

1(function(){"use strict";function hideOOSSwatches(){for(var scripts=document.querySelectorAll('script[type="application/json"]'),productData=null,i=0;i<scripts.length;i++)try{var data=JSON.parse(scripts[i].textContent);if(data&&data.variants&&data.variants.length>1&&data.variants[0].option1){productData=data;break}}catch(e){}if(!(!productData||!productData.variants)){var colorMap={};productData.variants.forEach(function(v){var color=v.option1;color&&(colorMap[color]||(colorMap[color]={total:0,unavail:0}),colorMap[color].total++,v.available||colorMap[color].unavail++)});var hiddenColors=[];Object.keys(colorMap).forEach(function(color){colorMap[color].total===colorMap[color].unavail&&hiddenColors.push(color.toLowerCase().replace(/"/g,""))}),hiddenColors.length&&(document.querySelectorAll("[data-swatch]").forEach(function(label){var swatchVal=(label.getAttribute("data-swatch")||"").toLowerCase();if(hiddenColors.indexOf(swatchVal)!==-1){label.style.display="none";var forId=label.getAttribute("for");if(forId){var input=document.getElementById(forId);input&&(input.style.display="none")}}}),document.querySelectorAll(".option-selector select option, .custom-select__option").forEach(function(opt){var val=(opt.textContent||opt.value||"").trim().toLowerCase().replace(/"/g,"");hiddenColors.indexOf(val)!==-1&&(opt.style.display="none",opt.disabled=!0)}))}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){setTimeout(hideOOSSwatches,500),setTimeout(hideOOSSwatches,2e3)}):(setTimeout(hideOOSSwatches,500),setTimeout(hideOOSSwatches,2e3));var observer=new MutationObserver(function(mutations){var hasNewSwatches=mutations.some(function(m){return m.addedNodes.length>0});hasNewSwatches&&hideOOSSwatches()}),target=document.querySelector(".option-selectors")||document.body;observer.observe(target,{childList:!0,subtree:!0})})();
2//# sourceMappingURL=/cdn/shop/t/237/assets/coldest-hide-oos-swatches.js.map?v=175603342415895241811774642801

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.