1(()=>{const TAG="variant-picker";customElements.whenDefined(TAG).then(()=>{const VariantPicker=customElements.get(TAG);if(!VariantPicker||VariantPicker.prototype.__hiddenVariantFixApplied)return;VariantPicker.prototype.__hiddenVariantFixApplied=!0;const originalSelectVariant=VariantPicker.prototype.selectVariant,getHiddenIds=picker=>{const raw=picker.getAttribute("data-hidden-variant-ids")||"";return new Set(raw.split(",").map(value=>parseInt(value,10)).filter(value=>!Number.isNaN(value)))},getSelectedOptionValues=picker=>Array.from(picker.querySelectorAll("[data-option-selector]")).map(selector=>{const input=selector.querySelector('input[name^="option"][type="hidden"], input[name^="option"]:checked, select[name^="option"]');return input?input.value:null}),findVisibleVariant=(picker,hiddenIds)=>{const variants=picker.product&&picker.product.variants;if(!variants)return null;const options=getSelectedOptionValues(picker),hideSoldOut=picker.hasAttribute("hide-sold-out-variants");for(let keep=options.length;keep>=0;keep--){const match=variants.find(variant=>hiddenIds.has(variant.id)||hideSoldOut&&!variant.available?!1:variant.options.slice(0,keep).every((value,index)=>value===options[index]));if(match)return match}return null};VariantPicker.prototype.selectVariant=function(id){const hiddenIds=getHiddenIds(this);if(hiddenIds.size===0||!this.product)return originalSelectVariant.call(this,id);const numericId=parseInt(id,10);if(id==null||hiddenIds.has(numericId)){const replacement=findVisibleVariant(this,hiddenIds);replacement&&(id=replacement.id)}return originalSelectVariant.call(this,id)},customElements.upgrade(document.body),document.querySelectorAll(TAG).forEach(picker=>{const hiddenIds=getHiddenIds(picker);if(hiddenIds.size===0||!picker.product)return;const current=picker.selectedVariant;current&&hiddenIds.has(current.id)&&picker.selectVariant(current.id)})})})(); 2//# sourceMappingURL=/cdn/shop/t/205/assets/hidden-variant-fix.js.map?v=28711288595193461631783628639
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.