1/*! 2 * headroom.js v0.11.0 - Give your page some headroom. Hide your header until you need it 3 * Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js 4 * License: MIT 5 */ 6 7if (typeof Object.assign != "function") { 8 Object.assign = function (target) { 9 "use strict"; 10 if (target == null) { 11 throw new TypeError("Cannot convert undefined or null to object"); 12 } 13 14 target = Object(target); 15 for (var index = 1; index < arguments.length; index++) { 16 var source = arguments[index]; 17 if (source != null) { 18 for (var key in source) { 19 if (Object.prototype.hasOwnProperty.call(source, key)) { 20 target[key] = source[key]; 21 } 22 } 23 } 24 } 25 return target; 26 }; 27} 28!(function (t, n) { 29 "object" == typeof exports && "undefined" != typeof module 30 ? (module.exports = n()) 31 : "function" == typeof define && define.amd 32 ? define(n) 33 : ((t = t || self).Headroom = n()); 34})(this, function () { 35 "use strict"; 36 function t() { 37 return "undefined" != typeof window; 38 } 39 function d(t) { 40 return (function (t) { 41 return ( 42 t && 43 t.document && 44 (function (t) { 45 return 9 === t.nodeType; 46 })(t.document) 47 ); 48 })(t) 49 ? (function (t) { 50 var n = t.document, 51 o = n.body, 52 s = n.documentElement; 53 return { 54 scrollHeight: function () { 55 return Math.max( 56 o.scrollHeight, 57 s.scrollHeight, 58 o.offsetHeight, 59 s.offsetHeight, 60 o.clientHeight, 61 s.clientHeight 62 ); 63 }, 64 height: function () { 65 return t.innerHeight || s.clientHeight || o.clientHeight; 66 }, 67 scrollY: function () { 68 return void 0 !== t.pageYOffset 69 ? t.pageYOffset 70 : (s || o.parentNode || o).scrollTop; 71 }, 72 }; 73 })(t) 74 : (function (t) { 75 return { 76 scrollHeight: function () { 77 return Math.max(t.scrollHeight, t.offsetHeight, t.clientHeight); 78 }, 79 height: function () { 80 return Math.max(t.offsetHeight, t.clientHeight); 81 }, 82 scrollY: function () { 83 return t.scrollTop; 84 }, 85 }; 86 })(t); 87 } 88 function n(t, s, e) { 89 var n, 90 o = (function () { 91 var n = !1; 92 try { 93 var t = { 94 get passive() { 95 n = !0; 96 }, 97 }; 98 window.addEventListener("test", t, t), 99 window.removeEventListener("test", t, t); 100 } catch (t) { 101 n = !1; 102 } 103 return n; 104 })(), 105 i = !1, 106 r = d(t), 107 l = r.scrollY(), 108 a = {}; 109 function c() { 110 var t = Math.round(r.scrollY()), 111 n = r.height(), 112 o = r.scrollHeight(); 113 (a.scrollY = t), 114 (a.lastScrollY = l), 115 (a.direction = l < t ? "down" : "up"), 116 (a.distance = Math.abs(t - l)), 117 (a.isOutOfBounds = t < 0 || o < t + n), 118 (a.top = t <= s.offset), 119 (a.bottom = o <= t + n), 120 (a.toleranceExceeded = a.distance > s.tolerance[a.direction]), 121 e(a), 122 (l = t), 123 (i = !1); 124 } 125 function h() { 126 i || ((i = !0), (n = requestAnimationFrame(c))); 127 } 128 var u = !!o && { passive: !0, capture: !1 }; 129 return ( 130 t.addEventListener("scroll", h, u), 131 c(), 132 { 133 destroy: function () { 134 cancelAnimationFrame(n), t.removeEventListener("scroll", h, u); 135 }, 136 } 137 ); 138 } 139 function o(t, n) { 140 (n = n || {}), 141 Object.assign(this, o.options, n), 142 (this.classes = Object.assign({}, o.options.classes, n.classes)), 143 (this.elem = t), 144 (this.tolerance = (function (t) { 145 return t === Object(t) ? t : { down: t, up: t }; 146 })(this.tolerance)), 147 (this.initialised = !1), 148 (this.frozen = !1); 149 } 150 return ( 151 (o.prototype = { 152 constructor: o, 153 init: function () { 154 return ( 155 o.cutsTheMustard && 156 !this.initialised && 157 (this.addClass("initial"),
158 (this.initialised = !0), 159 setTimeout( 160 function (t) { 161 t.scrollTracker = n( 162 t.scroller, 163 { offset: t.offset, tolerance: t.tolerance }, 164 t.update.bind(t) 165 ); 166 }, 167 100, 168 this 169 )), 170 this 171 ); 172 }, 173 destroy: function () { 174 (this.initialised = !1), 175 Object.keys(this.classes).forEach(this.removeClass, this), 176 this.scrollTracker.destroy(); 177 }, 178 unpin: function () { 179 (!this.hasClass("pinned") && this.hasClass("unpinned")) || 180 (this.addClass("unpinned"), 181 this.removeClass("pinned"), 182 this.onUnpin && this.onUnpin.call(this)); 183 }, 184 pin: function () { 185 this.hasClass("unpinned") && 186 (this.addClass("pinned"), 187 this.removeClass("unpinned"), 188 this.onPin && this.onPin.call(this)); 189 }, 190 freeze: function () { 191 (this.frozen = !0), this.addClass("frozen"); 192 }, 193 unfreeze: function () { 194 (this.frozen = !1), this.removeClass("frozen"); 195 }, 196 top: function () { 197 this.hasClass("top") || 198 (this.addClass("top"), 199 this.removeClass("notTop"), 200 this.onTop && this.onTop.call(this)); 201 }, 202 notTop: function () { 203 this.hasClass("notTop") || 204 (this.addClass("notTop"), 205 this.removeClass("top"), 206 this.onNotTop && this.onNotTop.call(this)); 207 }, 208 bottom: function () { 209 this.hasClass("bottom") || 210 (this.addClass("bottom"), 211 this.removeClass("notBottom"), 212 this.onBottom && this.onBottom.call(this)); 213 }, 214 notBottom: function () { 215 this.hasClass("notBottom") || 216 (this.addClass("notBottom"), 217 this.removeClass("bottom"), 218 this.onNotBottom && this.onNotBottom.call(this)); 219 }, 220 shouldUnpin: function (t) { 221 return "down" === t.direction && !t.top && t.toleranceExceeded; 222 }, 223 shouldPin: function (t) { 224 return ("up" === t.direction && t.toleranceExceeded) || t.top; 225 }, 226 addClass: function (t) { 227 this.elem.classList.add.apply( 228 this.elem.classList, 229 this.classes[t].split(" ") 230 ); 231 }, 232 removeClass: function (t) { 233 this.elem.classList.remove.apply( 234 this.elem.classList, 235 this.classes[t].split(" ") 236 ); 237 }, 238 hasClass: function (t) { 239 return this.classes[t].split(" ").every(function (t) { 240 return this.classList.contains(t); 241 }, this.elem); 242 }, 243 update: function (t) { 244 t.isOutOfBounds || 245 (!0 !== this.frozen && 246 (t.top ? this.top() : this.notTop(), 247 t.bottom ? this.bottom() : this.notBottom(), 248 this.shouldUnpin(t) 249 ? this.unpin() 250 : this.shouldPin(t) && this.pin())); 251 }, 252 }), 253 (o.options = { 254 tolerance: { up: 0, down: 0 }, 255 offset: 0, 256 scroller: t() ? window : null, 257 classes: { 258 frozen: "headroom--frozen", 259 pinned: "headroom--pinned", 260 unpinned: "headroom--unpinned", 261 top: "headroom--top", 262 notTop: "headroom--not-top", 263 bottom: "headroom--bottom", 264 notBottom: "headroom--not-bottom", 265 initial: "headroom", 266 }, 267 }), 268 (o.cutsTheMustard = !!( 269 t() && 270 function () {}.bind && 271 "classList" in document.documentElement && 272 Object.assign && 273 Object.keys && 274 requestAnimationFrame 275 )), 276 o 277 ); 278});
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.