PageSourceSearch

https://dmexco.com/wp-content/themes/deploy/assets/js/scripts-ms.js?ver=1.433

js dmexco.com collected 2026-10-01 08:36:07 UTC 60,784 bytes, 1,329 lines download raw bytes

1// MS
2jQuery(function($) {
3    var testimonialSwiperNew = document.querySelector('.testimonials-swipers-new');
4    if (testimonialSwiperNew) {
5        window.requestAnimationFrame(function () {
6            var testimonialObserver = new IntersectionObserver(function (entries) {
7                entries.forEach(function (entry) {
8                    if (entry.isIntersecting) {
9                        var testimonialsSwipers = new Swiper('.testimonials-swipers-new', {
10                            speed: 400,
11                            threshold: 0,
12                            spaceBetween: 8,
13                            slidesPerView: 'auto',
14                            loop: true,
15                            autoplay: {
16                                delay: 4000
17                            },
18                            navigation: {
19                                nextEl: '.testi-arrow-n',
20                                prevEl: '.testi-arrow-p',
21                            },
22                            on: {
23                                slideChangeTransitionStart: function () {
24                                    const swiper = this;
25                                    let factor = -2;
26                                    if (swiper.previousIndex - swiper.activeIndex > 0) {
27                                        factor = 0;
28                                    }
29                                    jQuery('.testimonials-swipers-new .swiper-pagination')
30                                        .css('transition', 'transform 0.4s cubic-bezier(0.71, 0.01, 0.29, 0.97)')
31                                        .css('transform', 'translateX(calc(var(--swiper-translate) * ' + factor + '))');
32                                },
33                                slideChangeTransitionEnd: function () {
34                                    const swiper = this;
35                                    jQuery('.testimonials-swipers-new .swiper-pagination')
36                                        .css('transition', 'none')
37                                        .css('transform', 'translateX(calc(var(--swiper-translate) * -1))');
38                                },
39                            },
40                            breakpoints: {
41                                1439: {
42                                    slidesPerView: 3,
43                                    slidesPerGroup: 1,
44                                    spaceBetween: 0,
45                                },
46                                999: {
47                                    slidesPerView: 2,
48                                    slidesPerGroup: 1,
49                                    spaceBetween: 0,
50                                    loop: true,
51                                },
52                                500: {
53                                    loop: false,
54                                    slidesPerView: 'auto',
55                                    slidesPerGroup: 1,
56                                    spaceBetween: 8,
57                                },
58                            },
59                        });
60                        testimonialObserver.disconnect();
61                    }
62                })
63            }, {
64                root: null,
65                rootMargin: '0px',
66                threshold: [0]
67            })
68            testimonialObserver.observe(testimonialSwiperNew)
69        });
70    }
71
72    var gallerySwiperEl = document.querySelector('.gallery-swiper');
73    if (gallerySwiperEl) {
74        window.requestAnimationFrame(function () {
75            var guideSwiperIO = new IntersectionObserver(function (entries) {
76                entries.forEach(function (entry) {
77                    if (entry.isIntersecting) {
78                        var gallerySwiper = new Swiper('.gallery-swiper', {
79                            speed: 400,
80                            threshold: 40,
81                            slidesPerView: 'auto',
82                            slidesPerGroup: 1,
83                            spaceBetween: 16,
84
85                            navigation: {
86                                nextEl: '.gallery-swiper-holder .main-navigation-n',
87                                prevEl: '.gallery-swiper-holder .main-navigation-p',
88                            },
89                            breakpoints: {
90                                1439: {
91                                    spaceBetween: 32,
92                                    slidesPerView: 4,
93                                    slidesPerGroup: 1,
94                                },
95                                999: {
96                                    spaceBetween: 32,
97                                    slidesPerView: 4,
98                                    slidesPerGroup: 1,
99                                },
100                                500: {
101                                    slidesPerView: 'auto',
102                                    slidesPerGroup: 1,
103                                    spaceBetween: 16,
104                                },
105                            },
106                        });
107                        guideSwiperIO.disconnect();
108                    }
109                })
110            }, {
111                root: null,
112                rootMargin: '0px',
113                threshold: [0]
114            })
115            guideSwiperIO.observe(gallerySwiperEl)
116        })
117    }
118
119    var tabsSwiperEl = document.querySelector('.tabs-swiper');
120    if (tabsSwiperEl) {
121        window.requestAnimationFrame(function () {
122            var tabsSwiper = new IntersectionObserver(function (entries) {
123                entries.forEach(function (entry) {
124                    if (entry.isIntersecting) {
125                        var tabssSwiper = new Swiper('.tabs-swiper', {
126                            speed: 400,
127                            threshold: 40,
128                            slidesPerView: 'auto',
129                            slidesPerGroup: 1,
130                            spaceBetween: 4,
131                            freeMode: true,
132
133                            navigation: {
134                                nextEl: '.tabs-next',
135                                prevEl: '.tabs-prev',
136                            },
137                        });
138                        tabssSwiper.disconnect();
139                    }
140                })
141            }, {
142                root: null,
143                rootMargin: '0px',
144                threshold: [0]
145            })
146            tabsSwiper.observe(tabsSwiperEl)
147        })
148    }
149
150    var guideSwiperEl = $('.guide-speaker-swiper');
151    console.log(guideSwiperEl)
152    if (guideSwiperEl) {
153        var guideSwiper = new Swiper('.guide-speaker-swiper', {
154            speed: 400,
155            threshold: 40,
156            slidesPerView: 'auto',
157            slidesPerGroup: 1,
158            spaceBetween: 16,
159            simulateTouch: false,
160            navigation: {
161                nextEl: '.arrow-speaker-right',
162                prevEl: '.arrow-speaker-left',
163            },
164            breakpoints: {
165                1439: {
166                    spaceBetween: 32,
167                    slidesPerView: 6,
168                    slidesPerGroup: 1,
169                },
170                999: {
171                    spaceBetween: 32,
172                    slidesPerView: 4,
173                    slidesPerGroup: 1,
174                },
175                500: {
176                    slidesPerView: 'auto',
177                    slidesPerGroup: 1,
178                    spaceBetween: 16,
179                },
180            },
181        });
182        window.addEventListener('resize', function () {
183            function touchCapable() {
184                return (
185                    'ontouchstart' in window ||
186                    (window.DocumentTouch && document instanceof window.DocumentTouch) ||
187                    navigator.maxTouchPoints > 0 ||
188                    window.navigator.msMaxTouchPoints > 0
189                );
190            };
191
192            swiperConfig = {
193                simulateTouch: !touchCapable()
194            }
195        });
196    }
197
198    var guideExhiSwiperEl = $('.guide-exhi-swiper');
199    if (guideExhiSwiperEl) {
200        var guideExhiSwiper = new Swiper('.guide-exhi-swiper', {
201            speed: 400,
202            threshold: 40,
203            slidesPerView: 'auto',
204            slidesPerGroup: 1,
205            spaceBetween: 16,
206            simulateTouch: false,
207            navigation: {
208                nextEl: '.arrow-exhi-right',
209                prevEl: '.arrow-exhi-left',
210            },
211            breakpoints: {
212                1439: {
213                    spaceBetween: 32,
214                    slidesPerView: 6,
215                    slidesPerGroup: 1,
216                },
217                999: {
218                    spaceBetween: 32,
219                    slidesPerView: 4,
220                    slidesPerGroup: 1,
221                },
222                500: {
223                    slidesPerView: 'auto',
224                    slidesPerGroup: 1,
225                    spaceBetween: 16,
226                },
227            },
228        });
229        window.addEventListener('resize', function () {
230            function touchCapable() {
231                return (
232                    'ontouchstart' in window ||
233                    (window.DocumentTouch && document instanceof window.DocumentTouch) ||
234                    navigator.maxTouchPoints > 0 ||
235                    window.navigator.msMaxTouchPoints > 0
236                );
237            };
238
239            swiperConfig = {
240                simulateTouch: !touchCapable()
241            }
242        });
243    }
244
245    var expectSwiperEl = document.querySelector('.expect-swiper');
246    if (expectSwiperEl) {
247        window.requestAnimationFrame(function () {
248            var expectSwiper = new IntersectionObserver(function (entries) {
249                entries.forEach(function (entry) {
250                    if (entry.isIntersecting) {
251                        var expectSwiper = new Swiper('.expect-swiper', {
252                            speed: 400,
253                            threshold: 40,
254                            slidesPerView: 'auto',
255                            slidesPerGroup: 1,
256                            spaceBetween: 16,
257
258                            navigation: {
259                                nextEl: '.arrow-expect-right',
260                                prevEl: '.arrow-expect-left',
261                            },
262                            breakpoints: {
263                                1439: {
264                                    spaceBetween: 32,
265                                    slidesPerView: 4,
266                                    slidesPerGroup: 1,
267                                },
268                                999: {
269                                    spaceBetween: 32,
270                                    slidesPerView: 3,
271                                    slidesPerGroup: 1,
272                                },
273                                500: {
274                                    slidesPerView: 'auto',
275                                    slidesPerGroup: 3,
276                                    spaceBetween: 16,
277                                },
278                            },
279                        });
280                        expectSwiper.disconnect();
281                    }
282                })
283            }, {
284                root: null,
285                rootMargin: '0px',
286                threshold: [0]
287            })
288            expectSwiper.observe(expectSwiperEl)
289        })
290    }
291
292    var aboutDSwiperEl = document.querySelector('.about2-swiper');
293    if (aboutDSwiperEl) {
294        window.requestAnimationFrame(function () {
295            var about2Swiper = new IntersectionObserver(function (entries) {
296                entries.forEach(function (entry) {
297                    if (entry.isIntersecting) {
298                        var about2Swiper = new Swiper('.about2-swiper', {
299                            speed: 400,
300                            threshold: 40,
301                            slidesPerView: 'auto',
302                            slidesPerGroup: 1,
303                            spaceBetween: 16,
304
305                            navigation: {
306                                nextEl: '.arrow-about2-right',
307                                prevEl: '.arrow-about2-left',
308                            },
309                            breakpoints: {
310                                1439: {
311                                    spaceBetween: 32,
312                                    slidesPerView: 3,
313                                    slidesPerGroup: 1,
314                                },
315                                999: {
316                                    spaceBetween: 32,
317                                    slidesPerView: 3,
318                                    slidesPerGroup: 1,
319                                },
320                                500: {
321                                    slidesPerView: 'auto',
322                                    slidesPerGroup: 1,
323                                    spaceBetween: 16,
324                                },
325                            },
326                        });
327                        about2Swiper.disconnect();
328                    }
329                })
330            }, {
331                root: null,
332                rootMargin: '0px',
333                threshold: [0]
334            })
335            about2Swiper.observe(aboutDSwiperEl)
336        })
337    }
338
339    var safeSwiperEl = document.querySelector('.safe-swiper');
340    if (safeSwiperEl) {
341        window.requestAnimationFrame(function () {
342            var safeSwiper = new IntersectionObserver(function (entries) {
343                entries.forEach(function (entry) {
344                    if (entry.isIntersecting) {
345                        var safeSwiper = new Swiper('.safe-swiper', {
346                            speed: 400,
347                            threshold: 40,
348                            slidesPerView: 'auto',
349                            slidesPerGroup: 1,
350                            spaceBetween: 16,
351
352                            navigation: {
353                                nextEl: '.arrow-safe-right',
354                                prevEl: '.arrow-safe-left',
355                            },
356                            breakpoints: {
357                                1439: {
358                                    spaceBetween: 32,
359                                    slidesPerView: 4,
360                                    slidesPerGroup: 1,
361                                },
362                                999: {
363                                    spaceBetween: 32,
364                                    slidesPerView: 3,
365                                    slidesPerGroup: 1,
366                                },
367                                500: {
368                                    slidesPerView: 'auto',
369                                    slidesPerGroup: 1,
370                                    spaceBetween: 16,
371                                },
372                            },
373                        });
374                        safeSwiper.disconnect();
375                    }
376                })
377            }, {
378                root: null,
379                rootMargin: '0px',
380                threshold: [0]
381            })
382            safeSwiper.observe(safeSwiperEl)
383        })
384    }
385
386    var smcontroller;
387    var plyrInitialized = false;
388
389    function initPlyr() {
390        var e = document.createElement("script");
391        e.src = "/wp-content/themes/deploy/assets/js/plyr.polyfilled.min.js";
392        document.body.appendChild(e);
393    }
394
395    function initSinlgePlyr(entry, observer) {
396        if (!window.Plyr) {
397            window.requestAnimationFrame(function () {
398                initSinlgePlyr(entry, observer);
399            })
400            return;
401        }
402        console.log('123123123')
403        const source = entry.target.querySelector('source');
404        if (source) {
405            const src = source.getAttribute('data-src');
406            source.setAttribute('src', src)
407            entry.target.load();
408        }
409        entry.target.style.display = "none";
410        const player = new Plyr(entry.target, {
411            controls: function () {
412                return $(this['elements']['container']).closest('.podcast-player
412-holder').find('.plyr-controls-js-podcast').html();
413            }
414        });
415        player.on('play', function () {
416            $(player['elements']['container']).find('.plyr-time').removeClass('hidden');
417            $(player['elements']['container']).find('.plyr-text').addClass('hidden');
418        });
419        // --------- podcast_click custom tracking event ----------
420        player.on('playing', function () {
421            custom_event = {
422                'event': 'podcast_click'
423            };
424            if ($('body').hasClass('single-podcasts')) {
425                custom_event['podcast_name'] = $('.podcast-title').text().trim();
426                custom_event['podcast_track'] = $('.podcast-track').text();
427            } else {
428                const title = $('.plyr-text.hidden').parents('.podcast-content-holder').find('.podcast-title').text().trim();
429                const track = $('.plyr-text.hidden').parents('.podcast-content-holder').find('.podcast-track').text();
430                custom_event['podcast_name'] = title;
431                custom_event['podcast_track'] = track;
432            }
433            dataLayer.push(custom_event);
434        });
435        observer.unobserve(entry.target)
436
437    }
438
439    function init_podcast_players() {
440        var podcast_players = document.querySelectorAll(".podcast-player");
441        if ($('body').hasClass('enable-audio')) {
442            podcast_players.forEach(function (podcastPlayer) {
443                $('.podcast-player-holder').on('click', function () {
444                    if ($(this).find('.plyr').hasClass('plyr--playing')) {
445                        $("audio").trigger("pause");
446                    } else {
447                        $("audio").trigger("pause");
448                        $(this).find('audio').trigger("play");
449
450                    }
451                });
452            })
453        }
454        if (podcast_players.length) {
455            var podcastObserver = new IntersectionObserver(function (entries, obs) {
456                entries.forEach(function (entry) {
457                    if (entry.isIntersecting) {
458                        if (!window.Plyr && !plyrInitialized) {
459                            initPlyr();
460                            plyrInitialized = true;
461                        }
462                        initSinlgePlyr(entry, obs);
463                    }
464                })
465            }, {
466                root: null,
467                rootMargin: '0px',
468                threshold: [0]
469            });
470
471            podcast_players.forEach(function (podcastPlayer) {
472                podcastObserver.observe(podcastPlayer);
473            })
474
475            if ((localStorage.getItem('autoplay_subpage_podcast') === 'autoplay') && document.body.className.indexOf('single-podcasts') !== -1) {
476                podcast_players[0].play();
477                localStorage.setItem('autoplay_subpage_podcast', 'no_autoplay');
478            }
479        }
480    }
481
482    function initOtherSinglePlyr(entry, otherObserver, controls_el) {
483        if (!window.Plyr) {
484            window.requestAnimationFrame(function () {
485                /*initOtherSinglePlyr(entry, otherObserver, controls_el);*/
486                var updateUCIframe = function () {
487                    if (!window.UC_UI) {
488                        window.requestAnimationFrame(updateUCIframe)
489                        return;
490                    }
491                    const ucServices = UC_UI.getServicesBaseInfo()
492                    const functional = ucServices.find(function (service) {
493                        return service.name === "Google Analytics"
494                    })
495                    console.log(ucServices)
496                    console.log(functional.consent.status)
497                    if (functional.consent.status === true) {
498                        initOtherSinglePlyr(entry, otherObserver, controls_el);
499                    } else {
500                        var vidCookieTitle = $('#video_cookie_title').text();
501                        var vidCookieText = $('#video_cookie_text').text();
502                        var vidCookieCta = $('#video_cookie_cta').text();
503                        if ($("body").hasClass('page-template-page-about-new')) {
504                            $('.plyr__video-embed').html('<div class="cookie_vid_banner" style="align-items: center;margin-bottom: 20px;background: lightgrey;/*padding: 24px*/;position: relative;display: flex;justify-content: space-between;"><img class="cookie-img" style="width: 100%; min-height: 450px" src="/wp-content/themes/deploy/assets/images/video_poster_frame.png" /><img class="cookie-img-m" style="width: 100%" src="/wp-content/themes/deploy/assets/images/video_poster_frame_m.png" /><div class="vid_cookies_text"><div class="vid_cookies_text_inner">
504<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="28" cy="28" r="27" stroke="white" stroke-width="2"/><path d="M9 9L47 47" stroke="white" stroke-width="2"/></svg><p class="cookie_header">' + vidCookieTitle + '</p><p class="cookie_text">' + vidCookieText + '</p><p style="margin-bottom: 0; cursor: pointer" class="enable_cookies">' + vidCookieCta + '</p></div></div></div><style>.cookie-img-m{display: none} .vid_cookies_text{position: absolute; z-index: 1; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #fff;backdrop-filter: blur(6px);}.plyr__video-embed{height: auto;padding-bottom: 0;position: relative;}.vid_cookies_text_inner svg{margin-bottom: 48px} .vid_cookies_text_inner{max-width: 545px;padding: 20px;display: flex; flex-direction: column;align-items: flex-start;}.enable_cookies{background: #FFFFFF; border-radius: 24px;padding: 14px 24px 10px;color:#000;font-size: 16px; line-height: 24px}p.cookie_header{font-size: 27px; line-height: 32px;margin-bottom: 32px}p.cookie_text{margin-bottom: 64px;font-size: 16px; line-height: 28px} @media (max-width: 999px){.vid_cookies_text_inner svg{margin-bottom: 24px;width: 40px;min-height: 40px; height: auto}.enable_cookies{background: #FFFFFF; border-radius: 24px;padding: 8px 16px 8px;color:#000;font-size: 11px; line-height: 16px}p.cookie_header{font-size: 16px; line-height: 24px;margin-bottom: 16px}p.cookie_text{margin-bottom: 24px;font-size: 11px; line-height: 16px}.vid_cookies_text_inner{max-width: 400px; height: 100%; padding: 36px;}} @media(max-width: 599px){.vid_cookies_text_inner{max-width: 400px; height: 100%; padding: 24px;}.cookie-img-m{display: block}.cookie-img{display: none}.cookie_vid_banner{margin: 0 calc(20/375*100vw) 20px;}}</style>')
505
506                        } else {
507                            $('.plyr__video-embed').html('<div class="cookie_vid_banner" style="align-items: center;margin-bottom: 20px;background: lightgrey;/*padding: 24px*/;position: relative;display: flex;justify-content: space-between;"><img class="cookie-img" style="width: 100%" src="/wp-content/themes/deploy/assets/images/video_poster_frame.png" /><img class="cookie-img-m" style="width: 100%" src="/wp-content/themes/deploy/assets/images/video_poster_frame_m.png" /><div class="vid_cookies_text"><div class="vid_cookies_text_inner"><svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="28" cy="28" r="27" stroke="white" stroke-width="2"/><path d="M9 9L47 47" stroke="white" stroke-width="2"/></svg><p class="cookie_header">' + vidCookieTitle + '</p><p class="cookie_text">' + vidCookieText + '</p><p style="margin-bottom: 0; cursor: pointer" class="enable_cookies">' + vidCookieCta + '</p></div></div></div><style>.cookie-img-m{display: none}
507 .vid_cookies_text{position: absolute; z-index: 1; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #fff;backdrop-filter: blur(6px);}.plyr__video-embed{height: auto;padding-bottom: 0;position: relative;}.vid_cookies_text_inner svg{margin-bottom: 48px} .vid_cookies_text_inner{max-width: 545px;padding: 20px;display: flex; flex-direction: column;align-items: flex-start;}.enable_cookies{background: #FFFFFF; border-radius: 24px;padding: 14px 24px 10px;color:#000;font-size: 16px; line-height: 24px}p.cookie_header{font-size: 27px; line-height: 32px;margin-bottom: 32px}p.cookie_text{margin-bottom: 64px;font-size: 16px; line-height: 28px} @media (max-width: 999px){.vid_cookies_text_inner svg{margin-bottom: 24px;width: 40px;min-height: 40px; height: auto}.enable_cookies{background: #FFFFFF; border-radius: 24px;padding: 8px 16px 8px;color:#000;font-size: 11px; line-height: 16px}p.cookie_header{font-size: 16px; line-height: 24px;margin-bottom: 16px}p.cookie_text{margin-bottom: 24px;font-size: 11px; line-height: 16px}.vid_cookies_text_inner{max-width: 400px; height: 100%; padding: 36px;}} @media(max-width: 599px){.vid_cookies_text_inner{max-width: 400px; height: 100%; padding: 24px;}.cookie-img-m{display: block}.cookie-img{display: none}.cookie_vid_banner{margin: 0 calc(20/375*100vw) 20px;}}</style>')
508
509                        }
510                        /*$('.plyr__video-embed').text('Please enable cookies')*/
511                        $(document).on('click', '.enable_cookies', function () {
512                            /*window.UC_UI.acceptAllConsents().then(() => console.log('All consents are accepted'));*/
513                            window.UC_UI.acceptService("HkocEodjb7", "BJ59EidsWQ").then(() => console.log('Service is accepted'));
514                            window.UC_UI.acceptService("BJ59EidsWQ", "BJ59EidsWQ").then(() => console.log('Service is accepted'));
515                            setTimeout(function () {
516                                window.location.reload()
517                            }, 100)
518                        })
519                        $(document).on('click', '#denyUC', function () {
520                            window.UC_UI.denyAllConsents().then(() => console.log('All consents are denied'));
521                        })
522                    }
523                }
524                window.requestAnimationFrame(updateUCIframe)
525            })
526            return;
527        }
528
529        if (entry.target.className.indexOf('plyr__video-embed') !== -1) {
530            if (entry.target.children.length) {
531                const iframe = entry.target.children[0];
532                if (iframe) {
533                    const src = iframe.getAttribute('data-src');
534                    if (src) {
535                        iframe.setAttribute('src', src);
536                    }
537                }
538            }
539        }
540        const player = new Plyr(entry.target, {
541            controls: controls_el
542        });
543        if (player) {
544            var elem = $(player.elements.original);
545            if (elem.hasClass('plyr-autoplay')) {
546                var options = {
547                    root: null,
548                    rootMargin: '0px',
549                    threshold: 0.2
550                };
551
552                var observer = new IntersectionObserver(function (entries, obs) {
553                    entries.forEach(function (entry) {
554                        /*if(entry.intersectionRatio > 0.2 && !player.playing) {
555                            player.play();
556                        }else{
557                            player.pause();
558                        }*/
559
560                    })
561                }, options);
562                document.querySelectorAll(".plyr-autoplay-vid").forEach(function (item) {
563                    observer.observe(item);
564                })
565            }
566        }
567        otherObserver.unobserve(entry.target)
568    }
569
570    function init_podcast_other_players() {
571        const mainPlyr = document.querySelectorAll('.plyr-player
571-init')
572        if (mainPlyr.length) {
573            const controls_el = $('.plyr-controls-js:not(.plyr-controls-js-podcast)').html();
574            var otherPodcastsObserver = new IntersectionObserver(function (entries, obs) {
575                entries.forEach(function (entry) {
576                    if (entry.isIntersecting) {
577                        if (!window.Plyr && !plyrInitialized) {
578                            initPlyr();
579                            plyrInitialized = true;
580                        }
581                        initOtherSinglePlyr(entry, obs, controls_el)
582                    }
583                })
584            }, {
585                root: null,
586                rootMargin: '0px',
587                threshold: [0]
588            });
589            mainPlyr.forEach(function (podcastPlayer) {
590                otherPodcastsObserver.observe(podcastPlayer);
591            })
592        }
593    }
594
595    window.addEventListener('load', function () {
596        window.requestAnimationFrame(function () {
597            init_podcast_players();
598            init_podcast_other_players()
599
600            function getScrollPos() {
601                return (window.pageYOffset !== undefined)
602                    ? window.pageYOffset
603                    : (document.documentElement || document.body.parentNode || document.body).scrollTop;
604            }
605
606            var lastScroll = getScrollPos();
607            window.addEventListener('scroll', function () {
608                var currentScroll = getScrollPos();
609                if (currentScroll > lastScroll) {
610                    document.body.setAttribute('data-scroll-direction', 'FORWARD')
611                } else if (currentScroll < lastScroll) {
612                    document.body.setAttribute('data-scroll-direction', 'REVERSE')
613                }
614            })
615            initScrollmagicActions();
616        })
617
618        function initScrollmagicActions() {
619            if (window.innerWidth < 1000) {
620                return;
621            }
622            if (!window.TimelineMax || !window.ScrollMagic) {
623                window.requestAnimationFrame(initScrollmagicActions)
624                return;
625            }
626            if (!smcontroller) {
627                smcontroller = new ScrollMagic.Controller();
628            }
629            if (document.body.className.indexOf('changeBg') !== -1) {
630                if (!smcontroller) {
631                    smcontroller = new ScrollMagic.Controller();
632                }
633                var menuColor = $("body").attr("data-menu");
634                var headerBg = new ScrollMagic.Scene({
635                    triggerElement: "#content",
636                    offset: $("#head").height() - $(".header").height()
637                })
638                    //.addIndicators('menu') // add indicators (requires plugin)
639                    .addTo(smcontroller)
640                    .on("start", function () {
641                        $(".header").removeClass(menuColor);
642                    })
643                    .on("update", function (e) {
644                        $("body").attr('data-scroll-direction', e.target.controller().info('scrollDirection'));
645                    })
646                    .on("leave", function () {
647                        $(".header").addClass(menuColor);
648                    });
649            }
650
651
652            $('.stats__container').each(function (e) {
653                if (!smcontroller) {
654                    smcontroller = new ScrollMagic.Controller();
655                }
656                var $this = $(this);
657                var $thisNumber = $this.find('.stats__stat');
658                var thisId = $thisNumber.attr('id');
659                var decimals = $thisNumber.attr('data-decimals');
660                var suffix = $thisNumber.attr('data-suffix');
661                var endVal = parseFloat($thisNumber.attr('data-endVal'));
662                if (!isNaN(endVal)) {
663                    if ($this.closest('.stats').hasClass('stats--horizontal-d'))
664                        $thisNumber.css('width', $this.width() + 30);
665                    var stats_scene = new ScrollMagic.Scene({
666                        triggerElement: this,
667                        triggerHook: 'onEnter',
668                        duration: 0,
669                        offset: 150,
670                        reverse: false
671                    })
672                        .addTo(smcontroller)
673                        .on("enter", function (e) {
674
675                            // quad easeInOut
676                            const easingFn = function (t, b, c, d) {
677                                var ts = (t /= d) * t;
678                                var tc = ts * t;
679                                return b + c * (tc * ts + -5 * ts * ts + 10 * tc + -10 * ts + 5 * t);
680                            }
681                            // qubic easeInOut
682                            /*const easingFn = function (t, b, c, d) {
683                              t /= d;
684                              return t<.5 ? b + c*(4*t*t*t) : b+c*((t-1)*(2*t-2)*(2*t-2)+1);
685                            }*/
686
687                            var options = {
688                                useEasing: true,
689                                useGrouping: false,
690                                separator: ',',
691                                decimal: '.',
692                                suffix: suffix,
693                                easingFn
694                            };
695                            var numAnim = new CountUp(thisId, 0, endVal, decimals, 1.2, options);
696                            if (!numAnim.error) {
697                                numAnim.start();
698                            } else {
699                                console.error(numAnim.error);
700                            }
701                        });
702                }
703
704            });
705
706            $('.chart--vertical, .chart--horizontal').each(function (index) {
707                var $this = $(this);
708                var loopIndex = index;
709                if (!smcontroller) {
710                    smcontroller = new ScrollMagic.Controller();
711                }
712                var $thisValue = $this.find('.chart-value');
713                var fullwidth = $thisValue.attr('data-fullwidth');
714                var chartEndValue = $thisValue.attr('data-stop');
715                var chartEndValueLabel = chartEndValue;
716                var $percentSpan = $thisValue.find('span');
717                $percentSpan.attr('id', 'percentSpan' + loopIndex);
718                var $label = $this.find('.chart-label');
719                var labelValue = parseInt($label.html());
720                $label.attr('id', 'chartLabel' + loopIndex);
721                var offset = $this.height() + 50;
722
723                var chart_scene = new ScrollMagic.Scene({
724                    triggerElement: this,
725                    triggerHook: 'onEnter',
726                    duration: 0,
727                    offset: offset,
728                    reverse: false
729                })
730                    .addTo(smcontroller)
731                    .on("enter", function () {
732                        if (fullwidth) {
733                            chartEndValue = "100";
734                        }
735                        if ($this.hasClass('chart--vertical'))
736                            var tn = TweenMax.to($thisValue, 1.2, {
737                                height: chartEndValue + '%',
738                                ease: Power2.easeInOut,
739                                onUpdate: updateFunction
740                            });
741                        else
742                            var tn = TweenMax.to($thisValue, 1.2, {
743                                width: chartEndValue + '%',
744                                ease: Power2.easeInOut,
745                                onUpdate: updateFunction
746                            });
747
748                        function updateFunction() {
749                            if ($this.hasClass('chart--vertical') && $percentSpan.height() < $thisValue.height()) {
750                                $thisValue.removeClass('chart-value--outside');
751                            }
752                            if ($this.hasClass('chart--horizontal') && $percentSpan.width() < $thisValue.width()) {
753                                $thisValue.removeClass('chart-value--outside');
754                            }
755                        }
756
757                        const easingFn = function (t, b, c, d) {
758                            t /= d;
759                            return t < .5 ? b + c * (2 * t * t) : b + c * (-1 + (4 - 2 * t) * t);
760                        }
761
762                        var numAnim = new CountUp('percentSpan' + loopIndex, 0, chartEndValueLabel, 0, 1.2, {
763                            useEasing: true,
764                            useGrouping: false,
765                            separator: ',',
766                            decimal: '.',
767                            suffix: '%',
768                            easingFn
769                        });
770                        if (!numAnim.error) {
771                            numAnim.start();
772                        } else {
773                            console.error(numAnim.error);
774                        }
775
776                        if (!$label.hasClass('no-anim')) {
777                            numAnim = new CountUp('chartLabel' + loopIndex, 0, labelValue, 0, 1.2, {
778                                useEasing: true,
779                                useGrouping: true,
780                                separator: '.',
781                                decimal: '.',
782                                suffix: '',
783                                easingFn
784                            });
785                            if (!numAnim.error) {
786                                numAnim.start();
787                            } else {
788
789                            }
790                        }
791
792                    })
793                    .on("leave", function (event) {
794                        if ($this.hasClass('chart--vertical'))
795                            TweenMax.to($thisValue, 1, {height: '0%'});
796                        else
797                            TweenMax.to($thisValue, 1, {width: '0%'});
798                    });
799
800            });
801        }
802    })
803    $(document).ready(function () {
804        $('.menu__item-label').on('click', function (e) {
805            if ($(window).width() < 1000) {
806                e.preventDefault();
807                $menu_item = $(this).closest('.menu__item');
808                if (!$menu_item.hasClass('menu__item-active'))
809                    $('.menu__item').removeClass('menu__item-active');
810                $menu_item.toggleClass('menu__item-active');
811            }
812        });
813
814        $('.mobile-menu-dropdown-toggle').on('click', function (e) {
815            $submenu = $(this).closest('.submenu');
816            $submenu.find('.submenu__right-bottom').toggleClass('hidden-p');
817            $submenu.find('.mobile-menu-dropdown-toggle').toggleClass('hidden');
818        });
819
820        // content gallery sliders
821
822        $('.elastic-content__content-gallery').each(function (e) {
823            var $swiper = $(this).find('.swiper-container');
824            var swiper = new Swiper($swiper, {
825                speed: 400,
826                spaceBetween: 0,
827                loop: false,
828                horizontal: true,
829                autoHeight: true,
830                navigation: {
831                    nextEl: $(this).find('.swiper-button-next'),
832                    prevEl: $(this).find('.swiper-button-prev'),
833                },
834                pagination: {
835                    el: '.swiper-pagination',
836                    type: 'fraction',
837                },
838            });
839        })
840        $('[data-toggle="tab"][data-slider="stream"]').click(function () {
841            if (players) {
842                players.forEach(function (player) {
843                    player.pause();
844                });
845            }
846        });
847
848        $('.open, .navi-arrow, .navi-arrow:before, .navi-arrow svg').click(function () {
849            const player = Plyr.setup('.plyr-player-init', {
850                controls: controls_el
851            });
852            setTimeout(function () {
853                const player = Plyr.setup('.plyr-player-init', {
854                    controls: controls_el
855                });
856
857            }, 10);
858            /*if (players) {
859                players.forEach(function(player) {
860                    player.start();
861                });
862            }*/
863        });
864
865
866        // Podcast download
867
868        $(document).on('click', '.podcast-listen-link', function (e) {
869            e.preventDefault();
870            $this = $(this);
871            $clicked_episode = $this.closest('.podcast-episodes__podcast');
872
873            //$('.podcast-player-box').css('background-image', 'url('+$this.attr('data-img')+')');
874            $('.podcast-player-box .post__title').html($clicked_episode.find('.podcast-episode-no').html());
875            $('.podcast-player-box .post__excerpt').html($clicked_episode.find('.podcast-title').html());
876
877            podcast_player.source = {
878                type: 'audio',
879                sources: [
880                    {
881                        src: $this.attr('data-podcast'),
882                        type: 'audio/mp3',
883                    }
884                ],
885            };
886            $(".podcast-download-link").attr('data-url', $this.attr('data-podcast'));
887            $(".podcast-download-link").attr('data-name', $this.attr('data-name'));
888            $('#podcast-newsletter-form').removeClass('hidden');
889            $('#download-form').addClass('hidden');
890        });
891
892        $(document).on('click', '.podcast-download-link', function (e) {
893            e.preventDefault();
894            $this = $(this);
895            $currentEpisodePlayerBox = $this.closest('.podcast-player-box');
896
897            $('#podcast-newsletter-form').toggleClass('hidden');
898            $('#download-form').toggleClass('hidden');
899
900            $('#hb-podcast input[name="download_url"]').val($this.attr('data-url')).change();
901            $('#hb-podcast input[name="download_file_name"]').val($this.attr('data-name')).change();
902
903            /*$('#podcast-download-form').find('.download-episode-no').html($currentEpisodePlayerBox.find('.post__title').html());
904            $('#podcast-download-form').find('.form').html($currentEpisodePlayerBox.find('audio source').attr('src'));*/
905
906
907        });
908
909        // File download
910
911        function hbDownloadFill(href, name, elem) {
912            if (!window.hbspt || !$('#download-form input[name="download_url"]').length || !$('#download-form input[name="download_file_name"]').length) {
913                window.requestAnimationFrame(function () {
914                    hbDownloadFill(href, name, elem);
915                })
916                return;
917            }
918            var $downloadBox = elem.closest('.download-box');
919            var downloadForm = $('#download-form');
920            if (!downloadForm.attr('data-clicked')) {
921                downloadForm.attr('data-clicked', href);
922                downloadForm.find('.download-file-name').html(elem.attr('data-name'));
923                $('#download-form input[name="download_url"]').val(elem.attr('href')).change();
924                $('#download-form input[name="download_file_name"]').val(elem.attr('data-name')).change();
925                $('.just_work').text(elem.attr('href')).change();
926                $('.just_work_url').text(elem.attr('data-name')).change();
927            } else {
928                if (downloadForm.attr('data-clicked') == elem.attr('href')) {
929                    downloadForm.attr('data-clicked', elem.attr('href'));
930                    downloadForm.find('.download-file-name').html(elem.attr('data-name'));
931                    $('#download-form input[name="download_url"]').val(elem.attr('href')).change();
932                    $('#download-form input[name="download_file_name"]').val(elem.attr('data-name')).change();
933                } else {
934                    downloadForm.attr('data-clicked', elem.attr('href'));
935                    downloadForm.find('.download-file-name').html(elem.attr('data-name'));
936                    $('#download-form input[name="download_url"]').val(elem.attr('href')).change();
937                    $('#download-form input[name="download_file_name"]').val(elem.attr('data-name')).change();
938                    if (downloadForm.hasClass('hidden')) {
939                        downloadForm.removeClass('hidden');
940                    }
941                }
942            }
943            /*if($(window).width() < 768) {*/
944            $('#downloads').css('height', "auto");
945            /*}*/
946        }
947
948        $(document).on('click', '.file-download-link', function (e) {
949            if (!$('body').hasClass('page-template-page-tickets_lp')) {
950                e.preventDefault();
951                var href = $(this).attr('href');
952                var name = $(this).attr('data-name');
953                $('#download-form').toggleClass('hidden');
954                hbDownloadFill(href, name, $(this))
955
956            }
957            $('body').addClass('overflow-hidden');
958        });
959
960
961        // photoswipe
962
963        var openPhotoSwipe = function (clicked_index, items) {
964            clickedPswp = clicked_index;
965            var thumbnail;
966            var pswpElement = document.querySelectorAll('.pswp')[0];
967            var options = {
968                barsSize: {top: 40, bottom: 40},
969                index: clicked_index,
970                history: false,
971                showHideOpacity: true,
972                simulateTouch: true,
973                bgOpacity: 0.9,
974                captionEl: true,
975                maxSpreadZoom: 1,
976                arrowEl: true,
977                clickToCloseNonZoomable: false,
978                getDoubleTapZoom: function (isMouseClick, item) {
979                    return item.initialZoomLevel;
980                },
981                fullscreenEl: false,
982                zoomEl: false,
983                shareEl: false,
984                counterEl: false,
985                getThumbBoundsFn: function (index) {
986                    if (!$('.pswp-open')[index]) {
987                        thumbnail = $('.pswp-open')[clickedPswp];
988                    } else {
989                        thumbnail = $('.pswp-open')[index];
990                    }
991                    var pageYScroll = window.pageYOffset || document.documentElement.scrollTop;
992                    var rect = thumbnail.getBoundingClientRect();
993                    return {x: rect.left, y: rect.top + pageYScroll, w: rect.width};
994                }
995            };
996            window.gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
997            window.gallery.init();
998        };
999        $(document).on('click', '.pswp-open', function (e) {
1000            e.preventDefault();
1001            openPhotoSwipe($('.pswp-open').index($(this)), pswp_items);
1002        });
1003
1004        var openPhotoSwipe2 = function (clicked_index, items) {
1005            var clickedPswp = clicked_index;
1006            var thumbnail;
1007            var pswpElement = document.querySelectorAll('.pswp')[0];
1008            var options = {
1009                barsSize: {top: 40, bottom: 40},
1010                index: clicked_index,
1011                history: false,
1012                showHideOpacity: true,
1013                bgOpacity: 0.9,
1014                captionEl: true,
1015                maxSpreadZoom: 1,
1016                clickToCloseNonZoomable: false,
1017                getDoubleTapZoom: function (isMouseClick, item) {
1018                    return item.initialZoomLevel;
1019                },
1020                fullscreenEl: false,
1021                zoomEl: false,
1022                shareEl: false,
1023                counterEl: false,
1024                focus: true,
1025                /* getThumbBoundsFn: function (index) {
1026                   thumbnail = jQuery('.pswp-open[data-index='+index+']');
1027                   if (!thumbnail.length) {
1028                     thumbnail = jQuery('.pswp-open')[clickedPswp];
1029                   } else {
1030                     thumbnail = thumbnail[0];
1031                   }
1032                   var pageYScroll = window.pageYOffset || document.documentElement.scrollTop;
1033                   var rect = thumbnail.getBoundingClientRect();
1034                   return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
1035                 }*/
1036            };
1037
1038            window.gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
1039            window.gallery.init();
1040            window.gallery.listen('afterChange', function () {
1041                const player = Plyr.setup('.plyr-player-init', {
1042                    controls: controls_el
1043                });
1044                setTimeout(function () {
1045                    const player = Plyr.setup('.plyr-player-init', {
1046                        controls: controls_el
1047                    });
1048
1049                }, 10);
1050            });
1051
1052        };
1053        jQuery(document).on('click', '.open', function (e) {
1054            e.preventDefault();
1055            var id = jQuery(this).attr('data-index');
1056            if (!id) {
1057                id = jQuery('.pswp-open').index(jQuery(this));
1058            }
1059            openPhotoSwipe2(parseInt(id), window.pswp_items);
1060        });
1061
1062
1063        // ics - add to calendar
1064
1065        // $(document).on('click', '.ics-js-link', function(e){
1066        //     e.preventDefault();
1067        //     var $this = $(this);
1068        //     var cal = icsFormatter();
1069        //     var begin = new Date($this.attr('data-begin'));
1070        //     var end = new Date(begin.getTime() + 30*60000);
1071        //     cal.addEvent($this.attr('data-subject'), 'description', $this.attr('data-location'), begin.toUTCString(), end.toUTCString());
1072        //     cal.download($this.attr('data-slug'));
1073        // });
1074
1075        // countup
1076
1077        window.scrollOffset;
1078        var updateScrollOffset = debounce(function () {
1079            if ($(document).width() > 999) {
1080                var mp = (2 * 0.625 / 100) * $(window).width();
1081            }
1082            if ($(document).width() <= 999) {
1083                var mp = (2 * 1.17188 / 100) * $(window).width();
1084            }
1085            if ($(document).width() <= 500) {
1086                var mp = (2 * 2.66667 / 100) * $(window).width();
1087            }
1088            window.scrollOffset = parseInt(mp + $('.menu__brand').height() + 1);
1089        }, 100);
1090        updateScrollOffset();
1091        window.addEventListener('resize', updateScrollOffset);
1092
1093        $(".scroll-slider-link").on("click", function (e) {
1094            e.preventDefault();
1095            e.stopPropagation();
1096            var link_href = $(this).attr('href');
1097            var link_page = link_href.substring(0, link_href.indexOf("#"));
1098            var section_id = link_href.substring(link_href.indexOf("#"));
1099            var target = $(this).attr('data-target');
1100            $('[data-toggle="tab"][data-target="' + target + '"]').trigger('click');
1101            TweenMax.to(window, 0.5, {scrollTo: {y: section_id, offsetY: window.scrollOffset, autoKill: false}});
1102        });
1103
1104        $("a[href*='#']:not([data-toggle='tab']):not(.scroll-slider-link):not(.no-sectionscroll)").on("click", function (e) {
1105            e.preventDefault();
1106            e.stopPropagation();
1107            var link_href = $(this).attr('href');
1108            var link_page = link_href.substring(0, link_href.indexOf("#"));
1109            var section_id = link_href.substring(link_href.indexOf("#"));
1110
1111            if (link_page == '' || link_page == window.location.origin + window.location.pathname) {
1112                TweenMax.to(window, 0.5, {scrollTo: {y: section_id, offsetY: window.scrollOffset, autoKill: false}});
1113                history.pushState("", document.title, section_id);
1114                $('body').removeClass('menu--opened');
1115            } else {
1116                if ($(this).hasClass("newTab")) {
1117                    window.open(link_href, '_blank');
1118                } else {
1119                    window.location.href = link_href;
1120                }
1121            }
1122        });
1123
1124        if (location.hash && $(location.hash).length > 0) {
1125            setTimeout(function () {
1126                if (window.TweenMax) {
1127                    TweenMax.to(window, 0.1, {
1128                        scrollTo: {
1129                            y: location.hash,
1130                            offsetY: window.scrollOffset,
1131                            autoKill: true
1132                        }
1133                    });
1134                }
1135            }, 1000);
1136        }
1137
1138        // url update
1139        // var currentPage = window.location.href.match(/\/(\w+)\//);
1140        // var hash = window.location.hash
1141        // var slug = $(this).closest('.tabs').attr('data-slug');
1142        // history.pushState("", document.title, slug+'/'+id);
1143
1144        // Speakers text animation
1145
1146        if ($('body').hasClass('single-exhibitors') || $('body').hasClass('single-speakers'))
1147            animateGuideSpeakers();
1148
1149        /* PDF doenload fixed overlay*/
1150
1151        $('.pdf-overlay-close').click(function () {
1152            $('.pdf-download-overlay').addClass('hidden');
1153        });
1154
1155        $('.pdf-download-overlay-link').click(function (e) {
1156            e.preventDefault();
1157            var url_params = '';
1158            jQuery.each(window.terms, function (k, values) {
1159                if (values.length > 0) {
1160                    url_params += "/" + k + "/";
1161                }
1162                if (values.length > 0) {
1163                    jQuery.each(values, function (i, term) {
1164                        if (k == 'topics') {
1165                            var filterItem = $('.filter-guide-item[data-slug="' + term.slug + '"]').closest('.filter__item');
1166                            if (filterItem.hasClass('filter__item--checked') && !filterItem.hasClass('hidden'))
1167                                url_params += term.slug + "+";
1168                        } else {
1169                            url_params += term.slug + "+";
1170                        }
1171                    });
1172                    url_params = url_params.substr(0, url_params.length - 1);
1173                }
1174            });
1175            var download_url = $(this).attr('href').replace(/\/$/, "");
1176            window.open(download_url + url_params, '_blank');
1177        });
1178
1179    });
1180
1181    function animateGuideSpeakers() {
1182        $('.guide__title').each(function () {
1183            startGuideAnimation($(this));
1184        });
1185        $('.guide--animation--1x1').each(function () {
1186            startGuideAnimation($(this));
1187        });
1188    }
1189
1190    var tweenNo = 0;
1191    var guideTweens = [];
1192    var r = 50;
1193    var adjustJank = 0;
1194
1195    function startGuideAnimation(elem) {
1196        if (!elem.hasClass('animation-running')) {
1197            elem.attr('style', '');
1198            var textSpan = elem.find('span');
1199            var d = textSpan.width();
1200            if (elem.hasClass('guide__title')) {
1201                if ($(window).width() > 500) {
1202                    var parentElem = elem.closest('.guide__content');
1203                    var dateElemWidth = parentElem.find('.guide__date').width();
1204                    var categoryWidth = parentElem.find('.guide__type').width();
1205                    var avSpace = parentElem.innerWidth() - categoryWidth - dateElemWidth;
1206                    var avSpacePx = avSpace;
1207                } else {
1208                    var parentElem = elem.closest('.guide__title-container');
1209                    var avSpace = parentElem.width();
1210                    var avSpacePx = avSpace;
1211                }
1212            } else {
1213                var avSpace = elem.width();
1214                var avSpacePx = avSpace;
1215            }
1216            elem.css('max-width', avSpacePx);
1217            if (d > avSpacePx && d !== 0) {
1218                if (elem.find('span').length == 1) {
1219                    textSpan.text(textSpan.text() + ', ');
1220                    textSpan.clone().appendTo(textSpan.parent());
1221                }
1222                textSpan.parent().parent().css("max-width", avSpace);
1223                d = textSpan.width();
1224                var t = d / r;
1225                textSpan.parent().attr('data-tweenid', 'tween' + tweenNo);
1226                guideTweens['tween' + tweenNo] = TweenMax.fromTo(
1227                    textSpan.parent(),
1228                    t,
1229                    {
1230                        x: 0,
1231                    },
1232                    {
1233                        x: "-" + (d + adjustJank),
1234                        ease: Linear.easeNone,
1235                        repeat: -1,
1236                    }
1237                );
1238                tweenNo = tweenNo + 1;
1239                elem.addClass('animation-running');
1240            }
1241        }
1242    }
1243
1244    function resetGuideSpeakers() {
1245        $('.guide__title.animation-running').each(function () {
1246            resetGuideAnimation($(this));
1247        });
1248        $('.guide--animation--1x1.animation-running').each(function () {
1249            resetGuideAnimation($(this));
1250        });
1251    }
1252
1253    function resetGuideAnimation(elem) {
1254        elem.attr('style', '');
1255        var textSpan = elem.find('span');
1256        var d = textSpan.width();
1257        if (elem.hasClass('guide__title')) {
1258            if ($(window).width() > 500) {
1259                var parentElem = elem.closest('.guide__content');
1260                var dateElemWidth = parentElem.find('.guide__date').width();
1261                var categoryWidth = parentElem.find('.guide__type').width();
1262                var avSpace = parentElem.innerWidth() - categoryWidth - dateElemWidth;
1263                var avSpacePx = avSpace;
1264            } else {
1265                var parentElem = elem.closest('.guide__title-container');
1266                var avSpace = parentElem.width();
1267                var avSpacePx = avSpace;
1268            }
1269        } else {
1270            var avSpace = elem.width();
1271            var avSpacePx = avSpace;
1272        }
1273        elem.css('max-width', avSpacePx);
1274        if (d > avSpacePx && d !== 0) {
1275            textSpan.parent().parent().css("max-width", avSpace);
1276            d = textSpan.width();
1277            var t = d / r;
1278            guideTweens[textSpan.parent().attr('data-tweenid')].kill();
1279            guideTweens[textSpan.parent().attr('data-tweenid')] = TweenMax.fromTo(
1280                textSpan.parent(),
1281                t,
1282                {
1283                    x: 0,
1284                },
1285                {
1286                    x: "-" + (d + adjustJank),
1287                    ease: Linear.easeNone,
1288                    repeat: -1,
1289                }
1290            );
1291        }
1292    }
1293
1294    var resizeGuideAnimation = debounce(function () {
1295        resetGuideSpeakers();
1296        animateGuideSpeakers();
1297    }, 300);
1298    window.addEventListener('resize', resizeGuideAnimation);
1299
1300// MS end
1301
1302    $(document).ready(function () {
1303        $(".video-click").click(function () {
1304            $(".lightbox_video").removeClass('d-none')
1305        });
1306        $(".lightbox_video").click(function (e) {
1307            var target = $(e.target)
1308            if (target.hasClass('lightbox_video')) {
1309                $(".lightbox_video").addClass('d-none')
1310            }
1311        });
1312        $(".icon-arrow").click(function () {
1313            $(".lightbox_video").addClass('d-none')
1314        });
1315        $(document).keyup(function (e) {
1316            if (e.keyCode === 27) $(".lightbox_video").addClass('d-none');   // esc
1317        });
1318    });
1319
1320
1321    $('#buttonn, .btn').mousemove(function (e) {
1322        var parentOffset = $(this).parent().offset()
1323        var x = e.pageX - parentOffset.left;
1324        var y = e.pageY - parentOffset.top;
1325        e.target.style.setProperty('--x', "".concat(x, "px"));
1326        e.target.style.setProperty('--y', "".concat(y, "px"));
1327    });
1328
1329});

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.