PageSourceSearch

https://www.bilete-fcsb.ro/public/front_v2/js/init.js?v=3

js bilete-fcsb.ro collected 2026-09-28 09:18:17 UTC 83,665 bytes, 3,070 lines download raw bytes

1;(function($){
2	"use strict";
3
4	$('body:not(.page-loader-disable)').jpreLoader({
5		showSplash: false,
6		loaderVPos: "50%",
7	});
8
9	$.fn.exists = function () {
10		return this.length > 0;
11	};
12
13	/* ----------------------------------------------------------- */
14	/*  Predefined Variables
15	/* ----------------------------------------------------------- */
16	var $template_var = $('body').data('template');
17	var $color_primary = '#ffdc11';
18	var $main_nav     = $('.main-nav');
19	var $circular_bar = $('.circular__bar');
20	var $gmap         = $('.gm-map');
21	var $mp_single    = $('.mp_single-img');
22	var $mp_gallery   = $('.mp_gallery');
23	var $mp_iframe    = $('.mp_iframe');
24	var $post_fitRows = $('.post-grid--fitRows');
25	var $post_masonry = $('.post-grid--masonry');
26	var $post_masonry_filter = $('.post-grid--masonry-filter');
27	var $team_album   = $('.js-album-masonry');
28	var $slick_featured_slider   = $('.posts--slider-featured');
29	var $slick_featured_carousel = $('.featured-carousel');
30	var $slick_video_carousel = $('.video-carousel');
31	var $slick_team_roster = $('.team-roster--slider');
32	var $slick_awards = $('.awards--slider');
33	var $slick_player_info = $('.player-info');
34	var $slick_product = $('.product__slider');
35	var $slick_product_soccer = $('.product__slider-soccer');
36	var $slick_team_roster_card = $('.team-roster--card-slider');
37	var $slick_team_roster_with_nav = $('.js-team-roster--slider-with-nav');
38	var $slick_team_roster_case = $('.team-roster--case-slider');
39	var $slick_team_roster_grid_slider = $('.js-team-roster--grid-sm');
40	var $slick_team_roster_card_compact = $('.js-team-roster--card-compact');
41	var $slick_team_tournaments_carousel = $('.js-team-tournaments-carousel');
42	var $slick_player_news_carousel = $('.js-posts-carousel');
43	var $slick_player_achievements_carousel = $('.js-alc-achievements-carousel');
44	var $slick_hero_slider = $('.hero-slider');
45	var $slick_hero_slider_football = $('.posts--slider-top-news');
46	var $slick_slider_var_width = $('.posts--slider-var-width');
47	var $slick_team_video_player = $('.js-alc-video-player');
48	var $slick_event_carousel = $('.js-alc-event-stats-carousel');
49	var $chart_games_history = $('#games-history');
50	var $chart_games_history_soccer = $('#games-history-soccer');
51	var $chart_games_history_esports = $('#games-history-esports');
52	var $chart_points_history = $('#points-history');
53	var $chart_points_history_soccer = $('#points-history-soccer');
54	var $chart_points_history_football = $('#points-history-football');
55	var $chart_yearly_history_esports = $('#yearly-history-esports');
56	var $chart_horizontal_bars_esports = $('#chart-horizontal-bars-esports');
57	var $chart_doughnut_esports = $('#chart-doughnut-esports');
58	var $chart_doughnut_soccer1 = $('#chart-doughnut-soccer-1');
59	var $chart_doughnut_soccer2 = $('#chart-doughnut-soccer-2');
60	var $chart_player_stats = $('#player-stats');
61	var $chart_event_cols = $('#alc-event-chart-cols');
62	var $content_filter = $('.content-filter');
63	var $marquee = $('.marquee');
64	var $range_slider = $('#slider-range');
65	var posts_filterable = $('.js-posts--filterable');
66
67	if ( $template_var == 'template-soccer' ) {
68		$color_primary = '#1892ed';
69	} else if ( $template_var == 'template-esports') {
70		$color_primary = '#00ff5b';
71	} else if ( $template_var == 'template-football' ) {
72		$color_primary = '#f92552';
73	}
74
75	var Core = {
76
77		initialize: function() {
78
79			this.SvgPolyfill();
80
81			this.headerNav();
82
83			this.countDown();
84
85			this.circularBar();
86
87			this.circleProgress();
88
89			this.MagnificPopup();
90
91			this.isotope();
92
93			this.SlickCarousel();
94
95			this.swiperSlider();
96
97			this.ContentFilter();
98
99			this.ChartJs();
100
101			this.RangeSlider();
102
103			this.GoogleMap();
104
105			this.miscScripts();
106
107		},
108
109		SvgPolyfill: function() {
110			svg4everybody();
111		},
112
113		headerNav: function() {
114
115			if ( $main_nav.exists() ) {
116
117				var $top_nav     = $('.nav-account');
118				var $top_nav_li  = $('.nav-account > li');
119				var $social      = $('.social-links--main-nav');
120				var $info_nav_li = $('.info-block--header > li');
121				var $info_nav_li_onclick = $('.js-info-block__item--onclick');
122				var $wrapper     = $('.site-wrapper');
123				var $nav_list    = $('.main-nav__list');
124				var $nav_list_li = $('.main-nav__list > li');
125				var $toggle_btn  = $('#header-mobile__toggle');
126				var $pushy_btn   = $('.pushy-panel__toggle, .search__toggle');
127
128				// Clone Search Form
129				var $header_search_form = $('.header-search-form').clone();
130				$('#header-mobile').append($header_search_form);
131
132				// Clone Shopping Cart to Mobile Menu
133				var $shop_cart = $('.info-block__item--shopping-cart > .info-block__link-wrapper').clone();
134				$shop_cart.appendTo($nav_list).wrap('<li class="main-nav__item--shopping-cart"></li>');
135
136				// Add arrow and class if Top Bar menu ite has submenu
137				$top_nav_li.has('ul').addClass('has-children').prepend('<span class="main-nav__toggle"></span>');
138
139				// Clone Top Bar menu to Main Menu
140				if ( $top_nav.exists() ) {
141					var children = $top_nav.children().clone();
142					$nav_list.append(children);
143				}
144
145				// Clone Header Logo to Mobile Menu
146				var $logo_mobile = $('.header-mobile__logo').clone();
147				$nav_list.prepend($logo_mobile);
148				$logo_mobile.prepend('<span class="main-nav__back"></span>');
149
150				// Clone Header Info to Mobile Menu
151				var header_info1 = $('.info-block__item--contact-primary').clone();
152				var header_info2 = $('.info-block__item--contact-secondary').clone();
153				$nav_list.append(header_info1).append(header_info2);
154
155				// Clone Social Links to Main Menu
156				if ( $social.exists() ) {
157					var social_li = $social.children().clone();
158					var social_li_new = social_li.contents().unwrap();
159					social_li_new.appendTo($nav_list).wrapAll('<li class="main-nav__item--social-links"></li>');
160				}
161
162				// Add arrow and class if Info Header Nav has submenu
163				$info_nav_li.has('ul').addClass('has-children');
164
165				if ( $info_nav_li_onclick.exists() ){
166					$info_nav_li_onclick.prepend('<span class="info-block__menu-icon"></span>');
167					$info_nav_li_onclick.on('click', '.info-block__menu-icon', function() {
168						$(this).toggleClass('active');
169					});
170				}
171
172				// Mobile Menu Toggle
173				$toggle_btn.on('click', function(){
174					$wrapper.toggleClass('site-wrapper--has-overlay');
175				});
176
177				$('.site-overlay, .main-nav__back').on('click', function(){
178					$wrapper.toggleClass('site-wrapper--has-overlay');
179				});
180
181				// Pushy Panel Toggle
182				$pushy_btn.on('click', function(e){
183					e.preventDefault();
184					$wrapper.toggleClass('site-wrapper--has-overlay-pushy');
185				});
186
187				$('.site-overlay, .pushy-panel__back-btn').on('click', function(e){
188					e.preventDefault();
189					$wrapper.removeClass('site-wrapper--has-overlay-pushy site-wrapper--has-overlay');
190				});
191
192				// Add toggle button and class if menu has submenu
193				$nav_list_li.has('.main-nav__sub').addClass('has-children').prepend('<span class="main-nav__toggle"></span>');
194				$nav_list_li.has('.main-nav__megamenu').addClass('has-children').prepend('<span class="main-nav__toggle"></span>');
195
196				$('.main-nav__toggle').on('click', function(){
197					$(this).toggleClass('main-nav__toggle--rotate')
198					.parent().siblings().children().removeClass('main-nav__toggle--rotate');
199
200					$(".main-nav__sub, .main-nav__megamenu").not($(this).siblings('.main-nav__sub, .main-nav__megamenu')).slideUp('normal');
201					$(this).siblings('.main-nav__sub').slideToggle('normal');
202					$(this).siblings('.main-nav__megamenu').slideToggle('normal');
203				});
204
205				// Add toggle button and class if submenu has sub-submenu
206				$('.main-nav__list > li > ul > li').has('.main-nav__sub-2').addClass('has-children').prepend('<span class="main-nav__toggle-2"></span>');
207				$('.main-nav__list > li > ul > li > ul > li').has('.main-nav__sub-3').addClass('has-children').prepend('<span class="main-nav__toggle-2"></span>');
208
209				$('.main-nav__toggle-2').on('click', function(){
210					$(this).toggleClass('main-nav__toggle--rotate');
211					$(this).siblings('.main-nav__sub-2').slideToggle('normal');
212					$(this).siblings('.main-nav__sub-3').slideToggle('normal');
213				});
214
215				// Mobile Search
216				$('#header-mobile__search-icon').on('click', function(){
217					$(this).toggleClass('header-mobile__search-icon--close');
218					$('.header-mobile').toggleClass('header-mobile--expanded');
219				});
220			}
221		},
222
223		countDown: function() {
224
225			var countdown = $('.countdown-counter');
226			var countdownPlain = $('.js-countdown-plain');
227
228			if (countdown.exists()){
229				var count_time = countdown.data('date');
230				count_time = count_time.replace(/ /g,"T")
231
232				countdown.countdown({
233					date: count_time,
234					render: function(data) {
235						$(this.el).html("<div class='countdown-counter__item countdown-counter__item--days'>
235" + this.leadingZeros(data.days, 2) + " <span class='countdown-counter__label'></span></div><div class='countdown-counter__item countdown-counter__item--hours'>" + this.leadingZeros(data.hours, 2) + " <span class='countdown-counter__label'></span></div><div class='countdown-counter__item countdown-counter__item--mins'>" + this.leadingZeros(data.min, 2) + " <span class='countdown-counter__label'></span></div><div class='countdown-counter__item countdown-counter__item--secs'>" + this.leadingZeros(data.sec, 2) + " <span class='countdown-counter__label'></span></div>");
236					}
237				});
238			}
239
240			if (countdownPlain.exists()){
241				var countdownPlainTime = countdownPlain.data('date');
242				var finalDate = new Date(countdownPlainTime);
243
244				countdownPlain.countdown({
245					date: countdownPlainTime,
246					render: function(date) {
247						var diffInDays = (finalDate.getTime() - Date.now()) / 1000 / 86400;
248						var progressBarValue = 100 - diffInDays ? 100 - diffInDays : 10;
249						$(this.el).html("<div class='alc-countdown-plain__item alc-countdown-plain__item--title'>Starts In:</div><div class='alc-countdown-plain__item alc-countdown-plain__item--days'>" + this.leadingZeros(date.days, 2) + " <span class='alc-countdown-plain__item-label'>days</span></div><div class='alc-countdown-plain__item alc-countdown-plain__item--hours'>" + this.leadingZeros(date.hours, 2) + " <span class='alc-countdown-plain__item-label'>hours</span></div><div class='alc-countdown-plain__item alc-countdown-plain__item--mins'>" + this.leadingZeros(date.min, 2) + " <span class='alc-countdown-plain__item-label'>mins</span></div><div class='alc-countdown-plain__item alc-countdown-plain__item--secs'>" + this.leadingZeros(date.sec, 2) + " <span class='alc-countdown-plain__item-label'>secs</span></div><div class='alc-countdown-plain__progress progress-grid-wrapper'><div class='progress progress--lines progress--lines-sm'><div class='progress__bar progress__bar--gradient-primary-success' style='width: " + progressBarValue + "%;' role='progressbar' aria-valuenow='" + progressBarValue + "' aria-valuemin='0' aria-valuemax='100'></div></div></div>");
250					}
251				});
252			}
253		},
254
255		circularBar: function() {
256
257			var $track_color = '#ecf0f6';
258			var $track_line_cap = 'square';
259
260			if ( $template_var == 'template-esports' ) {
261				$track_line_cap = 'round';
262			}
263
264			if ( $template_var == 'template-football' ) {
265				$track_color = '#4e4d73';
266			} else if ( $template_var == 'template-esports' ) {
267				$track_color = '#4b3b60';
268			}
269
270			if ( $circular_bar.exists() ) {
271				$circular_bar.easyPieChart({
272					barColor: $color_primary,
273					trackColor: $track_color,
274					lineCap: $track_line_cap,
275					lineWidth: 8,
276					size: 90,
277					scaleLength: 0
278				});
279			}
280
281		},
282
283		circleProgress: function() {
284			var circle_progress = $('.js-alc-circle-progress');
285
286			if ( circle_progress.exists() ) {
287				circle_progress.each(function() {
288					var circle_progress_el = $(this);
289					var valueEl = circle_progress_el.attr('data-value');
290					var percentSymbol = circle_progress_el.attr('data-percent-symbol');
291					var hideValue = circle_progress_el.attr('data-hide-value');
292
293					circle_progress_el.circleProgress({
294						max: 100,
295						value: valueEl,
296						textFormat: function() {
297							if (hideValue) {
298								return '';
299							}
300							if (percentSymbol) {
301								return (this.value !== undefined ? this.value : this.indeterminateText) + '%';
302							}
303							return (this.value !== undefined ? this.value : this.indeterminateText);
304						},
305					});
306				});
307			}
308
309		},
310
311		MagnificPopup: function(){
312
313			if ($mp_single.exists() ) {
314				// Single Image
315				$('.mp_single-img').magnificPopup({
316					type:'image',
317					removalDelay: 300,
318
319					gallery:{
320						enabled:false
321					},
322					mainClass: 'mfp-fade',
323					autoFocusLast: false,
324
325				});
326			}
327
328			if ($mp_gallery.exists() ) {
329				// Multiple Images (gallery)
330				$('.mp_gallery').magnificPopup({
331					type:'image',
332					removalDelay: 300,
333
334					gallery:{
335						enabled:true
336					},
337					mainClass: 'mfp-fade',
338					autoFocusLast: false,
339
340				});
341			}
342
343			if ($mp_iframe.exists() ) {
344				// Iframe (video, maps)
345				$('.mp_iframe').magnificPopup({
346					type:'iframe',
347					removalDelay: 300,
348					mainClass: 'mfp-fade',
349					autoFocusLast: false,
350
351					patterns: {
352						youtube: {
353							index: 'youtube.com/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index).
354
355							id: 'v=', // String that splits URL in a two parts, second part should be %id%
356							// Or null - full URL will be returned
357							// Or a function that should return %id%, for example:
358							// id: function(url) { return 'parsed id'; }
359
360							src: '//www.youtube.com/embed/%id%?autoplay=1' // URL that will be set as a source for iframe.
361						},
362						vimeo: {
363							index: 'vimeo.com/',
364							id: '/',
365							src: '//player.vimeo.com/video/%id%?autoplay=1'
366						},
367						twitch: {
368							index: 'twitch.tv/',
369							id: 'videos/',
370							src: '//player.twitch.tv/?autoplay=false&video=v%id%'
371						},
372						gmaps: {
373							index: '//maps.google.',
374							src: '%id%&output=embed'
375						}
376					},
377
378					srcAction: 'iframe_src', // Templating object key. First part defines CSS selector, second attribute. "iframe_src" means: find "iframe" and set attribute "src".
379
380				});
381			}
382		},
383
384
385		isotope: function() {
386
387			if ( $post_fitRows.exists() ) {
388				var $grid = $post_fitRows.imagesLoaded( function() {
389					// init Isotope after all images have loaded
390					$grid.isotope({
391						itemSelector: '.post-grid__item',
392						layoutMode: 'fitRows',
393						masonry: {
394							columnWidth: '.post-grid__item'
395						}
396					});
397				});
398			}
399
400			if ( $post_masonry.exists() ) {
401				var masonry = $post_masonry.imagesLoaded( function() {
402					// init Isotope after all images have loaded
403					masonry.isotope({
404						itemSelector: '.post-grid__item',
405						layoutMode: 'masonry',
406						percentPosition: true,
407						masonry: {
408							columnWidth: '.post-grid__item'
409						}
410					});
411				});
412			}
413
414			if ( $team_album.exists() ) {
415				var masonryTeamAlbum = $team_album.imagesLoaded( function() {
416					// init Isotope after all images have loaded
417					masonryTeamAlbum.isotope({
418						itemSelector: '.album__item',
419						layoutMode: 'masonry',
420						percentPosition: true,
421						masonry: {
422							columnWidth: '.album__item',
423						}
424					});
425				});
426			}
427
428
429			if ( $post_masonry_filter.exists() ) {
430				var masonry_grid = $post_masonry_filter.imagesLoaded( function() {
431
432					var $filter = $('.js-category-filter');
433
434					// init Isotope after all images have loaded
435					masonry_grid.isotope({
436						filter      : '*',
437						itemSelector: '.post-grid__item',
438						layoutMode: 'masonry',
439						masonry: {
440							columnWidth: '.post-grid__item'
441						}
442					});
443
444					// filter items on button click
445					$filter.on( 'click', 'button', function() {
446						var filterValue = $(this).attr('data-filter');
447						$filter.find('button').removeClass('category-filter__link--active');
448						$(this).addClass('category-filter__link--active');
449						masonry_grid.isotope({
450							filter: filterValue
451						});
452					});
453				});
454			}
455
456			if (posts_filterable.exists() ) {
457				var isotopeGrid = posts_filterable.imagesLoaded(function () {
458
459					var filter = $('.js-isotope-filter');
460
461					// init Isotope after all images have loaded
462					isotopeGrid.isotope({
463						filter: '*',
464						itemSelector: '.post-grid__item',
465						layoutMode: 'fitRows',
466						masonry: {
467							columnWidth: '.post-grid__item'
468						}
469					});
470
471					// filter items on button click
472					filter.on('click', '.isotope-filter__link', function () {
473						var filterValue = $(this).attr('data-filter');
474						filter.find('.isotope-filter__link').removeClass('isotope-filter__link--active');
475						$(this).addClass('isotope-filter__link--active');
476						isotopeGrid.isotope({
477							filter: filterValue
478						});
479					});
480				});
481			}
482
483		},
484
485
486		SlickCarousel: function() {
487
488			// Featured News Carousel
489			if ( $slick_featured_carousel.exists() ) {
490
491				$slick_featured_carousel.slick({
492					slidesToShow: 3,
493					slidesToScroll: 1,
494					autoplay: true,
495					autoplaySpeed: 5000,
496					centerMode: true,
497					centerPadding: 0,
498					rows: 0,
499
500					responsive: [
501						{
502							breakpoint: 992,
503							settings: {
504								arrows: false,
505								centerMode: true,
506								centerPadding: 0,
507								slidesToShow: 3
508							}
509						},
510						{
511							breakpoint: 768,
512							settings: {
513								arrows: false,
514								centerMode: true,
515								centerPadding: 0,
516								slidesToShow: 2
517							}
518						},
519						{
520							breakpoint: 480,
521							settings: {
522								arrows: false,
523								centerMode: true,
524								centerPadding: 0,
525								slidesToShow: 1,
526								dots: true
527							}
528						}
529					]
530				});
531
532			}
533
534			// Video Slideshow Carousel
535			if ( $slick_video_carousel.exists() ) {
536
537				$slick_video_carousel.slick({
538					slidesToShow: 4,
539					slidesToScroll: 1,
540					infinite: true,
541					autoplay: false,
542					autoplaySpeed: 5000,
543					rows: 0,
544
545					responsive: [
546						{
547							breakpoint: 992,
548							settings: {
549								arrows: false,
550								slidesToShow: 3,
551								infinite: true
552							}
553						},
554						{
555							breakpoint: 768,
556							settings: {
557								arrows: false,
558								slidesToShow: 2,
559								infinite: false
560							}
561						},
562						{
563							breakpoint: 480,
564							settings: {
565								arrows: false,
566								slidesToShow: 1,
567								infinite: false
568							}
569						}
570					]
571				});
572
573				// Filter by Categories
574				var filtered = false;
575
576				$('.category-filter--carousel .category-filter__link').on('click', function(e){
577					var category = $(this).data('category');
578					$slick_video_carousel.slick('slickUnfilter');
579					$slick_video_carousel.slick('slickFilter', '.' + category);
580					$('.category-filter--carousel .category-filter__link--active').removeClass('category-filter__link--active');
581					$(this).addClass('category-filter__link--active');
582					e.preventDefault();
583				});
584
585				// Reset Filter (Show All posts)
586				$('.category-filter--carousel .category-filter__link--reset').on('click', function(e){
587					$slick_video_carousel.slick('slickUnfilter');
588					$('.category-filter--carousel .category-filter__link').removeClass('category-filter__link--active');
589					$(this).addClass('category-filter__link--active');
590					filtered = false;
591					e.preventDefault();
592				});
593
594			}
595
596			// Featured News Slider
597			if ( $slick_featured_slider.exists() ) {
598
599				$slick_featured_slider.slick({
600					slidesToShow: 1,
601					slidesToScroll: 1,
602					autoplay: true,
603					autoplaySpeed: 5000,
604					rows: 0,
605					responsive: [
606						{
607							breakpoint: 768,
608							settings: {
609								arrows: false
610							}
611						}
612					]
613				});
614
615
616				// Featured Posts (.posts--slider-featured)
617
618				// Filter by Categories
619				var filtered2 = false;
620
621				$('.category-filter--featured .category-filter__link').on('click', function(e){
622					var category = $(this).data('category');
623					$slick_featured_slider.slick('slickUnfilter');
624					$slick_featured_slider.slick('slickFilter', '.' + category);
625					$('.category-filter--featured .category-filter__link--active').removeClass('category-filter__link--active');
626					$(this).addClass('category-filter__link--active');
627					e.preventDefault();
628				});
629
630				// Reset Filter (Show All posts)
631				$('.category-filter--featured .category-filter__link--reset').on('click', function(e){
632					$slick_featured_slider.slick('slickUnfilter');
633					$('.category-filter--featured .category-filter__link').removeClass('category-filter__link--active');
634					$(this).addClass('category-filter__link--active');
635					filtered2 = false;
636					e.preventDefault();
637				});
638			}
639
640
641			// Team Roster Carousel
642			if ( $slick_team_roster.exists() ) {
643
644				$slick_team_roster.slick({
645					centerMode: true,
646					centerPadding: 0,
647					slidesToShow: 3,
648					autoplay: true,
649					autoplaySpeed: 3000,
650					rows: 0,
651					responsive: [
652						{
653							breakpoint: 768,
654							settings: {
655								arrows: false,
656								centerMode: true,
657								centerPadding: 0,
658								slidesToShow: 3
659							}
660						},
661						{
662							breakpoint: 480,
663							settings: {
664								arrows: false,
665								centerMode: true,
666								centerPadding: 0,
667								slidesToShow: 1
668							}
669						}
670					]
671				});
672			}
673
674
675			// Awards Carousel
676			if ( $slick_awards.exists() ) {
677
678				if ( $template_var == 'template-football' ) {
679
680					// Filter by Categories
681					var filtered3 = false;
682
683					$('.awards-filter .awards-filter__link').on('click', function(e){
684						var category = $(this).data('category');
685						$slick_awards.slick('slickUnfilter');
686						$slick_awards.slick('slickFilter', '.' + category);
687						$('.awards-filter .awards-filter__link--active').removeClass('awards-filter__link--active');
688						$(this).addClass('awards-filter__link--active');
689						e.preventDefault();
690					});
691
692					// Reset Filter (Show All posts)
693					$('.awards-filter .awards-filter__link--reset').on('click', function(e){
694						$slick_awards.slick('slickUnfilter');
695						$('.awards-filter .awards-filter__link').removeClass('awards-filter__link--active');
696						$(this).addClass('awards-filter__link--active');
697						filtered3 = false;
698						e.preventDefault();
699					});
700
701
702					// Awards Slider
703					$slick_awards.slick({
704						slidesToShow: 1,
705						arrows: false,
706						dots: true,
707						vertical: true,
708						verticalSwiping: true,
709						rows: 0,
710					});
711
712
713				} else {
714
715					$slick_awards.slick({
716						slidesToShow: 1,
717						arrows: true,
718						dots: true,
719						rows: 0,
720						responsive: [
721							{
722								breakpoint: 768,
723								settings: {
724									arrows: false
725								}
726							}
727						]
728					});
729				}
730
731			}
732
733
734			// Player Info
735			if ( $slick_player_info.exists() ) {
736
737				$(window).on('load', function() {
738					$slick_player_info.slick({
739						slidesToShow: 3,
740						arrows: false,
741						dots: false,
742						infinite: false,
743						variableWidth: true,
744						rows: 0,
745						responsive: [
746							{
747								breakpoint: 992,
748								settings: {
749									slidesToShow: 1,
750									dots: true,
751									variableWidth: false
752								}
753							}
754						]
755					});
756				});
757			}
758
759
760			// Products Slider
761			if ( $slick_product.exists() ) {
762
763				if ( $template_var == 'template-esports' ) {
764
765					var $status = $('.product__slider-paging');
766					$slick_product.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) {
767						//currentSlide is undefined on init -- set it to 0 in this case (currentSlide is 0 based)
768						var i = (currentSlide ? currentSlide : 0) + 1;
769						$status.text(i + ' / ' + slick.slideCount);
770					});
771
772					$slick_product.slick({
773						slidesToShow: 1,
774						dots: false,
775						rows: 0,
776						appendArrows: $('.js-product__slider-arrows')
777					});
778
779				} else {
780					$slick_product.slick({
781						slidesToShow: 1,
782						arrows: false,
783						dots: true,
784						rows: 0,
785					});
786				}
787			}
788
789
790			// Products Slider - Thumbs
791			if ( $slick_product_soccer.exists() ) {
792
793				$slick_product_soccer.slick({
794					slidesToShow: 1,
795					slidesToScroll: 1,
796					arrows: false,
797					rows: 0,
798					asNavFor: '.product__slider-thumbs'
799				});
800				$('.product__slider-thumbs').slick({
801					slidesToShow: 3,
802					slidesToScroll: 1,
803					asNavFor: $slick_product_soccer,
804					focusOnSelect: true,
805					vertical: true,
806					rows: 0,
807				});
808			}
809
810
811			// Team Roster - Card Slider
812			if ( $slick_team_roster_card.exists() ) {
813
814				$slick_team_roster_card.slick({
815					slidesToShow: 1,
816					arrows: true,
817					dots: false,
818					rows: 0,
819					responsive: [
820						{
821							breakpoint: 992,
822							settings: {
823								arrows: false,
824							}
825						}
826					]
827				});
828			}
829
830
831			// Team Roster - with Nav
832			if ( $slick_team_roster_with_nav.exists() ) {
833
834				$slick_team_roster_with_nav.slick({
835					slidesToShow: 1,
836					arrows: true,
837					dots: false,
838					speed: 600,
839					rows: 0,
840					cssEase: 'cubic-bezier(0.23, 1, 0.32, 1)',
841					asNavFor: '.js-team-roster-nav',
842					responsive: [
843						{
844							breakpoint: 992,
845							settings: {
846								arrows: false,
847							}
848						}
849					]
850				});
851
852				$('.js-team-roster-nav').slick({
853					slidesToShow: 6,
854					slidesToScroll: 1,
855					asNavFor: $slick_team_roster_with_nav,
856					focusOnSelect: true,
857					arrows: false,
858					rows: 0,
859					responsive: [
860						{
861							breakpoint: 1200,
862							settings: {
863								slidesToShow: 5,
864							}
865						},
866						{
867							breakpoint: 992,
868							settings: {
869								slidesToShow: 4,
870							}
871						},
872						{
873							breakpoint: 768,
874							settings: {
875								slidesToShow: 3,
876							}
877						},
878						{
879							breakpoint: 540,
880							settings: {
881								slidesToShow: 2,
882							}
883						},
884						{
885							breakpoint: 480,
886							settings: {
887								slidesToShow: 1,
888							}
889						}
890					]
891				});
892			}
893
894
895			// Team Roster - Case Slider
896			if ( $slick_team_roster_case.exists() ) {
897
898				$slick_team_roster_case.slick({
899					slidesToShow: 3,
900					autoplay: true,
901					autoplaySpeed: 3000,
902					arrows: true,
903					dots: false,
904					rows: 0,
905					responsive: [
906						{
907							breakpoint: 768,
908							settings: {
909								arrows: false,
910								slidesToShow: 2
911							}
912						},
913						{
914							breakpoint: 480,
915							settings: {
916								arrows: false,
917								slidesToShow: 1
918							}
919						}
920					]
921				});
922			}
923
924
925			// Team - Tournaments Carousel
926			if ( $slick_team_tournaments_carousel.exists() ) {
927
928				$slick_team_tournaments_carousel.slick({
929					slidesToShow: 2,
930					slidesToScroll: 1,
931					infinite: true,
932					autoplay: false,
933					autoplaySpeed: 5000,
934					rows: 0,
935					appendArrows: $('.js-team-tournaments-carousel-header'),
936
937					responsive: [
938						{
939							breakpoint: 992,
940							settings: {
941								arrows: false,
942								slidesToShow: 2,
943								infinite: true
944							}
945						},
946						{
947							breakpoint: 768,
948							settings: {
949								arrows: false,
950								slidesToShow: 2,
951								infinite: false
952							}
953						},
954						{
955							breakpoint: 576,
956							settings: {
957								arrows: false,
958								slidesToShow: 1,
959								infinite: false
960							}
961						}
962					]
963				});
964			}
965
966
967			// Player - Related News
968			if ( $slick_player_news_carousel.exists() ) {
969
970				$slick_player_news_carousel.slick({
971					slidesToShow: 2,
972					slidesToScroll: 1,
973					infinite: true,
974					autoplay: false,
975					autoplaySpeed: 5000,
976					rows: 0,
977					appendArrows: $('.js-posts-carousel-header'),
978
979					responsive: [
980						{
981							breakpoint: 992,
982							settings: {
983								arrows: false,
984								slidesToShow: 2,
985								infinite: true
986							}
987						},
988						{
989							breakpoint: 768,
990							settings: {
991								arrows: false,
992								slidesToShow: 2,
993								infinite: false
994							}
995						},
996						{
997							breakpoint: 576,
998							settings: {
999								arrows: false,
1000								slidesToShow: 1,
1001								infinite: false
1002							}
1003						}
1004					]
1005				});
1006			}
1007
1008
1009			// Achievement Carousel
1010			if ( $slick_player_achievements_carousel.exists() ) {
1011
1012				$slick_player_achievements_carousel.slick({
1013					slidesToShow: 1,
1014					slidesToScroll: 1,
1015					infinite: true,
1016					autoplay: true,
1017					autoplaySpeed: 5000,
1018					rows: 0,
1019					appendArrows: $('.js-alc-achievements-carousel-header')
1020				});
1021			}
1022
1023
1024			// Hero Slider
1025			if ( $slick_hero_slider.exists() ) {
1026
1027				$slick_hero_slider.slick({
1028					slidesToShow: 1,
1029					slidesToScroll: 1,
1030					arrows: false,
1031					fade: true,
1032					autoplay: true,
1033					autoplaySpeed: 8000,
1034					rows: 0,
1035					asNavFor: '.hero-slider-thumbs',
1036
1037					responsive: [
1038						{
1039							breakpoint: 992,
1040							settings: {
1041								fade: false,
1042							}
1043						}
1044					]
1045				});
1046				$('.hero-slider-thumbs').slick({
1047					slidesToShow: 3,
1048					slidesToScroll: 1,
1049					asNavFor: $slick_hero_slider,
1050					focusOnSelect: true,
1051					rows: 0,
1052				});
1053			}
1054
1055
1056
1057			// Hero Slider - Football
1058			if ( $slick_hero_slider_football.exists() ) {
1059
1060				$slick_hero_slider_football.slick({
1061					slidesToShow: 1,
1062					slidesToScroll: 1,
1063					arrows: false,
1064					fade: true,
1065					dots: true,
1066					autoplay: true,
1067					autoplaySpeed: 8000,
1068					adaptiveHeight: true,
1069					rows: 0,
1070				});
1071			}
1072
1073
1074			// Featured News Slider - variable width
1075			if ( $slick_slider_var_width.exists() ) {
1076
1077				$slick_slider_var_width.slick({
1078					slidesToShow: 1,
1079					slidesToScroll: 1,
1080					autoplay: false,
1081					autoplaySpeed: 5000,
1082					adaptiveHeight: true,
1083					rows: 0,
1084					responsive: [
1085						{
1086							breakpoint: 768,
1087							settings: {
1088								arrows: false
1089							}
1090						}
1091					]
1092				});
1093			}
1094
1095
1096			// Team Roster - Grid Small Slider
1097			if ( $slick_team_roster_grid_slider.exists() ) {
1098
1099				$slick_team_roster_grid_slider.slick({
1100					slidesToShow: 3,
1101					autoplay: false,
1102					autoplaySpeed: 3000,
1103					arrows: true,
1104					dots: false,
1105					infinite: false,
1106					rows: 0,
1107					responsive: [
1108						{
1109							breakpoint: 1199,
1110							settings: {
1111								slidesToShow: 2
1112							}
1113						},
1114						{
1115							breakpoint: 768,
1116							settings: {
1117								slidesToShow: 1
1118							}
1119						},
1120						{
1121							breakpoint: 480,
1122							settings: {
1123								slidesToShow: 1
1124							}
1125						}
1126					]
1127				});
1128			}
1129
1130
1131			// Team Cards Compact - Slider
1132			if ( $slick_team_roster_card_compact.exists() ) {
1133
1134				$slick_team_roster_card_compact.slick({
1135					slidesToShow: 3,
1136					autoplay: false,
1137					autoplaySpeed: 3000,
1138					arrows: true,
1139					dots: false,
1140					infinite: false,
1141					rows: 0,
1142					responsive: [
1143						{
1144							breakpoint: 1199,
1145							settings: {
1146								slidesToShow: 2
1147							}
1148						},
1149						{
1150							breakpoint: 768,
1151							settings: {
1152								arrows: false,
1153								slidesToShow: 1
1154							}
1155						},
1156						{
1157							breakpoint: 480,
1158							settings: {
1159								arrows: false,
1160								slidesToShow: 1
1161							}
1162						}
1163					]
1164				});
1165			}
1166
1167
1168
1169			// Team - Video Player
1170			if ( $slick_team_video_player.exists() ) {
1171
1172				$slick_team_video_player.slick({
1173					slidesToShow: 1,
1174					slidesToScroll: 1,
1175					arrows: false,
1176					fade: true,
1177					rows: 0,
1178					asNavFor: '.alc-video-player__video-list'
1179				});
1180
1181				$('.alc-video-player__video-list').slick({
1182					slidesToShow: 3,
1183					slidesToScroll: 1,
1184					autoplay: true,
1185					autoplaySpeed: 8000,
1186					asNavFor: $slick_team_video_player,
1187					dots: false,
1188					appendArrows: $('.js-alc-video-player__header'),
1189					focusOnSelect: true,
1190					centerMode: false,
1191					vertical: true,
1192					verticalSwiping: true,
1193					rows: 0,
1194					responsive: [
1195						{
1196							breakpoint: 1200,
1197							settings: {
1198								slidesToShow: 2
1199							}
1200						},
1201						{
1202							breakpoint: 992,
1203							settings: {
1204								arrows: false,
1205								slidesToShow: 3
1206							}
1207						}
1208					]
1209				});
1210
1211			}
1212
1213
1214			// Event Carousel
1215			if ( $slick_event_carousel.exists() ) {
1216
1217				$slick_event_carousel.slick({
1218					slidesToShow: 1,
1219					arrows: true,
1220					dots: true,
1221					rows: 0,
1222					responsive: [
1223						{
1224							breakpoint: 768,
1225							settings: {
1226								arrows: false
1227							}
1228						}
1229					]
1230				});
1231
1232			}
1233
1234		},
1235
1236		swiperSlider: function() {
1237
1238			var swiperCareerStatsSlider = $('.js-alc-career-stats-slides');
1239			var swiperLeaguePlayersSlider = $('.js-alc-league-players-slides');
1240			var swiperTeamStatsSlider = $('.js-alc-team-stats-slides');
1241			var swiperSponsorsSlider = $('.js-alc-sponsors-slider');
1242			var swiperPlayerAwardsSlider = $('.js-alc-player-awards-slider');
1243			var swiperPlayerCardsSlider = $('.js-alc-player-cards-slider');
1244			var swiperScoreboardSlider = $('.js-alc-events-scoreboard-slider');
1245			var swiperRelatedProductsSlider = $('.js-alc-related-products-slides');
1246			var swiperProductSlider = $('.js-alc-product-single-slides');
1247			var swiperHeroGallerySlider = $('.js-alc-hero-gallery__slides');
1248			var swiperPlayerNewsSlider = $('.js-alc-post-news-slides');
1249			var swiperHeroCarouselSlider = $('.js-alc-hero-carousel__slides');
1250
1251			// Player News - Hockey
1252			if ( swiperPlayerNewsSlider.exists() ) {
1253
1254				var swiperHeroCarousel = new Swiper('.js-alc-hero-carousel__slides', {
1255					slidesPerView: 1,
1256					loop: true,
1257					spaceBetween: 0,
1258					navigation: {
1259						nextEl: '.js-alc-hero-carousel-button-next',
1260						prevEl: '.js-alc-hero-carousel-button-prev',
1261					},
1262					breakpoints: {
1263						768: {
1264							slidesPerView: 2,
1265						},
1266						992: {
1267							slidesPerView: 3,
1268						},
1269						1920: {
1270							slidesPerView: 4,
1271						},
1272					}
1273				});
1274			}
1275
1276			// Player News - Hockey
1277			if ( swiperPlayerNewsSlider.exists() ) {
1278
1279				var swiperPlayerNews = new Swiper('.js-alc-post-news-slides', {
1280					slidesPerView: 1,
1281					loop: true,
1282					spaceBetween: 0,
1283					navigation: {
1284						nextEl: '.js-alc-post-news-button-next',
1285						prevEl: '.js-alc-post-news-button-prev',
1286					},
1287				});
1288			}
1289
1290			// Hero Gallery - Hockey
1291			if ( swiperHeroGallerySlider.exists() ) {
1292
1293				var swiperHeroGalleryNav = new Swiper('.js-alc-hero-gallery__thumbs', {
1294					loop: true,
1295					slidesPerView: 3,
1296					direction: 'vertical',
1297					spaceBetween: 0,
1298					breakpoints: {
1299						576: {
1300							slidesPerView: 3,
1301						},
1302						768: {
1303							slidesPerView: 4,
1304						},
1305						992: {
1306							slidesPerView: 5,
1307						},
1308					}
1309				});
1310
1311				var swiperHeroGallery = new Swiper('.js-alc-hero-gallery__slides', {
1312					loop: true,
1313					slidesPerView: 1,
1314					spaceBetween: 0,
1315					autoplay: {
1316						delay: 6000,
1317						disableOnInteraction: true,
1318					},
1319					thumbs: {
1320						autoScrollOffset: 0,
1321						swiper: swiperHeroGalleryNav,
1322					},
1323				});
1324			}
1325
1326			// Single Product - Hockey
1327			if ( swiperProductSlider.exists() ) {
1328
1329				var swiperProductNav = new Swiper('.js-alc-product-single-slides-nav', {
1330					slidesPerView: 8,
1331					direction: 'vertical',
1332					spaceBetween: 12,
1333					autoHeight: true,
1334				});
1335
1336				var swiperProduct = new Swiper('.js-alc-product-single-slides', {
1337					slidesPerView: 1,
1338					thumbs: {
1339						swiper: swiperProductNav,
1340					},
1341				});
1342			}
1343
1344			// Related Products - Hockey
1345			if ( swiperRelatedProductsSlider.exists() ) {
1346
1347				var swiperRelatedProducts = new Swiper('.js-alc-related-products-slides', {
1348					slidesPerView: 1,
1349					loop: true,
1350					spaceBetween: 16,
1351					navigation: {
1352						nextEl: '.js-alc-related-products-button-next',
1353						prevEl: '.js-alc-related-products-button-prev',
1354					},
1355					breakpoints: {
1356						768: {
1357							slidesPerView: 2,
1358						},
1359						992: {
1360							slidesPerView: 3,
1361						},
1362						1200: {
1363							slidesPerView: 4,
1364						},
1365					}
1366				});
1367			}
1368
1369			// Sponsors Slider - Hockey
1370			if ( swiperSponsorsSlider.exists() ) {
1371
1372				var swiperSponsors = new Swiper('.js-alc-sponsors-slider', {
1373					slidesPerView: 1,
1374					loop: true,
1375					spaceBetween: 20,
1376					navigation: {
1377						nextEl: '.js-alc-sponsors-slider__button-next',
1378						prevEl: '.js-alc-sponsors-slider__button-prev',
1379					},
1380					breakpoints: {
1381						480: {
1382							slidesPerView: 2,
1383							spaceBetween: 10
1384						},
1385						768: {
1386							slidesPerView: 3,
1387							spaceBetween: 20
1388						},
1389						992: {
1390							slidesPerView: 2,
1391							spaceBetween: 10
1392						},
1393						1200: {
1394							slidesPerView: 3,
1395							spaceBetween: 20
1396						},
1397					}
1398				});
1399			}
1400
1401			// Career Stats Slider - Hockey
1402			if ( swiperCareerStatsSlider.exists() ) {
1403
1404				var swiperCareerStatsNav = new Swiper('.js-alc-career-stats-nav', {
1405					slidesPerView: 4,
1406					freeMode: true,
1407					watchSlidesProgress: true,
1408				});
1409				var swiperCareerStatsSlides = new Swiper('.js-alc-career-stats-slides', {
1410					spaceBetween: 10,
1411					navigation: {
1412						nextEl: ".js-alc-career-stats-button-next",
1413						prevEl: ".js-alc-career-stats-button-prev",
1414					},
1415					thumbs: {
1416						swiper: swiperCareerStatsNav,
1417					},
1418				});
1419			}
1420
1421			// League Players Slider - Hockey
1422			if ( swiperLeaguePlayersSlider.exists() ) {
1423
1424				var swiperLeaguePlayersNav = new Swiper('.js-alc-league-players-nav', {
1425					slidesPerView: 4,
1426					freeMode: true,
1427					watchSlidesProgress: true,
1428				});
1429				var swiperLeaguePlayersSlides = new Swiper('.js-alc-league-players-slides', {
1430					spaceBetween: 10,
1431					navigation: {
1432						nextEl: ".js-alc-league-players-button-next",
1433						prevEl: ".js-alc-league-players-button-prev",
1434					},
1435					thumbs: {
1436						swiper: swiperLeaguePlayersNav,
1437					},
1438				});
1439			}
1440
1441			// Team Stats Slider - Hockey
1442			if ( swiperTeamStatsSlider.exists() ) {
1443
1444				var swiperTeamStatsNav = new Swiper('.js-alc-team-stats-nav', {
1445					slidesPerView: 1,
1446					freeMode: true,
1447					watchSlidesProgress: true,
1448					effect: 'fade',
1449					fadeEffect: {
1450						crossFade: true
1451					},
1452				});
1453				var swiperTeamStatsSlides = new Swiper('.js-alc-team-stats-slides', {
1454					spaceBetween: 10,
1455					navigation: {
1456						nextEl: ".js-alc-team-stats-button-next",
1457						prevEl: ".js-alc-team-stats-button-prev",
1458					},
1459					thumbs: {
1460						swiper: swiperTeamStatsNav,
1461					},
1462				});
1463			}
1464
1465			// Player Awards Slider - Hockey
1466			if ( swiperPlayerAwardsSlider.exists() ) {
1467
1468				var swiperPlayerAwards = new Swiper('.js-alc-player-awards-slider', {
1469					slidesPerView: 1,
1470					direction: 'vertical',
1471					loop: true,
1472					autoplay: true,
1473					navigation: {
1474						nextEl: '.js-alc-player-awards-slider__button-next',
1475						prevEl: '.js-alc-player-awards-slider__button-prev',
1476					}
1477				});
1478			}
1479
1480			// Player Cards Slider - Hockey
1481			if ( swiperPlayerCardsSlider.exists() ) {
1482
1483				var swiperPlayerCards = new Swiper('.js-alc-player-cards-slider', {
1484					slidesPerView: 3,
1485					direction: 'horizontal',
1486					loop: false,
1487					autoplay: false,
1488					spaceBetween: 16,
1489					navigation: {
1490						nextEl: '.js-alc-player-cards-slider__button-next',
1491						prevEl: '.js-alc-player-cards-slider__button-prev',
1492					},
1493					breakpoints: {
1494						320: {
1495							slidesPerView: 1
1496						},
1497						768: {
1498							slidesPerView: 2
1499						},
1500						992: {
1501							slidesPerView: 2
1502						},
1503						1200: {
1504							slidesPerView: 3
1505						},
1506					}
1507				});
1508			}
1509
1510			// Scoreboard Slider - Hockey
1511			if ( swiperScoreboardSlider.exists() ) {
1512
1513				var swiperScoreboard = new Swiper('.js-alc-events-scoreboard-slider', {
1514					slidesPerView: 1,
1515					loop: false,
1516					spaceBetween: 0,
1517					navigation: {
1518						nextEl: '.alc-events-scoreboard__button-next',
1519						prevEl: '.alc-events-scoreboard__button-prev',
1520					},
1521					breakpoints: {
1522						480: {
1523							slidesPerView: 1,
1524						},
1525						730: {
1526							slidesPerView: 2,
1527						},
1528						992: {
1529							slidesPerView: 2,
1530						},
1531						1200: {
1532							slidesPerView: 2,
1533						},
1534						1330: {
1535							slidesPerView: 3,
1536						},
1537						1680: {
1538							slidesPerView: 4,
1539						},
1540						1900: {
1541							slidesPerView: 5,
1542						},
1543					}
1544				});
1545			}
1546
1547		},
1548
1549
1550		ContentFilter: function() {
1551
1552			if ( $content_filter.exists() ) {
1553				$('.content-filter__toggle').on('click', function(e){
1554					e.preventDefault();
1555					$(this).toggleClass('content-filter__toggle--active');
1556					$('.content-filter__list').toggleClass('content-filter__list--expanded');
1557				});
1558			}
1559
1560		},
1561
1562
1563		ChartJs: function() {
1564
1565			if ( $chart_games_history.exists() ) {
1566				var data = {
1567					type: 'bar',
1568					data: {
1569						labels: ["2010", "2011", "2012", "2013", "2014", "2015"],
1570						datasets: [{
1571							label: 'WON',
1572							data: [70, 67, 78, 87, 69, 76],
1573							backgroundColor: "#ffdc11",
1574						}, {
1575							label: 'LOST',
1576							data: [40, 45, 36, 28, 43, 35],
1577							backgroundColor: "#ff8429"
1578						}]
1579					},
1580					options: {
1581						legend: {
1582							display: false,
1583							labels: {
1584								boxWidth: 8,
1585								fontSize: 9,
1586								fontColor: '#31404b',
1587								fontFamily: 'Montserrat, sans-serif',
1588								padding: 20,
1589							}
1590						},
1591						tooltips: {
1592							backgroundColor: "rgba(49,64,75,0.8)",
1593							titleFontSize: 0,
1594							titleSpacing: 0,
1595							titleMarginBottom: 0,
1596							bodyFontFamily: 'Montserrat, sans-serif',
1597							bodyFontSize: 9,
1598							bodySpacing: 0,
1599							cornerRadius: 2,
1600							xPadding: 10,
1601							displayColors: false,
1602						},
1603						scales: {
1604							xAxes: [{
1605								barThickness: 14,
1606								gridLines: {
1607									display:false,
1608									color: "rgba(255,255,255,0)",
1609								},
1610								ticks: {
1611									fontColor: '#9a9da2',
1612									fontFamily: 'Montserrat, sans-serif',
1613									fontSize: 10,
1614								},
1615							}],
1616							yAxes: [{
1617								gridLines: {
1618									display:false,
1619									color: "rgba(255,255,255,0)",
1620								},
1621								ticks: {
1622									beginAtZero: true,
1623									fontColor: '#9a9da2',
1624									fontFamily: 'Montserrat, sans-serif',
1625									fontSize: 10,
1626									padding: 20
1627								}
1628							}]
1629						}
1630					},
1631				};
1632
1633				var ctx = $chart_games_history;
1634				var gamesHistory = new Chart(ctx, data);
1635				document.getElementById('gamesHistoryLegend').innerHTML = gamesHistory.generateLegend();
1636			}
1637
1638
1639
1640			if ( $chart_games_history_soccer.exists() ) {
1641				var data2 = {
1642					type: 'bar',
1643					data: {
1644						labels: ["2010", "2011", "2012", "2013", "2014", "2015"],
1645						datasets: [{
1646							label: 'WON',
1647							data: [40, 45, 36, 28, 42, 35],
1648							backgroundColor: "#c2ff1f",
1649						}, {
1650							label: 'LOST',
1651							data: [70, 67, 75, 86, 68, 76],
1652							backgroundColor: "#38a9ff",
1653						}]
1654					},
1655					options: {
1656						legend: {
1657							display: false,
1658							labels: {
1659								boxWidth: 8,
1660								fontSize: 9,
1661								fontColor: '#31404b',
1662								fontFamily: 'Montserrat, sans-serif',
1663								padding: 20,
1664							}
1665						},
1666						tooltips: {
1667							backgroundColor: "rgba(49,64,75,0.8)",
1668							titleFontSize: 0,
1669							titleSpacing: 0,
1670							titleMarginBottom: 0,
1671							bodyFontFamily: 'Montserrat, sans-serif',
1672							bodyFontSize: 9,
1673							bodySpacing: 0,
1674							cornerRadius: 2,
1675							xPadding: 10,
1676							displayColors: false,
1677						},
1678						scales: {
1679							xAxes: [{
1680								stacked: true,
1681								barThickness: 34,
1682								gridLines: {
1683									display:false,
1684									color: "rgba(255,255,255,0)",
1685								},
1686								ticks: {
1687									fontColor: '#9a9da2',
1688									fontFamily: 'Montserrat, sans-serif',
1689									fontSize: 10,
1690								},
1691							}],
1692							yAxes: [{
1693								stacked: true,
1694								gridLines: {
1695									display:false,
1696									color: "rgba(255,255,255,0)",
1697								},
1698								ticks: {
1699									fontColor: '#9a9da2',
1700									fontFamily: 'Montserrat, sans-serif',
1701									fontSize: 10,
1702									padding: 20,
1703								}
1704							}]
1705						}
1706					},
1707				};
1708
1709				var ctx2 = $chart_games_history_soccer;
1710				var gamesHistory2 = new Chart(ctx2, data2);
1711				document.getElementById('gamesHistoryLegendSoccer').innerHTML = gamesHistory2.generateLegend();
1712			}
1713
1714
1715
1716			if ( $chart_games_history_esports.exists() ) {
1717				var dataEsports = {
1718					type: 'bar',
1719					data: {
1720						labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
1721						datasets: [{
1722							label: 'WON',
1723							data: [680, 528, 592, 616, 720, 496, 640, 568, 600, 598, 607, 558],
1724							backgroundColor: "#00ff5b",
1725						}, {
1726							label: 'LOST',
1727							data: [610, 487, 569, 671, 622, 554, 610, 514, 674, 487, 657, 511],
1728							backgroundColor: "#6a3bc0"
1729						}]
1730					},
1731					options: {
1732						legend: {
1733							display: false,
1734							labels: {
1735								boxWidth: 8,
1736								fontSize: 9,
1737								fontColor: '#a59cae',
1738								fontFamily: 'Open Sans, sans-serif',
1739								padding: 20,
1740							}
1741						},
1742						tooltips: {
1743							backgroundColor: "#6a3bc0",
1744							titleFontSize: 0,
1745							titleSpacing: 0,
1746							titleMarginBottom: 0,
1747							bodyFontFamily: 'Open Sans, sans-serif',
1748							bodyFontSize: 9,
1749							bodySpacing: 0,
1750							cornerRadius: 2,
1751							xPadding: 10,
1752							displayColors: false,
1753						},
1754						scales: {
1755							xAxes: [{
1756								barThickness: 14,
1757								gridLines: {
1758									display:false,
1759									color: "rgba(255,255,255,0)",
1760								},
1761								ticks: {
1762									fontColor: '#9a9da2',
1763									fontFamily: 'Open Sans, sans-serif',
1764									fontSize: 10,
1765								},
1766							}],
1767							yAxes: [{
1768								gridLines: {
1769									display: false,
1770									color: "rgba(255,255,255,0)",
1771								},
1772								ticks: {
1773									beginAtZero: true,
1774									fontColor: '#9a9da2',
1775									fontFamily: 'Open Sans, sans-serif',
1776									fontSize: 10,
1777									padding: 20
1778								}
1779							}]
1780						}
1781					},
1782				};
1783
1784				var ctxEsports = $chart_games_history_esports;
1785				var gamesHistoryEsports = new Chart(ctxEsports, dataEsports);
1786				document.getElementById('gamesHistoryLegendEsports').innerHTML = gamesHistoryEsports.generateLegend();
1787			}
1788
1789
1790			var chart_goals_history_hockey = $('#js-alc-goals-history-hockey');
1791
1792			if ( chart_goals_history_hockey.exists() ) {
1793				var dataGoalsHockey = {
1794					type: 'horizontalBar',
1795					data: {
1796						labels: ["2021 - 20", "2020 - 19", "2019 - 18", "2018 - 17"],
1797						datasets: [{
1798							label: 'Goals Made',
1799							data: [69, 112, 55, 88],
1800							backgroundColor: "#6c4dee",
1801						}, {
1802							label: 'Goals Againts',
1803							data: [34, 52, 64, 24],
1804							backgroundColor: "#00e6e3"
1805						}]
1806					},
1807					options: {
1808						legend: {
1809							display: false,
1810						},
1811						tooltips: {
1812							backgroundColor: "#37353c",
1813							titleFontSize: 0,
1814							titleSpacing: 0,
1815							titleMarginBottom: 0,
1816							bodyFontFamily: 'Ubuntu, sans-serif',
1817							bodyFontSize: 9,
1818							bodySpacing: 0,
1819							cornerRadius: 2,
1820							xPadding: 10,
1821							displayColors: false,
1822							callbacks: {
1823								title: function() {} // removes title inside label
1824							}
1825						},
1826						scales: {
1827							xAxes: [{
1828								gridLines: {
1829									color: "#e7e6ee",
1830								},
1831								ticks: {
1832									beginAtZero: true,
1833									fontColor: '#37353c',
1834									fontFamily: 'Ubuntu, sans-serif',
1835									fontSize: 10,
1836								},
1837							}],
1838							yAxes: [{
1839								barThickness: 14,
1840								gridLines: {
1841									display: false,
1842									color: "rgba(255,255,255,0)",
1843								},
1844								ticks: {
1845									fontColor: '#37353c',
1846									fontFamily: 'Ubuntu, sans-serif',
1847									fontSize: 10,
1848									padding: 20
1849								}
1850							}]
1851						}
1852					},
1853				};
1854
1855				var ctxGoalsHockey = chart_goals_history_hockey;
1856				var goalsHistoryHockey = new Chart(ctxGoalsHockey, dataGoalsHockey);
1857				document.getElementById('js-alc-goals-history-legend-hockey').innerHTML = goalsHistoryHockey.generateLegend();
1858			}
1859
1860
1861
1862			if ( $chart_points_history.exists() ) {
1863				var data3 = {
1864					type: 'line',
1865					data: {
1866						labels: ["Aug 8", "Aug 15", "Aug 21", "Aug 28", "Sep 4", "Sep 19", "Sep 26", "Oct 3", "Oct 10", "Oct 16", "Oct 23", "Oct 30"],
1867						datasets: [{
1868							label: 'POINTS',
1869							fill: false,
1870							lineTension: 0,
1871							backgroundColor: "#ffdc11",
1872							borderWidth: 2,
1873							borderColor: "#ffdc11",
1874							borderCapStyle: 'butt',
1875							borderDashOffset: 0.0,
1876							borderJoinStyle: 'bevel',
1877							pointRadius: 0,
1878							pointBorderWidth: 0,
1879							pointHoverRadius: 5,
1880							pointHoverBackgroundColor: "#fff",
1881							pointHoverBorderColor: "#ffcc00",
1882							pointHoverBorderWidth: 5,
1883							pointHitRadius: 10,
1884							data: [104, 70, 115, 105, 45, 94, 84, 100, 82, 125, 78, 86, 110],
1885							spanGaps: false,
1886						}]
1887					},
1888					options: {
1889						legend: {
1890							display: false,
1891							labels: {
1892								boxWidth: 8,
1893								fontSize: 9,
1894								fontColor: '#31404b',
1895								fontFamily: 'Montserrat, sans-serif',
1896								padding: 20,
1897							}
1898						},
1899						tooltips: {
1900							backgroundColor: "rgba(49,64,75,0.8)",
1901							titleFontSize: 0,
1902							titleSpacing: 0,
1903							titleMarginBottom: 0,
1904							bodyFontFamily: 'Montserrat, sans-serif',
1905							bodyFontSize: 9,
1906							bodySpacing: 0,
1907							cornerRadius: 2,
1908							xPadding: 10,
1909							displayColors: false,
1910						},
1911						scales: {
1912							xAxes: [{
1913								gridLines: {
1914									color: "#e4e7ed",
1915								},
1916								ticks: {
1917									fontColor: '#9a9da2',
1918									fontFamily: 'Montserrat, sans-serif',
1919									fontSize: 10,
1920								},
1921							}],
1922							yAxes: [{
1923								gridLines: {
1924									display:false,
1925									color: "rgba(255,255,255,0)",
1926								},
1927								ticks: {
1928									beginAtZero: true,
1929									fontColor: '#9a9da2',
1930									fontFamily: 'Montserrat, sans-serif',
1931									fontSize: 10,
1932									padding: 20
1933								}
1934							}]
1935						}
1936					},
1937				};
1938
1939				var ctx3 = $chart_points_history;
1940				var gamesHistory3 = new Chart(ctx3, data3);
1941			}
1942
1943
1944			if ( $chart_points_history_soccer.exists() ) {
1945				var data4 = {
1946					type: 'line',
1947					data: {
1948						labels: ["Aug 8", "Aug 15", "Aug 21", "Aug 28", "Sep 4", "Sep 19", "Sep 26", "Oct 3", "Oct 10", "Oct 16", "Oct 23", "Oct 30"],
1949						datasets: [{
1950							label: 'PREV RECORD',
1951							fill: true,
1952							lineTension: 0.5,
1953							backgroundColor: "rgba(194,255,31,0.8)",
1954							borderWidth: 2,
1955							borderColor: "#c2ff1f",
1956							borderCapStyle: 'butt',
1957							borderDashOffset: 0.0,
1958							borderJoinStyle: 'bevel',
1959							pointRadius: 0,
1960							pointBorderWidth: 0,
1961							pointHoverRadius: 5,
1962							pointHoverBackgroundColor: "#fff",
1963							pointHoverBorderColor: "#c2ff1f",
1964							pointHoverBorderWidth: 5,
1965							pointHitRadius: 10,
1966							data: [52, 71, 40, 53, 62, 40, 44, 58, 38, 64, 46, 70, 75],
1967							spanGaps: false,
1968						}, {
1969							label: 'THIS YEAR',
1970							fill: true,
1971							lineTension: 0.5,
1972							backgroundColor: "rgba(56,169,255,0.8)",
1973							borderWidth: 2,
1974							borderColor: "#38a9ff",
1975							borderCapStyle: 'butt',
1976							borderDashOffset: 0.0,
1977							borderJoinStyle: 'bevel',
1978							pointRadius: 0,
1979							pointBorderWidth: 0,
1980							pointHoverRadius: 5,
1981							pointHoverBackgroundColor: "#fff",
1982							pointHoverBorderColor: "#38a9ff",
1983							pointHoverBorderWidth: 5,
1984							pointHitRadius: 10,
1985							data: [71, 52, 87, 53, 17, 62, 56, 37, 91, 48, 75, 64, 78],
1986							spanGaps: false,
1987						}]
1988					},
1989					options: {
1990						legend: {
1991							display: false,
1992							labels: {
1993								boxWidth: 8,
1994								fontSize: 9,
1995								fontColor: '#31404b',
1996								fontFamily: 'Montserrat, sans-serif',
1997								padding: 20,
1998							}
1999						},
2000						tooltips: {
2001							backgroundColor: "rgba(49,64,75,0.8)",
2002							titleFontSize: 0,
2003							titleSpacing: 0,
2004							titleMarginBottom: 0,
2005							bodyFontFamily: 'Montserrat, sans-serif',
2006							bodyFontSize: 9,
2007							bodySpacing: 0,
2008							cornerRadius: 2,
2009							xPadding: 10,
2010							displayColors: false,
2011						},
2012						scales: {
2013							xAxes: [{
2014								gridLines: {
2015									color: "#e4e7ed",
2016								},
2017								ticks: {
2018									fontColor: '#9a9da2',
2019									fontFamily: 'Montserrat, sans-serif',
2020									fontSize: 10,
2021								},
2022							}],
2023							yAxes: [{
2024								gridLines: {
2025									display:false,
2026									color: "rgba(255,255,255,0)",
2027								},
2028								ticks: {
2029									beginAtZero: true,
2030									fontColor: '#9a9da2',
2031									fontFamily: 'Montserrat, sans-serif',
2032									fontSize: 10,
2033									padding: 20
2034								}
2035							}]
2036						}
2037					},
2038				};
2039
2040				var ctx4 = $chart_points_history_soccer;
2041				var gamesHistory4 = new Chart(ctx4, data4);
2042
2043				document.getElementById('gamesPoinstsLegendSoccer').innerHTML = gamesHistory4.generateLegend();
2044			}
2045
2046
2047			if ( $chart_points_history_football.exists() ) {
2048				var data5 = {
2049					type: 'line',
2050					data: {
2051						labels: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
2051November", "December"],
2052						datasets: [{
2053							label: '2016',
2054							fill: false,
2055							lineTension: 0,
2056							borderWidth: 4,
2057							backgroundColor: "#3ffeca",
2058							borderColor: "#3ffeca",
2059							borderCapStyle: 'butt',
2060							borderDashOffset: 0.0,
2061							borderJoinStyle: 'bevel',
2062							pointRadius: 5,
2063							pointBorderWidth: 5,
2064							pointBackgroundColor: "#fff",
2065							pointHoverRadius: 5,
2066							pointHoverBackgroundColor: "#fff",
2067							pointHoverBorderColor: "#3ffeca",
2068							pointHoverBorderWidth: 5,
2069							pointHitRadius: 10,
2070							data: [115, 145, 110, 125, 165, 140, 145, 110, 145, 125, 135, 190],
2071							spanGaps: false,
2072						}, {
2073							label: '2015',
2074							fill: false,
2075							lineTension: 0,
2076							borderWidth: 4,
2077							backgroundColor: "#9e69ee",
2078							borderColor: "#9e69ee",
2079							borderCapStyle: 'butt',
2080							borderDashOffset: 0.0,
2081							borderJoinStyle: 'bevel',
2082							pointRadius: 5,
2083							pointBorderWidth: 5,
2084							pointBackgroundColor: "#fff",
2085							pointHoverRadius: 5,
2086							pointHoverBackgroundColor: "#fff",
2087							pointHoverBorderColor: "#9e69ee",
2088							pointHoverBorderWidth: 5,
2089							pointHitRadius: 10,
2090							data: [95, 65, 130, 75, 113, 85, 102, 85, 103, 58, 48, 138],
2091							spanGaps: false,
2092						}]
2093					},
2094					options: {
2095						legend: {
2096							display: false,
2097							labels: {
2098								boxWidth: 8,
2099								fontSize: 9,
2100								fontColor: '#31404b',
2101								fontFamily: 'Montserrat, sans-serif',
2102								padding: 20,
2103							}
2104						},
2105						tooltips: {
2106							backgroundColor: "rgba(50,49,80,0.8)",
2107							titleFontSize: 0,
2108							titleSpacing: 0,
2109							titleMarginBottom: 0,
2110							bodyFontFamily: 'Montserrat, sans-serif',
2111							bodyFontSize: 9,
2112							bodySpacing: 0,
2113							cornerRadius: 2,
2114							xPadding: 10,
2115							displayColors: false,
2116						},
2117						scales: {
2118							xAxes: [{
2119								gridLines: {
2120									color: "#3c3b5b",
2121									zeroLineColor: '#3c3b5b'
2122								},
2123								ticks: {
2124									fontColor: '#9e9caa',
2125									fontFamily: 'Montserrat, sans-serif',
2126									fontSize: 10,
2127								},
2128							}],
2129							yAxes: [{
2130								gridLines: {
2131									color: "#3c3b5b",
2132									zeroLineColor: '#3c3b5b'
2133								},
2134								ticks: {
2135									beginAtZero: true,
2136									fontColor: '#9e9caa',
2137									fontFamily: 'Montserrat, sans-serif',
2138									fontSize: 10,
2139									padding: 20
2140								}
2141							}]
2142						}
2143					},
2144				};
2145
2146				var ctx5 = $chart_points_history_football;
2147				var gamesHistory5 = new Chart(ctx5, data5);
2148
2149				document.getElementById('gamesPoinstsLegendFootball').innerHTML = gamesHistory5.generateLegend();
2150			}
2151
2152
2153			if ( $chart_yearly_history_esports.exists() ) {
2154				var data6 = {
2155					type: 'line',
2156					data: {
2157						labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
2158						datasets: [{
2159							label: 'Kills',
2160							fill: false,
2161							lineTension: 0,
2162							borderWidth: 4,
2163							backgroundColor: "#00fe5b",
2164							borderColor: "#00fe5b",
2165							borderCapStyle: 'butt',
2166							borderDashOffset: 0.0,
2167							borderJoinStyle: 'bevel',
2168							pointRadius: 5,
2169							pointBorderWidth: 5,
2170							pointBackgroundColor: "#fff",
2171							pointHoverRadius: 5,
2172							pointHoverBackgroundColor: "#fff",
2173							pointHoverBorderColor: "#00fe5b",
2174							pointHoverBorderWidth: 5,
2175							pointHitRadius: 10,
2176							data: [311, 447, 290, 367, 562, 420, 468, 290, 444, 343, 420, 592],
2177							spanGaps: false,
2178						},
2179						{
2180							label: 'Deaths',
2181							fill: false,
2182							lineTension: 0,
2183							borderWidth: 4,
2184							backgroundColor: "#6a3bc0",
2185							borderColor: "#6a3bc0",
2186							borderCapStyle: 'butt',
2187							borderDashOffset: 0.0,
2188							borderJoinStyle: 'bevel',
2189							pointRadius: 5,
2190							pointBorderWidth: 5,
2191							pointBackgroundColor: "#fff",
2192							pointHoverRadius: 5,
2193							pointHoverBackgroundColor: "#fff",
2194							pointHoverBorderColor: "#6a3bc0",
2195							pointHoverBorderWidth: 5,
2196							pointHitRadius: 10,
2197							data: [287, 145, 388, 189, 373, 231, 320, 225, 311, 109, 62, 346],
2198							spanGaps: false,
2199						},
2200						{
2201							label: 'Assists',
2202							fill: false,
2203							lineTension: 0,
2204							borderWidth: 4,
2205							backgroundColor: "#fff600",
2206							borderColor: "#fff600",
2207							borderCapStyle: 'butt',
2208							borderDashOffset: 0.0,
2209							borderJoinStyle: 'bevel',
2210							pointRadius: 5,
2211							pointBorderWidth: 5,
2212							pointBackgroundColor: "#fff",
2213							pointHoverRadius: 5,
2214							pointHoverBackgroundColor: "#fff",
2215							pointHoverBorderColor: "#fff600",
2216							pointHoverBorderWidth: 5,
2217							pointHitRadius: 10,
2218							data: [613, 503, 527, 693, 636, 619, 539, 542, 364, 497, 693, 675],
2219							spanGaps: false,
2220						}]
2221					},
2222					options: {
2223						legend: {
2224							display: false,
2225							labels: {
2226								boxWidth: 8,
2227								fontSize: 9,
2228								fontColor: '#31404b',
2229								fontFamily: 'Open Sans, sans-serif',
2230								padding: 20,
2231							}
2232						},
2233						tooltips: {
2234							backgroundColor: "rgba(0,0,0,0.8)",
2235							titleFontSize: 0,
2236							titleSpacing: 0,
2237							titleMarginBottom: 0,
2238							bodyFontFamily: 'Open Sans, sans-serif',
2239							bodyFontSize: 9,
2240							bodySpacing: 0,
2241							cornerRadius: 2,
2242							xPadding: 10,
2243							displayColors: false,
2244						},
2245						scales: {
2246							xAxes: [{
2247								gridLines: {
2248									color: "#3f3251",
2249									zeroLineColor: '#3f3251'
2250								},
2251								ticks: {
2252									fontColor: '#8c8297',
2253									fontFamily: 'Open Sans, sans-serif',
2254									fontSize: 10,
2255								},
2256							}],
2257							yAxes: [{
2258								gridLines: {
2259									color: "#3f3251",
2260									zeroLineColor: '#3f3251'
2261								},
2262								ticks: {
2263									beginAtZero: true,
2264									fontColor: '#8c8297',
2265									fontFamily: 'Open Sans, sans-serif',
2266									fontSize: 10,
2267									padding: 20
2268								}
2269							}]
2270						}
2271					},
2272				};
2273
2274				var ctx6 = $chart_yearly_history_esports;
2275				var gamesHistory6 = new Chart(ctx6, data6);
2276
2277				document.getElementById('gamesYearlyLegendEsports').innerHTML = gamesHistory6.generateLegend();
2278			}
2279
2280
2281			if ( $chart_horizontal_bars_esports.exists() ) {
2282				var data7 = {
2283					type: 'horizontalBar',
2284					data: {
2285						labels: ["2018", "2017", "2016", "2015", "2014"],
2286						datasets: [{
2287							label: 'Assists',
2288							data: [85, 32, 63, 76, 45],
2289							backgroundColor: "#fff600",
2290							hoverBackgroundColor: "#fff600",
2291							fill: true,
2292						}]
2293					},
2294					options: {
2295						legend: {
2296							display: false,
2297							labels: {
2298								boxWidth: 8,
2299								fontSize: 9,
2300								fontColor: '#31404b',
2301								fontFamily: 'Open Sans, sans-serif',
2302								padding: 20,
2303							}
2304						},
2305						tooltips: {
2306							backgroundColor: "rgba(0,0,0,0.8)",
2307							titleFontSize: 0,
2308							titleSpacing: 0,
2309							titleMarginBottom: 0,
2310							bodyFontFamily: 'Open Sans, sans-serif',
2311							bodyFontSize: 9,
2312							bodySpacing: 0,
2313							cornerRadius: 2,
2314							xPadding: 10,
2315							displayColors: false,
2316						},
2317						scales: {
2318							xAxes: [{
2319								gridLines: {
2320									display: false,
2321									color: "rgba(255,255,255,0)",
2322								},
2323								ticks: {
2324									fontColor: '#8c8297',
2325									fontFamily: 'Open Sans, sans-serif',
2326									fontSize: 10,
2327								},
2328							}],
2329							yAxes: [{
2330								barThickness: 24,
2331								gridLines: {
2332									display: false,
2333									color: "rgba(255,255,255,0)",
2334								},
2335								ticks: {
2336									fontColor: '#8c8297',
2337									fontFamily: 'Open Sans, sans-serif',
2338									fontSize: 10,
2339									padding: 20,
2340								}
2341							}]
2342						}
2343					},
2344				};
2345
2346				var ctx7 = $chart_horizontal_bars_esports;
2347				var gamesHistory7 = new Chart(ctx7, data7);
2348			}
2349
2350
2351			if ( $chart_doughnut_esports.exists() ) {
2352
2353				Chart.pluginService.register({
2354					beforeDraw: function (chart) {
2355						if (chart.config.options.elements.center) {
2356							//Get ctx from string
2357							var ctx = chart.chart.ctx;
2358
2359							//Get options from the center object in options
2360							var centerConfig = chart.config.options.elements.center;
2361							var fontStyle = centerConfig.fontStyle || 'Roboto Condensed, sans-serif';
2362							var txt = centerConfig.text;
2363							var color = centerConfig.color || '#fff';
2364							var fontWeight = centerConfig.fontWeight || 'bold';
2365							var sidePadding = centerConfig.sidePadding || 20;
2366							var sidePaddingCalculated = (sidePadding/100) * (chart.innerRadius * 2);
2367							//Start with a base font of 56px
2368							ctx.font = "56px " + fontStyle;
2369
2370							//Get the width of the string and also the width of the element minus 10 to give it 5px side padding
2371							var stringWidth = ctx.measureText(txt).width;
2372							var elementWidth = (chart.innerRadius * 2) - sidePaddingCalculated;
2373
2374							// Find out how much the font can grow in width.
2375							var widthRatio = elementWidth / stringWidth;
2376							var newFontSize = Math.floor(30 * widthRatio);
2377							var elementHeight = (chart.innerRadius * 2);
2378
2379							// Pick a new font size so it will not be larger than the height of label.
2380							var fontSizeToUse = Math.min(newFontSize, elementHeight);
2381
2382							//Set font settings to draw it correctly.
2383							ctx.textAlign = 'center';
2384							ctx.textBaseline = 'middle';
2385							var centerX = ((chart.chartArea.left + chart.chartArea.right) / 2);
2386							var centerY = ((chart.chartArea.top + chart.chartArea.bottom) / 2);
2387							ctx.font = fontWeight + " " + fontSizeToUse + "px " + fontStyle;
2388							ctx.fillStyle = color;
2389
2390							//Draw text in center
2391							ctx.fillText(txt, centerX, centerY);
2392						}
2393					}
2394				});
2395
2396				var data8 = {
2397					type: 'doughnut',
2398					data: {
2399						labels: ["Statistic 01", "Statistic 02", "Statistic 03"],
2400						datasets: [{
2401							label: 'Assists',
2402							data: [118, 120, 55],
2403							backgroundColor: ["#6a3bc0", "#00ff5b", "#fff600"],
2404							hoverBackgroundColor: ["#6a3bc0", "#00ff5b", "#fff600"],
2405							borderWidth: 0
2406						}]
2407					},
2408					options: {
2409						legend: {
2410							display: false,
2411							labels: {
2412								boxWidth: 8,
2413								fontSize: 12,
2414								fontColor: '#fff',
2415								fontStyle: 'bold',
2416								fontFamily: 'Roboto Condensed, sans-serif',
2417								padding: 20,
2418							}
2419						},
2420						tooltips: {
2421							backgroundColor: "rgba(0,0,0,0.8)",
2422							bodyFontFamily: 'Roboto Condensed, sans-serif',
2423							bodyFontSize: 10,
2424							bodySpacing: 0,
2425							cornerRadius: 2,
2426							xPadding: 10,
2427							displayColors: false,
2428						},
2429						cutoutPercentage: 90,
2430						elements: {
2431							center: {
2432								text: '293K',
2433								fontStyle: 'Roboto Condensed, sans-serif', // Default is Arial
2434								sidePadding: 20,
2435								fontWeight: 'bold',
2436							}
2437						}
2438					}
2439				};
2440
2441				var ctx8 = $chart_doughnut_esports;
2442				var gamesHistory8 = new Chart(ctx8, data8);
2443
2444				document.getElementById('chartDoughnutLegendEsports').innerHTML = gamesHistory8.generateLegend();
2445			}
2446
2447			if ( $chart_doughnut_soccer1.exists() ) {
2448
2449				Chart.pluginService.register({
2450					beforeDraw: function (chart) {
2451						if (chart.config.options.elements.center) {
2452							//Get ctx from string
2453							var ctx = chart.chart.ctx;
2454
2455							//Get options from the center object in options
2456							var centerConfig = chart.config.options.elements.center;
2457							var fontStyle = centerConfig.fontStyle || 'Montserrat, sans-serif';
2458							var txt = centerConfig.text;
2459							var color = centerConfig.color || '#31404b';
2460							var fontWeight = centerConfig.fontWeight || 'bold';
2461							var sidePadding = centerConfig.sidePadding || 20;
2462							var sidePaddingCalculated = (sidePadding/100) * (chart.innerRadius * 2);
2463							//Start with a base font of 56px
2464							ctx.font = "76px " + fontStyle;
2465
2466							//Get the width of the string and also the width of the element minus 10 to give it 5px side padding
2467							var stringWidth = ctx.measureText(txt).width;
2468							var elementWidth = (chart.innerRadius * 2) - sidePaddingCalculated;
2469
2470							// Find out how much the font can grow in width.
2471							var widthRatio = elementWidth / stringWidth;
2472							var newFontSize = Math.floor(30 * widthRatio);
2473							var elementHeight = (chart.innerRadius * 2);
2474
2475							// Pick a new font size so it will not be larger than the height of label.
2476							var fontSizeToUse = Math.min(newFontSize, elementHeight);
2477
2478							//Set font settings to draw it correctly.
2479							ctx.textAlign = 'center';
2480							ctx.textBaseline = 'middle';
2481							var centerX = ((chart.chartArea.left + chart.chartArea.right) / 2);
2482							var centerY = ((chart.chartArea.top + chart.chartArea.bottom) / 2);
2483							ctx.font = fontWeight + " " + fontSizeToUse + "px " + fontStyle;
2484							ctx.fillStyle = color;
2485
2486							//Draw text in center
2487							ctx.fillText(txt, centerX, centerY);
2488						}
2489					}
2490				});
2491
2492				var dataSoccer1 = {
2493					type: 'doughnut',
2494					data: {
2495						labels: ["On Goal", "Woodwork", "Off Goal"],
2496						datasets: [{
2497							label: 'Total Shots',
2498							data: [14, 3, 8],
2499							backgroundColor: ["#00e3d0", "#ffd200", "#ff5d0e"],
2500							hoverBackgroundColor: ["#00e3d0", "#ffd200", "#ff5d0e"],
2501							borderWidth: 0
2502						}]
2503					},
2504					options: {
2505						legend: {
2506							display: false,
2507							labels: {
2508								boxWidth: 8,
2509								fontSize: 12,
2510								fontColor: '#fff',
2511								fontStyle: 'bold',
2512								fontFamily: 'Montserrat, sans-serif',
2513								padding: 20,
2514							}
2515						},
2516						tooltips: {
2517							backgroundColor: "rgba(0,0,0,0.8)",
2518							bodyFontFamily: 'Montserrat, sans-serif',
2519							bodyFontSize: 10,
2520							bodySpacing: 0,
2521							cornerRadius: 2,
2522							xPadding: 10,
2523							displayColors: false,
2524						},
2525						cutoutPercentage: 90,
2526						elements: {
2527							center: {
2528								text: '25',
2529								fontStyle: 'Montserrat, sans-serif', // Default is Arial
2530								sidePadding: 20,
2531								fontWeight: 'bold',
2532							}
2533						}
2534					}
2535				};
2536
2537				var ctxdoughnut_soccer_1 = $chart_doughnut_soccer1;
2538				var gamesHistorySoccer1 = new Chart(ctxdoughnut_soccer_1, dataSoccer1);
2539
2540				document.getElementById('chartDoughnutLegendSoccer1').innerHTML = gamesHistorySoccer1.generateLegend();
2541			}
2542
2543			if ( $chart_doughnut_soccer2.exists() ) {
2544
2545				Chart.pluginService.register({
2546					beforeDraw: function (chart) {
2547						if (chart.config.options.elements.center) {
2548							//Get ctx from string
2549							var ctx = chart.chart.ctx;
2550
2551							//Get options from the center object in options
2552							var centerConfig = chart.config.options.elements.center;
2553							var fontStyle = centerConfig.fontStyle || 'Montserrat, sans-serif';
2554							var txt = centerConfig.text;
2555							var color = centerConfig.color || '#31404b';
2556							var fontWeight = centerConfig.fontWeight || 'bold';
2557							var sidePadding = centerConfig.sidePadding || 20;
2558							var sidePaddingCalculated = (sidePadding/100) * (chart.innerRadius * 2);
2559							//Start with a base font of 56px
2560							ctx.font = "76px " + fontStyle;
2561
2562							//Get the width of the string and also the width of the element minus 10 to give it 5px side padding
2563							var stringWidth = ctx.measureText(txt).width;
2564							var elementWidth = (chart.innerRadius * 2) - sidePaddingCalculated;
2565
2566							// Find out how much the font can grow in width.
2567							var widthRatio = elementWidth / stringWidth;
2568							var newFontSize = Math.floor(30 * widthRatio);
2569							var elementHeight = (chart.innerRadius * 2);
2570
2571							// Pick a new font size so it will not be larger than the height of label.
2572							var fontSizeToUse = Math.min(newFontSize, elementHeight);
2573
2574							//Set font settings to draw it correctly.
2575							ctx.textAlign = 'center';
2576							ctx.textBaseline = 'middle';
2577							var centerX = ((chart.chartArea.left + chart.chartArea.right) / 2);
2578							var centerY = ((chart.chartArea.top + chart.chartArea.bottom) / 2);
2579							ctx.font = fontWeight + " " + fontSizeToUse + "px " + fontStyle;
2580							ctx.fillStyle = color;
2581
2582							//Draw text in center
2583							ctx.fillText(txt, centerX, centerY);
2584						}
2585					}
2586				});
2587
2588				var dataSoccer2 = {
2589					type: 'doughnut',
2590					data: {
2591						labels: ["On Goal", "Woodwork", "Off Goal"],
2592						datasets: [{
2593							label: 'Total Shots',
2594							data: [6, 1, 9],
2595							backgroundColor: ["#00e3d0", "#ffd200", "#ff5d0e"],
2596							hoverBackgroundColor: ["#00e3d0", "#ffd200", "#ff5d0e"],
2597							borderWidth: 0
2598						}]
2599					},
2600					options: {
2601						legend: {
2602							display: false,
2603							labels: {
2604								boxWidth: 8,
2605								fontSize: 12,
2606								fontColor: '#fff',
2607								fontStyle: 'bold',
2608								fontFamily: 'Montserrat, sans-serif',
2609								padding: 20,
2610							}
2611						},
2612						tooltips: {
2613							backgroundColor: "rgba(0,0,0,0.8)",
2614							bodyFontFamily: 'Montserrat, sans-serif',
2615							bodyFontSize: 10,
2616							bodySpacing: 0,
2617							cornerRadius: 2,
2618							xPadding: 10,
2619							displayColors: false,
2620						},
2621						cutoutPercentage: 90,
2622						elements: {
2623							center: {
2624								text: '16',
2625								fontStyle: 'Montserrat, sans-serif', // Default is Arial
2626								sidePadding: 20,
2627								fontWeight: 'bold',
2628							}
2629						}
2630					}
2631				};
2632
2633				var ctxdoughnut_soccer_2 = $chart_doughnut_soccer2;
2634				var gamesHistorySoccer2 = new Chart(ctxdoughnut_soccer_2, dataSoccer2);
2635
2636				document.getElementById('chartDoughnutLegendSoccer2').innerHTML = gamesHistorySoccer2.generateLegend();
2637			}
2638
2639
2640			if ( $chart_player_stats.exists() ) {
2641				var radar_data = {
2642					type: 'radar',
2643					data: {
2644						labels: ["OFF", "AST", "3PT", "2PT", "DEF"],
2645						datasets: [{
2646							data: [72, 25, 40, 72, 50],
2647							backgroundColor: "rgba(255,220,17,0.8)",
2648							borderColor: "#ffdc11",
2649							pointBorderColor: "rgba(255,255,255,0)",
2650							pointBackgroundColor: "rgba(255,255,255,0)",
2651							pointBorderWidth: 0
2652						}]
2653					},
2654					options: {
2655						legend: {
2656							display: false,
2657						},
2658						tooltips: {
2659							backgroundColor: "rgba(49,64,75,0.8)",
2660							titleFontSize: 10,
2661							titleSpacing: 2,
2662							titleMarginBottom: 4,
2663							bodyFontFamily: 'Montserrat, sans-serif',
2664							bodyFontSize: 9,
2665							bodySpacing: 0,
2666							cornerRadius: 2,
2667							xPadding: 10,
2668							displayColors: false,
2669						},
2670						scale: {
2671							angleLines: {
2672								color: "rgba(255,255,255,0.025)",
2673							},
2674							pointLabels: {
2675								fontColor: "#9a9da2",
2676								fontFamily: 'Montserrat, sans-serif',
2677							},
2678							ticks: {
2679								beginAtZero: true,
2680								display: false,
2681							},
2682							gridLines: {
2683								color: "rgba(255,255,255,0.05)",
2684								lineWidth: 2,
2685							},
2686							labels: {
2687								display: false
2688							}
2689						}
2690					},
2691				};
2692
2693				var ctx_player_stats = $chart_player_stats;
2694				var playerInfo = new Chart(ctx_player_stats, radar_data);
2695			}
2696
2697
2698			if ( $chart_event_cols.exists() ) {
2699				var data9 = {
2700					type: 'bar',
2701					data: {
2702						labels: ["1st Q", "2nd Q", "3rd Q", "4th Q"],
2703						datasets: [{
2704							label: 'ALC',
2705							data: [24, 15, 20, 25],
2706							backgroundColor: "#ffdc11",
2707						}, {
2708							label: 'SHR',
2709							data: [21, 23, 17, 21],
2710							backgroundColor: "#0cb2e2"
2711						}]
2712					},
2713					options: {
2714						legend: {
2715							display: false,
2716							labels: {
2717								boxWidth: 8,
2718								fontSize: 9,
2719								fontColor: '#31404b',
2720								fontFamily: 'Montserrat, sans-serif',
2721								padding: 20,
2722							}
2723						},
2724						tooltips: {
2725							backgroundColor: "rgba(49,64,75,0.8)",
2726							titleFontSize: 0,
2727							titleSpacing: 0,
2728							titleMarginBottom: 0,
2729							bodyFontFamily: 'Montserrat, sans-serif',
2730							bodyFontSize: 9,
2731							bodySpacing: 0,
2732							cornerRadius: 2,
2733							xPadding: 10,
2734							displayColors: false,
2735						},
2736						scales: {
2737							xAxes: [{
2738								barThickness: 14,
2739								gridLines: {
2740									display:false,
2741									color: "rgba(255,255,255,0)",
2742								},
2743								ticks: {
2744									fontColor: '#9a9da2',
2745									fontFamily: 'Montserrat, sans-serif',
2746									fontSize: 10,
2747								},
2748							}],
2749							yAxes: [{
2750								gridLines: {
2751									display:false,
2752									color: "rgba(255,255,255,0)",
2753								},
2754								ticks: {
2755									beginAtZero: true,
2756									fontColor: '#9a9da2',
2757									fontFamily: 'Montserrat, sans-serif',
2758									fontSize: 10,
2759									padding: 20
2760								}
2761							}]
2762						}
2763					},
2764				};
2765
2766				var ctx9 = $chart_event_cols;
2767				var gamesHistory9 = new Chart(ctx9, data9);
2768				document.getElementById('gamesHistoryLegend').innerHTML = gamesHistory9.generateLegend();
2769			}
2770
2771		},
2772
2773		RangeSlider: function(){
2774
2775			if ( $range_slider.exists() ) {
2776
2777				var rangeSlider = document.getElementById('slider-range');
2778
2779				noUiSlider.create(rangeSlider, {
2780					start: [ 0, 350 ],
2781					connect: true,
2782					range: {
2783						'min': [ 0 ],
2784						'max': [ 450 ]
2785					}
2786				});
2787
2788				var snapValues = [
2789					document.getElementById('slider-range-value-min'),
2790					document.getElementById('slider-range-value-max')
2791				];
2792
2793				rangeSlider.noUiSlider.on('update', function( values, handle ) {
2794					snapValues[handle].innerHTML = values[handle];
2795				});
2796			}
2797
2798		},
2799
2800
2801		GoogleMap: function() {
2802
2803			// Google Map
2804			if ( $gmap.exists()) {
2805				$gmap.each(function() {
2806
2807					var $elem = $(this),
2808							mapAddress        = $elem.attr('data-map-address') ? $elem.attr('data-map-address') : "New York, USA",
2809							mapZoom           = $elem.attr('data-map-zoom') ? $elem.attr('data-map-zoom') : "15",
2810							mapStyle          = $elem.attr('data-map-style'),
2811							mapTypeControl    = $elem.attr('data-map-type-control') ? $elem.attr('data-map-type-control') : true,
2812							streetViewControl = $elem.attr('data-street-view-control') ? $elem.attr('data-street-view-control') : true,
2813							fullscreenControl = $elem.attr('data-fullscreen-control') ? $elem.attr('data-fullscreen-control') : true,
2814							zoomControl       = $elem.attr('data-zoom-control') ? $elem.attr('data-zoom-control') : true;
2815
2816					var styles_output = [];
2817
2818					// Skins
2819					if ( mapStyle == 'default') {
2820						// Skin: Default
2821						styles_output = [{"featureType": "administrative.country", "elementType": "geometry", "stylers": [{"visibility": "simplified"}, {"hue": "#ff0000"}]}];
2822
2823					} else if ( mapStyle == 'light-dream') {
2824						// Skin: Light Dream
2825						styles_output = [{"featureType":"landscape","stylers":[{"hue":"#FFBB00"},{"saturation":43.400000000000006},{"lightness":37.599999999999994			},{"gamma":1}]}
2825,{"featureType":"road.highway","stylers":[{"hue":"#FFC200"},{"saturation":-61.8},{"lightness":45.599999999999994},{"gamma":1}]},{"featureType":"road.arterial","stylers":[{"hue":"#FF0300"},{"saturation":-100},{"lightness":51.19999999999999},{"gamma":1}]},{"featureType":"road.local","stylers":[{"hue":"#FF0300"},{"saturation":-100},{"lightness":52},{"gamma":1}]},{"featureType":"water","stylers":[{"hue":"#0078FF"},{				"saturation":-13.200000000000003},{"lightness":2.4000000000000057},{"gamma":1}]},{"featureType":"poi","stylers":[{"hue":"#00FF6A"},{"saturation":-1.0989010989011234},{"lightness":11.200000000000017},{"gamma":1}]}];
2826
2827					} else if ( mapStyle == 'shades-of-grey') {
2828						// Skin: Shades of Grey
2829						styles_output = [{"featureType":"all","elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#000000"},{"lightness":40}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#000000"},{"lightness":16}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":17},{"weight":1.2}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":21}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":16}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":19}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":17}]}];
2830
2831					} else if ( mapStyle == 'blue-water') {
2832						// Skin: Blue Water
2833						styles_output = [{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#46bcec"},{"visibility":"on"}]}];
2834
2835					} else if ( mapStyle == 'midnight-commander') {
2836						// Skin: Blue Water
2837						styles_output = [
2838							{
2839									"featureType": "all",
2840									"elementType": "labels.text.fill",
2841									"stylers": [
2842											{
2843													"color": "#ffffff"
2844											}
2845									]
2846							},
2847							{
2848									"featureType": "all",
2849									"elementType": "labels.text.stroke",
2850									"stylers": [
2851											{
2852													"color": "#000000"
2853											},
2854											{
2855													"lightness": 13
2856											}
2857									]
2858							},
2859							{
2860									"featureType": "administrative",
2861									"elementType": "geometry.fill",
2862									"stylers": [
2863											{
2864													"color": "#000000"
2865											}
2866									]
2867							},
2868							{
2869									"featureType": "administrative",
2870									"elementType": "geometry.stroke",
2871									"stylers": [
2872											{
2873													"color": "#144b53"
2874											},
2875											{
2876													"lightness": 14
2877											},
2878											{
2879													"weight": 1.4
2880											}
2881									]
2882							},
2883							{
2884									"featureType": "landscape",
2885									"elementType": "all",
2886									"stylers": [
2887											{
2888													"color": "#08304b"
2889											}
2890									]
2891							},
2892							{
2893									"featureType": "poi",
2894									"elementType": "geometry",
2895									"stylers": [
2896											{
2897													"color": "#0c4152"
2898											},
2899											{
2900													"lightness": 5
2901											}
2902									]
2903							},
2904							{
2905									"featureType": "road.highway",
2906									"elementType": "geometry.fill",
2907									"stylers": [
2908											{
2909													"color": "#000000"
2910											}
2911									]
2912							},
2913							{
2914									"featureType": "road.highway",
2915									"elementType": "geometry.stroke",
2916									"stylers": [
2917											{
2918													"color": "#0b434f"
2919											},
2920											{
2921													"lightness": 25
2922											}
2923									]
2924							},
2925							{
2926									"featureType": "road.arterial",
2927									"elementType": "geometry.fill",
2928									"stylers": [
2929											{
2930													"color": "#000000"
2931											}
2932									]
2933							},
2934							{
2935									"featureType": "road.arterial",
2936									"elementType": "geometry.stroke",
2937									"stylers": [
2938											{
2939													"color": "#0b3d51"
2940											},
2941											{
2942													"lightness": 16
2943											}
2944									]
2945							},
2946							{
2947									"featureType": "road.local",
2948									"elementType": "geometry",
2949									"stylers": [
2950											{
2951													"color": "#000000"
2952											}
2953									]
2954							},
2955							{
2956									"featureType": "transit",
2957									"elementType": "all",
2958									"stylers": [
2959											{
2960													"color": "#146474"
2961											}
2962									]
2963							},
2964							{
2965									"featureType": "water",
2966									"elementType": "all",
2967									"stylers": [
2968											{
2969													"color": "#021019"
2970											}
2971									]
2972							}
2973					];
2974
2975					} else {
2976						// Skin: Ultra Light
2977						styles_output = [{"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16}]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2}]}];
2978					}
2979
2980					var mapTypeControlBoolean = mapTypeControl == 'false' ? false : true;
2981					var streetViewControlBoolean = streetViewControl == 'false' ? false : true;
2982					var fullscreenControlBoolean = fullscreenControl == 'false' ? false : true;
2983					var zoomControlBoolean = zoomControl == 'false' ? false : true;
2984
2985					$elem.gmap3({
2986						zoom: Number(mapZoom),
2987						mapTypeId : google.maps.MapTypeId.ROADMAP,
2988						scrollwheel: false,
2989						address: mapAddress,
2990						styles: styles_output,
2991						mapTypeControl: mapTypeControlBoolean,
2992						streetViewControl: streetViewControlBoolean,
2993						fullscreenControl: fullscreenControlBoolean,
2994						zoomControl: zoomControlBoolean
2995					})
2996					.marker({
2997						address: mapAddress,
2998					});
2999				});
3000			}
3001		},
3002
3003
3004		miscScripts: function() {
3005			// Tooltips
3006			$('[data-toggle="tooltip"]').tooltip();
3007
3008			[].slice.call( document.querySelectorAll( 'select.cs-select' ) ).forEach( function(el) {
3009				new SelectFx(el);
3010			} );
3011
3012			// Marquee
3013			if ( $marquee.exists() ) {
3014				$marquee.marquee({
3015					allowCss3Support: true,
3016					pauseOnHover: true
3017				});
3018			}
3019
3020			// Game Result Widget - Expand
3021			if ( $template_var == 'template-football' ) {
3022
3023				// Switch Toggle
3024			$('.widget-game-result').each(function() {
3025				var $this = $(this);
3026
3027				if ( $this.find('.switch-toggle').exists() ) {
3028					var txtHolder = $this.find('.switch__label-txt');
3029					var txtExpand = txtHolder.data('text-expand');
3030					var txtShrink = txtHolder.data('text-shrink');
3031
3032					$this.on('change', function(){
3033						$this.find('.widget-game-result__extra-stats').toggleClass('active');
3034						txtHolder.text(function(i, text){
3035							return text === txtShrink ? txtExpand : txtShrink;
3036						});
3037					});
3038				}
3039			});
3040
3041			} else {
3042
3043				// Switch Toggle (Basketball, Soccer)
3044				$('.widget-game-result .js-switch-toggle').each(function() {
3045					$(this).on('click', function(){
3046
3047						var text_expand = $(this).find('.js-switch-txt').data('text-expand');
3048						var text_shrink = $(this).find('.js-switch-txt').data('text-shrink');
3049
3050						$(this).parent().parent().find('.widget-game-result__extra-stats').toggleClass('active');
3051						$(this).find('.js-switch-txt').text(function(i, text){
3052							return text === text_shrink ? text_expand : text_shrink;
3053						});
3054					});
3055				});
3056
3057			}
3058
3059			// Duotone effect
3060			$('.effect-duotone').prepend('<div class="effect-duotone__layer"><div class="effect-duotone__layer-inner"></div></div>');
3061
3062		},
3063
3064	};
3065
3066	$(document).on('ready', function() {
3067		Core.initialize();
3068	});
3069
3070})(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.