PageSourceSearch

https://chesterlaw.com/wp-content/themes/thegem/js/functions.js?ver=5.12.3.1

js chesterlaw.com collected 2026-10-07 03:34:18 UTC 26,204 bytes, 794 lines download raw bytes

1(function($) {
2	$.fn.thegemPreloader = function(callback) {
3		$(this).each(function() {
4			var $el = $(this),
5				hasSrc = ['img', 'iframe'].indexOf($el[0].nodeName.toLowerCase()) != -1;
6
7			$el.data('thegemPreloader', $('img, iframe', $el).add($el.filter('img, iframe')).length);
8
9			if ($el.data('thegemPreloader') == 0 || (hasSrc && !$el.attr('src'))) {
10				$el.prev('.preloader').remove();
11				callback();
12				$el.trigger('thegem-preloader-loaded');
13				return;
14			}
15
16			if(!$el.prev('.preloader').length) {
17				$('<div class="preloader">').insertBefore($el);
18			}
19
20			$('img, iframe', $el).add($el.filter('img, iframe')).each(function() {
21				function preloaderItemLoaded() {
22					$el.data('thegemPreloader', $el.data('thegemPreloader')-1);
23					if($el.data('thegemPreloader') == 0) {
24						$el.prev('.preloader').remove();
25						callback();
26						$el.trigger('thegem-preloader-loaded');
27					}
28				}
29
30				if (!$(this).attr('src')) {
31					preloaderItemLoaded();
32					return;
33				}
34
35				var $obj = $('<img>');
36				if($(this).prop('tagName').toLowerCase() == 'iframe') {
37					$obj = $(this);
38				}
39				$obj.attr('src', $(this).attr('src'));
40				$obj.on('load error', preloaderItemLoaded);
41			});
42		});
43	}
44})(jQuery);
45
46(function($) {
47
48	var oWidth=$.fn.width;
49	$.fn.width=function(argument) {
50		if (arguments.length==0 && this.length==1 && this[0]===window) {
51			if (window.gemOptions.innerWidth != -1) {
52				return window.gemOptions.innerWidth;
53			}
54			var width = oWidth.apply(this,arguments);
55			window.updateGemInnerSize(width);
56			return width;
57		}
58
59		return oWidth.apply(this,arguments);
60	};
61
62	var $page = $('#page');
63
64	$(window).on('load', function() {
65		var $preloader = $('#page-preloader');
66		if ($preloader.length && !$preloader.hasClass('preloader-loaded')) {
67			$preloader.addClass('preloader-loaded');
68		}
69	});
70
71	$.fn.updateTabs = function() {
72
73		jQuery('.gem-tabs', this).each(function(index) {
74			var $tabs = $(this);
75			$tabs.thegemPreloader(function() {
76				$tabs.easyResponsiveTabs({
77					type: 'default',
78					width: 'auto',
79					fit: false,
80					activate: function(currentTab, e) {
81						var $tab = $(currentTab.target);
82						var controls = $tab.attr('aria-controls');
83						$tab.closest('.ui-tabs').find('.gem_tab[aria-labelledby="' + controls + '"]').trigger('tab-update');
84					}
85				});
86			});
87		});
88
89		jQuery('.gem-tour', this).each(function(index) {
90			var $tabs = $(this);
91			$tabs.thegemPreloader(function() {
92				$tabs.easyResponsiveTabs({
93					type: 'vertical',
94					width: 'auto',
95					fit: false,
96					activate: function(currentTab, e) {
97						var $tab = $(currentTab.target);
98						var controls = $tab.attr('aria-controls');
99						$tab.closest('.ui-tabs').find('.gem_tab[aria-labelledby="' + controls + '"]').trigger('tab-update');
100					}
101				});
102			});
103		});
104
105	};
106
107	function fullwidth_block_after_update($item) {
108		$item.trigger('updateTestimonialsCarousel');
109		$item.trigger('updateClientsCarousel');
110		$item.trigger('fullwidthUpdate');
111	}
112
113	function fullwidth_block_update($item, pageOffset, pagePaddingLeft, pageWidth,skipTrigger) {
114		var $prevElement = $item.prev(),
115			extra_padding = 0;
116			extra_margin = parseInt($prevElement.css('margin-left'));
117		if ($prevElement.length == 0 || $prevElement.hasClass('fullwidth-block') || $prevElement.is('style')) {
118			$prevElement = $item.parent();
119			extra_padding = parseInt($prevElement.css('padding-left'));
120			extra_margin = 0;
121		}
122
123		var offsetKey = window.gemSettings.isRTL ? 'right' : 'left';
124		var cssData = {
125			width: pageWidth
126		};
127		cssData[offsetKey] = pageOffset.left - ($prevElement.length ? $prevElement.offset().left - extra_margin : 0) + parseInt(pagePaddingLeft) - extra_padding;
128
129		$item.css(cssData);
130
131		if (!skipTrigger) {
132			fullwidth_block_after_update($item);
133		}
134	}
135
136	var inlineFullwidths = [],
137		notInlineFullwidths = [];
138
139	$('.fullwidth-block').each(function() {
140		var $item = $(this),
141			$parents = $item.parents('.vc_row'),
142			fullw = {
143				isInline: false
144			};
145
146		$parents.each(function() {
147			if (this.hasAttribute('data-vc-full-width')) {
148				fullw.isInline = true;
149				return false;
150				}
151		});
152
153		if (fullw.isInline) {
154			inlineFullwidths.push(this);
155		} else {
156			notInlineFullwidths.push(this);
157			}
158		});
159
160	function update_fullwidths(inline, init) {
161		var $needUpdate = [];
162
163		(inline ? inlineFullwidths : notInlineFullwidths).forEach(function(item) {
164			$needUpdate.push(item);
165		});
166
167		if ($needUpdate.length > 0) {
168			var pageOffset = $page.offset(),
169				pagePaddingLeft = $page.css('padding-left'),
170				pageWidth = $page.width();
171
172			$needUpdate.forEach(function(item) {
173				fullwidth_block_update($(item), pageOffset, pagePaddingLeft, pageWidth);
174				});
175		}
176	}
177
178	if (!window.disableGemSlideshowPreloaderHandle) {
179		jQuery('.gem-slideshow-with-preloader:not(.gem-slideshow-rs)').each(function() {
180			var $slideshow = $(this);
181			$slideshow.thegemPreloader(function() {});
182		});
183	}
184
185	var revapi = jQuery(document).ready(function() {});
186	revapi.one('revolution.slide.onloaded', function() {
187		jQuery('.gem-slideshow').prev('.slideshow-preloader').remove();
188	});
189
190	$(function() {
191		$('#gem-icons-loading-hide').remove();
192
193		if (window.tgpLazyItems===undefined) {
194			$('#thegem-preloader-inline-css').remove();
195		}
196
197		/*jQuery('iframe').not('.gem-video-background iframe, .wcppec-checkout-buttons iframe').each(function() {
198			$(this).thegemPreloader(function() {});
199		});*/
200
201		jQuery('.gem-video-background').each(function() {
202			var $videoBG = $(this);
203			var $videoContainer = $('.gem-video-background-inner', this);
204			var ratio = $videoBG.data('aspect-ratio') ? $videoBG.data('aspect-ratio') : '16:9';
205			var regexp = /(\d+):(\d+)/;
206			var $fullwidth = $videoBG.closest('.fullwidth-block');
207			ratio = regexp.exec(ratio);
208			if(!ratio || parseInt(ratio[1]) == 0 || parseInt(ratio[2]) == 0) {
209				ratio = 16/9;
210			} else {
211				ratio = parseInt(ratio[1])/parseInt(ratio[2]);
212			}
213
214			function gemVideoUpdate() {
215				$videoContainer.removeAttr('style');
216				if($videoContainer.width() / $videoContainer.height() > ratio) {
217					$videoContainer.css({
218						height: ($videoContainer.width() / ratio) + 'px',
219						marginTop: -($videoContainer.width() / ratio - $videoBG.height()) / 2 + 'px'
220					});
221				} else {
222					$videoContainer.css({
223						width: ($videoContainer.height() * ratio) + 'px',
224						marginLeft: -($videoContainer.height() * ratio - $videoBG.width()) / 2 + 'px'
225					});
226				}
227			}
228
229			if ($videoBG.closest('.vc_row_custom_video_background').length > 0) {
230				gemVideoUpdate();
231			}
232
233			if ($videoBG.closest('.page-title-block').length > 0) {
234				gemVideoUpdate();
235			}
236
237			if ($fullwidth.length) {
238				$fullwidth.on('fullwidthUpdate', gemVideoUpdate);
239			} else {
240				$(window).resize(gemVideoUpdate);
241				}
242			});
243
244		update_fullwidths(false, true);
245
246
247		$('.fullwidth-block').each(function() {
248			var $item = $(this),
249				mobile_enabled = $item.data('mobile-parallax-enable') || '0',
250				is_custom_title = $item.hasClass('custom-title-background');
251
252			if (!window.gemSettings.isTouch || mobile_enabled == '1') {
253				if ($item.hasClass('fullwidth-block-parallax-vertical')) {
254					var parallaxOptions = {};
255					if (is_custom_title) {
256						parallaxOptions.position = 'top';
257					}
258
259					$('.fullwidth-block-background', $item).each(function() {
260						var backgroundImageCss = $(this).css('background-image') || '';
261
262						if (backgroundImageCss == 'none' || backgroundImageCss == '') {
263							$(this).on('tgpliVisible', function() {
264								$(this).parallaxVertical('50%', parallaxOptions);
265							});
266
267							return;
268						}
269
270						$(this).parallaxVertical('50%', parallaxOptions);
271					});
272				} else if ($item.hasClass('fullwidth-block-parallax-horizontal')) {
273					$('.fullwidth-block-background', $item).each(function() {
274						if (!window.gemSettings.parallaxDisabled) {
275							var backgroundImageCss = $(this).css('background-image') || '';
276
277							if (backgroundImageCss == 'none' || backgroundImageCss == '') {
278								$(this).on('tgpliVisible', function() {
279									$(this).parallaxHorizontal();
280								});
281
282								return;
283							}
284
285							$(this).parallaxHorizontal();
286						}
287					});
288				}
289			} else {
290				$('.fullwidth-block-background', $item).css({
291					backgroundAttachment: 'scroll'
292				});
293			}
294		});
295
296		if(!window.gemSettings.isTouch) {
297			$('.page-title-parallax-background').each(function() {
298				var backgroundImageCss = $(this).css('background-image') || '';
299				if (backgroundImageCss == 'none' || backgroundImageCss == '') {
300					$(this).on('tgpliVisible', function() {
301						$(this).parallaxVertical('50%', {
302							position: 'top'
303						});
304					});
305					return;
306				}
307
308				$(this).parallaxVertical('50%', {
309					position: 'top'
310				});
311			});
312		} else {
313			$('.page-title-parallax-background').css({
314				backgroundAttachment: 'scroll'
315			});
316		}
317
318
319
320		$(window).resize(function() {
321			update_fullwidths(false, false);
322		});
323
324		$(window).on('load', function() {
325			update_fullwidths(false, false);
326		});
327
328		jQuery('select.gem-combobox, .gem-combobox select, .widget_archive select').each(function(index) {
329			$(this).combobox();
330		});
331
332		jQuery('.widget_categories select').each(function() {
333			this.onchange = null;
334			$(this).on('change', function() {
335				if($(this).val() != -1) {
336					$(this).closest('form').submit();
337				}
338			});
339		});
340
341		jQuery('input.gem-checkbox, .gem-checkbox input').each(function(index) {
342			$(this).checkbox();
343		});
344
345		if (typeof($.fn.ReStable) == "function") {
346			jQuery('.gem-table-responsive').each(function(index) {
347				$('> table', this).ReStable({
348					maxWidth: 768,
349					rowHeaders : $(this).hasClass('row-headers')
350				});
351			});
352		}
353
354		jQuery('.fancybox').each(function() {
355			$(this).fancybox();
356		});
357
358		if (typeof jQuery.fn.scSticky === 'function') {
359			jQuery('.panel-sidebar-sticky > .sidebar').scSticky();
360		}
361
362		$('.primary-navigation a.mega-no-link').closest('li').removeClass('menu-item-active current-menu-item');
363
364		function getElementPagePosition(element) {
365			var width = element.offsetWidth,
366				height = element.offsetHeight,
367				left = 0,
368				top = 0;
369
370			while (element && element.id != 'page') {
371				left += element.offsetLeft;
372				top += element.offsetTop;
373				element = element.offsetParent;
374			}
375
376			return {"left": left, "top": top, "width": width, "height": height};
377		}
378
379		var $anhorsElements = [];
380		$('a[href*="#"]').not('[data-vc-accordion], [data-vc-tabs], .scroll-to-content, .disable-scroll-to-anchor, .disable-scroll-to-anchor a').each(function(e) {
381			var $anhor = $(this);
382			var link = $anhor.attr('href');
383			if(!link) return ;
384			link = link.split('#');
385			var currentUrl = window.location.href.split('#')[0].replace(/\/$/, '');
386			if(link[0] === '/') link[0] = window.location.origin;
387			if(link[0] !== '' && link[0].replace(/\/$/, '') !== currentUrl) return ;
388			try {
389			if($('#'+link[1]).hasClass('vc_tta-panel')) return ;
390			if($('#'+link[1]).length) {
391				$anhor.closest('li').removeClass('menu-item-active current-menu-item');
392				$anhor.closest('li').parents('li').removeClass('menu-item-current');
393				$(document).on('update-page-scroller', function(e, elem) {
394					var $elem = $(elem);
395					if(!$anhor.closest('li.menu-item').length) return ;
396					if($elem.is($('#'+link[1])) || $elem.find($('#'+link[1])).length) {
397						$anhor.closest('li').addClass('menu-item-active');
398						$anhor.closest('li').parents('li').addClass('menu-item-current');
399					} else {
400						$anhor.closest('li').removeClass('menu-item-active');
401						$anhor.closest('li').parents('li.menu-item-current').each(function() {
402							if(!$('.menu-item-active', this).length) {
403								$(this).removeClass('menu-item-current');
404							}
405						});
406					}
407				});
408				$anhor.click(function(e) {
409					e.preventDefault();
410					history.replaceState('data to be passed', $anhor.text(), $anhor.attr('href'));
411					var correction = 0;
412					var isPerspectiveMenu = $('#thegem-perspective.modalview').length;
413
414					if($('#site-header.animated-header').length) {
415						var shrink = $('#site-header').hasClass('shrink');
416						$('#site-header').addClass('scroll-counting');
417						$('#site-header').addClass('fixed shrink');
418						correction = $('#site-header').outerHeight();
419						if (!isPerspectiveMenu) {
420							var siteHeaderTop = $('#site-header').position().top;
421							if ($('#site-header').hasClass('shrink')) {
422								siteHeaderTop = 0;
423							}
424							correction += siteHeaderTop;
425						}
426
427						if(!shrink) {
428							$('#site-header').removeClass('fixed shrink');
429						}
430						setTimeout(function() {
431							$('#site-header').removeClass('scroll-counting');
432						}, 50);
433					}
434					if($('#site-header.header-sticky').length && $('.header-sticky-template').length) {
435						correction = $('.header-sticky-template').outerHeight();
436					}
437					var target_top = getElementPagePosition( $('#'+link[1])[0] ).top - correction + 1;
438					if(getElementPagePosition( $('#'+link[1])[0] ).top == 0) { target_top = 0; }
439					if($('body').hasClass('page-scroller') && $('.page-scroller-nav-pane').is(':visible')) {
440						var $block = $('#'+link[1]+'.scroller-block').add($('#'+link[1]).closest('.scroller-block')).eq(0);
441						if($block.length) {
442							$('.page-scroller-nav-pane .page-scroller-nav-item').eq($('.scroller-block').index($block)).trigger('click');
443						}
444						if($anhor.closest('.overlay-menu-wrapper').length && $anhor.closest('.overlay-menu-wrapper').hasClass('active')) {
445							if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('responsive')) {
446								$anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click');
447								$anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click');
448							} else {
449								$anhor.closest('.thegem-te-menu').find('.overlay-toggle').trigger('click');
450								$anhor.closest('#primary-navigation').find('.overlay-toggle').trigger('click');
451							}
452						}
453					} else {
454						if (isPerspectiveMenu) {
455							$('#page').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutCubic', function() {
456								if($anhor.closest('#thegem-perspective').length && $anhor.closest('#thegem-perspective').hasClass('modalview')) {
457									$anhor.closest('.thegem-te-menu').find('.perspective-menu-close').trigger('click');
458									$anhor.closest('#primary-navigation').find('.perspective-menu-close').trigger('click');
459								}
460							});
461						} else {
462							$('html, body').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutCubic');
463						}
464						if($anhor.closest('#primary-menu').length && $anhor.closest('#primary-menu').hasClass('dl-menuopen')) {
465							$anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click');
466							$anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click');
467						}
468						if($anhor.closest('.mobile-menu-slide-wrapper').length && $anhor.closest('.mobile-menu-slide-wrapper').hasClass('opened')) {
469							$anhor.closest('.thegem-te-menu').find('.mobile-menu-slide-close').trigger('click');
470							$anhor.closest('#primary-navigation').find('.mobile-menu-slide-close').trigger('click');
471						}
472						if($anhor.closest('.overlay-menu-wrapper').length && $anhor.closest('.overlay-menu-wrapper').hasClass('active')) {
473							if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('responsive')) {
474								$anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click');
475								$anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click');
476							} else {
477								$anhor.closest('.thegem-te-menu').find('.overlay-toggle-close').trigger('click');
478								$anhor.closest('#primary-navigation').find('.overlay-toggle-close').trigger('click');
479							}
480						}
481						if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('hamburger-active')) {
482							$anhor.closest('.thegem-te-menu').find('.hamburger-toggle').trigger('click');
483							$anhor.closest('#primary-navigation').find('.hamburger-toggle').trigger('click');
484						}
485					}
486				});
487				$anhorsElements.push($anhor[0]);
488			}
489			} catch(e) { return; }
490		});
491
492		if ($anhorsElements.length) {
493			function anchorLinksScroll() {
494				var isPerspectiveMenu = $('#thegem-perspective.modalview').length;
495				var correction = 0;
496
497				if (!$page.hasClass('vertical-header')) {
498					correction = $('#site-header').outerHeight();
499					if (!isPerspectiveMenu) {
500						var siteHeaderTop = $('#site-header').length ? $('#site-header').position().top : 0;
501						if ($('#site-header').hasClass('shrink')) {
502							siteHeaderTop = 0;
503						}
504						correction += siteHeaderTop;
505					}
506				}
507
508				if($('#site-header.header-sticky').length && $('.header-sticky-template').length) {
509					correction = $('.header-sticky-template').outerHeight();
510				}
511
512				for (var i = 0; i < $anhorsElements.length; i++) {
513					var $anhor = $($anhorsElements[i]);
514					var link = $anhor.attr('href');
515					if(!link) continue ;
516					link = link.split('#');
517					var scrollY = getScrollY() + $page.scrollTop();
518
519					if(!$anhor.closest('li.menu-item').length) continue ;
520					var target_top = getElementPagePosition( $('#'+link[1])[0] ).top - correction;
521					if(scrollY >= target_top && scrollY <= target_top + $('#'+link[1]).outerHeight()) {
522						$anhor.closest('li').addClass('menu-item-active');
523						$anhor.closest('li').parents('li').addClass('menu-item-current');
524					} else {
525						$anhor.closest('li').removeClass('menu-item-active');
526						$anhor.closest('li').parents('li.menu-item-current').each(function() {
527							if(!$('.menu-item-active', this).length) {
528								$(this).removeClass('menu-item-current');
529							}
530						});
531					}
532				}
533			}
534
535			$(window).scroll(anchorLinksScroll);
536			if ($('#thegem-perspective').length) {
537				$page.scroll(anchorLinksScroll);
538			}
539
540			$(window).on('load', function() {
541				for (var i = 0; i < $anhorsElements.length; i++) {
542					var anhor = $anhorsElements[i];
543					if (anhor.href != undefined && anhor.href && window.location.href == anhor.href) {
544						anhor.click();
545						break;
546					}
547				}
548			});
549		}
550
551		$('body').on('click', '.post-footer-sharing .gem-button', function(e) {
552			e.preventDefault();
553			e.stopPropagation();
554			$(this).closest('.post-footer-sharing').find('.sharing-popup').addClass('active');
555		});
556
557		$('body').on('click', function () {
558			$('.sharing-popup').removeClass('active');
559		});
560
561		var scrollTimer,
562			body = document.body;
563
564		$(window).scroll(function() {
565			clearTimeout(scrollTimer);
566			if(!body.classList.contains('disable-hover')) {
567				//body.classList.add('disable-hover')
568			}
569
570			scrollTimer = setTimeout(function(){
571				//body.classList.remove('disable-hover')
572			}, 300);
573
574			if(getScrollY() > 0) {
575				$('.scroll-top-button').addClass('visible');
576			} else {
577				$('.scroll-top-button').removeClass('visible');
578			}
579		}).scroll();
580
581		function getScrollY(elem){
582			return window.pageYOffset || document.documentElement.scrollTop;
583		}
584
585		$('a.hidden-email').each(function() {
586			$(this).attr('href', 'mailto:'+$(this).data('name')+'@'+$(this).data('domain'));
587		});
588
589		var initFooterWidgetArea = function() {
590			if (window.tgpLazyItems !== undefined) {
591				var isShowed = window.tgpLazyItems.checkGroupShowed(this, function(node) {
592					initFooterWidgetArea.call(node);
593				});
594				if (!isShowed) {
595					return;
596				}
597			}
598
599			var self = this;
600			$(self).thegemPreloader(function() {
601				$(self).thegem_isotope({
602					itemSelector: '.widget',
603					layoutMode: 'masonry'
604				});
605			});
606		};
607
608		$('#colophon .footer-widget-area').each(initFooterWidgetArea);
609
610		$('body').updateTabs();
611	});
612
613	$(document).on('show.vc.accordion', '[data-vc-accordion]', function() {
614		var $target = $(this).data('vc.accordion').getContainer();
615		var correction = 0;
616		if(!$target.find('.vc_tta-tabs').length || !$(this).is(':visible') || $target.data('vc-tta-autoplay')) return ;
617		if($('#site-header.animated-header').length && $('#site-header').hasClass('fixed')) {
618			var shrink = $('#site-header').hasClass('shrink');
619			$('#site-header').addClass('scroll-counting');
620			$('#site-header').addClass('fixed shrink');
621			correction = $('#site-header').outerHeight() + $('#site-header').position().top;
622			if(!shrink) {
623				$('#site-header').removeClass('fixed shrink');
624			}
625			$('#site-header').removeClass('scroll-counting');
626		}
627		var target_top = $target.offset().top - correction - 100 + 1;
628		$('html, body').stop(true, true).animate({scrollTop:target_top}, 500, 'easeInOutCubic');
629	});
630
631	var vc_update_fullwidth_init = true;
632	$(document).on('vc-full-width-row', function(e) {
633		if (window.gemOptions.clientWidth - $page.width() > 25 || window.gemSettings.isRTL) {
634			for (var i = 1; i < arguments.length; i++) {
635				var $el = $(arguments[i]);
636				$el.addClass("vc_hidden");
637				var $el_full = $el.next(".vc_row-full-width");
638				$el_full.length || ($el_full = $el.parent().next(".vc_row-full-width"));
639				var el_margin_left = parseInt($el.css("margin-left"), 10),
640					el_margin_right = parseInt($el.css("margin-right"), 10),
641					offset = 0 - $el_full.offset().left - el_margin_left + $('#page').offset().left + parseInt($('#page').css('padding-left')),
642					width = $('#page').width();
643
644				var offsetKey = window.gemSettings.isRTL ? 'right' : 'left';
645				var cssData = {
646					position: "relative",
647					left: offset,
648					"box-sizing": "border-box",
649					width: $("#page").width()
650				};
651				cssData[offsetKey] = offset;
652
653				if ($el.css(cssData), !$el.data("vcStretchContent")) {
654					var padding = -1 * offset;
655					0 > padding && (padding = 0);
656					var paddingRight = width - padding - $el_full.width() + el_margin_left + el_margin_right;
657					0 > paddingRight && (paddingRight = 0), $el.css({
658						"padding-left": padding + "px",
659						"padding-right": paddingRight + "px"
660					})
661				}
662				$el.attr("data-vc-full-width-init", "true"), $el.removeClass("vc_hidden");
663				$el.trigger('VCRowFullwidthUpdate');
664			}
665		}
666		update_fullwidths(true, vc_update_fullwidth_init);
667		vc_update_fullwidth_init = false;
668	});
669
670	$('body').on('click', '.gem-button[href^="#give-form-"]', function(e) {
671		var form_id = $(this).attr('href').replace('#give-form-', '');
672		form_id = parseInt(form_id);
673		if (!isNaN(form_id)) {
674			$('#give-form-' + form_id + ' .give-btn-modal').click();
675		}
676		e.preventDefault();
677		return false;
678	});
679
680	$('body').on('click', '.close-fancybox', function (e){
681		if (parent.jQuery.fancybox.getInstance()) {
682			e.preventDefault();
683			parent.jQuery.fancybox.getInstance().close();
684		}
685	});
686
687})(jQuery);
688
689// Ajax Notification Hidden Sidebar
690(function($) {
691
692	$('body.notification-hidden-sidebar').on('added_to_cart', function () {
693		$('.thegem-popup-notification-wrap > .thegem-popup-notification.cart').remove();
694
695		$('body').addClass('notification-locked');
696		$('.thegem-popup-notification-sidebar').addClass('active');
697
698		setTimeout(() => {
699			$.fancybox.close();
700		}, 200)
701	});
702
703	$('body.notification-hidden-sidebar').on('click touchend', '.thegem-popup-notification-sidebar .close', function (e) {
704		$('.thegem-popup-notification-sidebar').removeClass('active');
705		$('body').removeClass('notification-locked');
706	});
707
708	$('body.notification-hidden-sidebar').on('click touchend', '.thegem-popup-notification-sidebar', function (e) {
709		const wrap = $('.thegem-popup-notification-sidebar .notification-sidebar');
710		if (!wrap.is(e.target) && wrap.has(e.target).length === 0) {
711			$('.thegem-popup-notification-sidebar').removeClass('active');
712			$('body').removeClass('notification-locked');
713		}
714	});
715
716	$('body.notification-hidden-sidebar').on('click touchend', 'a.minicart-menu-link', function (e) {
717		e.preventDefault();
718
719		$('body').addClass('notification-locked');
720		$('.thegem-popup-notification-sidebar').addClass('active');
721	});
722
723	$('body.notification-hidden-sidebar').on('click', '.woocommerce-mini-cart-item__qty > .plus, .woocommerce-mini-cart-item__qty > .minus', function () {
724		// Get values
725		var $qty = $(this).closest('.woocommerce-mini-cart-item__qty').find('.qty'),
726			currentVal = parseFloat($qty.val()),
727			max = parseFloat($qty.attr('max')),
728			min = parseFloat($qty.attr('min')),
729			step = $qty.attr('step');
730
731		// Format values
732		if (!currentVal || currentVal === '' || currentVal === 'NaN') currentVal = 0;
733		if (max === '' || max === 'NaN') max = '';
734		if (min === '' || min === 'NaN') min = 0;
735		if (step === 'any' || step === '' || step === undefined || parseFloat(step) === 'NaN') step = 1;
736
737		// Change the value
738		if ($(this).is('.plus')) {
739			if (max && (max == currentVal || currentVal > max)) {
740				$qty.val(max);
741			} else {
742				$qty.val(currentVal + parseFloat(step));
743			}
744		} else {
745			if (min && (min == currentVal || currentVal < min)) {
746				$qty.val(min);
747			} else if (currentVal > 0) {
748				$qty.val(currentVal - parseFloat(step));
749			}
750		}
751		$qty.trigger('change');
752	});
753
754	$('body.notification-hidden-sidebar').on('change input', '.woocommerce-mini-cart .quantity .qty', function () {
755		var input = $(this);
756		var qtyVal = input.val();
757		var itemID = input.parents('.woocommerce-mini-cart-item').data('key');
758
759		clearTimeout(window.thegem_cart_update);
760
761		window.thegem_cart_update = setTimeout(function() {
762			$.ajax({
763				url: woocommerce_params.ajax_url,
764				data: {
765					action: 'thegem_notification_sidebar_update_cart_item',
766					item_id: itemID,
767					qty: qtyVal
768				},
769				success: function (data) {
770					if (data && data.fragments) {
771						$.each(data.fragments, function (key, value) {
772							if ($(key).hasClass('widget_shopping_cart_content')) {
773								const dataItemValue = $(value).find('.woocommerce-mini-cart-item[data-key="' + itemID + '"]');
774								const dataFooterValue = $(value).find('.woocommerce-mini-cart__subtotal');
775								const $itemSelector = $(key).find('.woocommerce-mini-cart-item[data-key="' + itemID + '"]');
776
777								if (!data.cart_hash) {
778									$(key).replaceWith(value);
779								} else {
780									$itemSelector.replaceWith(dataItemValue);
781									$('.woocommerce-mini-cart__subtotal').replaceWith(dataFooterValue);
782								}
783							} else {
784								$(key).replaceWith(value);
785							}
786						});
787					}
788				},
789				dataType: 'json',
790				method: 'GET'
791			});
792		}, 500);
793	});
794})(jQuery);

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.