PageSourceSearch

https://kobiks.com/js/kobiks.js?20261002045401

js kobiks.com collected 2026-10-02 04:54:12 UTC 23,807 bytes, 918 lines download raw bytes

1// Mobile CTA
2const navbar = document.getElementById('mobile-cta')
3const onScroll = () => {
4
5  const scroll = document.documentElement.scrollTop
6
7  if (scroll > 0) {
8    navbar.classList.add("scroll-add");
9  } else {
10    navbar.classList.remove("scroll-add")
11  }
12}
13
14window.addEventListener('scroll', onScroll)
15
16
17// Pricing Switch Button
18try {
19  var e = document.getElementById("filt-monthly"),
20      d = document.getElementById("filt-yearly"),
21      t = document.getElementById("switcher"),
22      m = document.getElementById("monthly"),
23      y = document.getElementById("yearly");
24
25  e.addEventListener("click", function(){
26      t.checked = false;
27      e.classList.add("toggler--is-active");
28      d.classList.remove("toggler--is-active");
29      m.classList.remove("hide");
30      y.classList.add("hide");
31  });
32
33  d.addEventListener("click", function(){
34      t.checked = true;
35      d.classList.add("toggler--is-active");
36      e.classList.remove("toggler--is-active");
37      m.classList.add("hide");
38      y.classList.remove("hide");
39  });
40
41  t.addEventListener("click", function(){
42      d.classList.toggle("toggler--is-active");
43      e.classList.toggle("toggler--is-active");
44      m.classList.toggle("hide");
45      y.classList.toggle("hide");
46  })
47} catch(err) {
48
49}
50
51
52// Lazy Load
53(function(window, factory) {
54	var lazySizes = factory(window, window.document);
55	window.lazySizes = lazySizes;
56	if(typeof module == 'object' && module.exports){
57		module.exports = lazySizes;
58	}
59}(window, function l(window, document) {
60	'use strict';
61	/*jshint eqnull:true */
62	if(!document.getElementsByClassName){return;}
63
64	var lazysizes, lazySizesConfig;
65
66	var docElem = document.documentElement;
67
68	var Date = window.Date;
69
70	var supportPicture = window.HTMLPictureElement;
71
72	var _addEventListener = 'addEventListener';
73
74	var _getAttribute = 'getAttribute';
75
76	var addEventListener = window[_addEventListener];
77
78	var setTimeout = window.setTimeout;
79
80	var requestAnimationFrame = window.requestAnimationFrame || setTimeout;
81
82	var requestIdleCallback = window.requestIdleCallback;
83
84	var regPicture = /^picture$/i;
85
86	var loadEvents = ['load', 'error', 'lazyincluded', '_lazyloaded'];
87
88	var regClassCache = {};
89
vendor: 15,656 bytes, lines 90-706
90	var forEach = Array.prototype.forEach;
91
92	var hasClass = function(ele, cls) {
93		if(!regClassCache[cls]){
94			regClassCache[cls] = new RegExp('(\\s|^)'+cls+'(\\s|$)');
95		}
96		return regClassCache[cls].test(ele[_getAttribute]('class') || '') && regClassCache[cls];
97	};
98
99	var addClass = function(ele, cls) {
100		if (!hasClass(ele, cls)){
101			ele.setAttribute('class', (ele[_getAttribute]('class') || '').trim() + ' ' + cls);
102		}
103	};
104
105	var removeClass = function(ele, cls) {
106		var reg;
107		if ((reg = hasClass(ele,cls))) {
108			ele.setAttribute('class', (ele[_getAttribute]('class') || '').replace(reg, ' '));
109		}
110	};
111
112	var addRemoveLoadEvents = function(dom, fn, add){
113		var action = add ? _addEventListener : 'removeEventListener';
114		if(add){
115			addRemoveLoadEvents(dom, fn);
116		}
117		loadEvents.forEach(function(evt){
118			dom[action](evt, fn);
119		});
120	};
121
122	var triggerEvent = function(elem, name, detail, noBubbles, noCancelable){
123		var event = document.createEvent('CustomEvent');
124
125		if(!detail){
126			detail = {};
127		}
128
129		detail.instance = lazysizes;
130
131		event.initCustomEvent(name, !noBubbles, !noCancelable, detail);
132
133		elem.dispatchEvent(event);
134		return event;
135	};
136
137	var updatePolyfill = function (el, full){
138		var polyfill;
139		if( !supportPicture && ( polyfill = (window.picturefill || lazySizesConfig.pf) ) ){
140			polyfill({reevaluate: true, elements: [el]});
141		} else if(full && full.src){
142			el.src = full.src;
143		}
144	};
145
146	var getCSS = function (elem, style){
147		return (getComputedStyle(elem, null) || {})[style];
148	};
149
150	var getWidth = function(elem, parent, width){
151		width = width || elem.offsetWidth;
152
153		while(width < lazySizesConfig.minSize && parent && !elem._lazysizesWidth){
154			width =  parent.offsetWidth;
155			parent = parent.parentNode;
156		}
157
158		return width;
159	};
160
161	var rAF = (function(){
162		var running, waiting;
163		var firstFns = [];
164		var secondFns = [];
165		var fns = firstFns;
166
167		var run = function(){
168			var runFns = fns;
169
170			fns = firstFns.length ? secondFns : firstFns;
171
172			running = true;
173			waiting = false;
174
175			while(runFns.length){
176				runFns.shift()();
177			}
178
179			running = false;
180		};
181
182		var rafBatch = function(fn, queue){
183			if(running && !queue){
184				fn.apply(this, arguments);
185			} else {
186				fns.push(fn);
187
188				if(!waiting){
189					waiting = true;
190					(document.hidden ? setTimeout : requestAnimationFrame)(run);
191				}
192			}
193		};
194
195		rafBatch._lsFlush = run;
196
197		return rafBatch;
198	})();
199
200	var rAFIt = function(fn, simple){
201		return simple ?
202			function() {
203				rAF(fn);
204			} :
205			function(){
206				var that = this;
207				var args = arguments;
208				rAF(function(){
209					fn.apply(that, args);
210				});
211			}
212		;
213	};
214
215	var throttle = function(fn){
216		var running;
217		var lastTime = 0;
218		var gDelay = 125;
219		var rICTimeout = lazySizesConfig.ricTimeout;
220		var run = function(){
221			running = false;
222			lastTime = Date.now();
223			fn();
224		};
225		var idleCallback = requestIdleCallback && lazySizesConfig.ricTimeout ?
226			function(){
227				requestIdleCallback(run, {timeout: rICTimeout});
228
229				if(rICTimeout !== lazySizesConfig.ricTimeout){
230					rICTimeout = lazySizesConfig.ricTimeout;
231				}
232			} :
233			rAFIt(function(){
234				setTimeout(run);
235			}, true)
236		;
237
238		return function(isPriority){
239			var delay;
240
241			if((isPriority = isPriority === true)){
242				rICTimeout = 33;
243			}
244
245			if(running){
246				return;
247			}
248
249			running =  true;
250
251			delay = gDelay - (Date.now() - lastTime);
252
253			if(delay < 0){
254				delay = 0;
255			}
256
257			if(isPriority || (delay < 9 && requestIdleCallback)){
258				idleCallback();
259			} else {
260				setTimeout(idleCallback, delay);
261			}
262		};
263	};
264
265	//based on http://modernjavascript.blogspot.de/2013/08/building-better-debounce.html
266	var debounce = function(func) {
267		var timeout, timestamp;
268		var wait = 99;
269		var run = function(){
270			timeout = null;
271			func();
272		};
273		var later = function() {
274			var last = Date.now() - timestamp;
275
276			if (last < wait) {
277				setTimeout(later, wait - last);
278			} else {
279				(requestIdleCallback || run)(run);
280			}
281		};
282
283		return function() {
284			timestamp = Date.now();
285
286			if (!timeout) {
287				timeout = setTimeout(later, wait);
288			}
289		};
290	};
291
292	(function(){
293		var prop;
294
295		var lazySizesDefaults = {
296			lazyClass: 'lazyload',
297			loadedClass: 'lazyloaded',
298			loadingClass: 'lazyloading',
299			preloadClass: 'lazypreload',
300			errorClass: 'lazyerror',
301			//strictClass: 'lazystrict',
302			autosizesClass: 'lazyautosizes',
303			srcAttr: 'data-src',
304			srcsetAttr: 'data-srcset',
305			sizesAttr: 'data-sizes',
306			//preloadAfterLoad: false,
307			minSize: 40,
308			customMedia: {},
309			init: true,
310			expFactor: 1.5,
311			hFac: 0.8,
312			loadMode: 2,
313			loadHidden: true,
314			ricTimeout: 300,
315		};
316
317		lazySizesConfig = window.lazySizesConfig || window.lazysizesConfig || {};
318
319		for(prop in lazySizesDefaults){
320			if(!(prop in lazySizesConfig)){
321				lazySizesConfig[prop] = lazySizesDefaults[prop];
322			}
323		}
324
325		window.lazySizesConfig = lazySizesConfig;
326
327		setTimeout(function(){
328			if(lazySizesConfig.init){
329				init();
330			}
331		});
332	})();
333
334	var loader = (function(){
335		var preloadElems, isCompleted, resetPreloadingTimer, loadMode, started;
336
337		var eLvW, elvH, eLtop, eLleft, eLright, eLbottom;
338
339		var defaultExpand, preloadExpand, hFac;
340
341		var regImg = /^img$/i;
342		var regIframe = /^iframe$/i;
343
344		var supportScroll = ('onscroll' in window) && !(/glebot/.test(navigator.userAgent));
345
346		var shrinkExpand = 0;
347		var currentExpand = 0;
348
349		var isLoading = 0;
350		var lowRuns = -1;
351
352		var resetPreloading = function(e){
353			isLoading--;
354			if(e && e.target){
355				addRemoveLoadEvents(e.target, resetPreloading);
356			}
357
358			if(!e || isLoading < 0 || !e.target){
359				isLoading = 0;
360			}
361		};
362
363		var isNestedVisible = function(elem, elemExpand){
364			var outerRect;
365			var parent = elem;
366			var visible = getCSS(document.body, 'visibility') == 'hidden' || getCSS(elem, 'visibility') != 'hidden';
367
368			eLtop -= elemExpand;
369			eLbottom += elemExpand;
370			eLleft -= elemExpand;
371			eLright += elemExpand;
372
373			while(visible && (parent = parent.offsetParent) && parent != document.body && parent != docElem){
374				visible = ((getCSS(parent, 'opacity') || 1) > 0);
375
376				if(visible && getCSS(parent, 'overflow') != 'visible'){
377					outerRect = parent.getBoundingClientRect();
378					visible = eLright > outerRect.left &&
379						eLleft < outerRect.right &&
380						eLbottom > outerRect.top - 1 &&
381						eLtop < outerRect.bottom + 1
382					;
383				}
384			}
385
386			return visible;
387		};
388
389		var checkElements = function() {
390			var eLlen, i, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal, beforeExpandVal;
391
392			var lazyloadElems = lazysizes.elements;
393
394			if((loadMode = lazySizesConfig.loadMode) && isLoading < 8 && (eLlen = lazyloadElems.length)){
395
396				i = 0;
397
398				lowRuns++;
399
400				if(preloadExpand == null){
401					if(!('expand' in lazySizesConfig)){
402						lazySizesConfig.expand = docElem.clientHeight > 500 && docElem.clientWidth > 500 ? 500 : 370;
403					}
404
405					defaultExpand = lazySizesConfig.expand;
406					preloadExpand = defaultExpand * lazySizesConfig.expFactor;
407				}
408
409				if(currentExpand < preloadExpand && isLoading < 1 && lowRuns > 2 && loadMode > 2 && !document.hidden){
410					currentExpand = preloadExpand;
411					lowRuns = 0;
412				} else if(loadMode > 1 && lowRuns > 1 && isLoading < 6){
413					currentExpand = defaultExpand;
414				} else {
415					currentExpand = shrinkExpand;
416				}
417
418				for(; i < eLlen; i++){
419
420					if(!lazyloadElems[i] || lazyloadElems[i]._lazyRace){continue;}
421
422					if(!supportScroll){unveilElement(lazyloadElems[i]);continue;}
423
424					if(!(elemExpandVal = lazyloadElems[i][_getAttribute]('data-expand')) || !(elemExpand = elemExpandVal * 1)){
425						elemExpand = currentExpand;
426					}
427
428					if(beforeExpandVal !== elemExpand){
429						eLvW = innerWidth + (elemExpand * hFac);
430						elvH = innerHeight + elemExpand;
431						elemNegativeExpand = elemExpand * -1;
432						beforeExpandVal = elemExpand;
433					}
434
435					rect = lazyloadElems[i].getBoundingClientRect();
436
437					if ((eLbottom = rect.bottom) >= elemNegativeExpand &&
438						(eLtop = rect.top) <= elvH &&
439						(eLright = rect.right) >= elemNegativeExpand * hFac &&
440						(eLleft = rect.left) <= eLvW &&
441						(eLbottom || eLright || eLleft || eLtop) &&
442						(lazySizesConfig.loadHidden || getCSS(lazyloadElems[i], 'visibility') != 'hidden') &&
443						((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){
444						unveilElement(lazyloadElems[i]);
445						loadedSomething = true;
446						if(isLoading > 9){break;}
447					} else if(!loadedSomething && isCompleted && !autoLoadElem &&
448						isLoading < 4 && lowRuns < 4 && loadMode > 2 &&
449						(preloadElems[0] || lazySizesConfig.preloadAfterLoad) &&
450						(preloadElems[0] || (!elemExpandVal && ((eLbottom || eLright || eLleft || eLtop) || lazyloadElems[i][_getAttribute](lazySizesConfig.sizesAttr) != 'auto')))){
451						autoLoadElem = preloadElems[0] || lazyloadElems[i];
452					}
453				}
454
455				if(autoLoadElem && !loadedSomething){
456					unveilElement(autoLoadElem);
457				}
458			}
459		};
460
461		var throttledCheckElements = throttle(checkElements);
462
463		var switchLoadingClass = function(e){
464			addClass(e.target, lazySizesConfig.loadedClass);
465			removeClass(e.target, lazySizesConfig.loadingClass);
466			addRemoveLoadEvents(e.target, rafSwitchLoadingClass);
467			triggerEvent(e.target, 'lazyloaded');
468		};
469		var rafedSwitchLoadingClass = rAFIt(switchLoadingClass);
470		var rafSwitchLoadingClass = function(e){
471			rafedSwitchLoadingClass({target: e.target});
472		};
473
474		var changeIframeSrc = function(elem, src){
475			try {
476				elem.contentWindow.location.replace(src);
477			} catch(e){
478				elem.src = src;
479			}
480		};
481
482		var handleSources = function(source){
483			var customMedia;
484
485			var sourceSrcset = source[_getAttribute](lazySizesConfig.srcsetAttr);
486
487			if( (customMedia = lazySizesConfig.customMedia[source[_getAttribute]('data-media') || source[_getAttribute]('media')]) ){
488				source.setAttribute('media', customMedia);
489			}
490
491			if(sourceSrcset){
492				source.setAttribute('srcset', sourceSrcset);
493			}
494		};
495
496		var lazyUnveil = rAFIt(function (elem, detail, isAuto, sizes, isImg){
497			var src, srcset, parent, isPicture, event, firesLoad;
498
499			if(!(event = triggerEvent(elem, 'lazybeforeunveil', detail)).defaultPrevented){
500
501				if(sizes){
502					if(isAuto){
503						addClass(elem, lazySizesConfig.autosizesClass);
504					} else {
505						elem.setAttribute('sizes', sizes);
506					}
507				}
508
509				srcset = elem[_getAttribute](lazySizesConfig.srcsetAttr);
510				src = elem[_getAttribute](lazySizesConfig.srcAttr);
511
512				if(isImg) {
513					parent = elem.parentNode;
514					isPicture = parent && regPicture.test(parent.nodeName || '');
515				}
516
517				firesLoad = detail.firesLoad || (('src' in elem) && (srcset || src || isPicture));
518
519				event = {target: elem};
520
521				if(firesLoad){
522					addRemoveLoadEvents(elem, resetPreloading, true);
523					clearTimeout(resetPreloadingTimer);
524					resetPreloadingTimer = setTimeout(resetPreloading, 2500);
525
526					addClass(elem, lazySizesConfig.loadingClass);
527					addRemoveLoadEvents(elem, rafSwitchLoadingClass, true);
528				}
529
530				if(isPicture){
531					forEach.call(parent.getElementsByTagName('source'), handleSources);
532				}
533
534				if(srcset){
535					elem.setAttribute('srcset', srcset);
536				} else if(src && !isPicture){
537					if(regIframe.test(elem.nodeName)){
538						changeIframeSrc(elem, src);
539					} else {
540						elem.src = src;
541					}
542				}
543
544				if(isImg && (srcset || isPicture)){
545					updatePolyfill(elem, {src: src});
546				}
547			}
548
549			if(elem._lazyRace){
550				delete elem._lazyRace;
551			}
552			removeClass(elem, lazySizesConfig.lazyClass);
553
554			rAF(function(){
555				if( !firesLoad || (elem.complete && elem.naturalWidth > 1)){
556					if(firesLoad){
557						resetPreloading(event);
558					} else {
559						isLoading--;
560					}
561					switchLoadingClass(event);
562				}
563			}, true);
564		});
565
566		var unveilElement = function (elem){
567			var detail;
568
569			var isImg = regImg.test(elem.nodeName);
570
571			//allow using sizes="auto", but don't use. it's invalid. Use data-sizes="auto" or a valid value for sizes instead (i.e.: sizes="80vw")
572			var sizes = isImg && (elem[_getAttribute](lazySizesConfig.sizesAttr) || elem[_getAttribute]('sizes'));
573			var isAuto = sizes == 'auto';
574
575			if( (isAuto || !isCompleted) && isImg && (elem[_getAttribute]('src') || elem.srcset) && !elem.complete && !hasClass(elem, lazySizesConfig.errorClass) && hasClass(elem, lazySizesConfig.lazyClass)){return;}
576
577			detail = triggerEvent(elem, 'lazyunveilread').detail;
578
579			if(isAuto){
580				 autoSizer.updateElem(elem, true, elem.offsetWidth);
581			}
582
583			elem._lazyRace = true;
584			isLoading++;
585
586			lazyUnveil(elem, detail, isAuto, sizes, isImg);
587		};
588
589		var onload = function(){
590			if(isCompleted){return;}
591			if(Date.now() - started < 999){
592				setTimeout(onload, 999);
593				return;
594			}
595			var afterScroll = debounce(function(){
596				lazySizesConfig.loadMode = 3;
597				throttledCheckElements();
598			});
599
600			isCompleted = true;
601
602			lazySizesConfig.loadMode = 3;
603
604			throttledCheckElements();
605
606			addEventListener('scroll', function(){
607				if(lazySizesConfig.loadMode == 3){
608					lazySizesConfig.loadMode = 2;
609				}
610				afterScroll();
611			}, true);
612		};
613
614		return {
615			_: function(){
616				started = Date.now();
617
618				lazysizes.elements = document.getElementsByClassName(lazySizesConfig.lazyClass);
619				preloadElems = document.getElementsByClassName(lazySizesConfig.lazyClass + ' ' + lazySizesConfig.preloadClass);
620				hFac = lazySizesConfig.hFac;
621
622				addEventListener('scroll', throttledCheckElements, true);
623
624				addEventListener('resize', throttledCheckElements, true);
625
626				if(window.MutationObserver){
627					new MutationObserver( throttledCheckElements ).observe( docElem, {childList: true, subtree: true, attributes: true} );
628				} else {
629					docElem[_addEventListener]('DOMNodeInserted', throttledCheckElements, true);
630					docElem[_addEventListener]('DOMAttrModified', throttledCheckElements, true);
631					setInterval(throttledCheckElements, 999);
632				}
633
634				addEventListener('hashchange', throttledCheckElements, true);
635
636				//, 'fullscreenchange'
637				['focus', 'mouseover', 'click', 'load', 'transitionend', 'animationend', 'webkitAnimationEnd'].forEach(function(name){
638					document[_addEventListener](name, throttledCheckElements, true);
639				});
640
641				if((/d$|^c/.test(document.readyState))){
642					onload();
643				} else {
644					addEventListener('load', onload);
645					document[_addEventListener]('DOMContentLoaded', throttledCheckElements);
646					setTimeout(onload, 20000);
647				}
648
649				if(lazysizes.elements.length){
650					checkElements();
651					rAF._lsFlush();
652				} else {
653					throttledCheckElements();
654				}
655			},
656			checkElems: throttledCheckElements,
657			unveil: unveilElement
658		};
659	})();
660
661
662	var autoSizer = (function(){
663		var autosizesElems;
664
665		var sizeElement = rAFIt(function(elem, parent, event, width){
666			var sources, i, len;
667			elem._lazysizesWidth = width;
668			width += 'px';
669
670			elem.setAttribute('sizes', width);
671
672			if(regPicture.test(parent.nodeName || '')){
673				sources = parent.getElementsByTagName('source');
674				for(i = 0, len = sources.length; i < len; i++){
675					sources[i].setAttribute('sizes', width);
676				}
677			}
678
679			if(!event.detail.dataAttr){
680				updatePolyfill(elem, event.detail);
681			}
682		});
683		var getSizeElement = function (elem, dataAttr, width){
684			var event;
685			var parent = elem.parentNode;
686
687			if(parent){
688				width = getWidth(elem, parent, width);
689				event = triggerEvent(elem, 'lazybeforesizes', {width: width, dataAttr: !!dataAttr});
690
691				if(!event.defaultPrevented){
692					width = event.detail.width;
693
694					if(width && width !== elem._lazysizesWidth){
695						sizeElement(elem, parent, event, width);
696					}
697				}
698			}
699		};
700
701		var updateElementsSizes = function(){
702			var i;
703			var len = autosizesElems.length;
704			if(len){
705				i = 0;
706
707				for(; i < len; i++){
708					getSizeElement(autosizesElems[i]);
709				}
710			}
711		};
712
713		var debouncedUpdateElementsSizes = debounce(updateElementsSizes);
714
715		return {
716			_: function(){
717				autosizesElems = document.getElementsByClassName(lazySizesConfig.autosizesClass);
718				addEventListener('resize', debouncedUpdateElementsSizes);
719			},
720			checkElems: debouncedUpdateElementsSizes,
721			updateElem: getSizeElement
722		};
723	})();
724
725	var init = function(){
726		if(!init.i){
727			init.i = true;
728			autoSizer._();
729			loader._();
730		}
731	};
732
733	lazysizes = {
734		cfg: lazySizesConfig,
735		autoSizer: autoSizer,
736		loader: loader,
737		init: init,
738		uP: updatePolyfill,
739		aC: addClass,
740		rC: removeClass,
741		hC: hasClass,
742		fire: triggerEvent,
743		gW: getWidth,
744		rAF: rAF,
745	};
746
747	return lazysizes;
748}
749));
750
751
752// Blog Table of Contents
753; (function (window, $, undefined) {
754  $.fn.createTOC = function (settings) {
755      var option = $.extend({
756          title: "",
757          insert: "body",
758      }, settings);
759
760      var ACTIVE_CLASS = 'active';
761
762      var list = ["h2"];
763      var $headings = this.find(list.join(","));
764
765      var tocBox = document.createElement("ul");
766      var $tocBox = $(tocBox);
767      tocBox.className = "toc-box";
768
769      var idList = [];
770
771      $headings.map(function (i, head) {
772          var nodeName = head.nodeName;
773          var id = 'toc_' + i + '_' + nodeName;
774          head.id = id;
775
776          idList.push(id);
777
778          var row = document.createElement("li");
779
780          row.className = 'toc-item toc-' + nodeName;
781
782          var link = document.createElement('a');
783
784          link.innerHTML = head.innerHTML;
785          link.className = 'toc-item-link';
786          link.href = '#' + id;
787
788          row.appendChild(link);
789          tocBox.appendChild(row);
790      });
791      var isTakeOverByClick = false;
792
793      $tocBox.on("click", ".toc-item", function (ev) {
794          isTakeOverByClick = true;
795
796          var $item = $(this);
797          var $itemSiblings = $item.siblings();
798
799          $itemSiblings.removeClass(ACTIVE_CLASS);
800          $item.addClass(ACTIVE_CLASS);
801      });
802
803      var headBox = document.createElement("div");
804      headBox.className = "toc-title";
805      headBox.innerHTML = option.title;
806
807      var wrapBox = document.createElement("div");
808      wrapBox.className = "wrap-toc";
809
810      wrapBox.appendChild(headBox);
811      wrapBox.appendChild(tocBox);
812
813      var $insertBox = $(option.insert);
814      var $helperBox = $("<aside></aside>");
815      $helperBox.append(wrapBox);
816      $insertBox.append($helperBox);
817
818      var CACHE_WIDTH = $insertBox.css('width');
819      var CACHE_PADDING_TOP = $insertBox.css('paddingTop');
820      var CACHE_PADDING_RIGHT = $insertBox.css('paddingRight');
821      var CACHE_PADDING_BOTTOM = $insertBox.css('paddingBottom');
822      var CACHE_PADDING_LEFT = $insertBox.css('paddingLeft');
823      var CACHE_MARGIN_TOP = $insertBox.css('marginTop');
824
825      var scrollTop = $('html,body').scrollTop();
826      var offsetTop = $insertBox.offset().top;
827      var marginTop = parseInt($insertBox.css('marginTop'));
828      var offsetTopForView = offsetTop - scrollTop - marginTop;
829
830      $(window).scroll(function () {
831          var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
832          var isFixed = $helperBox.css("position") === "fixed";
833
834          !isTakeOverByClick && $.each(idList, function (index, id) {
835              var $head = $('#' + id);
836              var $item = $('[href="#' + id + '"]').parent();
837              var $itemSiblings = $item.siblings();
838              var offsetTopHead = $head.offset().top;
839              var isActived = $item.hasClass(ACTIVE_CLASS);
840
841              if (scrollTop >= offsetTopHead) {
842                  $itemSiblings.removeClass(ACTIVE_CLASS);
843                  !isActived && $item.addClass(ACTIVE_CLASS);
844              } else {
845                  $item.removeClass(ACTIVE_CLASS);
846              }
847
848          });
849          isTakeOverByClick = false;
850
851          if (scrollTop >= offsetTopForView) {
852              if (isFixed) return;
853              $insertBox.css({
854                  padding: 0,
855              });
856              $helperBox.css({
857                  position: 'fixed',
858                  top: CACHE_MARGIN_TOP,
859                  width: CACHE_WIDTH,
860                  paddingTop: CACHE_PADDING_TOP,
861                  paddingRight: CACHE_PADDING_RIGHT,
862                  paddingBottom: CACHE_PADDING_BOTTOM,
863                  paddingLeft: CACHE_PADDING_LEFT,
864                  backgroundColor: $insertBox.css('backgroundColor')
865              });
866          } else {
867              if (!isFixed) return;
868              $helperBox.css({
869                  position: 'static',
870                  padding: 0
871              });
872              $insertBox.css({
873                  paddingTop: CACHE_PADDING_TOP,
874                  paddingRight: CACHE_PADDING_RIGHT,
875                  paddingBottom: CACHE_PADDING_BOTTOM,
876                  paddingLeft: CACHE_PADDING_LEFT,
877              });
878          }
879      });
880
881
882  };
883
884}(this, jQuery));
885
886function openLoginModal() {
887  const modal = document.getElementById('loginModal');
888  if (modal) {
889    modal.classList.add('show');
890    document.body.style.overflow = 'hidden';
891  }
892}
893
894function closeLoginModal() {
895  const modal = document.getElementById('loginModal');
896  if (modal) {
897    modal.classList.remove('show');
898    document.body.style.overflow = 'auto';
899  }
900}
901
902document.addEventListener('click', function(event) {
903  const modal = document.getElementById('loginModal');
904  if (modal && modal.classList.contains('show')) {
905    if (event.target === modal || event.target.id === 'loginModal') {
906      closeLoginModal();
907    }
908  }
909}, true);
910
911document.addEventListener('keydown', function(event) {
912  if (event.key === 'Escape' || event.keyCode === 27) {
913    const modal = document.getElementById('loginModal');
914    if (modal && modal.classList.contains('show')) {
915      closeLoginModal();
916    }
917  }
918});

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.