OwlCyberSecurity - MANAGER
Edit File: sticksy.min.js
window.Sticksy=function(){"use strict";var s="static",i="fixed",n="stuck";function e(t,i){if(!t)throw new Error("You have to specify the target element");if("string"!=typeof t&&!(t instanceof Element))throw new Error("Expected a string or element, but got: "+Object.prototype.toString.call(t));var n=r.findElement(t);if(!n)throw new Error("Cannot find target element: "+t);var s=n.parentNode;if(!s)throw new Error("Cannot find container of target element: "+t);i=i||{},this.t={containerEl:s,targetEl:n,topSpacing:i.topSpacing||0,enabled:i.enabled||!0,listen:i.listen||!1},this.onStateChanged=null,this.nodeRef=n,this.i()}e.instances=[],e.enabledInstances=[],e.prototype.i=function(){var t=this;this.state=s,this.o=[],this.h=[];for(var i=this.t.targetEl;i;){var n=i.cloneNode(!0);n.style.visibility="hidden",n.style.pointerEvents="none",n.className+=" sticksy-dummy-node",n.removeAttribute("id"),this.t.targetEl.parentNode.insertBefore(n,this.t.targetEl),this.o.push(i),this.h.push(n),i=i.nextElementSibling}this.u=0,this.l={top:0,bottom:0},this.v=!1,this.t.containerEl.style.position="relative",this.m=-1===getComputedStyle(this.t.containerEl).display.indexOf("flex"),this.t.listen&&(this.p=new MutationObserver(function(){t.hardRefresh()}),this.g()),e.instances.push(this),this.t.enabled&&e.enabledInstances.push(this),this.hardRefresh()},e.prototype.g=function(){this.t.listen&&!this.v&&(this.p.observe(this.t.containerEl,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.v=!0)},e.prototype.C=function(){this.t.listen&&this.v&&(this.p.disconnect(),this.v=!1)},e.prototype.M=function(t){return t<this.l.top?s:t>=this.l.bottom?n:i},e.prototype.S=function(){this.u=r.getComputedBox(this.o[this.o.length-1]).bottomWithMargin-r.getComputedBox(this.o[0]).topWithMargin},e.prototype.j=function(){var t=this.t.containerEl,i=this.o,t=r.getComputedBox(t),i=r.getComputedBox(i[0]);this.l={top:i.topWithMargin-this.t.topSpacing,bottom:t.bottom-t.paddingBottom-this.t.topSpacing-this.u}},e.prototype.B=function(t){t===s?(this.P(this.o),this.T(this.h)):(this.k(this.o),t===i?this.O(this.o):this.W(this.o),this.D(this.h))},e.prototype.refresh=function(){var t=this.M(window.pageYOffset,this.l);t!==this.state&&(this.state=t,this.C(),this.B(t),this.g(),"function"==typeof this.onStateChanged&&this.onStateChanged(t))},e.prototype.hardRefresh=function(){this.C();var t=this.state;this.state=s,this.B(this.state),this.k(this.o),this.S(),this.j(),this.state=this.M(window.pageYOffset,this.l),this.B(this.state),this.g(),"function"==typeof this.onStateChanged&&t!==this.state&&this.onStateChanged(this.state)},e.prototype.enable=function(){this.t.enabled=!0,e.enabledInstances.push(this),this.hardRefresh()},e.prototype.disable=function(){this.t.enabled=!1,this.state=s,this.B(this.state),e.enabledInstances.splice(e.enabledInstances.indexOf(this),1)},e.prototype.O=function(t){for(var i=0,n=this.t.topSpacing,s=0;s<t.length;s++){var o=t[s],h=r.getComputedBox(o),e=this.m?Math.max(0,i-h.marginTop):i;o.style.position="fixed",o.style.top=n+e+"px",o.style.bottom="",n+=h.height+h.marginTop+e,i=h.marginBottom}},e.prototype.W=function(t){for(var i=0,n=r.getComputedBox(this.t.containerEl).paddingBottom,s=t.length-1;0<=s;s--){var o=t[s],h=r.getComputedBox(o),e=this.m?Math.max(0,i-h.marginBottom):i;o.style.position="absolute",o.style.top="auto",o.style.bottom=n+e+"px",n+=h.height+h.marginBottom+e,i=h.marginTop}},e.prototype.P=function(t){t.forEach(function(t){t.style.position="",t.style.top="",t.style.bottom="",t.style.height="",t.style.width=""})},e.prototype.T=function(t){t.forEach(function(t){t.style.display="none"})},e.prototype.D=function(t){for(var i=0;i<t.length;i++)t[i].style.display=getComputedStyle(this.o[i]).display},e.prototype.k=function(){for(var t=0;t<this.o.length;t++){var i=this.o[t],n=getComputedStyle(i);i.style.width=n.width,i.style.height=n.height}},e.refreshAll=function(){for(var t=0;t<e.enabledInstances.length;t++)e.enabledInstances[t].refresh()},e.hardRefreshAll=function(){for(var t=0;t<e.enabledInstances.length;t++)e.enabledInstances[t].hardRefresh()},e.enableAll=function(){e.enabledInstances=e.instances.slice(),this.hardRefreshAll()},e.disableAll=function(){for(var t=e.enabledInstances.slice(),i=0;i<t.length;i++)e.enabledInstances[i].disable();e.enabledInstances=[]},e.initializeAll=function(t,i,n){if(void 0===t)throw new Error("'target' parameter is undefined");var s=[];t instanceof Element?s=[t]:void 0!==t.length&&0<t.length&&t[0]instanceof Element?s="function"==typeof t.get?t.get():t:"string"==typeof t&&(s=document.querySelectorAll(t)||[]);var o=[],h=[];if(s.forEach(function(t){-1===o.indexOf(t.parentNode)&&(o.push(t.parentNode),h.push(t))}),!n&&!h.length)throw new Error("There are no elements to initialize");return h.map(function(t){return new e(t,i)})},window.addEventListener("scroll",e.refreshAll),window.addEventListener("resize",e.hardRefreshAll);var r={parseNumber:function(t){return parseFloat(t)||0},findElement:function(t,i){return i=i||document,"string"==typeof t?i.querySelector(t):t instanceof Element?t:void 0},getComputedBox:function(t){var i=t.getBoundingClientRect(),t=getComputedStyle(t);return{height:i.height,width:i.width,top:window.pageYOffset+i.top,bottom:window.pageYOffset+i.bottom,marginTop:r.parseNumber(t.marginTop),marginBottom:r.parseNumber(t.marginBottom),paddingTop:r.parseNumber(t.paddingTop),paddingBottom:r.parseNumber(t.paddingBottom),topWithMargin:window.pageYOffset+i.top-r.parseNumber(t.marginTop),bottomWithMargin:window.pageYOffset+i.bottom+r.parseNumber(t.marginBottom)}}};return e}();var jQueryPlugin=window.$||window.jQuery||window.Zepto;jQueryPlugin&&(jQueryPlugin.fn.sticksy=function(t){return window.Sticksy.initializeAll(this,t)});