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

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
var d2=function(a){a.V("cardstatechange",g.VW(a)&&g.WW(a)?1:0)},BBa=function(a){var b=g.yg(a);
a=g.Eg(a);return new g.ig(b.x,b.y,a.width,a.height)},CBa=function(a){return Math.pow(a,3)},DBa=function(a){return 3*a*a-2*a*a*a},g2=function(a){a=g.Ua(a);
delete e2[a];g.Wb(e2)&&f2&&f2.stop()},FBa=function(){f2||(f2=new g.H(function(){EBa()},20));
var a=f2;a.isActive()||a.start()},EBa=function(){var a=g.A();
g.Jb(e2,function(b){GBa(b,a)});
g.Wb(e2)||FBa()},h2=function(a,b,c,d){g.Dn.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.K=b;this.duration=c;this.F=d;this.coords=[];this.progress=this.I=0;this.D=null},GBa=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.I=1E3/(b-a.D);a.D=b;HBa(a,a.progress);1==a.progress?(a.Ca=0,g2(a),a.Bf(),a.rp()):a.Cb()&&a.Tv()},HBa=function(a,b){"function"===typeof a.F&&(b=a.F(b));
a.coords=Array(a.u.length);for(var c=0;c<a.u.length;c++)a.coords[c]=(a.K[c]-a.u[c])*b+a.u[c]},IBa=function(a,b){g.Ll.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.I;this.state=b.Ca},i2=function(a,b,c,d,e){h2.call(this,b,c,d,e);
this.element=a},j2=function(a,b,c,d,e){if(2!=b.length||2!=c.length)throw Error("Start and end points must be 2D");
i2.call(this,a,b,c,d,e)},k2=function(a){g.B.call(this);
this.B=a||window;this.u=[]},l2=function(a){return a.baseUrl||null},m2=function(a,b){return g.Ke(g.Pc(a,b,void 0),function(c){return!!c})},JBa=function(a,b,c){function d(gb){var Hb,bb,Wd,Xc=gb.hovercardButton;
if(!Xc)return null;Xc=Xc.subscribeButtonRenderer;if(!Xc)return null;var Bi=f(Xc.unsubscribedButtonText),Ci=f(Xc.subscribedButtonText);if(Xc.subscribed){var Bh=f(Xc.subscriberCountWithUnsubscribeText);var Di=f(Xc.subscriberCountText)}else Bh=f(Xc.subscriberCountText),Di=f(Xc.subscriberCountWithSubscribeText);var gf=null;return gb.signinEndpoint&&(gf=g.Rb(gb,"signinEndpoint","webNavigationEndpointData","url"),gf||(gf=null===(Wd=null===(bb=null===(Hb=Xc.signInEndpoint)||void 0===Hb?void 0:Hb.commandMetadata)||
void 0===bb?void 0:bb.webCommandMetadata)||void 0===Wd?void 0:Wd.url),!gf)?null:Bi&&(Ci||gf)?{subscribed:Xc.subscribed,subscribeText:Bi,subscribeCount:Bh,unsubscribeText:Ci,unsubscribeCount:Di,enabled:Xc.enabled,signinUrl:gf,classic:gb.useClassicSubscribeButton}:null}
function e(gb){if(gb){var Hb=[],bb=gb.videoId;bb&&Hb.push("v="+bb);(bb=gb.playlistId)&&Hb.push("list="+bb);(gb=gb.startTimeSeconds)&&Hb.push("t="+gb);return"/watch?"+Hb.join("&")}}
function f(gb){if(!gb)return null;var Hb=gb.simpleText;return Hb?Hb:gb.runs?g.Pc(gb.runs,function(bb){return bb.text}).join(""):null}
b=b.endscreenElementRenderer;if(!b)return null;var h=b.style,l=b.endpoint||{},m=null,n=null,p=null,r=null,t=null,w=null,x=!1,y=null,D=null,E=null,G=null,K=null;if("VIDEO"===h)l.urlEndpoint?m=l.urlEndpoint.url:m=e(l.watchEndpoint),n=!1,p=a,r=f(b.videoDuration);else if("PLAYLIST"===h)l.urlEndpoint?m=l.urlEndpoint.url:m=e(l.watchEndpoint),n=!1,p=a,t=f(b.playlistLength);else if("CHANNEL"===h){if(x=g.Rb(l,"browseEndpoint","browseId"))w=x,m="/channel/"+w;n=!1;p="new";(x=!!b.isSubscribe)?y=d(b):D=f(b.subscribersText)}else"WEBSITE"===
h?((E=g.Rb(l,"urlEndpoint","url"))&&(m=E),n=!0,p="new",E=b.icon.thumbnails[0].url):"CREATOR_MERCHANDISE"===h&&(b.productPrice&&(G=f(b.productPrice)),b.additionalFeesText&&(K=f(b.additionalFeesText)),(n=g.Rb(l,"urlEndpoint","url"))&&(m=n),n=!0,p="new");a=g.Rb(b,"title","accessibility","accessibilityData","label");var M=b.endpoint?b.endpoint.clickTrackingParams:null,Ia="";if(b.metadata){var va=f(b.metadata);va&&(Ia=va)}return{id:"element-"+c,type:h,title:f(b.title),metadata:Ia,callToAction:f(b.callToAction),
BA:b.image,iconUrl:E,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:r,playlistLength:t,channelId:w,subscribeButton:y,subscribersText:D,isSubscribe:x,targetUrl:m||null,nJ:n,hd:M?{itct:M}:null,DQ:p,On:a?a:null,qJ:b.isPlaceholder,impressionUrls:m2(b.impressionUrls||[],l2),gJ:m2(b.hovercardShowUrls||[],l2),clickUrls:m2(l.loggingUrls||[],l2),visualElement:g.es(b.trackingParams),
productPrice:G,additionalFeesText:K}},n2=function(a,b){var c={startMs:Math.floor(Number(a.startMs)),
impressionUrls:m2(a.impressionUrls||[],l2),elements:m2(a.elements||[],function(d,e){return JBa(b,d,e)})};
a.trackingParams&&(c.visualElement=g.es(a.trackingParams));return c},o2=function(a){g.vS.call(this,a);
this.C=this.endscreen=null;this.u={};this.F={};this.D=this.B=null;this.K=[];this.P=!0;this.I=0;a=a.T();this.N=g.MB(a)||g.OB(a);this.events=new g.Pr(this);g.C(this,this.events);this.events.R(this.player,g.rD("creatorendscreen"),this.YJ);this.events.R(this.player,g.sD("creatorendscreen"),this.ZJ);this.events.R(this.player,"resize",this.Qa);this.events.R(window,"focus",this.CP);this.load();var b=g.Fe("STYLE");(document.getElementsByTagName("HEAD")[0]||document.body).appendChild(b);g.dg(this,function(){g.Je(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))},KBa=function(a){return a.player.getVideoData().Hc?"current":a.N?"new":"current"},p2=function(a){return"creator-endscreen-editor"===a.player.T().playerStyle},LBa=function(a){var b=a.player.getVideoData(),c=b.videoId;
a.C&&a.C.abort();c={method:"POST",Bf:function(e){var f=a.C=null;200===e.status&&(e=e.responseText,")]}"===e.substring(0,3)&&(e=e.substring(3),f=JSON.parse(e),f=n2(f,KBa(a))));q2(a,f)},
Dg:{v:c},withCredentials:!0};a.N&&(c.Dg.ptype="embedded");var d=b.jr;d&&(c.Xb={ad_tracking:d});if(b=g.DF(b))if(b=g.Kc(b),b=g.Gc(b))a.C=g.oq(b,c)},q2=function(a,b,c){c=void 0===c?!0:c;
g.aX(a.player,"creatorendscreen");a.B&&(a.B.dispose(),a.B=null,a.D.dispose(),a.D=null);for(var d=g.q(Object.values(a.u)),e=d.next();!e.done;e=d.next())e.value.dispose();a.u={};a.F={};0<a.K.length&&(a.K.forEach(function(l){l.dispose()}),a.K.length=0);
a.I=0;if((a.endscreen=b)&&b.elements){c&&MBa(a);c=[];d=new g.oD(b.startMs,0x7ffffffffffff,{id:"ytp-ce-in-endscreen",namespace:"creatorendscreen"});c.push(d);a.player.T().u||(a.B=new g.V({G:"div",L:"ytp-ce-shadow"}),g.$O(a.player,a.B.element,4),a.D=new g.vN(a.B,200));for(d=0;d<b.elements.length;++d){e=b.elements[d];var f=NBa(a,e);a.u[e.id]=f;a.F[e.id]=e;g.$O(a.player,f.element,4);var h=new g.oD(e.startMs,e.endMs,{id:"ytp-ce-element-"+e.id,namespace:"creatorendscreen"});c.push(h);OBa(a,f,e)}g.kM(a.player,
c);a.Qa()}},MBa=function(a){var b=g.is(),c=g.ks();
c&&b&&a.endscreen.visualElement&&g.Js(c,b,a.endscreen.visualElement)},NBa=function(a,b){var c=null;
switch(b.type){case "VIDEO":c={G:"div",ia:["ytp-ce-element","ytp-ce-video"],U:{tabindex:"0","aria-label":b.On||"","aria-hidden":"true"},S:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-covering-image",U:r2(b)},{G:"div",L:"ytp-ce-covering-shadow-top"},{G:"a",L:"ytp-ce-covering-overlay",U:{href:s2(a,b.targetUrl),tabindex:"-1"},S:[{G:"div",ia:["ytp-ce-video-title","yt-ui-ellipsis","yt-ui-ellipsis-2"],U:{dir:g.Jn(b.title||"")},Z:b.title},{G:"div",L:"ytp-ce-video-duration",Z:b.videoDuration||
void 0}]}]};c=new g.V(c);break;case "PLAYLIST":c={G:"div",ia:["ytp-ce-element","ytp-ce-playlist"],U:{tabindex:"0","aria-label":b.On||"","aria-hidden":"true"},S:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-covering-image",U:r2(b)},{G:"div",L:"ytp-ce-covering-shadow-top"},{G:"a",L:"ytp-ce-covering-overlay",U:{href:s2(a,b.targetUrl),tabindex:"-1"},S:[{G:"div",ia:["ytp-ce-playlist-title","yt-ui-ellipsis","yt-ui-ellipsis-2"],U:{dir:g.Jn(b.title||"")},Z:b.title},{G:"div",L:"ytp-ce-playlist-count",
S:[{G:"div",L:"ytp-ce-playlist-icon"},{G:"div",L:"ytp-ce-playlist-count-text",Z:b.playlistLength||void 0}]}]}]};c=new g.V(c);break;case "CHANNEL":c={G:"div",ia:["ytp-ce-element","ytp-ce-channel",b.isSubscribe?"ytp-ce-channel-this":"ytp-ce-channel-that"],U:{tabindex:"0","aria-label":b.On||"","aria-hidden":"true"},S:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-expanding-overlay",S:[{G:"div",L:"ytp-ce-expanding-overlay-hider"},{G:"div",L:"ytp-ce-expanding-overlay-background"},{G:"div",L:"ytp-ce-expanding-overlay-content",
S:[{G:"div",L:"ytp-ce-expanding-overlay-body",S:[{G:"div",L:"ytp-ce-expanding-overlay-body-padding",S:[{G:"a",ia:["ytp-ce-channel-title","ytp-ce-link"],U:{href:s2(a,b.targetUrl),target:"_blank",tabindex:"-1",dir:g.Jn(b.title||"")},Z:b.title},b.subscribeButton?{G:"div",L:"ytp-ce-subscribe-container",S:[{G:"div",L:"ytp-ce-channel-subscribe"}]}:"",b.subscribersText?{G:"div",L:"ytp-ce-channel-subscribers-text",Z:b.subscribersText}:"",b.metadata?{G:"div",ia:["ytp-ce-channel-metadata","yt-ui-ellipsis",
"yt-ui-ellipsis-3"],Z:b.metadata}:""]}]}]}]},{G:"div",L:"ytp-ce-expanding-image",U:r2(b)}]};c=new g.V(c);var d=g.re(document,"div","ytp-ce-channel-subscribe",c.element)[0];if(b.subscribeButton&&b.channelId){g.I(d,"ytp-ce-subscribe-button");if(a.player.T().u){var e=null;var f=b.hd.itct}else e="endscreen",f=null;e=new g.eY(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":c={G:"div",ia:["ytp-ce-element","ytp-ce-website"],U:{tabindex:"0","aria-label":b.On||"","aria-hidden":"true"},S:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-expanding-overlay",S:[{G:"div",L:"ytp-ce-expanding-overlay-hider"},{G:"div",L:"ytp-ce-expanding-overlay-background"},{G:"div",L:"ytp-ce-expanding-overlay-content",S:[{G:"div",L:"ytp-ce-expanding-overlay-body",
S:[{G:"div",L:"ytp-ce-expanding-overlay-body-padding",S:[{G:"div",L:"ytp-ce-website-title",U:{dir:g.Jn(b.title||"")},Z:b.title},{G:"div",L:"ytp-ce-website-metadata",Z:b.metadata},{G:"a",ia:["ytp-ce-website-goto","ytp-ce-link"],U:{href:s2(a,b.targetUrl),target:"_blank",tabindex:"-1"},Z:b.callToAction}]}]}]}]},{G:"div",L:"ytp-ce-expanding-image",U:r2(b)},{G:"div",L:"ytp-ce-expanding-icon",U:PBa(b.iconUrl)}]};c=new g.V(c);break;case "CREATOR_MERCHANDISE":c="",b.productPrice&&(c={G:"div",L:"ytp-ce-merchandise-price-container",
S:[{G:"div",L:"ytp-ce-merchandise-price",Z:b.productPrice}]},b.additionalFeesText&&c.S.push({G:"div",L:"ytp-ce-merchandise-additional-fees",Z:b.additionalFeesText})),c={G:"div",ia:["ytp-ce-element","ytp-ce-merchandise"],U:{tabindex:"0","aria-label":b.On||"","aria-hidden":"true"},S:[{G:"div",L:"ytp-ce-element-shadow"},{G:"div",L:"ytp-ce-expanding-overlay",S:[{G:"div",L:"ytp-ce-expanding-overlay-hider"},{G:"div",L:"ytp-ce-expanding-overlay-background"},{G:"div",L:"ytp-ce-expanding-overlay-content",
S:[{G:"div",L:"ytp-ce-expanding-overlay-body",S:[{G:"div",L:"ytp-ce-expanding-overlay-body-padding",S:[{G:"div",L:"ytp-ce-merchandise-title",U:{dir:g.Jn(b.title||"")},Z:b.title},c,{G:"div",L:"ytp-ce-merchandise-metadata",Z:b.metadata},{G:"a",ia:["ytp-ce-merchandise-goto","ytp-ce-link"],U:{href:s2(a,b.targetUrl),target:"_blank",tabindex:"-1"},Z:b.callToAction}]}]}]}]},{G:"div",L:"ytp-ce-expanding-image",U:r2(b)},{G:"div",L:"ytp-ce-merchandise-invideo-cta-container",S:[{G:"div",L:"ytp-ce-merchandise-invideo-cta",
Z:b.callToAction||void 0}]}]},c=new g.V(c)}b.qJ&&g.I(c.element,"ytp-ce-placeholder");return c},r2=function(a){if(a.BA)var b=a.BA.thumbnails;
return PBa(b?b[b.length-1].url:null)},PBa=function(a){return a?{style:"background-image: url("+a+")"}:{}},OBa=function(a,b,c){function d(m){m&&(b.ra("blur",function(){"none"!=m.style.display&&a.P&&m.focus()}),b.R(m,"focus",f),b.R(m,"blur",h))}
function e(m){a.I+=m;0<a.I?(g.I(b.element,"ytp-ce-force-expand"),t2(a,c.id,!0)):(g.Bn(b.element,"ytp-ce-force-expand"),g.Bn(b.element,"ytp-ce-element-hover"),t2(a,c.id,!1))}
function f(){e(1)}
function h(){e(-1)}
b.ra("mouseenter",function(){u2(a,b,c)});
b.ra("mouseleave",function(){v2(a,b,c)});
a.player.T().u||b.ra("click",function(){g.I(b.element,"ytp-ce-element-hover")});
b.ra("click",function(m){QBa(a,c,m)});
b.ra("keypress",function(m){QBa(a,c,m)});
b.ra("focus",function(){u2(a,b,c)});
b.ra("blur",function(){v2(a,b,c)});
b.ra("touchstart",function(){u2(a,b,c)});
var l=g.te("ytp-ce-expanding-overlay-hider",b.element);l&&b.R(l,"touchstart",function(m){m=m||window.event;m.cancelBubble=!0;m.stopPropagation&&m.stopPropagation();g.Bn(b.element,"ytp-ce-element-hover");g.Bn(b.element,"ytp-ce-force-expand")});
b.ra("keydown",function(m){a.P=9===m.keyCode&&!m.shiftKey});
d(g.te("ytp-sb-subscribe",b.element));d(g.te("ytp-sb-unsubscribe",b.element));b.ra("focus",f);b.ra("blur",h)},QBa=function(a,b,c){if(b.targetUrl&&(!c||"keypress"!==c.type||13===c.keyCode)){for(var d=c.target;d&&!g.zn(d,"ytp-ce-element");){g.zn(d,"subscribe-label")&&w2(a,b);
if(g.zn(d,"ytp-ce-channel-subscribe"))return;d=g.Le(d)}if(!d||g.zn(d,"ytp-ce-element-hover")){c.preventDefault();c.stopPropagation();if(d=a.u[b.id])v2(a,d,b),d.element.blur();if(c.ctrlKey||c.metaKey||"new"===b.DQ)w2(a,b),a.player.sendVideoStatsEngageEvent(17,void 0),a.player.pauseVideo(),c=g.Kc(s2(a,b.targetUrl)),c=g.Gc(c),g.gK(c,void 0,b.hd);else{var e=a.player.getVideoData().Hc,f=function(){var h=s2(a,b.targetUrl),l=b.hd,m=g.Xp(h);e&&m&&(m.v||m.list)?g.N0(a.player.app,m.v,l,m.list,!1,void 0):g.fK(h,
l)};
w2(a,b,function(){a.player.sendVideoStatsEngageEvent(17,f)})}}}},s2=function(a,b){var c=a.player.T();
if(b){if(b.startsWith("//"))return c.protocol+":"+b;if(b.startsWith("/"))return g.rC(c)+b}else return"";return b},u2=function(a,b,c){g.zn(b.element,"ytp-ce-element-hover")||("VIDEO"===c.type||"PLAYLIST"===c.type?g.I(b.element,"ytp-ce-element-hover"):a.player.T().u?(new g.H(function(){g.I(b.element,"ytp-ce-element-hover")},200)).start():g.I(b.element,"ytp-ce-element-hover"),x2(a,c.gJ),t2(a,c.id,!0))},v2=function(a,b,c){g.Bn(b.element,"ytp-ce-element-hover");
g.Bn(b.element,"ytp-ce-force-expand");t2(a,c.id,!1)},t2=function(a,b,c){a.B&&(c?a.D.show():a.D.hide());
for(var d=g.q(Object.keys(a.u)),e=d.next();!e.done;e=d.next())e=e.value,e!==b&&g.J(a.u[e].element,"ytp-ce-element-shadow-show",c)},x2=function(a,b,c){function d(){f||(e++,e===b.length&&(h.stop(),c&&c()))}
if(!b||0===b.length||p2(a))c&&c();else{b=RBa(a,b);var e=0,f=!1,h=new g.H(function(){f=!0;c&&c()},1E3,a);
h.start();for(a=0;a<b.length;a++)g.Vs(b[a],d)}},w2=function(a,b,c){x2(a,b.clickUrls,c);
(a=g.ks())&&b.nJ&&g.Ms(a,b.visualElement)},RBa=function(a,b){var c=a.player.getVideoData().clientPlaybackNonce,d=a.player.getCurrentTime().toFixed(2);
c={CPN:c,AD_CPN:c,MT:d};d=[];for(var e=0;e<b.length;e++)d.push(SBa(b[e],c));return d},SBa=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})},TBa=function(a){return Array.isArray(a)&&a.length?a[0]:a},y2=function(a){return"string"===typeof a?a:""},z2=function(a,b,c){for(var d in b)if(b[d]===a)return a;
return c},UBa=function(a){this.externalId=a},VBa=function(a,b,c,d){this.value=a;
this.target=b;this.showLinkIcon=c;this.u=d},A2=function(a){return a.value?a.value:null},B2=function(a){if(!a)return null;
var b=g.Kc(y2(a.value));b=g.Gc(b);if(!b)return null;var c=z2(a.target,WBa,"current");if(null==c)a=null;else{var d=a.show_link_icon;a=new VBa(b,c,"true"===d||"false"===d?"true"===d:!0,null!=a.pause_on_navigation?a.pause_on_navigation:!0)}return a},XBa=function(a,b,c,d){this.type=a;
this.trigger=b;this.url=c;this.subscribeData=d},$Ba=function(a){if(!a)return null;
var b=z2(a.type,YBa),c=z2(a.trigger,ZBa),d=TBa(a.url);d=B2(d?d:null);a=TBa(a.subscribeData);var e=a?a:null;e?(a=y2(e.external_user_id),e=y2(e.subscription_token),a=a&&e?new UBa(a):null):a=null;return b?new XBa(b,c,d,a):null},C2=function(a,b,c,d,e){this.id=a;
this.type=b;this.style=c;this.data=e;this.action=d||[]},aCa=function(a,b){return g.jb(a.action,b,void 0)},bCa=function(a,b){this.context=a;
this.u=b},E2=function(a){return a.customMessage?D2("div","iv-card-message",a.customMessage):""},F2=function(a,b){var c="background-image: url("+a+");",d=[];
b&&d.push(b);return{G:"div",L:"iv-card-image",U:{style:c},S:d}},G2=function(a){if(!a.metaInfo||0===a.metaInfo.length)return"";
var b=[];a=g.q(a.metaInfo);for(var c=a.next();!c.done;c=a.next())b.push(D2("li","",c.value));return{G:"ul",L:"iv-card-meta-info",S:b}},D2=function(a,b,c){b?"string"===typeof b?b={"class":b}:Array.isArray(b)&&(b={"class":b.join(" ")}):b={};
b.dir=g.Jn(c);return{G:a,U:b,Z:c}},cCa=function(a){if(!a.customMessage)return"";
var b=["iv-card-action","iv-card-primary-link"],c={};a.Jq&&(b.push("iv-card-action-icon"),c.style="background-image: url("+a.Jq+");");c.dir=g.Jn(a.customMessage);var d=[{G:"span",Z:a.customMessage}];a.showLinkIcon&&(d.push("\u00a0"),d.push({G:"span",L:"iv-card-link-icon"}));return{G:"div",ia:b,U:c,S:d}},H2=function(a,b,c,d){if(d){b=g.q(b);
for(var e=b.next();!e.done;e=b.next())a.u(e.value,d,c.id,c.hd,c.nf.click,5)}},dCa=function(a,b){this.merchant=a;
this.price=b},eCa=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},fCa=function(a,b){return b?b:eCa(a)?"current":"new"},I2=function(a,b){g.B.call(this);
var c=this;this.element=a;this.context=b;this.Ia=!1;this.oa=new Map;this.ya=new Map;this.context.J.addEventListener(g.rD("annotations_module"),function(d){(d=c.oa.get(d))&&d.apply(c)});
this.context.J.addEventListener(g.sD("annotations_module"),function(d){(d=c.ya.get(d))&&d.apply(c)})},J2=function(a,b,c,d,e,f,h){a.context.u.ra(b,"click",function(){a.Rw(c,d,e,f||[],h||0)});
a.context.u.ra(b,"touchstart",function(){a.Ia=!1});
a.context.u.ra(b,"touchmove",function(){a.Ia=!0})},gCa=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},K2=function(a,b,c){return{JB:(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||""}),
IF:(b.impressionLoggingUrlsV2s||[]).map(function(d){return d.baseUrl||""}),
Ut:(b.clickLoggingUrlsV2s||[]).map(function(d){return d.baseUrl||""})}},N2=function(a,b,c){I2.call(this,b,c);
var d=this;this.J=a;this.eventId=null;this.ea=this.jb=this.C=this.rd=!1;this.ha=null;this.cards=[];this.Ma=this.N=this.fa=this.F=this.ka=this.u=null;this.W=[];this.K=this.dd=this.ba=null;this.I=0;this.Y=new g.H(g.Oa,c.D.Vc?4E3:3E3);g.C(this,this.Y);this.Fa=new g.H(g.Oa);g.C(this,this.Fa);this.X=new bCa(c,function(e,f,h,l,m,n){J2(d,e,f,h,l,m,n)});
this.P=new g.V({G:"div",L:"iv-drawer",U:{id:"iv-drawer"},S:[{G:"div",L:"iv-drawer-header",U:{"aria-role":"heading"},S:[{G:"span",L:"iv-drawer-header-text"},{G:"button",ia:["iv-drawer-close-button","ytp-button"],U:{"aria-label":"Hide cards",tabindex:"0"}}]},{G:"div",L:"iv-drawer-content"}]});g.C(this,this.P);this.D=this.P.element;this.xa=new g.vN(this.P,330);g.C(this,this.xa);this.Ra=g.te("iv-drawer-header-text",this.D);this.B=g.te("iv-drawer-content",this.D);this.addCueRange(0,1E3*c.videoData.lengthSeconds,
"",function(){d.jb&&L2(d,"YOUTUBE_DRAWER_AUTO_OPEN")},function(){(d.jb=d.C)&&M2(d)})},hCa=function(a,b){var c=b.data;
c.autoOpenMs&&a.addCueRange(c.autoOpenMs,0x8000000000000,"",function(){L2(a,"YOUTUBE_DRAWER_AUTO_OPEN")});
c.autoCloseMs&&a.addCueRange(c.autoCloseMs,0x8000000000000,"",function(){M2(a)});
var d=c.headerText;g.Ne(a.Ra,d);a.N&&a.N.setAttribute("title",d);c.eventId&&(a.eventId=c.eventId);a.ba=g.es(c.trackingParams);a.K=g.es(c.closeTrackingParams);a.dd=g.es(c.iconTrackingParams)},iCa=function(a,b){var c=b.cardId?b.cardId:"cr:"+a.I;
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;c={id:c,timestamp:a.I,type:"simple",teaserText:g.U(e.message),teaserDurationMs:Number(b.cueRanges[0].teaserDurationMs),startMs:Number(b.cueRanges[0].startCardActiveMs),autoOpen:!!b.autoOpen,hd:O2(a,c,b,d),sponsored:!1,nf:K2(d,e,d.command),Di:d.trackingParams?g.es(d.trackingParams):null,Ag:e.trackingParams?g.es(e.trackingParams):
null,dd:f&&f.trackingParams?g.es(f.trackingParams):null,imageUrl:P2(d.image.thumbnails,290).url,displayDomain:d.displayDomain?g.U(d.displayDomain):null,showLinkIcon:!!d.showLinkIcon,Jq:null,title:d.title?g.U(d.title):"",customMessage:d.callToAction?g.U(d.callToAction):"",url:d.command.urlEndpoint.url?B2({pause_on_navigation:!a.context.videoData.isLivePlayback,target:"new",value:d.command.urlEndpoint.url}):null};Q2(a,c)}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;c={id:c,timestamp:a.I,type:"collaborator",teaserText:g.U(e.message),teaserDurationMs:Number(b.cueRanges[0].teaserDurationMs),startMs:Number(b.cueRanges[0].startCardActiveMs),autoOpen:!!b.autoOpen,hd:O2(a,c,b,d),sponsored:!1,nf:K2(d,e,d.endpoint),Di:d.trackingParams?g.es(d.trackingParams):null,Ag:e.trackingParams?g.es(e.trackingParams):null,dd:f&&f.trackingParams?g.es(f.trackingParams):
null,channelId:d.endpoint.browseEndpoint.browseId,customMessage:d.customText?g.U(d.customText):null,JE:P2(d.channelAvatar.thumbnails,290).url,title:d.channelName?g.U(d.channelName):"",metaInfo:[d.subscriberCountText?g.U(d.subscriberCountText):""],url:B2({pause_on_navigation:!a.context.videoData.isLivePlayback,target:"new",value:d.endpoint.browseEndpoint.canonicalBaseUrl?d.endpoint.browseEndpoint.canonicalBaseUrl:"/channel/"+d.endpoint.browseEndpoint.browseId})};Q2(a,c)}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;c={id:c,timestamp:a.I,type:"playlist",teaserText:g.U(e.message),teaserDurationMs:Number(b.cueRanges[0].teaserDurationMs),startMs:Number(b.cueRanges[0].startCardActiveMs),autoOpen:!!b.autoOpen,hd:O2(a,c,b,d),sponsored:!1,nf:K2(d,e,d.action),Di:d.trackingParams?g.es(d.trackingParams):null,Ag:e.trackingParams?g.es(e.trackingParams):null,dd:f&&f.trackingParams?g.es(f.trackingParams):
null,cq:P2(d.playlistThumbnail.thumbnails,258).url,customMessage:d.customMessage?g.U(d.customMessage):null,playlistVideoCount:g.U(d.playlistVideoCount),title:d.playlistTitle?g.U(d.playlistTitle):"",metaInfo:[d.channelName?g.U(d.channelName):"",d.videoCountText?g.U(d.videoCountText):""],url:B2({pause_on_navigation:!a.context.videoData.isLivePlayback,target:"new",value:gCa(d.action)})};Q2(a,c)}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;c={id:c,timestamp:a.I,type:"video",teaserText:g.U(e.message),teaserDurationMs:Number(b.cueRanges[0].teaserDurationMs),startMs:Number(b.cueRanges[0].startCardActiveMs),autoOpen:!!b.autoOpen,hd:O2(a,c,b,d),sponsored:!1,nf:K2(d,e,d.action),Di:d.trackingParams?g.es(d.trackingParams):null,Ag:e.trackingParams?g.es(e.trackingParams):null,dd:f&&f.trackingParams?g.es(f.trackingParams):null,cq:P2(d.videoThumbnail.thumbnails,258).url,
videoDuration:d.lengthString?g.U(d.lengthString):null,customMessage:d.customMessage?g.U(d.customMessage):null,title:d.videoTitle?g.U(d.videoTitle):"",metaInfo:[d.channelName?g.U(d.channelName):"",d.viewCountText?g.U(d.viewCountText):""],isLiveNow:!!d.badge,url:B2({pause_on_navigation:!a.context.videoData.isLivePlayback,target:"new",value:gCa(d.action)})};Q2(a,c)}a.I++},P2=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]},O2=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||""}},kCa=function(a,b){var c=jCa(a,b);
c&&(c===a.u&&(a.u=null),a.J.removeCueRange(c.card.id),g.Je(c.Uu),g.rb(a.cards,c),a.Lq(),R2(a))},L2=function(a,b,c){if(!a.C){a.xa.show();
a.ka=new g.H(function(){g.I(a.context.J.getRootNode(),g.a0.IV_DRAWER_OPEN)},0);
a.ka.start();a.ha=g.cp(a.B,"mousewheel",function(h){a.Y.start();h.preventDefault();h=h||window.event;var l=0;"MozMousePixelScroll"==h.type?l=0==(h.axis==h.HORIZONTAL_AXIS)?h.detail:0:window.opera?l=h.detail:l=0==h.wheelDelta%120?"WebkitTransform"in document.documentElement.style?window.chrome&&0==navigator.platform.indexOf("Mac")?h.wheelDeltaY/-30:h.wheelDeltaY/-1.2:h.wheelDelta/-1.6:h.wheelDeltaY/-3;if(h=l)a.B.scrollTop+=h});
a.C=!0;var d=g.ks();d&&a.ba&&a.K&&g.Ks(d,[a.ba,a.K]);b={TRIGGER_TYPE:b};for(var e=g.q(a.cards),f=e.next();!f.done;f=e.next())f=f.value,f.mC||(f.mC=!0,lCa(a.context.logger,f.card.nf.JB,b)),d&&g.Ks(d,[f.card.Di]);d2(a.J);c&&(a.F=new g.H(function(){a.fa=a.N;a.Ma.focus()},330),a.F.start())}},M2=function(a){a.C&&(a.xa.hide(),g.dp(a.ha),a.ha=null,g.Bn(a.context.J.getRootNode(),g.a0.IV_DRAWER_OPEN),a.C=!1,d2(a.J),a.F&&a.F.stop(),a.F=new g.H(function(){a.fa&&(a.fa.focus(),a.fa=null)},330),a.F.start())},nCa=
function(a){g.An(a.La(),[g.a0.STOP_EVENT_PROPAGATION,
"iv-drawer-manager"]);g.$O(a.J,a.D,5);mCa(a);a.N=g.te("ytp-cards-button",a.J.getRootNode());a.Ma=g.te("iv-drawer-close-button",a.D);a.rd=!0},mCa=function(a){var b=g.te("iv-drawer-close-button",a.D);
a.context.u.ra(b,"click",a.HH,a);a.context.u.ra(a.B,"touchend",function(){a.Y.start()});
a.context.u.ra(a.B,"scroll",a.UH,a);a.context.B.subscribe("onHideControls",function(){a.ea=!0});
a.context.B.subscribe("onShowControls",function(){a.ea=!1});
a.context.B.subscribe("onVideoAreaChange",function(){a.ea=g.zn(a.J.getRootNode(),"ytp-autohide")});
a.W.push(g.No("iv-button-shown",a.vJ,a));a.W.push(g.No("iv-button-hidden",a.uJ,a));a.W.push(g.No("iv-teaser-shown",a.wK,a));a.W.push(g.No("iv-teaser-hidden",a.wJ,a));a.W.push(g.No("iv-teaser-clicked",a.vK,a))},Q2=function(a,b){a.rd||nCa(a);
kCa(a,b.id);var c=oCa(a,b);if(c){var d={card:b,Uu:c.element,mC:!1},e=pCa(a,d);g.xb(a.cards,e,0,d);c.da(a.B,e);a.Lq();b.autoOpen?a.addCueRange(b.startMs,0x8000000000000,b.id,function(){a.C||(a.u=d,R2(a),qCa(a,d),L2(a,"YOUTUBE_DRAWER_AUTO_OPEN",!1))}):(c=1E3*a.context.J.getCurrentTime(),5E3>c&&c>b.startMs&&rCa(a,d),a.addCueRange(b.startMs,b.startMs+1,b.id,function(){rCa(a,d)}),R2(a))}},oCa=function(a,b){switch(b.type){case "simple":var c=a.X;
var d=b.displayDomain?{G:"div",L:"iv-card-image-text",Z:b.displayDomain}:void 0;var e=cCa(b);d={G:"div",ia:["iv-card"],S:[{G:"a",L:"iv-click-target",U:{href:b.url?A2(b.url)||"":""},S:[F2(b.imageUrl,d),{G:"div",L:"iv-card-content",S:[D2("h2",void 0,b.title),e]}]}]};d=new g.V(d);H2(c,g.se("iv-click-target",d.element),b,b.url);return d;case "collaborator":return c=a.X,d={G:"div",ia:["iv-card","iv-card-channel"],S:[{G:"a",ia:["iv-click-target"],U:{href:A2(b.url)||"","data-ytid":b.channelId},S:[F2(b.JE),
{G:"div",L:"iv-card-content",S:[E2(b),{G:"h2",L:"iv-card-primary-link",Z:b.title},G2(b)]}]}]},d=new g.V(d),H2(c,g.se("iv-click-target",d.element),b,b.url),d;case "playlist":return c=a.X,d={G:"div",ia:["iv-card","iv-card-playlist"],S:[{G:"a",L:"iv-click-target",U:{href:A2(b.url)||""},S:[F2(b.cq,{G:"div",L:"iv-card-image-overlay",S:[{G:"span",L:"iv-card-playlist-video-count",Z:b.playlistVideoCount}]}),{G:"div",L:"iv-card-content",S:[E2(b),D2("h2","iv-card-primary-link",b.title),G2(b)]}]}]},d=new g.V(d),
H2(c,g.se("iv-click-target",d.element),b,b.url),d;case "productListing":c=a.X;var f=!g.ob(b.offers);d=["iv-card"];e="";var h=cCa(b);f&&(d.push("iv-card-product-listing"),e="iv-card-primary-link",h=b.offers[0],f=[],h.price&&f.push({G:"div",L:"iv-card-offer-price",Z:h.price}),h.merchant&&f.push({G:"div",L:"iv-card-offer-merchant",Z:h.merchant}),h={G:"div",S:f});f=b.url?A2(b.url)||"":"";d={G:"div",ia:d,U:{tabindex:"0"},S:[{G:"a",ia:["iv-card-image","iv-click-target"],U:{style:"background-image: url("+
b.imageUrl+");",href:f,"aria-hidden":"true",tabindex:"-1"}},{G:"div",L:"iv-card-content",S:[b.sponsored?{G:"div",L:"iv-card-sponsored",S:["Sponsored",{G:"div",L:"iv-ad-info-container",S:[{G:"div",L:"iv-ad-info",Z:"{{adInfo}}"},{G:"div",L:"iv-ad-info-icon-container",S:[{G:"div",L:"iv-ad-info-icon"},{G:"div",L:"iv-ad-info-callout"}]}]}]}:"",{G:"a",L:"iv-click-target",U:{href:f},S:[D2("h2",e,b.title),h]}]}]};d=new g.V(d);e=g.Fe("span");g.Ne(e,"You are seeing this product because we think it is relevant to the video. Google may be compensated by the merchant.");
d.jc(e,"adInfo");H2(c,g.se("iv-click-target",d.element),b,b.url);return d;case "video":return c=a.X,d=b.isLiveNow?{G:"span",ia:["yt-badge","yt-badge-live"],Z:"LIVE NOW"}:null,d={G:"div",ia:["iv-card","iv-card-video"],S:[{G:"a",L:"iv-click-target",U:{href:A2(b.url)||""},S:[F2(b.cq,b.videoDuration?{G:"span",L:"iv-card-video-duration",Z:b.videoDuration}:void 0),{G:"div",L:"iv-card-content",S:[E2(b),D2("h2","iv-card-primary-link",b.title),G2(b),d]}]}]},d=new g.V(d),H2(c,g.se("iv-click-target",d.element),
b,b.url),d;default:return null}},pCa=function(a,b){if(0===a.cards.length)return 0;
var c=g.kb(a.cards,function(d){return b.card.startMs>d.card.startMs||b.card.startMs===d.card.startMs&&b.card.timestamp>=d.card.timestamp?!0:!1});
return-1===c?0:c+1},sCa=function(a){return a.u?"productListing"===a.u.card.type:g.jh(a.cards,function(b){return"productListing"===b.card.type})},R2=function(a){g.J(a.J.getRootNode(),"ytp-cards-shopping-active",sCa(a))},rCa=function(a,b){if(!g.zn(a.J.getRootNode(),"ytp-cards-teaser-shown")){if(a.u!==b){var c=g.ks(),d=a.u?a.u.card.dd:a.dd;
c&&d&&g.Ls(c,[d]);a.u=b;R2(a)}if(c="none"!=a.La().style.display)2===a.context.J.getPresentingPlayerType()?c=1===a.context.J.getAdState():(c=a.context.J.getPlayerState(),d=0===c&&0===a.context.J.getCurrentTime(),c=1===c||3===c||d);c&&b.card.teaserDurationMs&&(c={teaserText:b.card.teaserText,durationMs:b.card.teaserDurationMs},(d=g.UW(g.LW(a.J)))&&d.Nw(!0,c));a.Fa.isActive()||((!a.C||!a.Y.isActive()&&a.ea)&&qCa(a,b),a.Fa.start(910+b.card.teaserDurationMs))}},qCa=function(a,b){if(a.P.Wa){var c=new h2([0,
a.B.scrollTop],[0,b.Uu.offsetTop],600,DBa);a.context.C.ra(c,"animate",function(d){a.B.scrollTop=d.y});
a.context.C.ra(c,"finish",function(d){a.B.scrollTop=d.y});
c.play()}else g.CM(a.P,!0),a.B.scrollTop=b.Uu.offsetTop,g.CM(a.P,!1)},S2=function(a){return a.u&&a.u.card?a.u.card:a.cards[0]&&a.cards[0].card?a.cards[0].card:null},jCa=function(a,b){return g.jb(a.cards,function(c){return c.card.id===b})},T2=function(a,b,c){I2.call(this,a,b);
this.annotation=c;this.isActive=!1},tCa=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()})},U2=function(a,b,c){T2.call(this,a,b,c);
this.B=null;this.K=!1;this.C=null;this.D=!1;this.u=this.I=this.F=null},uCa=function(a,b){var c=void 0===c?0:c;
var d=BBa(b).width;g.wg(b,d);c=new j2(b,[d,b.offsetTop],[d-d-c,b.offsetTop],200,CBa);g.C(a,c);a.context.C.ra(c,"begin",function(){g.Fg(b,!0)});
c.play()},xCa=function(a,b){if(b.channel_name){var c=a.createElement({G:"div",
ia:["iv-branding-context-name"],Z:b.channel_name}),d=a.createElement({G:"div",ia:["iv-branding-context-subscribe"]}),e=b.standalone_subscribe_button_data;e&&(a.u=new g.eY(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.J),a.u.da(d));var f=a.createElement({G:"div",ia:["iv-branding-context-subscribe-caret"]}),h=a.createElement({G:"div",ia:["branding-context-container-inner"]});
h.appendChild(f);h.appendChild(c);h.appendChild(d);g.Fg(h,!1);var l=a.createElement({G:"div",ia:["branding-context-container-outer"]});l.appendChild(h);g.F(l,"right",b.image_width+"px");a.La().appendChild(l);a.C=new g.H(function(){vCa(a,h,l)},500);
g.C(a,a.C);a.context.u.ra(a.La(),"mouseover",function(){wCa(a,h,l,f,b.image_height)});
a.context.u.ra(a.La(),"mouseout",function(){a.C.start()})}},wCa=function(a,b,c,d,e){a.C.stop();
if(!a.D){var f=g.Eg(b);a.u||(b.style.width=g.vg(f.width,!0),c.style.width=g.vg(f.width,!0));g.F(d,"top",f.height-Math.max(Math.min(f.height,e)/2+10,20)+"px");g.F(d,"right","1px");a.D=!0;g.Fg(b,!0);a.F=new g.H(function(){g.I(this.La(),"iv-branding-active")},0,a);
a.F.start()}},vCa=function(a,b,c){g.Bn(a.La(),"iv-branding-active");
a.I=new g.H(function(){g.Fg(b,!1);a.u||(c.style.width=g.vg(0,!0))},250);
a.I.start();a.D=!1},yCa=function(a,b,c,d,e,f,h){this.u=a;
this.C=b;this.D=c;this.videoData=d;this.logger=e;this.J=f;this.B=h},V2=function(a,b,c){T2.call(this,a,b,c);
var d=this;this.N=this.isCollapsed=this.P=!1;this.I=5E3;this.B=this.C=this.u=this.D=null;this.K=this.createElement({G:"div",ia:["iv-promo-contents"]});this.F=new g.H(function(){d.u.setAttribute("aria-hidden","true");g.Fg(d.C,!1);g.Fg(d.B,!0)},700,this);
g.C(this,this.F)},zCa=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.I=b.collapsedelay_ms||a.I;var d=["iv-promo","iv-promo-inactive"];a.La().setAttribute("aria-hidden","true");a.La().setAttribute("aria-label","Promotion");a.La().tabIndex=0;var e=a.annotation.cd(),f=b.image_url;if(f){var h=a.createElement({G:"div",ia:["iv-promo-img","iv-click-target"]});f=a.createElement({G:"img",U:{src:f,"aria-hidden":"true"}});h.appendChild(f);b.video_duration&&!b.is_live?
(f=a.createElement({G:"span",L:"iv-promo-video-duration",Z:b.video_duration}),h.appendChild(f)):b.playlist_length&&(f=a.createElement({G:"span",L:"iv-promo-playlist-length",Z:b.playlist_length.toString()}),h.appendChild(f));e&&J2(a,h,e,a.annotation.id,b.session_data,void 0,c)}e?(f=a.createElement({G:"a",L:"iv-promo-txt"}),g.id(f,A2(e)),a.u=f):a.u=a.createElement({G:"div",L:"iv-promo-txt"});switch(a.annotation.style){case "cta":case "website":var l=a.createElement({G:"p",S:[{G:"strong",Z:b.text_line_1}]});
var m=a.createElement({G:"p",S:[{G:"span",L:"iv-promo-link",Z:b.text_line_2}]});if(f=b.text_line_3){d.push("iv-promo-website-card-cta-redesign");var n=a.createElement({G:"button",ia:["iv-promo-round-expand-icon","ytp-button"]});f=a.createElement({G:"button",ia:["iv-button","iv-promo-button"],S:[{G:"span",L:"iv-button-content",Z:f}]});var p=a.createElement({G:"div",L:"iv-promo-button-container"});p.appendChild(f);e&&J2(a,a.La(),e,a.annotation.id,b.session_data,void 0,c)}g.I(a.u,"iv-click-target");
e&&J2(a,a.u,e,a.annotation.id,b.session_data,void 0,c);break;case "playlist":case "video":l=a.createElement({G:"p",S:[{G:"span",Z:b.text_line_1}]}),m=a.createElement({G:"p",S:[{G:"strong",Z:b.text_line_2}]}),b.is_live&&(l=m,m=a.createElement({G:"span",ia:["yt-badge","iv-promo-badge-live"],Z:"LIVE NOW"})),g.I(a.u,"iv-click-target"),e&&J2(a,a.u,e,a.annotation.id,b.session_data,void 0,c),d.push("iv-promo-video")}l&&a.u.appendChild(l);m&&a.u.appendChild(m);a.K.appendChild(a.u);p&&a.K.appendChild(p);c=
a.createElement({G:"div",L:"iv-promo-actions"});a.B=a.createElement({G:"button",ia:["iv-promo-expand","ytp-button"]});a.B.title="Expand";a.context.u.ra(a.B,"click",function(r){W2(a,5E3,r)});
c.appendChild(a.B);g.Fg(a.B,!1);a.context.u.ra(a.La(),"mouseover",a.NI,a);a.context.u.ra(a.La(),"mouseout",a.MI,a);a.context.u.ra(a.La(),"touchend",function(r){W2(a,5E3,r)});
a.C=a.createElement({G:"button",ia:["iv-promo-close","ytp-button"]});a.C.title="Close";a.context.u.ra(a.C,"click","cta"===a.annotation.style&&b.text_line_3?a.GI:a.FI,a);c.appendChild(a.C);g.An(a.La(),d);h&&(a.La().appendChild(h),n&&h.appendChild(n));a.La().appendChild(a.K);a.La().appendChild(c)},W2=function(a,b,c){c.stopPropagation();
ACa(a);BCa(a,b);a.u.focus()},CCa=function(a){a.isCollapsed||a.N||a.D||(g.I(a.La(),"iv-promo-collapsed"),a.isCollapsed=!0,a.F.start())},ACa=function(a){a.F.stop();
a.isCollapsed&&(g.Cn(a.La(),["iv-promo-collapsed","iv-promo-collapsed-no-delay"]),a.isCollapsed=!1,a.u&&a.u.removeAttribute("aria-hidden"),g.Fg(a.B,!1),g.Fg(a.C,!0))},BCa=function(a,b){a.D||(a.D=g.Um(function(){X2(this);
CCa(this)},b,a))},X2=function(a){a.D&&(g.v.clearTimeout(a.D),a.D=null)},DCa=function(a){this.J=a},lCa=function(a,b,c){b&&(c?Y2(a,b.map(function(d){return g.on(d,c)})):Y2(a,b))},Y2=function(a,b,c,d){var e=1,f=void 0,h=-1;
if(c){var l=!1;f=function(){e--;e||l||(clearTimeout(h),l=!0,c())};
h=setTimeout(function(){l=!0;c()},1E3)}b=g.q(b||[]);
for(var m=b.next();!m.done;m=b.next())m=m.value,e++,g.Vs(m,f);d&&(e++,0!==d&&a.J.sendVideoStatsEngageEvent(d,f))},Z2=function(a){g.vS.call(this,a);
var b=this;this.P=!1;this.loadNumber=0;this.K={};this.logger=new DCa(this.player);this.F=new g.Pr(this);this.I=this.C=null;this.events=new g.Pr(this);this.N=this.u=null;this.W=[];g.C(this,this.F);this.F.R(this.player,"onVideoAreaChange",function(){b.V("onVideoAreaChange")});
this.F.R(this.player,"onHideControls",function(){b.V("onHideControls")});
this.F.R(this.player,"onShowControls",function(){b.V("onShowControls")});
this.F.R(this.player,"resize",function(d){b.V("resize",d)});
this.F.R(this.player,"presentingplayerstatechange",function(d){b.V("presentingplayerstatechange",d)});
this.subscribe("presentingplayerstatechange",this.uK,this);this.subscribe("resize",this.jt,this);this.player.T().P.subscribe("vast_info_card_add",this.sE,this);g.C(this,this.events);this.X=this.createElement({G:"div",L:"video-custom-annotations"});this.B=new g.V({G:"div",ia:["ytp-player-content","ytp-iv-player-content"]});g.C(this,this.B);g.$O(this.player,this.B.element,4);this.B.hide();this.D=new g.V({G:"div",ia:["ytp-iv-video-content"]});g.C(this,this.D);a=this.createElement({G:"div",L:"video-annotations"});
a.appendChild(this.X);this.D.element.appendChild(a);ECa(this)&&this.load();var c=this.createElement({G:"style"});(document.getElementsByTagName("HEAD")[0]||document.body).appendChild(c);g.dg(this,function(){g.Je(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)},FCa=function(a){a=a.createElement({G:"div",
ia:["annotation","annotation-type-custom"]});g.Fg(a,!1);return a},ECa=function(a){var b=a.player.T();
a=a.player.getVideoData();return 1===(b.annotationsLoadPolicy||a.annotationsLoadPolicy)&&!a.mG||b.P.get(a.videoId)||g.FF(a)||g.GF(a)?!0:!1},GCa=function(a,b){var c=!b.isCued()&&!g.T(b,1024);
g.CM(a.B,c);g.CM(a.D,c)},HCa=function(a,b,c){a.P=!0;
a.I=g.oq(b,c)},ICa=function(a,b){for(var c={},d=g.q(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.Sa(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(ICa(a,e))}return c},LCa=function(a){var b=a.player.getVideoData();
if(b.eg){var c=a.player.T().P.get(b.videoId);if(c){var d={format:"XML",urlParams:{},method:"POST",withCredentials:!0,onFinish:function(e,f,h){e=b.videoId;a.loaded&&a.loadNumber===a.loadNumber&&a.player.getVideoData().videoId===e&&(h=g.iq(h)&&h.responseXML?h.responseXML:null)&&$2(a,h)}};
g.sp()&&(d.onFinish=JCa(a,d.onFinish));d.postParams={ic_only:"1"};KCa(d,c);a.P=!0;g.oq(b.eg,d)}}},KCa=function(a,b){a.method="POST";
a.Xb=a.Xb||{};b.Qq&&(a.Xb.ic_coll=b.Qq);b.Rq&&(a.Xb.ic_xml=b.Rq);b.hq&&(a.Xb.ic_track=b.hq)},MCa=function(a){var b=new g.V({G:"div"});
g.Fg(b.element,!1);var c=new N2(a.player,b.element,a3(a));g.C(c,b);b.da(a.B.element);c.Qp();return c},a3=function(a){if(!a.N){var b=new k2(a);
g.C(a,b);var c=new g.W0(a);g.C(a,c);a.N=new yCa(b,c,a.player.T(),a.player.getVideoData(),a.logger,a.player,a.jb)}return a.N},$2=function(a,b){var c=!1,d=b.getElementsByTagName("annotations");
if(d&&!(1>d.length)&&(d=d[0].getAttribute("itct"))){var e=g.ks();if(e){var f=g.is();f&&g.Bs(g.uo("use_default_events_client")?void 0:g.cr,e,f,[g.es(d)])}}d=b.getElementsByTagName("annotation");for(e=0;e<d.length;e++){var h=ICa(a,d[e]);f=null;try{if(h){var l=h.id,m=/.+/;var n="string"===typeof l&&null!=m&&null!=l&&l.match(m)?l:"";var p=z2(h.type,NCa),r=z2(h.style,OCa),t=y2(h.data),w=0!==t.length?JSON.parse(t):{};var x=h.action;h=$Ba;if(null==x)var y=null;else if(g.Ra(x)){m=[];for(var D=g.q(x),E=D.next();!E.done;E=
D.next()){var G=h(E.value);G&&m.push(G)}y=m}else{var K=h(x);y=K?[K]:[]}f=n&&p?new C2(n,p,r,y,w):null}else f=null}catch(bb){}if(f)if("branding"===f.type||"promotion"===f.type){h=a;m=f;var M=FCa(h),Ia=null;switch(m.type){case "branding":if(h.player.T().Za)break;h.B.element.appendChild(M);Ia=new U2(M,a3(h),m);break;case "promotion":g.$O(h.player,M,4),Ia=new V2(M,a3(h),m)}Ia&&Ia.Qp();if(h=Ia)g.C(a,h),a.K[f.id]=h}else if("card"===f.type||"drawer"===f.type){a.u||(a.u=MCa(a),g.C(a,a.u));if("card"===f.type){c=
a.u;var va=f&&f.data&&f.data.card_type;h=f.data;if(va)switch(m=h.tracking||{},m={JB:m.impression,click:m.click,close:m.close,IF:m.teaser_impression,Ut:m.teaser_click},M=h.tracking_params||{},Ia=null,va){case "collaborator":f={id:f.id,timestamp:h.timestamp||0,type:h.card_type,teaserText:h.teaser_text,teaserDurationMs:h.teaser_duration_ms,startMs:h.start_ms,autoOpen:h.auto_open||!1,hd:h.session_data||{},sponsored:h.sponsored||!1,nf:m,Di:M.card?g.es(M.card):null,Ag:M.teaser?g.es(M.teaser):null,dd:M.icon?
g.es(M.icon):null,channelId:h.channel_id,customMessage:h.custom_message?h.custom_message:null,JE:h.image_url,title:h.title,metaInfo:h.meta_info,url:B2({pause_on_navigation:h.pause_on_navigation,target:h.target||"new",value:h.url})};Q2(c,f);break;case "playlist":f={id:f.id,timestamp:h.timestamp||0,type:h.card_type,teaserText:h.teaser_text,teaserDurationMs:h.teaser_duration_ms,startMs:h.start_ms,autoOpen:h.auto_open||!1,hd:h.session_data||{},sponsored:h.sponsored||!1,nf:m,Di:M.card?g.es(M.card):null,
Ag:M.teaser?g.es(M.teaser):null,dd:M.icon?g.es(M.icon):null,cq:h.image_url,playlistVideoCount:h.playlist_video_count,customMessage:h.custom_message?h.custom_message:null,title:h.title,metaInfo:h.meta_info,url:B2({pause_on_navigation:h.pause_on_navigation,target:h.target||"new",value:h.url})};Q2(c,f);break;case "productListing":h.signin_url&&(Ia=B2({target:"current",value:h.signin_url}));va=[];for(var gb=h.offers||[],Hb=0;Hb<gb.length;Hb++)va.push(new dCa(g.pd(gb[Hb].merchant),g.pd(gb[Hb].price)));
f={id:f.id,timestamp:h.timestamp||0,type:h.card_type,teaserText:h.teaser_text,teaserDurationMs:h.teaser_duration_ms,startMs:h.start_ms,autoOpen:h.auto_open||!1,hd:h.session_data||{},sponsored:h.sponsored||!1,nf:m,Di:M.card?g.es(M.card):null,Ag:M.teaser?g.es(M.teaser):null,dd:M.icon?g.es(M.icon):null,imageUrl:h.image_url,displayDomain:h.display_domain?h.display_domain:null,showLinkIcon:!!h.show_link_icon,Jq:h.button_icon_url?h.button_icon_url:null,title:h.title,customMessage:h.custom_message?h.custom_message:
null,url:B2({pause_on_navigation:h.pause_on_navigation,target:h.target||"new",value:h.url}),eW:Ia,dW:h.signin_title?h.signin_title:void 0,cW:h.signin_message?h.signin_message:void 0,offers:va};Q2(c,f);break;case "simple":f={id:f.id,timestamp:h.timestamp||0,type:h.card_type,teaserText:h.teaser_text,teaserDurationMs:h.teaser_duration_ms,startMs:h.start_ms,autoOpen:h.auto_open||!1,hd:h.session_data||{},sponsored:h.sponsored||!1,nf:m,Di:M.card?g.es(M.card):null,Ag:M.teaser?g.es(M.teaser):null,dd:M.icon?
g.es(M.icon):null,imageUrl:h.image_url,displayDomain:h.display_domain?h.display_domain:null,showLinkIcon:!!h.show_link_icon,Jq:h.button_icon_url?h.button_icon_url:null,title:h.title,customMessage:h.custom_message?h.custom_message:null,url:B2({pause_on_navigation:h.pause_on_navigation,target:h.target||"new",value:h.url})};Q2(c,f);break;case "video":f={id:f.id,timestamp:h.timestamp||0,type:h.card_type,teaserText:h.teaser_text,teaserDurationMs:h.teaser_duration_ms,startMs:h.start_ms,autoOpen:h.auto_open||
!1,hd:h.session_data||{},sponsored:h.sponsored||!1,nf:m,Di:M.card?g.es(M.card):null,Ag:M.teaser?g.es(M.teaser):null,dd:M.icon?g.es(M.icon):null,cq:h.image_url,videoDuration:h.video_duration||null,customMessage:h.custom_message?h.custom_message:null,title:h.title,metaInfo:h.meta_info,isLiveNow:!!h.is_live_now,url:B2({pause_on_navigation:h.pause_on_navigation,target:h.target||"new",value:h.url})},Q2(c,f)}}else hCa(a.u,f);c=!0}}c&&(d2(a.player),a.jt())},PCa=function(a,b){var c=!1;
a.u||(a.u=MCa(a),g.C(a,a.u));for(var d=g.q(b.cards||[]),e=d.next();!e.done;e=d.next())e=e.value,e.cardRenderer&&(iCa(a.u,e.cardRenderer),c=!0);c&&(c=a.u,d=b.headerText?g.U(b.headerText):"",g.Ne(c.Ra,d),c.N&&c.N.setAttribute("title",d),c.context.videoData.eventId&&(c.eventId=c.context.videoData.eventId),c.ba=b.trackingParams?g.es(b.trackingParams):null,c.K=b.closeButton.infoCardIconRenderer.trackingParams?g.es(b.closeButton.infoCardIconRenderer.trackingParams):null,c.dd=b.icon.infoCardIconRenderer.trackingParams?
g.es(b.icon.infoCardIconRenderer.trackingParams):null,d2(a.player),a.jt())},QCa=function(a,b,c,d,e){if(!a.player.T().Za){var f=[];
b.navigationEndpoint&&b.navigationEndpoint.browseEndpoint&&b.navigationEndpoint.browseEndpoint.browseId&&f.push(new XBa("openUrl","click",new VBa("/channel/"+b.navigationEndpoint.browseEndpoint.browseId,"new",!0,!0),null));var h=b.watermark.thumbnails[0];d={channel_name:b.channelName,end_ms:b.endTimeMs,image_height:h.height,image_type:1,image_url:h.url,image_width:h.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;var m,n;h=e=null;b.subscribed?(b.subscriberCountWithUnsubscribeText&&(e=g.U(b.subscriberCountWithUnsubscribeText)),b.subscriberCountText&&(h=g.U(b.subscriberCountText))):(b.subscriberCountText&&(e=g.U(b.subscriberCountText)),b.subscriberCountWithSubscribeText&&(h=g.U(b.subscriberCountWithSubscribeText)));var p=b.signInEndpoint&&b.signInEndpoint.webNavigationEndpointData&&
b.signInEndpoint.webNavigationEndpointData.url?b.signInEndpoint.webNavigationEndpointData.url:(null===(n=null===(m=null===(l=b.signInEndpoint)||void 0===l?void 0:l.commandMetadata)||void 0===m?void 0:m.webCommandMetadata)||void 0===n?void 0:n.url)||"";l={subscribeText:g.U(b.unsubscribedButtonText),subscribeCount:e||"",unsubscribeText:g.U(b.subscribedButtonText),unsubscribeCount:h||"",enabled:b.enabled||!1,classic:!1,subscribed:b.subscribed||!1,feature:"iv",signInUrl:p};d.standalone_subscribe_button_data=
l}f=new C2(c,"branding","branding",f,d);l=FCa(a);a.B.element.appendChild(l);f=new U2(l,a3(a),f);f.Qp();g.C(f,f);a.K[c]=f}},JCa=function(a,b){return function(c){for(var d=[],e=0;e<arguments.length;++e)d[e-0]=arguments[e];
a.la()||(d.unshift(b),b=g.Va.apply(window,d),a.W.push(g.qp(b)))}},RCa=function(a){return"annotation-editor"===a||"live-dashboard"===a},e2={},f2=null;g.Xa(h2,g.Dn);g.k=h2.prototype;g.k.getDuration=function(){return this.duration};
g.k.play=function(a){if(a||0==this.Ca)this.progress=0,this.coords=this.u;else if(this.Cb())return!1;g2(this);this.startTime=a=g.A();-1==this.Ca&&(this.startTime-=this.duration*this.progress);this.endTime=this.startTime+this.duration;this.D=this.startTime;this.progress||this.ht();this.hg("play");-1==this.Ca&&this.hg("resume");this.Ca=1;var b=g.Ua(this);b in e2||(e2[b]=this);FBa();GBa(this,a);return!0};
g.k.stop=function(a){g2(this);this.Ca=0;a&&(this.progress=1);HBa(this,this.progress);this.hg("stop");this.rp()};
g.k.pause=function(){this.Cb()&&(g2(this),this.Ca=-1,this.hg("pause"))};
g.k.aa=function(){0==this.Ca||this.stop(!1);this.hg("destroy");h2.Wc.aa.call(this)};
g.k.destroy=function(){this.dispose()};
g.k.Tv=function(){this.hg("animate")};
g.k.hg=function(a){this.dispatchEvent(new IBa(a,this))};
g.Xa(IBa,g.Ll);g.Xa(i2,h2);i2.prototype.B=g.Oa;i2.prototype.Tv=function(){this.B();i2.Wc.Tv.call(this)};
i2.prototype.rp=function(){this.B();i2.Wc.rp.call(this)};
i2.prototype.ht=function(){this.B();i2.Wc.ht.call(this)};
g.Xa(j2,i2);j2.prototype.B=function(){this.element.style.left=Math.round(this.coords[0])+"px";this.element.style.top=Math.round(this.coords[1])+"px"};g.u(k2,g.B);k2.prototype.ra=function(a,b,c,d){c=(0,g.z)(c,d||this.B);a=g.cp(a,b,c);this.u.push(a);return a};
k2.prototype.Hw=function(a,b,c,d){c=(0,g.z)(c,d||this.B);a=g.lp(a,b,c);this.u.push(a);return a};
k2.prototype.Bb=function(a){g.dp(a);g.rb(this.u,a)};
k2.prototype.aa=function(){g.dp(this.u);this.u.length=0;g.B.prototype.aa.call(this)};g.u(o2,g.vS);g.k=o2.prototype;g.k.load=function(){g.vS.prototype.load.call(this);if(!p2(this)){var a=g.EF(this.player.getVideoData());a?(a=n2(a,KBa(this)),q2(this,a,!1)):LBa(this)}};
g.k.unload=function(){q2(this,null);this.C&&(this.C.abort(),this.C=null);g.vS.prototype.unload.call(this)};
g.k.Rd=function(a,b){if(!p2(this))return null;if("loadCustomEndscreenRenderer"===a){var c=n2(b,"new");q2(this,c);return!0}return null};
g.k.getOptions=function(){return p2(this)?["loadCustomEndscreenRenderer"]:[]};
g.k.Qa=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<SCa.length;f++){var h=Math.abs(b.width-SCa[f]);if(-1===e||d>=h)e=f,d=h}d=TCa[e];this.B&&g.F(this.B.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.u[f],h=
this.F[f],e&&h){var l=h.width*c/h.aspectRatio;f=Math.round(l*a.height);var m=a.left+Math.round(h.left*a.width),n=a.top+Math.round(h.top*a.height);g.Dg(e.element,Math.round(h.width*a.width),f);g.wg(e.element,m,n);g.Cn(e.element,UCa);m=h.left+h.width/2;h=h.top+l/2;g.I(e.element,.5>=m&&.5>=h?"ytp-ce-top-left-quad":.5<m&&.5>=h?"ytp-ce-top-right-quad":.5>=m&&.5<h?"ytp-ce-bottom-left-quad":"ytp-ce-bottom-right-quad");g.Cn(e.element,TCa);g.I(e.element,d);(e=g.re(document,"div","ytp-ce-expanding-overlay-body",
e.element)[0])&&g.F(e,"height",f+"px")}}}}};
g.k.YJ=function(a){if(this.endscreen)if("ytp-ce-in-endscreen"===a.getId())x2(this,this.endscreen.impressionUrls),(a=g.ks())&&this.endscreen.visualElement&&g.Cs(a,this.endscreen.visualElement,void 0);else{a=a.getId().substring(15);var b=this.u[a],c=this.F[a];g.I(b.element,"ytp-ce-element-show");b.element.removeAttribute("aria-hidden");b=this.player.getRootNode();g.I(b,"ytp-ce-shown");x2(this,c.impressionUrls);(b=g.ks())&&g.Cs(b,c.visualElement,void 0);this.player.T().C&&this.player.va("endscreenelementshown",
a)}};
g.k.ZJ=function(a){if("ytp-ce-in-endscreen"!==a.getId()){a=a.getId().substring(15);var b=this.u[a];g.Bn(b.element,"ytp-ce-element-show");b.element.setAttribute("aria-hidden","true");b=this.player.getRootNode();g.Bn(b,"ytp-ce-shown");this.player.T().C&&this.player.va("endscreenelementhidden",a)}};
g.k.CP=function(a){var b=this;a.target===window&&(new g.H(function(){for(var c=g.q(Object.values(b.u)),d=c.next();!d.done;d=c.next())g.Cn(d.value.element,["ytp-ce-force-expand","ytp-ce-element-hover","ytp-ce-element-shadow-show"])},0)).start()};
var SCa=[346,426,470,506,570,640,853,1280,1920],TCa="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(" "),UCa=["ytp-ce-top-left-quad","ytp-ce-top-right-quad","ytp-ce-bottom-left-quad","ytp-ce-bottom-right-quad"];var WBa={oS:"current",TT:"new"};var YBa={CLOSE:"close",VT:"openUrl",hH:"subscribe"},ZBa={fS:"click",CLOSE:"close",XS:"hidden",HU:"rollOut",IU:"rollOver",OU:"shown"};C2.prototype.cd=function(){var a=aCa(this,function(b){return"openUrl"===b.type&&null!=b.url});
return a?a.url:null};
var OCa={NR:"anchored",DG:"branding",CHANNEL:"channel",nS:"cta",aT:"highlightText",pT:"label",PLAYLIST:"playlist",uU:"popup",UU:"speech",hH:"subscribe",gV:"title",VIDEO:"video",tV:"website"},NCa={DG:"branding",XR:"card",tS:"drawer",ZS:"highlight",GT:"marker",zU:"promotion",TEXT:"text",vV:"widget"};g.u(I2,g.B);g.k=I2.prototype;g.k.addCueRange=function(a,b,c,d,e){a=new g.oD(a,b,{id:c});a.namespace="annotations_module";d&&this.oa.set(a,d);e&&this.ya.set(a,e);g.kM(this.context.J,[a])};
g.k.Qp=function(){this.context.B.subscribe("resize",this.Lq,this)};
g.k.La=function(){return this.element};
g.k.Rw=function(a,b,c,d,e,f){if(this.Ia)return!1;f&&(f.stopPropagation(),f.preventDefault());this.navigate(a,c,d,e);return!1};
g.k.show=function(){};
g.k.hide=function(){};
g.k.destroy=function(){g.Je(this.La())};
g.k.Lq=function(){};
g.k.navigate=function(a,b,c,d){var e=this,f=A2(a);if(f){var h=fCa(f,a.target),l=function(){a.u&&e.context.J.pauseVideo();var m=e.context.videoData.Hc||!1,n=g.Xp(f||"");m&&n&&(n.v||n.list)?g.N0(e.context.J.app,n.v,b,n.list,!1,void 0):g.gK(f||"","current"===h?"_top":void 0,b)};
"new"===h&&(l(),l=null);Y2(this.context.logger,c,l,d);eCa(f)||(c=g.ks(),d=b.itct,c&&d&&g.Ms(c,g.es(d)))}};
g.k.aa=function(){this.oa.clear();this.ya.clear();g.B.prototype.aa.call(this)};
g.k.createElement=function(a){a=new g.V(a);g.C(this,a);return a.element};g.u(N2,I2);g.k=N2.prototype;g.k.isAvailable=function(){var a;if(a=!!this.cards.length)(a=this.J.getRootNode())?(a=g.Eg(a),a=173<a.width&&173<a.height):a=!1;return a};
g.k.Lq=function(){var a=this.isAvailable();g.Fg(this.La(),a);g.J(this.context.J.getRootNode(),g.a0.IV_DRAWER_ENABLED,a);d2(this.J)};
g.k.destroy=function(){var a=g.UW(g.LW(this.J));a&&a.Nw(!1,void 0);try{this.J.getRootNode().removeChild(this.D)}catch(b){}g.Oo(this.W);g.dp(this.ha);this.ka&&this.ka.dispose();this.F&&this.F.dispose();I2.prototype.destroy.call(this)};
g.k.HH=function(){if(this.C){Y2(this.context.logger,S2(this).nf.close);var a=g.ks();a&&this.K&&g.Ms(a,this.K);M2(this)}};
g.k.UH=function(){g.J(this.D,"iv-drawer-scrolled",0<this.B.scrollTop)};
g.k.vJ=function(){var a=g.ks(),b=S2(this);b=b?b.dd:this.dd;a&&b&&g.Ks(a,[b])};
g.k.uJ=function(){var a=g.ks(),b=S2(this);b=b?b.dd:this.dd;a&&b&&g.Ls(a,[b])};
g.k.wK=function(){var a=S2(this);Y2(this.context.logger,a.nf.IF);var b=g.ks();b&&a&&g.Ks(b,[a.Ag,a.dd])};
g.k.wJ=function(){var a=g.ks(),b=S2(this);a&&b&&g.Ls(a,[b.Ag])};
g.k.vK=function(a){var b=S2(this),c=g.ks();this.u?a?(a=this.context.logger,Y2(a,b.nf.Ut),a.J.sendVideoStatsEngageEvent(4,void 0),c&&b.Ag&&g.Ms(c,b.Ag)):(a=this.context.logger,Y2(a,b.nf.Ut),a.J.sendVideoStatsEngageEvent(4,void 0),c&&b.dd&&g.Ms(c,b.dd)):(a=this.context.logger,Y2(a,b.nf.Ut),a.J.sendVideoStatsEngageEvent(4,void 0),c&&this.dd&&g.Ms(c,this.dd))};g.u(T2,I2);T2.prototype.Qp=function(){I2.prototype.Qp.call(this);tCa(this)};
T2.prototype.show=function(){I2.prototype.show.call(this);var a=g.ks(),b=this.annotation.data;a&&b&&(b=b.session_data)&&g.Ks(a,[g.es(b.itct)])};
T2.prototype.hide=function(){I2.prototype.hide.call(this);var a=g.ks(),b=this.annotation.data;a&&b&&(b=b.session_data)&&g.Ls(a,[g.es(b.itct)])};g.u(U2,T2);
U2.prototype.show=function(){if(!this.isActive){T2.prototype.show.call(this);if(!this.K){g.I(this.La(),"iv-branding");var a=this.annotation.data;this.B=this.createElement({G:"img",ia:["branding-img","iv-click-target"],U:{"aria-label":"Channel watermark",src:a.image_url,width:a.image_width,height:a.image_height}});g.Fg(this.B,!1);var b=this.createElement({G:"div",ia:["branding-img-container"]});b.appendChild(this.B);this.La().appendChild(b);(b=this.annotation.cd())&&J2(this,this.B,b,this.annotation.id,a.session_data);
xCa(this,a);this.K=!0}g.Fg(this.La(),!0);this.isActive=!0;this.B&&uCa(this,this.B)}};
U2.prototype.hide=function(){this.isActive&&(T2.prototype.hide.call(this),g.Fg(this.La(),!1),this.isActive=!1)};
U2.prototype.destroy=function(){this.u&&(this.u.dispose(),this.u=null);T2.prototype.destroy.call(this)};g.u(V2,T2);g.k=V2.prototype;g.k.show=function(){this.isActive||(T2.prototype.show.call(this),this.P||(zCa(this),this.P=!0),g.Fg(this.La(),!0),g.Um(function(){g.Bn(this.La(),"iv-promo-inactive")},100,this),this.La().removeAttribute("aria-hidden"),this.isActive=!0,X2(this),ACa(this),BCa(this,this.I))};
g.k.hide=function(){this.isActive&&(g.I(this.La(),"iv-promo-inactive"),this.isActive=!1,this.La().setAttribute("aria-hidden","true"))};
g.k.Rw=function(a,b,c,d,e,f){return this.isCollapsed?!1:T2.prototype.Rw.call(this,a,b,c,d,e,f)};
g.k.NI=function(a){this.N=!0;W2(this,500,a)};
g.k.MI=function(){this.N=!1;CCa(this)};
g.k.FI=function(a){a.stopPropagation();this.hide()};
g.k.GI=function(a){a.stopPropagation();X2(this);this.isCollapsed=!0;g.I(this.La(),"iv-promo-collapsed-no-delay");this.F.start()};
g.k.destroy=function(){this.F.dispose();T2.prototype.destroy.call(this)};g.u(Z2,g.vS);g.k=Z2.prototype;g.k.Rd=function(a,b){if(!RCa(this.player.T().playerStyle))return null;switch(a){case "loadCustomAnnotationsXml":var c=g.V0(b);c&&$2(this,c);return!0;case "removeCustomAnnotationById":return b&&this.u&&(kCa(this.u,b),d2(this.player)),!0}return null};
g.k.getOptions=function(){return RCa(this.player.T().playerStyle)?["loadCustomAnnotationsXml","removeCustomAnnotationById"]:[]};
g.k.jt=function(){if(this.D){var a=g.yG(this.player).getVideoContentRect(!0);g.Dg(this.D.element,a.width,a.height);g.wg(this.D.element,a.left,a.top)}if(this.u){var b=this.player.Nh();a=this.u;b=b.width;g.J(a.D,"iv-drawer-small",426>=b);g.J(a.D,"iv-drawer-big",1280<=b)}};
g.k.uK=function(a){GCa(this,a.state);g.T(a.state,2)&&(this.Wo()&&this.wC()&&2!==this.player.getPresentingPlayerType()&&this.setCardsVisible(!1),this.Nw(!1))};
g.k.load=function(){function a(h){var l=b.loadNumber;b.I=null;b.loaded&&b.loadNumber===l&&b.player.getVideoData().videoId===d&&(h=g.iq(h)&&h.responseXML?h.responseXML:null)&&($2(b,h),g.I(b.player.getRootNode(),"iv-module-loaded"))}
var b=this;g.vS.prototype.load.call(this);GCa(this,g.fI(this.player));this.loadNumber++;var c=this.player.getVideoData(),d=c.videoId;g.sp()&&(a=JCa(this,a));var e={format:"XML",Bf:a,onError:function(){b.I=null},
Dg:{}};c.isPharma&&(e.Dg.pharma="1");e.method="POST";e.withCredentials=!0;var f=this.player.T().P.get(d);f&&KCa(e,f);f=f&&(f.Rq||f.Qq);if(!c.Gq||f)c.eg?HCa(this,c.eg,e):(this.C=function(){b.Oa(e)},this.player.addEventListener("videodatachange",this.C));
g.$O(this.player,this.D.element,4);this.jt();(f=g.FF(c))&&PCa(this,f);(f=g.GF(c))&&f.featuredChannel&&QCa(this,f.featuredChannel,f.annotationId||"branding",c.videoId||null,c.eventId||null)};
g.k.Oa=function(a){var b=this.player.getVideoData();b.eg&&(this.C&&(this.player.removeEventListener("videodatachange",this.C),this.C=null),HCa(this,b.eg,a))};
g.k.unload=function(){g.aX(this.player,"annotations_module");for(var a=g.q(Object.keys(this.K)),b=a.next();!b.done;b=a.next())this.K[b.value].destroy();this.N=null;this.u&&(this.u.destroy(),this.u=null,d2(this.player));this.P=!1;this.I&&(this.I.abort(),this.I=null);this.K={};this.B.hide();g.vS.prototype.unload.call(this);this.D.detach();this.C&&(this.player.removeEventListener("videodatachange",this.C),this.C=null)};
g.k.sE=function(a){a===this.player.getVideoData().videoId&&(this.loaded?LCa(this):this.load())};
g.k.Wo=function(){return!!this.u&&this.u.isAvailable()};
g.k.wC=function(){this.Wo();return!!this.u&&this.u.C};
g.k.setCardsVisible=function(a,b,c){b=void 0===b?!1:b;this.Wo();this.u&&(a?c?L2(this.u,c,b):L2(this.u,"YOUTUBE_DRAWER_AUTO_OPEN",b):M2(this.u))};
g.k.Nw=function(a,b){this.player.V(a?"cardsteasershow":"cardsteaserhide",b)};
g.k.aa=function(){this.player.T().P.unsubscribe("vast_info_card_add",this.sE,this);g.Bn(this.player.getRootNode(),g.a0.IV_DRAWER_OPEN);for(var a=this.W,b=0,c=a.length;b<c;b++)g.tp(a[b]);this.W.length=0;g.vS.prototype.aa.call(this)};
g.k.createElement=function(a){a=new g.V(a);g.C(this,a);return a.element};g.oX.annotations_module=Z2;g.oX.creatorendscreen=o2;})(_yt_player);
