PageSourceSearch

https://www.hersheyfoodservice.com/etc.clientlibs/hershey/componen…-e1f05a809b0b1b6705b6b279bc4effa2-lc.min.js

js hersheyfoodservice.com collected 2026-10-08 10:51:09 UTC 4,658 bytes, 11 lines download raw bytes

1function addSwitch(a,b,d,l,g,f){if(null===a||void 0===a)a="HIGH CONTRAST";if(null===d||void 0===d)d="ON";if(null===b||void 0===b)b="OFF";f&&(f.innerHTML="");var c=document.createElement("div");c.classList.add("switch-status");var h=l?d:b,e=document.createElement("label");e.setAttribute("class","switch");e.setAttribute("for","contrast");e.setAttribute("aria-labelledby","contrast");var m=document.createElement("input");m.setAttribute("class","switcher");l?m.setAttribute("checked",""):m.removeAttribute("checked",
2"");m.setAttribute("type","checkbox");m.setAttribute("id","contrast");m.setAttribute("aria-label","Enable High Contrast Mode");var r=document.createElement("span");r.setAttribute("class","slider round");var q=document.createElement("span");q.setAttribute("class","sr-only");q.innerText="This checkbox when checked enables high contrast mode, which changes the color scheme to provide more contrast between colors on the site.";var p=document.createElement("span");p.setAttribute("class","status");p.setAttribute("id",
3"highContrastStatus");p.innerText=h;h=document.createElement("span");h.innerText=a;h.appendChild(p);c.appendChild(e);e.appendChild(m);e.appendChild(r);e.appendChild(q);c.appendChild(h);f&&f.appendChild(c);g&&g(l);f&&(f.addEventListener("click",function(k){if("checkbox"==k.target.type){k=document.querySelector(".switch-status\x3e.switch\x3einput").checked?!0:!1;var n=!0===k?d:b;document.querySelector(".switch-status\x3espan\x3e#highContrastStatus").innerText=n;g&&g(k)}}),f.addEventListener("keypress",
4function(k){if("Enter"===k.code){var n=document.querySelector(".switch-status\x3e.switch\x3einput");n.checked=!n.checked;"checkbox"==k.target.type&&(k=n.checked?!0:!1,n=!0===k?d:b,document.querySelector(".switch-status\x3espan\x3e#highContrastStatus").innerText=n,g&&g(k))}}));return f}
5document.addEventListener("DOMContentLoaded",function(){var a=window.location.hostname,b=["www.hersheyland.com","stage.hersheyland.com","dev.hersheyland.com"];if(window.location.pathname.startsWith("/content/hersheyland/en-us/")||b.includes(a)){if(console.log("Hersheyland site or subpage detected \u2014 hiding contrast toggle"),a=document.querySelector(".contrast-toggle-container"))a.style.display="none"}else{a=document.cookie;b=a.indexOf("is-hight-contrast-enabled\x3d");if(-1!==b){var d=a.indexOf(";",
6b);a="true"===a.substring(b+25+1,-1===d?a.length:d).trim()}else a=!1;var l="cadbury-primary kisses-primary kitkat-primary reese-primary twizzlers-primary corporate-base-theme pelon-primary chipits-primary crayon-primary oh-henry-primary chocolate-world-base-theme sofit-primary one-primary fulfilnutrition-primary skinny-primary pirate-primary".split(" "),g;addSwitch("HIGH CONTRAST","OFF","ON",a,function(f){for(var c=document.querySelector("body"),h=c.getAttribute("class"),e=0;e<l.length;e++)if(-1!=
7h.indexOf(l[e])){g=l[e];break}f?(c.classList.contains("hershey-primary")||c.classList.contains("default-theme")?c.classList.add("high-contrast-mode"):c.classList.add("branch-high-contrast-mode"),c.classList.remove(g)):(c.classList.remove("high-contrast-mode"),c.classList.remove("branch-high-contrast-mode"),c.classList.add(g));c.classList.contains("undefined")&&c.classList.remove("undefined");c=new Date;h=new Date(c);h.setDate(c.getDate()+365);document.cookie="is-hight-contrast-enabled\x3d"+f+";expires \x3d "+
8h.toGMTString()},document.querySelector(".contrast-toggle-container"))}});
9function emailTooltipFunc(a){if(null==a||""==a){var b=document.getElementById("tooltiptext"),d=document.getElementById("tooltiptext2");null!=b?(b.className=991<window.innerWidth?"tooltiptext1":"tooltiptext",b.style.visibility="visible",setTimeout(function(){b.style.visibility="hidden"},2E3)):(d.className=991<window.innerWidth?"tooltiptext4":"tooltiptext3",d.style.visibility="visible",setTimeout(function(){d.style.visibility="hidden"},2E3));return!1}return!0}
10function setEmail(){var a=document.getElementById("email").value;if(emailTooltipFunc(a)){document.getElementById("email");localStorage.removeItem("email");localStorage.setItem("email",a);if(null!=document.getElementById("newsbkg"))return!0;a=document.getElementById("formId").action;var b=a.indexOf("?");a=-1==b?a:a.substring(0,b);window.location=a}return!1}
11document.body.addEventListener("keyup",function(a){document.getElementById("email")===document.activeElement&&9==(a.keyCode?a.keyCode:a.which)&&(a=document.getElementById("email").value,emailTooltipFunc(a))});function submitEmailAsGet(a){for(var b=a.getElementsByTagName("input"),d=0;d<b.length;d++)"email"===b[d].getAttribute("name")&&b[d].removeAttribute("name");a.setAttribute("method","GET");a.submit()};

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.