https://onceuponafarmorganics.com/cdn/shop/t/1115/assets/cart-vali…?v=175530273443007876051789484047
1const ADD_ON_TAG="current-add-on",HIDDEN_TAG="hide-from-cart",STORE_ONLY_TAG="store-locator",SUBSCRIPTION_TAG="subscription",DRY_TAGS=new Set(["Dry_alacarte","Dry"]),CHILLED_OR_FROZEN_TAGS=new Set(["Chilled_alacarte","Chilled_subscription","Frozen_Chilled_alacarte","Frozen_subscription","Frozen_alacarte"]),CHILLED_OR_FROZEN="chilled-or-frozen",DRY="dry";export function isCartLineBundled(item){return!!item.properties?._rc_bundle}export function parseCartLineTags(raw){return raw?raw.split(",").map(tag=>tag.trim()).filter(Boolean):[]}export function hasCartLineTag(tags,tag){return tags.includes(tag)}export function isCartAddOn(tags){return hasCartLineTag(tags,ADD_ON_TAG)}export function getCartLineTemperature(tags){return tags.some(tag=>DRY_TAGS.has(tag))?DRY:tags.some(tag=>CHILLED_OR_FROZEN_TAGS.has(tag))?CHILLED_OR_FROZEN:null}export function getInvalidCartLineKeys(lines){if(lines=lines.filter(line=>!line.properties?._is_gwp),lines.length===0)return[];const keysToRemove=new Set;if(lines.every(line=>hasCartLineTag(line.tags,HIDDEN_TAG)))return lines.map(line=>line.key);for(const line of lines)hasCartLineTag(line.tags,SUBSCRIPTION_TAG)&&!isCartLineBundled(line)&&keysToRemove.add(line.key);for(const line of lines)hasCartLineTag(line.tags,STORE_ONLY_TAG)&&keysToRemove.add(line.key);const fullProducts=lines.filter(line=>!isCartAddOn(line.tags)),addOns=lines.filter(line=>isCartAddOn(line.tags));if(addOns.length<=0)return[...keysToRemove];
1if(fullProducts.length===0)return addOns.map(line=>line.key);if(fullProducts.every(line=>getCartLineTemperature(line.tags)===DRY))for(const line of addOns)getCartLineTemperature(line.tags)===CHILLED_OR_FROZEN&&keysToRemove.add(line.key);if(fullProducts.every(line=>getCartLineTemperature(line.tags)===CHILLED_OR_FROZEN))for(const line of addOns)getCartLineTemperature(line.tags)===DRY&&keysToRemove.add(line.key);return[...keysToRemove]} 2//# sourceMappingURL=/cdn/shop/t/1115/assets/cart-validation-utils.js.map?v=175530273443007876051789484047
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.