if (self.CavalryLogger) { CavalryLogger.start_js(["hbfFd"]); }

__d("VideoChannelLoggerEvents",[],(function a(b,c,d,e,f,g){f.exports=Object.freeze({SESSION_START:"session_start",SESSION_PAUSE:"session_pause",SESSION_RESUME:"session_resume",SESSION_END:"session_end",IMPRESSION:"impression",VPV:"vpv",CLICK:"click",WATCH_SUMMARY:"watch_summary",FOLLOW:"follow",UNFOLLOW:"unfollow",SUBSCRIBE:"subscribe",SUBSCRIBE_SOME:"subscribe_some",UNSUBSCRIBE:"unsubscribe",PIN_TOPIC:"pin_topic",UNPIN_TOPIC:"unpin_topic",MARK_VISIT:"mark_visit",AUTO_ADVANCE:"auto_advance",STORY_FETCH_RESULTS:"story_fetch_results",FETCH_FIRST_STORY:"fetch_first_story_success",FETCH_STORIES_FROM_ENTQUERY:"fetch_stories_from_entquery",FETCH_STORIES_FORWARD:"fetch_stories_forward",FETCH_STORIES_BACKWARD:"fetch_stories_backward",FETCH_CHANNEL_PIVOTS:"fetch_channel_pivots_success",APPEND_CHANNEL_PIVOTS:"append_channel_pivots",FETCH_FIRST_STORY_SUCCESS:"fetch_first_story_success",FETCH_FIRST_STORY_ERROR:"fetch_first_story_error",FETCH_STORIES_FROM_ENTQUERY_SUCCESS:"fetch_stories_from_entquery_success",FETCH_STORIES_FROM_ENTQUERY_ERROR:"fetch_stories_from_entquery_error",FETCH_STORIES_FORWARD_SUCCESS:"fetch_stories_forward_success",FETCH_STORIES_FORWARD_ERROR:"fetch_stories_forward_error",FETCH_STORIES_BACKWARD_SUCCESS:"fetch_stories_backward_success",FETCH_STORIES_BACKWARD_ERROR:"fetch_stories_backward_error"})}),null);
__d("VideoChannelLoggerFields",[],(function a(b,c,d,e,f,g){f.exports=Object.freeze({DEPTH_LEVEL:"depth_level",EVENT_TARGET:"event_target",EVENT_TARGET_INFO:"event_target_info",ENTRY_POINT:"entry_point",ENTRY_POINT_TYPE:"entry_point_type",ENTRY_POINT_VALUE:"entry_point_value",EXIT_POINT_TYPE:"exit_point_type",EXIT_POINT_VALUE:"exit_point_value",FOLLOW_SURFACE:"follow_surface",EVENT:"event",HAS_STORY_FETCH_CURSOR:"has_story_fetch_cursor",IS_AD:"is_ad",IS_EMPLOYEE:"is_employee",IS_TEST_USER:"is_test_user",PERF_TIME_MS:"perf_time_ms",REQUEST_STATUS:"request_status",HAS_NEXT_PAGE:"has_next_page",POSITION_IN_CHANNEL:"position_in_channel",SESSION_ID:"session_id",SUBSCRIPTION_SURFACE:"subscription_surface",STORY_ID:"story_id",STORY_FETCH_COUNT:"story_fetch_count",STORY_FETCH_CURSOR:"story_fetch_cursor",STORY_FETCH_LIMIT:"story_fetch_limit",TIME_SINCE_START:"time_since_start",TRACKING_DATA:"tracking_data",VIDEO_ID:"video",VIDEO_ID_OVERRIDE:"video_id_override",VIDEO_CHAINING_CALLER:"video_chaining_caller",VIDEO_CHANNEL_ID:"video_channel_id",VIDEO_CHANNEL_TYPE:"video_channel_type",VIDEO_CHANNEL_TITLE:"video_channel_title",VIDEO_HOME_SESSION_ID:"video_home_session_id",WATCH_TIME_S:"watch_time_s"})}),null);
__d("VideoChannelLogger",["Arbiter","Banzai","BanzaiLogger","Run","VideoChannelLoggerEvents","VideoChannelLoggerFields","VideoChannelViewChainLengthManager","VideoChannelViewVariables"],(function a(b,c,d,e,f,g){__p&&__p();var h=c("VideoChannelViewVariables").channelPivots,i=0,j=null,k=null,l=null,m=0,n=null,o={startSession:function p(q,r,s){__p&&__p();j=r;l=s;k=q;c("Arbiter").inform("LogEnterChannel",r);c("VideoChannelViewChainLengthManager").registerVideoID(q,q);var t={};t[c("VideoChannelLoggerFields").EVENT]=c("VideoChannelLoggerEvents").SESSION_START;o.log(t);i=Date.now();c("Run").onLeave(o.endSession);c("Banzai").subscribe(c("Banzai").SHUTDOWN,o.endSession)},endSession:function p(){__p&&__p();if(j){c("Arbiter").inform("LogExitChannel",j);var q={};q[c("VideoChannelLoggerFields").EVENT]=c("VideoChannelLoggerEvents").SESSION_END;o.log(q);j=null;k=null;l=null;n=null;i=0}},setOffset:function p(q){m=q},setPosition:function p(q){n=q},setChannel:function p(q){j=q},getPlayerLoggingData:function p(){if(!j)return{};return{video_channel_id:j,position_in_channel:n+m}},log:function p(q){__p&&__p();var r=c("VideoChannelViewChainLengthManager").getLoggingData(k);q[c("VideoChannelLoggerFields").SESSION_ID]=r.video_chaining_session_id;if(!h)q[c("VideoChannelLoggerFields").VIDEO_CHANNEL_ID]=j;q[c("VideoChannelLoggerFields").VIDEO_CHAINING_CALLER]=l;if(!(c("VideoChannelLoggerFields").POSITION_IN_CHANNEL in q))q[c("VideoChannelLoggerFields").POSITION_IN_CHANNEL]=n+m;if(i){var s=Date.now()-i;q[c("VideoChannelLoggerFields").TIME_SINCE_START]=s+.001}c("BanzaiLogger").log("VideoChannelLoggerConfig",q)}};f.exports=o}),null);
__d("VideoChannelProgressCircle.react",["cx","React","ReactDOM","Style"],(function a(b,c,d,e,f,g,h){__p&&__p();var i,j,k=c("React").PropTypes;i=babelHelpers.inherits(l,c("React").PureComponent);j=i&&i.prototype;function l(){var m,n;"use strict";for(var o=arguments.length,p=Array(o),q=0;q<o;q++)p[q]=arguments[q];return n=(m=j.constructor).call.apply(m,[this].concat(p)),this.$VideoChannelProgressCircle1=null,this.$VideoChannelProgressCircle2=0,n}l.prototype.componentDidMount=function(){"use strict";this.drawProgressCircle(this.props)};l.prototype.componentWillUnmount=function(){"use strict";clearInterval(this.$VideoChannelProgressCircle1)};l.prototype.componentWillReceiveProps=function(m){"use strict";if(m.makeProgress!==this.props.makeProgress||m.timeoutSec!==this.props.timeoutSec)this.drawProgressCircle(m)};l.prototype.drawProgressCircle=function(m){"use strict";__p&&__p();var n=c("ReactDOM").findDOMNode(this.refs.progressCircle),o=this.$VideoChannelProgressCircle2,p=o/100;c("Style").set(n,"stroke-dashoffset",o+"px");clearInterval(this.$VideoChannelProgressCircle1);if(m.makeProgress)this.$VideoChannelProgressCircle1=setInterval(function(){o-=p;c("Style").set(n,"stroke-dashoffset",o+"px");if(o<=0){clearInterval(this.$VideoChannelProgressCircle1);c("Style").set(n,"stroke-dashoffset","0px");m.onProgressDone&&m.onProgressDone()}}.bind(this),m.timeoutSec*10)};l.prototype.render=function(){"use strict";var m=this.props.watchAndScroll?34:80,n=this.props.watchAndScroll?2:4,o=m/2,p=o-n/2;this.$VideoChannelProgressCircle2=p*2*Math.PI;return c("React").createElement("div",null,c("React").createElement("svg",{className:"_20_8"},c("React").createElement("circle",{cx:o,cy:o,r:p,stroke:"#ffffff",strokeWidth:n,strokeDasharray:this.$VideoChannelProgressCircle2,fill:"transparent"}),c("React").createElement("circle",{ref:"progressCircle",cx:o,cy:o,r:p,stroke:"#5890ff",strokeWidth:n,strokeDasharray:this.$VideoChannelProgressCircle2,fill:"transparent"})),this.props.children)};l.propTypes={children:k.element,makeProgress:k.bool.isRequired,onProgressDone:k.func,timeoutSec:k.number.isRequired,watchAndScroll:k.bool};f.exports=l}),null);
__d("VideoChannelReplayImage.react",["cx","Image.react","React"],(function a(b,c,d,e,f,g,h){__p&&__p();var i,j;i=babelHelpers.inherits(k,c("React").Component);j=i&&i.prototype;k.prototype.render=function(){"use strict";return c("React").createElement(c("Image.react"),{onClick:this.props.onClick,className:"_4nxy"+(this.props.size==="small"?" _4nxz":""),src:"/images/video/channel_view/replay.svg"})};function k(){"use strict";i.apply(this,arguments)}k.defaultProps={size:"normal"};f.exports=k}),null);
__d("VideoChannelRequestStatus",[],(function a(b,c,d,e,f,g){f.exports=Object.freeze({SUCCEEDED:"succeeded",FAILED:"failed",ABORTED:"aborted"})}),null);
__d("XVideoChannelViewAsyncController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/video/channel/view/async/{id}/",{id:{type:"String",required:true},original_video_id:{type:"String",required:true},cursor:{type:"String"},story_count:{type:"Int",defaultValue:3},caller:{type:"Enum",defaultValue:"channel_view_from_unknown",enumType:1}})}),null);
__d("XVideoChannelViewStoryAsyncController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/video/channel/view/story/async/{root_video_id}/",{root_video_id:{type:"String",required:true},video_ids:{type:"StringVector",defaultValue:[]},use_video_placeholder:{type:"Bool",defaultValue:false},setup_interactions:{type:"Bool",defaultValue:false},is_first_story:{type:"Bool",defaultValue:false},feed_tracking_data:{type:"StringVector",defaultValue:[]},caller:{type:"Enum",defaultValue:"channel_view_from_unknown",enumType:1},channel_id:{type:"String"},ad_impression_token:{type:"String"},fetch_channel_pivots:{type:"Bool",defaultValue:false}})}),null);
__d("VideoChannelStoryFetcher",["AsyncRequest","HTML","VideoChannelLogger","VideoChannelLoggerEvents","VideoChannelLoggerFields","VideoChannelRequestStatus","VideoChannelViewVariables","XVideoChannelViewAsyncController","XVideoChannelViewStoryAsyncController"],(function a(b,c,d,e,f,g){__p&&__p();var h=c("VideoChannelViewVariables").channelPivots;function i(j,k,l,m,n,o,p){"use strict";__p&&__p();this.$VideoChannelStoryFetcher7=j;this.$VideoChannelStoryFetcher8=k;this.$VideoChannelStoryFetcher4=l;this.$VideoChannelStoryFetcher10=0;this.$VideoChannelStoryFetcher2=null;this.$VideoChannelStoryFetcher3=true;this.$VideoChannelStoryFetcher5=[];this.$VideoChannelStoryFetcher6=[];this.$VideoChannelStoryFetcher9={};if(n){this.$VideoChannelStoryFetcher5=n.videoIDs;this.$VideoChannelStoryFetcher6=n.feedTrackingData;this.$VideoChannelStoryFetcher2=n.cursorInfo.cursor;this.$VideoChannelStoryFetcher3=n.cursorInfo.hasNextPage;var q=this.$VideoChannelStoryFetcher5.indexOf(this.$VideoChannelStoryFetcher7);c("VideoChannelLogger").setOffset(q);this.$VideoChannelStoryFetcher9.start=q;this.$VideoChannelStoryFetcher9.end=q+1}if(o){this.$VideoChannelStoryFetcher5=o;this.$VideoChannelStoryFetcher3=!!p;var r=this.$VideoChannelStoryFetcher5.indexOf(this.$VideoChannelStoryFetcher7);c("VideoChannelLogger").setOffset(r);this.$VideoChannelStoryFetcher9.start=r;this.$VideoChannelStoryFetcher9.end=r+1}c("VideoChannelLogger").setPosition(0);this.$VideoChannelStoryFetcher11=m;this.$VideoChannelStoryFetcher12=[];this.$VideoChannelStoryFetcher13=[]}i.prototype.reset=function(j,k){"use strict";__p&&__p();this.$VideoChannelStoryFetcher7=j;this.$VideoChannelStoryFetcher8=k;this.$VideoChannelStoryFetcher10=0;this.$VideoChannelStoryFetcher2=null;this.$VideoChannelStoryFetcher3=true;this.$VideoChannelStoryFetcher5=[];this.$VideoChannelStoryFetcher6=[];this.$VideoChannelStoryFetcher9={};this.$VideoChannelStoryFetcher12=[];this.$VideoChannelStoryFetcher13=[]};i.prototype.abandonRequest=function(){"use strict";this.$VideoChannelStoryFetcher1&&this.$VideoChannelStoryFetcher1.abandon()};i.prototype.hasNext=function(){"use strict";var j=this.$VideoChannelStoryFetcher5.length-this.$VideoChannelStoryFetcher9.end>0;return this.$VideoChannelStoryFetcher3||j};i.prototype.$VideoChannelStoryFetcher14=function(event,j,k){"use strict";var l={};l[c("VideoChannelLoggerFields").EVENT]=event;l[c("VideoChannelLoggerFields").REQUEST_STATUS]=j;l[c("VideoChannelLoggerFields").PERF_TIME_MS]=Date.now()-k;if(h)l[c("VideoChannelLoggerFields").VIDEO_CHANNEL_ID]=this.$VideoChannelStoryFetcher8;c("VideoChannelLogger").log(l)};i.prototype.fetchFirstStory=function(j,k,l){"use strict";__p&&__p();if(k===null)if(this.$VideoChannelStoryFetcher5.length!==0){var m=this.$VideoChannelStoryFetcher5.indexOf(this.$VideoChannelStoryFetcher7);k=this.$VideoChannelStoryFetcher6[m]}var n=c("XVideoChannelViewStoryAsyncController").getURIBuilder().setEnum("caller",this.$VideoChannelStoryFetcher4).setStringVector("video_ids",[this.$VideoChannelStoryFetcher7]).setString("root_video_id",this.$VideoChannelStoryFetcher7).setBool("is_first_story",true).setBool("use_video_placeholder",j).setBool("setup_interactions",l).setString("channel_id",this.$VideoChannelStoryFetcher8).setString("ad_impression_token",this.$VideoChannelStoryFetcher11);if(k)n.setStringVector("feed_tracking_data",[JSON.stringify(k)]);var o=Date.now(),p=new(c("AsyncRequest"))(n.getURI()).setAllowCrossPageTransition(true).setHandler(function(){__p&&__p();var q,r=this;this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_FIRST_STORY,c("VideoChannelRequestStatus").SUCCEEDED,o);this.$VideoChannelStoryFetcher15();if(h)(function(){__p&&__p();var o=Date.now(),s=c("XVideoChannelViewStoryAsyncController").getURIBuilder().setEnum("caller",r.$VideoChannelStoryFetcher4).setStringVector("video_ids",[r.$VideoChannelStoryFetcher7]).setString("root_video_id",r.$VideoChannelStoryFetcher7).setString("channel_id",r.$VideoChannelStoryFetcher8).setBool("fetch_channel_pivots",true);if(k)s.setStringVector("feed_tracking_data",[JSON.stringify(k)]);var t=new(c("AsyncRequest"))(s.getURI()).setAllowCrossPageTransition(true).setHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_CHANNEL_PIVOTS,c("VideoChannelRequestStatus").SUCCEEDED,o);this.$VideoChannelStoryFetcher15()}.bind(r)).setErrorHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_CHANNEL_PIVOTS,c("VideoChannelRequestStatus").FAILED,o);this.$VideoChannelStoryFetcher15()}.bind(r)).setAbortHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_CHANNEL_PIVOTS,c("VideoChannelRequestStatus").ABORTED,o);this.$VideoChannelStoryFetcher15()}.bind(r));r.$VideoChannelStoryFetcher1=t;r.$VideoChannelStoryFetcher10=Date.now();t.send()})()}.bind(this)).setErrorHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_FIRST_STORY,c("VideoChannelRequestStatus").FAILED,o);this.$VideoChannelStoryFetcher15()}.bind(this)).setAbortHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_FIRST_STORY,c("VideoChannelRequestStatus").ABORTED,o);this.$VideoChannelStoryFetcher15()}.bind(this));this.$VideoChannelStoryFetcher1=p;this.$VideoChannelStoryFetcher10=Date.now();p.send()};i.prototype.getPreloadedData=function(){"use strict";return{stories:this.$VideoChannelStoryFetcher12,thumbnails:this.$VideoChannelStoryFetcher13}};i.prototype.$VideoChannelStoryFetcher16=function(j,k){"use strict";__p&&__p();if(!this.$VideoChannelStoryFetcher8)return;var l=c("XVideoChannelViewAsyncController").getURIBuilder().setString("id",this.$VideoChannelStoryFetcher8).setEnum("caller",this.$VideoChannelStoryFetcher4).setString("original_video_id",this.$VideoChannelStoryFetcher7).setInt("story_count",j);if(this.$VideoChannelStoryFetcher2)l.setString("cursor",this.$VideoChannelStoryFetcher2.toString());var m=Date.now(),n=l.getURI(),o=new(c("AsyncRequest"))(n).setAllowCrossPageTransition(true).setHandler(function(p){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_FROM_ENTQUERY,c("VideoChannelRequestStatus").SUCCEEDED,m);this.$VideoChannelStoryFetcher2=p.getPayload().cursor;this.$VideoChannelStoryFetcher3=p.getPayload().hasNextPage;this.$VideoChannelStoryFetcher15();this.$VideoChannelStoryFetcher17(p,function(q,r){this.$VideoChannelStoryFetcher12=[].concat(this.$VideoChannelStoryFetcher12,q);this.$VideoChannelStoryFetcher13=[].concat(this.$VideoChannelStoryFetcher13,r);return k(q,r)}.bind(this))}.bind(this)).setErrorHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_FROM_ENTQUERY,c("VideoChannelRequestStatus").FAILED,m);this.$VideoChannelStoryFetcher15()}.bind(this)).setAbortHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_FROM_ENTQUERY,c("VideoChannelRequestStatus").ABORTED,m);this.$VideoChannelStoryFetcher15()}.bind(this));this.$VideoChannelStoryFetcher1=o;o.send()};i.prototype.$VideoChannelStoryFetcher18=function(j,k,l){__p&&__p();var m,n=this;"use strict";var o=this.$VideoChannelStoryFetcher9.end,p=this.$VideoChannelStoryFetcher5.length-o,q=o+Math.min(p,j);if(p>0)(function(){__p&&__p();var r=n.$VideoChannelStoryFetcher5.slice(o,q),s=n.$VideoChannelStoryFetcher6.slice(o,q).map(function(v){return JSON.stringify(v)}),t=c("XVideoChannelViewStoryAsyncController").getURIBuilder().setEnum("caller",n.$VideoChannelStoryFetcher4).setString("channel_id",n.$VideoChannelStoryFetcher8).setString("root_video_id",n.$VideoChannelStoryFetcher7).setStringVector("video_ids",r).setStringVector("feed_tracking_data",s),u=Date.now();n.$VideoChannelStoryFetcher1=new(c("AsyncRequest"))(t.getURI()).setAllowCrossPageTransition(true).setErrorHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_FORWARD,c("VideoChannelRequestStatus").FAILED,u);this.$VideoChannelStoryFetcher15()}.bind(n)).setAbortHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_FORWARD,c("VideoChannelRequestStatus").ABORTED,u);this.$VideoChannelStoryFetcher15()}.bind(n)).setHandler(function(v){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_FORWARD,c("VideoChannelRequestStatus").SUCCEEDED,u);this.$VideoChannelStoryFetcher9.end=q;this.$VideoChannelStoryFetcher15();this.$VideoChannelStoryFetcher17(v,function(w,x){this.$VideoChannelStoryFetcher12=[].concat(this.$VideoChannelStoryFetcher12,w);this.$VideoChannelStoryFetcher13=[].concat(this.$VideoChannelStoryFetcher13,x);return k(w,x)}.bind(this))}.bind(n));n.$VideoChannelStoryFetcher1.send();if(l)l(p)})();else if(this.$VideoChannelStoryFetcher3){this.$VideoChannelStoryFetcher16(j,k);if(l)l(j)}};i.prototype.$VideoChannelStoryFetcher19=function(j,k,l){__p&&__p();var m,n=this;"use strict";var o=this.$VideoChannelStoryFetcher9.start;if(o>0)(function(){__p&&__p();var p=Math.max(o-j,0),q=n.$VideoChannelStoryFetcher5.slice(p,o),r=n.$VideoChannelStoryFetcher6.slice(p,o).map(function(u){return JSON.stringify(u)}),s=c("XVideoChannelViewStoryAsyncController").getURIBuilder().setEnum("caller",n.$VideoChannelStoryFetcher4).setString("channel_id",n.$VideoChannelStoryFetcher8).setString("root_video_id",n.$VideoChannelStoryFetcher7).setStringVector("video_ids",q).setStringVector("feed_tracking_data",r),t=Date.now();n.$VideoChannelStoryFetcher1=new(c("AsyncRequest"))(s.getURI()).setAllowCrossPageTransition(true).setErrorHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_BACKWARD,c("VideoChannelRequestStatus").FAILED,t);this.$VideoChannelStoryFetcher15()}.bind(n)).setAbortHandler(function(){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_BACKWARD,c("VideoChannelRequestStatus").ABORTED,t);this.$VideoChannelStoryFetcher15()}.bind(n)).setHandler(function(u){this.$VideoChannelStoryFetcher14(c("VideoChannelLoggerEvents").FETCH_STORIES_BACKWARD,c("VideoChannelRequestStatus").SUCCEEDED,t);this.$VideoChannelStoryFetcher9.start=p;this.$VideoChannelStoryFetcher15();this.$VideoChannelStoryFetcher17(u,k)}.bind(n));n.$VideoChannelStoryFetcher1.send();if(l)l(o-p)})()};i.prototype.fetchStories=function(j,k,l){"use strict";var m=c("VideoChannelViewVariables").defaultStoriesToLoad;if(this.$VideoChannelStoryFetcher1)return;if(j)this.$VideoChannelStoryFetcher18(m,k,l);else this.$VideoChannelStoryFetcher19(m,k,l)};i.prototype.$VideoChannelStoryFetcher17=function(j,k){"use strict";var l=j.getPayload(),m=c("HTML").replaceJSONWrapper(l.stories).getNodes(),n=l.thumbnails.map(function(o){return c("HTML").replaceJSONWrapper(o).getRootNode()});k(m,n)};i.prototype.$VideoChannelStoryFetcher15=function(){"use strict";this.$VideoChannelStoryFetcher1=null};f.exports=i}),null);
__d("VideoAutoplayControllerAbortLoadingHelper",["invariant","VideoPlayerLoggerSource","VideoPlayerExperiments","VideoPlayerAbortLoadingExperiment","getViewportDimensions","Set","Map"],(function a(b,c,d,e,f,g,h){__p&&__p();function i(){"use strict";this.$VideoAutoplayControllerAbortLoadingHelper1=new(c("Set"))();this.$VideoAutoplayControllerAbortLoadingHelper2=new(c("Map"))()}i.prototype.maybeAbortLoading=function(){"use strict";__p&&__p();for(var j=this.$VideoAutoplayControllerAbortLoadingHelper1,k=Array.isArray(j),l=0,j=k?j:j[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var m;if(k){if(l>=j.length)break;m=j[l++]}else{l=j.next();if(l.done)break;m=l.value}var n=m,o=c("VideoPlayerExperiments").deferWhichVideoToAbortLoadingDecisioningLogic,p=n.getVideoPlayerController(),q=p?p.isLiveVideo():null;if(q!==null&&(o==="vod"&&q||o==="live"&&!q))continue;if(!n.isState("playing")&&typeof n.abortLoading==="function"&&i.shouldAbortLoadingVideoUnit(n))if(c("VideoPlayerExperiments").abortLoadingHelperNegativeYAbortLoading)this.$VideoAutoplayControllerAbortLoadingHelper3(n);else this.$VideoAutoplayControllerAbortLoadingHelper4(n);else if(c("VideoPlayerExperiments").abortLoadingHelperNegativeYAbortLoading&&n.isState("playing")){var r=this.$VideoAutoplayControllerAbortLoadingHelper2.get(n);!!r||h(0);if(r&&r.abortedLoading)r.abortedLoading=false}}};i.prototype.$VideoAutoplayControllerAbortLoadingHelper3=function(j){"use strict";__p&&__p();if(c("VideoPlayerExperiments").abortLoadingHelperBoundedReloading){var k=c("getViewportDimensions")().height/-2;if(j.getDistanceToViewport()<c("VideoPlayerExperiments").abortedLoadingPixelBoundary+k&&!j.isVisible())this.$VideoAutoplayControllerAbortLoadingHelper5(j);else if(j.getDistanceToViewport()>c("VideoPlayerExperiments").reloadingPixelBoundary+k)this.$VideoAutoplayControllerAbortLoadingHelper6(j)}else if(j.getDistanceToViewport()<0&&!j.isVisible())this.$VideoAutoplayControllerAbortLoadingHelper5(j)};i.prototype.addVideoUnit=function(j){"use strict";if(!this.$VideoAutoplayControllerAbortLoadingHelper1.has(j)){this.$VideoAutoplayControllerAbortLoadingHelper1.add(j);this.$VideoAutoplayControllerAbortLoadingHelper2.set(j,{y:j.getDistanceToViewport(),timestamp:new Date().valueOf(),v:0,abortedLoading:false})}};i.prototype.removeVideoUnit=function(j){"use strict";this.$VideoAutoplayControllerAbortLoadingHelper1["delete"](j);this.$VideoAutoplayControllerAbortLoadingHelper2["delete"](j)};i.prototype.calculateFutureScrollPosition=function(j){"use strict";var k=j.y1-j.y0,l=j.t1-j.t0,m=k/l,n=m-j.v0,o=n/l,p=j.t,q=o*p*p/2+p*m+j.y1;return{v1:m,a:o,S:q}};i.prototype.preloadClosestVideoUnits=function(j){"use strict";this.$VideoAutoplayControllerAbortLoadingHelper7(j).forEach(function(k){return this.$VideoAutoplayControllerAbortLoadingHelper6(k)}.bind(this))};i.prototype.$VideoAutoplayControllerAbortLoadingHelper7=function(j){"use strict";return Array.from(this.$VideoAutoplayControllerAbortLoadingHelper1).filter(function(k){return k.getDistanceToViewport()>=0}).sort(function(k,l){return k.getDistanceToViewport()-l.getDistanceToViewport()}).slice(0,j)};i.prototype.$VideoAutoplayControllerAbortLoadingHelper6=function(j){"use strict";__p&&__p();var k=this.$VideoAutoplayControllerAbortLoadingHelper2.get(j);!!k||h(0);var l=void 0;if(k){l=k.abortedLoading;k.abortedLoading=false}if(l&&typeof j.preload==="function")j.preload()};i.prototype.$VideoAutoplayControllerAbortLoadingHelper5=function(j){"use strict";__p&&__p();var k=this.$VideoAutoplayControllerAbortLoadingHelper2.get(j);!!k||h(0);var l=void 0;if(k){l=k.abortedLoading;k.abortedLoading=true}if(!l&&typeof j.abortLoading==="function")j.abortLoading()};i.prototype.$VideoAutoplayControllerAbortLoadingHelper4=function(j){"use strict";__p&&__p();var k=c("getViewportDimensions")().height,l=1600,m=k/2,n=m+l,o=-m,p=o-l,q=this.$VideoAutoplayControllerAbortLoadingHelper2.get(j);!!q||h(0);if(!q)return;var r=j.getDistanceToViewport(),s=q.y;q.y=r;var t=new Date().valueOf(),u=q.timestamp;q.timestamp=t;var v=q.v;if(p<=r&&n>=r){if(q.abortedLoading)this.$VideoAutoplayControllerAbortLoadingHelper6(j);return}var w=500,x=this.calculateFutureScrollPosition({y0:s,y1:r,t0:u,t1:t,v0:v,t:w});q.v=x.v1;var y=x.S;if(q.abortedLoading){if(r<p&&y>p||r>n&&y<n)this.$VideoAutoplayControllerAbortLoadingHelper6(j)}else this.$VideoAutoplayControllerAbortLoadingHelper5(j)};i.prototype.$VideoAutoplayControllerAbortLoadingHelper8=function(j){"use strict";var k=j.getVideoPlayerController();return k?k.getVideoPlayerID():null};i.shouldAbortLoadingVideoUnit=function(j){"use strict";__p&&__p();var k=!c("VideoPlayerExperiments").abortLoadingDecisioningLogic,l=true;if(j){if(typeof j.getIsInChannel==="function")l=j.getIsInChannel();if(typeof j.getSource==="function"&&c("VideoPlayerExperiments").abortLoadingDecisioningLogic)k=j.getSource()===c("VideoPlayerLoggerSource").TAHOE;return c("VideoPlayerAbortLoadingExperiment").canAbort&&!l&&!k}return false};f.exports=i}),null);
__d("VideoAutoplayControllerBase",["Arbiter","DesktopHscrollUnitEventConstants","Event","VideoPlayerExperiments","VideoPlayerAbortLoadingExperiment","VideoAutoplayControllerAbortLoadingHelper","VideoPlayerLoggerSource","VideoPlayerReason","Visibility","destroyOnUnload","SubscriptionsHandler","debounce","throttle","setTimeout","emptyFunction"],(function a(b,c,d,e,f,g){__p&&__p();var h=c("VideoPlayerExperiments").abortLoadingDelay;function i(l,m){var n=[];return function(){var o=Date.now();n.unshift(o);var p=0;while(n[++p]+m>o);n=n.slice(0,p);return n.length<=l}}function j(l,m,n){__p&&__p();var o=null;return function(){__p&&__p();var p;for(var q=arguments.length,r=Array(q),s=0;s<q;s++)r[s]=arguments[s];if(m()){l.apply(undefined,r);return c("emptyFunction").thatReturnsFalse}else if(!o)(function(){var t=c("setTimeout")(function(){o=null;l.apply(undefined,r)},n);o=function u(){if(!o)return false;clearTimeout(t);o=null;return true}})();return o}}function k(l){"use strict";__p&&__p();this.$VideoAutoplayControllerBase8=c("emptyFunction");this.$VideoAutoplayControllerBase9=c("emptyFunction");this.$VideoAutoplayControllerBase3=null;this.$VideoAutoplayControllerBase2=null;this.$VideoAutoplayControllerBase10=[];this.$VideoAutoplayControllerBase1=l;this.$VideoAutoplayControllerBase4=null;this.$VideoAutoplayControllerBase5=new(c("SubscriptionsHandler"))();c("destroyOnUnload")(function(){this.$VideoAutoplayControllerBase10=[];this.$VideoAutoplayControllerBase3=null;if(this.$VideoAutoplayControllerBase4){this.$VideoAutoplayControllerBase4.remove();this.$VideoAutoplayControllerBase4=null}this.$VideoAutoplayControllerBase5.release()}.bind(this));if(c("VideoPlayerExperiments").autoplayMaxCallsPerWindow)this.$VideoAutoplayControllerBase6=j(function(m){var n=this.$VideoAutoplayControllerBase3;if(n)n.playWithoutUnmute(m)}.bind(this),i(c("VideoPlayerExperiments").autoplayMaxCallsPerWindow,c("VideoPlayerExperiments").autoplayThrottleWindow),c("VideoPlayerExperiments").autoplayThrottleDelay);this.$VideoAutoplayControllerBase7=c("emptyFunction").thatReturnsFalse}k.prototype.getVideoUnits=function(){"use strict";return this.$VideoAutoplayControllerBase10};k.prototype.setVideoUnits=function(l){"use strict";this.$VideoAutoplayControllerBase10=l};k.prototype.addVideoUnit=function(l){"use strict";this.$VideoAutoplayControllerBase10.push(l)};k.prototype.removeVideoUnit=function(l){"use strict";var m=this.$VideoAutoplayControllerBase10.findIndex(function(n){return n===l});if(m>-1)this.$VideoAutoplayControllerBase10.splice(m,1)};k.prototype.getPlayingVideoUnit=function(){"use strict";return this.$VideoAutoplayControllerBase3};k.prototype.setPlayingVideoUnit=function(l){"use strict";this.$VideoAutoplayControllerBase3=l;if(this.$VideoAutoplayControllerBase3)this.setupPlayingVideoUnitSubscriptions()};k.prototype.playVideo=function(l,m){"use strict";__p&&__p();if(c("VideoPlayerExperiments").disableAutoplayForInactiveTab&&c("Visibility").isHidden()){this.$VideoAutoplayControllerBase2=l;return}this.setPlayingVideoUnit(l);if(this.$VideoAutoplayControllerBase3){var n=this.$VideoAutoplayControllerBase6;if(n)this.$VideoAutoplayControllerBase7=n.call(this,m);else this.$VideoAutoplayControllerBase3.playWithoutUnmute(m)}};k.prototype.setupPlayingVideoUnitSubscriptions=function(){"use strict";throw new Error("Should be overridden")};k.prototype.addSubscriberVideoUnit=function(){"use strict";if(!this.getVideoUnits().length){this.$VideoAutoplayControllerBase5.addSubscriptions(c("Event").listen(window,"resize",this.updateAutoplay.bind(this)),c("Event").listen(window,"blur",this.$VideoAutoplayControllerBase11.bind(this)),c("Event").listen(window,"focus",this.$VideoAutoplayControllerBase12.bind(this)),c("Visibility").addListener(c("Visibility").HIDDEN,this.$VideoAutoplayControllerBase11.bind(this)),c("Visibility").addListener(c("Visibility").VISIBLE,this.$VideoAutoplayControllerBase12.bind(this)),c("Arbiter").subscribe(c("DesktopHscrollUnitEventConstants").HSCROLL_ITEM_SHOWN_EVENT,this.updateAutoplay.bind(this)));if(!this.$VideoAutoplayControllerBase13())this.$VideoAutoplayControllerBase14()}};k.prototype.$VideoAutoplayControllerBase11=function(){"use strict";if(!this.$VideoAutoplayControllerBase2){this.$VideoAutoplayControllerBase2=this.getPlayingVideoUnit();this.$VideoAutoplayControllerBase15(c("VideoPlayerReason").PAGE_VISIBILITY)}};k.prototype.$VideoAutoplayControllerBase12=function(){"use strict";if(this.$VideoAutoplayControllerBase2){this.playVideo(this.$VideoAutoplayControllerBase2,c("VideoPlayerReason").PAGE_VISIBILITY);this.$VideoAutoplayControllerBase2=null}};k.prototype.$VideoAutoplayControllerBase14=function(){"use strict";__p&&__p();if(this.$VideoAutoplayControllerBase4)this.$VideoAutoplayControllerBase4.remove();this.$VideoAutoplayControllerBase8=c("throttle")(function(){return this.updateAutoplay()}.bind(this),this.$VideoAutoplayControllerBase1);this.$VideoAutoplayControllerBase9=c("debounce")(function(){return this.updateAutoplay()}.bind(this),this.$VideoAutoplayControllerBase1);this.$VideoAutoplayControllerBase4=c("Event").listen(window,"scroll",function(){this.$VideoAutoplayControllerBase8();if(c("VideoPlayerExperiments").useDebouncedScroll)this.$VideoAutoplayControllerBase9()}.bind(this))};k.prototype.$VideoAutoplayControllerBase13=function(){"use strict";return!!this.$VideoAutoplayControllerBase4};k.prototype.getClosestVideoUnits=function(l){"use strict";return this.$VideoAutoplayControllerBase10.filter(function(m){return m.getDistanceToViewport()>=0}).sort(function(m,n){return m.getDistanceToViewport()-n.getDistanceToViewport()}).slice(0,l)};k.prototype.getVisibleUnits=function(){"use strict";__p&&__p();var l=[];this.$VideoAutoplayControllerBase10.forEach(function(m){if(m.isVisible()){l.push(m);if(!m.wasVisible){m.wasVisible=true;m.logDisplayed()}}else m.wasVisible=false});return l};k.prototype.$VideoAutoplayControllerBase16=function(l){"use strict";var m=c("VideoPlayerExperiments").deferWhichVideoToAbortLoadingDecisioningLogic,n=l.getVideoPlayerController(),o=n?n.isLiveVideo():null;if(o!==null&&(m==="vod"&&o||m==="live"&&!o))return false;return c("VideoAutoplayControllerAbortLoadingHelper").shouldAbortLoadingVideoUnit(l)};k.prototype.pausePlayingVideo=function(l,m){__p&&__p();var n,o=this;"use strict";var p=this.$VideoAutoplayControllerBase3;if(p)(function(){__p&&__p();var q=function q(){if(!p.isState("playing")){if(c("VideoPlayerExperiments").abortLoadingReUpStillVisibleVideos&&p.isVisible()){c("setTimeout")(q,h);return}if(typeof p.abortLoading==="function")p.abortLoading()}};if(!o.$VideoAutoplayControllerBase7())p.pause(l);if(!c("VideoPlayerExperiments").decoupleAbortLoadingFromPause)if(o.$VideoAutoplayControllerBase16(p)&&!m)c("setTimeout")(q,h);o.$VideoAutoplayControllerBase3=null})()};k.prototype.$VideoAutoplayControllerBase15=function(l){"use strict";this.pausePlayingVideo(l,true)};k.prototype.updateAutoplay=function(){"use strict";throw new Error("Should be overridden")};f.exports=k}),null);
__d("XVideoAutoplayNuxAsyncController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/video/autoplay/nux/",{})}),null);
__d("XVideoAutoplayNuxDismissAsyncController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/video/autoplay/nux/dismiss/",{})}),null);
__d("XVideoAutoplayNuxLogViewAsyncController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/video/autoplay/nux/log/view/",{})}),null);
__d("VideoAutoplayControllerX",["csx","AsyncRequest","DOM","Event","Network","Run","SubscriptionsHandler","VideoAutoplayControllerAbortLoadingHelper","VideoAutoplayControllerBase","VideoPlayerExperiments","VideoPlayerPreloadExperiment","VideoPlayerReason","XVideoAutoplayNuxAsyncController","XVideoAutoplayNuxDismissAsyncController","XVideoAutoplayNuxLogViewAsyncController","clearTimeout","destroyOnUnload","getViewportDimensions","ifRequired","setTimeout"],(function a(b,c,d,e,f,g,h){__p&&__p();var i,j,k=null,l=200,m=false;function n(){return!c("VideoPlayerExperiments").delayAutoplayUntilAfterLoad||m}i=babelHelpers.inherits(o,c("VideoAutoplayControllerBase"));j=i&&i.prototype;function o(){"use strict";__p&&__p();j.constructor.call(this,l);this.$VideoAutoplayControllerX1=new(c("VideoAutoplayControllerAbortLoadingHelper"))();this.$VideoAutoplayControllerX2=new(c("SubscriptionsHandler"))();this.$VideoAutoplayControllerX3=new(c("SubscriptionsHandler"))();this.$VideoAutoplayControllerX4=true;this.$VideoAutoplayControllerX5=true;this.$VideoAutoplayControllerX6=true;this.$VideoAutoplayControllerX7=null;this.$VideoAutoplayControllerX8=null;this.$VideoAutoplayControllerX9=false;this.$VideoAutoplayControllerX10=null;this.$VideoAutoplayControllerX11=false;this.$VideoAutoplayControllerX12=false;this.$VideoAutoplayControllerX13=false;var p=c("XVideoAutoplayNuxAsyncController").getURIBuilder().getURI();new(c("AsyncRequest"))(p).setAllowCrossPageTransition().send();c("destroyOnUnload")(function(){this.$VideoAutoplayControllerX14();if(c("VideoPlayerExperiments").disableAutoplayOnHomePgUpPgDownEnd){if(this.$VideoAutoplayControllerX15)c("clearTimeout")(this.$VideoAutoplayControllerX15);this.$VideoAutoplayControllerX16.remove()}if(this===k)k=null}.bind(this));c("Run").onAfterLoad(function(){m=true;if(c("VideoPlayerExperiments").delayAutoplayUntilAfterLoad)if(k)k.updateAutoplay();if(!document.hasFocus())c("Event").fire(window,"blur");if(c("VideoPlayerExperiments").disableAutoplayOnHomePgUpPgDownEnd)this.$VideoAutoplayControllerX17()}.bind(this))}o.prototype.$VideoAutoplayControllerX17=function(){"use strict";__p&&__p();var p=33,q=34,r=35,s=36;this.$VideoAutoplayControllerX15=null;var t=function(){this.$VideoAutoplayControllerX18(this.$VideoAutoplayControllerX5);c("clearTimeout")(this.$VideoAutoplayControllerX15);this.$VideoAutoplayControllerX15=null}.bind(this);this.$VideoAutoplayControllerX16=c("Event").listen(document.body,"keydown",function(u){__p&&__p();var v=-1;switch(u.keyCode){case p:case q:v=c("VideoPlayerExperiments").pressPgUpPgDownAutoplayShutoffInterval;break;case r:case s:v=c("VideoPlayerExperiments").pressHomeEndAutoplayShutoffInterval;break;default:break}if(v>-1)if(this.$VideoAutoplayControllerX15){c("clearTimeout")(this.$VideoAutoplayControllerX15);this.$VideoAutoplayControllerX15=c("setTimeout")(t,v)}else if(this.$VideoAutoplayControllerX4){this.$VideoAutoplayControllerX18(false);this.$VideoAutoplayControllerX15=c("setTimeout")(t,v)}}.bind(this))};o.prototype.$VideoAutoplayControllerX18=function(p){"use strict";this.$VideoAutoplayControllerX4=p;this.updateAutoplay()};o.registerVideoUnit=function(p){"use strict";__p&&__p();if(k==null)k=new o();k.addSubscriberVideoUnit();k.addVideoUnit(p);var q=new(c("SubscriptionsHandler"))();q.addSubscriptions.apply(q,k.$VideoAutoplayControllerX19(p));k.$VideoAutoplayControllerX20();if(p.isVisible()&&n())k.updateAutoplay();if(k.shouldRestoreAllSubsequentStreamBufferSizes())k.restoreStreamBufferSize();return function(){k&&k.removeVideoUnit(p);q.release();if(k&&p===k.getPlayingVideoUnit()){k.$VideoAutoplayControllerX3.release();k.setPlayingVideoUnit(null)}}};o.setShouldAutoplay=function(p){"use strict";if(k==null)k=new o();k.$VideoAutoplayControllerX4=p;k.$VideoAutoplayControllerX6=p;k.$VideoAutoplayControllerX5=p;k.updateAutoplay()};o.prototype.$VideoAutoplayControllerX14=function(){"use strict";this.$VideoAutoplayControllerX2.release();this.$VideoAutoplayControllerX3.release()};o.setAutoplayNux=function(p,q){"use strict";__p&&__p();if(k==null)return;k.$VideoAutoplayControllerX7=p;k.$VideoAutoplayControllerX8=q;k.$VideoAutoplayControllerX9=true;var r=c("DOM").find(q.getContentRoot(),"._5cqr");c("Event").listen(r,"click",function(){k.$VideoAutoplayControllerX21()});var s=c("DOM").scry(q.getContentRoot(),"._36gl")[0];if(s)c("Event").listen(s,"click",function(){k.$VideoAutoplayControllerX21()})};o.prototype.$VideoAutoplayControllerX21=function(){"use strict";this.$VideoAutoplayControllerX8.hide();this.$VideoAutoplayControllerX9=false;var p=c("XVideoAutoplayNuxDismissAsyncController").getURIBuilder().getURI();new(c("AsyncRequest"))(p).setAllowCrossPageTransition().send()};o.prototype.setupPlayingVideoUnitSubscriptions=function(){"use strict";__p&&__p();if(this.getPlayingVideoUnit().addListener){this.$VideoAutoplayControllerX2.release();this.$VideoAutoplayControllerX2.engage();if(!this.getPlayingVideoUnit().isLooping())this.$VideoAutoplayControllerX2.addSubscriptions(this.getPlayingVideoUnit().addListener("finishPlayback",function(){this.setPlayingVideoUnit(null)}.bind(this)));this.$VideoAutoplayControllerX2.addSubscriptions(this.getPlayingVideoUnit().addListener("turnOffAutoplay",function(){this.setPlayingVideoUnit(null)}.bind(this)),this.getPlayingVideoUnit().addListener("pausePlayback",function(){this.$VideoAutoplayControllerX20()}.bind(this)),this.getPlayingVideoUnit().addListener("finishPlayback",function(){this.$VideoAutoplayControllerX20()}.bind(this)),c("Network").addListener("online",function(){this.$VideoAutoplayControllerX20()}.bind(this)),c("Network").addListener("offline",function(){this.$VideoAutoplayControllerX20()}.bind(this)))}};o.prototype.$VideoAutoplayControllerX20=function(){"use strict";__p&&__p();if(c("VideoPlayerExperiments").webVideosBlockAutoplayWhenOffline)if(c("Network").isOnline())this.$VideoAutoplayControllerX4=this.$VideoAutoplayControllerX6;else{this.$VideoAutoplayControllerX6=this.$VideoAutoplayControllerX4;this.$VideoAutoplayControllerX4=false;return}var p=this.getVideoUnits();for(var q=0;q<p.length;q++){var r=p[q].getVideoPlayerController();if(r){if(r.getDataInsertionPosition()==="0"){this.$VideoAutoplayControllerX11=true;if(this.$VideoAutoplayControllerX12===false){r.restoreStreamBufferSize();r.once("beginPlayback",function(){this.$VideoAutoplayControllerX13=true;this.restoreStreamBufferSize()}.bind(this));this.$VideoAutoplayControllerX12=true}}if(!c("VideoPlayerExperiments").autoplayBlockBlacklist)r.updateAutoplayRestrained()}}if(!this.$VideoAutoplayControllerX11)this.restoreStreamBufferSize()};o.prototype.shouldRestoreAllSubsequentStreamBufferSizes=function(){"use strict";if(!this.$VideoAutoplayControllerX11)return true;return this.$VideoAutoplayControllerX13};o.prototype.restoreStreamBufferSize=function(){"use strict";var p=this.getVideoUnits();for(var q=0;q<p.length;q++){var r=p[q].getVideoPlayerController();if(r!==null)r.restoreStreamBufferSize()}};o.prototype.$VideoAutoplayControllerX19=function(p){__p&&__p();var q;"use strict";if(!p.addListener)return[];var r=function(){__p&&__p();var t=p.getVideoPlayerController();if(!t.isMuted()&&t.isState("playing")){if(this.$VideoAutoplayControllerX10&&this.$VideoAutoplayControllerX10!==p){var u=this.$VideoAutoplayControllerX10.getVideoPlayerController(),v=u.getOption("VideoWithLiveBroadcast","isLive");if(v)u.mute();else u.pause(c("VideoPlayerReason").USER)}this.$VideoAutoplayControllerX10=p}}.bind(this),s=[p.addListener("beginPlayback",r),p.addListener("changeVolume",r),p.addListener("unmuteVideo",r)];(q=this.$VideoAutoplayControllerX3).addSubscriptions.apply(q,s);return s};o.prototype.$VideoAutoplayControllerX22=function(){"use strict";__p&&__p();var p=this.getVisibleUnits(),q=p.length,r=null;if(q===1){r=p[0];r=r.isAutoplayable()?r:null}else if(q>1){var s=c("getViewportDimensions")().height/2;p.forEach(function(t){if(!t.isAutoplayable())return;var u=t.getDOMPosition(),v=u.y+u.height/2,w=Math.abs(v-s);t.playPriority=w;if(!r||t.playPriority<r.playPriority)r=t})}return r};o.prototype.showAutoplayNUX=function(p){"use strict";if(this.$VideoAutoplayControllerX8&&!this.$VideoAutoplayControllerX8.isShown()){var q=p.getVideoPlayerController().getRootNode();c("DOM").prependContent(q,this.$VideoAutoplayControllerX7);this.$VideoAutoplayControllerX8.show();var r=c("XVideoAutoplayNuxLogViewAsyncController").getURIBuilder().getURI();new(c("AsyncRequest"))(r).setAllowCrossPageTransition().send()}this.$VideoAutoplayControllerX9=false};o.getChannelVideos=function(){"use strict";if(k)return k.getVideoUnits().filter(function(p){return p.getIsInChannel()});return null};o.prototype.addVideoUnit=function(p){"use strict";j.addVideoUnit.call(this,p);if(c("VideoPlayerExperiments").decoupleAbortLoadingFromPause&&p)this.$VideoAutoplayControllerX1.addVideoUnit(p)};o.prototype.removeVideoUnit=function(p){"use strict";j.removeVideoUnit.call(this,p);if(c("VideoPlayerExperiments").decoupleAbortLoadingFromPause&&p)this.$VideoAutoplayControllerX1.removeVideoUnit(p)};o.prototype.updateAutoplay=function(){"use strict";__p&&__p();if(!this.$VideoAutoplayControllerX4){this.pausePlayingVideo(c("VideoPlayerReason").AUTOPLAY);return}if(!c("VideoPlayerExperiments").decoupleAbortLoadingFromPause)this.getClosestVideoUnits(c("VideoPlayerPreloadExperiment").preloadVideosCount).forEach(function(r){return r.preload()});else if(c("VideoPlayerExperiments").abortLoadingHelperDefaultPreloading)this.$VideoAutoplayControllerX1.preloadClosestVideoUnits(c("VideoPlayerPreloadExperiment").preloadVideosCount);var p=this.$VideoAutoplayControllerX22(),q=this.getPlayingVideoUnit();if(q){if(p!=q){this.pausePlayingVideo(c("VideoPlayerReason").AUTOPLAY);this.playVideo(p,c("VideoPlayerReason").AUTOPLAY);if(this.$VideoAutoplayControllerX9)this.showAutoplayNUX(p)}}else if(p){this.playVideo(p,c("VideoPlayerReason").AUTOPLAY);if(this.$VideoAutoplayControllerX9)this.showAutoplayNUX(p)}if(c("VideoPlayerExperiments").decoupleAbortLoadingFromPause)this.$VideoAutoplayControllerX1.maybeAbortLoading()};f.exports=o}),null);
__d("VideoAutoplayPlayerBase",["EventEmitter","FBLogger"],(function a(b,c,d,e,f,g){__p&&__p();var h,i;h=babelHelpers.inherits(j,c("EventEmitter"));i=h&&h.prototype;function j(){var k,l;"use strict";for(var m=arguments.length,n=Array(m),o=0;o<m;o++)n[o]=arguments[o];return l=(k=i.constructor).call.apply(k,[this].concat(n)),this.wasVisible=false,l}j.prototype.isVisible=function(){"use strict";throw new Error("Should be overridden")};j.prototype.getDistanceToViewport=function(){"use strict";throw new Error("Should be overridden")};j.prototype.getVideoPlayerController=function(){"use strict";c("FBLogger")("video").warn(["VideoAutoplayPlayerBase.getVideoPlayerController()","was called and returned null."].join(" "));return null};j.prototype.logDisplayed=function(){"use strict";throw new Error("Should be overridden")};j.prototype.playWithoutUnmute=function(k){"use strict";throw new Error("Should be overridden")};j.prototype.pause=function(k){"use strict";throw new Error("Should be overridden")};j.prototype.isAutoplayable=function(){"use strict";throw new Error("Should be overridden")};j.prototype.getDOMPosition=function(){"use strict";throw new Error("Should be overridden")};j.prototype.isLooping=function(){"use strict";throw new Error("Should be overridden")};j.prototype.isState=function(k){"use strict";throw new Error("Should be overridden")};f.exports=j}),null);
__d("XVideoWnsUpNextAsyncController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/video/wns/upnext/async/{video_id}/",{video_id:{type:"FBID",required:true},viewed_videos:{type:"FBIDSet"}})}),null);
__d("VideoWatchAndScrollDrawer.react",["csx","cx","fbt","AsyncRequest","CenteredContainer.react","DOM","DOMContainer.react","FBLoadShimmer.react","React","XVideoWnsUpNextAsyncController"],(function a(b,c,d,e,f,g,h,i,j){__p&&__p();var k,l;k=babelHelpers.inherits(m,c("React").Component);l=k&&k.prototype;function m(n){"use strict";l.constructor.call(this,n);this.state={fetching:true,upNext:null}}m.prototype.componentDidMount=function(){"use strict";if(this.props.videoID)this.$VideoWatchAndScrollDrawer2(this.props.videoID)};m.prototype.componentWillUnmount=function(){"use strict";this.$VideoWatchAndScrollDrawer1&&this.$VideoWatchAndScrollDrawer1.abort()};m.prototype.$VideoWatchAndScrollDrawer2=function(n){"use strict";__p&&__p();var o=c("XVideoWnsUpNextAsyncController").getURIBuilder().setFBID("video_id",n).setFBIDSet("viewed_videos",this.props.viewedVideos);this.$VideoWatchAndScrollDrawer1=new(c("AsyncRequest"))(o.getURI());this.$VideoWatchAndScrollDrawer1.setHandler(function(p){var q=p.getPayload(),r=q.upNextUnit&&q.upNextUnit.markup;if(r){var s=c("DOM").create("div",{},r),t=c("DOM").scry(s,"._3iqr");if(t.length){this.setState({upNext:s});this.props.onLoadUpNext(s)}}this.setState({fetching:false})}.bind(this)).send()};m.prototype.render=function(){"use strict";var n=null;if(this.state.upNext)n=c("React").createElement(c("DOMContainer.react"),null,this.state.upNext);else if(this.state.fetching)n=c("React").createElement("div",{className:"_2685"},c("React").createElement(c("FBLoadShimmer.react"),{height:70,width:124}),c("React").createElement("div",{className:"_63-r"},c("React").createElement(c("FBLoadShimmer.react"),{height:14,width:140,className:"_3-94"}),c("React").createElement(c("FBLoadShimmer.react"),{height:14,width:140,className:"_3-94"}),c("React").createElement(c("FBLoadShimmer.react"),{height:14,width:70,className:"_3-94"}),c("React").createElement(c("FBLoadShimmer.react"),{height:14,width:70})));else return null;return c("React").createElement("div",{className:"_3rq1 _60a7 _2tyk"},c("React").createElement("div",{className:"_3652"},c("React").createElement("div",{className:"_3653"},j._("Up Next"))),n)};f.exports=m}),null);
__d("VideoWatchAndScrollEndScreen.react",["ix","fbt","cx","Image.react","PopoverMenu.react","React","ReactXUIMenu","ShimButton.react","TooltipData","VideoChannelProgressCircle.react","VideoChannelReplayImage.react","VideoPlayerExperiments","fbglyph"],(function a(b,c,d,e,f,g,h,i,j){__p&&__p();var k,l,m=c("VideoPlayerExperiments").showWNSClose,n=c("React").PropTypes,o=function o(s){var t=s.onClose;return c("React").createElement(c("ShimButton.react"),{className:"_3r7h",onClick:t},c("React").createElement(c("Image.react"),{src:h("114710")}))},p=function p(s){var t=s.onCollapse;return c("React").createElement("div",babelHelpers["extends"]({className:"_1dtq",onClick:t,role:"button",tabIndex:"1"},c("TooltipData").propsFor(i._("Collapse Video"))),c("React").createElement(c("Image.react"),{src:h("115705")}))},q=function q(s){var t=s.onClose,u=c("React").createElement(c("ReactXUIMenu"),{onItemClick:function v(w,x){var y=x.item;if(y.getValue()==="close")t()}},c("React").createElement(c("ReactXUIMenu").Item,{value:"close"},"Close"));return c("React").createElement(c("PopoverMenu.react"),{className:"_ivg",menu:u},c("React").createElement("a",{href:"#"},c("React").createElement(c("Image.react"),{src:h("114186")})))};k=babelHelpers.inherits(r,c("React").Component);l=k&&k.prototype;r.prototype.render=function(){"use strict";return c("React").createElement("div",{className:"_5qdn _2se8"+(this.props.fadeOut?" _2gud":"")+" _1s-2"},c("React").createElement("div",{className:"_1szz _2se8"},c("React").createElement("div",{className:"_1szy _ww8",onClick:this.props.onReplay,role:"presentation"},c("React").createElement(c("VideoChannelProgressCircle.react"),{makeProgress:this.props.makeProgress,timeoutSec:this.props.endScreenDuration,watchAndScroll:true},c("React").createElement(c("VideoChannelReplayImage.react"),{size:"small"})))),c("React").createElement("div",{className:"_ivh"},m?null:c("React").createElement(q,{onClose:this.props.onClose}),c("React").createElement(p,{onCollapse:this.props.onCollapse}),m?c("React").createElement(o,{onClose:this.props.onClose}):null))};function r(){"use strict";k.apply(this,arguments)}r.propTypes={endScreenDuration:n.number.isRequired,fadeOut:n.bool,makeProgress:n.bool.isRequired,onReplay:n.func.isRequired,onClose:n.func.isRequired};f.exports=r}),null);
__d("shouldWNSRenderToRHC",["ge"],(function a(b,c,d,e,f,g){"use strict";function h(){return!!c("ge")("fbRHCVideoWNS-container")}f.exports=h}),null);
__d("VideoWatchAndScrollContainer.react",["csx","cx","Arbiter","CSS","DOM","DOMContainer.react","DOMDimensions","Event","Locale","Parent","React","ReactCSSTransitionGroup","Rect","SubscriptionsHandler","VideoChannelProgressCircle.react","VideoChannelReplayImage.react","VideoPlayerExperiments","VideoWatchAndScrollDrawer.react","VideoWatchAndScrollEndScreen.react","cancelAnimationFrame","getViewportDimensions","requestAnimationFrame","setTimeoutAcrossTransitions","shallowCompare","shouldWNSRenderToRHC","throttle"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j,k,l=c("React").PropTypes,m=10,n=230,o=476,p=300,q=2e3,r=c("VideoPlayerExperiments").endScreenDuration,s=Object.freeze({NW:"nw",NE:"ne",SE:"se",SW:"sw"});j=babelHelpers.inherits(t,c("React").Component);k=j&&j.prototype;function t(u,v){k.constructor.call(this,u,v);this.state=this.$VideoWatchAndScrollContainer3(this.props)}t.prototype.$VideoWatchAndScrollContainer3=function(u){var v=this.$VideoWatchAndScrollContainer4(),w=this.$VideoWatchAndScrollContainer5(this.props.initialPosition,v);return{channelVideoElements:[this.props.initialVideoElement],containerBoundingBox:v,dragging:false,draggingStartHeight:0,draggingStartLeft:0,draggingStartMousePositionX:0,draggingStartMousePositionY:0,draggingStartTop:0,draggingStartWidth:0,endScreenFadeOut:false,endScreenShown:false,fadeOut:false,fadeOutPlaceholder:null,hasDrawer:false,height:w.height,left:w.left,playbackFinished:false,overlayShown:false,resizeDirection:null,showDrawer:false,timeUntilNext:0,top:w.top,width:w.width,videoIndex:0}};t.prototype.shouldComponentUpdate=function(u,v){return!this.state.fadeOut&&c("shallowCompare")(this,u,v)};t.prototype.componentDidUpdate=function(u,v){__p&&__p();if(!v)return;if(!v.dragging&&this.state.dragging){this.documentSubscriptions=new(c("SubscriptionsHandler"))();this.documentSubscriptions.addSubscriptions(c("Event").listen(document,"mousemove",this.$VideoWatchAndScrollContainer6.bind(this)),c("Event").listen(document,"mouseup",this.$VideoWatchAndScrollContainer7.bind(this)))}else if(v.dragging&&!this.state.dragging)this.documentSubscriptions.release();if(v.playbackFinished!==this.state.playbackFinished&&this.state.playbackFinished&&this.state.timeUntilNext){clearTimeout(this.$VideoWatchAndScrollContainer2);this.$VideoWatchAndScrollContainer8();this.$VideoWatchAndScrollContainer2=c("setTimeoutAcrossTransitions")(function(){this.props.onPlayNext()}.bind(this),this.state.timeUntilNext*1e3)}var w=["._23if","._23ig","._452w","._2i7a"],x=v.channelVideoElements||[];this.state.channelVideoElements.forEach(function(y){__p&&__p();if(x.indexOf(y)!==-1)return;w.forEach(function(B){var C=c("DOM").scry(y,B),D=C[0];if(D)c("CSS").hide(D)});var z=c("DOM").scry(y,"._3pay"),A=z[0];if(A){c("CSS").removeClass(A,"_3pay");c("CSS").addClass(A,"_2337")}})};t.prototype.componentDidMount=function(){this.movementListeners=new(c("SubscriptionsHandler"))();this.movementListeners.addSubscriptions(c("Event").listen(window,"resize",c("throttle")(this.$VideoWatchAndScrollContainer9.bind(this),100)),c("Arbiter").subscribe("sidebar/visibility",c("throttle")(this.$VideoWatchAndScrollContainer9.bind(this),100)))};t.prototype.componentWillUnmount=function(){if(this.documentSubscriptions)this.documentSubscriptions.release();if(this.movementListeners)this.movementListeners.release();this.$VideoWatchAndScrollContainer1&&clearTimeout(this.$VideoWatchAndScrollContainer1);this.$VideoWatchAndScrollContainer2&&clearTimeout(this.$VideoWatchAndScrollContainer2)};t.prototype.getFadeOutStatus=function(){return this.state.fadeOut};t.prototype.getChannelVideoElements=function(){return this.state.channelVideoElements};t.prototype.$VideoWatchAndScrollContainer9=function(){var u=this.$VideoWatchAndScrollContainer4(),v=this.$VideoWatchAndScrollContainer5({height:this.state.height,left:this.state.left,top:this.state.top,width:this.state.width},u);this.setState({containerBoundingBox:u,height:v.height,left:v.left,top:v.top,width:v.width})};t.prototype.$VideoWatchAndScrollContainer10=function(u,event){this.$VideoWatchAndScrollContainer11(event,u)};t.prototype.$VideoWatchAndScrollContainer12=function(event){if(c("Parent").bySelector(event.target,"._5-32")||!c("Parent").bySelector(event.target,"._3t-6"))return;this.$VideoWatchAndScrollContainer11(event,null)};t.prototype.$VideoWatchAndScrollContainer13=function(event){return event.button!==0||c("Parent").bySelector(event.target,"._3t-6")||c("Parent").bySelector(event.target,"._2se8")};t.prototype.$VideoWatchAndScrollContainer14=function(event){if(this.$VideoWatchAndScrollContainer13(event))return;this.props.onClick&&this.props.onClick()};t.prototype.$VideoWatchAndScrollContainer15=function(event){if(this.$VideoWatchAndScrollContainer13(event))return;this.props.onDoubleClick&&this.props.onDoubleClick()};t.prototype.$VideoWatchAndScrollContainer11=function(event,u){var v=event.button,w=event.target;if(v!==0)return;if(c("Parent").bySelector(w,"._360f"))return;this.props.onGrab();this.setState({containerBoundingBox:this.$VideoWatchAndScrollContainer4(),dragging:true,draggingStartHeight:this.state.height,draggingStartLeft:this.state.left,draggingStartMousePositionX:event.screenX,draggingStartMousePositionY:event.screenY,draggingStartTop:this.state.top,draggingStartWidth:this.state.width,resizeDirection:u});event.preventDefault()};t.prototype.$VideoWatchAndScrollContainer4=function(){var u=0,v=c("DOM").scry(document.body,".fbChatSidebar");if(v.length===1)u=c("DOMDimensions").getElementDimensions(v[0]).width;var w=c("getViewportDimensions").withoutScrollbars(),x=43+m,y=w.height-m,z=m,A=w.width-m;if(c("Locale").isRTL())z+=u;else A-=u;return new(c("Rect"))(x,A,y,z)};t.prototype.$VideoWatchAndScrollContainer5=function(u,v){var w=new(c("Rect"))(u.top,u.left+u.width,u.top+u.height,u.left);w=w.boundWithin(v);return{height:w.h(),left:w.getLeft(),top:w.getTop(),width:w.w()}};t.prototype.$VideoWatchAndScrollContainer16=function(u,v,w){__p&&__p();var x=u.top,y=v.getTop(),z=y-x;if(z>0){if(w===s.NE||w===s.NW)u.height-=z;u.top=y}var A=u.left,B=v.getLeft(),C=B-A;if(C>0){if(w===s.NW||w===s.SW)u.width-=C;u.left=B}var D=u.top+u.height,E=v.getTop()+v.h(),F=D-E;if(F>0)u.height=E-u.top;var G=u.left+u.width,H=v.getLeft()+v.w(),I=G-H;if(I>0)u.width=H-u.left};t.prototype.$VideoWatchAndScrollContainer17=function(u,v,w){__p&&__p();if(u.width<n){if(w===s.NW||w===s.SW)u.left-=n-u.width;u.width=n}if(u.height<n){if(w===s.NE||w===s.NW)u.top-=n-u.height;u.height=n}};t.prototype.$VideoWatchAndScrollContainer18=function(u,v,w){__p&&__p();if(u.width>o){if(w===s.NW||w===s.SW)u.left+=u.width-o;u.width=o}if(u.height>o){if(w===s.NE||w===s.NW)u.top+=u.height-o;u.height=o}};t.prototype.$VideoWatchAndScrollContainer19=function(u,v,w){__p&&__p();var x=u.width/u.height,y=v.width/v.height;if(x>y){var z=u.height*y,A=u.height;if(z<n){A*=n/z;z=n;if(w===s.NE||w===s.NW)u.top+=u.height-A}if(w===s.NW||w===s.SW)u.left+=u.width-z;u.width=z;u.height=A}else if(x<y){var B=u.width/y;if(w===s.NE||w===s.NW)u.top+=u.height-B;u.height=B}};t.prototype.$VideoWatchAndScrollContainer20=function(u,v,w,x){this.$VideoWatchAndScrollContainer16(u,w,x);this.$VideoWatchAndScrollContainer17(u,v,x);this.$VideoWatchAndScrollContainer18(u,v,x);this.$VideoWatchAndScrollContainer19(u,v,x);return{height:u.height,left:u.left,top:u.top,width:u.width}};t.prototype.$VideoWatchAndScrollContainer6=function(event){c("cancelAnimationFrame")(this.dragUpdateRequestAnimationFrameID);this.dragUpdateRequestAnimationFrameID=c("requestAnimationFrame")(this.$VideoWatchAndScrollContainer21.bind(this,event))};t.prototype.$VideoWatchAndScrollContainer22=function(u){if(u.height!==this.state.height||u.width!==this.state.width)this.props.onInitialPositionUpdate(u)};t.prototype.$VideoWatchAndScrollContainer21=function(event){__p&&__p();if(!this.state.dragging)return;var u=event.screenX-this.state.draggingStartMousePositionX,v=event.screenY-this.state.draggingStartMousePositionY,w=this.state.resizeDirection,x=void 0;if(!w){x=this.$VideoWatchAndScrollContainer5({height:this.state.draggingStartHeight,left:this.state.draggingStartLeft+u,top:this.state.draggingStartTop+v,width:this.state.draggingStartWidth},this.state.containerBoundingBox);this.$VideoWatchAndScrollContainer22(x);this.setState({height:x.height,left:x.left,top:x.top,width:x.width})}else{var y=this.state.draggingStartHeight,z=this.state.draggingStartLeft,A=this.state.draggingStartTop,B=this.state.draggingStartWidth;if(w===s.NE||w===s.SE)B+=u;if(w===s.NW||w===s.SW){z+=u;B-=u}if(w===s.SE||w===s.SW)y+=v;if(w===s.NE||w===s.NW){A+=v;y-=v}x=this.$VideoWatchAndScrollContainer20({height:y,left:z,top:A,width:B},{height:this.state.draggingStartHeight,left:this.state.draggingStartLeft,top:this.state.draggingStartTop,width:this.state.draggingStartWidth},this.state.containerBoundingBox,w);this.$VideoWatchAndScrollContainer22(x);this.setState({height:x.height,left:x.left,top:x.top,width:x.width})}event.preventDefault()};t.prototype.$VideoWatchAndScrollContainer7=function(event){c("cancelAnimationFrame")(this.dragUpdateRequestAnimationFrameID);this.props.onDrop();this.setState({dragging:false,draggingStartHeight:0,draggingStartLeft:0,draggingStartMousePositionX:0,draggingStartMousePositionY:0,draggingStartTop:0,draggingStartWidth:0,resizeDirection:null});event.preventDefault()};t.prototype.$VideoWatchAndScrollContainer23=function(){if(this.$VideoWatchAndScrollContainer1){clearTimeout(this.$VideoWatchAndScrollContainer1);this.$VideoWatchAndScrollContainer1=null}this.setState({showDrawer:true})};t.prototype.$VideoWatchAndScrollContainer24=function(){if(this.state.showDrawer)this.$VideoWatchAndScrollContainer8()};t.prototype.$VideoWatchAndScrollContainer25=function(){clearTimeout(this.$VideoWatchAndScrollContainer2);this.setState({playbackFinished:false});this.props.onReplay()};t.prototype.$VideoWatchAndScrollContainer8=function(){if(this.$VideoWatchAndScrollContainer1)clearTimeout(this.$VideoWatchAndScrollContainer1);else this.setState({showDrawer:true});this.$VideoWatchAndScrollContainer1=c("setTimeoutAcrossTransitions")(function(){this.setState({showDrawer:false});this.$VideoWatchAndScrollContainer1=null}.bind(this),q)};t.prototype.$VideoWatchAndScrollContainer26=function(u,v){if(u>this.state.channelVideoElements.length)return null;var w=this.state.channelVideoElements[u];if(!w)return null;return c("React").createElement("div",{className:"_2yq3"+(v==="left"?" _2yq4":"")+(v==="center"?" _2yq5":"")+(v==="right"?" _2yq6":""),key:w.id},c("React").createElement(c("DOMContainer.react"),null,w))};t.prototype.$VideoWatchAndScrollContainer27=function(){if(c("shouldWNSRenderToRHC")())return[];return[c("React").createElement("div",{className:"_52ua",onMouseDown:this.$VideoWatchAndScrollContainer10.bind(this,s.NW),key:s.NW}),c("React").createElement("div",{className:"_52uc",onMouseDown:this.$VideoWatchAndScrollContainer10.bind(this,s.NE),key:s.NE}),c("React").createElement("div",{className:"_52ui",onMouseDown:this.$VideoWatchAndScrollContainer10.bind(this,s.SE),key:s.SE}),c("React").createElement("div",{className:"_52uj",onMouseDown:this.$VideoWatchAndScrollContainer10.bind(this,s.SW),key:s.SW})]};t.prototype.getWidth=function(){return this.state.width};t.prototype.onLoadUpNext=function(u){this.props.onLoadUpNext(u);this.setState({hasDrawer:true})};t.prototype.canPlayAnotherVideo=function(){var u=this.state.channelVideoElements;return this.state.videoIndex<u.length-1};t.prototype.render=function(){__p&&__p();var u=null;if(!this.props.isDrawerEnabled)u={height:Math.round(this.state.height)+"px",left:this.state.left+"px",top:this.state.top+"px",width:Math.round(this.state.width)+"px"};var v=this.state.channelVideoElements,w=v[this.state.videoIndex];if(w){c("CSS").addClass(w,"_1kfp");c("CSS").conditionClass(w,"_1blk",this.state.width<p)}var x=null;if(this.state.endScreenShown)x=c("React").createElement(c("VideoWatchAndScrollEndScreen.react"),{endScreenDuration:r/1e3,fadeOut:this.state.endScreenFadeOut,makeProgress:this.canPlayAnotherVideo(),onReplay:this.props.onReplay,onClose:function(){clearTimeout(this.$VideoWatchAndScrollContainer2);this.$VideoWatchAndScrollContainer2=null;this.props.onClose()}.bind(this),onCollapse:this.props.onCollapse});var y=null;if(this.state.fadeOutPlaceholder)y=c("React").createElement(c("DOMContainer.react"),null,this.state.fadeOutPlaceholder);else y=c("React").createElement("ul",{className:"_2yq7"},v.map(function(B,C){if(C>this.state.videoIndex+1||C<this.state.videoIndex-1)c("CSS").removeClass(B,"_1kfp");if(C<=this.state.videoIndex+1)return null;return c("React").createElement("li",{key:B.id},c("React").createElement(c("DOMContainer.react"),null,B))}.bind(this)));var z=null;if(this.state.playbackFinished)z=c("React").createElement("div",{role:"presentation",onClick:this.$VideoWatchAndScrollContainer25.bind(this),className:"_1szy _ww8"},c("React").createElement(c("VideoChannelProgressCircle.react"),{makeProgress:!!this.state.timeUntilNext,timeoutSec:this.state.timeUntilNext,watchAndScroll:true},c("React").createElement(c("VideoChannelReplayImage.react"),{size:"small"})));var A=null;if(this.props.isDrawerEnabled)A=c("React").createElement(c("VideoWatchAndScrollDrawer.react"),{videoID:this.props.videoID,viewedVideos:this.props.viewedVideos,onLoadUpNext:this.onLoadUpNext.bind(this)});return c("React").createElement(c("ReactCSSTransitionGroup"),{transitionAppear:true,transitionAppearTimeout:500,transitionEnter:false,transitionLeave:false,transitionName:{appear:"_tie",appearActive:"_tik"}},c("React").createElement("div",{className:"_360g"+(this.state.showDrawer?" _hzi":"")+(this.state.fadeOut?" _473b":"")+(this.state.hasDrawer?" _60a6":"")+(this.props.isLiveVideo()?" _29mh":""),onMouseLeave:this.$VideoWatchAndScrollContainer24.bind(this),onMouseMove:this.$VideoWatchAndScrollContainer23.bind(this),style:u},c("React").createElement("div",{className:"_52u8",onClick:this.$VideoWatchAndScrollContainer14.bind(this),onDoubleClick:this.$VideoWatchAndScrollContainer15.bind(this),onMouseDown:this.$VideoWatchAndScrollContainer12.bind(this),role:"presentation"},c("React").createElement("div",{className:"_hzj"},this.$VideoWatchAndScrollContainer26(this.state.videoIndex-1,"left"),this.$VideoWatchAndScrollContainer26(this.state.videoIndex,"center"),this.$VideoWatchAndScrollContainer26(this.state.videoIndex+1,"right"),z),A),this.$VideoWatchAndScrollContainer27(),y))};t.propTypes={initialPosition:l.object.isRequired,initialVideoElement:l.instanceOf(HTMLElement).isRequired,onChannelNavigation:l.func.isRequired,onClick:l.func.isRequired,onClose:l.func.isRequired,onDoubleClick:l.func.isRequired,onDrop:l.func.isRequired,onGrab:l.func.isRequired,onInitialPositionUpdate:l.func.isRequired,onReplay:l.func.isRequired};f.exports=t}),null);
__d("XVideoWNSSurveyController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/video/wns_survey/",{__asyncDialog:{type:"Int"}})}),null);
__d("VideoWatchAndScrollController",["csx","cx","invariant","Arbiter","AsyncRequest","Bootloader","CSS","DOM","DOMDimensions","Event","EventListener","Locale","React","ReactDOM","Set","SubscriptionsHandler","Tahoe","VideoAutoplayControllerX","VideoChainingCaller","VideoChannelLogger","VideoChannelStoryFetcher","VideoFrameBuffer","VideoPlayerExperiments","VideoPlayerLoggerEvent","VideoPlayerLoggerSource","VideoPlayerReason","VideoPlayerShakaGlobalConfig","VideoPlayerStates","VideoPlayerVolumeSettings","ViewportBounds","VideoWatchAndScrollContainer.react","VideoWatchAndScrollVariables","XVideoWNSSurveyController","cancelAnimationFrame","destroyOnUnload","getViewportDimensions","ifRequired","setTimeoutAcrossTransitions","shouldWNSRenderToRHC","throttle"],(function a(b,c,d,e,f,g,h,i,j){__p&&__p();var k=158,l=280,m=10,n=42,o=n+m,p=476,q=230,r=[c("VideoPlayerReason").AUTOPLAY,c("VideoPlayerReason").PAGE_VISIBILITY],s=750,t=308,u=3,v=null,w=c("VideoPlayerExperiments").persistentWNSEnabled;function x(){return Math.max(c("getViewportDimensions")().height,400)-n-80}function y(z,A,B,C){__p&&__p();var D;"use strict";this.$VideoWatchAndScrollController31=new(c("SubscriptionsHandler"))();this.$VideoWatchAndScrollController32=new(c("SubscriptionsHandler"))();this.$VideoWatchAndScrollController1=false;this.$VideoWatchAndScrollController2=null;this.$VideoWatchAndScrollController3=null;this.$VideoWatchAndScrollController4=false;this.$VideoWatchAndScrollController35=B;this.$VideoWatchAndScrollController38=false;this.$VideoWatchAndScrollController30=false;this.$VideoWatchAndScrollController48=C;this.$VideoWatchAndScrollController49=C;this.$VideoWatchAndScrollController34=new(c("VideoChannelStoryFetcher"))(A,z,this.$VideoWatchAndScrollController35,null);this.$VideoWatchAndScrollController36=[];this.$VideoWatchAndScrollController37=0;this.$VideoWatchAndScrollController39=[];this.$VideoWatchAndScrollController40=[];this.$VideoWatchAndScrollController5=k;this.$VideoWatchAndScrollController6=l;this.$VideoWatchAndScrollController10=window.document.getElementById("leftCol");this.$VideoWatchAndScrollController11=window.document.getElementById("rightCol");this.$VideoWatchAndScrollController12=window.document.getElementById("pagelet_bluebar");this.$VideoWatchAndScrollController44={};this.$VideoWatchAndScrollController47=null;this.$VideoWatchAndScrollController52();(D=this.$VideoWatchAndScrollController31).addSubscriptions.apply(D,this.$VideoWatchAndScrollController53());if(!w)c("destroyOnUnload")(function(){this.$VideoWatchAndScrollController54();if(this.$VideoWatchAndScrollController4)this.$VideoWatchAndScrollController55();if(this.$VideoWatchAndScrollController31)this.$VideoWatchAndScrollController31.release();if(this===v)v=null}.bind(this))}y.prototype.$VideoWatchAndScrollController53=function(){__p&&__p();var z,A=this;"use strict";var B=[];B.push(c("Arbiter").subscribe("VideoChannelView/opened",function(C,D){if(this.$VideoWatchAndScrollController4&&(!D.controller||this.$VideoWatchAndScrollController16!==D.controller))this.$VideoWatchAndScrollController55()}.bind(this)));B.push(c("Arbiter").subscribe("fbVideoWatchAndScroll/closeWNS",function(){if(!this.$VideoWatchAndScrollController4)return;var C=this.$VideoWatchAndScrollController16,D=C.getOption("CommercialBreakVideoAdOverlay","videoController");if(D)C=D;C.logEvent(c("VideoPlayerLoggerEvent").WATCH_AND_SCROLL_EXITED);this.$VideoWatchAndScrollController56();var E=c("XVideoWNSSurveyController").getURIBuilder().getURI(),F=new(c("AsyncRequest"))().setURI(E);F.send()}.bind(this)));if(c("VideoPlayerExperiments").rhcWNSEnabled){B.push(c("Arbiter").subscribe("RHCVideoWNSController/collapseStart",function(){var C=this.$VideoWatchAndScrollController14;if(!C||!c("shouldWNSRenderToRHC")())return;C.setState({endScreenFadeOut:true,endScreenShown:false})}.bind(this)),c("Arbiter").subscribe("RHCVideoWNSController/collapseEnd",function(){var C=this.$VideoWatchAndScrollController14;if(!C||!c("shouldWNSRenderToRHC")())return;this.pauseActiveVideo(c("VideoPlayerReason").USER);C.setState({endScreenFadeOut:false})}.bind(this)),c("Arbiter").subscribe("RHCVideoWNSController/expandStart",function(){var C=this.$VideoWatchAndScrollController14;if(!C||!this.isActiveVideoDonePlaying()||!c("shouldWNSRenderToRHC")())return;C.setState({endScreenShown:true})}.bind(this)));if(w)(function(){__p&&__p();var C=function(){var D=this.$VideoWatchAndScrollController16.getVideoNode();D instanceof HTMLVideoElement||j(0);D.currentTime=D.currentTime}.bind(A);B.push(c("Arbiter").subscribe("RHCVideoWNSController/eject",function(D,E){if(!c("shouldWNSRenderToRHC")())return;this.$VideoWatchAndScrollController2=E;c("DOM").appendContent(document.body,E);if(!c("VideoPlayerShakaGlobalConfig").getBool("timeouts_persist_on_page_transition",true))C();if(this.$VideoWatchAndScrollController16.isState(c("VideoPlayerStates").PLAYING))this.playActiveVideo(c("VideoPlayerReason").USER)}.bind(A)),c("Arbiter").subscribe("RHCVideoWNSController/dock",function(){if(!c("shouldWNSRenderToRHC")())return;if(!c("VideoPlayerShakaGlobalConfig").getBool("timeouts_persist_on_page_transition",true))C();if(this.$VideoWatchAndScrollController16.isState(c("VideoPlayerStates").PLAYING))this.playActiveVideo(c("VideoPlayerReason").USER)}.bind(A)),c("Event").listen(window,"resize",c("throttle")(function(){if(!c("shouldWNSRenderToRHC")())return;this.$VideoWatchAndScrollController57()}.bind(A))),c("Arbiter").subscribe("RHCVideoWNSController/mount",function(){this.$VideoWatchAndScrollController57()}.bind(A)))})()}return B};y.prototype.$VideoWatchAndScrollController57=function(){"use strict";__p&&__p();var z=this.$VideoWatchAndScrollController14;if(!z||this.$VideoWatchAndScrollController38)return;var A=this.$VideoWatchAndScrollController16.getVideoNode(),B=this.$VideoWatchAndScrollController58(A);this.$VideoWatchAndScrollController16.removeOffsetStylings();this.$VideoWatchAndScrollController16.setDimensions(B.width,B.height);z.setState({width:B.width,height:B.height});this.$VideoWatchAndScrollController47=B;c("Arbiter").inform("VideoWatchAndScrollController/resize")};y.prototype.isActiveVideoDonePlaying=function(){"use strict";var z=this.$VideoWatchAndScrollController16.getState();return z===c("VideoPlayerStates").FINISHED};y.isActiveVideoDonePlaying=function(){"use strict";return v?v.isActiveVideoDonePlaying():false};y.prototype.$VideoWatchAndScrollController59=function(z,A,B){"use strict";__p&&__p();z||j(0);A.length||j(0);this.$VideoWatchAndScrollController48=true;this.$VideoWatchAndScrollController38=false;this.$VideoWatchAndScrollController32=new(c("SubscriptionsHandler"))();this.$VideoWatchAndScrollController37=B;this.$VideoWatchAndScrollController34=z;this.$VideoWatchAndScrollController39=z.getPreloadedData().thumbnails||[];this.$VideoWatchAndScrollController40=[];this.$VideoWatchAndScrollController36=A.slice(0);this.$VideoWatchAndScrollController36.forEach(function(D){this.$VideoWatchAndScrollController60(D);this.$VideoWatchAndScrollController61(D);D.updateSource(c("VideoPlayerLoggerSource").WATCH_SCROLL)}.bind(this));var C=this.$VideoWatchAndScrollController36.shift();this.$VideoWatchAndScrollController62(C,c("VideoPlayerReason").USER)};y.prototype.$VideoWatchAndScrollController63=function(z,A,B,C,D){"use strict";this.$VideoWatchAndScrollController9=D;this.$VideoWatchAndScrollController47=this.$VideoWatchAndScrollController58(D.videoRootNode);this.$VideoWatchAndScrollController59(z,A,B);if(this.$VideoWatchAndScrollController14)this.$VideoWatchAndScrollController14.setState({channelVideoElements:C},function(){this.$VideoWatchAndScrollController64()}.bind(this));this.$VideoWatchAndScrollController9=null};y.registerVideoController=function(z,A,B,C){"use strict";__p&&__p();if(v==null)v=new y(z.getVideoChannelID(),z.getVideoID(),A,C);v.$VideoWatchAndScrollController31.addSubscriptions(z.addListener("enterWatchAndScroll",function(){if(v)v.$VideoWatchAndScrollController65(z)}),z.addListener("crossfadeWatchAndScroll",function(){if(v){v.$VideoWatchAndScrollController66();var E=z.getVideoNode();v.$VideoWatchAndScrollController47=v.$VideoWatchAndScrollController58(E);v.$VideoWatchAndScrollController62(z,c("VideoPlayerReason").USER,false,true);z.unmute()}}),z.addListener("exitWatchAndScroll",function(){if(v&&v.$VideoWatchAndScrollController4)v.$VideoWatchAndScrollController55()}),z.addListener("VideoChannelController/enterChannel",function(){if(v)v.$VideoWatchAndScrollController38=true}),z.addListener("VideoChannelController/exitChannel",function(){if(v)v.$VideoWatchAndScrollController38=false}));if(A===c("VideoChainingCaller").WNS)v.$VideoWatchAndScrollController36.push(z);if(!B)return;var D=["beginPlayback","changeVolume","muteVideo","toggleFullscreen","unmuteVideo","VideoChannelController/enterChannel"];D.forEach(function(event){if(v)v.$VideoWatchAndScrollController31.addSubscriptions(z.addListener(event,function(E){if(v)v.$VideoWatchAndScrollController67(z,event,E)}))})};y.isActive=function(){"use strict";if(!v)return false;return v.$VideoWatchAndScrollController4&&!v.$VideoWatchAndScrollController38};y.updateSlidingCalculations=function(){"use strict";if(!v)return;if(v.$VideoWatchAndScrollController19)v.$VideoWatchAndScrollController68(v.$VideoWatchAndScrollController19)};y.registerChannelVideoController=function(z){"use strict";if(!v)return;z.updateSource(c("VideoPlayerLoggerSource").WATCH_SCROLL);v.$VideoWatchAndScrollController60(z);v.$VideoWatchAndScrollController61(z);v.$VideoWatchAndScrollController36.push(z)};y.getStoryFetcherData=function(){"use strict";return v&&v.$VideoWatchAndScrollController69()};y.prototype.$VideoWatchAndScrollController69=function(){"use strict";return{storyFetcher:this.$VideoWatchAndScrollController34,videoPlayerControllers:this.$VideoWatchAndScrollController36,channelVideoIndex:this.$VideoWatchAndScrollController37,rootVideoPlayerController:this.$VideoWatchAndScrollController17,channelInteractionsToRegister:this.$VideoWatchAndScrollController40,isFromWNS:true}};y.getVideoPlaceholder=function(){"use strict";if(!v)return null;return v.$VideoWatchAndScrollController18};y.getReactContainer=function(){"use strict";if(!v)return null;return v.$VideoWatchAndScrollController14};y.registerChannelInteraction=function(z){"use strict";if(v)v.$VideoWatchAndScrollController40.push(z)};y.onEnterTahoe=function(){"use strict";if(!v)return;v.$VideoWatchAndScrollController70()};y.prototype.$VideoWatchAndScrollController70=function(){"use strict";this.$VideoWatchAndScrollController38=true;this.$VideoWatchAndScrollController34.abandonRequest()};y.onEnterChannel=function(){"use strict";if(!v)return;v.$VideoWatchAndScrollController71()};y.prototype.$VideoWatchAndScrollController71=function(){"use strict";__p&&__p();this.$VideoWatchAndScrollController38=true;this.$VideoWatchAndScrollController34.abandonRequest();var z=this.$VideoWatchAndScrollController14;if(!z)return;var A=["._23if","._23ig","._452w","._2i7a"];z.getChannelVideoElements().forEach(function(B){A.forEach(function(E){var F=c("DOM").scry(B,E),G=F[0];if(G)c("CSS").show(G)});var C=c("DOM").scry(B,"._2337"),D=C[0];if(D){c("CSS").removeClass(D,"_2337");c("CSS").addClass(D,"_3pay")}})};y.resetFromChannelView=function(z,A,B){"use strict";if(!v)return;v.$VideoWatchAndScrollController59(z,A,B)};y.startFromChannelView=function(z,A,B,C,D){"use strict";if(!v)return;v.$VideoWatchAndScrollController63(z,A,B,C,D)};y.prototype.$VideoWatchAndScrollController67=function(z,event,A){"use strict";__p&&__p();if(this.$VideoWatchAndScrollController4){if(this.$VideoWatchAndScrollController16===z)return;if(A&&r.includes(A.reason))return;if(!z.isIntentionallyViewing())return;var B=this.$VideoWatchAndScrollController16.getOption("VideoWithLiveBroadcast","isLive");if(B)this.$VideoWatchAndScrollController16.mute();else this.$VideoWatchAndScrollController16.pause(c("VideoPlayerReason").USER)}if(event==="toggleFullscreen"&&z.isFullscreen()||event==="VideoChannelController/enterChannel"){if(this.$VideoWatchAndScrollController19)this.$VideoWatchAndScrollController54()}else if((event!=="beginPlayback"||A&&A.reason===c("VideoPlayerReason").USER||z.getSource()===c("VideoPlayerLoggerSource").PERMALINK)&&z.isIntentionallyViewing()&&!z.isFullscreen()&&!z.getIsInChannel()){var C=this.$VideoWatchAndScrollController72(z.getVideoNode()),D=C.top;if(D>window.scrollY||event==="beginPlayback"&&A&&A.reason===c("VideoPlayerReason").AUTOPLAY)this.$VideoWatchAndScrollController68(z)}};y.prototype.$VideoWatchAndScrollController73=function(z){"use strict";if(this.$VideoWatchAndScrollController38||z!==this.$VideoWatchAndScrollController16)return;if(this.$VideoWatchAndScrollController14)this.$VideoWatchAndScrollController14.setState({endScreenShown:true,playbackFinished:true,timeUntilNext:this.$VideoWatchAndScrollController51?u:0})};y.prototype.$VideoWatchAndScrollController74=function(z){"use strict";return z.addListener("finishPlayback",function(){return this.$VideoWatchAndScrollController73(z)}.bind(this))};y.prototype.$VideoWatchAndScrollController68=function(z){"use strict";var A=z.getVideoNode();if(!A.offsetParent)return;this.$VideoWatchAndScrollController19=z;this.$VideoWatchAndScrollController26=c("throttle")(this.$VideoWatchAndScrollController75.bind(this),100);window.addEventListener("resize",this.$VideoWatchAndScrollController26);this.$VideoWatchAndScrollController76(A);this.$VideoWatchAndScrollController77()};y.prototype.$VideoWatchAndScrollController75=function(){"use strict";if(this.$VideoWatchAndScrollController19){this.$VideoWatchAndScrollController76(this.$VideoWatchAndScrollController18||this.$VideoWatchAndScrollController19.getVideoNode());this.$VideoWatchAndScrollController27&&this.$VideoWatchAndScrollController27()}};y.prototype.$VideoWatchAndScrollController78=function(z){"use strict";__p&&__p();var A=this.$VideoWatchAndScrollController72(z),B=z.scrollWidth,C=z.scrollHeight,D=q,E=p;if(B<C){D*=B/C;E*=B/C}var F=D;if(this.$VideoWatchAndScrollController10&&this.$VideoWatchAndScrollController10.children.length){var G=this.$VideoWatchAndScrollController72(this.$VideoWatchAndScrollController10);if(G.left<=A.left)F=Math.min(G.left-2*m,E);else if(this.$VideoWatchAndScrollController11&&this.$VideoWatchAndScrollController11.children.length){var H=this.$VideoWatchAndScrollController72(this.$VideoWatchAndScrollController11);F=Math.min(H.left-2*m,E)}}else{var I=document.getElementById("timeline_tab_content");if(I){var J=this.$VideoWatchAndScrollController72(I).left;F=Math.min(J-2*m,E)}}return Math.max(F,D)};y.prototype.$VideoWatchAndScrollController72=function(z){"use strict";var A={left:0,top:0};do{A.top+=z.offsetTop;A.left+=z.offsetLeft}while(z=z.offsetParent);return A};y.prototype.$VideoWatchAndScrollController79=function(){"use strict";__p&&__p();if(c("VideoPlayerExperiments").rhcWNSEnabled)return t;var z=0;if(this.$VideoWatchAndScrollController10&&this.$VideoWatchAndScrollController10.children.length){var A=this.$VideoWatchAndScrollController72(this.$VideoWatchAndScrollController10),B=window.getComputedStyle(this.$VideoWatchAndScrollController10),C=parseInt(B.width,10);if(w)C=C||l;z=C+A.left-m}else{var D=document.getElementById("timeline_tab_content");if(!D){var E=document.getElementById("pagelet_timeline_main_column");if(E)D=E.parentNode;else D=document.getElementById("contentArea")}if(D){var F=this.$VideoWatchAndScrollController72(D).left;z=F-2*m}}return z};y.prototype.$VideoWatchAndScrollController58=function(z){"use strict";__p&&__p();var A=!z&&this.$VideoWatchAndScrollController9,B={left:0},C=16,D=9;if(!A){B=this.$VideoWatchAndScrollController72(z);D=1;C=parseFloat(z.getAttribute("data-original-aspect-ratio"));var E=z.parentElement;if((!C||D===0)&&E){B=this.$VideoWatchAndScrollController72(E);C=E.scrollWidth;D=E.scrollHeight}}var F=q,G=p;if(C<D){F*=C/D;G*=C/D}var H=this.$VideoWatchAndScrollController79(),I=m;if(this.$VideoWatchAndScrollController12)I+=this.$VideoWatchAndScrollController12.scrollHeight;I=Math.max(I,o);var J=c("VideoPlayerExperiments").rhcWNSEnabled?H:Math.max(Math.min(H,G),q),K=void 0;if(c("VideoPlayerExperiments").rhcWNSEnabled)K=c("Locale").isRTL()?m+c("ViewportBounds").getRight():c("getViewportDimensions")().width-J-m;else{K=H>G?H-G+m:m;K=Math.max(K,m)}var L=J*D/C;if(c("VideoPlayerExperiments").rhcWNSEnabled)L=Math.min(L,x());return{hasEnoughSpace:!!A||H>=F,height:L,left:K,top:I,width:J}};y.hasEnoughSpaceToEnter=function(z){"use strict";__p&&__p();if(!v||!z||!z.getVideoNode())return false;var A=z.getVideoNode(),B=1,C=parseFloat(A.getAttribute("data-original-aspect-ratio")),D=A.parentElement;if((!C||B===0)&&D){C=D.scrollWidth;B=D.scrollHeight}var E=q;if(C<B)E*=C/B;return v.$VideoWatchAndScrollController79()>E};y.prototype.$VideoWatchAndScrollController76=function(z){"use strict";__p&&__p();this.$VideoWatchAndScrollController22=this.$VideoWatchAndScrollController72(z);this.$VideoWatchAndScrollController28=z.scrollWidth;this.$VideoWatchAndScrollController29=z.scrollHeight;var A=Math.max(this.$VideoWatchAndScrollController28,this.$VideoWatchAndScrollController29);if(A<q){var B=q/A;this.$VideoWatchAndScrollController28*=B;this.$VideoWatchAndScrollController29*=B}this.$VideoWatchAndScrollController21=this.$VideoWatchAndScrollController22.top+this.$VideoWatchAndScrollController29*.5-n;this.$VideoWatchAndScrollController20=this.$VideoWatchAndScrollController22.top+this.$VideoWatchAndScrollController29*.5-window.innerHeight;this.$VideoWatchAndScrollController47=this.$VideoWatchAndScrollController58(z);this.$VideoWatchAndScrollController30=!this.$VideoWatchAndScrollController47.hasEnoughSpace};y.prototype.$VideoWatchAndScrollController77=function(){"use strict";if(this.$VideoWatchAndScrollController19.isIntentionallyViewing()){this.$VideoWatchAndScrollController80(this.$VideoWatchAndScrollController81.bind(this));this.$VideoWatchAndScrollController81()}else this.$VideoWatchAndScrollController54()};y.isVideoAlmostFinished=function(z){"use strict";var A=z.getPlaybackDuration(),B=z.getCurrentTimePosition(),C=c("VideoWatchAndScrollVariables").noWNSRemainingTime;if(A*.2<C)return B/A>.8;else return A-B<C};y.isSlidingEnabled=function(z){"use strict";__p&&__p();var A=v;if(A==null)return false;var B=A.$VideoWatchAndScrollController19;if(B==null||B!==z)return false;if(A.$VideoWatchAndScrollController30||!z.isIntentionallyViewing()||!z.getVideoNode().offsetParent||y.isVideoAlmostFinished(z)||z.getSource()===c("VideoPlayerLoggerSource").TAHOE||z.hasLooped()){A.$VideoWatchAndScrollController54();return false}return true};y.prototype.$VideoWatchAndScrollController81=function(){"use strict";__p&&__p();var z=this.$VideoWatchAndScrollController19;if(z==null)return;if(!z.isIntentionallyViewing()||!z.getVideoNode().offsetParent){this.$VideoWatchAndScrollController54();return}if((window.scrollY>this.$VideoWatchAndScrollController21||window.scrollY<this.$VideoWatchAndScrollController20)&&y.isSlidingEnabled(z)&&z!==this.$VideoWatchAndScrollController16&&!z.isFullscreen()&&!this.$VideoWatchAndScrollController38){if(c("VideoPlayerExperiments").rhcWNS&&c("VideoPlayerExperiments").responsiveRHC&&window.innerWidth<Number(c("VideoPlayerExperiments").ResponsiveRHCMinWidth))z.pause(c("VideoPlayerReason").USER);else{this.$VideoWatchAndScrollController66();this.$VideoWatchAndScrollController62(z,c("VideoPlayerReason").AUTOPLAY,false,true)}this.$VideoWatchAndScrollController54()}};y.prototype.$VideoWatchAndScrollController66=function(){"use strict";this.$VideoWatchAndScrollController48=this.$VideoWatchAndScrollController49};y.prototype.$VideoWatchAndScrollController80=function(z){"use strict";window.removeEventListener("scroll",this.$VideoWatchAndScrollController27);this.$VideoWatchAndScrollController27=z||null;window.addEventListener("scroll",this.$VideoWatchAndScrollController27);c("cancelAnimationFrame")(this.$VideoWatchAndScrollController33);delete this.$VideoWatchAndScrollController33};y.prototype.$VideoWatchAndScrollController54=function(){"use strict";window.removeEventListener("resize",this.$VideoWatchAndScrollController26);this.$VideoWatchAndScrollController80();delete this.$VideoWatchAndScrollController19;this.$VideoWatchAndScrollController30=false};y.prototype.$VideoWatchAndScrollController65=function(z){"use strict";this.$VideoWatchAndScrollController54();if(this.$VideoWatchAndScrollController4&&this.$VideoWatchAndScrollController16!==z)this.$VideoWatchAndScrollController82(z);else{this.$VideoWatchAndScrollController47=this.$VideoWatchAndScrollController58(z.getVideoNode());this.$VideoWatchAndScrollController66();this.$VideoWatchAndScrollController62(z,c("VideoPlayerReason").USER)}};y.prototype.$VideoWatchAndScrollController82=function(z){"use strict";this.$VideoWatchAndScrollController23=z;this.$VideoWatchAndScrollController83()};y.prototype.$VideoWatchAndScrollController62=function(z,A,B,C){"use strict";__p&&__p();if(z.getSource()===c("VideoPlayerLoggerSource").TAHOE){this.$VideoWatchAndScrollController38=false;var D=c("Tahoe").get();if(D)D.onExit("wns")}var E=!!this.$VideoWatchAndScrollController46;if(this.$VideoWatchAndScrollController46){clearTimeout(this.$VideoWatchAndScrollController46);this.$VideoWatchAndScrollController46=null;c("ReactDOM").unmountComponentAtNode(this.$VideoWatchAndScrollController84());this.$VideoWatchAndScrollController85()}var F=this.$VideoWatchAndScrollController1&&(B||C)&&!!this.$VideoWatchAndScrollController17&&this.$VideoWatchAndScrollController17!==z;if(F){this.$VideoWatchAndScrollController37=0;this.$VideoWatchAndScrollController36=[];this.$VideoWatchAndScrollController39=[];this.$VideoWatchAndScrollController42=this.$VideoWatchAndScrollController17;this.$VideoWatchAndScrollController44=babelHelpers["extends"]({},this.$VideoWatchAndScrollController8);this.$VideoWatchAndScrollController45=this.$VideoWatchAndScrollController18;this.$VideoWatchAndScrollController41=this.$VideoWatchAndScrollController14;this.$VideoWatchAndScrollController43=this.$VideoWatchAndScrollController2;this.$VideoWatchAndScrollController2=null;this.$VideoWatchAndScrollController13&&this.$VideoWatchAndScrollController13.remove();this.$VideoWatchAndScrollController32.release();this.$VideoWatchAndScrollController32=new(c("SubscriptionsHandler"))()}this.$VideoWatchAndScrollController17=z;this.$VideoWatchAndScrollController86(this.$VideoWatchAndScrollController14&&this.$VideoWatchAndScrollController37>0?this.$VideoWatchAndScrollController87(this.$VideoWatchAndScrollController37):z);if(this.$VideoWatchAndScrollController50)this.$VideoWatchAndScrollController50.add(z.getVideoID());else this.$VideoWatchAndScrollController50=new(c("Set"))([z.getVideoID()]);if(this.$VideoWatchAndScrollController14&&this.$VideoWatchAndScrollController36.length>this.$VideoWatchAndScrollController37)this.$VideoWatchAndScrollController87(this.$VideoWatchAndScrollController37+1).preload();this.$VideoWatchAndScrollController15=this.$VideoWatchAndScrollController16.getRootNode();var G=!this.$VideoWatchAndScrollController1||!this.$VideoWatchAndScrollController16.isMuted(),H=!this.$VideoWatchAndScrollController1||this.$VideoWatchAndScrollController16.isState("playing"),I=this.$VideoWatchAndScrollController1&&this.$VideoWatchAndScrollController16.isState("finished");if(!this.$VideoWatchAndScrollController1||F){if(!this.$VideoWatchAndScrollController9)c("VideoChannelLogger").startSession(this.$VideoWatchAndScrollController17.getVideoID(),this.$VideoWatchAndScrollController17.getVideoChannelID(),this.$VideoWatchAndScrollController35);if(!B||E){if(E)this.$VideoWatchAndScrollController47=this.$VideoWatchAndScrollController58(this.$VideoWatchAndScrollController15);this.$VideoWatchAndScrollController52(this.$VideoWatchAndScrollController15)}if(this.$VideoWatchAndScrollController9){this.$VideoWatchAndScrollController8=this.$VideoWatchAndScrollController9;if(this.$VideoWatchAndScrollController8.videoRootNode){this.$VideoWatchAndScrollController18=this.$VideoWatchAndScrollController88(this.$VideoWatchAndScrollController8.dimensions,this.$VideoWatchAndScrollController17.getVideoNode());c("DOM").appendContent(this.$VideoWatchAndScrollController8.videoRootNode,this.$VideoWatchAndScrollController18);var J=c("DOM").scry(this.$VideoWatchAndScrollController8.videoRootNode,"._344x"),K=J[0];if(K)c("DOM").remove(K)}}else{this.$VideoWatchAndScrollController8={videoRootNode:this.$VideoWatchAndScrollController15.parentNode,dimensions:c("DOMDimensions").getElementDimensions(this.$VideoWatchAndScrollController15),source:this.$VideoWatchAndScrollController16.getSource()};this.$VideoWatchAndScrollController18=this.$VideoWatchAndScrollController88(this.$VideoWatchAndScrollController8.dimensions,this.$VideoWatchAndScrollController16.getVideoNode());c("DOM").insertAfter(this.$VideoWatchAndScrollController15,this.$VideoWatchAndScrollController18)}var L=null;if(this.$VideoWatchAndScrollController9)L=this.$VideoWatchAndScrollController9.videoRootNode;if(!L&&this.$VideoWatchAndScrollController15)L=this.$VideoWatchAndScrollController15.parentNode;if(L)this.$VideoWatchAndScrollController13=c("EventListener").listen(L,"click",function(){this.$VideoWatchAndScrollController56();z.play(c("VideoPlayerReason").USER);c("setTimeoutAcrossTransitions")(function(){this.$VideoWatchAndScrollController67(z,"beginPlayback",{reason:c("VideoPlayerReason").USER})}.bind(this),s)}.bind(this));this.$VideoWatchAndScrollController16.pause(c("VideoPlayerReason").USER);if(this.$VideoWatchAndScrollController16.isPlayerVersion("silvercity"))this.$VideoWatchAndScrollController16.detachRootNode();var M=this.$VideoWatchAndScrollController7?this.$VideoWatchAndScrollController7.width:this.$VideoWatchAndScrollController6,N=this.$VideoWatchAndScrollController7?this.$VideoWatchAndScrollController7.height:this.$VideoWatchAndScrollController5;this.$VideoWatchAndScrollController16.removeOffsetStylings();this.$VideoWatchAndScrollController16.setDimensions(M,N);this.$VideoWatchAndScrollController4=true;if(F)this.$VideoWatchAndScrollController89();this.$VideoWatchAndScrollController14=this.$VideoWatchAndScrollController90();if(!this.$VideoWatchAndScrollController1&&c("shouldWNSRenderToRHC")())c("Arbiter").inform("VideoWatchAndScrollController/init");if(I)this.$VideoWatchAndScrollController73(this.$VideoWatchAndScrollController16)}else{this.$VideoWatchAndScrollController16.pause(c("VideoPlayerReason").USER);this.$VideoWatchAndScrollController64()}H&&this.$VideoWatchAndScrollController16.play(A);if(G){this.$VideoWatchAndScrollController16.unmute();if(this.$VideoWatchAndScrollController16.getVolume()===0){var O=c("VideoPlayerVolumeSettings").getLastVolumeBeforeMute()||1;this.$VideoWatchAndScrollController16.setVolume(O);this.$VideoWatchAndScrollController16.emit("unmuteVideo")}}this.$VideoWatchAndScrollController16.updateSource(c("VideoPlayerLoggerSource").WATCH_SCROLL);var P=this.$VideoWatchAndScrollController34;if((!this.$VideoWatchAndScrollController1||F)&&P){P.abandonRequest();if(!this.$VideoWatchAndScrollController9)P.reset(z.getVideoID(),z.getVideoChannelID());this.$VideoWatchAndScrollController91();this.$VideoWatchAndScrollController60(z);this.$VideoWatchAndScrollController61(z)}this.$VideoWatchAndScrollController1=true;if(c("shouldWNSRenderToRHC")())c("Arbiter").inform("VideoWatchAndScrollController/start")};y.prototype.$VideoWatchAndScrollController60=function(z){"use strict";if(!z.hasOption("WatchAndScroll","isActive"))z.registerOption("WatchAndScroll","isActive",y.isActive)};y.prototype.$VideoWatchAndScrollController61=function(z){"use strict";this.$VideoWatchAndScrollController32.addSubscriptions(this.$VideoWatchAndScrollController74(z),z.addListener("VideoChannelController/enterChannel",function(){this.$VideoWatchAndScrollController32.release()}.bind(this)),z.addListener("WatchAndScroll/close",function(){this.$VideoWatchAndScrollController56();var A=c("XVideoWNSSurveyController").getURIBuilder().getURI(),B=new(c("AsyncRequest"))().setURI(A);B.send()}.bind(this)))};y.prototype.$VideoWatchAndScrollController92=function(){"use strict";if(!this.$VideoWatchAndScrollController14)return;this.$VideoWatchAndScrollController14.setState({endScreenShown:false});if(this.$VideoWatchAndScrollController16)this.$VideoWatchAndScrollController16.play(c("VideoPlayerReason").USER)};y.prototype.$VideoWatchAndScrollController91=function(){"use strict";__p&&__p();if(!this.$VideoWatchAndScrollController48)return;this.$VideoWatchAndScrollController34.fetchStories(true,function(z,A){var B=this.$VideoWatchAndScrollController14;if(!z||!z.length||!B)return;var C=B.getChannelVideoElements().concat(z);B.setState({channelVideoElements:C},function(){c("setTimeoutAcrossTransitions")(function(){this.$VideoWatchAndScrollController87(this.$VideoWatchAndScrollController37+1).preload()}.bind(this))}.bind(this));this.$VideoWatchAndScrollController39=this.$VideoWatchAndScrollController39.concat(A)}.bind(this))};y.prototype.$VideoWatchAndScrollController87=function(z){"use strict";var A=this.$VideoWatchAndScrollController14?this.$VideoWatchAndScrollController14.getChannelVideoElements():[],B=[this.$VideoWatchAndScrollController17].concat(this.$VideoWatchAndScrollController36),C=null;B.forEach(function(D){if(A[z].contains(D.getRootNode()))C=D});C||j(0);return C};y.prototype.$VideoWatchAndScrollController93=function(){"use strict";if(v)if(v.$VideoWatchAndScrollController51)for(var z=0;z<v.$VideoWatchAndScrollController36.length;z++){var A=v.$VideoWatchAndScrollController36[z];if(v.$VideoWatchAndScrollController51.contains(A.getRootNode()))return A}return null};y.prototype.$VideoWatchAndScrollController64=function(){"use strict";__p&&__p();var z=this.$VideoWatchAndScrollController16.isMuted();this.$VideoWatchAndScrollController16.pause(c("VideoPlayerReason").USER);if(this.$VideoWatchAndScrollController16!==this.$VideoWatchAndScrollController17)this.$VideoWatchAndScrollController16.abortLoading();this.$VideoWatchAndScrollController86(this.$VideoWatchAndScrollController87(this.$VideoWatchAndScrollController37));this.$VideoWatchAndScrollController15=this.$VideoWatchAndScrollController16.getRootNode();var A=this.$VideoWatchAndScrollController16.getVideoNode(),B=parseFloat(A.getAttribute("data-original-aspect-ratio"));if(!B)B=16/9;var C=this.$VideoWatchAndScrollController47;if(!C)C=this.$VideoWatchAndScrollController58(A);this.$VideoWatchAndScrollController14&&(C.width=this.$VideoWatchAndScrollController14.getWidth());C.height=C.width/B;if(c("VideoPlayerExperiments").rhcWNSEnabled)C.height=Math.min(C.height,x());else if(C.height>p){C.height=p;C.width=C.height*B}this.$VideoWatchAndScrollController16.removeOffsetStylings();this.$VideoWatchAndScrollController16.setDimensions(C.width,C.height);this.$VideoWatchAndScrollController52(A);this.$VideoWatchAndScrollController14&&this.$VideoWatchAndScrollController14.setState({playbackFinished:false,videoIndex:this.$VideoWatchAndScrollController37,width:C.width,height:C.height},function(){if(c("shouldWNSRenderToRHC")())c("Arbiter").inform("VideoWatchAndScrollController/resize")});this.$VideoWatchAndScrollController47=C;this.$VideoWatchAndScrollController16.play(c("VideoPlayerReason").AUTOPLAY);z&&this.$VideoWatchAndScrollController16.mute();if(this.$VideoWatchAndScrollController36.length<=this.$VideoWatchAndScrollController37)this.$VideoWatchAndScrollController91();else this.$VideoWatchAndScrollController87(this.$VideoWatchAndScrollController37+1).preload()};y.prototype.$VideoWatchAndScrollController94=function(){"use strict";var z=m;if(this.$VideoWatchAndScrollController12)z+=this.$VideoWatchAndScrollController12.scrollHeight;return Math.max(z,o)};y.prototype.$VideoWatchAndScrollController52=function(z){"use strict";__p&&__p();if(this.$VideoWatchAndScrollController47){this.$VideoWatchAndScrollController7={height:this.$VideoWatchAndScrollController47.height,left:this.$VideoWatchAndScrollController47.left,top:this.$VideoWatchAndScrollController47.top,width:this.$VideoWatchAndScrollController47.width};return}if(z){var A=z.scrollWidth,B=z.scrollHeight,C=this.$VideoWatchAndScrollController78(z),D=C*B/A;this.$VideoWatchAndScrollController7.height=D;this.$VideoWatchAndScrollController7.width=C}else this.$VideoWatchAndScrollController7={height:this.$VideoWatchAndScrollController5,left:m,top:this.$VideoWatchAndScrollController94(),width:this.$VideoWatchAndScrollController6}};y.prototype.$VideoWatchAndScrollController88=function(z,A){"use strict";__p&&__p();var B=c("DOM").create("canvas",{className:"_57n6"});B.height=z.height;B.width=z.width;if(B.getContext&&B.getContext("2d"))if(A.scrollHeight===0){var C=c("DOM").scry(A.parentNode,"._3t5i"),D=C[0];if(D){var E=B.getContext("2d");E.drawImage(D,0,0)}}else if(A instanceof window.HTMLVideoElement){var F=new(c("VideoFrameBuffer"))(B,A);F.updateFrameBuffer()}var G=c("DOM").create("div");G.appendChild(B);var H=c("DOM").create("i",{className:"_1jto _bsl _3htz"});G.appendChild(H);return G};y.prototype.$VideoWatchAndScrollController56=function(){"use strict";if(this.$VideoWatchAndScrollController19)this.$VideoWatchAndScrollController54();this.$VideoWatchAndScrollController16.pause(c("VideoPlayerReason").USER);this.$VideoWatchAndScrollController83()};y.prototype.$VideoWatchAndScrollController95=function(){"use strict";this.$VideoWatchAndScrollController16.emit("WatchAndScroll/collapse")};y.prototype.$VideoWatchAndScrollController96=function(){"use strict";__p&&__p();var z=this.$VideoWatchAndScrollController88(this.$VideoWatchAndScrollController7,this.$VideoWatchAndScrollController16.getVideoNode(),true);this.$VideoWatchAndScrollController14&&this.$VideoWatchAndScrollController14.setState({fadeOut:true,fadeOutPlaceholder:z});this.$VideoWatchAndScrollController97(this.$VideoWatchAndScrollController17,this.$VideoWatchAndScrollController8);if(this.$VideoWatchAndScrollController18){c("DOM").remove(this.$VideoWatchAndScrollController18);this.$VideoWatchAndScrollController18=null}if(this.$VideoWatchAndScrollController13){this.$VideoWatchAndScrollController13.remove();this.$VideoWatchAndScrollController13=null}};y.prototype.$VideoWatchAndScrollController97=function(z,A,B){"use strict";__p&&__p();var C=z.getOption("VideoWithLiveBroadcast","isLive");z.pause(c("VideoPlayerReason").USER);if(z.isPlayerVersion("silvercity"))z.detachRootNode();B&&c("ReactDOM").unmountComponentAtNode(B);if(A.dimensions&&A.dimensions.width&&A.dimensions.height){z.addOffsetStylings();z.setDimensions(A.dimensions.width,A.dimensions.height)}if(A.videoRootNode)c("DOM").prependContent(A.videoRootNode,z.getRootNode());z.emit("WatchAndScroll/positionUpdated");z.updateSource(A.source||c("VideoPlayerLoggerSource").INLINE);var D=this.$VideoWatchAndScrollController72(z.getVideoNode()),E=D.top,F=c("getViewportDimensions")().height;if(z.getSource()!==c("VideoPlayerLoggerSource").PERMALINK)z.mute();if(E<window.scrollY||E>window.scrollY+F){z.pause(c("VideoPlayerReason").AUTOPLAY);z.emit("resumeAutoplay")}else z.play(c("VideoPlayerReason").USER)};y.prototype.$VideoWatchAndScrollController89=function(){"use strict";__p&&__p();this.$VideoWatchAndScrollController4||j(0);this.$VideoWatchAndScrollController41||j(0);this.$VideoWatchAndScrollController41.setState({fadeOut:true});this.$VideoWatchAndScrollController46=c("setTimeoutAcrossTransitions")(function(){this.$VideoWatchAndScrollController42||j(0);this.$VideoWatchAndScrollController43||j(0);this.$VideoWatchAndScrollController97(this.$VideoWatchAndScrollController42,this.$VideoWatchAndScrollController44,this.$VideoWatchAndScrollController43);if(this.$VideoWatchAndScrollController45){c("DOM").remove(this.$VideoWatchAndScrollController45);this.$VideoWatchAndScrollController45=null}this.$VideoWatchAndScrollController46=null}.bind(this),s)};y.prototype.$VideoWatchAndScrollController55=function(){"use strict";__p&&__p();this.$VideoWatchAndScrollController4||j(0);this.$VideoWatchAndScrollController14||j(0);if(!this.$VideoWatchAndScrollController23&&c("shouldWNSRenderToRHC")())c("Arbiter").inform("VideoWatchAndScrollController/exit");this.$VideoWatchAndScrollController36.forEach(function(z){return z.abortLoading()});this.$VideoWatchAndScrollController96();this.$VideoWatchAndScrollController46=c("setTimeoutAcrossTransitions")(function(){c("ReactDOM").unmountComponentAtNode(this.$VideoWatchAndScrollController84());this.$VideoWatchAndScrollController85()}.bind(this),s)};y.prototype.$VideoWatchAndScrollController85=function(){"use strict";__p&&__p();this.$VideoWatchAndScrollController4||j(0);this.$VideoWatchAndScrollController34&&this.$VideoWatchAndScrollController34.abandonRequest();this.$VideoWatchAndScrollController37=0;this.$VideoWatchAndScrollController1=false;this.$VideoWatchAndScrollController32.release();this.$VideoWatchAndScrollController32=new(c("SubscriptionsHandler"))();this.$VideoWatchAndScrollController8={};this.$VideoWatchAndScrollController16=null;this.$VideoWatchAndScrollController17=null;this.$VideoWatchAndScrollController4=false;this.$VideoWatchAndScrollController36=[];this.$VideoWatchAndScrollController39=[];this.$VideoWatchAndScrollController14=null;clearTimeout(this.$VideoWatchAndScrollController46);this.$VideoWatchAndScrollController46=null;if(this.$VideoWatchAndScrollController42&&this.$VideoWatchAndScrollController43&&this.$VideoWatchAndScrollController44)this.$VideoWatchAndScrollController97(this.$VideoWatchAndScrollController42,this.$VideoWatchAndScrollController44,this.$VideoWatchAndScrollController43);this.$VideoWatchAndScrollController42=null;this.$VideoWatchAndScrollController44={};if(this.$VideoWatchAndScrollController45){c("DOM").remove(this.$VideoWatchAndScrollController45);this.$VideoWatchAndScrollController45=null}c("VideoAutoplayControllerX").setShouldAutoplay(true);this.$VideoWatchAndScrollController2=null;if(this.$VideoWatchAndScrollController23){this.$VideoWatchAndScrollController47=this.$VideoWatchAndScrollController58(this.$VideoWatchAndScrollController23.getVideoNode());this.$VideoWatchAndScrollController66();this.$VideoWatchAndScrollController62(this.$VideoWatchAndScrollController23,c("VideoPlayerReason").USER);this.$VideoWatchAndScrollController23=null}this.$VideoWatchAndScrollController30=false;this.$VideoWatchAndScrollController47=null;c("VideoChannelLogger").endSession()};y.prototype.$VideoWatchAndScrollController90=function(){"use strict";return c("ReactDOM").render(c("React").createElement(c("VideoWatchAndScrollContainer.react"),{isDrawerEnabled:c("VideoPlayerExperiments").rhcWNSDrawerEnabled&&c("shouldWNSRenderToRHC")()&&c("VideoPlayerExperiments").rhcWNSExpandToTahoe,isLiveVideo:function(){return this.$VideoWatchAndScrollController16.isLiveVideo()}.bind(this),initialPosition:this.$VideoWatchAndScrollController7,initialVideoElement:this.$VideoWatchAndScrollController15,onChannelNavigation:this.$VideoWatchAndScrollController98.bind(this),onClick:this.$VideoWatchAndScrollController99.bind(this),onClose:this.$VideoWatchAndScrollController56.bind(this),onCollapse:this.$VideoWatchAndScrollController95.bind(this),onDoubleClick:this.$VideoWatchAndScrollController100.bind(this),onDrop:this.$VideoWatchAndScrollController101.bind(this),onGrab:this.$VideoWatchAndScrollController102.bind(this),onInitialPositionUpdate:this.$VideoWatchAndScrollController103.bind(this),onLoadUpNext:this.registerUpNextUnit.bind(this),onPlayNext:this.$VideoWatchAndScrollController104.bind(this),onReplay:this.$VideoWatchAndScrollController92.bind(this),viewedVideos:Array.from(this.$VideoWatchAndScrollController50),videoID:this.$VideoWatchAndScrollController16.getVideoID()}),this.$VideoWatchAndScrollController84())};y.prototype.$VideoWatchAndScrollController83=function(){"use strict";if(this.$VideoWatchAndScrollController17)this.$VideoWatchAndScrollController17.emit("exitWatchAndScroll")};y.prototype.$VideoWatchAndScrollController98=function(z){"use strict";if(z>0&&this.$VideoWatchAndScrollController36.length<=this.$VideoWatchAndScrollController37){if(!c("shouldWNSRenderToRHC")())this.$VideoWatchAndScrollController56();return}this.$VideoWatchAndScrollController37+=z;this.$VideoWatchAndScrollController64()};y.prototype.$VideoWatchAndScrollController104=function(){"use strict";var z=this.$VideoWatchAndScrollController93();if(z){this.$VideoWatchAndScrollController51=null;z.emit("crossfadeWatchAndScroll");z.play(c("VideoPlayerReason").AUTOPLAY)}};y.prototype.$VideoWatchAndScrollController102=function(){"use strict";if(this.$VideoWatchAndScrollController19)this.$VideoWatchAndScrollController54();var z=this.$VideoWatchAndScrollController16.getOption("VideoWithLiveBroadcast","isLive");if(z)return;this.$VideoWatchAndScrollController24=this.$VideoWatchAndScrollController16.isState("playing");this.$VideoWatchAndScrollController16.pause(c("VideoPlayerReason").USER)};y.prototype.$VideoWatchAndScrollController101=function(){"use strict";var z=this.$VideoWatchAndScrollController16.getOption("VideoWithLiveBroadcast","isLive");if(z)return;if(this.$VideoWatchAndScrollController24)this.$VideoWatchAndScrollController16.play(c("VideoPlayerReason").USER);this.$VideoWatchAndScrollController24=null};y.prototype.$VideoWatchAndScrollController99=function(){"use strict";var z=this.$VideoWatchAndScrollController16.getOption("VideoWithLiveBroadcast","isLive");if(this.$VideoWatchAndScrollController19||z)return;if(this.$VideoWatchAndScrollController16.isState("playing"))this.$VideoWatchAndScrollController16.pause(c("VideoPlayerReason").USER);else if(this.$VideoWatchAndScrollController16.isState("paused")||this.$VideoWatchAndScrollController16.isState("finished")||this.$VideoWatchAndScrollController16.isState("ready"))this.$VideoWatchAndScrollController16.play(c("VideoPlayerReason").USER)};y.prototype.$VideoWatchAndScrollController86=function(z){"use strict";__p&&__p();if(this.$VideoWatchAndScrollController16===z)return;if(c("VideoPlayerExperiments").rhcWNSEnabled)z.addListener("WatchAndScroll/collapse",function(){if(z!=this.$VideoWatchAndScrollController16){z.removeCurrentListener();return}if(!c("shouldWNSRenderToRHC")())return;c("Arbiter").inform("VideoWatchAndScrollController/collapse")}.bind(this));this.$VideoWatchAndScrollController16=z};y.prototype.$VideoWatchAndScrollController100=function(){"use strict";if(this.$VideoWatchAndScrollController19)return;var z=this.$VideoWatchAndScrollController16.getOption("VideoWithClickToChannelView","isChannelEligible"),A=this.$VideoWatchAndScrollController16.getVideoID()===this.$VideoWatchAndScrollController17.getVideoID();if(A&&!z)return;c("Bootloader").loadModules(["VideoChannelController"],function(B){this.$VideoWatchAndScrollController71();B.openFromVideoPlayer(this.$VideoWatchAndScrollController16,this.$VideoWatchAndScrollController16.getVideoChannelID(),this.$VideoWatchAndScrollController35,this.$VideoWatchAndScrollController69())}.bind(this),"VideoWatchAndScrollController")};y.prototype.pauseActiveVideo=function(z){"use strict";if(!this.$VideoWatchAndScrollController16)return;this.$VideoWatchAndScrollController16.pause(z)};y.pauseActiveVideo=function(){var z=arguments.length<=0||arguments[0]===undefined?c("VideoPlayerReason").USER:arguments[0];"use strict";if(!v)return;v.pauseActiveVideo(z)};y.prototype.playActiveVideo=function(z){"use strict";if(!this.$VideoWatchAndScrollController16)return;this.$VideoWatchAndScrollController16.play(z)};y.prototype.registerUpNextUnit=function(z){"use strict";__p&&__p();var A=c("DOM").find(z,"._3iqr");if(!v||!A)return;v.$VideoWatchAndScrollController51=z;c("EventListener").listen(A,"click",function(event){__p&&__p();if(!v)return;var B=v.$VideoWatchAndScrollController93();if(B){event.preventDefault();event.stopPropagation();v.$VideoWatchAndScrollController51=null;B.emit("crossfadeWatchAndScroll");B.play(c("VideoPlayerReason").USER)}})};y.playActiveVideo=function(){var z=arguments.length<=0||arguments[0]===undefined?c("VideoPlayerReason").USER:arguments[0];"use strict";if(!v)return;v.playActiveVideo(z)};y.prototype.$VideoWatchAndScrollController103=function(z){"use strict";this.$VideoWatchAndScrollController7=z;if(this.$VideoWatchAndScrollController14&&!this.$VideoWatchAndScrollController14.getFadeOutStatus()){this.$VideoWatchAndScrollController16.removeOffsetStylings();this.$VideoWatchAndScrollController16.setDimensions(z.width,z.height);this.$VideoWatchAndScrollController16.emit("WatchAndScroll/positionUpdated")}};y.prototype.$VideoWatchAndScrollController105=function(){"use strict";var z=c("DOM").create("div");if(c("shouldWNSRenderToRHC")())c("ifRequired")("RHCVideoWNSController",function(A){return A.mount(z)});else c("DOM").appendContent(document.body,z);return z};y.prototype.$VideoWatchAndScrollController84=function(){"use strict";if(!this.$VideoWatchAndScrollController2)this.$VideoWatchAndScrollController2=this.$VideoWatchAndScrollController105();return this.$VideoWatchAndScrollController2};f.exports=y}),null);