1(function(o, i) { 2 typeof exports == "object" && typeof module < "u" ? i(exports) : typeof define == "function" && define.amd ? define(["exports"], i) : (o = typeof globalThis < "u" ? globalThis : o || self, 3 i(o.aat = {})) 4} 5)(this, function(o) { 6 "use strict"; 7 function i(s, e, t) { 8 return Math.min(Math.max(s, e), t) 9 } 10 function l({from: s, to: e, percentage: t, unit: n}) { 11 return s + (e - s) * t + (n || "") 12 } 13 const a = { 14 offsetBottom: 0, 15 offsetTop: 0, 16 offsetRight: 0, 17 offsetLeft: 0, 18 addWrapper: !1, 19 wrapperClass: "", 20 container: document.documentElement 21 }; 22 class c { 23 static Container(e=document.documentElement) { 24 return new h(e) 25 } 26 static Element(e, t) { 27 return new d(e,{ 28 ...a, 29 ...t 30 }) 31 } 32 onScroll(e) { 33 this._handler = e, 34 this._onScroll() 35 } 36 } 37 class h extends c { 38 constructor(e) { 39 super(), 40 this._container = e, 41 (e === document.documentElement ? window : e).addEventListener("scroll", this._onScroll.bind(this)) 42 } 43 _onScroll() { 44 const e = this._container.scrollTop 45 , t = this._container.scrollHeight - this._container.clientHeight 46 , n = i(e / t, 0, 1) || 0 47 , r = this._container.scrollLeft 48 , p = this._container.scrollWidth - this._container.clientWidth 49 , _ = i(r / p, 0, 1) || 0; 50 this._handler && typeof this._handler == "function" && requestAnimationFrame(()=>this._handler({ 51 percentageY: n, 52 percentageX: _ 53 })) 54 } 55 } 56 class d extends c { 57 constructor(e, t) { 58 super(), 59 this._element = e, 60 this._options = t, 61 this._lastPercentageY = null, 62 this._lastPercentageX = null, 63 this._options.addWrapper && this._addWrapper(), 64 (this._options.container === document.documentElement ? window : this._options.container).addEventListener("scroll", this._onScroll.bind(this)), 65 requestAnimationFrame(()=>this._onScroll()) 66 } 67 _addWrapper() { 68 this._wrapper = document.createElement("div"), 69 this._options.wrapperClass && this._wrapper.classList.add(this._options.wrapperClass), 70 this._element.parentNode.insertBefore(this._wrapper, this._element), 71 this._wrapper.appendChild(this._element) 72 } 73 get _containerClientHeight() { 74 return this._options.container === window ? window.innerHeight : this._options.container.clientHeight 75 } 76 get _containerClientWidth() { 77 return this._options.container === window ? window.innerWidth : this._options.container.clientWidth 78 } 79 get _elRectRelativeToContainer() { 80 const t = (this._options.addWrapper ? this._wrapper : this._element).getBoundingClientRect(); 81 if (this._options.container === document.documentElement) 82 return t; 83 const n = this._options.container.getBoundingClientRect(); 84 return { 85 width: t.width, 86 height: t.width, 87 left: t.left - n.left, 88 top: t.top - n.top, 89 right: t.right - n.right, 90 bottom: t.bottom - n.bottom 91 } 92 } 93 _calculatePercentageY() { 94 const e = this._elRectRelativeToContainer 95 , t = this._containerClientHeight - this._options.offsetBottom 96 , n = this._options.offsetTop 97 , r = t - n; 98 return i((t - e.top) / r, 0, 1) 99 } 100 _calculatePercentageX() { 101 const e = this._elRectRelativeToContainer 102 , t = this._containerClientWidth - this._options.offsetRight 103 , n = this._options.offsetLeft 104 , r = t - n; 105 return i((t - e.left) / r, 0, 1) 106 } 107 _onScroll() { 108 const e = this._calculatePercentageY() 109 , t = this._calculatePercentageX(); 110 this._handler && typeof this._handler == "function" && (this._lastPercentageY !== e || this._lastPercentageX !== t) && requestAnimationFrame(()=>this._handler({ 111 percentageY: e, 112 percentageX: t 113 })), 114 this._lastPercentageY = e, 115 this._lastPercentageX = t 116 } 117 } 118 o.ScrollObserver = c, 119 o.valueAtPercentage = l, 120 Object.defineProperty(o, Symbol.toStringTag, { 121 value: "Module" 122 }) 123});
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.