"use strict";(self.bxpChunk=self.bxpChunk||[]).push([[1535],{13916:(e,t,i)=>{i.r(t),i.d(t,{default:()=>v});var o=i(65311),a=i(28784),n=i(16722),r=i(7242);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function l(e,t,i){return(t=u(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e,t){for(var i=0;ivideo thumbnail';"modal"!==this.behavior&&"overlaySection"!==this.behavior||this.modal.$overlay.on("modal.hide",(function(){e.modal.$modalContent.html("")}));var t=document.createElement("iframe");return t.setAttribute("src","https://player.vimeo.com/video/"+e.videoId+"?api=1&autoplay=1&player_id=vimeoplayer-"+e.videoId+"-"+e.uniqueId),t.id="vimeoplayer-"+e.videoId+"-"+e.uniqueId,t.width=e.vidWidth,t.height=e.vidHeight,this.player=t,this.player}},{key:"onclick",value:function(e,t){if(t||e.preventDefault(),this.imWidth=window.innerWidth-40,this.behavior.match(/replaceImage|playOnPageLoad/)&&(this.imWidth=o("img",this.domRoot).width()),this.vidWidth=window.innerWidth<1024||this.behavior.match(/replaceImage|playOnPageLoad/)?this.imWidth:1024,this.vidHeight=.5625*this.vidWidth,"vimeo"===this.source&&this.onVimeoIframeAPIReady(),"none"===this.behavior);else if(this.behavior.match(/replaceImage|playOnPageLoad/))this.domRoot.find(".vid-thumb").html(this.getVidPlayer());else{if(!this.modal)if("overlaySection"===this.behavior){var i=this.domRoot.closest("section, .container-fluid");i.height()<576&&(this.vidHeight=i.outerHeight(),this.vidWidth=1.7777*this.vidHeight),this.modal=new r.default({modalType:"video",fixed:!1,centerVertically:!1,modalContainer:i,id:this.params.videoId})}else this.modal=new r.default({modalType:"video"});this.modal.$modalContent.html(this.getVidPlayer.bind(this)),"overlaySection"===this.behavior&&this.modal.$overlay.on("modal.show",o.proxy((function(){this.modal.params.modalContainer.addClass("modal-video")}),this)).on("modal.hide",o.proxy((function(){this.modal.params.modalContainer.removeClass("modal-video")}),this)),this.modal.show(),this.modal.place()}"youtube"===this.source&&this.onYouTubeIframeAPIReady()}},{key:"onVimeoIframeAPIReady",value:function(){window.addEventListener?window.addEventListener("message",this.onVimeoMessage.bind(this),!1):window.attachEvent("onmessage",this.onVimeoMessage.bind(this),!1)}},{key:"onYouTubeIframeAPIReady",value:function(){var e=this;e.player=new YT.Player("player-"+e.videoId+"-"+e.uniqueId,{width:e.vidWidth,height:e.vidHeight,videoId:e.videoId,playerVars:{autoplay:1,rel:0,origin:window.location.origin,widget_referrer:window.location.origin},events:{onReady:e.onPlayerReady.bind(e),onStateChange:e.onYoutubeStateChange.bind(e)}}),"modal"!==e.behavior&&"overlaySection"!==e.behavior||e.modal.$overlay.on("modal.hide",(function(){e.userLeftPage=!0,e.player.pauseVideo&&setTimeout((function(){return e.player.pauseVideo()}),500)})),window.onbeforeunload=function(){e.userLeftPage=!0,e.player.pauseVideo&&setTimeout((function(){return e.player.pauseVideo()}),500)}}},{key:"onPlayerReady",value:function(e){this.isPlayOnPageLoad&&(e.target.mute(),e.target.playVideo())}},{key:"onYoutubeStateChange",value:function(e){var t=e.target.getCurrentTime(),i=t/e.target.getDuration()*100,o={event:"Interaction",eventComponent:"Video",videoTitle:e.target.getVideoData().title,videoId:e.target.getVideoData().video_id,videoURL:e.target.getVideoUrl(),pageURL:window.location.href,currentTime:this.secsToTime(t),currentPercentage:Math.round(10*i)/10};switch(e.data){case YT.PlayerState.PLAYING:o.eventType=t<1?"video_started":"video_resumed",n.Z.trackEvent("Video-Event",o);break;case YT.PlayerState.PAUSED:o.eventType=this.userLeftPage?"video_abandoned":"video_paused",n.Z.trackEvent("Video-Event",o);break;case YT.PlayerState.ENDED:o.eventType="video_completed",n.Z.trackEvent("Video-Event",o);break;default:return}}},{key:"onVimeoMessage",value:function(e){var t=this;if(!/^https?:\/\/player.vimeo.com/.test(e.origin))return!1;"*"===this.playerOrigin&&(this.playerOrigin=e.origin);var i=JSON.parse(e.data),o={event:"Interaction",eventComponent:"Video",videoId:t.videoId,videoURL:"https://vimeo.com/"+t.videoId,pageURL:window.location.href,currentTime:t.secsToTime(i.data?i.data.seconds:0),currentPercentage:i.data?i.data.percent:0};switch(i.event){case"ready":t.onVimeoReady();break;case"play":o.eventType="0s"===o.currentTime?"video_started":"video_resumed",n.Z.trackEvent("Video-Event",o);break;case"pause":o.eventType=t.userLeftPage?"video_abandoned":"video_paused",n.Z.trackEvent("Video-Event",o);break;case"finish":o.eventType="video_completed",n.Z.trackEvent("Video-Event",o)}}},{key:"vimeoPost",value:function(e,t){var i=o("#vimeoplayer-"+this.videoId+"-"+this.uniqueId),a={method:e};t&&(a.value=t);var n=JSON.stringify(a);i[0]&&i[0].contentWindow.postMessage(n,this.playerOrigin)}},{key:"onVimeoReady",value:function(){this.vimeoPost("addEventListener","play"),this.vimeoPost("addEventListener","pause"),this.vimeoPost("addEventListener","finish")}},{key:"secsToTime",value:function(e){return(e>=3600?Math.floor(e/3600)+"h ":"")+(e>=60?Math.floor(e%3600/60)+"m ":"")+(e>=0?Math.floor(e%3600%60)+"s":"")}}])&&h(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()}}]); //# sourceMappingURL=/static/master/9671/assets/build/js/chunks/e02aecbed616cb.js.map