PageSourceSearch

https://remontholoda.com/wp-content/themes/johnnygo/assets/js/theme-script.js?ver=1.0.0

js remontholoda.com collected 2026-10-04 17:38:22 UTC 40,717 bytes, 1,134 lines download raw bytes

1/* super-guacamole.min.js */
2!function(e,t){function n(t){var n,i,r=this;n={id:"",href:"",title:"&middot;&middot;&middot;",children:{},templates:{},container:null},i=e.extend(n,t),r.id=i.id,r.href=i.href,r.title=i.title,r.children=i.children,r.templates=i.templates,r.$container=i.container,r.node=null,r.attachedNode=null,r.options={},r.visible=!0}var i={menu:'<li class="%1$s"><a href="%2$s">%3$s</a>%4$s</li>',child_wrap:"<ul>%s</ul>",child:'<li class="%1$s" id="%5$s"><a href="%2$s">%3$s</a><ul class="sub-menu">%4$s</ul></li>'};n.prototype.set=function(e){if(!1==e instanceof n)throw new Error("Invalid argument type");return this.children[e.id]=e,this},n.prototype.push=function(e){return this.set(e)},n.prototype.get=function(e){var t=null;return this.map(e,function(e,n){return t=n,n}),t},n.prototype.map=function(e,t,n){var i={id:e},r=this;return"string"!=typeof e&&(i=e),n=n||this.children,0>=n.length?i:(Object.keys(n).forEach(function(e){child=n[e],i.id===child.id?n[i.id]=t(child):child.children&&0<Object.keys(child.children).length&&(i=r.map(i,t,child.children))}),i)},n.prototype.has=function(e){return t!==this.children[e]},n.prototype.isVisible=function(){return this.visible},n.prototype.forEach=function(e){return this.children.forEach(e)},n.prototype.countVisibleAttachedNodes=function(){var t=this,n=-1;return Object.keys(t.children).forEach(function(i){e(t.children[i].getAttachedNode()).attr("hidden")||n++}),n},n.prototype.countVisibleNodes=function(){var t,n=this,i=0;return Object.keys(n.children).forEach(function(r){t=n.children[r],e(t.getNode()).attr("hidden")||i++}),i},n.prototype.countVisible=function(){var e=this,t=0;return Object.keys(e.children).forEach(function(n){e.children[n].isVisible()&&t++}),t},n.prototype.getNode=function(){return this.node},n.prototype.getAttachedNode=function(){return this.attachedNode},n.prototype.setNode=function(e){this.node=e},n.prototype.attachNode=function(e){this.attachedNode=e},n.prototype.setOptions=function(e){return this.options=e,this},n.prototype.getOptions=function(){return this.options},n.prototype.render=function(){function t(e,n,i){var r=e.replace(new RegExp("\\%"+n+"\\$s","g"),i);return pipes={replace:function(e,n){return t(r,e,n),pipes},get:function(){return r}},pipes}function n(e,i,r){var o="",a=Object.keys(i.children);return r=r||!1,a.forEach(function(e){o+=n("super-guacamole__menu__child",i.children[e])}),t(r?d:c,1,e+" menu-item"+(0<a.length?" menu-item-has-children":"")).replace(2,i.href).replace(3,i.title).replace(4,0<a.length?o:"").replace(5,i.id).get().replace('<ul class="sub-menu"></ul>',"")}function i(e){var t="";return Object.keys(e).forEach(function(i){t+=n("super-guacamole__menu",e[i])}),t}var r,o=this,c=o.templates.menu,d=o.templates.child,a=o.$container;o.options.$menu;return 0<a.length&&(a.append(i([o])),a.find(".super-guacamole__menu__child").each(function(){$current_el=e(this),id=e(this).attr("id"),r=a.find("#"+id.replace("sg-","")),0===r.length&&(r=a.find("."+id.replace("sg-",""))),0<r.length&&o.map(id,function(e){return e.attachNode(r),e.setNode($current_el),e})})),this},n.extract=function(t){function i(e){var t="",n=null,i=/menu\-item\-[0-9]+/i;return e.attr("class").split(" ").forEach(function(e){n=i.exec(e),null!==n&&(t=n[0])}),t}var r,o,c,d,a={};return t.each(function(t,u){r=e(u),o=r.find("a:first"),menuId=r.attr("id"),"undefined"==typeof menuId&&(menuId=i(r)),c=new n({id:"sg-"+menuId,href:o.attr("href"),title:o.get(0).childNodes[0].data}),c.attachNode(r),-1<r.children(".sub-menu").length&&(subMenu=n.extract(r.children(".sub-menu").children(".menu-item")),Object.keys(subMenu).forEach(function(e){d=subMenu[e],c.set(d)})),a[c.id]=c}),a},n.prototype.attachedNodesFit=function(){var t,n,i=this,r=0,o=0,c=e(e(".header-container > .container").length>0?".header-container > .container":".header-container > div"),d=i.$container.outerWidth(!0)-i.$container.find(".super-guacamole__menu").outerWidth(!0)-(parseInt(c.css("padding-left"),10)+parseInt(c.css("padding-right"),10))/2;return Object.keys(i.children).forEach(function(r){n=i.children[r],$attachedNode=e(n.getAttachedNode()),t=e(n.getNode()),$attachedNode.removeAttr("hidden"),t.attr("hidden",!0)}
2),Object.keys(i.children).forEach(function(c){n=n=i.children[c],$attachedNode=e(n.getAttachedNode()),t=e(n.getNode()),o=$attachedNode.outerWidth(!0),o>0&&$attachedNode.data("width",o),r+=$attachedNode.data("width"),r>d&&($attachedNode.attr("hidden",!0),t.removeAttr("hidden"))}),!0},n.prototype.menuFit=function(t){var n,i=this,r={removeAttr:function(e,t){return e.removeAttr(t)},attr:function(e,t){return e.attr(t,!0)}},o="removeAttr",c=i.options.threshold||768;return t=t||!1,0===i.countVisibleNodes()&&(o="attr"),e(window).width()<=c-1&&(o="attr",Object.keys(i.children).forEach(function(t){n=i.children[t],$attachedNode=e(n.getAttachedNode()),$node=e(n.getNode()),$attachedNode.removeAttr("hidden"),$node.attr("hidden",!0)})),t||r[o](i.$container.find(".super-guacamole__menu"),"hidden"),"removeAttr"===o},n.prototype.watch=function(t){function n(){r.attachedNodesFit(),r.menuFit()}function i(e){var t;return function(i){function r(){n(),timeout=null}t&&clearTimeout(t),t=setTimeout(r,e)}}var r=this;return(t=t||!1)?(n(),r):(e(window).on("resize",i(10)),e(window).on("orientationchange",i(10)),r)},e.fn.superGuacamole=function(t){var r,o,c,d,a=e(this),u=a.find("#main-menu");r={threshold:544,minChildren:3,childrenFilter:"li",menuTitle:"&middot;&middot;&middot;",menuUrl:"#",templates:i},o=e.extend(r,t),c=u.children(o.childrenFilter+":not(.super-guacamole__menu):not(.super-guacamole__menu__child)"),d=new n({title:o.menuTitle,href:o.menuUrl,templates:o.templates,children:n.extract(c),container:u}),o.$menu=u,d.setOptions(o).render().watch(!0).watch()}}(jQuery);
3
4(function( $ ) {
5	
6	"use strict";
7
8	CherryJsCore.utilites.namespace( 'theme_script' );
9	CherryJsCore.theme_script = {
10		init: function() {
11			// Document ready event check
12			if ( CherryJsCore.status.is_ready ) {
13				this.document_ready_render();
14			} else {
15				CherryJsCore.variable.$document.on( 'ready', this.document_ready_render.bind( this ) );
16			}
17
18			// Windows load event check
19			if ( CherryJsCore.status.on_load ) {
20				this.window_load_render();
21			} else {
22				CherryJsCore.variable.$window.on( 'load', this.window_load_render.bind( this ) );
23			}
24		},
25
26		document_ready_render: function() {
27			// post-formats
28			this.post_formats_custom_init( this );
29			// widgets
30			this.smart_slider_init( this );
31			this.swiper_carousel_init( this );
32			this.playlist_slider_widget_init( this );
33			this.news_smart_box_init( this );
34			// menus
35			this.navbar_init( this );
36			this.main_menu( this, $( '.main-navigation' ) );
37			this.mega_menu( this );
38			this.mobile_menu( this );
39			this.vertical_menu_init( this );
40			// plugins
41			this.add_project_inline_style( this );
42			this.single_team( this );
43			this.elementor_open_first_toggle( this );
44			// anchor-navigation
45			this.anchor_navigation( this );
46			this.anchor_scrolling_navigation( this );
47			// misc
48			this.to_top_init( this );
49			this.header_search( this );
50			this.big_image_class( this );
51			this.ofi_init( this );
52			this.tilter( this );
53			this.replyLinkScroll( this );
54		},
55
56		window_load_render: function() {
57			this.page_preloader_init( this );
58		},
59
60		mobile_breakpoint: 600,
61
62		anchor_navigation: function ( self ) {
63			$( '.page-template-landing div:not(.woocommerce-tabs) a[href*=#]:not([href=#])' ).on( 'click', function() {
64
65				var $window = CherryJsCore.variable.$window,
66					width = $window.outerWidth( true ),
67					$menuToggle = $( '.main-menu-toggle[aria-controls="main-menu"]' );
68
69				if ( self.mobile_breakpoint > width ) {
70					$menuToggle.trigger( 'click.mobileMenuToggle' );
71				}
72
73				if ( location.pathname.replace( /^\//, '' ) === this.pathname.replace( /^\//, '' ) || location.hostname === this.hostname ) {
74					var target     = $( this.hash ),
75						targetLink = this.hash,
76						$correctionSelector = ( self.mobile_breakpoint <= width ) ? $( '#main-menu' ) : $( '.mobile-panel' ),
77						menuHeight = $correctionSelector.outerHeight(true);
78
79					target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) + ']' );
80
81					if ( target.length ) {
82						$( 'html, body' ).animate( {
83							scrollTop: target.offset().top - menuHeight
84						}, 1000 );
85
86						return false;
87					}
88				}
89			});
90		},
91
92		anchor_scrolling_navigation: function ( self ) {
93
94			var $document   = $( document ),
95				top         = null,
96				changed     = false,
97				currentHash = null,
98				sections    = null,
99				timeout     = null,
100				interval    = null,
101				menuHeight  = $( '#main-menu' ).outerHeight(true),
102				$sections   = $( '.tm_pb_anchor' );
103
104			sections = getSections();
105
106
107			$( window ).on( 'scroll.cherry_anchor_navigation', function () {
108				var newTop  = $document.scrollTop();
109
110				changed = newTop != top;
111
112				if ( changed ) {
113					top = newTop;
114				}
115			});
116
117			$( window ).on( 'resize.cherry_anchor_navigation', function () {
118				sections = getSections();
119			});
120
121			function getSections() {
122				sections = $.map( $sections, function ( event ) {
123					var $event = $( event ),
124						position = $event.position();
125
126					return {
127						top: position.top - menuHeight,
128						bottom: position.top + $event.outerHeight( true ) - menuHeight,
129						hash: $event.attr( 'id' )
130					};
131				});
132
133				return sections;
134
135			}
136
137			function iteration() {
138
139				var sectionsLength = sections.length,
140					section,
141					scrollTop;
142
143				while ( section = sections[--sectionsLength] ) {
144
145					if ( section.top >= top || section.bottom <= top ) {
146						continue;
147					}
148
149					if ( currentHash == section.hash ) {
150						break;
151					}
152
153					currentHash = section.hash;
154					history.pushState( null, null, '#' + section.hash );
155				}
156			}
157
158			timeout = setTimeout( function (){
159				interval = setInterval( iteration, 250 );
160			}, 250 );
161		},
162
163		smart_slider_init: function( self ) {
164			$( '.johnnygo-smartslider' ).each( function() {
165				var slider = $( this ),
166					sliderId = slider.data( 'id' ),
167					sliderWidth = slider.data( 'width' ),
168					sliderHeight = slider.data( 'height' ),
169					sliderOrientation = slider.data( 'orientation' ),
170					slideDistance = slider.data( 'slide-distance' ),
171					slideDuration = slider.data( 'slide-duration' ),
172					sliderFade = slider.data( 'slide-fade' ),
173					sliderNavigation = slider.data( 'navigation' ),
174					sliderFadeNavigation = slider.data( 'fade-navigation' ),
175					sliderPagination = slider.data( 'pagination' ),
176					sliderAutoplay = slider.data( 'autoplay' ),
177					sliderFullScreen = slider.data( 'fullscreen' ),
178					sliderShuffle = slider.data( 'shuffle' ),
179					sliderLoop = slider.data( 'loop' ),
180					sliderThumbnailsArrows = slider.data( 'thumbnails-arrows' ),
181					sliderThumbnailsPosition = slider.data( 'thumbnails-position' ),
182					sliderThumbnailsWidth = slider.data( 'thumbnails-width' ),
183					sliderThumbnailsHeight = slider.data( 'thumbnails-height' );
184
185				if ( $( '.smart-slider__items', '#' + sliderId ).length > 0 ) {
186					$( '#' + sliderId ).sliderPro( {
187						width: sliderWidth,
188						height: sliderHeight,
189						orientation: sliderOrientation,
190						slideDistance: slideDistance,
191						slideAnimationDuration: slideDuration,
192						fade: sliderFade,
193						arrows: sliderNavigation,
194						fadeArrows: sliderFadeNavigation,
195						buttons: sliderPagination,
196						autoplay: sliderAutoplay,
197						fullScreen: sliderFullScreen,
198						shuffle: sliderShuffle,
199						loop: sliderLoop,
200						waitForLayers: false,
201						thumbnailArrows: sliderThumbnailsArrows,
202						thumbnailsPosition: sliderThumbnailsPosition,
203						thumbnailWidth: sliderThumbnailsWidth,
204						thumbnailHeight: sliderThumbnailsHeight,
205						init: function() {
206							$( this ).resize();
207						},
208						sliderResize: function( event ) {
209							var thisSlider = $( '#' + sliderId ),
210								slides = $( '.sp-slide', thisSlider );
211
212							slides.each( function() {
213
214								if ( $( '.sp-title a', this ).width() > $( this ).width() ) {
215									$( this ).addClass( 'text-wrapped' );
216								} else {
217									$( this ).removeClass( 'text-wrapped' );
218								}
219
220							} );
221						},
222						breakpoints: {
223							899: {
224								height: parseFloat( sliderHeight ) * 0.75
225							},
226							599: {
227								height: parseFloat( sliderHeight ) * 0.5,
228								thumbnailsPosition: ( 'top' === this.thumbnailsPosition ) ? 'top' : 'bottom',
229								thumbnailHeight: parseFloat( sliderThumbnailsHeight ) * 0.75,
230								thumbnailWidth: parseFloat( sliderThumbnailsWidth ) * 0.75
231							}
232						}
233					} );
234				}
235			} );//each end
236		},
237
238		swiper_carousel_init: function( self ) {
239
240			$( '.tm-products-carousel-widget-container' ).each( function() {
241				var swiper             = null,
242					uniqId             = $( this ).data( 'uniq-id' ),
243					slidesPerView      = parseFloat( $( this ).data( 'slides-per-view' ) ),
244					slidesPerGroup     = parseFloat( $( this ).data( 'slides-per-group' ) ),
245					slidesPerColumn    = parseFloat( $( this ).data( 'slides-per-column' ) ),
246					spaceBetweenSlides = parseFloat( $( this ).data( 'space-between-slides' ) ),
247					durationSpeed      = parseFloat( $( this ).data( 'duration-speed' ) ),
248					swiperLoop         = $( this ).data( 'swiper-loop' ),
249					freeMode           = $( this ).data( 'free-mode' ),
250					grabCursor         = $( this ).data( 'grab-cursor' ),
251					mouseWheel         = $( this ).data( 'mouse-wheel' ),
252					breakpointsList    = {
253						992: {
254							slidesPerView: Math.ceil( slidesPerView * 0.75 ),
255							spaceBetween:  Math.ceil( spaceBetweenSlides * 0.75 )
256						},
257						768: {
258							slidesPerView: Math.ceil( slidesPerView * 0.5 ),
259							spaceBetween:  Math.ceil( spaceBetweenSlides * 0.5 )
260						},
261						480: {
262							slidesPerView: Math.ceil( slidesPerView * 0.25 ),
263							spaceBetween:  Math.ceil( spaceBetweenSlides * 0.25 )
264						}
265					},
266					customBreakpoints  = $( this ).data( 'custom-breakpoints' );
267
268				if ( '' !== customBreakpoints && 'object' === typeof customBreakpoints ) {
269					breakpointsList = customBreakpoints;
270				}
271
272				swiper = new Swiper( '#' + uniqId, {
273						slidesPerView:       slidesPerView,
274						slidesPerGroup:      slidesPerGroup,
275						slidesPerColumn:     slidesPerColumn,
276						spaceBetween:        spaceBetweenSlides,
277						speed:               durationSpeed,
278						loop:                swiperLoop,
279						freeMode:            freeMode,
280						grabCursor:          grabCursor,
281						mousewheelControl:   mouseWheel,
282						paginationClickable: true,
283						nextButton:          '#' + uniqId + '-next',
284						prevButton:          '#' + uniqId + '-prev',
285						pagination:          '#' + uniqId + '-pagination',
286						//threshold:           5,
287						onInit:              function() {
288							$( '#' + uniqId + '-next' ).css( {
289								'display': 'block'
290							} );
291							$( '#' + uniqId + '-prev' ).css( {
292								'display': 'block'
293							} );
294						},
295						breakpoints: breakpointsList
296					}
297				);
298			} );
299
300			// Enable swiper carousels
301			jQuery( '.johnnygo-carousel' ).each( function() {
302				var swiper = null,
303					uniqId = jQuery( this ).data( 'uniq-id' ),
304					slidesPerView = parseFloat( jQuery( this ).data( 'slides-per-view' ) ),
305					slidesPerGroup = parseFloat( jQuery( this ).data( 'slides-per-group' ) ),
306					slidesPerColumn = parseFloat( jQuery( this ).data( 'slides-per-column' ) ),
307					spaceBetweenSlides = parseFloat( jQuery( this ).data( 'space-between-slides' ) ),
308					durationSpeed = parseFloat( jQuery( this ).data( 'duration-speed' ) ),
309					swiperLoop = jQuery( this ).data( 'swiper-loop' ),
310					freeMode = jQuery( this ).data( 'free-mode' ),
311					grabCursor = jQuery( this ).data( 'grab-cursor' ),
312					mouseWheel = jQuery( this ).data( 'mouse-wheel' ),
313					breakpointsSettings = {
314						1199: {
315							slidesPerView: Math.floor( slidesPerView * 0.75 ),
316							spaceBetween: Math.floor( spaceBetweenSlides * 0.75 )
317						},
318						899: {
319							slidesPerView: Math.floor( slidesPerView * 0.5 ),
320							spaceBetween: Math.floor( spaceBetweenSlides * 0.5 )
321						},
322						599: {
323							slidesPerView: ( 0 !== Math.floor( slidesPerView * 0.25 ) ) ? Math.floor( slidesPerView * 0.25 ) : 1
324						}
325					};
326
327				if ( 1 == slidesPerView ) {
328					breakpointsSettings = {}
329				}
330
331				var swiper = new Swiper( '#' + uniqId, {
332						slidesPerView: slidesPerView,
333						slidesPerGroup: slidesPerGroup,
334						slidesPerColumn: slidesPerColumn,
335						spaceBetween: spaceBetweenSlides,
336						speed: durationSpeed,
337						loop: swiperLoop,
338						freeMode: freeMode,
339						grabCursor: grabCursor,
340						mousewheelControl: mouseWheel,
341						paginationClickable: true,
342						nextButton: '#' + uniqId + '-next',
343						prevButton: '#' + uniqId + '-prev',
344						pagination: '#' + uniqId + '-pagination',
345						onInit: function() {
346							$( '#' + uniqId + '-next' ).css( { 'display': 'block' } );
347							$( '#' + uniqId + '-prev' ).css( { 'display': 'block' } );
348						},
349						breakpoints: breakpointsSettings
350					}
351				);
352			} );
353		},
354
355		post_formats_custom_init: function( self ) {
356			CherryJsCore.variable.$document.on( 'cherry-post-formats-custom-init', function( event ) {
357
358				if ( 'slider' !== event.object ) {
359					return;
360				}
361
362				var uniqId = '#' + event.item.attr( 'id' ),
363					settings = event.item.data( 'init' ),
364					swiper = new Swiper( uniqId, {
365						pagination: uniqId + ' .swiper-pagination',
366						paginationClickable: true,
367						nextButton: uniqId + ' .swiper-button-next',
368						prevButton: uniqId + ' .swiper-button-prev',
369						spaceBetween: 0,
370						loop: settings['loop'],
371						onInit: function() {
372							if ( settings['arrows'] ) {
373								$( uniqId + ' .swiper-button-next' ).css( { 'display': 'block' } );
374								$( uniqId + ' .swiper-button-prev' ).css( { 'display': 'block' } );
375							}
376							if ( settings['buttons'] ) {
377								$( uniqId + ' .swiper-pagination' ).css( { 'display': 'block' } );
378							}
379						}
380					} );
381
382				event.item.data( 'initalized', true );
383			} );
384		},
385
386		navbar_init: function( self ) {
387
388			$( window ).load( function() {
389
390				var $navbar = $( '.header-container' );
391
392				if ( !$.isFunction( jQuery.fn.stickUp ) || undefined === window.johnnygo.stickUp || !$navbar.length ) {
393					return !1;
394				}
395
396				$navbar.stickUp( {
397					correctionSelector: '#wpadminbar',
398					listenSelector: '.listenSelector',
399					pseudo: true,
400					active: true
401				} );
402				CherryJsCore.variable.$document.trigger( 'scroll.stickUp' );
403
404			} );
405		},
406
407		isMegaMenuEnabled: function() {
408
409			if ( undefined === window.johnnygo.megaMenu ) {
410				return false;
411			}
412
413			if ( true === window.johnnygo.megaMenu.isActive && 'main' == window.johnnygo.megaMenu.location ) {
414				return true;
415			}
416
417			return false;
418		},
419
420		main_menu: function( self, $mainNavigation ) {
421
422			if ( self.isMegaMenuEnabled() ) {
423				//return;
424			}
425
426			var transitionend = 'transitionend oTransitionEnd webkitTransitionEnd',
427				moreMenuContent = '&middot;&middot;&middot;',
428				imgurl = '',
429				srcset = '',
430				hasimg = false,
431				hasicon = false,
432				hasprop = Object.prototype.hasOwnProperty,
433				$menuToggle = $( '.main-menu-toggle[aria-controls="main-menu"]', $mainNavigation ),
434				liWithChildren = 'li.menu-item-has-children, li.page_item_has_children',
435				$body = $( 'body' ),
436				$parentNode,
437				menuItem,
438				subMenu,
439				index = -1,
440				$layout = window.johnnygo.labels.header_layout;
441
442			if ( hasprop.call( window, 'johnnygo' ) &&
443				hasprop.call( window.johnnygo, 'more_button_options' ) &&
444				hasprop.call( window.johnnygo.more_button_options, 'more_button_type' ) ) {
445				switch ( window.johnnygo.more_button_options.more_button_type ) {
446					case 'image':
447						imgurl = window.johnnygo.more_button_options.more_button_image_url;
448						if ( window.johnnygo.more_button_options.retina_more_button_image_url ) {
449							srcset = ' srcset="' + window.johnnygo.more_button_options.retina_more_button_image_url + ' 2x"';
450						}
451						moreMenuContent = '<img src="' + imgurl + '"' + srcset + ' alt="' + moreMenuContent + '">';
452						hasimg = true;
453						break;
454					case 'icon':
455						moreMenuContent = '<i class="nc-icon-mini ' + window.johnnygo.more_button_options.more_button_icon + '"></i>';
456						hasicon = true;
457						break;
458					case 'text':
459					default:
460						moreMenuContent = window.johnnygo.more_button_options.more_button_text || moreMenuContent;
461						hasimg = false;
462						hasicon = false;
463						break;
464				}
465			}
466
467			if ( 'style-3' !== $layout && 'style-7' !== $layout ) {
468				$mainNavigation.superGuacamole( {
469					threshold: self.mobile_breakpoint, // Minimal menu width, when this plugin activates
470					minChildren: 3, // Minimal visible children count
471					childrenFilter: '.menu-item:not(.wpml-ls-item):not([class*="pll-"]):not(.lang-item)', // Child elements selector
472					menuTitle: moreMenuContent, // Menu title
473					menuUrl: '#',
474					templates: {
475						menu: '<li id="%5$s" class="%1$s' + ( hasimg ? ' super-guacamole__menu-with-image' : '' ) +
476						( hasicon ? ' super-guacamole__menu-with-icon' : '' ) + '"><a href="%2$s">%3$s</a><ul class="sub-menu">%4$s</ul></li>',
477						child_wrap: '<ul class="%1$s">%2$s</ul>',
478						child: '<li id="%5$s" class="%1$s"><a href="%2$s">%3$s</a><ul class="sub-menu">%4$s</ul></li>'
479					}
480				} );
481			}
482
483			function hideSubMenu( menuItem, $event ) {
484				var subMenus = menuItem.find( '.sub-menu' ),
485					subMenu = menuItem.children( '.sub-menu' ).first();
486
487				menuItem
488					.removeData( 'index' )
489					.removeClass( 'menu-hover' );
490
491				subMenus.addClass( 'in-transition' );
492
493				subMenus
494					.one( transitionend, function() {
495						subMenus.removeClass( 'in-transition' );
496					} );
497			}
498
499			function handleMenuItemHover( $event ) {
500				if ( $( 'html' ).hasClass( 'mobile-menu-active' ) ) {
501					return;
502				}
503				menuItem = $( $event.target ).parents( '.menu-item' );
504				subMenu = menuItem.children( '.sub-menu' ).first();
505
506				var subMenus = menuItem.find( '.sub-menu' );
507
508				if ( !menuItem.hasClass( 'menu-item-has-children' ) ) {
509					menuItem = $event.target.tagName === 'LI' ?
510						$( $event.target ) :
511						$( $event.target ).parents().filter( '.menu-item' );
512				}
513
514				switch ( $event.type ) {
515					case 'mouseenter':
516					case 'mouseover':
517						if ( 0 < subMenu.length ) {
518							var maxWidth = $body.outerWidth( true ),
519								subMenuOffset = subMenu.offset().left + subMenu.outerWidth( true );
520
521							menuItem.addClass( 'menu-hover' );
522							subMenus.addClass( 'in-transition' );
523
524							if ( $( 'body' ).hasClass( 'rtl' ) ) {
525								if ( 0 > subMenu.offset().left ) {
526									subMenu.addClass( 'inverse-side' );
527									subMenu.find( '.sub-menu' ).addClass( 'inverse-side' );
528								} else if ( maxWidth <= subMenuOffset ) {
529									subMenu.removeClass( 'inverse-side' );
530									subMenu.find( '.sub-menu' ).removeClass( 'inverse-side' );
531								}
532
533							} else {
534								if ( maxWidth <= subMenuOffset ) {
535									subMenu.addClass( 'inverse-side' );
536									subMenu.find( '.sub-menu' ).addClass( 'inverse-side' );
537								} else if ( 0 > subMenu.offset().left ) {
538									subMenu.removeClass( 'inverse-side' );
539									subMenu.find( '.sub-menu' ).removeClass( 'inverse-side' );
540								}
541							}
542
543							subMenus
544								.one( transitionend, function() {
545									subMenus.removeClass( 'in-transition' );
546								} );
547						}
548						break;
549					case 'mouseleave':
550					case 'mouseout':
551						hideSubMenu( menuItem, $event );
552						break;
553				}
554			}
555
556			CherryJsCore.variable.$window.on( 'orientationchange resize', function() {
557				if ( $( 'html' ).hasClass( 'mobile-menu-active' ) ) {
558					return;
559				}
560				$mainNavigation.find( '.menu-item' ).removeClass( 'menu-hover' );
561				$mainNavigation.find( '.sub-menu.inverse-side' ).removeClass( 'inverse-side' );
562			} );
563
564			$( liWithChildren ).hoverIntent( {
565				over: function() {
566				},
567				out: function() {
568				},
569				timeout: 300,
570				selector: '.menu-item'
571			} );
572
573			$mainNavigation.on( 'mouseenter mouseover mouseleave mouseout', '.menu-item', handleMenuItemHover );
574
575			function doubleClickMenu( $jqEvent ) {
576				$parentNode = $( this );
577
578				if ( $( 'html' ).hasClass( 'mobile-menu-active' ) ) {
579					return true;
580				}
581
582				var menuIndex = $parentNode.index();
583
584				if ( menuIndex !== parseInt( $parentNode.data( 'index' ), 10 ) ) {
585					$jqEvent.preventDefault();
586				}
587
588				$parentNode.data( 'index', menuIndex );
589			}
590
591			// Check if touch events supported
592			if ( 'ontouchend' in window ) {
593
594				// Attach event listener for double click
595				$( liWithChildren, $mainNavigation )
596					.on( 'click', doubleClickMenu );
597
598				// Reset index on touchend event
599				CherryJsCore.variable.$document.on( 'touchend', function( $jqEvent ) {
600					if ( !$( 'html' ).hasClass( 'mobile-menu-active' ) ) {
601						$parentNode = $( $jqEvent.target ).parents().filter( '.menu-item:first' );
602
603						if ( $parentNode.hasClass( 'menu-hover' ) === false ) {
604							hideSubMenu( $parentNode, $jqEvent );
605
606							index = $parentNode.data( 'index' );
607
608							if ( index ) {
609								$parentNode.data( 'index', parseInt( index, 10 ) - 1 );
610							}
611						}
612					}
613				} );
614			}
615
616			$menuToggle.on( 'click', function( $event ) {
617				$event.preventDefault();
618				$mainNavigation.toggleClass( 'toggled' );
619			} );
620		},
621
622		mobile_menu: function( self ) {
623
624			var $mainNavigation = $( '.main-navigation' ),
625				$menuToggle = $( '.main-menu-toggle[aria-controls="main-menu"]' );
626
627			$mainNavigation
628				.find( 'li.menu-item-has-children > a' )
629				.append( '<span class="sub-menu-toggle"></span>' );
630
631			/**
632			 * Debounce the function call
633			 *
634			 * @param  {number}   threshold The delay.
635			 * @param  {Function} callback  The function.
636			 */
637			function debounce( threshold, callback ) {
638				var timeout;
639
640				return function debounced( $event ) {
641					function delayed() {
642						callback.call( this, $event );
643						timeout = null;
644					}
645
646					if ( timeout ) {
647						clearTimeout( timeout );
648					}
649
650					timeout = setTimeout( delayed, threshold );
651				};
652			}
653
654			/**
655			 * Resize event handler.
656			 *
657			 * @param {jqEvent} jQuery event.
658			 */
659
660			function resizeHandler( $event ) {
661				if ( !$( 'body' ).hasClass( 'jet-mobile-menu-active' ) ) {
662					var $window = CherryJsCore.variable.$window,
663						width = $window.outerWidth( true );
664					if ( self.mobile_breakpoint <= width ) {
665						$mainNavigation.removeClass( 'mobile-menu' );
666					} else {
667						$mainNavigation.addClass( 'mobile-menu' );
668					}
669				}
670			}
671
672			/**
673			 * Toggle sub-menus.
674			 *
675			 * @param  {jqEvent} $event jQuery event.
676			 */
677			function toggleSubMenuHandler( $event ) {
678
679				$event.preventDefault();
680
681				$( this ).toggleClass( 'active' );
682				$( this ).parents().filter( 'li:first' ).toggleClass( 'sub-menu-open' );
683			}
684
685			/**
686			 * Toggle menu.
687			 *
688			 * @param  {jqEvent} $event jQuery event.
689			 */
690			function toggleMenuHandler( $event ) {
691				var $toggle = $( '.sub-menu-toggle' );
692
693				if ( !$event.isDefaultPrevented() ) {
694					$event.preventDefault();
695				}
696
697				setTimeout( function() {
698					if ( !$mainNavigation.hasClass( 'animate' ) ) {
699						$mainNavigation.addClass( 'animate' );
700					}
701					$mainNavigation.toggleClass( 'show' );
702					$( 'html' ).toggleClass( 'mobile-menu-active' );
703				}, 10 );
704
705				$menuToggle.toggleClass( 'toggled' );
706				$menuToggle.attr( 'aria-expanded', !$menuToggle.hasClass( 'toggled' ) );
707
708				if ( $toggle.hasClass( 'active' ) ) {
709					$toggle.removeClass( 'active' );
710					$mainNavigation.find( '.sub-menu-open' ).removeClass( 'sub-menu-open' );
711				}
712			}
713
714			resizeHandler();
715			CherryJsCore.variable.$window.on( 'resize orientationchange', debounce( 500, resizeHandler ) );
716			$( '.sub-menu-toggle', $mainNavigation ).on( 'click', toggleSubMenuHandler );
717			$menuToggle.on( 'click.mobileMenuToggle', toggleMenuHandler );
718		},
719
720		mega_menu: function( self ) {
721
722			/**
723			 * Mega-menu mobile SubMenu Toggled.
724			 */
725			function megaMenuSubMenuToggled() {
726				$( this ).toggleClass( 'active' );
727			}
728
729			// ADD to Mega-menu sub-menu toggle active class.
730			$( '.mega-menu-mobile-arrow' ).on( 'click', megaMenuSubMenuToggled );
731		},
732
733		page_preloader_init: function( self ) {
734
735			if ( $( '.page-preloader-cover' )[0] ) {
736				$( '.page-preloader-cover' ).delay( 500 ).fadeTo( 500, 0, function() {
737					$( this ).remove();
738				} );
739			}
740		},
741
742		to_top_init: function( self ) {
743			if ( $.isFunction( jQuery.fn.UItoTop ) && undefined !== window.johnnygo.toTop ) {
744				$().UItoTop( {
745					text: johnnygo.labels.totop_button,
746					scrollSpeed: 600
747				} );
748			}
749		},
750
751		ofi_init: function( self ) {
752			if ( $( 'body' ).hasClass( 'ie' ) && 'undefined' !== typeof objectFitImages ) {
753				objectFitImages();
754			}
755		},
756
757		playlist_slider_widget_init: function( self ) {
758			$( '.widget-playlist-slider .playlist-slider' ).each( function() {
759				var $this = $( this ),
760					settings = $this.data( 'settings' ),
761					breakpoints = JSON.parse( settings.breakpoints );
762
763				$this.sliderPro( {
764					autoplay: false,
765					width: settings['width'],
766					height: parseInt( settings['height'] ),
767					orientation: 'vertical',
768					waitForLayers: false,
769					touchSwipe: false,
770					updateHash: false,
771					arrows: settings['arrows'],
772					buttons: settings['buttons'],
773					thumbnailArrows: settings['thumbnailArrows'],
774					thumbnailsPosition: settings['thumbnailsPosition'],
775					thumbnailPointer: true,
776					thumbnailWidth: settings['thumbnailWidth'],
777					thumbnailHeight: settings['thumbnailHeight'],
778					breakpoints: breakpoints,
779					init: function() {
780						$this.resize().fadeTo( 0, 1 );
781					},
782					gotoSlideComplete: function( event ) {
783						var prevSlide = $( '.sp-slide', $this ).eq( event.previousIndex ),
784							iframe = prevSlide.find( 'iframe' ),
785							html5Video = prevSlide.find( 'video' );
786
787						if ( iframe[0] ) {
788							var iframeSrc = iframe.attr( 'src' );
789
790							iframe.attr( 'src', iframeSrc );
791						} else if ( html5Video[0] ) {
792							html5Video[0].stop();
793						}
794					}
795				} );
796			} );
797		},
798
799		news_smart_box_init: function( self ) {
800			jQuery( '.news-smart-box__instance' ).each( function() {
801				var uniqId = $( this ).data( 'uniq-id' ),
802					instanceSettings = $( this ).data( 'instance-settings' ),
803					instance = $( '#' + uniqId ),
804					$termItem = $( '.news-smart-box__navigation-terms-list-item', instance ),
805					$currentTerm = $( '.news-smart-box__navigation-title', instance ),
806					$listContainer = $( '.news-smart-box__wrapper', instance ),
807					$ajaxPreloader = $( '.nsb-spinner', instance ),
808					$termsList = $( '.news-smart-box__navigation-terms-list', instance ),
809					$menuToggle = $( '.menu-toggle', instance ),
810					ajaxGetNewInstance = null,
811					ajaxGetNewInstanceSuccess = true,
812					showNewItems = null;
813
814				$termItem.each( function() {
815					var slug = $( this ).data( 'slug' );
816
817					if ( 'category' === instanceSettings.terms_type ) {
818						if ( slug === instanceSettings.current_category ) {
819							$( this ).addClass( 'is-active' );
820						}
821					} else {
822						if ( slug === instanceSettings.current_tag ) {
823							$( this ).addClass( 'is-active' );
824						}
825					}
826				} );
827
828				$menuToggle.on( 'click', function( $jqEvent ) {
829					$jqEvent.preventDefault();
830					$menuToggle.toggleClass( 'news-smart-box__navigation-toggle--open' );
831					$termsList.toggleClass( 'news-smart-box__navigation-terms-list--open' );
832				} );
833
834				$termItem.on( 'click', function() {
835					var slug = $( this ).data( 'slug' ),
836						data = {
837							action: 'new_smart_box_instance',
838							nonce: johnnygo.new_smart_box_nonce,
839							value_slug: slug,
840							instance_settings: instanceSettings
841						},
842						currentTermName = $( this ).text(),
843						counter = 0;
844
845					if ( !$( this ).hasClass( 'is-active' ) ) {
846						$termItem.removeClass( 'is-active' );
847						$( this ).addClass( 'is-active' );
848					}
849
850					$currentTerm.html( currentTermName );
851
852					if ( ajaxGetNewInstance !== null ) {
853						ajaxGetNewInstance.abort();
854					}
855					ajaxGetNewInstance = $.ajax( {
856						type: 'GET',
857						url: johnnygo.ajaxurl,
858						data: data,
859						cache: false,
860						beforeSend: function() {
861							ajaxGetNewInstanceSuccess = false;
862							$ajaxPreloader.css( { 'display': 'block' } ).fadeTo( 300, 1 );
863						},
864						success: function( response ) {
865							ajaxGetNewInstanceSuccess = true;
866
867							$ajaxPreloader.fadeTo( 300, 0, function() {
868								$( this ).css( { 'display': 'none' } );
869							} );
870
871							$( '.news-smart-box__listing', $listContainer ).html( response );
872
873							counter = 0;
874							$( '.news-smart-box__item-inner', $listContainer ).addClass( 'animate-cycle-sh
874ow' );
875							$( '.news-smart-box__item', $listContainer ).each( function() {
876								showItem( $( this ), 100 * parseInt( counter ) + 200 );
877								counter++;
878							} )
879
880						}
881					} );
882
883				} );
884
885				var showItem = function( itemList, delay ) {
886					var timeOutInterval = setTimeout( function() {
887						$( '.news-smart-box__item-inner', itemList ).removeClass( 'animate-cycle-show' );
888					}, delay );
889				}
890			} );
891		},
892		header_search: function( self ) {
893			var $header = $( '.site-header' ),
894				$searchToggle = $( '.search-form__toggle, .search-form__close', $header ),
895				$headerSearch = $( '.header-search', $header ),
896				$searchInput = $( '.search-form__field', $headerSearch ),
897				searchHandler = function( event ) {
898					$header.toggleClass( 'search-active' );
899					if ( $header.hasClass( 'search-active' ) ) {
900						$searchInput.focus();
901					}
902				},
903				removeActiveClass = function( event ) {
904					if ( $( event.target ).closest( $searchToggle ).length || $( event.target ).closest( $headerSearch ).length ) {
905						return;
906					}
907
908					if ( $header.hasClass( 'search-active' ) ) {
909						$header.removeClass( 'search-active' );
910					}
911
912					event.stopPropagation();
913				};
914
915			$searchToggle.on( 'click', searchHandler );
916			CherryJsCore.variable.$document.on( 'click', removeActiveClass );
917
918		},
919		vertical_menu_init: function( self ) {
920			var $mainNavigation = $( '.main-navigation.vertical-menu' ),
921				$mainMenu = $( '.menu', $mainNavigation ),
922				$back = $( '.back', $mainNavigation ),
923				$close = $( '.close', $mainNavigation ),
924				currentTranslate = parseInt( $mainMenu.css( 'transform' ) ),
925				isAnimate = false;
926
927			resizeHandler();
928			CherryJsCore.variable.$window.on( 'resize', resizeHandler );
929
930			function resizeHandler( event ) {
931				var $window = CherryJsCore.variable.$window,
932					width = $window.outerWidth( true );
933
934				if ( self.mobile_breakpoint > width ) {
935					$mainNavigation.removeClass( 'vertical-menu' );
936
937					$( '.vertical-menu-toggle' ).off( 'click.open', openHandler );
938					$( '.menu-item-has-children > a', $mainNavigation ).off( 'click.active', clickHandler );
939					$back.off( 'click.back', backHandler );
940					$close.off( 'click.close', closeHandler );
941					$mainMenu.removeClass( 'scroll' );
942
943					$( '.main-navigation .menu' ).css( 'transform', 'translateX(0)' );
944
945				} else {
946					$mainNavigation.addClass( 'vertical-menu' );
947					$( '.vertical-menu-toggle' ).off( 'click.open', openHandler ).on( 'click.open', openHandler );
948					$( '.menu-item-has-children > a', $mainNavigation ).off( 'click.active', clickHandler ).on( 'click.active', clickHandler );
949					$back.on( 'click.back', backHandler );
950					$close.on( 'click.close', closeHandler );
951					$mainMenu.addClass( 'scroll' );
952				}
953			}
954
955			$( '.menu-item-has-children', $mainNavigation ).each( function() {
956				var $li = $( this ),
957					$link = $( '>a', $li ),
958					linkText = $link.html(),
959					linkHref = $link[0].cloneNode( true ),
960					$subMenu = $( '> .sub-menu', $li );
961				$subMenu.prepend( '<li class="parent-title"><a href="' + linkHref + '">' + linkText + '</a></li>' );
962			} );
963
964			function openHandler( event ) {
965				$( this ).toggleClass( 'toggled' );
966				if ( $mainNavigation.hasClass( 'menu-open' ) ) {
967					closeHandler();
968					return false;
969				}
970				$mainNavigation.toggleClass( 'menu-open' );
971			}
972
973			function backHandler( event ) {
974				var currentTranslate = parseFloat( ($mainMenu.css( 'transform' ).replace( /,/g, "" )).split( " " )[4] ),
975					offset = CherryJsCore.variable.$window.outerWidth( true ) / 2,
976					translate = currentTranslate + offset,
977					$active = $( '.active', $mainMenu ),
978					$lastActive = $( $active[$active.length - 1] );
979
980				if ( isAnimate ) {
981					return false;
982				}
983
984				if ( currentTranslate < 0 ) {
985					isAnimate = true;
986					$mainMenu.css( 'transform', 'translateX(' + translate + 'px)' );
987
988					if ( translate >= 0 ) {
989						translate = 0;
990						$( this ).addClass( 'hide' );
991						$close.removeClass( 'hide' );
992					}
993
994					setTimeout( function() {
995						$lastActive.removeClass( 'active' );
996						$lastActive.siblings().toggleClass( 'hide' );
997						$( '>a', $lastActive ).removeClass( 'hide' );
998						$lastActive.parent().addClass( 'scroll' );
999						isAnimate = false;
1000					}, 250 );
1001
1002				}
1003				return false;
1004			}
1005
1006			function closeHandler( event ) {
1007				if ( !isAnimate ) {
1008					$( '.active', $mainMenu ).removeClass( 'active' );
1009					$( '.hide', $mainMenu ).removeClass( 'hide' );
1010					$( '.close.hide', $mainNavigation ).removeClass( 'hide' );
1011					$back.addClass( 'hide' );
1012					$mainNavigation.removeClass( 'menu-open' );
1013					$mainMenu.css( 'transform', 'translateX(0)' );
1014				}
1015
1016				$( '.vertical-menu-toggle' ).removeClass( 'toggled' );
1017				return false;
1018			}
1019
1020			function clickHandler( event ) {
1021				var $_target = $( event.currentTarget ),
1022					offset = CherryJsCore.variable.$window.outerWidth( true ) / 2,
1023					$mainMenu = $_target.closest( '.menu' ),
1024					deep = $_target.parents( 'ul' ).length,
1025					translate = deep * offset;
1026
1027				$mainMenu.css( 'transform', 'translateX(' + -translate + 'px)' );
1028
1029				setTimeout( function() {
1030					$_target.parent().addClass( 'active' );
1031					$_target.parent().siblings().toggleClass( 'hide' );
1032					$_target.parents( '.active' ).find( '> a' ).addClass( 'hide' );
1033					$_target.siblings( 'ul' ).addClass( 'scroll' );
1034					$_target.parents( 'ul' ).removeClass( 'scroll' );
1035				}, 250 );
1036
1037				$back.removeClass( 'hide' );
1038				$close.addClass( 'hide' );
1039
1040				return false;
1041			}
1042		},
1043
1044		big_image_class: function ( self ) {
1045			var $img = $( '.entry-content p img' );
1046			$img.each( function() {
1047				var $this = $( this ),
1048					$imgWidth = $this.attr( 'width' );
1049
1050				if ( 1600 <= $imgWidth ) {
1051					$this.addClass( 'size-big' );
1052				}
1053			});
1054		},
1055
1056		add_project_inline_style: function( self ) {
1057			var $projectGridContainer = $( '.projects-container.grid-layout' ),
1058				$projectJustifiedContainer = $( '.projects-container.justified-layout' ),
1059				$projectGridTermsContainer = $( '.projects-terms-container.grid-layout' ),
1060				$projectContainer = $( '.projects-container' ),
1061
1062				addInlineStyle = function() {
1063					var $this = $( this ),
1064						$projectsSettings = $this.data( 'settings' ),
1065						$projectItemIndent = Math.ceil( +$projectsSettings['item-margin'] );
1066
1067					$this.css( {
1068						'margin-left': -$projectItemIndent / 2 + 'px',
1069						'margin-right': -$projectItemIndent / 2 + 'px'
1070					} );
1071				},
1072
1073				addTemplateClass = function() {
1074					var $this = $( this ),
1075						$projectsSettings = $this.data( 'settings' ),
1076						$projectsTemplate = $projectsSettings['template'];
1077
1078					if ( $projectsTemplate ) {
1079						$this.addClass( $projectsTemplate.replace( '.', '-' ) );
1080					}
1081				};
1082
1083			$projectGridContainer.each( addInlineStyle );
1084			$projectJustifiedContainer.each( addInlineStyle );
1085			$projectGridTermsContainer.each( addInlineStyle );
1086
1087			$projectContainer.each( addTemplateClass );
1088		},
1089
1090		single_team: function ( self ) {
1091			var avatar_style = function() {
1092				var $avatar = $( '.single-team .template-single .team-cover-image + .team-photo .avatar' ),
1093					$avatarWidth = $avatar.width();
1094
1095				$avatar.css( {
1096					'marginTop': -$avatarWidth / 2
1097				} );
1098			};
1099
1100			CherryJsCore.variable.$window.on( 'resize.singleTeam, load.singleTeam', avatar_style );
1101		},
1102
1103		elementor_open_first_toggle: function ( self ) {
1104			if ( $( '.elementor-toggle' )[0] ) {
1105				$( '.elementor-toggle' ).each( function() {
1106					$(this).find( '.elementor-toggle-title:first-child' ).addClass( 'active' ).next().show();
1107				} )
1108			}
1109		},
1110
1111		tilter: function ( self ) {
1112			[].slice.call(document.querySelectorAll('.template-media-icon-bg-2 .services-item')).forEac
1112h(function(el) { 
1113				new TiltFx(el);
1114			});
1115		},
1116
1117		replyLinkScroll: function() {
1118			var $replyLink = $( '.comment-reply-link' ),
1119				$respondForm = $ ( '#respond' );
1120
1121			if ( $replyLink[0] && $respondForm[0] ) {
1122				$replyLink.each( function() {
1123					$( this ).on( 'click', function( event ) {
1124						$( 'html, body' ).animate( {
1125							scrollTop: $respondForm.offset().top
1126						}, 500 )
1127					} );
1128				} )
1129			}
1130		}
1131	};
1132	CherryJsCore.theme_script.init();
1133
1134}( 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.