var BREAKPOINTS={DESKTOP:1024,TABLET:912,MOBILE:576};window.setPortalHeroVideoHeight=function(){var i=$("#fac-filters-wrapper").height(),c=$("#trd-header").height(),n=$("#hero-video"),t=$(".video-home").data("desktop-url"),r=$(".video-home").data("mobile-url"),l=$(".site-logo-container"),u=n&&n.length&&t&&t.length&&r&&r.length,f="video-home__video--horizontal",e="video-home__video--vertical",o=$(window).outerHeight(),s=window.innerWidth,h;s>=BREAKPOINTS.DESKTOP&&u&&(n.attr("src",t),n.removeClass(e).addClass(f));(vrcIsPhone.any()||s<=BREAKPOINTS.TABLET)&&u&&(facFiltersHeight=$(".fac-filters").height(),facFilterHeight=$(".fac-filters li").outerHeight(!0),i=i-facFiltersHeight+facFilterHeight,n.attr("src",r),n.removeClass(f).addClass(e));h=o-c-i;o<BREAKPOINTS.MOBILE&&s>BREAKPOINTS.MOBILE&&u&&(h=o-c,l.hide(),n.attr("src",t),n.removeClass(e).addClass(f));$("#trd-hero-video, #hero-video, .hero-fallback").css("height",h)};window.getPortalHeroVideoHeight=vcDebounce(function(){window.setPortalHeroVideoHeight()},200,!1);window.sendDateToServer=function(n){const i=new Date;i.setHours(i.getHours()+2);const r=i.toISOString();var t=new XMLHttpRequest;t.open("POST",n,!0);t.setRequestHeader("Content-Type","application/json");t.send(JSON.stringify({date:r}));t.onreadystatechange=function(){t.readyState===4&&console&&console.log("VRC ||| Date sent to server ")}};window.wireupVideo=function(){var i=$("#trd-hero-play-video"),r=$("#trd-hero-pause-video"),t,n;if($(".hero-overlay, .hero-text").show(),t=$("#hero-video"),t==null||t.size()==0){window.showFallbackImages();return}try{if(typeof Vimeo!="object"&&typeof Vimeo.Player!="function"){window.showFallbackImages();return}if(n=new Vimeo.Player(t[0]),typeof n!="object"&&typeof n.play!="function"&&typeof n.on!="function"&&typeof n.getPaused!="function"){window.showFallbackImages();return}n.on("playing",function(){i.hide().attr("aria-pressed",!0);r.show().attr("aria-pressed",!1)});n.on("error",function(){window.showFallbackImages()});n.getDuration().then(function(){n.play().then(function(){}).catch(function(){window.showFallbackImages()})}).catch(function(){window.showFallbackImages()});$("#trd-hero-pause-video, #trd-hero-play-video").on("click",function(){n.getPaused().then(function(t){t?(n.play(),i.hide().attr("aria-pressed",!0),r.show().attr("aria-pressed",!1)):(n.pause(),i.show().attr("aria-pressed",!1),r.hide().attr("aria-pressed",!0))}).catch(function(){window.showFallbackImages()})})}catch(u){window.showFallbackImages()}};window.showFallbackImages=function(){$("#trd-hero-video .hero-fallback, #trd-hero-video .hero-overlay, #trd-hero-video .hero-text").show();$("#hero-video").hide();var n=navigator.userAgent||"";n&&n.toLowerCase().indexOf("bot")===-1&&window.sendDateToServer("/utility/LogHomepageVideoError")};$(document).ready(function(){window.setPortalHeroVideoHeight();window.wireupVideo();var n=$(window).width();$(window).resize(function(){var t=$(window).width();t!==n&&($("#hero-video").attr("src",""),window.getPortalHeroVideoHeight(),n=t)})})