(function(g){var window=this;'use strict';var K5=function(a,b){g.U.call(this,{I:"button",Na:["ytp-miniplayer-expand-watch-page-button","ytp-button","ytp-miniplayer-button-top-left"],X:{title:"{{title}}","data-tooltip-target-id":"ytp-miniplayer-expand-watch-page-button","aria-keyshortcuts":"i","data-title-no-tooltip":"{{data-title-no-tooltip}}"},V:[{I:"svg",X:{height:"24px",version:"1.1",viewBox:"0 0 24 24",width:"24px"},V:[{I:"g",X:{fill:"none","fill-rule":"evenodd",stroke:"none","stroke-width":"1"},V:[{I:"g",X:{transform:"translate(12.000000, 12.000000) scale(-1, 1) translate(-12.000000, -12.000000) "}, V:[{I:"path",X:{d:"M19,19 L5,19 L5,5 L12,5 L12,3 L5,3 C3.89,3 3,3.9 3,5 L3,19 C3,20.1 3.89,21 5,21 L19,21 C20.1,21 21,20.1 21,19 L21,12 L19,12 L19,19 Z M14,3 L14,5 L17.59,5 L7.76,14.83 L9.17,16.24 L19,6.41 L19,10 L21,10 L21,3 L14,3 Z",fill:"#fff","fill-rule":"nonzero"}}]}]}]}]});this.J=a;this.listen("click",this.onClick,this);this.updateValue("title",g.fR(a,"Expand","i"));this.update({"data-title-no-tooltip":"Expand"});this.addOnDisposeCallback(g.dR(b.Se(),this.element))},Cjb=function(a){g.U.call(this, {I:"div", S:"ytp-miniplayer-ui"});this.N=this.G=!1;this.player=a;this.T(a,"minimized",this.ph);this.T(a,"onStateChange",this.wea);this.T(a,"documentpictureinpicturechange",this.Laa)},Djb=function(a){var b=a.player.qb().getPlayerSize().width,c=0,d=b; a.player.L("web_cairo_modern_miniplayer")&&!a.N&&(c=12,d=b-24);g.JRa(a.progressBar,c,d,!1);g.EV(a.progressBar)},Ejb=function(a){g.ST.call(this,a); this.B=new g.iE(this);this.j=new Cjb(this.player);this.j.hide();g.oR(this.player,this.j.element,4);a.isMinimized()&&(this.load(),g.Xo(a.getRootNode(),"ytp-player-minimized",!0))}; g.z(K5,g.U);K5.prototype.onClick=function(){this.J.ib("onExpandMiniplayer")};g.z(Cjb,g.U);g.k=Cjb.prototype; g.k.show=function(){this.j=new g.Ko(this.U4,null,this);this.j.start();if(!this.G){this.tooltip=new g.lW(this.player,this);g.P(this,this.tooltip);g.oR(this.player,this.tooltip.element,4);this.tooltip.scale=.6;this.le=new g.OU(this.player);g.P(this,this.le);this.progressBar=new g.DV(this.player,this);g.P(this,this.progressBar);g.oR(this.player,this.progressBar.element,4);this.B=new g.U({I:"div",S:"ytp-miniplayer-scrim"});g.P(this,this.B);this.B.Ja(this.element);this.T(this.B.element,"click",this.A0); var a=new g.U({I:"button",Na:["ytp-miniplayer-close-button","ytp-button"],X:{"aria-label":"Close"},V:[g.mx()]});g.P(this,a);a.Ja(this.B.element);this.T(a.element,"click",this.XU);a=new K5(this.player,this);g.P(this,a);a.Ja(this.B.element);this.C=new g.U({I:"div",S:"ytp-miniplayer-controls"});g.P(this,this.C);this.C.Ja(this.B.element);this.T(this.C.element,"click",this.A0);var b=new g.U({I:"div",S:"ytp-miniplayer-button-container"});g.P(this,b);b.Ja(this.C.element);a=new g.U({I:"div",S:"ytp-miniplayer-play-button-container"}); g.P(this,a);a.Ja(this.C.element);var c=new g.U({I:"div",S:"ytp-miniplayer-button-container"});g.P(this,c);c.Ja(this.C.element);this.Y=new g.yV(this.player,this,!1);g.P(this,this.Y);this.Y.Ja(b.element);b=new g.xV(this.player,this);g.P(this,b);b.Ja(a.element);this.nextButton=new g.yV(this.player,this,!0);g.P(this,this.nextButton);this.nextButton.Ja(c.element);this.K=new g.eW(this.player,this);g.P(this,this.K);this.K.Ja(this.B.element);this.D=new g.U({I:"div",S:"ytp-miniplayer-buttons"});g.P(this,this.D); g.oR(this.player,this.D.element,4);a=new g.U({I:"button",Na:["ytp-miniplayer-close-button","ytp-button"],X:{"aria-label":"Close"},V:[g.mx()]});g.P(this,a);a.Ja(this.D.element);this.T(a.element,"click",this.XU);a=new g.U({I:"button",Na:["ytp-miniplayer-replay-button","ytp-button"],X:{"aria-label":"Close"},V:[g.sx()]});g.P(this,a);a.Ja(this.D.element);this.T(a.element,"click",this.Sba);this.player.L("web_cairo_modern_miniplayer")&&(a=new K5(this.player,this),g.P(this,a),a.Ja(this.D.element));this.T(this.player, "presentingplayerstatechange",this.V4);this.T(this.player,"appresize",this.kc);this.T(this.player,"fullscreentoggled",this.kc);this.player.L("web_cairo_modern_miniplayer")&&this.T(this.player,"onPlaylistUpdate",this.kS);this.kc();this.G=!0}this.player.getPlayerState()!==0&&g.U.prototype.show.call(this);this.progressBar.show();this.player.unloadModule("annotations_module")}; g.k.hide=function(){this.j&&(this.j.dispose(),this.j=void 0);g.U.prototype.hide.call(this);this.player.isMinimized()||(this.G&&this.progressBar.hide(),this.player.loadModule("annotations_module"))}; g.k.xa=function(){this.j&&(this.j.dispose(),this.j=void 0);g.U.prototype.xa.call(this)}; g.k.XU=function(){this.player.stopVideo();this.player.ib("onCloseMiniplayer")}; g.k.Sba=function(){this.player.playVideo()}; g.k.A0=function(a){if(a.target===this.B.element||a.target===this.C.element)this.player.getPlayerStateObject().isOrWillBePlaying()?this.player.pauseVideo():this.player.playVideo()}; g.k.ph=function(){g.Xo(this.player.getRootNode(),"ytp-player-minimized",this.player.isMinimized());this.player.L("web_cairo_modern_miniplayer")&&(g.Xo(this.player.getRootNode(),"ytp-modern-miniplayer",this.player.isMinimized()),this.kS())}; g.k.Laa=function(){g.Xo(this.player.getRootNode(),"ytp-player-minimized",this.player.Ej());g.Xo(this.player.getRootNode(),"ytp-player-document-picture-in-picture",this.player.Ej());this.kS()}; g.k.Dg=function(){this.progressBar.Tc();this.K.Tc()}; g.k.U4=function(){this.Dg();this.j&&this.j.start()}; g.k.V4=function(a){g.Z(a.state,32)&&this.tooltip.hide()}; g.k.kS=function(){this.N=this.player.isMinimized()&&!!this.player.getPlaylist();g.Xo(this.player.getRootNode(),"ytp-has-playlist-data",this.N);Djb(this)}; g.k.kc=function(){Djb(this)}; g.k.wea=function(a){this.player.isMinimized()&&(a===0?this.hide():this.show())}; g.k.Se=function(){return this.tooltip}; g.k.zy=function(a,b,c,d,e){var f=0,h=d=0,l=g.mm(a);if(b){c=g.So(b,"ytp-prev-button")||g.So(b,"ytp-next-button");var m=g.So(b,"ytp-play-button"),n=g.So(b,"ytp-miniplayer-expand-watch-page-button");c?f=h=12:m?(b=g.em(b,this.element),h=b.x,f=b.y-12):n&&(h=g.So(b,"ytp-miniplayer-button-top-left"),f=g.em(b,this.element),b=g.mm(b),h?(h=8,f=f.y+40):(h=f.x-l.width+b.width,f=f.y-20))}else h=c-l.width/2,d=25+(e||0);b=this.player.qb().getPlayerSize().width;e=f+(e||0);l=g.Bd(h,0,b-l.width);e?(a.style.top=e+"px", a.style.bottom=""):(a.style.top="",a.style.bottom=d+"px");a.style.left=l+"px"};g.z(Ejb,g.ST);g.k=Ejb.prototype;g.k.onVideoDataChange=function(){if(this.player.getVideoData()){var a=this.player.getVideoAspectRatio(),b=16/9;a=a>b+.1||a