(function(g){var window=this;'use strict';var HfK=function(h){h.publish("autonavvisibility")},Bf6=function(h,W){h.Iz("onAutonavCoundownStarted",W)},Epc=function(h){var W,c,V; return h==null?void 0:(W=h.playerOverlays)==null?void 0:(c=W.playerOverlayRenderer)==null?void 0:(V=c.autoplay)==null?void 0:V.playerOverlayAutoplayRenderer},Bi=function(h){var W=h.B(),c=W.Y; g.p.call(this,{D:"a",K:"ytp-autonav-suggestion-card",J:{href:"{{url}}",target:c?W.T:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},V:[{D:"div",LM:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],J:{style:"{{background}}"},V:[{D:"div",J:{"aria-label":"{{timestamp}}"},LM:["ytp-autonav-timestamp"],YN:"{{duration}}"},{D:"div",LM:["ytp-autonav-live-stamp"],YN:"En vivo"}, {D:"div",LM:["ytp-autonav-upcoming-stamp"],YN:"Pr\u00f3ximamente"},{D:"div",K:"ytp-autonav-list-overlay",V:[{D:"div",K:"ytp-autonav-mix-text",YN:"Mix"},{D:"div",K:"ytp-autonav-mix-icon"}]}]},{D:"div",LM:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],YN:"{{title}}"},{D:"div",LM:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],YN:"{{author}}"},{D:"div",LM:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],YN:"{{views_and_publish_time}}"}]});this.L= h;this.suggestion=null;this.X=c;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},E3=function(h,W){W=W===void 0?!1:W; g.p.call(this,{D:"div",K:"ytp-autonav-endscreen-countdown-overlay"});var c=this;this.S=W;this.cancelCommand=this.N=void 0;this.G=0;this.container=new g.p({D:"div",K:"ytp-autonav-endscreen-countdown-container"});g.X(this,this.container);this.container.kN(this.element);W=h.B();var V=W.Y;this.L=h;this.suggestion=null;this.onVideoDataChange("newdata",this.L.getVideoData());this.U(h,"videodatachange",this.onVideoDataChange);this.X=new g.p({D:"div",K:"ytp-autonav-endscreen-upnext-container",J:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},V:[{D:"div",K:"ytp-autonav-endscreen-upnext-header"},{D:"div",K:"ytp-autonav-endscreen-upnext-alternative-header",YN:"{{autoplayAlternativeHeader}}"},{D:"a",K:"ytp-autonav-endscreen-link-container",J:{href:"{{url}}",target:V?W.T:""},V:[{D:"div",K:"ytp-autonav-endscreen-upnext-thumbnail",J:{style:"{{background}}"},V:[{D:"div",J:{"aria-label":"{{timestamp}}"},LM:["ytp-autonav-timestamp"], YN:"{{duration}}"},{D:"div",LM:["ytp-autonav-live-stamp"],YN:"En vivo"},{D:"div",LM:["ytp-autonav-upcoming-stamp"],YN:"Pr\u00f3ximamente"}]},{D:"div",K:"ytp-autonav-endscreen-video-info",V:[{D:"div",K:"ytp-autonav-endscreen-premium-badge"},{D:"div",K:"ytp-autonav-endscreen-upnext-title",YN:"{{title}}"},{D:"div",K:"ytp-autonav-endscreen-upnext-author",YN:"{{author}}"},{D:"div",K:"ytp-autonav-view-and-date",YN:"{{views_and_publish_time}}"},{D:"div",K:"ytp-autonav-author-and-view",YN:"{{author_and_views}}"}]}]}]}); g.X(this,this.X);this.X.kN(this.container.element);V||this.U(this.X.vk("ytp-autonav-endscreen-link-container"),"click",this.PK);this.L.createClientVe(this.container.element,this,115127);this.L.createClientVe(this.X.vk("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.p({D:"div",K:"ytp-autonav-overlay"});g.X(this,this.overlay);this.overlay.kN(this.container.element);this.W=new g.p({D:"div",K:"ytp-autonav-endscreen-button-container"});g.X(this,this.W);this.W.kN(this.container.element); this.cancelButton=new g.p({D:"button",LM:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",W.j("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],J:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},YN:"Cancelar"});g.X(this,this.cancelButton);this.cancelButton.kN(this.W.element);this.cancelButton.listen("click",this.u2,this);this.L.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.p({D:"a",LM:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",W.j("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],J:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},YN:"Reproducir ahora"});g.X(this,this.playButton);this.playButton.kN(this.W.element);this.playButton.listen("click",this.PK,this);this.L.createServerVe(this.playButton.element,this.playButton,!0);(W=this.L.getVideoData())&&R7l(this,W);this.Y=new g.oD(function(){JAI(c)},500); g.X(this,this.Y);this.hd();this.U(h,"autonavvisibility",this.hd);this.L.j("web_autonav_color_transition")&&(this.U(h,"autonavchange",this.Ob),this.U(h,"onAutonavCoundownStarted",this.oNn))},Rh=function(h){var W=h.L.Hv(!0,h.L.isFullscreen()); g.$y(h.container.element,"ytp-autonav-endscreen-small-mode",h.Lp(W));g.$y(h.container.element,"ytp-autonav-endscreen-is-premium",!!h.suggestion&&!!h.suggestion.u8V);g.$y(h.L.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!h.L.XD());g.$y(h.L.getRootNode(),"countdown-running",h.Lg());g.$y(h.container.element,"ytp-player-content",h.L.XD());g.oY(h.overlay.element,{width:W.width+"px"});if(!h.Lg()){h.L.XD()?uwc(h,Math.round(dFU(h)/1E3)):uwc(h);W=!!h.suggestion&&!!h.suggestion.s4;var c=h.L.XD()|| !W;g.$y(h.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!c&&W);g.$y(h.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",c&&!W);h.W.pJ(h.L.XD());g.$y(h.element,"ytp-enable-w2w-color-transitions",G4U(h))}},JAI=function(h){var W=dFU(h),c=Math,V=c.min; var H=h.G?Date.now()-h.G:0;c=V.call(c,H,W);uwc(h,Math.ceil((W-c)/1E3));W-c<=500&&h.Lg()?h.select(!0):h.Lg()&&h.Y.start()},dFU=function(h){if(h.L.isFullscreen()){var W; h=(W=h.L.getVideoData())==null?void 0:W.T$;return h===-1||h===void 0?8E3:h}return h.L.AZ()>=0?h.L.AZ():g.DF(h.L.B().experiments,"autoplay_time")||1E4},R7l=function(h,W){W=W.getWatchNextResponse(); var c,V;W=(c=Epc(W))==null?void 0:(V=c.nextButton)==null?void 0:V.buttonRenderer;h.N=W==null?void 0:W.navigationEndpoint;c=W==null?void 0:W.trackingParams;h.playButton&&c&&h.L.setTrackingParams(h.playButton.element,c)},G4U=function(h){var W; return!((W=h.L.getVideoData())==null||!W.watchToWatchTransitionRenderer)},uwc=function(h,W){W=W===void 0?-1:W; h=h.X.vk("ytp-autonav-endscreen-upnext-header");g.xS(h);if(W>=0){W=String(W);var c="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],V="A continuaci\u00f3n, en $SECONDS".indexOf(c);if(V>=0){h.appendChild(g.rb("A continuaci\u00f3n, en $SECONDS".slice(0,V)));var H=g.Zr("span");g.wH(H,"ytp-autonav-endscreen-upnext-header-countdown-number");g.aY(H,W);h.appendChild(H);h.appendChild(g.rb("A continuaci\u00f3n, en $SECONDS".slice(V+c.length)));return}}g.aY(h,"A continuaci\u00f3n")},Jd= function(h,W){g.p.call(this,{D:"div", LM:["html5-endscreen","ytp-player-content",W||"base-endscreen"]});this.created=!1;this.player=h},ut=function(h){g.p.call(this,{D:"div", LM:["ytp-upnext","ytp-player-content"],J:{"aria-label":"{{aria_label}}"},V:[{D:"div",K:"ytp-cued-thumbnail-overlay-image",J:{style:"{{background}}"}},{D:"span",K:"ytp-upnext-top",V:[{D:"span",K:"ytp-upnext-header",YN:"A continuaci\u00f3n"},{D:"span",K:"ytp-upnext-title",YN:"{{title}}"},{D:"span",K:"ytp-upnext-author",YN:"{{author}}"}]},{D:"a",K:"ytp-upnext-autoplay-icon",J:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},V:[{D:"svg",J:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},V:[{D:"circle",K:"ytp-svg-autoplay-circle",J:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{D:"circle",K:"ytp-svg-autoplay-ring",J:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{D:"path",K:"ytp-svg-fill",J:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{D:"span",K:"ytp-upnext-bottom",V:[{D:"span",K:"ytp-upnext-cancel"},{D:"span",K:"ytp-upnext-paused", YN:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=h;this.cancelButton=null;this.N=this.vk("ytp-svg-autoplay-ring");this.G=this.notification=this.X=this.suggestion=null;this.Y=new g.oD(this.O6,5E3,this);this.W=0;var W=this.vk("ytp-upnext-cancel");this.cancelButton=new g.p({D:"button",LM:["ytp-upnext-cancel-button","ytp-button"],J:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},YN:"Cancelar"});g.X(this,this.cancelButton);this.cancelButton.listen("click", this.l2,this);this.cancelButton.kN(W);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.X(this,this.Y);this.api.createClientVe(this.element,this,18788);W=this.vk("ytp-upnext-autoplay-icon");this.U(W,"click",this.Xs);this.api.createClientVe(W,this,115130);this.vK();this.U(h,"autonavvisibility",this.vK);this.U(h,"mdxnowautoplaying",this.HJk);this.U(h,"mdxautoplaycanceled",this.nZI);g.$y(this.element,"ytp-upnext-mobile",this.api.B().W)},ZfI=function(h,W){if(W)return W; if(h.api.isFullscreen()){var c;h=(c=h.api.getVideoData())==null?void 0:c.T$;return h===-1||h===void 0?8E3:h}return h.api.AZ()>=0?h.api.AZ():g.DF(h.api.B().experiments,"autoplay_time")||1E4},rAt=function(h,W){W=ZfI(h,W); var c=Math,V=c.min;var H=(0,g.aC)()-h.W;c=V.call(c,H,W);W=W===0?1:Math.min(c/W,1);h.N.setAttribute("stroke-dashoffset",""+-211*(W+1));W>=1&&h.Lg()&&h.api.getPresentingPlayerType()!==3?h.select(!0):h.Lg()&&h.X.start()},dq=function(h){Jd.call(this,h,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.p({D:"div",K:"ytp-suggestion-panel",V:[{D:"div",LM:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],YN:"M\u00e1s videos"}]});this.Z=new g.p({D:"div",K:"ytp-suggestions-container"});this.videos=[];this.G=null;this.N=this.S=!1;this.W=new E3(this.player);g.X(this,this.W);this.W.kN(this.element);h.getVideoData().iX?this.X=this.W:(this.X=new ut(h),g.ge(this.player,this.X.element,4),g.X(this,this.X));this.overlay=new g.p({D:"div", K:"ytp-autonav-overlay-cancelled-state"});g.X(this,this.overlay);this.overlay.kN(this.element);this.Y=new g.lX(this);g.X(this,this.Y);g.X(this,this.table);this.table.kN(this.element);this.table.show();g.X(this,this.Z);this.Z.kN(this.table.element);this.hide()},Gl=function(h){var W=h.XD(); W!==h.N&&(h.N=W,HfK(h.player),h.N?(h.W!==h.X&&h.W.hide(),h.table.hide()):(h.W!==h.X&&h.W.show(),h.table.show()))},qKI=function(h){Jd.call(this,h,"videowall-endscreen"); var W=this;this.L=h;this.stills=[];this.G=this.videoData=null;this.Y=this.S=!1;this.Z=null;g.he(this.element,"modern-videowall-endscreen");this.W=new g.lX(this);g.X(this,this.W);this.N=new g.oD(function(){g.he(W.element,"ytp-show-tiles")},0); g.X(this,this.N);this.table=new g.cn({D:"div",K:"ytp-modern-endscreen-content"});g.X(this,this.table);this.table.kN(this.element);h.getVideoData().iX?this.X=new E3(h,!0):this.X=new ut(h);g.X(this,this.X);g.ge(this.player,this.X.element,4);h.createClientVe(this.element,this,158789);this.hide()},Zi=function(h){return g.Df(h.player)&&h.g1()&&!h.G},rq=function(h){var W=h.XD(); W!==h.S&&(h.S=W,HfK(h.player))},xFK=function(h){Jd.call(this,h,"subscribecard-endscreen"); this.X=new g.p({D:"div",K:"ytp-subscribe-card",V:[{D:"img",K:"ytp-author-image",J:{src:"{{profilePicture}}"}},{D:"div",K:"ytp-subscribe-card-right",V:[{D:"div",K:"ytp-author-name",YN:"{{author}}"},{D:"div",K:"html5-subscribe-button-container"}]}]});g.X(this,this.X);this.X.kN(this.element);var W=h.getVideoData();this.subscribeButton=new g.Hm("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,W.e5,W.subscribed,"trailer-endscreen",null,h,!1);g.X(this,this.subscribeButton);this.subscribeButton.kN(this.X.vk("html5-subscribe-button-container")); this.U(h,"videodatachange",this.FI);this.FI();this.hide()},q5=function(h){var W=h.B(),c=g.Zx||g.SN?{style:"will-change: opacity"}:void 0,V=W.Y,H=["ytp-videowall-still"]; W.W&&H.push("ytp-videowall-show-text");g.p.call(this,{D:"a",LM:H,J:{href:"{{url}}",target:V?W.T:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},V:[{D:"div",K:"ytp-videowall-still-image",J:{style:"{{background}}"}},{D:"span",K:"ytp-videowall-still-info",J:{"aria-hidden":"true"},V:[{D:"span",K:"ytp-videowall-still-info-bg",V:[{D:"span",K:"ytp-videowall-still-info-content",J:c,V:[{D:"span",K:"ytp-videowall-still-info-title",YN:"{{title}}"}, {D:"span",K:"ytp-videowall-still-info-author",YN:"{{author_and_views}}"},{D:"span",K:"ytp-videowall-still-info-live",YN:"En vivo"},{D:"span",K:"ytp-videowall-still-info-duration",YN:"{{duration}}"}]}]}]},{D:"span",LM:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],J:{"aria-hidden":"true"},V:[{D:"span",K:"ytp-videowall-still-listlabel-icon"},"Playlist",{D:"span",K:"ytp-videowall-still-listlabel-length",V:[" (",{D:"span",YN:"{{playlist_length}}"},")"]}]},{D:"span",LM:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],J:{"aria-hidden":"true"},V:[{D:"span",K:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{D:"span",K:"ytp-videowall-still-listlabel-length",YN:" (50+)"}]}]});this.suggestion=null;this.W=V;this.api=h;this.X=new g.lX(this);g.X(this,this.X);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.X.U(h,"videodatachange",this.onVideoDataChange);h.createServerVe(this.element,this);this.onVideoDataChange()},xi=function(h){Jd.call(this,h,"videowall-endscreen"); var W=this;this.L=h;this.G=0;this.stills=[];this.Y=this.videoData=null;this.N=this.Z=!1;this.T=null;this.W=new g.lX(this);g.X(this,this.W);this.S=new g.oD(function(){g.he(W.element,"ytp-show-tiles")},0); g.X(this,this.S);var c=new g.p({D:"button",LM:["ytp-button","ytp-endscreen-previous"],J:{"aria-label":"Anterior"},V:[g.uw()]});g.X(this,c);c.kN(this.element);c.listen("click",this.PW,this);this.table=new g.cn({D:"div",K:"ytp-endscreen-content"});g.X(this,this.table);this.table.kN(this.element);c=new g.p({D:"button",LM:["ytp-button","ytp-endscreen-next"],J:{"aria-label":"Siguiente"},V:[g.d7()]});g.X(this,c);c.kN(this.element);c.listen("click",this.dw,this);h.getVideoData().iX?this.X=new E3(h,!0):this.X= new ut(h);g.X(this,this.X);g.ge(this.player,this.X.element,4);h.createClientVe(this.element,this,158789);this.hide()},lt=function(h){return g.Df(h.player)&&h.g1()&&!h.Y},nh=function(h){var W=h.XD(); W!==h.Z&&(h.Z=W,HfK(h.player))},lUX=function(h,W){g.p.call(this,{D:"button", LM:["ytp-watch-on-youtube-button","ytp-button"],YN:"{{content}}"});this.L=h;this.buttonType=this.buttonType=W;this.HZ();this.buttonType===2&&g.he(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.HZ);this.pJ(!0)},ji=function(h){Jd.call(this,h,"watch-again-on-youtube-endscreen"); this.watchButton=new lUX(h,1);g.X(this,this.watchButton);this.watchButton.kN(this.element);g.$u6(h)&&(this.X=new g.VO(h),g.X(this,this.X),this.W=new g.p({D:"div",LM:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],J:{tabIndex:"-1"},V:[this.X]}),g.X(this,this.W),this.X.kN(this.W.element),this.W.kN(this.element));h.createClientVe(this.element,this,156914);this.hide()},e7t=function(h){g.K3.call(this,h); var W=this;this.endScreen=null;this.X=this.W=this.G=!1;this.listeners=new g.lX(this);g.X(this,this.listeners);var c=h.B();h.isEmbedsShortsMode()?this.endScreen=new ji(h):np6(h)?(this.G=!0,j5u(this),this.X?this.endScreen=new dq(h):c.j("delhi_modern_endscreen")?this.endScreen=new qKI(h):this.endScreen=new xi(h)):c.tE?this.endScreen=new xFK(h):this.endScreen=new Jd(h);g.X(this,this.endScreen);g.ge(h,this.endScreen.element,4);aUc(this);this.listeners.U(h,"videodatachange",this.onVideoDataChange,this); this.listeners.U(h,g.mZ("endscreen"),function(V){W.onCueRangeEnter(V)}); this.listeners.U(h,g.om("endscreen"),function(V){W.onCueRangeExit(V)})},j5u=function(h){var W=h.player.getVideoData(); if(!W||h.X===W.Aa&&h.W===W.iX)return!1;h.X=W.Aa;h.W=W.iX;return!0},np6=function(h){h=h.B(); return h.U8&&!h.tE&&!h.disableOrganicUi},aUc=function(h){h.player.zw("endscreen"); var W=h.player.getVideoData();W=new g.t$(Math.max((W.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var c=new g.t$(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});h.player.Fi([W,c])}; g.t7.prototype.AZ=g.$5(6,function(){return this.app.AZ()}); g.jw.prototype.AZ=g.$5(5,function(){return this.getVideoData().dc}); g.bc.prototype.Ym=g.$5(4,function(h){this.QX().Ym(h)}); g.kH.prototype.Ym=g.$5(3,function(h){this.N_!==h&&(this.N_=h,this.ym())}); g.n(Bi,g.p);Bi.prototype.select=function(){this.L.Av(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.Oe||void 0)&&this.L.logClick(this.element)}; Bi.prototype.onClick=function(h){g.eY(h,this.L,this.X,this.suggestion.sessionData||void 0)&&this.select()}; Bi.prototype.onKeyPress=function(h){switch(h.keyCode){case 13:case 32:h.defaultPrevented||(this.select(),h.preventDefault())}};g.n(E3,g.p);g.l=E3.prototype;g.l.G_=function(h){this.suggestion!==h&&(this.suggestion=h,g.GP(this.X,h),this.playButton.updateValue("url",this.suggestion.gV()),Rh(this))}; g.l.Lg=function(){return this.G>0}; g.l.n7=function(){this.Lg()||(this.G=Date.now(),JAI(this),Bf6(this.L,dFU(this)),g.$y(this.L.getRootNode(),"countdown-running",this.Lg()))}; g.l.Ph=function(){this.u$();JAI(this);var h=this.X.vk("ytp-autonav-endscreen-upnext-header");h&&g.aY(h,"A continuaci\u00f3n")}; g.l.u$=function(){this.Lg()&&(this.Y.stop(),this.G=0)}; g.l.select=function(h){this.L.nextVideo(!1,h===void 0?!1:h);this.u$()}; g.l.PK=function(h){g.eY(h,this.L)&&(h.currentTarget===this.playButton.element?this.L.logClick(this.playButton.element):h.currentTarget===this.X.vk("ytp-autonav-endscreen-link-container")&&(h=this.X.vk("ytp-autonav-endscreen-link-container"),this.L.logVisibility(h,!0),this.L.logClick(h)),this.N?(this.L.Iz("innertubeCommand",this.N),this.u$()):this.select())}; g.l.u2=function(){this.L.logClick(this.cancelButton.element);g.oo(this.L,!0);this.cancelCommand&&this.L.Iz("innertubeCommand",this.cancelCommand)}; g.l.onVideoDataChange=function(h,W){R7l(this,W);h=W.getWatchNextResponse();var c,V;h=(c=Epc(h))==null?void 0:(V=c.cancelButton)==null?void 0:V.buttonRenderer;this.cancelCommand=h==null?void 0:h.command}; g.l.oNn=function(h){if(G4U(this)){var W=this.L.getVideoData().watchToWatchTransitionRenderer,c=W==null?void 0:W.fromColorPaletteDark;W=W==null?void 0:W.toColorPaletteDark;if(c&&W){var V=this.element;V.style.setProperty("--w2w-start-background-color",g.Ma(c.surgeColor));V.style.setProperty("--w2w-start-primary-text-color",g.Ma(c.primaryTitleColor));V.style.setProperty("--w2w-start-secondary-text-color",g.Ma(c.secondaryTitleColor));V.style.setProperty("--w2w-end-background-color",g.Ma(W.surgeColor)); V.style.setProperty("--w2w-end-primary-text-color",g.Ma(W.primaryTitleColor));V.style.setProperty("--w2w-end-secondary-text-color",g.Ma(W.secondaryTitleColor));V.style.setProperty("--w2w-animation-duration",h+"ms")}g.$y(this.element,"ytp-w2w-animate",!0)}}; g.l.Ob=function(h){this.L.j("web_autonav_color_transition")&&h!==2&&g.$y(this.element,"ytp-w2w-animate",!1)}; g.l.hd=function(){var h=this.L.XD();this.S&&this.Of!==h&&this.pJ(h);Rh(this);this.L.logVisibility(this.container.element,h);this.L.logVisibility(this.cancelButton.element,h);this.L.logVisibility(this.X.vk("ytp-autonav-endscreen-link-container"),h);this.L.logVisibility(this.playButton.element,h)}; g.l.Lp=function(h){return h.width<400||h.height<459};g.n(Jd,g.p);g.l=Jd.prototype;g.l.create=function(){this.created=!0}; g.l.destroy=function(){this.created=!1}; g.l.g1=function(){return!1}; g.l.XD=function(){return!1}; g.l.Z2=function(){return!1};g.n(ut,g.p);g.l=ut.prototype;g.l.O6=function(){this.notification&&(this.Y.stop(),this.v0(this.G),this.G=null,this.notification.close(),this.notification=null)}; g.l.G_=function(h){this.suggestion=h;g.GP(this,h,"hqdefault.jpg")}; g.l.vK=function(){this.pJ(this.api.XD());this.api.logVisibility(this.element,this.api.XD());this.api.logVisibility(this.vk("ytp-upnext-autoplay-icon"),this.api.XD());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.XD())}; g.l.Rzf=function(){window.focus();this.O6()}; g.l.n7=function(h){var W=this;this.Lg()||(g.D8("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.W=(0,g.aC)(),this.X=new g.oD(function(){rAt(W,h)},25),rAt(this,h),Bf6(this.api,ZfI(this,h))); g.cD(this.element,"ytp-upnext-autoplay-paused")}; g.l.hide=function(){g.p.prototype.hide.call(this)}; g.l.Lg=function(){return!!this.X}; g.l.Ph=function(){this.u$();this.W=(0,g.aC)();rAt(this);g.he(this.element,"ytp-upnext-autoplay-paused")}; g.l.u$=function(){this.Lg()&&(this.X.dispose(),this.X=null)}; g.l.select=function(h){h=h===void 0?!1:h;if(this.api.B().j("autonav_notifications")&&h&&window.Notification&&typeof document.hasFocus==="function"){var W=Notification.permission;W==="default"?Notification.requestPermission():W!=="granted"||document.hasFocus()||(this.O6(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.YL()}),this.G=this.U(this.notification,"click",this.Rzf),this.Y.start())}this.u$();this.api.nextVideo(!1,h)}; g.l.Xs=function(h){!g.jk(this.cancelButton.element,h.target)&&g.eY(h,this.api)&&(this.api.XD()&&this.api.logClick(this.vk("ytp-upnext-autoplay-icon")),this.select())}; g.l.l2=function(){this.api.XD()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.oo(this.api,!0)}; g.l.HJk=function(h){this.api.getPresentingPlayerType();this.show();this.n7(h)}; g.l.nZI=function(){this.api.getPresentingPlayerType();this.u$();this.hide()}; g.l.dE=function(){this.u$();this.O6();g.p.prototype.dE.call(this)};g.n(dq,Jd);g.l=dq.prototype;g.l.create=function(){Jd.prototype.create.call(this);this.Y.U(this.player,"appresize",this.aP);this.Y.U(this.player,"onVideoAreaChange",this.aP);this.Y.U(this.player,"videodatachange",this.onVideoDataChange);this.Y.U(this.player,"autonavchange",this.z4);this.Y.U(this.player,"onAutonavCancelled",this.WW);this.onVideoDataChange()}; g.l.show=function(){Jd.prototype.show.call(this);(this.S||this.G&&this.G!==this.videoData.clientPlaybackNonce)&&g.oo(this.player,!1);g.Df(this.player)&&this.g1()&&!this.G?(Gl(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.X.select(!0):this.X.n7():this.videoData.autonavState===3&&this.X.Ph()):(g.oo(this.player,!0),Gl(this));this.aP()}; g.l.hide=function(){Jd.prototype.hide.call(this);this.X.Ph();Gl(this)}; g.l.aP=function(){var h=this.player.Hv(!0,this.player.isFullscreen());Gl(this);Rh(this.W);g.$y(this.element,"ytp-autonav-cancelled-small-mode",this.Lp(h));g.$y(this.element,"ytp-autonav-cancelled-tiny-mode",this.FE(h));g.$y(this.element,"ytp-autonav-cancelled-mini-mode",h.width<=400||h.height<=360);this.overlay&&g.oY(this.overlay.element,{width:h.width+"px"});if(!this.N)for(h=0;h0&&(h= Z*4,q=W<=u-2&&d>=G*4;if((G+1)/Z*V/E>E/(G/(Z+1)*V)&&q)d-=G*4,W+=2;else if(r)d-=Z*4,h+=2;else if(q)d-=G*4,W+=2;else break}V=!1;d>=12&&c*4-d<=6&&(W>=4||h>=4)&&(V=!0);d=h*96;J=W*54;E=d/J=h-2&&G>=W-2?q=1:G%2===0&&u%2===0&&(G<2&&u<2?G===0&&u===0&&(q=2):q=2),Z=g.mq(Z+this.G,c),q!==0){r=this.stills[E];r||(r=new q5(this.player),this.stills[E]=r,B.appendChild(r.element));var x=Math.floor(J*G/W),z=Math.floor(d*u/h),L=Math.floor(J*(G+q)/W)-x-4,M=Math.floor(d*(u+q)/h)-z-4;g.gb(r.element,z,x);g.h3(r.element,M,L);g.oY(r.element,"transitionDelay",(G+u)/20+"s");g.$y(r.element,"ytp-videowall-still-mini", q===1);g.$y(r.element,"ytp-videowall-still-large",q>2);q=Math.max(M,L);g.$y(r.element,"ytp-videowall-still-round-large",q>=256);g.$y(r.element,"ytp-videowall-still-round-medium",q>96&&q<256);g.$y(r.element,"ytp-videowall-still-round-small",q<=96);Z=H[Z];r.suggestion!==Z&&(r.suggestion=Z,q=r.api.B(),x=g.k$(r.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.GP(r,Z,x),g.DE(q)&&!r.api.j("web_player_log_click_before_generating_ve_conversion_params")&&(q=Z.gV(),x={},g.LQ(r.api,"addEmbedsConversionTrackingParams", [x]),q=g.r0(q,x),r.updateValue("url",q)),(Z=(Z=Z.sessionData)&&Z.itct)&&r.api.setTrackingParams(r.element,Z));E++}B.ariaBusy="false";g.$y(this.element,"ytp-endscreen-paginate",E=E;H--)h=this.stills[H],g.nk(h.element),g.hA(h);this.stills.length=E}}; g.l.onVideoDataChange=function(){var h=this.player.getVideoData(1);this.videoData!==h&&(h!=null&&g.jy(h)?(this.G=0,this.videoData=h,this.Vm()):this.player.GV("missg",{vid:(h==null?void 0:h.videoId)||"",cpn:(h==null?void 0:h.clientPlaybackNonce)||""}))}; g.l.dw=function(){this.G+=this.stills.length;this.Vm()}; g.l.PW=function(){this.G-=this.stills.length;this.Vm()}; g.l.Z2=function(){return this.X.Lg()}; g.l.cf=function(h){h===1?(this.N=!1,this.Y=this.videoData.clientPlaybackNonce,this.X.u$(),this.Of&&this.Vm()):(this.N=!0,this.Of&<(this)&&(h===2?this.X.n7():h===3&&this.X.Ph()))}; g.l.Yj=function(h){if(h){for(h=0;h0||h.endSeconds>0||h.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!W)return!0;var c;var V=!!((h==null?0:g.jy(h))||(h==null?0:(c=h.suggestions)==null?0:c.length));V=!np6(this.player)||V;h=h.yX;c=this.player.TX();return V&&!h&&!c&&!W}; g.l.XD=function(){return this.endScreen.XD()}; g.l.Lm=function(){return this.XD()?this.endScreen.Z2():!1}; g.l.dE=function(){this.player.zw("endscreen");g.K3.prototype.dE.call(this)}; g.l.load=function(){var h=this.player.getVideoData();var W=h.transitionEndpointAtEndOfStream;if(W&&W.videoId){var c=this.player.Pi().tq.get("heartbeat"),V=g.jy(h);!V||W.videoId!==V.videoId||h.T8?(this.player.Av(W.videoId,void 0,void 0,!0,!0,W),c&&c.Ii("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),h=!0):h=!1}else h=!1;h||(g.K3.prototype.load.call(this),this.endScreen.show())}; g.l.unload=function(){g.K3.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.l.onCueRangeEnter=function(h){this.Sb()&&(this.endScreen.created||this.endScreen.create(),h.getId()==="load"&&this.load())}; g.l.onCueRangeExit=function(h){h.getId()==="load"&&this.loaded&&this.unload()}; g.l.onVideoDataChange=function(){aUc(this);this.G&&j5u(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.X?this.endScreen=new dq(this.player):this.endScreen=new xi(this.player),g.X(this,this.endScreen),g.ge(this.player,this.endScreen.element,4))};g.i3("endscreen",e7t);})(_yt_player);