var ScrollPosStyler=function(s,e){"use strict";var t=0,a=!1,n=1,l="sps",r=s.getElementsByClassName(l),o="sps--abv",i="sps--blw",c="data-sps-offset";function f(){t=e.pageYOffset;for(var s=[],a=0;r[a];++a){var l=r[a],f=l.getAttribute(c)||n,m=l.classList.contains(o);m&&t>f?s.push({element:l,addClass:i,removeClass:o}):!m&&t<=f&&s.push({element:l,addClass:o,removeClass:i})}return s}function m(s){for(var e=0;s[e];++e){var t=s[e];t.element.classList.add(t.addClass),t.element.classList.remove(t.removeClass)}a=!1}var u={init:function(t){a=!0,t&&(t.spsClass&&(l=t.spsClass,r=s.getElementsByClassName(l)),n=t.scrollOffsetY||n,o=t.classAbove||o,i=t.classBelow||i,c=t.offsetTag||c);var u=f();u.length>0?e.requestAnimationFrame((function(){m(u)})):a=!1}};return s.addEventListener("DOMContentLoaded",(function(){e.setTimeout(u.init,1)})),e.addEventListener("scroll",(function(){if(!a){var s=f();s.length>0&&(a=!0,e.requestAnimationFrame((function(){m(s)})))}})),u}(document,window);