(self.webpackChunk=self.webpackChunk||[]).push([[2497],{22497:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return k}});var n=i(83094),o=i(53218),a=i(47005),r=i(48734),s=i(78695),l=i(27515),u=i(53754),c=i(71616),d=i(1892),p=i.n(d),f=i(33691);function h(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}p()(f.Z,{insert:"head",singleton:!1}),f.Z.locals,i(78066),i(93462);var x=n.ZP.whichTransitionEvent();function m(){var e=this,t=e.options.parent,i=Math.max(Math.round(D(e)/1e3),0);console.debug("up next seconds remaining: "+i);var n='<span class="upNextDialog-countdownText">'+u.ZP.translate("HeaderSecondsValue",i)+"</span>",o="Episode"===e.itemType?u.ZP.translate("HeaderNextEpisodePlayingInValue",n):u.ZP.translate("HeaderNextVideoPlayingInValue",n);t.querySelector(".upNextDialog-nextVideoText").innerHTML=o}function g(e){var t=this,i=t.options.parent;i.querySelector(".upNextDialog-mediainfo").innerHTML=r.ZP.getPrimaryMediaInfoHtml(e,{criticRating:!1,originalAirDate:!1,starRating:!1,subtitles:!1});var n=c.ZP.getDisplayName(e);e.SeriesName&&(n=e.SeriesName+" - "+n),i.querySelector(".upNextDialog-title").innerHTML=n||"",t.itemType=e.Type,t.show()}function v(e){e._countdownTextTimeout&&(clearInterval(e._countdownTextTimeout),e._countdownTextTimeout=null)}function b(){var e=this.options;if(e){var t=e.player;this.hide(),o.O.nextTrack(t)}}function w(e,t){var i;t.parent.innerHTML=(i="",i+='<div class="flex flex-direction-column flex-grow">',i+='<h2 class="upNextDialog-nextVideoText" style="margin:.25em 0;">&nbsp;</h2>',i+='<h3 class="upNextDialog-title" style="margin:.25em 0 .5em;"></h3>',i+='<div class="flex flex-direction-row upNextDialog-mediainfo">',i+="</div>",i+='<div class="flex flex-direction-row upNextDialog-buttons" style="margin-top:1em;">',i+='<button type="button" is="emby-button" class="raised raised-mini btnStartNow upNextDialog-button">',i+=u.ZP.translate("HeaderStartNow"),i+="</button>",i+='<button type="button" is="emby-button" class="raised raised-mini btnHide upNextDialog-button">',i+=u.ZP.translate("Hide"),i+="</button>",(i+="</div>")+"</div>"),t.parent.classList.add("hide"),t.parent.classList.add("upNextDialog"),t.parent.classList.add("upNextDialog-hidden"),g.call(e,t.nextItem),t.parent.querySelector(".btnHide").addEventListener("click",e.hide.bind(e)),t.parent.querySelector(".btnStartNow").addEventListener("click",b.bind(e))}function y(e,t){var i=e._onHideAnimationComplete;i&&n.ZP.removeEventListener(t,x,i,{once:!0})}function N(e){var t=e.target;t.classList.add("hide"),y(this,t),a.Events.trigger(this,"hide")}function T(){var e=this;if(v(this),e.options){var t=e.options.parent;if(t&&(y(this,t),!t.classList.contains("upNextDialog-hidden"))){t.offsetWidth,t.classList.add("upNextDialog-hidden");var i=N.bind(e);e._onHideAnimationComplete=i,n.ZP.addEventListener(t,x,i,{once:!0})}}}function D(e){var t=e.options;if(t){var i=o.O.duration(t.player);if(i){var n=i-1e4*o.O.currentTime(t.player);return Math.round(n/1e4)}}return 0}var k=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,w(this,t)}var t,i;return t=e,(i=[{key:"show",value:function(){var e,t=this.options.parent;y(this,t),t.classList.remove("hide"),t.offsetWidth,t.classList.remove("upNextDialog-hidden"),s.Z.tv&&setTimeout((function(){l.Z.focus(t.querySelector(".btnStartNow"))}),50),D(e=this)<=0||(m.call(e),v(e),e._countdownTextTimeout=setInterval(m.bind(e),400))}},{key:"hide",value:function(){T.call(this)}},{key:"destroy",value:function(){T.call(this),this.options=null,this.itemType=null}}])&&h(t.prototype,i),e}()},33691:function(e,t,i){"use strict";var n=i(93476),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".upNextContainer{position:fixed;right:0;bottom:0;width:30em;padding:1em;margin:0 2em 2em 0;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;will-change:transform,opacity;transition:opacity .3s ease-out;background-color:rgba(0,0,0,.7);color:#fff;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none}.upNextDialog-hidden{opacity:0}.upNextDialog-countdownText{font-weight:500}.upNextDialog-nextVideoText,.upNextDialog-title{width:25.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.upNextDialog-buttons{width:29.75em;-webkit-justify-content:end;justify-content:end;-webkit-align-content:flex-end;align-content:flex-end}.upNextDialog-button{background:#404040;color:#fff}@media (orientation:landscape){.upNextDialog{-webkit-flex-direction:row;flex-direction:row}}",""]),t.Z=o}}]);