(function(g){var window=this;'use strict';var Y3=function(a){g.W.call(this,{D:"div",K:"ytp-miniplayer-ui"});this.Pg=!1;this.player=a;this.N(a,"minimized",this.Th);this.N(a,"onStateChange",this.SC)},Z3=function(a){g.aM.call(this,a);
this.i=new Y3(this.player);this.i.hide();g.RL(this.player,this.i.element,4);a.jf()&&(this.load(),g.L(a.getRootNode(),"ytp-player-minimized",!0))};
g.v(Y3,g.W);g.k=Y3.prototype;
g.k.jB=function(){this.tooltip=new g.tP(this.player,this);g.H(this,this.tooltip);g.RL(this.player,this.tooltip.element,4);this.tooltip.scale=.6;this.lc=new g.QM(this.player);g.H(this,this.lc);this.Ze=new g.W({D:"div",K:"ytp-miniplayer-scrim"});g.H(this,this.Ze);this.Ze.xa(this.element);this.N(this.Ze.element,"click",this.tx);var a=new g.W({D:"button",Ba:["ytp-miniplayer-close-button","ytp-button"],U:{"aria-label":"Close"},S:[g.bK()]});g.H(this,a);a.xa(this.Ze.element);this.N(a.element,"click",this.ph);
a=new g.z_(this.player,this);g.H(this,a);a.xa(this.Ze.element);g.S(this.player.T().experiments,"web_inline_player_enabled")&&(a=new g.fP(this.player,this),g.H(this,a),a.xa(this.Ze.element),a=new g.lO(this.player,this),g.H(this,a),a.xa(this.Ze.element));this.Lo=new g.W({D:"div",K:"ytp-miniplayer-controls"});g.H(this,this.Lo);this.Lo.xa(this.Ze.element);this.N(this.Lo.element,"click",this.tx);var b=new g.W({D:"div",K:"ytp-miniplayer-button-container"});g.H(this,b);b.xa(this.Lo.element);a=new g.W({D:"div",
K:"ytp-miniplayer-play-button-container"});g.H(this,a);a.xa(this.Lo.element);var c=new g.W({D:"div",K:"ytp-miniplayer-button-container"});g.H(this,c);c.xa(this.Lo.element);this.jJ=new g.qO(this.player,this,!1);g.H(this,this.jJ);this.jJ.xa(b.element);b=new g.nO(this.player,this);g.H(this,b);b.xa(a.element);this.nextButton=new g.qO(this.player,this,!0);g.H(this,this.nextButton);this.nextButton.xa(c.element);this.Zg=new g.gP(this.player,this);g.H(this,this.Zg);this.Zg.xa(this.Ze.element);this.Dc=new g.vO(this.player,
this);g.H(this,this.Dc);g.RL(this.player,this.Dc.element,4);this.gx=new g.W({D:"div",K:"ytp-miniplayer-buttons"});g.H(this,this.gx);g.RL(this.player,this.gx.element,4);a=new g.W({D:"button",Ba:["ytp-miniplayer-close-button","ytp-button"],U:{"aria-label":"Close"},S:[g.bK()]});g.H(this,a);a.xa(this.gx.element);this.N(a.element,"click",this.ph);a=new g.W({D:"button",Ba:["ytp-miniplayer-replay-button","ytp-button"],U:{"aria-label":"Close"},S:[g.gK()]});g.H(this,a);a.xa(this.gx.element);this.N(a.element,
"click",this.zR);this.N(this.player,"presentingplayerstatechange",this.wc);this.N(this.player,"appresize",this.kb);this.N(this.player,"fullscreentoggled",this.kb);this.kb()};
g.k.show=function(){this.Ed=new g.Zm(this.vp,null,this);this.Ed.start();this.Pg||(this.jB(),this.Pg=!0);0!==this.player.getPlayerState()&&g.W.prototype.show.call(this);this.Dc.show();this.player.unloadModule("annotations_module")};
g.k.hide=function(){this.Ed&&(this.Ed.dispose(),this.Ed=void 0);g.W.prototype.hide.call(this);this.player.jf()||(this.Pg&&this.Dc.hide(),this.player.loadModule("annotations_module"))};
g.k.oa=function(){this.Ed&&(this.Ed.dispose(),this.Ed=void 0);g.W.prototype.oa.call(this)};
g.k.ph=function(){this.player.stopVideo();this.player.La("onCloseMiniplayer")};
g.k.zR=function(){this.player.playVideo()};
g.k.tx=function(a){if(a.target===this.Ze.element||a.target===this.Lo.element)g.S(this.player.T().experiments,"kevlar_miniplayer_play_pause_on_scrim")?g.eJ(this.player.rb())?this.player.pauseVideo():this.player.playVideo():this.player.La("onExpandMiniplayer")};
g.k.Th=function(){g.L(this.player.getRootNode(),"ytp-player-minimized",this.player.jf())};
g.k.Fe=function(){this.Dc.Rb();this.Zg.Rb()};
g.k.vp=function(){this.Fe();this.Ed&&this.Ed.start()};
g.k.wc=function(a){g.V(a.state,32)&&this.tooltip.hide()};
g.k.kb=function(){g.GO(this.Dc,0,this.player.Wa().getPlayerSize().width,!1);g.xO(this.Dc)};
g.k.SC=function(a){this.player.jf()&&(0===a?this.hide():this.show())};
g.k.ac=function(){return this.tooltip};
g.k.Ve=function(){return!1};
g.k.lf=function(){return!1};
g.k.Ai=function(){return!1};
g.k.Qx=function(){};
g.k.Gm=function(){};
g.k.Mq=function(){};
g.k.Tm=function(){return null};
g.k.jj=function(){return new g.Uf(0,0,0,0)};
g.k.handleGlobalKeyDown=function(){return!1};
g.k.handleGlobalKeyUp=function(){return!1};
g.k.Dp=function(a,b,c,d,e){var f=0,h=d=0,l=g.tg(a);if(b){c=g.hn(b,"ytp-prev-button")||g.hn(b,"ytp-next-button");var m=g.hn(b,"ytp-play-button"),n=g.hn(b,"ytp-miniplayer-expand-watch-page-button");c?f=h=12:m?(b=g.rg(b,this.element),h=b.x,f=b.y-12):n&&(h=g.hn(b,"ytp-miniplayer-button-top-left"),f=g.rg(b,this.element),b=g.tg(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.Wa().getPlayerSize().width;e=f+(e||0);l=g.Zd(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.k.showControls=function(){};
g.k.Uk=function(){};
g.k.Bk=function(){return!1};g.v(Z3,g.aM);Z3.prototype.create=function(){};
Z3.prototype.Qi=function(){return!1};
Z3.prototype.load=function(){this.player.hideControls();this.i.show()};
Z3.prototype.unload=function(){this.player.showControls();this.i.hide()};g.gM.miniplayer=Z3;})(_yt_player);
