PageSourceSearch

https://www.riverbotanicals.com/cdn/shop/t/147/assets/rb-product-v…?v=81412178136289733671789592366

js riverbotanicals.com collected 2026-10-09 04:43:11 UTC 7,488 bytes, 2 lines download raw bytes

1(function(){var glowSyncByRoot=new WeakMap,globalGlowBound=!1;function onReady(fn){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",fn):fn()}function isProductPage(){return!!(document.body&&document.body.classList.contains("template-product"))}function normalizeHex(hex){if(hex&&typeof hex=="object"&&(hex=hex.toString?hex.toString():""),!hex||typeof hex!="string")return null;var cleaned=hex.trim();return!cleaned||(cleaned.charAt(0)!=="#"&&(cleaned="#"+cleaned),!/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(cleaned))?null:cleaned}function lightenHex(hex,amount){var cleaned=normalizeHex(hex);if(!cleaned)return"#4fa891";var raw=cleaned.slice(1);raw.length===3&&(raw=raw.split("").map(function(c){return c+c}).join(""));var r=parseInt(raw.slice(0,2),16),g=parseInt(raw.slice(2,4),16),b=parseInt(raw.slice(4,6),16),mix=function(channel){return Math.round(channel+(255-channel)*amount)},toHex=function(n){var h=n.toString(16);return h.length===1?"0"+h:h};return"#"+toHex(mix(r))+toHex(mix(g))+toHex(mix(b))}function applyGlow(root,hex){var color=normalizeHex(hex)||"#29696a",mid=lightenHex(color,.35),flow="linear-gradient(90deg, "+color+" 0%, "+mid+" 50%, "+color+" 100%)",staticGrad="linear-gradient(90deg, "+color+" 0%, "+mid+" 100%)";function paint(el){!el||!el.style||(el.style.setProperty("--rb-variant-glow",color),el.style.setProperty("--rb-feature-color",color),el.style.setProperty("--rb-feature-mid",mid),el.style.setProperty("--rb-atc-hover-gradient",flow),el.style.setProperty("--rb-atc-hover-gradient-static",staticGrad),el.style.setProperty("--rb-atc-hover-gradient-size","200% 100%"))}paint(root),paint(document.body),paint(document.documentElement),document.querySelectorAll(".t4s-product__info-wrapper, .prod_des .pdf, .prod_des .pad, .prod_des .pbu, .hwtusecon, .hwto").forEach(paint);var critical=document.getElementById("rb-variant-glow-critical");critical&&(critical.textContent="html.template-product,body.template-product,body.template-product .t4s-product__info-wrapper,body.template-product .prod_des .pdf,body.template-product .prod_des .pad,body.template-product .prod_des .pbu,body.template-product .hwtusecon,body.template-product .hwto{--rb-variant-glow:"+color+";--rb-feature-color:"+color+";}")}function getVariantId(form){if(!form)return null;var select=form.querySelector('select[name="id"]');if(select&&select.value)return String(select.value);var input=form.querySelector('input[name="id"]');if(input&&input.value)return String(input.value);var checked=form.querySelector('[name="id"]:checked');return checked?String(checked.value):null}function getSelectedFormula(root,formulaOptionIndex){if(formulaOptionIndex==null)return null;var option=root.querySelector('[data-swatch-option][data-id="'+formulaOptionIndex+'"]');if(!option)return null;var selected=option.querySelector("[data-swatch-item].is--selected");if(selected&&selected.getAttribute("data-value"))return selected.getAttribute("data-value");var current=option.querySelector("[data-current-value]");return current?current.textContent.trim():null}function resolveColor(data,form,root){var byId=data&&data.byId||data||{},byFormula=data&&data.byFormula||{},formulaIndex=data&&data.formulaOptionIndex,formula=getSelectedFormula(root,formulaIndex);if(formula&&byFormula[formula])return byFormula[formula];var id=getVariantId(form);return id&&byId[id]?byId[id]:root.style.getPropertyValue("--rb-variant-glow")||"#29696a"}function initGlow(root,opts){if(opts=opts||{},!root||root.dataset.rbGlowReady==="true"&&!opts.force)return;root.dataset.rbGlowReady="true";var jsonEl=root.querySelector("[data-rb-variant-glow-json]"),data={};if(jsonEl)try{data=JSON.parse(jsonEl.textContent)}catch(err){data={}}!data.byId&&!data.byFormula&&(data={byId:data,byFormula:{},formulaOptionIndex:null});var form=root.querySelector('form[action*="/cart/add"]')||document.querySelector('form[action*="/cart/add"]'),lastColor="";function sync(){var hex=resolveColor(data,form,root),normalized=normalizeHex(hex)||"#29696a";normalized!==lastColor&&(lastColor=normalized,applyGlow(root,normalized))}
1applyGlow(root,resolveColor(data,form,root)),lastColor=normalizeHex(resolveColor(data,form,root))||"#29696a",glowSyncByRoot.set(root,sync),sync(),form&&form.addEventListener("change",function(event){var t=event.target;!t||!t.name||(t.name==="id"||t.name.indexOf("option")===0)&&sync()},!0),root.addEventListener("pointerdown",function(event){var swatch=event.target.closest("[data-swatch-item]");if(!(!swatch||!root.contains(swatch))){var option=swatch.closest("[data-swatch-option]"),optionId=option?option.getAttribute("data-id"):null;if(optionId!==null&&String(optionId)===String(data.formulaOptionIndex)){var formulaValue=swatch.getAttribute("data-value");formulaValue&&data.byFormula&&data.byFormula[formulaValue]&&(lastColor="",applyGlow(root,data.byFormula[formulaValue]),lastColor=normalizeHex(data.byFormula[formulaValue])||lastColor)}}},!0),root.addEventListener("click",function(event){var swatch=event.target.closest("[data-swatch-item]");if(!(!swatch||!root.contains(swatch))){var option=swatch.closest("[data-swatch-option]"),optionId=option?option.getAttribute("data-id"):null;if(optionId!==null&&String(optionId)===String(data.formulaOptionIndex)){var formulaValue=swatch.getAttribute("data-value");formulaValue&&data.byFormula&&data.byFormula[formulaValue]&&(lastColor="",applyGlow(root,data.byFormula[formulaValue]),lastColor=normalizeHex(data.byFormula[formulaValue])||lastColor)}window.requestAnimationFrame(sync),setTimeout(sync,0),setTimeout(sync,50)}},!0);var watchTargets=[];if(data.formulaOptionIndex!==null&&data.formulaOptionIndex!==void 0){var formulaOption=root.querySelector('[data-swatch-option][data-id="'+data.formulaOptionIndex+'"]');formulaOption&&watchTargets.push(formulaOption)}if(form){var idField=form.querySelector('select[name="id"], input[name="id"]');idField&&watchTargets.push(idField)}if(watchTargets.length&&window.MutationObserver){var observer=new MutationObserver(function(){sync()});watchTargets.forEach(function(el){observer.observe(el,{attributes:!0,childList:!0,subtree:!0,characterData:!0})})}if(window.MutationObserver&&document.body){var lateObserver=new MutationObserver(function(){sync()});lateObserver.observe(document.body,{childList:!0,subtree:!0}),setTimeout(function(){lateObserver.disconnect()},4e3)}}function bindGlobalGlow(){globalGlowBound||!window.jQuery||(globalGlowBound=!0,window.jQuery(document).off("change.rbGlow").on("change.rbGlow",'select[name="id"], input[name="id"]',function(){document.querySelectorAll("[data-rb-variant-glow]").forEach(function(root){var sync=glowSyncByRoot.get(root);sync&&sync()})}))}function bootScope(scope){if(isProductPage()){var scopeEl=scope&&scope.querySelectorAll?scope:document;scopeEl.querySelectorAll("[data-rb-variant-glow]").forEach(function(root){initGlow(root,{force:!0})})}}function bootAll(){bindGlobalGlow(),bootScope(document)}function peekGlowFromMarkup(scope){if(!(!scope||!scope.querySelector)){var glowRoot=scope.querySelector("[data-rb-variant-glow]");if(glowRoot){var inline=glowRoot.style.getPropertyValue("--rb-variant-glow");inline&&inline.trim()&&applyGlow(glowRoot,inline.trim())}}}window.rbInitVariantGlow=bootScope,window.rbApplyVariantGlow=applyGlow,window.rbPeekVariantGlow=peekGlowFromMarkup,bindGlobalGlow(),document.body&&bootAll(),onReady(bootAll)})();
2//# sourceMappingURL=/cdn/shop/t/147/assets/rb-product-variant-glow.js.map?v=81412178136289733671789592366

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.