PageSourceSearch

https://linbit.com/wp-content/plugins/g-business-reviews-rating/wp/js/js.js?ver=7.0.5

js linbit.com collected 2026-10-01 10:42:59 UTC 25,107 bytes, 586 lines download raw bytes

1// JavaScript Document
2
3function google_business_reviews_rating(e, i) {
4	if (typeof e == 'undefined') {
5		var e = null;
6	}
7	else if (typeof e == 'string' && e.match(/^[\d]+$/)) {
8		e = parseInt(e);
9	}
10		
11	if (typeof i == 'undefined') {
12		var i = null;
13	}
14	else if (typeof i == 'string') {
15		i = parseInt(i.replace(/[^\d]/, ''));
16	}
17	
18	if ((typeof e == 'number' || typeof e == 'object' || typeof e == 'string') && typeof i == 'number') {
19		if (typeof e == 'object') {
20			e = jQuery('.google-business-reviews-rating').index(e);
21		}
22		else if (typeof e == 'string') {
23			e = jQuery('.google-business-reviews-rating').index(jQuery('#' + e));
24		}
25		
26		jQuery('.review-full-text:eq(0)', '.google-business-reviews-rating:eq(' + e + ') li:eq(' + i + ')').show();
27		jQuery('.review-more-link:eq(0)', '.google-business-reviews-rating:eq(' + e + ') li:eq(' + i + ')').remove();
28		return;
29	}
30
31	const observer = new IntersectionObserver(stars => {
32			stars.forEach(item => {
33				if (item.isIntersecting) {
34					item.target.classList.add('animation-start');
35					return;
36				}
37
38				item.target.classList.remove('animation-pause');
39				return;
40			});
41		}, { threshold: 0.5 }),
42		safari = (navigator.userAgent.match(/^((?!chrome|android).)*safari/i) != null);
43	
44	var stars_width_multiplier = null,
45		rating = null,
46		rating_width = null,
47		clear_styles = (jQuery('#stylesheet-none').length && jQuery('#stylesheet-none').is(':checked')),
48		star_html = false,
49		star_css = false,
50		star_inline = false,
51		star_image = null,
52		overall_link = null,
53		reviews_window = null,
54		view = null;
55
56	jQuery('.google-business-reviews-rating').each(function(index) {
57		var e = jQuery(this),
58			view = (jQuery(this).hasClass('carousel') && typeof jQuery(this).data('view') == 'number' && jQuery(this).data('view') >= 1 && jQuery(this ).data('view') <= 50) ? jQuery(this).data('view') : null,
59			star_html = (typeof jQuery(this).attr('class') == 'string' && (jQuery(this).hasClass('stars-html') || jQuery(this).attr('class').match(/\bversion[_-]?1\b/i))),
60			star_css = (!star_html && typeof jQuery(this).attr('class') == 'string' && (jQuery(this).hasClass('stars-css') || jQuery(this).hasClass('stars-gray-css'))),
61			star_inline = (!star_html && !star_css && typeof jQuery(e).data('stars') == 'string' && jQuery(e).data('stars').match(/^inline|inline$/i) != null),
62			star_color = (!star_html && !star_css && !star_inline && (typeof jQuery(e).data('stars') == 'string' || typeof jQuery(e).data('stars-gray') == 'string')),
63			stars_width_multiplier = 0.196,
64			rating = (jQuery('.number', this).length) ? parseFloat(jQuery('.number:eq(0)', this).text().replace(/,/g, '.').replace(/(\d+(?:\.\d+)?)/, '$1')) : null,
65			overall_link = (typeof jQuery(this).data('href') == 'string' && jQuery(this).data('href').length && !jQuery('.buttons', this).length && (!jQuery('.listing', this).length || jQuery('.listing', this).length && !jQuery('.listing > *', this).length)) ? jQuery(this).data('href') : null;
66		
67		if (clear_styles) {
68			jQuery(this).removeAttr('class');
69		}
70		else if ((typeof jQuery(this).attr('id') != 'string' || !jQuery(this).attr('id').length)) {
71			jQuery(this).attr('id', 'google-business-reviews-rating' + ((index > 1) ? '-' + index : ''));
72		}
73		
74		if (!clear_styles && jQuery(this).hasClass('no-styles')) {
75			jQuery(this).removeAttr('class');
76		}
77		
78		if (jQuery(this).hasClass('link')) {
79			if (overall_link != null) {
80				jQuery(this).on('click', { overall_link: overall_link }, function(event) {
81					if (!jQuery(event.target).is('a')) {
82						event.preventDefault();
83						event.stopPropagation();
84						if (event.data.overall_link.match(/^\/.*$/)) {
85							document.location.href = event.data.overall_link;
86						}
87						else {
88							reviews_window = window.open(event.data.overall_link, '_blank');
89							reviews_window.focus();
90						}
91						return false;
92					}
93				});
94			}
95			else {
96				jQuery(this).removeClass('link');
97			}
98			
99			jQuery(this).removeData('href').removeAttr('data-href');
100		}
101
102		if (this.getAttribute('data-animate') == 'immediate') {
103			this.querySelector(':scope .all-stars.animate').classList.add('animation-start');
104		}
105		else if (this.querySelector(':scope .all-stars.animate') != null) {
106			observer.observe(this.querySelector(':scope .all-stars.animate'));
107		}
108
109		if (!star_html && jQuery('.star', jQuery('.all-stars', e)).length) {
110			if (star_css) {
111				if (!jQuery('.rating-stars', e).length) {
112					jQuery('.all-stars', e).append('<span class="rating-stars star temporary" style="display: none;">.</span>');
113				}
114				
115				if (!jQuery('.star.gray', e).css('color')) {
116					jQuery('.all-stars', e).append('<span class="star gray temporary" style="display: none;">.</span>');
117				}
118				
119				if (typeof jQuery('.star.gray', e).css('color') == 'string' && !jQuery('.rating-stars', e).css('color').match(/^(?:#(?:F7B\d0\d|E7711B)|rgba?\s*\(23[12],\s*11[34],\s*2[78](?:,\s*1(?:\.0+)?)?\))$/i)) {
120					jQuery(e).data('stars', jQuery('.rating-stars', e).css('color'));
121					star_color = true;
122				}
123				
124				if (typeof jQuery('.star.gray', e).css('color') == 'string' && (!jQuery(e).hasClass('dark') && !jQuery('.star.gray', e).css('color').match(/^(?:#(?:A4A4A4|C1C1C1|C9C9C9)|rgba?\s*\(193,\s*193,\s*193(?:,\s*1(?:\.0+)?)?\))$/i) || jQuery(e).hasClass('dark') && !jQuery('.star.gray', e).css('color').match(/^(?:#B4B4B4|rgba?\s*\(180,\s*180,\s*180(?:,\s*0?\.8)?\))$/i))) {
125					jQuery(e).data('stars-gray', jQuery('.star.gray', e).css('color'));
126					star_color = true;
127				}
128				
129				if (jQuery('.temporary', jQuery('.all-stars', e)).length) {
130					jQuery('.temporary', jQuery('.all-stars', e)).remove();
131				}
132			}
133			
134			if (star_color && (typeof jQuery(e).data('stars') == 'string' && jQuery(e).data('stars').length && !jQuery(e).data('stars').match(/^#(?:F7B\d0\d|E7711B)$/i) || typeof jQuery(e).data('stars-gray') == 'string' && jQuery(e).data('stars-gray').length && !jQuery(e).data('stars-gray').match(/^#(?:A4A4A4|C1C1C1|C9C9C9)$/i))) {
135				if (star_css && (typeof jQuery(e).data('stars-gray') != 'string' || typeof jQuery(e).data('stars-gray') == 'string' && jQuery(e).data('stars-gray') == 'css') && !jQuery('.star.gray', jQuery('.all-stars', e)).length) {
136					jQuery('.all-stars', e).append('<span class="temporary" style="display: none;">.</span>');
137				}
138				
139				jQuery('.star', jQuery('.all-stars', e)).each(function() {
140					try {
141						star_image = atob(jQuery(this).css('background-image').replace(/^url\(["']data:image\/svg\+xml;charset=UTF-8;base64,(.+)["']\)$/, '$1'));
142						
143						if (typeof jQuery(e).data('stars') == 'string' && jQuery(e).data('stars').length && !jQuery(e).data('stars').match(/^#(?:F7B\d0\d|E7711B)$/i)) {
144							star_image = star_image.replace(/#(?:F7B\d0\d|E7711B)/g, jQuery(e).data('stars'));
145						}
146	
147						if (typeof jQuery(e).data('stars-gray') == 'string' && jQuery(e).data('stars-gray').length && !jQuery(e).data('stars-gray').match(/^#(?:A4A4A4|C1C1C1|C9C9C9)$/i)) {
148							star_image = star_image.replace(/#(?:A4A4A4|C1C1C1|C9C9C9)/g, jQuery(e).data('stars-gray'));
149						}
150	
151						jQuery(this).css('background-image', 'url(\'data:image\/svg+xml;charset=UTF-8;base64,' + btoa(star_image) + '\')');
152					}
153					catch (err) {
154						return;
155					}
156				});
157			}
158		}
159		
160		if (jQuery('.review-more-placeholder', e).length) {
161			jQuery('.review-more-placeholder', e).each(function(more) {
162				if (jQuery(this).siblings('.review-full-text').length && !jQuery(this).siblings('.review-full-text').html().length) {
163					jQuery(this).parent().removeClass('text-excerpt');
164					jQuery(this).siblings('.review-full-text').remove();
165					jQuery(this).remove();
166				}
167				else if (jQuery(e).hasClass('js-links')) {
168					jQuery(this).after('<a href="javascript:google_business_reviews_rating(' + index + ', ' + jQuery('li', jQuery(e)).index(jQuery(this).closest('li')) + ');" class="review-more-link">' + jQuery(this).html() + '</a>');
169					jQuery(this).remove();
170				}
171				else {
172					jQuery(this).after('<a href="#' + jQuery(e).attr('id') + '" class="review-more-link">' + jQuery(this).html() + '</a>');
173					jQuery('.review-more-link', jQuery(this).parent()).on('click', function(event) {
174						event.preventDefault();
175						event.stopPropagation();
176						jQuery(this).next('.review-full-text').show();
177						
178						if (view == null) {
179							jQuery(this).remove();
180							return false;
181						}
182	
183						jQuery(this).hide();
184						google_business_reviews_rating_carousel(this, null);
185						return false;						
186					});
187					
188					jQuery(this).remove();
189				}
190			});
191		}
192		
193		if (jQuery('.fixed-height', e).length && jQuery(e).hasClass('bubble')) {
194			jQuery('.text', e).each(function() {
195				if (jQuery(this).prev().length && (jQuery(this).prev().hasClass('author-avatar') || jQuery(this).prev().hasClass('review-meta') && (jQuery('.author-name', jQuery(this).prev()).length))) {
196					jQuery('.text', e).before('<span class="arrow arrow-up"></span>');
197					return;
198				}
199				
200				if (jQuery(this).next().length && (jQuery(this).next().hasClass('author-avatar') || jQuery(this).next().hasClass('review-meta') && (jQuery('.author-name', jQuery(this).next()).length))) {
201					jQuery('.text', e).after('<span class="arrow arrow-down"></span>');
202					return;
203				}
204            });
205		}
206		
207		if (!star_html && !star_inline && jQuery('.all-stars', e).length && jQuery('.all-stars', e).hasClass('animate') && typeof rating == 'number' && rating > 1.5 && jQuery('.number:eq(0)', e).length) {
208			jQuery('.all-stars', e)
209				.after(jQuery('<span>')
210					.addClass('all-stars')
211					.addClass('backdrop')
212					.css({
213						width: Math.ceil(jQuery('.all-stars', e).width() + 0.1) + 'px',
214						margin: (jQuery('body').hasClass('rtl')) ? '0 ' + (-1 * jQuery('.all-stars', e).width() - 0.1) + 'px 0 0' :'0 0 0 ' + (-1 * jQuery('.all-stars', e).width() - 0.1) + 'px' 
215						})
216					.html('<span class="star gray"></span><span class="star gray"></span><span class="star gray"></span><span class="star gray"></span><span class="star gray"></span>'));
217					
218			if (jQuery('.all-stars:eq(0)', e).position().top - jQuery('.all-stars.backdrop', e).position().top != 0) {
219				jQuery('.all-stars.backdrop', e).css('margin-top', (jQuery('.all-stars:eq(0)', e).position().top - jQuery('.all-stars.backdrop', e).position().top) + 'px');
220			}
221
222			if (typeof jQuery(e).data('stars-gray') == 'string' && jQuery(e).data('stars-gray').length && !jQuery(e).data('stars-gray').match(/^#(?:A4A4A4|C1C1C1|C9C9C9)$/i)) {
223				jQuery('.star', jQuery('.all-stars.backdrop', e)).each(function() {
224					try {
225						star_image = atob(jQuery(this).css('background-image').replace(/^url\(["']data:image\/svg\+xml;charset=UTF-8;base64,(.+)["']\)$/, '$1'));
226						star_image = star_image.replace(/#(?:A4A4A4|C1C1C1|C9C9C9)/g, jQuery(e).data('stars-gray'));
227						jQuery(this).css('background-image', 'url(\'data:image\/svg+xml;charset=UTF-8;base64,' + btoa(star_image) + '\')');
228					}
229					catch (err) {
230						return;
231					}
232				});
233			}
234
235			jQuery('.star:last', jQuery('.all-stars:eq(0)', e)).on('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(event) {
236				if (jQuery('.all-stars.backdrop', e).length) {
237					jQuery('.all-stars.backdrop', jQuery(this).closest('.rating')).fadeOut(300, function() { jQuery(this).remove(); });
238				}
239			});
240			
241			setTimeout(
242				function(e) {
243					if (jQuery('.all-stars.backdrop', e).length) {
244						jQuery('.all-stars.backdrop', e).fadeOut(300, function() { jQuery(this).remove(); });
245					}
246				}, 4800, jQuery('.all-stars.backdrop', e).length);
247		}
248		else if (star_html && typeof rating == 'number') {
249			if (safari) {
250				jQuery('.all-stars', e).addClass('safari');
251			}
252				
253			if (rating == 5) {
254				setTimeout(
255					function() {
256							jQuery('.all-stars', e).css('color', 'rgba(0, 0, 0, 0)');
257					}, 2400);
258			}
259			else if (rating == 0) {
260				jQuery('.rating-stars', e).remove();
261			}
262			
263			if (jQuery('.rating-stars', e) && jQuery('.all-stars', e).length) {
264				if (typeof jQuery('.rating-stars', e).data('multiplier') == 'number') {
265					stars_width_multiplier = jQuery('.rating-stars', e).data('multiplier');
266				}
267				
268				rating_width = Math.round(jQuery('.all-stars', e).width() * rating * stars_width_multiplier + stars_width_multiplier * 0.05 * Math.sin(rating * 2 * Math.PI) + 0.5 * stars_width_multiplier * (Math.round(rating + 0.49) - rating));
269				jQuery('.rating-stars', e).width(rating_width).css({ margin: (jQuery('body').hasClass('rtl')) ? '0 0 0 ' + (-1 * rating_width) + 'px' : '0 ' + (-1 * rating_width) + 'px 0 0' });
270			}
271		}
272		
273		if (view == null || view > jQuery('.listing', e).children().length) {
274			return;
275		}
276		
277		google_business_reviews_rating_carousel(e);
278	});
279	return;
280}
281
282function google_business_reviews_rating_carousel(e, i, auto) {
283	if (typeof e != 'object') {
284		return;
285	}
286	
287	if (typeof i != 'number') {
288		var i = (!jQuery(e).hasClass('google-business-reviews-rating') && !jQuery(this).hasClass('review-more-link') && jQuery(e).closest('.bullet').length) ? jQuery(e).closest('.bullet').index() : null;
289	}
290	
291	if (typeof auto != 'boolean') {
292		var auto = false;
293	}
294	
295	e = (jQuery(e).hasClass('google-business-reviews-rating')) ? e : jQuery(e).closest('.google-business-reviews-rating');
296	
297	var view = (jQuery(e).hasClass('carousel') && typeof jQuery(e).data('view') == 'number' && jQuery(e).data('view') >= 1 && jQuery(e).data('view') <= 50) ? jQuery(e).data('view') : null,
298		slide = (view != null && typeof jQuery(e).data('slide') == 'number' && jQuery(e).data('slide') >= 2) ? jQuery(e).data('slide') : 1,
299		iterations = (view != null && typeof jQuery(e).data('loop') != 'number' && typeof jQuery(e).data('iterations') == 'number') ? jQuery(e).data('iterations') : null,
300		loop = (view != null && typeof jQuery(e).data('loop') == 'number' && typeof jQuery(e).data('loop') || typeof jQuery(e).data('loop') == 'boolean') ? ((typeof jQuery(e).data('loop') == 'number' && jQuery(e).data('loop') < 1) ? true : jQuery(e).data('loop')) : ((iterations != null) ? Math.round(iterations * view) : false),
301		loop_counter = (view != null && loop && typeof jQuery(e).data('counter') == 'number') ? jQuery(e).data('counter') : null,
302		interval = (view != null && loop && typeof jQuery(e).data('interval') == 'number') ? jQuery(e).data('interval') : null,
303		interval_id = (view != null && loop && typeof jQuery(e).data('interval-id') == 'number') ? jQuery(e).data('interval-id') : null,
304		new_slide = (i != null) ? i + 1 : ((auto) ? slide + 1 : null),
305		transition = (view != null && typeof jQuery(e).data('transition') == 'string') ? jQuery(e).data('transition') : null,
306		transition_duration = (view != null && transition == 'string' && typeof jQuery(e).data('transition-duration') == 'number') ? jQuery(e).data('transition-duration') : null,
307		bounds = null,
308		list_area = [null, null, null, null],
309		list_visible = view,
310		list_width = 0,
311		list_height = 0;
312		
313	if (view == null || new_slide != null && view > jQuery('.listing:eq(0)', e).children().length || auto && jQuery(e).is(':hover')) {
314		return;
315	}
316	
317	if (new_slide != null && (view < 1 || slide == new_slide || (!auto || auto && (typeof loop == 'boolean' && !loop || typeof loop == 'number' && (loop_counter != null && loop_counter > loop))) && (new_slide < 1 || new_slide > Math.ceil(jQuery('.listing:eq(0) > *', e).length / view)))) {
318		if (auto && interval_id != null) {
319			clearInterval(interval_id);
320		};
321		
322		return;
323	}
324	
325	if (auto && (new_slide < 1 || new_slide > Math.ceil(jQuery('.listing:eq(0) > *', e).length / view))) {
326		new_slide = (new_slide < 1) ? Math.ceil(jQuery('.listing:eq(0) > *', e).length / view) : 1;
327		
328		if (!jQuery('.navigation', e).length) {
329			jQuery(e).data('slide', new_slide);
330		}
331	}
332	
333	if (new_slide != null) {
334		switch (transition)
335		{
336		default:
337			jQuery('.listing:eq(0) > *', e).each(function(j) {
338				if (Math.ceil((jQuery(this).data('index') + 1) / view) == slide) {
339					if (jQuery('.review-more-link', this).length && jQuery('.review-full-text', this).length) {
340						jQuery('.review-full-text', this).hide();
341						jQuery('.review-more-link', this).show();
342					}
343	
344					jQuery(this).removeClass('visible').addClass('hidden');
345					return;
346				}
347				
348				if (Math.ceil((jQuery(this).data('index') + 1) / view) == new_slide) {
349					jQuery(this).removeClass('hidden').addClass('visible');
350					return;
351				}
352			});
353			
354			break;
355		}
356		
357		if (jQuery('.navigation', e).length) {
358			jQuery('a:eq(' + (new_slide - 1) + ')', jQuery('.navigation', e)).parent().addClass('current').siblings().removeClass('current');
359		}
360		
361		slide = new_slide;
362		jQuery(e).data('slide', slide);
363	}
364	
365	jQuery('.listing:eq(0) > .visible', e).each(function(j) {
366		bounds = this.getBoundingClientRect();
367		
368		if (list_area[0] == null || list_area[0] > bounds.top) {
369			list_area[0] = bounds.top;
370		}
371		
372		if (list_area[1] == null || list_area[1] < bounds.right) {
373			list_area[1] = bounds.right;
374		}
375		
376		if (list_area[2] == null || list_area[2] < bounds.top) {
377			list_area[2] = bounds.bottom;
378		}
379		
380		if (list_area[3] == null || list_area[3] > bounds.right) {
381			list_area[3] = bounds.left;
382		}
383	});
384	
385	if (list_area[0] != null && list_area[1] != null && list_area[2] != null && list_area[3] != null) {
386		list_width = parseInt(list_area[1] - list_area[3]) + parseInt(j
386Query('.listing:eq(0) > .visible:eq(0)', e).css('margin-left')) + parseInt(jQuery('.listing:eq(0) > .visible:last', e).css('margin-right'));
387		list_height = parseInt(list_area[2] - list_area[0]) + parseInt(jQuery('.listing:eq(0) > .visible:eq(0)', e).css('margin-top')) + parseInt(jQuery('.listing:eq(0) > .visible:last', e).css('margin-bottom'));
388		if (list_width == 0 || list_height == 0) {
389			if (jQuery('.navigation', e)) {
390				jQuery('a', jQuery('.navigation', e)).each(function() {
391					jQuery(this).on('click', function(event) {
392						event.preventDefault();
393						event.stopPropagation();
394					});
395				});
396			}
397			
398			if (typeof jQuery(e).data('reattempt') != 'number' || jQuery(e).data('reattempt') < 1) {
399				interval_id = setTimeout(google_business_reviews_rating_carousel, 10, e);
400				jQuery(e).data('reattempt', interval_id);
401				return;
402			}
403			
404			return;
405		}
406	}
407	
408	if (auto && typeof loop == 'number' && loop >= 1) {
409		if (typeof loop_counter != 'number' || loop_counter < 1) {
410			loop_counter = 1;
411		}
412		
413		loop_counter++;
414		jQuery(e).data('counter', loop_counter);
415		
416		if (auto && interval_id != null && typeof loop == 'number' && loop_counter > loop) {
417			clearInterval(interval_id);
418			return;
419		};
420	}
421	
422	if (typeof jQuery('.listing:eq(0)', e).data('initial-height') == 'number' || list_area[0] == null || list_height == 0) {
423		return;
424	}
425	
426	jQuery('.listing:eq(0)', e).data('initial-height', parseInt(list_height));
427	
428	if (jQuery('.navigation', e).length) {
429		jQuery('a', jQuery('.navigation', e)).each(function(index) {
430			jQuery(this).on('click', function(event) {
431				event.preventDefault();
432				event.stopPropagation();
433				
434				if (jQuery(this).hasClass('current')) {
435					return;
436				}
437				
438				google_business_reviews_rating_carousel(this)
439			});
440		});
441	}
442	
443	if (!auto && interval_id == null && (typeof loop == 'boolean' && loop || typeof loop == 'number' && loop >= 1) && typeof interval == 'number' && interval >= 0.3 && interval <= 999) {
444		interval_id = setInterval(google_business_reviews_rating_carousel, interval * 1000, e, null, true);
445		jQuery(e).data('interval-id', interval_id);
446	}
447	
448	if (typeof jQuery(e).data('draggable') == 'boolean' && !jQuery(e).data('draggable') || typeof jQuery(e).data('draggable') == 'number' && jQuery(e).data('draggable') <= 0) {
449		return;
450	}
451
452	jQuery('.listing:eq(0)', e).on('touchstart', function(event) {
453		var e = jQuery(this).closest('.google-business-reviews-rating'),
454			click_start = event.originalEvent.touches[0].pageX,
455			view = (jQuery(e).hasClass('carousel') && typeof jQuery(e).data('view') == 'number' && jQuery(e).data('view') >= 1 && jQuery(e).data('view') <= 50) ? jQuery(e).data('view') : null,
456			slide = (view != null && typeof jQuery(e).data('slide') == 'number' && jQuery(e).data('slide') >= 2) ? jQuery(e).data('slide') : 1;
457		
458		jQuery(this).one('touchmove', function(event) {
459			var move_x = event.originalEvent.touches[0].pageX,
460				pixel_sensitivity = 7;
461	
462			if (!jQuery('body').hasClass('rtl') && Math.ceil(move_x - click_start) > pixel_sensitivity || jQuery('body').hasClass('rtl') && Math.ceil(click_start - move_x) > pixel_sensitivity) {
463				if (!jQuery('.navigation', e).length) {
464					if (slide <= 1) {
465						return
466					}
467					
468					google_business_reviews_rating_carousel(e, slide - 2);
469					return;
470				}
471				if (jQuery('.current', jQuery('.navigation', e)).index() <= 0) {
472					return;
473				}				
474				
475				google_business_reviews_rating_carousel(jQuery('.current > a', jQuery('.navigation', e)), jQuery('.current', jQuery('.navigation', e)).index() - 1);
476				return;
477			}
478			
479			if (!jQuery('body').hasClass('rtl') && Math.ceil(click_start - move_x) > pixel_sensitivity || jQuery('body').hasClass('rtl') && Math.ceil(move_x - click_start) > pixel_sensitivity) {
480				if (!jQuery('.navigation', e).length) {
481					if (slide >= Math.ceil(jQuery('.listing:eq(0)', e).children().length/view)) {
482						return
483					}
484					
485					google_business_reviews_rating_carousel(e, slide);
486					return;
487				}
488				
489				if (jQuery('.current', jQuery('.navigation', e)).index() >= jQuery('.bullet', jQuery('.navigation', e)).length - 1) {
490					return;
491				}
492				
493				google_business_reviews_rating_carousel(jQuery('.current > a', jQuery('.navigation', e)), jQuery('.current', jQuery('.navigation', e)).index() + 1);
494				return;
495			}
496			
497		});
498		
499		jQuery(this).on('touchend', function() {
500			jQuery(this).off('touchmove');
501		});
502	});	
503	
504	return;
505}
506
507function google_business_reviews_rating_actions(event) {
508	if (!jQuery('.google-business-reviews-rating.carousel').length || event.type != 'keydown' || event.keyCode != 37 && event.keyCode != 39) {
509		return;
510	}
511		
512	var i = 0,
513		bounds = null,
514		active = false,
515		view = null,
516		slide = null;
517	
518	for (i = 0; i < 2; i++) {
519		jQuery('.google-business-reviews-rating.carousel').each(function() {
520			if (active || typeof jQuery(this).data('cursor') == 'boolean' && !jQuery(this).data('cursor') || typeof jQuery(this).data('cursor') == 'number' && jQuery(this).data('cursor') <= 0) {
521				return false;
522			}
523			
524			if (i == 0 && !jQuery(this).is(':hover') || !jQuery('.listing', this).length) {
525				return;
526			}
527			
528			bounds = this.querySelector('.listing').getBoundingClientRect();
529			
530			if (typeof bounds != 'object' || bounds.bottom < 0 || bounds.top > (window.innerHeight || document.documentElement.clientHeight)) {
531				return;
532			}
533			
534			active = true;
535			view = (jQuery(this).hasClass('carousel') && typeof jQuery(this).data('view') == 'number' && jQuery(this).data('view') >= 1 && jQuery(this).data('view') <= 50) ? jQuery(this).data('view') : null;
536			slide = (view != null && typeof jQuery(this).data('slide') == 'number' && jQuery(this).data('slide') >= 2) ? jQuery(this).data('slide') : 1;
537					
538			if (!jQuery('body').hasClass('rtl') && event.keyCode == 37 || jQuery('body').hasClass('rtl') && event.keyCode == 39) {
539				if (!jQuery('.navigation', this).length) {
540					if (slide <= 1) {
541						return false;
542					}
543					
544					google_business_reviews_rating_carousel(this, slide - 2);
545					return;
546				}
547				if (jQuery('.current', jQuery('.navigation', this)).index() <= 0) {
548					return false;
549				}
550				
551				google_business_reviews_rating_carousel(jQuery('.current > a', jQuery('.navigation', this)), jQuery('.current', jQuery('.navigation', this)).index() - 1);
552				return false;
553			}
554			
555			if (!jQuery('body').hasClass('rtl') && event.keyCode == 39 || jQuery('body').hasClass('rtl') && event.keyCode == 37) {
556				if (!jQuery('.navigation', this).length) {
557					if (slide >= Math.ceil(jQuery('.listing:eq(0)', this).children().length/view)) {
558						return false;
559					}
560					
561					google_business_reviews_rating_carousel(this, slide);
562					return;
563				}
564				
565				if (jQuery('.current', jQuery('.navigation', this)).index() >= jQuery('.bullet', jQuery('.navigation', this)).length - 1) {
566					return false;
567				}
568				
569				google_business_reviews_rating_carousel(jQuery('.current > a', jQuery('.navigation', this)), jQuery('.current', jQuery('.navigation', this)).index() + 1);
570				return false;
571			}
572			
573			return false;
574		});
575	}
576}
577
578jQuery(document).ready(function($){
579	google_business_reviews_rating();
580	return;
581});
582
583jQuery(window).on('keydown', function(event) {
584	google_business_reviews_rating_actions(event);
585	return;
586});

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.