(function(g){var window=this;/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
'use strict';var U0=function(a){a.ea("cardstatechange",a.Nh()&&a.Sk()?1:0)},V0=function(a,b){var c=g.Qa(b),d=c?b:arguments;
for(c=c?0:1;c<d.length;c++){if(null==a)return;a=a[d[c]]}return a},gUa=function(a){var b=g.Rm(a);
a=g.Um(a);return new g.Em(b.x,b.y,a.width,a.height)},hUa=function(a){return Math.pow(a,3)},iUa=function(a){return 3*a*a-2*a*a*a},Y0=function(a){a=g.Ta(a);
delete W0[a];g.ag(W0)&&X0&&X0.stop()},kUa=function(){X0||(X0=new g.L(function(){jUa()},20));
var a=X0;a.isActive()||a.start()},jUa=function(){var a=g.Xa();
g.Mf(W0,function(b){lUa(b,a)});
g.ag(W0)||kUa()},Z0=function(a,b,c,d){g.Mp.call(this);
if(!Array.isArray(a)||!Array.isArray(b))throw Error("Start and end parameters must be arrays");if(a.length!=b.length)throw Error("Start and end points must be the same length");this.u=a;this.N=b;this.duration=c;this.J=d;this.coords=[];this.progress=this.K=0;this.D=null},lUa=function(a,b){b<a.startTime&&(a.endTime=b+a.endTime-a.startTime,a.startTime=b);
a.progress=(b-a.startTime)/(a.endTime-a.startTime);1<a.progress&&(a.progress=1);a.K=1E3/(b-a.D);a.D=b;mUa(a,a.progress);1==a.progress?(a.j=0,Y0(a),a.onFinish(),a.Fx()):a.Kc()&&a.rD()},mUa=function(a,b){"function"===typeof a.J&&(b=a.J(b));
a.coords=Array(a.u.length);for(var c=0;c<a.u.length;c++)a.coords[c]=(a.N[c]-a.u[c])*b+a.u[c]},nUa=function(a,b){g.Cf.call(this,a);
this.coords=b.coords;this.x=b.coords[0];this.y=b.coords[1];this.z=b.coords[2];this.duration=b.duration;this.progress=b.progress;this.fps=b.K;this.state=b.j},$0=function(a,b,c,d,e){Z0.call(this,b,c,d,e);
this.element=a},a1=function(a,b,c,d,e){if(2!=b.length||2!=c.length)throw Error("Start and end points must be 2D");
$0.call(this,a,b,c,d,e)},b1=function(a){g.G.call(this);
this.u=a||window;this.j=[]},c1=function(a){return a.baseUrl||null},d1=function(a,b){return g.In(g.Pl(a,b,void 0),function(c){return!!c})},oUa=function(a,b,c){function d(na){var za=na.hovercardButton;
if(!za)return null;za=za.subscribeButtonRenderer;if(!za)return null;var Va=f(za.unsubscribedButtonText),Qb=f(za.subscribedButtonText);if(za.subscribed){var Ma=f(za.subscriberCountWithUnsubscribeText);var zb=f(za.subscriberCountText)}else Ma=f(za.subscriberCountText),zb=f(za.subscriberCountWithSubscribeText);var sc=null;if(na.signinEndpoint){sc=V0(na,"signinEndpoint","webNavigationEndpointData","url");if(!sc){var Td,le,Ha;sc=null==(Td=za.signInEndpoint)?void 0:null==(le=Td.commandMetadata)?void 0:
null==(Ha=le.webCommandMetadata)?void 0:Ha.url}if(!sc)return null}return Va&&(Qb||sc)?{subscribed:za.subscribed,subscribeText:Va,subscribeCount:Ma,unsubscribeText:Qb,unsubscribeCount:zb,enabled:za.enabled,signinUrl:sc,classic:na.useClassicSubscribeButton}:null}
function e(na){if(na){var za=[],Va=na.videoId;Va&&za.push("v="+Va);(Va=na.playlistId)&&za.push("list="+Va);(na=na.startTimeSeconds)&&za.push("t="+na);return"/watch?"+za.join("&")}}
function f(na){if(!na)return null;var za=na.simpleText;return za?za:na.runs?g.Pl(na.runs,function(Va){return Va.text}).join(""):null}
b=b.endscreenElementRenderer;if(!b)return null;var k=b.style,l=b.endpoint||{},m=null,n=null,p=!1,q=null,t=null,w=null,x=null,y=!1,z=null,E=null,I=null,J=null,N=null;if("VIDEO"===k)l.urlEndpoint?m=l.urlEndpoint.url:m=e(l.watchEndpoint),n=!1,q=a,b.thumbnailOverlays?(p=b.thumbnailOverlays[0].thumbnailOverlayTimeStatusRenderer,t=f(p.text),p="LIVE"===p.style):t=f(b.videoDuration);else if("PLAYLIST"===k)l.urlEndpoint?m=l.urlEndpoint.url:m=e(l.watchEndpoint),n=!1,q=a,w=f(b.playlistLength);else if("CHANNEL"===
k){if(y=V0(l,"browseEndpoint","browseId"))x=y,m="/channel/"+x;n=!1;q="new";(y=!!b.isSubscribe)?z=d(b):E=f(b.subscribersText)}else"WEBSITE"===k?((I=V0(l,"urlEndpoint","url"))&&(m=I),n=!0,q="new",I=b.icon.thumbnails[0].url):"CREATOR_MERCHANDISE"===k&&(b.productPrice&&(J=f(b.productPrice)),b.additionalFeesText&&(N=f(b.additionalFeesText)),(n=V0(l,"urlEndpoint","url"))&&(m=n),n=!0,q="new");a=V0(b,"title","accessibility","accessibilityData","label");var aa=b.endpoint?b.endpoint.clickTrackingParams:null,
K="";if(b.metadata){var oa=f(b.metadata);oa&&(K=oa)}return{id:"element-"+c,type:k,title:f(b.title),metadata:K,callToAction:f(b.callToAction),NL:b.image,iconUrl:I,left:Number(b.left),width:Number(b.width),top:Number(b.top),aspectRatio:Number(b.aspectRatio),startMs:Math.floor(Number(b.startMs)),endMs:Math.floor(Number(b.endMs)),videoDuration:t,isLiveVideo:p,playlistLength:w,channelId:x,subscribeButton:z,subscribersText:E,isSubscribe:y,targetUrl:m||null,vV:n,sessionData:aa?{itct:aa}:null,d_:q,Sv:a?a:
null,isPlaceholder:b.isPlaceholder,impressionUrls:d1(b.impressionUrls||[],c1),kV:d1(b.hovercardShowUrls||[],c1),clickUrls:d1(l.loggingUrls||[],c1),visualElement:g.Hv(b.trackingParams),productPrice:J,additionalFeesText:N}},e1=function(a,b){var c={startMs:Math.floor(Number(a.startMs)),
impressionUrls:d1(a.impressionUrls||[],c1),elements:d1(a.elements||[],function(d,e){return oUa(b,d,e)})};
a.trackingParams&&(c.visualElement=g.Hv(a.trackingParams));return c},f1=function(a){g.tL.call(this,a);
this.B=this.endscreen=null;this.j={};this.D={};this.C=this.u=null;this.K=[];this.X=!0;this.J=0;a=a.V();this.N=g.GC(a)||g.KC(a);this.events=new g.gA(this);g.H(this,this.events);this.events.T(this.player,g.Kw("creatorendscreen"),this.onCueRangeEnter);this.events.T(this.player,g.Lw("creatorendscreen"),this.onCueRangeExit);this.events.T(this.player,"resize",this.zb);this.events.T(window,"focus",this.eZ);this.load();var b=g.$h("STYLE");(g.Qh("HEAD")[0]||document.body).appendChild(b);g.Bf(this,function(){g.di(b)});
b.sheet&&(b.sheet.insertRule(".ytp-ce-playlist-icon {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASBAMAAACk4JNkAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAIVBMVEVMaXGzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7P///91E4wTAAAACXRSTlMArBbpVOtYrReN+x2FAAAAAWJLR0QKaND0VgAAACFJREFUCNdjYCAWzIQAFBaZ6hgVYLKcJnBWGEyWvYGASwCXtBf7m4i3CQAAAABJRU5ErkJggg==) no-repeat center;background-size:18px;width:18px;height:18px}",0),b.sheet.insertRule(".ytp-ce-size-853 .ytp-ce-playlist-icon, .ytp-ce-size-1280 .ytp-ce-playlist-icon, .ytp-ce-size-1920 .ytp-ce-playlist-icon {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJ1BMVEVMaXGzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7P///9RfzIKAAAAC3RSTlMAvDeyLvxYtDK9Ogx4T1QAAAABYktHRAyBs1FjAAAAK0lEQVQY02NgoBjshgO8HJoYwKiAMGAD92YHJM7uMCTO9gaEHs4FlPuZAQC8Fj8x/xHjxwAAAABJRU5ErkJggg==) no-repeat center;background-size:24px;width:24px;height:24px}",
0))},pUa=function(a){return a.player.getVideoData().D?"current":a.N?"new":"current"},g1=function(a){return"creator-endscreen-editor"===a.player.V().playerStyle},qUa=function(a){var b=a.player.getVideoData(),c=b.videoId;
a.B&&a.B.abort();c={method:"POST",onFinish:function(e){var f=a.B=null;200===e.status&&(e=e.responseText,")]}"===e.substring(0,3)&&(e=e.substring(3),f=JSON.parse(e),f=e1(f,pUa(a))));h1(a,f)},
urlParams:{v:c},withCredentials:!0};a.N&&(c.urlParams.ptype="embedded");var d=b.Xq;d&&(c.postParams={ad_tracking:d});if(b=g.$wa(b))if(b=g.bh(b),b=g.Yg(b))a.B=g.Hr(b,c)},h1=function(a,b,c){c=void 0===c?!0:c;
a.player.lf("creatorendscreen");a.u&&(a.u.dispose(),a.u=null,a.C.dispose(),a.C=null);for(var d=g.r(Object.values(a.j)),e=d.next();!e.done;e=d.next())e.value.dispose();a.j={};a.D={};0<a.K.length&&(a.K.forEach(function(l){l.dispose()}),a.K.length=0);
a.J=0;if((a.endscreen=b)&&b.elements){c&&rUa(a);c=[];d=new g.Iw(b.startMs,0x7ffffffffffff,{id:"ytp-ce-in-endscreen",namespace:"creatorendscreen"});c.push(d);a.player.V().isMobile||(a.u=new g.W({G:"div",L:"ytp-ce-shadow"}),g.gL(a.player,a.u.element,4),a.C=new g.bJ(a.u,200));for(d=0;d<b.elements.length;++d){e=b.elements[d];var f=sUa(a,e);if(f){a.j[e.id]=f;a.D[e.id]=e;g.gL(a.player,f.element,4);var k=new g.Iw(e.startMs,e.endMs,{id:"ytp-ce-element-"+e.id,namespace:"creatorendscreen"});c.push(k);tUa(a,
f,e)}else g.Sv(new g.Js("buildEndscreenElement null",e))}a.player.Sd(c);a.zb()}},rUa=function(a){var b=g.Kv(),c=g.Lv();
c&&b&&a.endscreen.visualElement&&g.Wv(void 0,c,b,[a.endscreen.visualElement])},sUa=function(a,b){var c=null;
switch(b.type){case "VIDEO":a={G:"div",Ga:["ytp-ce-element","ytp-ce-video"],W:{tabindex:"0","aria-label":b.Sv||"","aria-hidden":"true"},U:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-covering-image",W:i1(b)},{G:"div",L:"ytp-ce-covering-shadow-top"},{G:"a",L:"ytp-ce-covering-overlay",W:{href:j1(a,b.targetUrl),tabindex:"-1"},U:[{G:"div",Ga:["ytp-ce-video-title","ytp-webkit-ellipsis"],W:{dir:g.Rp(b.title||"")},oa:b.title},{G:"div",L:b.isLiveVideo?"ytp-ce-live-video-duration":"ytp-ce-video-duration",
oa:b.videoDuration||void 0}]}]};c=new g.W(a);break;case "PLAYLIST":a={G:"div",Ga:["ytp-ce-element","ytp-ce-playlist"],W:{tabindex:"0","aria-label":b.Sv||"","aria-hidden":"true"},U:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-covering-image",W:i1(b)},{G:"div",L:"ytp-ce-covering-shadow-top"},{G:"a",L:"ytp-ce-covering-overlay",W:{href:j1(a,b.targetUrl),tabindex:"-1"},U:[{G:"div",Ga:["ytp-ce-playlist-title","ytp-webkit-ellipsis"],W:{dir:g.Rp(b.title||"")},oa:b.title},{G:"div",L:"ytp-ce-playlist-count",
U:[{G:"div",L:"ytp-ce-playlist-icon"},{G:"div",L:"ytp-ce-playlist-count-text",oa:b.playlistLength||void 0}]}]}]};c=new g.W(a);break;case "CHANNEL":c={G:"div",Ga:["ytp-ce-element","ytp-ce-channel",b.isSubscribe?"ytp-ce-channel-this":"ytp-ce-channel-that"],W:{tabindex:"0","aria-label":b.Sv||"","aria-hidden":"true"},U:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-expanding-overlay",U:[{G:"div",L:"ytp-ce-expanding-overlay-hider"},{G:"div",L:"ytp-ce-expanding-overlay-background"},{G:"div",L:"ytp-ce-expanding-overlay-content",
U:[{G:"div",L:"ytp-ce-expanding-overlay-body",U:[{G:"div",L:"ytp-ce-expanding-overlay-body-padding",U:[{G:"a",Ga:["ytp-ce-channel-title","ytp-ce-link"],W:{href:j1(a,b.targetUrl),target:"_blank",tabindex:"-1",dir:g.Rp(b.title||"")},oa:b.title},b.subscribeButton?{G:"div",L:"ytp-ce-subscribe-container",U:[{G:"div",L:"ytp-ce-channel-subscribe"}]}:"",b.subscribersText?{G:"div",L:"ytp-ce-channel-subscribers-text",oa:b.subscribersText}:"",b.metadata?{G:"div",Ga:["ytp-ce-channel-metadata","yt-ui-ellipsis",
"yt-ui-ellipsis-3"],oa:b.metadata}:""]}]}]}]},{G:"div",L:"ytp-ce-expanding-image",W:i1(b)}]};c=new g.W(c);var d=g.Th(document,"div","ytp-ce-channel-subscribe",c.element)[0];if(b.subscribeButton&&b.channelId){g.M(d,"ytp-ce-subscribe-button");if(a.player.V().isMobile){var e=null;var f=b.sessionData.itct}else e="endscreen",f=null;e=new g.yM(b.subscribeButton.subscribeText,b.subscribeButton.subscribeCount,b.subscribeButton.unsubscribeText,b.subscribeButton.unsubscribeCount,!!b.subscribeButton.enabled,
!!b.subscribeButton.classic,b.channelId,!!b.subscribeButton.subscribed,e,f,b.subscribeButton.signinUrl,a.player);d.appendChild(e.element);a.K.push(e)}break;case "WEBSITE":a={G:"div",Ga:["ytp-ce-element","ytp-ce-website"],W:{tabindex:"0","aria-label":b.Sv||"","aria-hidden":"true"},U:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-expanding-overlay",U:[{G:"div",L:"ytp-ce-expanding-overlay-hider"},{G:"div",L:"ytp-ce-expanding-overlay-background"},{G:"div",L:"ytp-ce-expanding-overlay-content",
U:[{G:"div",L:"ytp-ce-expanding-overlay-body",U:[{G:"div",L:"ytp-ce-expanding-overlay-body-padding",U:[{G:"div",L:"ytp-ce-website-title",W:{dir:g.Rp(b.title||"")},oa:b.title},{G:"div",L:"ytp-ce-website-metadata",oa:b.metadata},{G:"a",Ga:["ytp-ce-website-goto","ytp-ce-link"],W:{href:j1(a,b.targetUrl),target:"_blank",tabindex:"-1"},oa:b.callToAction}]}]}]}]},{G:"div",L:"ytp-ce-expanding-image",W:i1(b)},{G:"div",L:"ytp-ce-expanding-icon",W:uUa(b.iconUrl)}]};c=new g.W(a);break;case "CREATOR_MERCHANDISE":c=
"",b.productPrice&&(c={G:"div",L:"ytp-ce-merchandise-price-container",U:[{G:"div",L:"ytp-ce-merchandise-price",oa:b.productPrice}]},b.additionalFeesText&&c.U.push({G:"div",L:"ytp-ce-merchandise-additional-fees",oa:b.additionalFeesText})),a={G:"div",Ga:["ytp-ce-element","ytp-ce-merchandise"],W:{tabindex:"0","aria-label":b.Sv||"","aria-hidden":"true"},U:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-expanding-overlay",U:[{G:"div",L:"ytp-ce-expanding-overlay-hider"},{G:"div",L:"ytp-ce-expanding-overlay-background"},
{G:"div",L:"ytp-ce-expanding-overlay-content",U:[{G:"div",L:"ytp-ce-expanding-overlay-body",U:[{G:"div",L:"ytp-ce-expanding-overlay-body-padding",U:[{G:"div",L:"ytp-ce-merchandise-title",W:{dir:g.Rp(b.title||"")},oa:b.title},c,{G:"div",L:"ytp-ce-merchandise-metadata",oa:b.metadata},{G:"a",Ga:["ytp-ce-merchandise-goto","ytp-ce-link"],W:{href:j1(a,b.targetUrl),target:"_blank",tabindex:"-1"},oa:b.callToAction}]}]}]}]},{G:"div",L:"ytp-ce-expanding-image",W:i1(b)},{G:"div",L:"ytp-ce-merchandise-invideo-cta-container",
U:[{G:"div",L:"ytp-ce-merchandise-invideo-cta",oa:b.callToAction||void 0}]}]},c=new g.W(a)}b.isPlaceholder&&g.M(c.element,"ytp-ce-placeholder");return c},i1=function(a){if(a.NL)var b=a.NL.thumbnails;
return uUa(b?b[b.length-1].url:null)},uUa=function(a){return a?{style:"background-image: url("+a+")"}:{}},tUa=function(a,b,c){function d(m){m&&(b.Pa("blur",function(){"none"!=m.style.display&&a.X&&m.focus()}),b.T(m,"focus",f),b.T(m,"blur",k))}
function e(m){a.J+=m;0<a.J?(g.M(b.element,"ytp-ce-force-expand"),k1(a,c.id,!0)):(g.Dp(b.element,"ytp-ce-force-expand"),g.Dp(b.element,"ytp-ce-element-hover"),k1(a,c.id,!1))}
function f(){e(1)}
function k(){e(-1)}
b.Pa("mouseenter",function(){l1(a,b,c)});
b.Pa("mouseleave",function(){m1(a,b,c)});
a.player.V().isMobile||b.Pa("click",function(){g.M(b.element,"ytp-ce-element-hover")});
b.Pa("click",function(m){vUa(a,c,m)});
b.Pa("keypress",function(m){vUa(a,c,m)});
b.Pa("focus",function(){l1(a,b,c)});
b.Pa("blur",function(){m1(a,b,c)});
b.Pa("touchstart",function(){l1(a,b,c)});
var l=g.Vh("ytp-ce-expanding-overlay-hider",b.element);l&&b.T(l,"touchstart",function(m){m=m||window.event;m.cancelBubble=!0;m.stopPropagation&&m.stopPropagation();g.Dp(b.element,"ytp-ce-element-hover");g.Dp(b.element,"ytp-ce-force-expand")});
b.Pa("keydown",function(m){a.X=9===m.keyCode&&!m.shiftKey});
d(g.Vh("ytp-sb-subscribe",b.element));d(g.Vh("ytp-sb-unsubscribe",b.element));b.Pa("focus",f);b.Pa("blur",k)},vUa=function(a,b,c){if(b.targetUrl&&(!c||"keypress"!==c.type||13===c.keyCode)){for(var d=c.target;d&&!g.Bp(d,"ytp-ce-element");){g.Bp(d,"subscribe-label")&&n1(a,b);
if(g.Bp(d,"ytp-ce-channel-subscribe"))return;d=g.ei(d)}if(!d||g.Bp(d,"ytp-ce-element-hover")){c.preventDefault();c.stopPropagation();if(d=a.j[b.id])m1(a,d,b),d.element.blur();if(c.ctrlKey||c.metaKey||"new"===b.d_)n1(a,b),a.player.sendVideoStatsEngageEvent(17,void 0),a.player.pauseVideo(),c=g.bh(j1(a,b.targetUrl)),c=g.Yg(c),g.BJ(c,void 0,b.sessionData);else{var e=a.player.getVideoData().D,f=function(){var k=j1(a,b.targetUrl),l=b.sessionData,m=g.or(k);e&&m&&(m.v||m.list)?a.player.wk(m.v,l,m.list,!1):
g.AJ(k,l)};
n1(a,b,function(){a.player.sendVideoStatsEngageEvent(17,f)})}}}},j1=function(a,b){a=a.player.V();
if(b){if(b.startsWith("//"))return a.protocol+":"+b;if(b.startsWith("/"))return g.iD(a)+b}else return"";return b},l1=function(a,b,c){g.Bp(b.element,"ytp-ce-element-hover")||("VIDEO"===c.type||"PLAYLIST"===c.type?g.M(b.element,"ytp-ce-element-hover"):a.player.V().isMobile?(new g.L(function(){g.M(b.element,"ytp-ce-element-hover")},200)).start():g.M(b.element,"ytp-ce-element-hover"),o1(a,c.kV),k1(a,c.id,!0))},m1=function(a,b,c){g.Dp(b.element,"ytp-ce-element-hover");
g.Dp(b.element,"ytp-ce-force-expand");k1(a,c.id,!1)},k1=function(a,b,c){a.u&&(c?a.C.show():a.C.hide());
for(var d=g.r(Object.keys(a.j)),e=d.next();!e.done;e=d.next())e=e.value,e!==b&&g.O(a.j[e].element,"ytp-ce-element-shadow-show",c)},o1=function(a,b,c){function d(){f||(e++,e===b.length&&(k.stop(),c&&c()))}
if(!b||0===b.length||g1(a))c&&c();else{b=wUa(a,b);var e=0,f=!1,k=new g.L(function(){f=!0;c&&c()},1E3,a);
k.start();for(a=0;a<b.length;a++)g.Ot(b[a],d)}},n1=function(a,b,c){o1(a,b.clickUrls,c);
(a=g.Lv())&&b.vV&&g.bw(a,b.visualElement)},wUa=function(a,b){var c=a.player.getVideoData().clientPlaybackNonce;
a=a.player.getCurrentTime().toFixed(2);c={CPN:c,AD_CPN:c,MT:a};a=[];for(var d=0;d<b.length;d++)a.push(xUa(b[d],c));return a},xUa=function(a,b){return a.replace(/%5B[a-zA-Z_:]+%5D|\[[a-zA-Z_:]+\]/g,function(c){var d=unescape(c);
d=d.substring(1,d.length-1);return b[d]?escape(b[d]):c})},yUa=function(a){return"string"===typeof a?a:""},p1=function(a,b,c){for(var d in b)if(b[d]===a)return a;
return c},zUa=function(a,b,c,d){this.value=a;
this.target=b;this.showLinkIcon=c;this.j=d},q1=function(a){return a.value?a.value:null},r1=function(a){if(!a)return null;
var b=g.bh(yUa(a.value));b=g.Yg(b);if(!b)return null;var c=p1(a.target,AUa,"current");if(null==c)a=null;else{var d=a.show_link_icon;a=new zUa(b,c,"true"===d||"false"===d?"true"===d:!0,null!=a.pause_on_navigation?a.pause_on_navigation:!0)}return a},BUa=function(a,b,c){this.type=a;
this.trigger=b;this.url=c},EUa=function(a){if(!a)return null;
var b=p1(a.type,CUa),c=p1(a.trigger,DUa);a=a.url;a=Array.isArray(a)&&a.length?a[0]:a;a=r1(a?a:null);return b?new BUa(b,c,a):null},FUa=function(a,b,c,d,e){this.id=a;
this.type=b;this.style=c;this.data=e;this.action=d||[]},HUa=function(a){return(a=GUa(a,function(b){return"openUrl"===b.type&&null!=b.url}))?a.url:null},GUa=function(a,b){return g.ac(a.action,b,void 0)},IUa=function(a,b){this.context=a;
this.j=b},t1=function(a){return a.customMessage?s1("div","iv-card-message",a.customMessage):""},u1=function(a,b){a="background-image: url("+a+");";
var c=[];b&&c.push(b);return{G:"div",L:"iv-card-image",W:{style:a},U:c}},v1=function(a){if(!a.metaInfo||0===a.metaInfo.length)return"";
var b=[];a=g.r(a.metaInfo);for(var c=a.next();!c.done;c=a.next())b.push(s1("li","",c.value));return{G:"ul",L:"iv-card-meta-info",U:b}},s1=function(a,b,c){b?"string"===typeof b?b={"class":b}:Array.isArray(b)&&(b={"class":b.join(" ")}):b={};
b.dir=g.Rp(c);return{G:a,W:b,oa:c}},JUa=function(a){if(!a.customMessage)return"";
var b=["iv-card-action","iv-card-primary-link"],c={};a.Cz&&(b.push("iv-card-action-icon"),c.style="background-image: url("+a.Cz+");");c.dir=g.Rp(a.customMessage);var d=[{G:"span",oa:a.customMessage}];a.showLinkIcon&&(d.push("\u00a0"),d.push({G:"span",L:"iv-card-link-icon"}));return{G:"div",Ga:b,W:c,U:d}},w1=function(a,b,c,d){if(d){b=g.r(b);
for(var e=b.next();!e.done;e=b.next())a.j(e.value,d,c.id,c.sessionData,c.tracking.click,5)}},KUa=function(a,b){this.merchant=a;
this.price=b},LUa=function(a){var b;
(b=a)&&!(b=1<a.length?"/"===a.charAt(0)&&"/"!==a.charAt(1):"/"===a)&&(b=a.replace(/^(https?:)?\/\//,""),b=b.split("/",1),b=!b||1>b.length||!b[0]?[]:b[0].toLowerCase().split(".").reverse(),b="com"===b[0]&&"youtube"===b[1]||"be"===b[0]&&"youtu"===b[1]);return b?-1===a.indexOf("/redirect?"):!1},MUa=function(a,b){return b?b:LUa(a)?"current":"new"},x1=function(a,b){g.G.call(this);
var c=this;this.element=a;this.context=b;this.Ya=!1;this.Ra=new Map;this.Sa=new Map;this.context.I.addEventListener(g.Kw("annotations_module"),function(d){(d=c.Ra.get(d))&&d.apply(c)});
this.context.I.addEventListener(g.Lw("annotations_module"),function(d){(d=c.Sa.get(d))&&d.apply(c)})},y1=function(a,b,c,d,e,f,k){a.context.j.Pa(b,"click",function(l){a.sD(c,d,e,f||[],k||0,l)});
a.context.j.Pa(b,"touchstart",function(){a.Ya=!1});
a.context.j.Pa(b,"touchmove",function(){a.Ya=!0})},NUa=function(a){if(a.urlEndpoint&&a.urlEndpoint.url)return a.urlEndpoint.url;
if(a.watchEndpoint&&a.watchEndpoint.videoId){var b="/watch?v="+a.watchEndpoint.videoId;a.watchEndpoint.playlistId&&(b+="&list="+a.watchEndpoint.playlistId);a.watchEndpoint.index&&(b+="&index="+a.watchEndpoint.index);a.watchEndpoint.startTimeSeconds&&(b+="&t="+a.watchEndpoint.startTimeSeconds);return b}return null},z1=function(a,b,c){return{impression:(a.impressionLoggingUrlsV2s||[]).map(function(d){return d.baseUrl||""}),
click:(c.loggingUrls||[]).map(function(d){return d.baseUrl||""}),
close:(b.dismissLoggingUrlsV2s||[]).map(function(d){return d.baseUrl||""}),
dQ:(b.impressionLoggingUrlsV2s||[]).map(function(d){return d.baseUrl||""}),
nC:(b.clickLoggingUrlsV2s||[]).map(function(d){return d.baseUrl||""})}},C1=function(a,b,c){x1.call(this,b,c);
var d=this;this.I=a;this.eventId=null;this.Ia=this.qb=this.B=this.isInitialized=!1;this.va=null;this.cards=[];this.ib=this.N=this.Ea=this.D=this.Ja=this.j=null;this.Z=[];this.K=this.Ne=this.ya=null;this.J=0;this.xa=new g.L(function(){},c.Y.Le?4E3:3E3);
g.H(this,this.xa);this.Xa=new g.L(function(){});
g.H(this,this.Xa);this.ma=new IUa(c,function(e,f,k,l,m,n){y1(d,e,f,k,l,m,n)});
this.X=new g.W({G:"div",L:"iv-drawer",W:{id:"iv-drawer"},U:[{G:"div",L:"iv-drawer-header",W:{"aria-role":"heading"},U:[{G:"span",L:"iv-drawer-header-text"},{G:"button",Ga:["iv-drawer-close-button","ytp-button"],W:{"aria-label":"Hide cards",tabindex:"0"}}]},{G:"div",L:"iv-drawer-content"}]});g.H(this,this.X);this.C=this.X.element;this.Wa=new g.bJ(this.X,330);g.H(this,this.Wa);this.jb=g.Vh("iv-drawer-header-text",this.C);this.u=g.Vh("iv-drawer-content",this.C);this.addCueRange(0,1E3*c.videoData.lengthSeconds,
"",function(){d.qb&&A1(d,"YOUTUBE_DRAWER_AUTO_OPEN")},function(){(d.qb=d.B)&&B1(d)})},OUa=function(a,b){b=b.data;
b.autoOpenMs&&a.addCueRange(b.autoOpenMs,0x8000000000000,"",function(){A1(a,"YOUTUBE_DRAWER_AUTO_OPEN")});
b.autoCloseMs&&a.addCueRange(b.autoCloseMs,0x8000000000000,"",function(){B1(a)});
var c=b.headerText;g.gi(a.jb,c);a.N&&a.N.setAttribute("title",c);b.eventId&&(a.eventId=b.eventId);a.ya=g.Hv(b.trackingParams);a.K=g.Hv(b.closeTrackingParams);a.Ne=g.Hv(b.iconTrackingParams)},PUa=function(a,b){var c=b.cardId?b.cardId:"cr:"+a.J;
if(b.content.simpleCardContentRenderer){if(!b.cueRanges.length)return;var d=b.content.simpleCardContentRenderer,e=b.teaser.simpleCardTeaserRenderer,f=b.icon?b.icon.infoCardIconRenderer:null;b={id:c,timestamp:a.J,type:"simple",teaserText:g.Pw(e.message),teaserDurationMs:Number(b.cueRanges[0].teaserDurationMs),startMs:Number(b.cueRanges[0].startCardActiveMs),autoOpen:!!b.autoOpen,sessionData:D1(a,c,b,d),sponsored:!1,tracking:z1(d,e,d.command),gm:d.trackingParams?g.Hv(d.trackingParams):null,pj:e.trackingParams?
g.Hv(e.trackingParams):null,Ne:f&&f.trackingParams?g.Hv(f.trackingParams):null,imageUrl:E1(d.image.thumbnails,290).url,displayDomain:d.displayDomain?g.Pw(d.displayDomain):null,showLinkIcon:!!d.showLinkIcon,Cz:null,title:d.title?g.Pw(d.title):"",customMessage:d.callToAction?g.Pw(d.callToAction):"",url:d.command.urlEndpoint.url?r1({pause_on_navigation:!a.context.videoData.isLivePlayback,target:"new",value:d.command.urlEndpoint.url}):null};F1(a,b)}else if(b.content.collaboratorInfoCardContentRenderer){if(!b.cueRanges.length)return;
d=b.content.collaboratorInfoCardContentRenderer;e=b.teaser.simpleCardTeaserRenderer;f=b.icon?b.icon.infoCardIconRenderer:null;b={id:c,timestamp:a.J,type:"collaborator",teaserText:g.Pw(e.message),teaserDurationMs:Number(b.cueRanges[0].teaserDurationMs),startMs:Number(b.cueRanges[0].startCardActiveMs),autoOpen:!!b.autoOpen,sessionData:D1(a,c,b,d),sponsored:!1,tracking:z1(d,e,d.endpoint),gm:d.trackingParams?g.Hv(d.trackingParams):null,pj:e.trackingParams?g.Hv(e.trackingParams):null,Ne:f&&f.trackingParams?
g.Hv(f.trackingParams):null,channelId:d.endpoint.browseEndpoint.browseId,customMessage:d.customText?g.Pw(d.customText):null,profileImageUrl:E1(d.channelAvatar.thumbnails,290).url,title:d.channelName?g.Pw(d.channelName):"",metaInfo:[d.subscriberCountText?g.Pw(d.subscriberCountText):""],url:r1({pause_on_navigation:!a.context.videoData.isLivePlayback,target:"new",value:d.endpoint.browseEndpoint.canonicalBaseUrl?d.endpoint.browseEndpoint.canonicalBaseUrl:"/channel/"+d.endpoint.browseEndpoint.browseId})};
F1(a,b)}else if(b.content.playlistInfoCardContentRenderer){if(!b.cueRanges.length)return;d=b.content.playlistInfoCardContentRenderer;e=b.teaser.simpleCardTeaserRenderer;f=b.icon?b.icon.infoCardIconRenderer:null;b={id:c,timestamp:a.J,type:"playlist",teaserText:g.Pw(e.message),teaserDurationMs:Number(b.cueRanges[0].teaserDurationMs),startMs:Number(b.cueRanges[0].startCardActiveMs),autoOpen:!!b.autoOpen,sessionData:D1(a,c,b,d),sponsored:!1,tracking:z1(d,e,d.action),gm:d.trackingParams?g.Hv(d.trackingParams):
null,pj:e.trackingParams?g.Hv(e.trackingParams):null,Ne:f&&f.trackingParams?g.Hv(f.trackingParams):null,Gy:E1(d.playlistThumbnail.thumbnails,258).url,customMessage:d.customMessage?g.Pw(d.customMessage):null,playlistVideoCount:g.Pw(d.playlistVideoCount),title:d.playlistTitle?g.Pw(d.playlistTitle):"",metaInfo:[d.channelName?g.Pw(d.channelName):"",d.videoCountText?g.Pw(d.videoCountText):""],url:r1({pause_on_navigation:!a.context.videoData.isLivePlayback,target:"new",value:NUa(d.action)})};F1(a,b)}else if(b.content.videoInfoCardContentRenderer){if(!b.cueRanges.length)return;
d=b.content.videoInfoCardContentRenderer;e=b.teaser.simpleCardTeaserRenderer;f=b.icon?b.icon.infoCardIconRenderer:null;b={id:c,timestamp:a.J,type:"video",teaserText:g.Pw(e.message),teaserDurationMs:Number(b.cueRanges[0].teaserDurationMs),startMs:Number(b.cueRanges[0].startCardActiveMs),autoOpen:!!b.autoOpen,sessionData:D1(a,c,b,d),sponsored:!1,tracking:z1(d,e,d.action),gm:d.trackingParams?g.Hv(d.trackingParams):null,pj:e.trackingParams?g.Hv(e.trackingParams):null,Ne:f&&f.trackingParams?g.Hv(f.trackingParams):
null,Gy:E1(d.videoThumbnail.thumbnails,258).url,videoDuration:d.lengthString?g.Pw(d.lengthString):null,customMessage:d.customMessage?g.Pw(d.customMessage):null,title:d.videoTitle?g.Pw(d.videoTitle):"",metaInfo:[d.channelName?g.Pw(d.channelName):"",d.viewCountText?g.Pw(d.viewCountText):""],isLiveNow:!!d.badge,url:r1({pause_on_navigation:!a.context.videoData.isLivePlayback,target:"new",value:NUa(d.action)})};F1(a,b)}a.J++},E1=function(a,b){for(var c=-1,d=-1,e=0;e<a.length;e++){if(a[e].height===b||290===
a[e].width)return a[e];
((a[e].height||0)<b||290>(a[e].width||0))&&(0>c||(a[c].height||0)<(a[e].height||0)||(a[c].width||0)<(a[e].width||0))?c=e:((a[e].height||0)>=b||290<=(a[e].width||0))&&(0>d||(a[d].height||0)>(a[e].height||0)||(a[d].width||0)>(a[e].width||0))&&(d=e)}return a[0<=d?d:c]},D1=function(a,b,c,d){return{feature:c.feature?c.feature:"cards",
src_vid:a.context.videoData.videoId,annotation_id:b,ei:a.context.videoData.eventId||"",itct:d.trackingParams||""}},RUa=function(a,b){if(b=QUa(a,b))b===a.j&&(a.j=null),a.I.removeCueRange(b.card.id),g.di(b.sE),g.hc(a.cards,b),a.Gz(),G1(a)},A1=function(a,b,c){if(!a.B){a.Wa.show();
a.Ja=new g.L(function(){g.M(a.context.I.getRootNode(),g.zQ.IV_DRAWER_OPEN)},0);
a.Ja.start();a.va=g.pu(a.u,"mousewheel",function(k){a.xa.start();k.preventDefault();k=k||window.event;var l=0;"MozMousePixelScroll"==k.type?l=0==(k.axis==k.HORIZONTAL_AXIS)?k.detail:0:window.opera?l=k.detail:l=0==k.wheelDelta%120?"WebkitTransform"in document.documentElement.style?window.chrome&&0==navigator.platform.indexOf("Mac")?k.wheelDeltaY/-30:k.wheelDeltaY/-1.2:k.wheelDelta/-1.6:k.wheelDeltaY/-3;if(k=l)a.u.scrollTop+=k});
a.B=!0;var d=g.Lv();d&&a.ya&&a.K&&g.$v(d,[a.ya,a.K]);b={TRIGGER_TYPE:b};for(var e=g.r(a.cards),f=e.next();!f.done;f=e.next())f=f.value,f.BN||(f.BN=!0,SUa(a.context.logger,f.card.tracking.impression,b)),d&&g.$v(d,[f.card.gm]);U0(a.I);c&&(a.D=new g.L(function(){a.Ea=a.N;a.ib.focus()},330),a.D.start())}},B1=function(a){a.B&&(a.Wa.hide(),g.qu(a.va),a.va=null,g.Dp(a.context.I.getRootNode(),g.zQ.IV_DRAWER_OPEN),a.B=!1,U0(a.I),a.D&&a.D.stop(),a.D=new g.L(function(){a.Ea&&(a.Ea.focus(),a.Ea=null)},330),a.D.start())},
UUa=function(a){g.Cp(a.element,[g.zQ.STOP_EVENT_PROPAGATION,
"iv-drawer-manager"]);g.gL(a.I,a.C,5);TUa(a);a.N=g.Vh("ytp-cards-button",a.I.getRootNode());a.ib=g.Vh("iv-drawer-close-button",a.C);a.isInitialized=!0},TUa=function(a){var b=g.Vh("iv-drawer-close-button",a.C);
a.context.j.Pa(b,"click",a.VT,a);a.context.j.Pa(a.u,"touchend",function(){a.xa.start()});
a.context.j.Pa(a.u,"scroll",a.jU,a);a.context.u.subscribe("onHideControls",function(){a.Ia=!0});
a.context.u.subscribe("onShowControls",function(){a.Ia=!1});
a.context.u.subscribe("onVideoAreaChange",function(){a.Ia=g.Bp(a.I.getRootNode(),"ytp-autohide")});
a.Z.push(g.Ju("iv-button-shown",a.FV,a));a.Z.push(g.Ju("iv-button-hidden",a.EV,a));a.Z.push(g.Ju("iv-teaser-shown",a.xS,a));a.Z.push(g.Ju("iv-teaser-hidden",a.GV,a));a.Z.push(g.Ju("iv-teaser-clicked",a.wS,a))},F1=function(a,b){a.isInitialized||UUa(a);
RUa(a,b.id);var c=VUa(a,b);if(c){var d={card:b,sE:c.element,BN:!1},e=WUa(a,d);g.nc(a.cards,e,0,d);c.Ba(a.u,e);a.Gz();b.autoOpen?a.addCueRange(b.startMs,0x8000000000000,b.id,function(){a.B||(a.j=d,G1(a),XUa(a,d),A1(a,"YOUTUBE_DRAWER_AUTO_OPEN",!1))}):(c=1E3*a.context.I.getCurrentTime(),5E3>c&&c>b.startMs&&YUa(a,d),a.addCueRange(b.startMs,b.startMs+1,b.id,function(){YUa(a,d)}),G1(a))}},VUa=function(a,b){switch(b.type){case "simple":a=a.ma;
var c=b.displayDomain?{G:"div",L:"iv-card-image-text",oa:b.displayDomain}:void 0;var d=JUa(b);c={G:"div",Ga:["iv-card"],U:[{G:"a",L:"iv-click-target",W:{href:b.url?q1(b.url)||"":""},U:[u1(b.imageUrl,c),{G:"div",L:"iv-card-content",U:[s1("h2",void 0,b.title),d]}]}]};c=new g.W(c);w1(a,g.Uh("iv-click-target",c.element),b,b.url);return c;case "collaborator":return a=a.ma,c={G:"div",Ga:["iv-card","iv-card-channel"],U:[{G:"a",Ga:["iv-click-target"],W:{href:q1(b.url)||"","data-ytid":b.channelId},U:[u1(b.profileImageUrl),
{G:"div",L:"iv-card-content",U:[t1(b),{G:"h2",L:"iv-card-primary-link",oa:b.title},v1(b)]}]}]},c=new g.W(c),w1(a,g.Uh("iv-click-target",c.element),b,b.url),c;case "playlist":return a=a.ma,c={G:"div",Ga:["iv-card","iv-card-playlist"],U:[{G:"a",L:"iv-click-target",W:{href:q1(b.url)||""},U:[u1(b.Gy,{G:"div",L:"iv-card-image-overlay",U:[{G:"span",L:"iv-card-playlist-video-count",oa:b.playlistVideoCount}]}),{G:"div",L:"iv-card-content",U:[t1(b),s1("h2","iv-card-primary-link",b.title),v1(b)]}]}]},c=new g.W(c),
w1(a,g.Uh("iv-click-target",c.element),b,b.url),c;case "productListing":a=a.ma;var e=!g.ec(b.offers);c=["iv-card"];d="";var f=JUa(b);e&&(c.push("iv-card-product-listing"),d="iv-card-primary-link",f=b.offers[0],e=[],f.price&&e.push({G:"div",L:"iv-card-offer-price",oa:f.price}),f.merchant&&e.push({G:"div",L:"iv-card-offer-merchant",oa:f.merchant}),f={G:"div",U:e});e=b.url?q1(b.url)||"":"";c={G:"div",Ga:c,W:{tabindex:"0"},U:[{G:"a",Ga:["iv-card-image","iv-click-target"],W:{style:"background-image: url("+
b.imageUrl+");",href:e,"aria-hidden":"true",tabindex:"-1"}},{G:"div",L:"iv-card-content",U:[b.sponsored?{G:"div",L:"iv-card-sponsored",U:["Sponsored",{G:"div",L:"iv-ad-info-container",U:[{G:"div",L:"iv-ad-info",oa:"{{adInfo}}"},{G:"div",L:"iv-ad-info-icon-container",U:[{G:"div",L:"iv-ad-info-icon"},{G:"div",L:"iv-ad-info-callout"}]}]}]}:"",{G:"a",L:"iv-click-target",W:{href:e},U:[s1("h2",d,b.title),f]}]}]};c=new g.W(c);d=g.$h("span");g.gi(d,"You are seeing this product because we think it is relevant to the video. Google may be compensated by the merchant.");
c.Cd(d,"adInfo");w1(a,g.Uh("iv-click-target",c.element),b,b.url);return c;case "video":return a=a.ma,d=b.videoDuration?{G:"span",L:"iv-card-video-duration",oa:b.videoDuration}:void 0,f=b.isLiveNow?{G:"span",Ga:["yt-badge","yt-badge-live"],oa:"LIVE NOW"}:null,e={G:"div",Ga:["iv-card","iv-card-video"],U:[{G:"a",L:"iv-click-target",W:{href:(null==(c=b.url)?void 0:q1(c))||""},U:[u1(b.Gy,d),{G:"div",L:"iv-card-content",U:[t1(b),s1("h2","iv-card-primary-link",b.title),v1(b),f]}]}]},c=new g.W(e),w1(a,g.Uh("iv-click-target",
c.element),b,b.url),c;default:return null}},WUa=function(a,b){if(0===a.cards.length)return 0;
a=g.bc(a.cards,function(c){return b.card.startMs>c.card.startMs||b.card.startMs===c.card.startMs&&b.card.timestamp>=c.card.timestamp?!0:!1});
return-1===a?0:a+1},ZUa=function(a){return a.j?"productListing"===a.j.card.type:g.Ql(a.cards,function(b){return"productListing"===b.card.type})},G1=function(a){g.O(a.I.getRootNode(),"ytp-cards-shopping-active",ZUa(a))},YUa=function(a,b){if(!g.Bp(a.I.getRootNode(),"ytp-cards-teaser-shown")){if(a.j!==b){var c=g.Lv(),d=a.j?a.j.card.Ne:a.Ne;
c&&d&&g.aw(c,[d]);a.j=b;G1(a)}if(c="none"!=a.element.style.display)c=a.context.I.getPlayerState(),d=0===c&&0===a.context.I.getCurrentTime(),c=1===c||3===c||d;c&&b.card.teaserDurationMs&&a.I.yu(!0,{teaserText:b.card.teaserText,durationMs:b.card.teaserDurationMs});a.Xa.isActive()||((!a.B||!a.xa.isActive()&&a.Ia)&&XUa(a,b),a.Xa.start(910+b.card.teaserDurationMs))}},XUa=function(a,b){a.X.vb?(b=new Z0([0,
a.u.scrollTop],[0,b.sE.offsetTop],600,iUa),a.context.B.Pa(b,"animate",function(c){a.u.scrollTop=c.y}),a.context.B.Pa(b,"finish",function(c){a.u.scrollTop=c.y}),b.play()):(g.qI(a.X,!0),a.u.scrollTop=b.sE.offsetTop,g.qI(a.X,!1))},H1=function(a){return a.j&&a.j.card?a.j.card:a.cards[0]&&a.cards[0].card?a.cards[0].card:null},QUa=function(a,b){return g.ac(a.cards,function(c){return c.card.id===b})},I1=function(a,b,c){x1.call(this,a,b);
this.annotation=c;this.isActive=!1},$Ua=function(a){var b=a.annotation.data;
"start_ms"in b&&"end_ms"in b&&a.addCueRange(b.start_ms,b.end_ms,a.annotation.id,function(){a.show()},function(){a.hide()})},J1=function(a,b,c){I1.call(this,a,b,c);
this.u=null;this.K=!1;this.B=null;this.C=!1;this.j=this.J=this.D=null},aVa=function(a,b){var c=void 0===c?0:c;
var d=gUa(b).width;g.Pm(b,d);c=new a1(b,[d,b.offsetTop],[d-d-c,b.offsetTop],200,hUa);g.H(a,c);a.context.B.Pa(c,"begin",function(){g.Vm(b,!0)});
c.play()},dVa=function(a,b){if(b.channel_name){var c=a.createElement({G:"div",
Ga:["iv-branding-context-name"],oa:b.channel_name}),d=a.createElement({G:"div",Ga:["iv-branding-context-subscribe"]}),e=b.standalone_subscribe_button_data;e&&(a.j=new g.yM(e.subscribeText,e.subscribeCount,e.unsubscribeText,e.unsubscribeCount,!!e.enabled,!!e.classic,b.channel_id,!!e.subscribed,e.feature,b.session_data.itct,e.signInUrl,a.context.I),a.j.Ba(d));var f=a.createElement({G:"div",Ga:["iv-branding-context-subscribe-caret"]}),k=a.createElement({G:"div",Ga:["branding-context-container-inner"]});
k.appendChild(f);k.appendChild(c);k.appendChild(d);g.Vm(k,!1);var l=a.createElement({G:"div",Ga:["branding-context-container-outer"]});l.appendChild(k);g.Jm(l,"right",b.image_width+"px");a.element.appendChild(l);a.B=new g.L(function(){bVa(a,k,l)},500);
g.H(a,a.B);a.context.j.Pa(a.element,"mouseover",function(){cVa(a,k,l,f,b.image_height)});
a.context.j.Pa(a.element,"mouseout",function(){a.B.start()})}},cVa=function(a,b,c,d,e){a.B.stop();
if(!a.C){var f=g.Um(b);a.j||(b.style.width=g.Om(f.width,!0),c.style.width=g.Om(f.width,!0));g.Jm(d,"top",f.height-Math.max(Math.min(f.height,e)/2+10,20)+"px");g.Jm(d,"right","1px");a.C=!0;g.Vm(b,!0);a.D=new g.L(function(){g.M(this.element,"iv-branding-active")},0,a);
a.D.start()}},bVa=function(a,b,c){g.Dp(a.element,"iv-branding-active");
a.J=new g.L(function(){g.Vm(b,!1);a.j||(c.style.width=g.Om(0,!0))},250);
a.J.start();a.C=!1},eVa=function(a,b,c,d,e,f,k){this.j=a;
this.B=b;this.Y=c;this.videoData=d;this.logger=e;this.I=f;this.u=k},K1=function(a,b,c){I1.call(this,a,b,c);
var d=this;this.N=this.isCollapsed=this.X=!1;this.J=5E3;this.u=this.B=this.j=this.C=null;this.K=this.createElement({G:"div",Ga:["iv-promo-contents"]});this.D=new g.L(function(){d.j.setAttribute("aria-hidden","true");g.Vm(d.B,!1);g.Vm(d.u,!0)},700,this);
g.H(this,this.D)},fVa=function(a){var b=a.annotation.data;
if("cta"===a.annotation.style)var c=6;else if("video"===a.annotation.style||"playlist"===a.annotation.style)c=7;a.J=b.collapsedelay_ms||a.J;var d=["iv-promo","iv-promo-inactive"];a.element.setAttribute("aria-hidden","true");a.element.setAttribute("aria-label","Promotion");a.element.tabIndex=0;var e=HUa(a.annotation),f=b.image_url;if(f){var k=a.createElement({G:"div",Ga:["iv-promo-img","iv-click-target"]});f=a.createElement({G:"img",W:{src:f,"aria-hidden":"true"}});k.appendChild(f);b.video_duration&&
!b.is_live?(f=a.createElement({G:"span",L:"iv-promo-video-duration",oa:b.video_duration}),k.appendChild(f)):b.playlist_length&&(f=a.createElement({G:"span",L:"iv-promo-playlist-length",oa:b.playlist_length.toString()}),k.appendChild(f));e&&y1(a,k,e,a.annotation.id,b.session_data,void 0,c)}e?(f=a.createElement({G:"a",L:"iv-promo-txt"}),g.vh(f,q1(e)),a.j=f):a.j=a.createElement({G:"div",L:"iv-promo-txt"});switch(a.annotation.style){case "cta":case "website":var l=a.createElement({G:"p",U:[{G:"strong",
oa:b.text_line_1}]});var m=a.createElement({G:"p",U:[{G:"span",L:"iv-promo-link",oa:b.text_line_2}]});if(f=b.text_line_3){d.push("iv-promo-website-card-cta-redesign");var n=a.createElement({G:"button",Ga:["iv-promo-round-expand-icon","ytp-button"]});f=a.createElement({G:"button",Ga:["iv-button","iv-promo-button"],U:[{G:"span",L:"iv-button-content",oa:f}]});var p=a.createElement({G:"div",L:"iv-promo-button-container"});p.appendChild(f);e&&y1(a,a.element,e,a.annotation.id,b.session_data,void 0,c)}g.M(a.j,
"iv-click-target");e&&y1(a,a.j,e,a.annotation.id,b.session_data,void 0,c);break;case "playlist":case "video":l=a.createElement({G:"p",U:[{G:"span",oa:b.text_line_1}]}),m=a.createElement({G:"p",U:[{G:"strong",oa:b.text_line_2}]}),b.is_live&&(l=m,m=a.createElement({G:"span",Ga:["yt-badge","iv-promo-badge-live"],oa:"LIVE NOW"})),g.M(a.j,"iv-click-target"),e&&y1(a,a.j,e,a.annotation.id,b.session_data,void 0,c),d.push("iv-promo-video")}l&&a.j.appendChild(l);m&&a.j.appendChild(m);a.K.appendChild(a.j);p&&
a.K.appendChild(p);c=a.createElement({G:"div",L:"iv-promo-actions"});a.u=a.createElement({G:"button",Ga:["iv-promo-expand","ytp-button"]});a.u.title="Expand";a.context.j.Pa(a.u,"click",function(q){L1(a,5E3,q)});
c.appendChild(a.u);g.Vm(a.u,!1);a.context.j.Pa(a.element,"mouseover",a.PU,a);a.context.j.Pa(a.element,"mouseout",a.OU,a);a.context.j.Pa(a.element,"touchend",function(q){L1(a,5E3,q)});
a.B=a.createElement({G:"button",Ga:["iv-promo-close","ytp-button"]});a.B.title="Close";a.context.j.Pa(a.B,"click","cta"===a.annotation.style&&b.text_line_3?a.KU:a.JU,a);c.appendChild(a.B);g.Cp(a.element,d);k&&(a.element.appendChild(k),n&&k.appendChild(n));a.element.appendChild(a.K);a.element.appendChild(c)},L1=function(a,b,c){c.stopPropagation();
gVa(a);hVa(a,b);a.j.focus()},iVa=function(a){a.isCollapsed||a.N||a.C||(g.M(a.element,"iv-promo-collapsed"),a.isCollapsed=!0,a.D.start())},gVa=function(a){a.D.stop();
a.isCollapsed&&(g.Ep(a.element,["iv-promo-collapsed","iv-promo-collapsed-no-delay"]),a.isCollapsed=!1,a.j&&a.j.removeAttribute("aria-hidden"),g.Vm(a.u,!1),g.Vm(a.B,!0))},hVa=function(a,b){a.C||(a.C=g.Bi(function(){M1(this);
iVa(this)},b,a))},M1=function(a){a.C&&(g.C.clearTimeout(a.C),a.C=null)},jVa=function(a){this.I=a},SUa=function(a,b,c){b&&(c?N1(a,b.map(function(d){return g.np(d,c)})):N1(a,b))},N1=function(a,b,c,d){var e=1,f=void 0,k=-1;
if(c){var l=!1;f=function(){e--;e||l||(clearTimeout(k),l=!0,c())};
k=setTimeout(function(){l=!0;c()},1E3)}b=g.r(b||[]);
for(var m=b.next();!m.done;m=b.next())m=m.value,e++,g.Ot(m,f);d&&(e++,0!==d&&a.I.sendVideoStatsEngageEvent(d,f))},O1=function(a){g.tL.call(this,a);
var b=this;this.N=!1;this.loadNumber=0;this.J={};this.logger=new jVa(this.player);this.C=new g.gA(this);this.D=this.Kl=null;this.events=new g.gA(this);this.K=this.j=null;this.X=[];g.H(this,this.C);this.C.T(this.player,"onVideoAreaChange",function(){b.ea("onVideoAreaChange")});
this.C.T(this.player,"onHideControls",function(){b.ea("onHideControls")});
this.C.T(this.player,"onShowControls",function(){b.ea("onShowControls")});
this.C.T(this.player,"resize",function(d){b.ea("resize",d)});
this.C.T(this.player,"presentingplayerstatechange",function(d){b.ea("presentingplayerstatechange",d)});
this.subscribe("presentingplayerstatechange",this.yS,this);this.subscribe("resize",this.uB,this);this.player.V().Z.subscribe("vast_info_card_add",this.PO,this);g.H(this,this.events);this.Z=this.createElement({G:"div",L:"video-custom-annotations"});this.u=new g.W({G:"div",Ga:["ytp-player-content","ytp-iv-player-content"]});g.H(this,this.u);g.gL(this.player,this.u.element,4);this.u.hide();this.B=new g.W({G:"div",Ga:["ytp-iv-video-content"]});g.H(this,this.B);a=this.createElement({G:"div",L:"video-annotations"});
a.appendChild(this.Z);this.B.element.appendChild(a);this.xr()&&this.load();var c=this.createElement({G:"style"});(g.Qh("HEAD")[0]||document.body).appendChild(c);g.Bf(this,function(){g.di(c)});
if(a=c.sheet)a.insertRule(".iv-promo .iv-promo-contents .iv-promo-txt .iv-promo-link:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAHlBMVEVMaXH////////////////////////////////////Z6AnKAAAACXRSTlMA+/A2IuI1mJIldm0CAAAAAWJLR0QB/wIt3gAAAEVJREFUCNdjYGCYCQUMBJlACOIzIDElIcyZkwxgojOVWWDMSQauMKYySySUOSnBdSaUOZ0lEsac2YqwYiZ+JhwgM7E5HACgzVCI/YJ59AAAAABJRU5ErkJggg==) no-repeat center;background-size:10px;width:10px;height:10px}",
0),a.insertRule(".iv-promo .iv-promo-actions .iv-promo-close:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJBAMAAAASvxsjAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJFBMVEVMaXH///////////////////////////////////////////9tKdXLAAAAC3RSTlMAVaQDpaimqQbl5rjXUFUAAAABYktHRAH/Ai3eAAAAPUlEQVQI12MQMmAwEmDwDmaOTmAw39663YCBuXp2MQMDQ+fOBgYG5ujVwQwMptvbgeLaxczVCQwiBgxmAgBkXg1FN5iwiAAAAABJRU5ErkJggg==) no-repeat center;background-size:9px;width:9px;height:9px}",
0),a.insertRule(".iv-promo .iv-promo-actions .iv-promo-expand:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAJBAMAAADnQZCTAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJFBMVEVMaXHMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMz////eMKB4AAAAC3RSTlMAOpE7k5Uvj5kpfRaQSaQAAAABYktHRAsf18TAAAAAHklEQVQI12MQYGBQZmBwTWCo0GSo6AKRQDZQRIABADXXA/UkIpvtAAAAAElFTkSuQmCC) no-repeat center;background-size:4px 9px;width:4px;height:9px}",0),a.insertRule(".iv-promo-website-card-cta-redesign .iv-promo-round-expand-icon:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgCgUUEztsNfqrAAAAXklEQVRYw+3Uuw2AQAwEUUNXfBpDIvBRMhQwJJAScNrA0r4CdiQHjjAzK4NGKucPAFmCnZcmwcTphBNO9CTGH4VB+/Zm6YlYis9fhedXz38FNvFriCCl808iw8ysrBu65gCeuV/CfgAAAABJRU5ErkJggg==) no-repeat center;background-size:18px 18px;width:18px;height:18px}",
0),a.insertRule(".iv-card-link-icon {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASBAMAAACk4JNkAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEVMaXG7u7u7u7u7u7u7u7u7u7u7u7v///+WKTAlAAAABnRSTlMAFdQWbGj9GiOuAAAAAWJLR0QHFmGI6wAAAEhJREFUCNdjYACBNCBgQGMxMKrBWEJJaRAJRjVlKEsoSQDIAqtSZICwgEIQFkgIZBRECMxiBqsCsVjAqsCygQwwFgMeFgQgswBg2xjLrfC4mgAAAABJRU5ErkJggg==) no-repeat center;background-size:9px;width:9px;height:9px}",0),a.insertRule(".iv-card-playlist-video-count:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJFBMVEVMaXH///////////////////////////////////////////9tKdXLAAAAC3RSTlMAvDeyLvxYtDK9Ogx4T1QAAAABYktHRAH/Ai3eAAAAK0lEQVQY02NgoBjshgO8HJoYwKiAMGAD92YHJM7uMCTO9gaEHs4FlPuZAQC8Fj8x/xHjxwAAAABJRU5ErkJggg==) no-repeat center;background-size:24px;width:24px;height:24px}",
0),a.insertRule(".iv-drawer-close-button:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAgMAAAArG7R0AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACVBMVEVMaXH////////OZTV/AAAAAnRSTlMAoKBFbtAAAAABYktHRAH/Ai3eAAAAKUlEQVQI12MIYGBlSGGQBMIUBjbHCQyM0xwYGDIZwBjEBomB5EBqgGoBolQGzYuy51cAAAAASUVORK5CYII=) no-repeat center;background-size:12px;width:12px;height:12px}",0),a.insertRule(".iv-ad-info-icon {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAMAAACecocUAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAVFBMVEVMaXGUlJSYmJiZmZmYmJiXl5eZmZmZmZmWlpaVlZWOjo6ZmZmSkpKXl5eYmJiYmJiZmZmZmZmZmZmZmZmYmJiJiYmXl5eZmZmYmJiWlpaZmZn///+81lbeAAAAGnRSTlMAE5DM80DliTMMEjccWIM5p1UjaTQNgB5cLlr5mgUAAAABYktHRBsCYNSkAAAAVElEQVQI102NRw7AIBADhw7ppIf/PzQLJ/ZgWSNrFlDaWKMVcs6HmGLwTqjEME6CFDrAXBYIGhNh3TJEg02wHydctvFc7sbrvnXZV8/zfs3T+7u/P7CrAso35YfPAAAAAElFTkSuQmCC) no-repeat center;background-size:11px;width:11px;height:11px}",
0),a.insertRule(".annotation-close-button {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEVMaXEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/Pz9aWloBAQGZmZlbW1v///+X9wUzAAAACHRSTlMANprf+g6lyRmB9hUAAAABYktHRA5vvTBPAAAAWUlEQVQI12NgYBAycVZkAIKwDiBIZWBgrQAx2gMY2DrAIIFBomPWju6VHY0MGh1rbu891dHEYNGx9+yd2x3NDB4d3XfO7uhoQTDgUnDFcO1wA+FWwC2FOQMAdKg6tUSAFEAAAAAASUVORK5CYII=) no-repeat center}",0),a.insertRule(".annotation-link-icon {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAMAAAANmfvwAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUVBMVEVMaXH////////////////////////////////////////////////////////////////////////////////////////////////////////JzkR1AAAAGnRSTlMAfXf+c3xsdGdv/GJoXPtXXflSVk5L7DBH9VeFfsQAAAABYktHRAH/Ai3eAAAAgElEQVQ4y93SSQ6AIAwFULSOOOJs739Qf9SF0VA2uNCu+psHaQJK7cVCqY+Rg92PXA++Q84KnCR03UIRJrFEKMEgZYFQhpyzQHSBWJJAdIVUENtJ3SC0mu3EdOh7zXZiBrRdzQLJ0Y1GfOlpVstD3HaZktX9X/gvRCxvxL6FR7IBS1RTM5xIpLoAAAAASUVORK5CYII=) no-repeat center}",
0)},kVa=function(a){a=a.createElement({G:"div",
Ga:["annotation","annotation-type-custom"]});g.Vm(a,!1);return a},lVa=function(a,b){b=!b.isCued()&&!g.V(b,1024);
g.qI(a.u,b);g.qI(a.B,b)},mVa=function(a,b,c){a.N=!0;
a.D=g.Hr(b,c)},nVa=function(a,b){for(var c={},d=g.r(b.attributes),e=d.next();!e.done;e=d.next())e=e.value,c[e.name]=e.nodeValue;
for(d=0;d<b.childNodes.length;d++)if(e=b.childNodes[d],g.Ra(e)&&1==e.nodeType){if(c[e.tagName])var f=c[e.tagName];else if("data"===e.tagName){0<e.childNodes.length&&(f=e.childNodes[0].nodeValue,c[e.tagName]="string"===typeof f?f.trim():f);continue}else f=[],c[e.tagName]=f;e&&"TEXT"===e.tagName?1===e.childNodes.length&&3===e.childNodes[0].nodeType?f.push(e.childNodes[0].nodeValue):f.push(""):e&&f.push(nVa(a,e))}return c},qVa=function(a){var b=a.player.getVideoData();
if(b.Ra){var c=a.player.V().Z.get(b.videoId);if(c){var d={format:"XML",urlParams:{},method:"POST",withCredentials:!0,onFinish:function(e,f,k){e=b.videoId;a.loaded&&a.loadNumber===a.loadNumber&&a.player.getVideoData().videoId===e&&(k=g.Ar(k)&&k.responseXML?k.responseXML:null)&&P1(a,k)}};
g.Xr()&&(d.onFinish=oVa(a,d.onFinish));d.postParams={ic_only:"1"};pVa(d,c);a.N=!0;g.Hr(b.Ra,d)}}},pVa=function(a,b){a.method="POST";
a.postParams=a.postParams||{};b.cw&&(a.postParams.ic_coll=b.cw);b.Mz&&(a.postParams.ic_xml=b.Mz);b.Jy&&(a.postParams.ic_track=b.Jy)},rVa=function(a){var b=new g.W({G:"div"});
g.Vm(b.element,!1);var c=new C1(a.player,b.element,Q1(a));g.H(c,b);b.Ba(a.u.element);c.qy();return c},Q1=function(a){if(!a.K){var b=new b1(a);
g.H(a,b);var c=new g.Rk(a);g.H(a,c);a.K=new eVa(b,c,a.player.V(),a.player.getVideoData(),a.logger,a.player,a.Dd)}return a.K},P1=function(a,b){var c=!1,d=b.getElementsByTagName("annotations");
if(d&&!(1>d.length)&&(d=d[0].getAttribute("itct"))){var e=g.Lv();if(e){var f=g.Kv();f&&g.Wv(void 0,e,f,[g.Hv(d)])}}b=b.getElementsByTagName("annotation");for(d=0;d<b.length;d++){f=nVa(a,b[d]);e=null;try{if(f){var k=f.id,l=/.+/;var m="string"===typeof k&&null!=l&&null!=k&&k.match(l)?k:"";var n=p1(f.type,sVa),p=p1(f.style,tVa),q=yUa(f.data),t=0!==q.length?JSON.parse(q):{};var w=f.action;f=EUa;if(null==w)var x=null;else if(g.Qa(w)){l=[];for(var y=g.r(w),z=y.next();!z.done;z=y.next()){var E=f(z.value);
E&&l.push(E)}x=l}else{var I=f(w);x=I?[I]:[]}e=m&&n?new FUa(m,n,p,x,t):null}else e=null}catch(na){}if(e)if("branding"===e.type||"promotion"===e.type){f=a;l=e;var J=kVa(f),N=null;switch(l.type){case "branding":if(f.player.V().Sb)break;f.u.element.appendChild(J);N=new J1(J,Q1(f),l);break;case "promotion":g.gL(f.player,J,4),N=new K1(J,Q1(f),l)}N&&N.qy();if(f=N)g.H(a,f),a.J[e.id]=f}else if("card"===e.type||"drawer"===e.type){a.j||(a.j=rVa(a),g.H(a,a.j));if("card"===e.type){c=a.j;var aa=e&&e.data&&e.data.card_type;
f=e.data;if(aa)switch(l=f.tracking||{},l={impression:l.impression,click:l.click,close:l.close,dQ:l.teaser_impression,nC:l.teaser_click},J=f.tracking_params||{},N=null,aa){case "collaborator":e={id:e.id,timestamp:f.timestamp||0,type:f.card_type,teaserText:f.teaser_text,teaserDurationMs:f.teaser_duration_ms,startMs:f.start_ms,autoOpen:f.auto_open||!1,sessionData:f.session_data||{},sponsored:f.sponsored||!1,tracking:l,gm:J.card?g.Hv(J.card):null,pj:J.teaser?g.Hv(J.teaser):null,Ne:J.icon?g.Hv(J.icon):
null,channelId:f.channel_id,customMessage:f.custom_message?f.custom_message:null,profileImageUrl:f.image_url,title:f.title,metaInfo:f.meta_info,url:r1({pause_on_navigation:f.pause_on_navigation,target:f.target||"new",value:f.url})};F1(c,e);break;case "playlist":e={id:e.id,timestamp:f.timestamp||0,type:f.card_type,teaserText:f.teaser_text,teaserDurationMs:f.teaser_duration_ms,startMs:f.start_ms,autoOpen:f.auto_open||!1,sessionData:f.session_data||{},sponsored:f.sponsored||!1,tracking:l,gm:J.card?g.Hv(J.card):
null,pj:J.teaser?g.Hv(J.teaser):null,Ne:J.icon?g.Hv(J.icon):null,Gy:f.image_url,playlistVideoCount:f.playlist_video_count,customMessage:f.custom_message?f.custom_message:null,title:f.title,metaInfo:f.meta_info,url:r1({pause_on_navigation:f.pause_on_navigation,target:f.target||"new",value:f.url})};F1(c,e);break;case "productListing":f.signin_url&&(N=r1({target:"current",value:f.signin_url}));aa=[];for(var K=f.offers||[],oa=0;oa<K.length;oa++)aa.push(new KUa(g.Kh(K[oa].merchant),g.Kh(K[oa].price)));
e={id:e.id,timestamp:f.timestamp||0,type:f.card_type,teaserText:f.teaser_text,teaserDurationMs:f.teaser_duration_ms,startMs:f.start_ms,autoOpen:f.auto_open||!1,sessionData:f.session_data||{},sponsored:f.sponsored||!1,tracking:l,gm:J.card?g.Hv(J.card):null,pj:J.teaser?g.Hv(J.teaser):null,Ne:J.icon?g.Hv(J.icon):null,imageUrl:f.image_url,displayDomain:f.display_domain?f.display_domain:null,showLinkIcon:!!f.show_link_icon,Cz:f.button_icon_url?f.button_icon_url:null,title:f.title,customMessage:f.custom_message?
f.custom_message:null,url:r1({pause_on_navigation:f.pause_on_navigation,target:f.target||"new",value:f.url}),Hha:N,Gha:f.signin_title?f.signin_title:void 0,Fha:f.signin_message?f.signin_message:void 0,offers:aa};F1(c,e);break;case "simple":e={id:e.id,timestamp:f.timestamp||0,type:f.card_type,teaserText:f.teaser_text,teaserDurationMs:f.teaser_duration_ms,startMs:f.start_ms,autoOpen:f.auto_open||!1,sessionData:f.session_data||{},sponsored:f.sponsored||!1,tracking:l,gm:J.card?g.Hv(J.card):null,pj:J.teaser?
g.Hv(J.teaser):null,Ne:J.icon?g.Hv(J.icon):null,imageUrl:f.image_url,displayDomain:f.display_domain?f.display_domain:null,showLinkIcon:!!f.show_link_icon,Cz:f.button_icon_url?f.button_icon_url:null,title:f.title,customMessage:f.custom_message?f.custom_message:null,url:r1({pause_on_navigation:f.pause_on_navigation,target:f.target||"new",value:f.url})};F1(c,e);break;case "video":e={id:e.id,timestamp:f.timestamp||0,type:f.card_type,teaserText:f.teaser_text,teaserDurationMs:f.teaser_duration_ms,startMs:f.start_ms,
autoOpen:f.auto_open||!1,sessionData:f.session_data||{},sponsored:f.sponsored||!1,tracking:l,gm:J.card?g.Hv(J.card):null,pj:J.teaser?g.Hv(J.teaser):null,Ne:J.icon?g.Hv(J.icon):null,Gy:f.image_url,videoDuration:f.video_duration||null,customMessage:f.custom_message?f.custom_message:null,title:f.title,metaInfo:f.meta_info,isLiveNow:!!f.is_live_now,url:r1({pause_on_navigation:f.pause_on_navigation,target:f.target||"new",value:f.url})},F1(c,e)}}else OUa(a.j,e);c=!0}}c&&(U0(a.player),a.uB())},uVa=function(a,
b){var c=!1;
a.j||(a.j=rVa(a),g.H(a,a.j));for(var d=g.r(b.cards||[]),e=d.next();!e.done;e=d.next())e=e.value,e.cardRenderer&&(PUa(a.j,e.cardRenderer),c=!0);c&&(c=a.j,d=b.headerText?g.Pw(b.headerText):"",g.gi(c.jb,d),c.N&&c.N.setAttribute("title",d),c.context.videoData.eventId&&(c.eventId=c.context.videoData.eventId),c.ya=b.trackingParams?g.Hv(b.trackingParams):null,c.K=b.closeButton.infoCardIconRenderer.trackingParams?g.Hv(b.closeButton.infoCardIconRenderer.trackingParams):null,c.Ne=b.icon.infoCardIconRenderer.trackingParams?
g.Hv(b.icon.infoCardIconRenderer.trackingParams):null,U0(a.player),a.uB())},vVa=function(a,b,c,d,e){if(!a.player.V().Sb){var f=[];
b.navigationEndpoint&&b.navigationEndpoint.browseEndpoint&&b.navigationEndpoint.browseEndpoint.browseId&&f.push(new BUa("openUrl","click",new zUa("/channel/"+b.navigationEndpoint.browseEndpoint.browseId,"new",!0,!0)));var k=b.watermark.thumbnails[0];d={channel_name:b.channelName,end_ms:b.endTimeMs,image_height:k.height,image_type:1,image_url:k.url,image_width:k.width,is_mobile:!1,session_data:{annotation_id:c,ei:e,feature:"iv",itct:b.trackingParams,src_vid:d},start_ms:b.startTimeMs};if(b.subscribeButton&&
b.subscribeButton.subscribeButtonRenderer){d.channel_id=b.subscribeButton.subscribeButtonRenderer.channelId;var l;b=b.subscribeButton.subscribeButtonRenderer;k=e=null;b.subscribed?(b.subscriberCountWithUnsubscribeText&&(e=g.Pw(b.subscriberCountWithUnsubscribeText)),b.subscriberCountText&&(k=g.Pw(b.subscriberCountText))):(b.subscriberCountText&&(e=g.Pw(b.subscriberCountText)),b.subscriberCountWithSubscribeText&&(k=g.Pw(b.subscriberCountWithSubscribeText)));if(b.signInEndpoint&&b.signInEndpoint.webNavigationEndpointData&&
b.signInEndpoint.webNavigationEndpointData.url)var m=b.signInEndpoint.webNavigationEndpointData.url;else{var n,p;m=(null==(l=b.signInEndpoint)?void 0:null==(n=l.commandMetadata)?void 0:null==(p=n.webCommandMetadata)?void 0:p.url)||""}l={subscribeText:g.Pw(b.unsubscribedButtonText),subscribeCount:e||"",unsubscribeText:g.Pw(b.subscribedButtonText),unsubscribeCount:k||"",enabled:b.enabled||!1,classic:!1,subscribed:b.subscribed||!1,feature:"iv",signInUrl:m};d.standalone_subscribe_button_data=l}f=new FUa(c,
"branding","branding",f,d);l=kVa(a);a.u.element.appendChild(l);f=new J1(l,Q1(a),f);f.qy();g.H(f,f);a.J[c]=f}},oVa=function(a,b){return function(){var c=g.Da.apply(0,arguments);
a.isDisposed()||a.X.push(g.rp.fg(function(){b.apply(null,g.u(c))}))}},wVa=function(a){return"annotation-editor"===a||"live-dashboard"===a};
g.$K.prototype.yu=g.da(19,function(a,b){var c=g.KL(this.ub());c&&c.yu(a,b)});
var W0={},X0=null;g.Ya(Z0,g.Mp);g.h=Z0.prototype;g.h.getDuration=function(){return this.duration};
g.h.play=function(a){if(a||0==this.j)this.progress=0,this.coords=this.u;else if(this.Kc())return!1;Y0(this);this.startTime=a=g.Xa();-1==this.j&&(this.startTime-=this.duration*this.progress);this.endTime=this.startTime+this.duration;this.D=this.startTime;this.progress||this.pB();this.Ji("play");-1==this.j&&this.Ji("resume");this.j=1;var b=g.Ta(this);b in W0||(W0[b]=this);kUa();lUa(this,a);return!0};
g.h.stop=function(a){Y0(this);this.j=0;a&&(this.progress=1);mUa(this,this.progress);this.Ji("stop");this.Fx()};
g.h.pause=function(){this.Kc()&&(Y0(this),this.j=-1,this.Ji("pause"))};
g.h.ra=function(){0==this.j||this.stop(!1);this.Ji("destroy");Z0.xe.ra.call(this)};
g.h.destroy=function(){this.dispose()};
g.h.rD=function(){this.Ji("animate")};
g.h.Ji=function(a){this.dispatchEvent(new nUa(a,this))};
g.Ya(nUa,g.Cf);g.Ya($0,Z0);$0.prototype.C=g.Na;$0.prototype.rD=function(){this.C();$0.xe.rD.call(this)};
$0.prototype.Fx=function(){this.C();$0.xe.Fx.call(this)};
$0.prototype.pB=function(){this.C();$0.xe.pB.call(this)};
g.Ya(a1,$0);a1.prototype.C=function(){this.element.style.left=Math.round(this.coords[0])+"px";this.element.style.top=Math.round(this.coords[1])+"px"};g.v(b1,g.G);b1.prototype.Pa=function(a,b,c,d){c=(0,g.Ua)(c,d||this.u);a=g.pu(a,b,c);this.j.push(a);return a};
b1.prototype.aB=function(a,b,c,d){c=(0,g.Ua)(c,d||this.u);a=g.Moa(a,b,c);this.j.push(a);return a};
b1.prototype.xc=function(a){g.qu(a);g.hc(this.j,a)};
b1.prototype.ra=function(){g.qu(this.j);this.j.length=0;g.G.prototype.ra.call(this)};g.v(f1,g.tL);g.h=f1.prototype;g.h.load=function(){g.tL.prototype.load.call(this);if(!g1(this)){var a=g.axa(this.player.getVideoData());a?(a=e1(a,pUa(this)),h1(this,a,!1)):qUa(this)}};
g.h.unload=function(){h1(this,null);this.B&&(this.B.abort(),this.B=null);g.tL.prototype.unload.call(this)};
g.h.Af=function(a,b){return g1(this)?"loadCustomEndscreenRenderer"===a?(a=e1(b,"new"),h1(this,a),!0):null:null};
g.h.getOptions=function(){return g1(this)?["loadCustomEndscreenRenderer"]:[]};
g.h.zb=function(){if(this.endscreen&&this.endscreen.elements){var a=this.player.getVideoContentRect();if(a&&0!==a.width&&0!==a.height){var b=this.player.getPlayerSize();if(b&&0!==b.width&&0!==b.height){var c=a.width/a.height;var d=0;for(var e=-1,f=0;f<xVa.length;f++){var k=Math.abs(b.width-xVa[f]);if(-1===e||d>=k)e=f,d=k}d=yVa[e];this.u&&g.Jm(this.u.element,"outline-width",Math.max(b.width,b.height)+"px");for(b=0;b<this.endscreen.elements.length;++b)if(f=this.endscreen.elements[b].id,e=this.j[f],
k=this.D[f],e&&k){var l=k.width*c/k.aspectRatio;f=Math.round(l*a.height);var m=a.left+Math.round(k.left*a.width),n=a.top+Math.round(k.top*a.height);g.Tm(e.element,Math.round(k.width*a.width),f);g.Pm(e.element,m,n);g.Ep(e.element,zVa);m=k.left+k.width/2;k=k.top+l/2;g.M(e.element,.5>=m&&.5>=k?"ytp-ce-top-left-quad":.5<m&&.5>=k?"ytp-ce-top-right-quad":.5>=m&&.5<k?"ytp-ce-bottom-left-quad":"ytp-ce-bottom-right-quad");g.Ep(e.element,yVa);g.M(e.element,d);(e=g.Th(document,"div","ytp-ce-expanding-overlay-body",
e.element)[0])&&g.Jm(e,"height",f+"px")}}}}};
g.h.onCueRangeEnter=function(a){if(this.endscreen)if("ytp-ce-in-endscreen"===a.getId())o1(this,this.endscreen.impressionUrls),(a=g.Lv())&&this.endscreen.visualElement&&g.Xv(a,this.endscreen.visualElement,void 0);else{a=a.getId().substring(15);var b=this.j[a],c=this.D[a];g.M(b.element,"ytp-ce-element-show");b.element.removeAttribute("aria-hidden");b=this.player.getRootNode();g.M(b,"ytp-ce-shown");o1(this,c.impressionUrls);(b=g.Lv())&&g.Xv(b,c.visualElement,void 0);this.player.V().B&&this.player.Oa("endscreenelementshown",
a)}};
g.h.onCueRangeExit=function(a){if("ytp-ce-in-endscreen"!==a.getId()){a=a.getId().substring(15);var b=this.j[a];g.Dp(b.element,"ytp-ce-element-show");b.element.setAttribute("aria-hidden","true");b=this.player.getRootNode();g.Dp(b,"ytp-ce-shown");this.player.V().B&&this.player.Oa("endscreenelementhidden",a)}};
g.h.eZ=function(a){var b=this;a.target===window&&(new g.L(function(){for(var c=g.r(Object.values(b.j)),d=c.next();!d.done;d=c.next())g.Ep(d.value.element,["ytp-ce-force-expand","ytp-ce-element-hover","ytp-ce-element-shadow-show"])},0)).start()};
var xVa=[346,426,470,506,570,640,853,1280,1920],yVa="ytp-ce-size-346 ytp-ce-size-426 ytp-ce-size-470 ytp-ce-size-506 ytp-ce-size-570 ytp-ce-size-640 ytp-ce-size-853 ytp-ce-size-1280 ytp-ce-size-1920".split(" "),zVa=["ytp-ce-top-left-quad","ytp-ce-top-right-quad","ytp-ce-bottom-left-quad","ytp-ce-bottom-right-quad"];var AUa={h5:"current",Daa:"new"};var CUa={CLOSE:"close",Xaa:"openUrl",SUBSCRIBE:"subscribe"},DUa={K1:"click",CLOSE:"close",F6:"hidden",Bca:"rollOut",Cca:"rollOver",yda:"shown"};var tVa={E0:"anchored",TQ:"branding",CHANNEL:"channel",g5:"cta",I6:"highlightText",k8:"label",PLAYLIST:"playlist",Tba:"popup",Ida:"speech",SUBSCRIBE:"subscribe",bea:"title",VIDEO:"video",Hfa:"website"},sVa={TQ:"branding",v1:"card",x5:"drawer",H6:"highlight",P9:"marker",dca:"promotion",TEXT:"text",lga:"widget"};g.v(x1,g.G);g.h=x1.prototype;g.h.addCueRange=function(a,b,c,d,e){a=new g.Iw(a,b,{id:c,namespace:"annotations_module"});d&&this.Ra.set(a,d);e&&this.Sa.set(a,e);this.context.I.Sd([a])};
g.h.qy=function(){this.context.u.subscribe("resize",this.Gz,this)};
g.h.sD=function(a,b,c,d,e,f){if(this.Ya)return!1;f&&(f.stopPropagation(),f.preventDefault());this.navigate(a,c,d,e);return!1};
g.h.show=function(){};
g.h.hide=function(){};
g.h.destroy=function(){g.di(this.element)};
g.h.Gz=function(){};
g.h.navigate=function(a,b,c,d){var e=this,f=q1(a);if(f){var k=MUa(f,a.target),l=function(){a.j&&e.context.I.pauseVideo();var m=e.context.videoData.D||!1,n=g.or(f||"");m&&n&&(n.v||n.list)?e.context.I.wk(n.v,b,n.list,!1):g.BJ(f||"","current"===k?"_top":void 0,b)};
"new"===k&&(l(),l=null);N1(this.context.logger,c,l,d);LUa(f)||(c=g.Lv(),d=b.itct,c&&d&&g.bw(c,g.Hv(d)))}};
g.h.ra=function(){this.Ra.clear();this.Sa.clear();g.G.prototype.ra.call(this)};
g.h.createElement=function(a){a=new g.W(a);g.H(this,a);return a.element};g.v(C1,x1);g.h=C1.prototype;g.h.isAvailable=function(){var a;if(a=!!this.cards.length)(a=this.I.getRootNode())?(a=g.Um(a),a=173<a.width&&173<a.height):a=!1;return a};
g.h.Gz=function(){var a=this.isAvailable();g.Vm(this.element,a);g.O(this.context.I.getRootNode(),g.zQ.IV_DRAWER_ENABLED,a);U0(this.I)};
g.h.destroy=function(){this.I.yu(!1);try{this.I.getRootNode().removeChild(this.C)}catch(a){}g.Ku(this.Z);g.qu(this.va);this.Ja&&this.Ja.dispose();this.D&&this.D.dispose();x1.prototype.destroy.call(this)};
g.h.VT=function(){if(this.B){N1(this.context.logger,H1(this).tracking.close);var a=g.Lv();a&&this.K&&g.bw(a,this.K);B1(this)}};
g.h.jU=function(){g.O(this.C,"iv-drawer-scrolled",0<this.u.scrollTop)};
g.h.FV=function(){var a=g.Lv(),b=H1(this);b=b?b.Ne:this.Ne;a&&b&&g.$v(a,[b])};
g.h.EV=function(){var a=g.Lv(),b=H1(this);b=b?b.Ne:this.Ne;a&&b&&g.aw(a,[b])};
g.h.xS=function(){var a=H1(this);N1(this.context.logger,a.tracking.dQ);var b=g.Lv();b&&a&&g.$v(b,[a.pj,a.Ne])};
g.h.GV=function(){var a=g.Lv(),b=H1(this);a&&b&&g.aw(a,[b.pj])};
g.h.wS=function(a){var b=H1(this),c=g.Lv();this.j?a?(a=this.context.logger,N1(a,b.tracking.nC),a.I.sendVideoStatsEngageEvent(4,void 0),c&&b.pj&&g.bw(c,b.pj)):(a=this.context.logger,N1(a,b.tracking.nC),a.I.sendVideoStatsEngageEvent(4,void 0),c&&b.Ne&&g.bw(c,b.Ne)):(a=this.context.logger,N1(a,b.tracking.nC),a.I.sendVideoStatsEngageEvent(4,void 0),c&&this.Ne&&g.bw(c,this.Ne))};g.v(I1,x1);I1.prototype.qy=function(){x1.prototype.qy.call(this);$Ua(this)};
I1.prototype.show=function(){x1.prototype.show.call(this);var a=g.Lv(),b=this.annotation.data;a&&b&&(b=b.session_data)&&g.$v(a,[g.Hv(b.itct)])};
I1.prototype.hide=function(){x1.prototype.hide.call(this);var a=g.Lv(),b=this.annotation.data;a&&b&&(b=b.session_data)&&g.aw(a,[g.Hv(b.itct)])};g.v(J1,I1);
J1.prototype.show=function(){if(!this.isActive){I1.prototype.show.call(this);if(!this.K){g.M(this.element,"iv-branding");var a=this.annotation.data;this.u=this.createElement({G:"img",Ga:["branding-img","iv-click-target"],W:{"aria-label":"Channel watermark",src:a.image_url,width:a.image_width,height:a.image_height}});g.Vm(this.u,!1);var b=this.context.Y.S("html5_player_branding_button_killswitch")?this.createElement({G:"div",Ga:["branding-img-container"]}):this.createElement({G:"button",Ga:["branding-img-container",
"ytp-button"]});b.appendChild(this.u);this.element.appendChild(b);var c=HUa(this.annotation);c&&(b=this.context.Y.S("html5_player_branding_button_killswitch")?this.u:b,y1(this,b,c,this.annotation.id,a.session_data));dVa(this,a);this.K=!0}g.Vm(this.element,!0);this.isActive=!0;this.u&&aVa(this,this.u)}};
J1.prototype.hide=function(){this.isActive&&(I1.prototype.hide.call(this),g.Vm(this.element,!1),this.isActive=!1)};
J1.prototype.destroy=function(){this.j&&(this.j.dispose(),this.j=null);I1.prototype.destroy.call(this)};g.v(K1,I1);g.h=K1.prototype;g.h.show=function(){this.isActive||(I1.prototype.show.call(this),this.X||(fVa(this),this.X=!0),g.Vm(this.element,!0),g.Bi(function(){g.Dp(this.element,"iv-promo-inactive")},100,this),this.element.removeAttribute("aria-hidden"),this.isActive=!0,M1(this),gVa(this),hVa(this,this.J))};
g.h.hide=function(){this.isActive&&(g.M(this.element,"iv-promo-inactive"),this.isActive=!1,this.element.setAttribute("aria-hidden","true"))};
g.h.sD=function(a,b,c,d,e,f){return this.isCollapsed?!1:I1.prototype.sD.call(this,a,b,c,d,e,f)};
g.h.PU=function(a){this.N=!0;L1(this,500,a)};
g.h.OU=function(){this.N=!1;iVa(this)};
g.h.JU=function(a){a.stopPropagation();this.hide()};
g.h.KU=function(a){a.stopPropagation();M1(this);this.isCollapsed=!0;g.M(this.element,"iv-promo-collapsed-no-delay");this.D.start()};
g.h.destroy=function(){this.D.dispose();I1.prototype.destroy.call(this)};g.v(O1,g.tL);g.h=O1.prototype;g.h.Af=function(a,b){if(!wVa(this.player.V().playerStyle))return null;switch(a){case "loadCustomAnnotationsXml":return(a=g.t_(b))&&P1(this,a),!0;case "removeCustomAnnotationById":return b&&this.j&&(RUa(this.j,b),U0(this.player)),!0}return null};
g.h.getOptions=function(){return wVa(this.player.V().playerStyle)?["loadCustomAnnotationsXml","removeCustomAnnotationById"]:[]};
g.h.xr=function(){var a=this.player.V(),b=this.player.getVideoData();return b.D&&a.pfpChazalUi?!1:1===(a.annotationsLoadPolicy||b.annotationsLoadPolicy)&&!b.mP||a.Z.get(b.videoId)||g.yE(b)||g.zE(b)?!0:!1};
g.h.uB=function(){if(this.B){var a=this.player.eb().getVideoContentRect(!0);g.Tm(this.B.element,a.width,a.height);g.Pm(this.B.element,a.left,a.top)}if(this.j){var b=this.player.Mj();a=this.j;b=b.width;g.O(a.C,"iv-drawer-small",426>=b);g.O(a.C,"iv-drawer-big",1280<=b)}};
g.h.yS=function(a){lVa(this,a.state);g.V(a.state,2)&&(this.Nh()&&this.Sk()&&2!==this.player.getPresentingPlayerType()&&this.setCardsVisible(!1),this.yu(!1))};
g.h.load=function(){function a(k){var l=b.loadNumber;b.D=null;b.loaded&&b.loadNumber===l&&b.player.getVideoData().videoId===d&&(k=g.Ar(k)&&k.responseXML?k.responseXML:null)&&(P1(b,k),g.M(b.player.getRootNode(),"iv-module-loaded"))}
var b=this;g.tL.prototype.load.call(this);lVa(this,this.player.Ab());this.loadNumber++;var c=this.player.getVideoData(),d=c.videoId;g.Xr()&&(a=oVa(this,a));var e={format:"XML",onFinish:a,onError:function(){b.D=null},
urlParams:{}};c.isPharma&&(e.urlParams.pharma="1");e.method="POST";e.withCredentials=!0;var f=this.player.V().Z.get(d);f&&pVa(e,f);f=f&&(f.Mz||f.cw);if(!c.Zl||f)c.Ra?mVa(this,c.Ra,e):(this.Kl=function(){b.onVideoDataChange(e)},this.player.addEventListener("videodatachange",this.Kl));
g.gL(this.player,this.B.element,4);this.uB();(f=g.yE(c))&&uVa(this,f);(f=g.zE(c))&&f.featuredChannel&&vVa(this,f.featuredChannel,f.annotationId||"branding",c.videoId||null,c.eventId||null)};
g.h.onVideoDataChange=function(a){var b=this.player.getVideoData();b.Ra&&(this.Kl&&(this.player.removeEventListener("videodatachange",this.Kl),this.Kl=null),mVa(this,b.Ra,a))};
g.h.unload=function(){this.player.lf("annotations_module");for(var a=g.r(Object.keys(this.J)),b=a.next();!b.done;b=a.next())this.J[b.value].destroy();this.K=null;this.j&&(this.j.destroy(),this.j=null,U0(this.player));this.N=!1;this.D&&(this.D.abort(),this.D=null);this.J={};this.u.hide();g.tL.prototype.unload.call(this);this.B.detach();this.Kl&&(this.player.removeEventListener("videodatachange",this.Kl),this.Kl=null)};
g.h.PO=function(a){a===this.player.getVideoData().videoId&&(this.loaded?qVa(this):this.load())};
g.h.Nh=function(){return!!this.j&&this.j.isAvailable()};
g.h.Sk=function(){this.Nh();return!!this.j&&this.j.B};
g.h.setCardsVisible=function(a,b,c){b=void 0===b?!1:b;this.Nh();this.j&&(a?c?A1(this.j,c,b):A1(this.j,"YOUTUBE_DRAWER_AUTO_OPEN",b):B1(this.j))};
g.h.yu=function(a,b){this.player.ea(a?"cardsteasershow":"cardsteaserhide",b)};
g.h.ra=function(){this.player.V().Z.unsubscribe("vast_info_card_add",this.PO,this);g.Dp(this.player.getRootNode(),g.zQ.IV_DRAWER_OPEN);for(var a=this.X,b=g.rp,c=0,d=a.length;c<d;c++)b.Gi(a[c]);this.X.length=0;g.tL.prototype.ra.call(this)};
g.h.createElement=function(a){a=new g.W(a);g.H(this,a);return a.element};g.sL("annotations_module",O1);g.sL("creatorendscreen",f1);})(_yt_player);
