{"version":3,"sources":["common/js/components/videoHeroComponent.js"],"names":["playVideoBasedOnScreenSize","$","each","i","breakpoint","value","load","play","pause","bindCaretClick","on","$nextSection","this","closest","next","animate","scrollTop","offset","top","height","updateVideoVisibilityOnDebouncedResize","debounce","window","addEventListener","jQuery"],"mappings":"AAeA,SAASA,6BACPC,EAAE,6BAA6BC,KAAK,SAAUC,GACnB,OAArBC,WAAWC,OAEbJ,EAAE,6BAA6BE,GAAGG,OAClCL,EAAE,6BAA6BE,GAAGI,QAElCN,EAAE,6BAA6BE,GAAGK,UAOxC,SAASC,iBACPR,EAAE,8BAA8BS,GAAG,QAAS,WAC1C,IAAIC,aAAeV,EAAEW,MAAMC,QAAQ,uBAAuBC,OAI1D,OAHAb,EAAE,cAAcc,SACdC,UAAWL,aAAaM,SAASC,IAAMjB,EAAE,mCAAmCkB,UAC3E,MACI,KAnCX,SAAWlB,GACTD,6BACAS,iBAGA,IAAIW,uCAAyCC,SAAS,WACpDrB,8BACC,KACHsB,OAAOC,iBAAiB,SAAUH,wCARpC,CASGI","file":"../../../../common/js/components/videoHeroComponent-2b98c77257.js","sourcesContent":["(function ($) {\n playVideoBasedOnScreenSize();\n bindCaretClick();\n\n /* Throttled window resize event*/\n var updateVideoVisibilityOnDebouncedResize = debounce(function () {\n playVideoBasedOnScreenSize();\n }, 250);\n window.addEventListener('resize', updateVideoVisibilityOnDebouncedResize);\n})(jQuery);\n\n/*If page is initially loaded in mobile mode, make sure the video starts when\r\nwindow is resized to match desktop media queries.\r\nIf page is initially loaded in desktop mode, make sure the video pauses\r\nwhen window is resized to match mobile media queries. */\nfunction playVideoBasedOnScreenSize() {\n $(\".videoHeroComponent-video\").each(function (i) {\n if (breakpoint.value === \"lg\") {\n // Cannot include \"md\" because iPad in landscape reports as \"md\", but is not able to autoplay video which is a requirement.\n $(\".videoHeroComponent-video\")[i].load();\n $(\".videoHeroComponent-video\")[i].play();\n } else {\n $(\".videoHeroComponent-video\")[i].pause();\n }\n });\n}\n\n/* Click on the caret scrolls down to the next component since we have\r\nno idea if a \"Select category\" component is actually added to the page */\nfunction bindCaretClick() {\n $(\".videoHeroComponent-button\").on('click', function () {\n var $nextSection = $(this).closest(\".videoHeroComponent\").next();\n $('html, body').animate({\n scrollTop: $nextSection.offset().top - $(\".navigationMainComponent-navbar\").height()\n }, 300);\n return false;\n });\n}"]}