(function(g){var window=this;'use strict';var ptI=function(C,b){C.LO("onAutonavCoundownStarted",b)},Phj=function(C){var b,h,N; return C==null?void 0:(b=C.playerOverlays)==null?void 0:(h=b.playerOverlayRenderer)==null?void 0:(N=h.autoplay)==null?void 0:N.playerOverlayAutoplayRenderer},Pi=function(C,b,h){g.L2(C.element,"ytp-suggestion-set",!!b.videoId); var N=b.playlistId;h=b.Q6(h?h:"mqdefault.jpg");var p=null,P=null;b instanceof g.lW&&(b.lengthText?(p=b.lengthText||null,P=b.Wh||null):b.lengthSeconds&&(p=g.Vt(b.lengthSeconds),P=g.Vt(b.lengthSeconds,!0)));var c=!!N;N=c&&g.Y6(N).type==="RD";var e=b instanceof g.lW?b.isLivePlayback:null,L=b instanceof g.lW?b.isUpcoming:null,Z=b.author,Y=b.shortViewCount,a=b.publishedTimeText,l=[],F=[];Z&&l.push(Z);Y&&(l.push(Y),F.push(Y));a&&F.push(a);h={title:b.title,author:Z,author_and_views:l.join(" \u2022 "),aria_label:b.ariaLabel|| g.lG("Ver $TITLE",{TITLE:b.title}),duration:p,timestamp:P,url:b.CI(),is_live:e,is_upcoming:L,is_list:c,is_mix:N,background:h?"background-image: url("+h+")":"",views_and_publish_time:F.join(" \u2022 "),autoplayAlternativeHeader:b.nB};b instanceof g.aQ&&(h.playlist_length=b.playlistLength);C.update(h)},jj=function(C){var b=C.Y(),h=b.X; g.n.call(this,{B:"a",C:"ytp-autonav-suggestion-card",T:{href:"{{url}}",target:h?b.V:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},U:[{B:"div",J4:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],T:{style:"{{background}}"},U:[{B:"div",T:{"aria-label":"{{timestamp}}"},J4:["ytp-autonav-timestamp"],BE:"{{duration}}"},{B:"div",J4:["ytp-autonav-live-stamp"],BE:"En directo"}, {B:"div",J4:["ytp-autonav-upcoming-stamp"],BE:"Pr\u00f3ximamente"},{B:"div",C:"ytp-autonav-list-overlay",U:[{B:"div",C:"ytp-autonav-mix-text",BE:"Mix"},{B:"div",C:"ytp-autonav-mix-icon"}]}]},{B:"div",J4:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],BE:"{{title}}"},{B:"div",J4:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],BE:"{{author}}"},{B:"div",J4:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],BE:"{{views_and_publish_time}}"}]});this.Z= C;this.suggestion=null;this.j=h;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},ci=function(C,b){b=b===void 0?!1:b; g.n.call(this,{B:"div",C:"ytp-autonav-endscreen-countdown-overlay"});var h=this;this.J=b;this.cancelCommand=this.W=void 0;this.N=0;this.container=new g.n({B:"div",C:"ytp-autonav-endscreen-countdown-container"});g.D(this,this.container);this.container.Gi(this.element);b=C.Y();var N=b.X;this.Z=C;this.suggestion=null;this.onVideoDataChange("newdata",this.Z.getVideoData());this.S(C,"videodatachange",this.onVideoDataChange);this.j=new g.n({B:"div",C:"ytp-autonav-endscreen-upnext-container",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}}"},U:[{B:"div",C:"ytp-autonav-endscreen-upnext-header"},{B:"div",C:"ytp-autonav-endscreen-upnext-alternative-header",BE:"{{autoplayAlternativeHeader}}"},{B:"a",C:"ytp-autonav-endscreen-link-container",T:{href:"{{url}}",target:N?b.V:""},U:[{B:"div",C:"ytp-autonav-endscreen-upnext-thumbnail",T:{style:"{{background}}"},U:[{B:"div",T:{"aria-label":"{{timestamp}}"},J4:["ytp-autonav-timestamp"], BE:"{{duration}}"},{B:"div",J4:["ytp-autonav-live-stamp"],BE:"En directo"},{B:"div",J4:["ytp-autonav-upcoming-stamp"],BE:"Pr\u00f3ximamente"}]},{B:"div",C:"ytp-autonav-endscreen-video-info",U:[{B:"div",C:"ytp-autonav-endscreen-premium-badge"},{B:"div",C:"ytp-autonav-endscreen-upnext-title",BE:"{{title}}"},{B:"div",C:"ytp-autonav-endscreen-upnext-author",BE:"{{author}}"},{B:"div",C:"ytp-autonav-view-and-date",BE:"{{views_and_publish_time}}"},{B:"div",C:"ytp-autonav-author-and-view",BE:"{{author_and_views}}"}]}]}]}); g.D(this,this.j);this.j.Gi(this.container.element);N||this.S(this.j.dO("ytp-autonav-endscreen-link-container"),"click",this.Hf);this.Z.createClientVe(this.container.element,this,115127);this.Z.createClientVe(this.j.dO("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.n({B:"div",C:"ytp-autonav-overlay"});g.D(this,this.overlay);this.overlay.Gi(this.container.element);this.K=new g.n({B:"div",C:"ytp-autonav-endscreen-button-container"});g.D(this,this.K);this.K.Gi(this.container.element); this.cancelButton=new g.n({B:"button",J4:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",b.D("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],T:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},BE:"Cancelar"});g.D(this,this.cancelButton);this.cancelButton.Gi(this.K.element);this.cancelButton.listen("click",this.l9,this);this.Z.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.n({B:"a",J4:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",b.D("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],T:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente v\u00eddeo"},BE:"Ver ahora"});g.D(this,this.playButton);this.playButton.Gi(this.K.element);this.playButton.listen("click",this.Hf,this);this.Z.createServerVe(this.playButton.element,this.playButton,!0);(b=this.Z.getVideoData())&&j9d(this,b);this.X=new g.wl(function(){cee(h)},500); g.D(this,this.X);this.DO();this.S(C,"autonavvisibility",this.DO);this.Z.D("web_autonav_color_transition")&&(this.S(C,"autonavchange",this.fd),this.S(C,"onAutonavCoundownStarted",this.OJh))},kZ=function(C){var b=C.Z.f2(!0,C.Z.isFullscreen()); g.L2(C.container.element,"ytp-autonav-endscreen-small-mode",C.R2(b));g.L2(C.container.element,"ytp-autonav-endscreen-is-premium",!!C.suggestion&&!!C.suggestion.AyE);g.L2(C.Z.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!C.Z.Ie());g.L2(C.Z.getRootNode(),"countdown-running",C.m0());g.L2(C.container.element,"ytp-player-content",C.Z.Ie());g.LV(C.overlay.element,{width:b.width+"px"});if(!C.m0()){C.Z.Ie()?kpp(C,Math.round(eYp(C)/1E3)):kpp(C);b=!!C.suggestion&&!!C.suggestion.nB;var h=C.Z.Ie()|| !b;g.L2(C.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!h&&b);g.L2(C.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",h&&!b);C.K.Kj(C.Z.Ie());g.L2(C.element,"ytp-enable-w2w-color-transitions",LrU(C))}},cee=function(C){var b=eYp(C),h=Math,N=h.min; var p=C.N?Date.now()-C.N:0;h=N.call(h,p,b);kpp(C,Math.ceil((b-h)/1E3));b-h<=500&&C.m0()?C.select(!0):C.m0()&&C.X.start()},eYp=function(C){if(C.Z.isFullscreen()){var b; C=(b=C.Z.getVideoData())==null?void 0:b.Qh;return C===-1||C===void 0?8E3:C}return C.Z.cj()>=0?C.Z.cj():g.Lk(C.Z.Y().experiments,"autoplay_time")||1E4},j9d=function(C,b){b=b.getWatchNextResponse(); var h,N;b=(h=Phj(b))==null?void 0:(N=h.nextButton)==null?void 0:N.buttonRenderer;C.W=b==null?void 0:b.navigationEndpoint;h=b==null?void 0:b.trackingParams;C.playButton&&h&&C.Z.setTrackingParams(C.playButton.element,h)},LrU=function(C){var b; return!((b=C.Z.getVideoData())==null||!b.watchToWatchTransitionRenderer)},kpp=function(C,b){b=b===void 0?-1:b; C=C.j.dO("ytp-autonav-endscreen-upnext-header");g.hW(C);if(b>=0){b=String(b);var h="A continuaci\u00f3n en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],N="A continuaci\u00f3n en $SECONDS".indexOf(h);if(N>=0){C.appendChild(g.CM("A continuaci\u00f3n en $SECONDS".slice(0,N)));var p=g.wk("span");g.p2(p,"ytp-autonav-endscreen-upnext-header-countdown-number");g.PP(p,b);C.appendChild(p);C.appendChild(g.CM("A continuaci\u00f3n en $SECONDS".slice(N+h.length)));return}}g.PP(C,"Siguiente")},ej=function(C,b){g.n.call(this, {B:"div", J4:["html5-endscreen","ytp-player-content",b||"base-endscreen"]});this.created=!1;this.player=C},LH=function(C){g.n.call(this,{B:"div", J4:["ytp-upnext","ytp-player-content"],T:{"aria-label":"{{aria_label}}"},U:[{B:"div",C:"ytp-cued-thumbnail-overlay-image",T:{style:"{{background}}"}},{B:"span",C:"ytp-upnext-top",U:[{B:"span",C:"ytp-upnext-header",BE:"Siguiente"},{B:"span",C:"ytp-upnext-title",BE:"{{title}}"},{B:"span",C:"ytp-upnext-author",BE:"{{author}}"}]},{B:"a",C:"ytp-upnext-autoplay-icon",T:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente v\u00eddeo"},U:[{B:"svg",T:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},U:[{B:"circle",C:"ytp-svg-autoplay-circle",T:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{B:"circle",C:"ytp-svg-autoplay-ring",T:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{B:"path",C:"ytp-svg-fill",T:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{B:"span",C:"ytp-upnext-bottom",U:[{B:"span",C:"ytp-upnext-cancel"},{B:"span",C:"ytp-upnext-paused", BE:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=C;this.cancelButton=null;this.W=this.dO("ytp-svg-autoplay-ring");this.N=this.notification=this.j=this.suggestion=null;this.X=new g.wl(this.Yc,5E3,this);this.K=0;var b=this.dO("ytp-upnext-cancel");this.cancelButton=new g.n({B:"button",J4:["ytp-upnext-cancel-button","ytp-button"],T:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},BE:"Cancelar"});g.D(this,this.cancelButton);this.cancelButton.listen("click", this.tI,this);this.cancelButton.Gi(b);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.D(this,this.X);this.api.createClientVe(this.element,this,18788);b=this.dO("ytp-upnext-autoplay-icon");this.S(b,"click",this.Cd);this.api.createClientVe(b,this,115130);this.JG();this.S(C,"autonavvisibility",this.JG);this.S(C,"mdxnowautoplaying",this.YUz);this.S(C,"mdxautoplaycanceled",this.mof);g.L2(this.element,"ytp-upnext-mobile",this.api.Y().K)},Zb0=function(C,b){if(b)return b; if(C.api.isFullscreen()){var h;C=(h=C.api.getVideoData())==null?void 0:h.Qh;return C===-1||C===void 0?8E3:C}return C.api.cj()>=0?C.api.cj():g.Lk(C.api.Y().experiments,"autoplay_time")||1E4},Yqj=function(C,b){b=Zb0(C,b); var h=Math,N=h.min;var p=(0,g.fB)()-C.K;h=N.call(h,p,b);b=b===0?1:Math.min(h/b,1);C.W.setAttribute("stroke-dashoffset",""+-211*(b+1));b>=1&&C.m0()&&C.api.getPresentingPlayerType()!==3?C.select(!0):C.m0()&&C.j.start()},ZX=function(C){ej.call(this,C,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.n({B:"div",C:"ytp-suggestion-panel",U:[{B:"div",J4:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],BE:"M\u00e1s v\u00eddeos"}]});this.L=new g.n({B:"div",C:"ytp-suggestions-container"});this.videos=[];this.N=null;this.W=this.J=!1;this.K=new ci(this.player);g.D(this,this.K);this.K.Gi(this.element);C.getVideoData().k6?this.j=this.K:(this.j=new LH(C),g.MC(this.player,this.j.element,4),g.D(this,this.j));this.overlay=new g.n({B:"div", C:"ytp-autonav-overlay-cancelled-state"});g.D(this,this.overlay);this.overlay.Gi(this.element);this.X=new g.Jm(this);g.D(this,this.X);g.D(this,this.table);this.table.Gi(this.element);this.table.show();g.D(this,this.L);this.L.Gi(this.table.element);this.hide()},YZ=function(C){var b=C.Ie(); b!==C.W&&(C.W=b,C.player.publish("autonavvisibility"),C.W?(C.K!==C.j&&C.K.hide(),C.table.hide()):(C.K!==C.j&&C.K.show(),C.table.show()))},ap=function(C,b){g.n.call(this,{B:"button", J4:["ytp-watch-on-youtube-button","ytp-button"],BE:"{{content}}"});this.Z=C;this.buttonType=this.buttonType=b;this.BS();this.buttonType===2&&g.j6(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.BS);this.Kj(!0)},lM=function(C,b){ej.call(this,C,"embeds-lite-endscreen"); this.Z=C;this.j=b;this.Z.createClientVe(this.element,this,156943);this.watchButton=new ap(C,2);g.D(this,this.watchButton);this.watchButton.Gi(this.element);this.hide()},ahI=function(C){ej.call(this,C,"subscribecard-endscreen"); this.j=new g.n({B:"div",C:"ytp-subscribe-card",U:[{B:"img",C:"ytp-author-image",T:{src:"{{profilePicture}}"}},{B:"div",C:"ytp-subscribe-card-right",U:[{B:"div",C:"ytp-author-name",BE:"{{author}}"},{B:"div",C:"html5-subscribe-button-container"}]}]});g.D(this,this.j);this.j.Gi(this.element);var b=C.getVideoData();this.subscribeButton=new g.PH("Suscribirme",null,"Anular suscripci\u00f3n",null,!0,!1,b.w8,b.subscribed,"trailer-endscreen",null,C,!1);g.D(this,this.subscribeButton);this.subscribeButton.Gi(this.j.dO("html5-subscribe-button-container")); this.S(C,"videodatachange",this.l$);this.l$();this.hide()},op=function(C){var b=C.Y(),h=g.Am||g.FO?{style:"will-change: opacity"}:void 0,N=b.X,p=["ytp-videowall-still"]; b.K&&p.push("ytp-videowall-show-text");g.n.call(this,{B:"a",J4:p,T:{href:"{{url}}",target:N?b.V:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},U:[{B:"div",C:"ytp-videowall-still-image",T:{style:"{{background}}"}},{B:"span",C:"ytp-videowall-still-info",T:{"aria-hidden":"true"},U:[{B:"span",C:"ytp-videowall-still-info-bg",U:[{B:"span",C:"ytp-videowall-still-info-content",T:h,U:[{B:"span",C:"ytp-videowall-still-info-title",BE:"{{title}}"}, {B:"span",C:"ytp-videowall-still-info-author",BE:"{{author_and_views}}"},{B:"span",C:"ytp-videowall-still-info-live",BE:"En directo"},{B:"span",C:"ytp-videowall-still-info-duration",BE:"{{duration}}"}]}]}]},{B:"span",J4:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],T:{"aria-hidden":"true"},U:[{B:"span",C:"ytp-videowall-still-listlabel-icon"},"Lista de reproducci\u00f3n",{B:"span",C:"ytp-videowall-still-listlabel-length",U:[" (",{B:"span",BE:"{{playlist_length}}"},")"]}]}, {B:"span",J4:["ytp-videowall-still-listlabel-mix","ytp-videowall-still-listlabel"],T:{"aria-hidden":"true"},U:[{B:"span",C:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{B:"span",C:"ytp-videowall-still-listlabel-length",BE:" (50+)"}]}]});this.suggestion=null;this.K=N;this.api=C;this.j=new g.Jm(this);g.D(this,this.j);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.j.S(C,"videodatachange",this.onVideoDataChange);C.createServerVe(this.element,this);this.onVideoDataChange()}, F6=function(C){ej.call(this,C,"videowall-endscreen"); var b=this;this.Z=C;this.N=0;this.stills=[];this.X=this.videoData=null;this.W=this.L=!1;this.V=null;this.K=new g.Jm(this);g.D(this,this.K);this.J=new g.wl(function(){g.j6(b.element,"ytp-show-tiles")},0); g.D(this,this.J);var h=new g.n({B:"button",J4:["ytp-button","ytp-endscreen-previous"],T:{"aria-label":"Anterior"},U:[g.GY()]});g.D(this,h);h.Gi(this.element);h.listen("click",this.Sl,this);this.table=new g.kY({B:"div",C:"ytp-endscreen-content"});g.D(this,this.table);this.table.Gi(this.element);h=new g.n({B:"button",J4:["ytp-button","ytp-endscreen-next"],T:{"aria-label":"Siguiente"},U:[g.Sv()]});g.D(this,h);h.Gi(this.element);h.listen("click",this.u9,this);C.getVideoData().k6?this.j=new ci(C,!0):this.j= new LH(C);g.D(this,this.j);g.MC(this.player,this.j.element,4);C.createClientVe(this.element,this,158789);this.hide()},Gs=function(C){return g.qC(C.player)&&C.Ku()&&!C.X},Sj=function(C){var b=C.Ie(); b!==C.L&&(C.L=b,C.player.publish("autonavvisibility"))},$Z=function(C){ej.call(this,C,"watch-again-on-youtube-endscreen"); this.watchButton=new ap(C,1);g.D(this,this.watchButton);this.watchButton.Gi(this.element);g.oKW(C)&&(this.j=new g.Is(C),g.D(this,this.j),this.K=new g.n({B:"div",J4:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],T:{tabIndex:"-1"},U:[this.j]}),g.D(this,this.K),this.j.Gi(this.K.element),this.K.Gi(this.element));C.createClientVe(this.element,this,156914);this.hide()},Gpe=function(C){g.qK.call(this,C); var b=this;this.endScreen=null;this.K=this.j=this.N=this.X=!1;this.listeners=new g.Jm(this);g.D(this,this.listeners);var h=C.Y(),N=C.getVideoData();N=N&&N.limitedPlaybackDurationInSeconds!==0;g.ew(g.A9(h))&&N&&!g.$z(C)?(this.K=!0,this.endScreen=new lM(C,g.PK(C))):C.isEmbedsShortsMode()?this.endScreen=new $Z(C):lhD(C)?(this.X=!0,oEo(this),this.j?this.endScreen=new ZX(C):this.endScreen=new F6(C)):h.OR?this.endScreen=new ahI(C):this.endScreen=new ej(C);g.D(this,this.endScreen);g.MC(C,this.endScreen.element, 4);FrE(this);this.listeners.S(C,"videodatachange",this.onVideoDataChange,this);this.listeners.S(C,g.gL("endscreen"),function(p){b.onCueRangeEnter(p)}); this.listeners.S(C,g.p8("endscreen"),function(p){b.onCueRangeExit(p)})},oEo=function(C){var b=C.player.getVideoData(); if(!b||C.j===b.xf&&C.N===b.k6)return!1;C.j=b.xf;C.N=b.k6;return!0},lhD=function(C){C=C.Y(); return C.OU&&!C.OR&&!C.disableOrganicUi},FrE=function(C){C.player.Sh("endscreen"); var b=C.player.getVideoData();b=new g.hk(Math.max((b.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var h=new g.hk(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});C.player.A8([b,h])}; g.oC.prototype.cj=g.NW(14,function(){return this.app.cj()}); g.SA.prototype.cj=g.NW(13,function(){return this.getVideoData().RW}); g.Z_.prototype.C6=g.NW(12,function(C){this.pZ().C6(C)}); g.HH.prototype.C6=g.NW(11,function(C){this.j!==C&&(this.j=C,this.l$())}); g.R$.prototype.C6=g.NW(10,function(C){this.overflowButton&&this.overflowButton.C6(C)}); g.Z_.prototype.bb=g.NW(9,function(C){this.pZ().bb(C)}); g.fh.prototype.bb=g.NW(8,function(C){this.K!==C&&(this.K=C,this.l$())}); g.R$.prototype.bb=g.NW(7,function(C){this.shareButton&&this.shareButton.bb(C)}); g.Z_.prototype.Av=g.NW(6,function(C){this.pZ().Av(C)}); g.xj.prototype.Av=g.NW(5,function(C){this.gm!==C&&(this.gm=C,this.B4())}); g.Z_.prototype.Oo=g.NW(4,function(C){this.pZ().Oo(C)}); g.R$.prototype.Oo=g.NW(3,function(C){this.mB!==C&&(this.mB=C,this.wh())});g.S(jj,g.n);jj.prototype.select=function(){this.Z.fk(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.uO||void 0)&&this.Z.logClick(this.element)}; jj.prototype.onClick=function(C){g.T4(C,this.Z,this.j,this.suggestion.sessionData||void 0)&&this.select()}; jj.prototype.onKeyPress=function(C){switch(C.keyCode){case 13:case 32:C.defaultPrevented||(this.select(),C.preventDefault())}};g.S(ci,g.n);g.k=ci.prototype;g.k.mH=function(C){this.suggestion!==C&&(this.suggestion=C,Pi(this.j,C),this.playButton.updateValue("url",this.suggestion.CI()),kZ(this))}; g.k.m0=function(){return this.N>0}; g.k.Z7=function(){this.m0()||(this.N=Date.now(),cee(this),ptI(this.Z,eYp(this)),g.L2(this.Z.getRootNode(),"countdown-running",this.m0()))}; g.k.eb=function(){this.O1();cee(this);var C=this.j.dO("ytp-autonav-endscreen-upnext-header");C&&g.PP(C,"Siguiente")}; g.k.O1=function(){this.m0()&&(this.X.stop(),this.N=0)}; g.k.select=function(C){this.Z.nextVideo(!1,C===void 0?!1:C);this.O1()}; g.k.Hf=function(C){g.T4(C,this.Z)&&(C.currentTarget===this.playButton.element?this.Z.logClick(this.playButton.element):C.currentTarget===this.j.dO("ytp-autonav-endscreen-link-container")&&(C=this.j.dO("ytp-autonav-endscreen-link-container"),this.Z.logVisibility(C,!0),this.Z.logClick(C)),this.W?(this.Z.LO("innertubeCommand",this.W),this.O1()):this.select())}; g.k.l9=function(){this.Z.logClick(this.cancelButton.element);g.G4(this.Z,!0);this.cancelCommand&&this.Z.LO("innertubeCommand",this.cancelCommand)}; g.k.onVideoDataChange=function(C,b){j9d(this,b);C=b.getWatchNextResponse();var h,N;C=(h=Phj(C))==null?void 0:(N=h.cancelButton)==null?void 0:N.buttonRenderer;this.cancelCommand=C==null?void 0:C.command}; g.k.OJh=function(C){if(LrU(this)){var b=this.Z.getVideoData().watchToWatchTransitionRenderer,h=b==null?void 0:b.fromColorPaletteDark;b=b==null?void 0:b.toColorPaletteDark;if(h&&b){var N=this.element;N.style.setProperty("--w2w-start-background-color",g.s8(h.surgeColor));N.style.setProperty("--w2w-start-primary-text-color",g.s8(h.primaryTitleColor));N.style.setProperty("--w2w-start-secondary-text-color",g.s8(h.secondaryTitleColor));N.style.setProperty("--w2w-end-background-color",g.s8(b.surgeColor)); N.style.setProperty("--w2w-end-primary-text-color",g.s8(b.primaryTitleColor));N.style.setProperty("--w2w-end-secondary-text-color",g.s8(b.secondaryTitleColor));N.style.setProperty("--w2w-animation-duration",C+"ms")}g.L2(this.element,"ytp-w2w-animate",!0)}}; g.k.fd=function(C){this.Z.D("web_autonav_color_transition")&&C!==2&&g.L2(this.element,"ytp-w2w-animate",!1)}; g.k.DO=function(){var C=this.Z.Ie();this.J&&this.Bb!==C&&this.Kj(C);kZ(this);this.Z.logVisibility(this.container.element,C);this.Z.logVisibility(this.cancelButton.element,C);this.Z.logVisibility(this.j.dO("ytp-autonav-endscreen-link-container"),C);this.Z.logVisibility(this.playButton.element,C)}; g.k.R2=function(C){return C.width<400||C.height<459};g.S(ej,g.n);g.k=ej.prototype;g.k.create=function(){this.created=!0}; g.k.destroy=function(){this.created=!1}; g.k.Ku=function(){return!1}; g.k.Ie=function(){return!1}; g.k.Tw=function(){return!1};g.S(LH,g.n);g.k=LH.prototype;g.k.Yc=function(){this.notification&&(this.X.stop(),this.D9(this.N),this.N=null,this.notification.close(),this.notification=null)}; g.k.mH=function(C){this.suggestion=C;Pi(this,C,"hqdefault.jpg")}; g.k.JG=function(){this.Kj(this.api.Ie());this.api.logVisibility(this.element,this.api.Ie());this.api.logVisibility(this.dO("ytp-upnext-autoplay-icon"),this.api.Ie());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.Ie())}; g.k.Tn2=function(){window.focus();this.Yc()}; g.k.Z7=function(C){var b=this;this.m0()||(g.cl("a11y-announce","Siguiente "+this.suggestion.title),this.K=(0,g.fB)(),this.j=new g.wl(function(){Yqj(b,C)},25),Yqj(this,C),ptI(this.api,Zb0(this,C))); g.kb(this.element,"ytp-upnext-autoplay-paused")}; g.k.hide=function(){g.n.prototype.hide.call(this)}; g.k.m0=function(){return!!this.j}; g.k.eb=function(){this.O1();this.K=(0,g.fB)();Yqj(this);g.j6(this.element,"ytp-upnext-autoplay-paused")}; g.k.O1=function(){this.m0()&&(this.j.dispose(),this.j=null)}; g.k.select=function(C){C=C===void 0?!1:C;if(this.api.Y().D("autonav_notifications")&&C&&window.Notification&&typeof document.hasFocus==="function"){var b=Notification.permission;b==="default"?Notification.requestPermission():b!=="granted"||document.hasFocus()||(this.Yc(),this.notification=new Notification("Siguiente",{body:this.suggestion.title,icon:this.suggestion.Q6()}),this.N=this.S(this.notification,"click",this.Tn2),this.X.start())}this.O1();this.api.nextVideo(!1,C)}; g.k.Cd=function(C){!g.pM(this.cancelButton.element,C.target)&&g.T4(C,this.api)&&(this.api.Ie()&&this.api.logClick(this.dO("ytp-upnext-autoplay-icon")),this.select())}; g.k.tI=function(){this.api.Ie()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.G4(this.api,!0)}; g.k.YUz=function(C){this.api.getPresentingPlayerType();this.show();this.Z7(C)}; g.k.mof=function(){this.api.getPresentingPlayerType();this.O1();this.hide()}; g.k.wO=function(){this.O1();this.Yc();g.n.prototype.wO.call(this)};g.S(ZX,ej);g.k=ZX.prototype;g.k.create=function(){ej.prototype.create.call(this);this.X.S(this.player,"appresize",this.g1);this.X.S(this.player,"onVideoAreaChange",this.g1);this.X.S(this.player,"videodatachange",this.onVideoDataChange);this.X.S(this.player,"autonavchange",this.Q1);this.X.S(this.player,"onAutonavCancelled",this.b9);this.onVideoDataChange()}; g.k.show=function(){ej.prototype.show.call(this);(this.J||this.N&&this.N!==this.videoData.clientPlaybackNonce)&&g.G4(this.player,!1);g.qC(this.player)&&this.Ku()&&!this.N?(YZ(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.j.select(!0):this.j.Z7():this.videoData.autonavState===3&&this.j.eb()):(g.G4(this.player,!0),YZ(this));this.g1()}; g.k.hide=function(){ej.prototype.hide.call(this);this.j.eb();YZ(this)}; g.k.g1=function(){var C=this.player.f2(!0,this.player.isFullscreen());YZ(this);kZ(this.K);g.L2(this.element,"ytp-autonav-cancelled-small-mode",this.R2(C));g.L2(this.element,"ytp-autonav-cancelled-tiny-mode",this.JE(C));g.L2(this.element,"ytp-autonav-cancelled-mini-mode",C.width<=400||C.height<=360);this.overlay&&g.LV(this.overlay.element,{width:C.width+"px"});if(!this.W)for(C=0;C0&&(C= a*4,F=b<=L-2&&Z>=Y*4;if((Y+1)/a*N/c>c/(Y/(a+1)*N)&&F)Z-=Y*4,b+=2;else if(l)Z-=a*4,C+=2;else if(F)Z-=Y*4,b+=2;else break}N=!1;Z>=12&&h*4-Z<=6&&(b>=4||C>=4)&&(N=!0);Z=C*96;e=b*54;c=Z/e=C-2&&Y>=b-2?F=1:Y%2===0&&L%2===0&&(Y<2&&L<2?Y===0&&L===0&&(F=2):F=2),a=g.kv(a+this.N,h),F!==0){l=this.stills[c];l||(l=new op(this.player),this.stills[c]=l,P.appendChild(l.element));var G=Math.floor(e*Y/b),V=Math.floor(Z*L/C),q=Math.floor(e*(Y+F)/b)-G-4,f=Math.floor(Z*(L+F)/C)-V-4;g.Fo(l.element,V,G);g.zV(l.element,f,q);g.LV(l.element,"transitionDelay",(Y+L)/20+"s");g.L2(l.element,"ytp-videowall-still-mini", F===1);g.L2(l.element,"ytp-videowall-still-large",F>2);F=Math.max(f,q);g.L2(l.element,"ytp-videowall-still-round-large",F>=256);g.L2(l.element,"ytp-videowall-still-round-medium",F>96&&F<256);g.L2(l.element,"ytp-videowall-still-round-small",F<=96);a=p[a];l.suggestion!==a&&(l.suggestion=a,F=l.api.Y(),G=g.P4(l.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",Pi(l,a,G),g.SR(F)&&!l.api.D("web_player_log_click_before_generating_ve_conversion_params")&&(F=a.CI(),G={},g.bv(l.api,"addEmbedsConversionTrackingParams", [G]),F=g.Dh(F,G),l.updateValue("url",F)),(a=(a=a.sessionData)&&a.itct)&&l.api.setTrackingParams(l.element,a));c++}P.ariaBusy="false";g.L2(this.element,"ytp-endscreen-paginate",c=c;p--)C=this.stills[p],g.gQ(C.element),g.kI(C);this.stills.length=c}}; g.k.onVideoDataChange=function(){var C=this.player.getVideoData(1);this.videoData!==C&&(C!=null&&g.dF(C)?(this.N=0,this.videoData=C,this.sF()):this.player.jp("missg",{vid:(C==null?void 0:C.videoId)||"",cpn:(C==null?void 0:C.clientPlaybackNonce)||""}))}; g.k.u9=function(){this.N+=this.stills.length;this.sF()}; g.k.Sl=function(){this.N-=this.stills.length;this.sF()}; g.k.Tw=function(){return this.j.m0()}; g.k.g5=function(C){C===1?(this.W=!1,this.X=this.videoData.clientPlaybackNonce,this.j.O1(),this.Bb&&this.sF()):(this.W=!0,this.Bb&&Gs(this)&&(C===2?this.j.Z7():C===3&&this.j.eb()))}; g.k.i9=function(C){if(C){for(C=0;C0||C.endSeconds>0):C.mutedAutoplay;if((this.player.isEmbedsShortsMode()||this.K)&&!b)return!0;var h;var N=!!((C==null?0:g.dF(C))||(C==null?0:(h=C.suggestions)==null?0:h.length));N=!lhD(this.player)||N;C=C.K5;h=this.player.A0();return N&&!C&&!h&&!b}; g.k.Ie=function(){return this.endScreen.Ie()}; g.k.YXD=function(){return this.Ie()?this.endScreen.Tw():!1}; g.k.wO=function(){this.player.Sh("endscreen");g.qK.prototype.wO.call(this)}; g.k.load=function(){var C=this.player.getVideoData();var b=C.transitionEndpointAtEndOfStream;if(b&&b.videoId){var h=this.player.N8().Nz.get("heartbeat"),N=g.dF(C);!N||b.videoId!==N.videoId||C.qB?(this.player.fk(b.videoId,void 0,void 0,!0,!0,b),h&&h.SR("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),C=!0):C=!1}else C=!1;C||(g.qK.prototype.load.call(this),this.endScreen.show())}; g.k.unload=function(){g.qK.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.k.onCueRangeEnter=function(C){this.Fa()&&(this.endScreen.created||this.endScreen.create(),C.getId()==="load"&&this.load())}; g.k.onCueRangeExit=function(C){C.getId()==="load"&&this.loaded&&this.unload()}; g.k.onVideoDataChange=function(){FrE(this);this.X&&oEo(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.j?this.endScreen=new ZX(this.player):this.endScreen=new F6(this.player),g.D(this,this.endScreen),g.MC(this.player,this.endScreen.element,4))};g.MK("endscreen",Gpe);})(_yt_player);