(function(g){var window=this;'use strict';var KMt=function(n){n.publish("autonavvisibility")},SVL=function(n,q){n.Uq("onAutonavCoundownStarted",q)},ufG=function(n){var q,w,X; return n==null?void 0:(q=n.playerOverlays)==null?void 0:(w=q.playerOverlayRenderer)==null?void 0:(X=w.autoplay)==null?void 0:X.playerOverlayAutoplayRenderer},I3=function(n){var q=n.B(),w=q.W; g.Q.call(this,{J:"a",Y:"ytp-autonav-suggestion-card",U:{href:"{{url}}",target:w?q.L:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},S:[{J:"div",Jg:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],U:{style:"{{background}}"},S:[{J:"div",U:{"aria-label":"{{timestamp}}"},Jg:["ytp-autonav-timestamp"],Ag:"{{duration}}"},{J:"div",Jg:["ytp-autonav-live-stamp"],Ag:"En vivo"}, {J:"div",Jg:["ytp-autonav-upcoming-stamp"],Ag:"Pr\u00f3ximamente"},{J:"div",Y:"ytp-autonav-list-overlay",S:[{J:"div",Y:"ytp-autonav-mix-text",Ag:"Mix"},{J:"div",Y:"ytp-autonav-mix-icon"}]}]},{J:"div",Jg:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Ag:"{{title}}"},{J:"div",Jg:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Ag:"{{author}}"},{J:"div",Jg:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],Ag:"{{views_and_publish_time}}"}]});this.T= n;this.suggestion=null;this.N=w;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},kP=function(n,q){q=q===void 0?!1:q; g.Q.call(this,{J:"div",Y:"ytp-autonav-endscreen-countdown-overlay"});var w=this;this.G=q;this.cancelCommand=this.D=void 0;this.C=0;this.container=new g.Q({J:"div",Y:"ytp-autonav-endscreen-countdown-container"});g.K(this,this.container);this.container.wl(this.element);q=n.B();var X=q.W;this.T=n;this.suggestion=null;this.onVideoDataChange("newdata",this.T.getVideoData());this.j(n,"videodatachange",this.onVideoDataChange);this.N=new g.Q({J:"div",Y:"ytp-autonav-endscreen-upnext-container",U:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},S:[{J:"div",Y:"ytp-autonav-endscreen-upnext-header"},{J:"div",Y:"ytp-autonav-endscreen-upnext-alternative-header",Ag:"{{autoplayAlternativeHeader}}"},{J:"a",Y:"ytp-autonav-endscreen-link-container",U:{href:"{{url}}",target:X?q.L:""},S:[{J:"div",Y:"ytp-autonav-endscreen-upnext-thumbnail",U:{style:"{{background}}"},S:[{J:"div",U:{"aria-label":"{{timestamp}}"},Jg:["ytp-autonav-timestamp"], Ag:"{{duration}}"},{J:"div",Jg:["ytp-autonav-live-stamp"],Ag:"En vivo"},{J:"div",Jg:["ytp-autonav-upcoming-stamp"],Ag:"Pr\u00f3ximamente"}]},{J:"div",Y:"ytp-autonav-endscreen-video-info",S:[{J:"div",Y:"ytp-autonav-endscreen-premium-badge"},{J:"div",Y:"ytp-autonav-endscreen-upnext-title",Ag:"{{title}}"},{J:"div",Y:"ytp-autonav-endscreen-upnext-author",Ag:"{{author}}"},{J:"div",Y:"ytp-autonav-view-and-date",Ag:"{{views_and_publish_time}}"},{J:"div",Y:"ytp-autonav-author-and-view",Ag:"{{author_and_views}}"}]}]}]}); g.K(this,this.N);this.N.wl(this.container.element);X||this.j(this.N.C5("ytp-autonav-endscreen-link-container"),"click",this.xP);this.T.createClientVe(this.container.element,this,115127);this.T.createClientVe(this.N.C5("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.Q({J:"div",Y:"ytp-autonav-overlay"});g.K(this,this.overlay);this.overlay.wl(this.container.element);this.X=new g.Q({J:"div",Y:"ytp-autonav-endscreen-button-container"});g.K(this,this.X);this.X.wl(this.container.element); this.cancelButton=new g.Q({J:"button",Jg:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",q.Z("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],U:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},Ag:"Cancelar"});g.K(this,this.cancelButton);this.cancelButton.wl(this.X.element);this.cancelButton.listen("click",this.GO,this);this.T.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.Q({J:"a",Jg:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",q.Z("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],U:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},Ag:"Reproducir ahora"});g.K(this,this.playButton);this.playButton.wl(this.X.element);this.playButton.listen("click",this.xP,this);this.T.createServerVe(this.playButton.element,this.playButton,!0);(q=this.T.getVideoData())&&BGG(this,q);this.W=new g.YF(function(){QB0(w)},500); g.K(this,this.W);this.PT();this.j(n,"autonavvisibility",this.PT);this.T.Z("web_autonav_color_transition")&&(this.j(n,"autonavchange",this.ZY),this.j(n,"onAutonavCoundownStarted",this.kpP))},rk=function(n){var q=n.T.rd(!0,n.T.isFullscreen()); g.XW(n.container.element,"ytp-autonav-endscreen-small-mode",n.lP(q));g.XW(n.container.element,"ytp-autonav-endscreen-is-premium",!!n.suggestion&&!!n.suggestion.jzW);g.XW(n.T.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!n.T.Mi());g.XW(n.T.getRootNode(),"countdown-running",n.Tn());g.XW(n.container.element,"ytp-player-content",n.T.Mi());g.K$(n.overlay.element,{width:q.width+"px"});if(!n.Tn()){n.T.Mi()?ZFj(n,Math.round(JnD(n)/1E3)):ZFj(n);q=!!n.suggestion&&!!n.suggestion.L8;var w=n.T.Mi()|| !q;g.XW(n.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!w&&q);g.XW(n.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",w&&!q);n.X.bL(n.T.Mi());g.XW(n.element,"ytp-enable-w2w-color-transitions",zCt(n))}},QB0=function(n){var q=JnD(n),w=Math,X=w.min; var P=n.C?Date.now()-n.C:0;w=X.call(w,P,q);ZFj(n,Math.ceil((q-w)/1E3));q-w<=500&&n.Tn()?n.select(!0):n.Tn()&&n.W.start()},JnD=function(n){if(n.T.isFullscreen()){var q; n=(q=n.T.getVideoData())==null?void 0:q.aM;return n===-1||n===void 0?8E3:n}return n.T.nm()>=0?n.T.nm():g.Jv(n.T.B().experiments,"autoplay_time")||1E4},BGG=function(n,q){q=q.getWatchNextResponse(); var w,X;q=(w=ufG(q))==null?void 0:(X=w.nextButton)==null?void 0:X.buttonRenderer;n.D=q==null?void 0:q.navigationEndpoint;w=q==null?void 0:q.trackingParams;n.playButton&&w&&n.T.setTrackingParams(n.playButton.element,w)},zCt=function(n){var q; return!((q=n.T.getVideoData())==null||!q.watchToWatchTransitionRenderer)},ZFj=function(n,q){q=q===void 0?-1:q; n=n.N.C5("ytp-autonav-endscreen-upnext-header");g.U_(n);if(q>=0){q=String(q);var w="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],X="A continuaci\u00f3n, en $SECONDS".indexOf(w);if(X>=0){n.appendChild(g.iX("A continuaci\u00f3n, en $SECONDS".slice(0,X)));var P=g.O_("span");g.zK(P,"ytp-autonav-endscreen-upnext-header-countdown-number");g.mJ(P,q);n.appendChild(P);n.appendChild(g.iX("A continuaci\u00f3n, en $SECONDS".slice(X+w.length)));return}}g.mJ(n,"A continuaci\u00f3n")},j1= function(n,q){g.Q.call(this,{J:"div", Jg:["html5-endscreen","ytp-player-content",q||"base-endscreen"]});this.created=!1;this.player=n},s1=function(n){g.Q.call(this,{J:"div", Jg:["ytp-upnext","ytp-player-content"],U:{"aria-label":"{{aria_label}}"},S:[{J:"div",Y:"ytp-cued-thumbnail-overlay-image",U:{style:"{{background}}"}},{J:"span",Y:"ytp-upnext-top",S:[{J:"span",Y:"ytp-upnext-header",Ag:"A continuaci\u00f3n"},{J:"span",Y:"ytp-upnext-title",Ag:"{{title}}"},{J:"span",Y:"ytp-upnext-author",Ag:"{{author}}"}]},{J:"a",Y:"ytp-upnext-autoplay-icon",U:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},S:[{J:"svg",U:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},S:[{J:"circle",Y:"ytp-svg-autoplay-circle",U:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{J:"circle",Y:"ytp-svg-autoplay-ring",U:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{J:"path",Y:"ytp-svg-fill",U:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{J:"span",Y:"ytp-upnext-bottom",S:[{J:"span",Y:"ytp-upnext-cancel"},{J:"span",Y:"ytp-upnext-paused", Ag:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=n;this.cancelButton=null;this.D=this.C5("ytp-svg-autoplay-ring");this.C=this.notification=this.N=this.suggestion=null;this.W=new g.YF(this.XE,5E3,this);this.X=0;var q=this.C5("ytp-upnext-cancel");this.cancelButton=new g.Q({J:"button",Jg:["ytp-upnext-cancel-button","ytp-button"],U:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},Ag:"Cancelar"});g.K(this,this.cancelButton);this.cancelButton.listen("click", this.Qo,this);this.cancelButton.wl(q);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.K(this,this.W);this.api.createClientVe(this.element,this,18788);q=this.C5("ytp-upnext-autoplay-icon");this.j(q,"click",this.YC);this.api.createClientVe(q,this,115130);this.pF();this.j(n,"autonavvisibility",this.pF);this.j(n,"mdxnowautoplaying",this.MjW);this.j(n,"mdxautoplaycanceled",this.vEf);g.XW(this.element,"ytp-upnext-mobile",this.api.B().X)},WMG=function(n,q){if(q)return q; if(n.api.isFullscreen()){var w;n=(w=n.api.getVideoData())==null?void 0:w.aM;return n===-1||n===void 0?8E3:n}return n.api.nm()>=0?n.api.nm():g.Jv(n.api.B().experiments,"autoplay_time")||1E4},NGt=function(n,q){q=WMG(n,q); var w=Math,X=w.min;var P=(0,g.m$)()-n.X;w=X.call(w,P,q);q=q===0?1:Math.min(w/q,1);n.D.setAttribute("stroke-dashoffset",""+-211*(q+1));q>=1&&n.Tn()&&n.api.getPresentingPlayerType()!==3?n.select(!0):n.Tn()&&n.N.start()},e1=function(n){j1.call(this,n,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.Q({J:"div",Y:"ytp-suggestion-panel",S:[{J:"div",Jg:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Ag:"M\u00e1s videos"}]});this.V=new g.Q({J:"div",Y:"ytp-suggestions-container"});this.videos=[];this.C=null;this.D=this.G=!1;this.X=new kP(this.player);g.K(this,this.X);this.X.wl(this.element);n.getVideoData().VL?this.N=this.X:(this.N=new s1(n),g.Zp(this.player,this.N.element,4),g.K(this,this.N));this.overlay=new g.Q({J:"div", Y:"ytp-autonav-overlay-cancelled-state"});g.K(this,this.overlay);this.overlay.wl(this.element);this.W=new g.Um(this);g.K(this,this.W);g.K(this,this.table);this.table.wl(this.element);this.table.show();g.K(this,this.V);this.V.wl(this.table.element);this.hide()},f3=function(n){var q=n.Mi(); q!==n.D&&(n.D=q,KMt(n.player),n.D?(n.X!==n.N&&n.X.hide(),n.table.hide()):(n.X!==n.N&&n.X.show(),n.table.show()))},nhB=function(n){j1.call(this,n,"videowall-endscreen"); var q=this;this.T=n;this.stills=[];this.C=this.videoData=null;this.W=this.G=!1;this.V=null;g.N4(this.element,"modern-videowall-endscreen");this.X=new g.Um(this);g.K(this,this.X);this.D=new g.YF(function(){g.N4(q.element,"ytp-show-tiles")},0); g.K(this,this.D);this.table=new g.wV({J:"div",Y:"ytp-modern-endscreen-content"});g.K(this,this.table);this.table.wl(this.element);n.getVideoData().VL?this.N=new kP(n,!0):this.N=new s1(n);g.K(this,this.N);g.Zp(this.player,this.N.element,4);n.createClientVe(this.element,this,158789);this.hide()},O1=function(n){return g.JE(n.player)&&n.Ur()&&!n.C},i6=function(n){var q=n.Mi(); q!==n.G&&(n.G=q,KMt(n.player))},qLt=function(n){j1.call(this,n,"subscribecard-endscreen"); this.N=new g.Q({J:"div",Y:"ytp-subscribe-card",S:[{J:"img",Y:"ytp-author-image",U:{src:"{{profilePicture}}"}},{J:"div",Y:"ytp-subscribe-card-right",S:[{J:"div",Y:"ytp-author-name",Ag:"{{author}}"},{J:"div",Y:"html5-subscribe-button-container"}]}]});g.K(this,this.N);this.N.wl(this.element);var q=n.getVideoData();this.subscribeButton=new g.ry("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,q.qY,q.subscribed,"trailer-endscreen",null,n,!1);g.K(this,this.subscribeButton);this.subscribeButton.wl(this.N.C5("html5-subscribe-button-container")); this.j(n,"videodatachange",this.dl);this.dl();this.hide()},Hi=function(n){var q=n.B(),w=g.fT||g.uY?{style:"will-change: opacity"}:void 0,X=q.W,P=["ytp-videowall-still"]; q.X&&P.push("ytp-videowall-show-text");g.Q.call(this,{J:"a",Jg:P,U:{href:"{{url}}",target:X?q.L:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},S:[{J:"div",Y:"ytp-videowall-still-image",U:{style:"{{background}}"}},{J:"span",Y:"ytp-videowall-still-info",U:{"aria-hidden":"true"},S:[{J:"span",Y:"ytp-videowall-still-info-bg",S:[{J:"span",Y:"ytp-videowall-still-info-content",U:w,S:[{J:"span",Y:"ytp-videowall-still-info-title",Ag:"{{title}}"}, {J:"span",Y:"ytp-videowall-still-info-author",Ag:"{{author_and_views}}"},{J:"span",Y:"ytp-videowall-still-info-live",Ag:"En vivo"},{J:"span",Y:"ytp-videowall-still-info-duration",Ag:"{{duration}}"}]}]}]},{J:"span",Jg:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],U:{"aria-hidden":"true"},S:[{J:"span",Y:"ytp-videowall-still-listlabel-icon"},"Playlist",{J:"span",Y:"ytp-videowall-still-listlabel-length",S:[" (",{J:"span",Ag:"{{playlist_length}}"},")"]}]},{J:"span",Jg:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],U:{"aria-hidden":"true"},S:[{J:"span",Y:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{J:"span",Y:"ytp-videowall-still-listlabel-length",Ag:" (50+)"}]}]});this.suggestion=null;this.X=X;this.api=n;this.N=new g.Um(this);g.K(this,this.N);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.N.j(n,"videodatachange",this.onVideoDataChange);n.createServerVe(this.element,this);this.onVideoDataChange()},U1=function(n){j1.call(this,n,"videowall-endscreen"); var q=this;this.T=n;this.C=0;this.stills=[];this.W=this.videoData=null;this.D=this.V=!1;this.L=null;this.X=new g.Um(this);g.K(this,this.X);this.G=new g.YF(function(){g.N4(q.element,"ytp-show-tiles")},0); g.K(this,this.G);var w=new g.Q({J:"button",Jg:["ytp-button","ytp-endscreen-previous"],U:{"aria-label":"Anterior"},S:[g.sD()]});g.K(this,w);w.wl(this.element);w.listen("click",this.UU,this);this.table=new g.wV({J:"div",Y:"ytp-endscreen-content"});g.K(this,this.table);this.table.wl(this.element);w=new g.Q({J:"button",Jg:["ytp-button","ytp-endscreen-next"],U:{"aria-label":"Siguiente"},S:[g.eV()]});g.K(this,w);w.wl(this.element);w.listen("click",this.oA,this);n.getVideoData().VL?this.N=new kP(n,!0):this.N= new s1(n);g.K(this,this.N);g.Zp(this.player,this.N.element,4);n.createClientVe(this.element,this,158789);this.hide()},tp=function(n){return g.JE(n.player)&&n.Ur()&&!n.W},dk=function(n){var q=n.Mi(); q!==n.V&&(n.V=q,KMt(n.player))},w5D=function(n,q){g.Q.call(this,{J:"button", Jg:["ytp-watch-on-youtube-button","ytp-button"],Ag:"{{content}}"});this.T=n;this.buttonType=this.buttonType=q;this.AN();this.buttonType===2&&g.N4(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.AN);this.bL(!0)},gk=function(n){j1.call(this,n,"watch-again-on-youtube-endscreen"); this.watchButton=new w5D(n,1);g.K(this,this.watchButton);this.watchButton.wl(this.element);g.AOG(n)&&(this.N=new g.XH(n),g.K(this,this.N),this.X=new g.Q({J:"div",Jg:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],U:{tabIndex:"-1"},S:[this.N]}),g.K(this,this.X),this.N.wl(this.X.element),this.X.wl(this.element));n.createClientVe(this.element,this,156914);this.hide()},cRf=function(n){g.Lq.call(this,n); var q=this;this.endScreen=null;this.N=this.X=this.C=!1;this.listeners=new g.Um(this);g.K(this,this.listeners);var w=n.B();n.isEmbedsShortsMode()?this.endScreen=new gk(n):X5h(n)?(this.C=!0,Pu5(this),this.N?this.endScreen=new e1(n):w.Z("delhi_modern_endscreen")?this.endScreen=new nhB(n):this.endScreen=new U1(n)):w.yp?this.endScreen=new qLt(n):this.endScreen=new j1(n);g.K(this,this.endScreen);g.Zp(n,this.endScreen.element,4);RHw(this);this.listeners.j(n,"videodatachange",this.onVideoDataChange,this); this.listeners.j(n,g.Aq("endscreen"),function(X){q.onCueRangeEnter(X)}); this.listeners.j(n,g.YS("endscreen"),function(X){q.onCueRangeExit(X)})},Pu5=function(n){var q=n.player.getVideoData(); if(!q||n.N===q.xL&&n.X===q.VL)return!1;n.N=q.xL;n.X=q.VL;return!0},X5h=function(n){n=n.B(); return n.iS&&!n.yp&&!n.disableOrganicUi},RHw=function(n){n.player.wg("endscreen"); var q=n.player.getVideoData();q=new g.og(Math.max((q.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var w=new g.og(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});n.player.Zf([q,w])}; g.bR.prototype.nm=g.Rs(6,function(){return this.app.nm()}); g.yg.prototype.nm=g.Rs(5,function(){return this.getVideoData().tE}); g.GY.prototype.Dr=g.Rs(4,function(n){this.Wl().Dr(n)}); g.wy.prototype.Dr=g.Rs(3,function(n){this.z2!==n&&(this.z2=n,this.LX())}); g.m(I3,g.Q);I3.prototype.select=function(){this.T.q1(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.k$||void 0)&&this.T.logClick(this.element)}; I3.prototype.onClick=function(n){g.gL(n,this.T,this.N,this.suggestion.sessionData||void 0)&&this.select()}; I3.prototype.onKeyPress=function(n){switch(n.keyCode){case 13:case 32:n.defaultPrevented||(this.select(),n.preventDefault())}};g.m(kP,g.Q);g.d=kP.prototype;g.d.zd=function(n){this.suggestion!==n&&(this.suggestion=n,g.O0(this.N,n),this.playButton.updateValue("url",this.suggestion.z1()),rk(this))}; g.d.Tn=function(){return this.C>0}; g.d.iq=function(){this.Tn()||(this.C=Date.now(),QB0(this),SVL(this.T,JnD(this)),g.XW(this.T.getRootNode(),"countdown-running",this.Tn()))}; g.d.Dz=function(){this.f1();QB0(this);var n=this.N.C5("ytp-autonav-endscreen-upnext-header");n&&g.mJ(n,"A continuaci\u00f3n")}; g.d.f1=function(){this.Tn()&&(this.W.stop(),this.C=0)}; g.d.select=function(n){this.T.nextVideo(!1,n===void 0?!1:n);this.f1()}; g.d.xP=function(n){g.gL(n,this.T)&&(n.currentTarget===this.playButton.element?this.T.logClick(this.playButton.element):n.currentTarget===this.N.C5("ytp-autonav-endscreen-link-container")&&(n=this.N.C5("ytp-autonav-endscreen-link-container"),this.T.logVisibility(n,!0),this.T.logClick(n)),this.D?(this.T.Uq("innertubeCommand",this.D),this.f1()):this.select())}; g.d.GO=function(){this.T.logClick(this.cancelButton.element);g.YE(this.T,!0);this.cancelCommand&&this.T.Uq("innertubeCommand",this.cancelCommand)}; g.d.onVideoDataChange=function(n,q){BGG(this,q);n=q.getWatchNextResponse();var w,X;n=(w=ufG(n))==null?void 0:(X=w.cancelButton)==null?void 0:X.buttonRenderer;this.cancelCommand=n==null?void 0:n.command}; g.d.kpP=function(n){if(zCt(this)){var q=this.T.getVideoData().watchToWatchTransitionRenderer,w=q==null?void 0:q.fromColorPaletteDark;q=q==null?void 0:q.toColorPaletteDark;if(w&&q){var X=this.element;X.style.setProperty("--w2w-start-background-color",g.MF(w.surgeColor));X.style.setProperty("--w2w-start-primary-text-color",g.MF(w.primaryTitleColor));X.style.setProperty("--w2w-start-secondary-text-color",g.MF(w.secondaryTitleColor));X.style.setProperty("--w2w-end-background-color",g.MF(q.surgeColor)); X.style.setProperty("--w2w-end-primary-text-color",g.MF(q.primaryTitleColor));X.style.setProperty("--w2w-end-secondary-text-color",g.MF(q.secondaryTitleColor));X.style.setProperty("--w2w-animation-duration",n+"ms")}g.XW(this.element,"ytp-w2w-animate",!0)}}; g.d.ZY=function(n){this.T.Z("web_autonav_color_transition")&&n!==2&&g.XW(this.element,"ytp-w2w-animate",!1)}; g.d.PT=function(){var n=this.T.Mi();this.G&&this.xE!==n&&this.bL(n);rk(this);this.T.logVisibility(this.container.element,n);this.T.logVisibility(this.cancelButton.element,n);this.T.logVisibility(this.N.C5("ytp-autonav-endscreen-link-container"),n);this.T.logVisibility(this.playButton.element,n)}; g.d.lP=function(n){return n.width<400||n.height<459};g.m(j1,g.Q);g.d=j1.prototype;g.d.create=function(){this.created=!0}; g.d.destroy=function(){this.created=!1}; g.d.Ur=function(){return!1}; g.d.Mi=function(){return!1}; g.d.Ra=function(){return!1};g.m(s1,g.Q);g.d=s1.prototype;g.d.XE=function(){this.notification&&(this.W.stop(),this.wM(this.C),this.C=null,this.notification.close(),this.notification=null)}; g.d.zd=function(n){this.suggestion=n;g.O0(this,n,"hqdefault.jpg")}; g.d.pF=function(){this.bL(this.api.Mi());this.api.logVisibility(this.element,this.api.Mi());this.api.logVisibility(this.C5("ytp-upnext-autoplay-icon"),this.api.Mi());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.Mi())}; g.d.wQl=function(){window.focus();this.XE()}; g.d.iq=function(n){var q=this;this.Tn()||(g.zg("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.X=(0,g.m$)(),this.N=new g.YF(function(){NGt(q,n)},25),NGt(this,n),SVL(this.api,WMG(this,n))); g.qX(this.element,"ytp-upnext-autoplay-paused")}; g.d.hide=function(){g.Q.prototype.hide.call(this)}; g.d.Tn=function(){return!!this.N}; g.d.Dz=function(){this.f1();this.X=(0,g.m$)();NGt(this);g.N4(this.element,"ytp-upnext-autoplay-paused")}; g.d.f1=function(){this.Tn()&&(this.N.dispose(),this.N=null)}; g.d.select=function(n){n=n===void 0?!1:n;if(this.api.B().Z("autonav_notifications")&&n&&window.Notification&&typeof document.hasFocus==="function"){var q=Notification.permission;q==="default"?Notification.requestPermission():q!=="granted"||document.hasFocus()||(this.XE(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.EF()}),this.C=this.j(this.notification,"click",this.wQl),this.W.start())}this.f1();this.api.nextVideo(!1,n)}; g.d.YC=function(n){!g.gr(this.cancelButton.element,n.target)&&g.gL(n,this.api)&&(this.api.Mi()&&this.api.logClick(this.C5("ytp-upnext-autoplay-icon")),this.select())}; g.d.Qo=function(){this.api.Mi()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.YE(this.api,!0)}; g.d.MjW=function(n){this.api.getPresentingPlayerType();this.show();this.iq(n)}; g.d.vEf=function(){this.api.getPresentingPlayerType();this.f1();this.hide()}; g.d.Xf=function(){this.f1();this.XE();g.Q.prototype.Xf.call(this)};g.m(e1,j1);g.d=e1.prototype;g.d.create=function(){j1.prototype.create.call(this);this.W.j(this.player,"appresize",this.Td);this.W.j(this.player,"onVideoAreaChange",this.Td);this.W.j(this.player,"videodatachange",this.onVideoDataChange);this.W.j(this.player,"autonavchange",this.Aj);this.W.j(this.player,"onAutonavCancelled",this.ji);this.onVideoDataChange()}; g.d.show=function(){j1.prototype.show.call(this);(this.G||this.C&&this.C!==this.videoData.clientPlaybackNonce)&&g.YE(this.player,!1);g.JE(this.player)&&this.Ur()&&!this.C?(f3(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.N.select(!0):this.N.iq():this.videoData.autonavState===3&&this.N.Dz()):(g.YE(this.player,!0),f3(this));this.Td()}; g.d.hide=function(){j1.prototype.hide.call(this);this.N.Dz();f3(this)}; g.d.Td=function(){var n=this.player.rd(!0,this.player.isFullscreen());f3(this);rk(this.X);g.XW(this.element,"ytp-autonav-cancelled-small-mode",this.lP(n));g.XW(this.element,"ytp-autonav-cancelled-tiny-mode",this.j_(n));g.XW(this.element,"ytp-autonav-cancelled-mini-mode",n.width<=400||n.height<=360);this.overlay&&g.K$(this.overlay.element,{width:n.width+"px"});if(!this.D)for(n=0;n0&&(n= O*4,U=q<=r-2&&e>=f*4;if((f+1)/O*X/c>c/(f/(O+1)*X)&&U)e-=f*4,q+=2;else if(H)e-=O*4,n+=2;else if(U)e-=f*4,q+=2;else break}X=!1;e>=12&&w*4-e<=6&&(q>=4||n>=4)&&(X=!0);e=n*96;k=q*54;c=e/k=n-2&&f>=q-2?U=1:f%2===0&&r%2===0&&(f<2&&r<2?f===0&&r===0&&(U=2):U=2),O=g.Ko(O+this.C,w),U!==0){H=this.stills[c];H||(H=new Hi(this.player),this.stills[c]=H,R.appendChild(H.element));var t=Math.floor(k*f/q),V=Math.floor(e*r/n),T=Math.floor(k*(f+U)/q)-t-4,x=Math.floor(e*(r+U)/n)-V-4;g.JU(H.element,V,t);g.n1(H.element,x,T);g.K$(H.element,"transitionDelay",(f+r)/20+"s");g.XW(H.element,"ytp-videowall-still-mini", U===1);g.XW(H.element,"ytp-videowall-still-large",U>2);U=Math.max(x,T);g.XW(H.element,"ytp-videowall-still-round-large",U>=256);g.XW(H.element,"ytp-videowall-still-round-medium",U>96&&U<256);g.XW(H.element,"ytp-videowall-still-round-small",U<=96);O=P[O];H.suggestion!==O&&(H.suggestion=O,U=H.api.B(),t=g.Wt(H.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.O0(H,O,t),g.Q2(U)&&!H.api.Z("web_player_log_click_before_generating_ve_conversion_params")&&(U=O.z1(),t={},g.p0(H.api,"addEmbedsConversionTrackingParams", [t]),U=g.OV(U,t),H.updateValue("url",U)),(O=(O=O.sessionData)&&O.itct)&&H.api.setTrackingParams(H.element,O));c++}R.ariaBusy="false";g.XW(this.element,"ytp-endscreen-paginate",c=c;P--)n=this.stills[P],g.dr(n.element),g.wM(n);this.stills.length=c}}; g.d.onVideoDataChange=function(){var n=this.player.getVideoData(1);this.videoData!==n&&(n!=null&&g.dY(n)?(this.C=0,this.videoData=n,this.a8()):this.player.p5("missg",{vid:(n==null?void 0:n.videoId)||"",cpn:(n==null?void 0:n.clientPlaybackNonce)||""}))}; g.d.oA=function(){this.C+=this.stills.length;this.a8()}; g.d.UU=function(){this.C-=this.stills.length;this.a8()}; g.d.Ra=function(){return this.N.Tn()}; g.d.LJ=function(n){n===1?(this.D=!1,this.W=this.videoData.clientPlaybackNonce,this.N.f1(),this.xE&&this.a8()):(this.D=!0,this.xE&&tp(this)&&(n===2?this.N.iq():n===3&&this.N.Dz()))}; g.d.IA=function(n){if(n){for(n=0;n0||n.endSeconds>0||n.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!q)return!0;var w;var X=!!((n==null?0:g.dY(n))||(n==null?0:(w=n.suggestions)==null?0:w.length));X=!X5h(this.player)||X;n=n.Uu;w=this.player.f7();return X&&!n&&!w&&!q}; g.d.Mi=function(){return this.endScreen.Mi()}; g.d.Pq=function(){return this.Mi()?this.endScreen.Ra():!1}; g.d.Xf=function(){this.player.wg("endscreen");g.Lq.prototype.Xf.call(this)}; g.d.load=function(){var n=this.player.getVideoData();var q=n.transitionEndpointAtEndOfStream;if(q&&q.videoId){var w=this.player.fM().RS.get("heartbeat"),X=g.dY(n);!X||q.videoId!==X.videoId||n.i4?(this.player.q1(q.videoId,void 0,void 0,!0,!0,q),w&&w.m0("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),n=!0):n=!1}else n=!1;n||(g.Lq.prototype.load.call(this),this.endScreen.show())}; g.d.unload=function(){g.Lq.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.d.onCueRangeEnter=function(n){this.gW()&&(this.endScreen.created||this.endScreen.create(),n.getId()==="load"&&this.load())}; g.d.onCueRangeExit=function(n){n.getId()==="load"&&this.loaded&&this.unload()}; g.d.onVideoDataChange=function(){RHw(this);this.C&&Pu5(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.N?this.endScreen=new e1(this.player):this.endScreen=new U1(this.player),g.K(this,this.endScreen),g.Zp(this.player,this.endScreen.element,4))};g.vb("endscreen",cRf);})(_yt_player);