text: /*! youtube.com: v1.5.0 (webpack: v1.10.1) */
  !function(e){function t(n){if(i[n])return i[n].exports;var s=i[n]={exports:{},id:n,loaded:!1};return e[n].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";function n(){var e,t=-1!==["AuraHD2","AuraHD3","AuraHD8","MAG254","MAG275","MAG276","WR320"].indexOf(d.deviceModel());i(3).token&&(r.data.metrics.mainMenuSize-=2);try{c.init([i(50),i(53),i(52),i(54),i(51)]),r.emit("ready"),c.pages.forEach(function(e){e.emit("load")})}catch(n){}o=i(44),s=new(i(31))({$node:document.getElementById("exitMessage"),events:{keydown:function(e){e.code===l.ok?r.exit():(e.code===l.back||e.code===l.exit)&&(e.stop=!0,s.$node.style.visibility="hidden",a.focus())}}}),s.$body.classList.add("modalExit"),s.$node.style.visibility="hidden",s.$header.innerHTML=gettext("Exit from app?"),s.$content.innerHTML="",s.$footer.innerHTML="",s.$content.appendChild(e=document.createElement("div")),e.innerText=gettext("Ok"),e.className="btn confirm"+(t?" old":""),s.$content.appendChild(e=document.createElement("div")),e.className="btn back"+(t?" old":""),e.innerText=gettext("Cancel"),s.$footer.innerHTML="",c.navigate("pm")}var s,o,a,r=i(4),l=i(1),c=i(2),d=i(21),u=i(12),h=i(24);i(47),r.show=function(){stbWindowMgr.windowShow(r.data.windowId)},r.exit=function(){d.saveUserData(h.settingsFile,JSON.stringify(r.settings)),r.player&&r.player.stop(),window.parent!==window?("pp"===c.current.id&&c.back(),window.parent.postMessage("hide","*")):window.location.href=i(60)()||"file:///home/web/services.html"},r.reload=function(){d.saveUserData(h.settingsFile,JSON.stringify(r.settings)),r.player.stop(),location.reload()},r.addListeners({load:function(){var e,t=i(3),s=i(10);window.parent!==window&&window.parent.postMessage("show","*"),d.setVKButtonState(!1),d.setAppButtonState(!0),d.setServiceButtonState(!0);try{r.settings=JSON.parse(d.loadUserData(h.settingsFile))}catch(o){r.settings=!1}r.settings||(r.settings=h.defaultSettings,d.saveUserData(h.settingsFile,JSON.stringify(r.settings))),r.params=i(59)(location.search.substring(1));for(e in h.defaultSettings)void 0===r.settings[e]&&(r.settings[e]=h.defaultSettings[e]);if(i(29).addListener("load",function(){r.languageIndex=s.languageIndex,r.settings.language=u.languages[r.languageIndex],document.documentElement.dir=u.directions[r.languageIndex],"rtl"===document.documentElement.dir&&(l.left=39,l.right=37),r.params.apiKey&&r.params.apiClientId&&r.params.apiSecret&&(r.settings.customCredenitals={key:[r.params.apiKey],clientId:[r.params.apiClientId],secret:[r.params.apiSecret]}),t.init({credentialsIndex:r.settings.credentialsIndex,customCredenitals:r.settings.customCredenitals}).then(n,n)["catch"](function(e){})}),r.settings.languageOverwrite)s.setLang(r.settings.language);else try{r.settings.language=JSON.parse(d.getEnv('{"varList":["language"]}')).result.language}finally{s.setLang(r.settings.language)}gSTB.SetInputLang(r.settings.language)},unload:function(){d.saveUserData(h.settingsFile,JSON.stringify(r.settings)),r.player.stop()},keydown:function(e){if(e.code===l.exit)window.parent!==window?r.exit():(a=c.current.activeComponent,s.$node.style.visibility="visible",s.focus());else if(o)switch(e.code){case l.volumeUp:case l.volumeDown:case l.mute:o.changeVolume(e.code)}},message:function(e){"show"===e.message&&r.show(),"exit"===e.message&&stbWebWindow.close()}}),d.setNativeStringMode(!0)},function(e,t,i){"use strict";e.exports={back:8,"delete":46,channelPrev:1009,channelNext:9,ok:13,exit:27,up:38,down:40,left:37,right:39,pageUp:33,pageDown:34,end:35,home:36,volumeUp:107,volumeDown:109,f1:112,f2:113,f3:114,f4:115,refresh:116,frame:117,phone:119,set:120,tv:121,menu:122,web:123,mic:2032,rewind:2066,forward:2070,app:2076,usbMounted:2080,usbUnmounted:2081,playPause:2082,stop:2083,power:2085,record:2087,info:2089,mute:2192,clock:2032,audio:2071,keyboard:2076}},function(e,t,i){"use strict";var n,s=i(6);n=new s,n.current=null,n.history=[],n.pages=[],n.ids={},n.init=function(e){var t,i,n;if(e){for(this.pages=[],this.pages=e,t=0,i=e.length;i>t;t++)n=e[t],this.ids[n.id]=n,n.active&&(this.current=n);return this.events.init&&this.emit("init",{pages:e}),!0}return!1},n.parse=function(e){var t={name:"",data:[]};return t.data=e.split("/").map(decodeURIComponent),t.name=t.data.shift().slice(1),t},n.stringify=function(e,t){return t=Array.isArray(t)?t:[],e=encodeURIComponent(e),t=t.map(encodeURIComponent),t.unshift(e),t.join("/")},n.show=function(e,t){return e&&!e.active?(e.$node.classList.add("active"),e.active=!0,this.current=e,e.events.show&&e.emit("show",{page:e,data:t}),!0):!1},n.hide=function(e){return e&&e.active?(e.$node.classList.remove("active"),e.active=!1,this.current=null,e.events.hide&&e.emit("hide",{page:e}),!0):!1},n.navigate=function(e,t){var i=this.current,n=this.ids[e];return n&&!n.active?(location.hash=this.stringify(e,t),this.hide(this.current),this.show(n,t),this.events.navigate&&this.emit("navigate",{from:i,to:n}),this.history.push(n),!0):!1},n.back=function(){var e,t;return this.history.length>1&&(e=this.history.pop(),t=this.history[this.history.length-1],t&&!t.active)?(location.hash=t.id,this.hide(this.current),this.show(t),this.events.navigate&&this.emit("navigate",{from:e,to:t}),!0):!1},e.exports=n},function(e,t,i){"use strict";function n(e,t){return Math.floor(Math.random()*(t-e+1))+e}function s(){return u.request("GET","guideCategories?part=snippet").then(function(e){var t=new XMLHttpRequest;return t.open("GET","config.json"),l(t).then(function(t){var i={};return t=JSON.parse(t),t=Object.keys(t.categories),e=JSON.parse(e).items,e.forEach(function(e){i[e.id]={id:e.id,title:e.snippet.title,value:e.snippet.title,icon:d[e.id]}}),t.forEach(function(e){u.categories.push(i[e])}),u.token?u.request("GET","subscriptions?part=snippet&mine=true&maxResults=50").then(function(e){e=JSON.parse(e).items,e.forEach(function(e){u.subscriptions.push({id:e.snippet.resourceId.channelId,value:e.snippet.title,title:e.snippet.title,icon:e.snippet.thumbnails["default"].url})})},function(){}):void 0})["catch"](function(){return e=JSON.parse(e).items,e.splice(1,1),e.forEach(function(e){u.categories.push({id:e.id,title:e.snippet.title,value:e.snippet.title,icon:d[e.id]})}),u.token?u.request("GET","subscriptions?part=snippet&mine=true&maxResults=50").then(function(e){e=JSON.parse(e).items,e.forEach(function(e){u.subscriptions.push({id:e.snippet.resourceId.channelId,value:e.snippet.title,title:e.snippet.title,icon:e.snippet.thumbnails["default"].url})})},function(){}):void 0})})["catch"](function(e,t){})}function o(e){return new r(function(t,i){var n=new XMLHttpRequest;return e.refreshToken?(n.open("POST","https://accounts.google.com/o/oauth2/token"),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.onload=function(){200===this.status?(u.token=JSON.parse(this.responseText).access_token,u.refreshToken=o,t()):(u.token=!1,u.refreshToken=!1,i(this.status))},n.onerror=function(){u.token=!1,u.refreshToken=!1,i(this.status)},void n.send("client_id="+u.credenitals.clientId[u.credentialsIndex]+"&client_secret="+u.credenitals.secret[u.credentialsIndex]+"&grant_type=refresh_token&refresh_token="+e.refreshToken)):e.sessionToken?(u.token=e.sessionToken,void t()):void i()})}var a=i(4),r=i(8),l=i(49),c=i(12),d=i(45),u={credenitals:{key:["AIzaSyCs3nDE08_3R5K2T1Bx22kpM30F7YG7oas","AIzaSyB0R6yyvCfQtGiQO3QnBdA80ETEXP95q4U","AIzaSyB4q-29BnTe_HzBNN721CqQDrO4adNwVyc","AIzaSyBB4Tz3Ri_J1VEXi9PQcYUlMbKlxX5eXUY"],clientId:["1043905621618-7ucc82n1tftafbcle61d9bbo2o9m5fsl.apps.googleusercontent.com","566362027879-qtd61rknt0uib4ot5lk3etpbpgevqfds.apps.googleusercontent.com","455766416355-rqacpj1ekjiae2gkq9jd18af8p2npss8.apps.googleusercontent.com","374361881839-al94hukaoe16seafjo7i266b45p2u4gf.apps.googleusercontent.com"],secret:["iiqucIR3wJXnsEaZa4D8eDGo","891QVeNchJlSoJilE1c8QyGc","69x9MTMlc1PDgddxDwGgYJuA","JVrZN38438O8BU6cgiVrmH_-"]},categories:[],subscriptions:[],playlists:[],BASE_URL:"https://www.googleapis.com/youtube/v3/",APP_DOMAIN:"http://tubb.zz.mu/oathcallback.html",AUTH_URL:"",credentialsIndex:0,token:!1,refreshToken:!1,activeKey:"",staticUrl:"",request:function(e,t,i){var n=this;return new r(function(s,o){var r=new XMLHttpRequest;r.open(e,n.BASE_URL+t+n.staticUrl),r.setRequestHeader("Accept","application/json"),r.setRequestHeader("Content-Type","application/json"),n.token&&r.setRequestHeader("Authorization","Bearer "+n.token),r.onload=function(){200===this.status?s(this.responseText):401===this.status?(u.token=!1,a.settings.sessionToken=!1,o(this.status)):o(this.statusText)},r.onerror=function(){o()},r.send(i)})}};u.init=function(e){var t=this;return e.customCredenitals?(this.credenitals=e.customCredenitals,this.credentialsIndex=n(0,this.credenitals.key.length-1)):"number"==typeof e.credentialsIndex&&-1!==e.credentialsIndex?this.credentialsIndex=e.credentialsIndex:this.credentialsIndex=n(0,this.credenitals.key.length-1),this.activeKey=this.credenitals.key[this.credentialsIndex],this.AUTH_URL="https://accounts.google.com/o/oauth2/auth?approval_prompt=force&response_type=code&scope=https://www.googleapis.com/auth/youtube.force-ssl&access_type=offline&redirect_uri="+this.APP_DOMAIN+"&client_id="+this.credenitals.clientId[this.credentialsIndex],this.staticUrl="&key="+this.activeKey+"&hl="+c.locales[a.languageIndex]+"&regionCode="+c.regions[a.languageIndex],o(a.settings).then(function(){return s()},function(){return t.credentialsIndex===e.credentialsIndex&&(t.credentialsIndex=n(0,t.credenitals.key.length-1)),t.activeKey=t.credenitals.key[t.credentialsIndex],t.AUTH_URL="https://accounts.google.com/o/oauth2/auth?response_type=code&scope=https://www.googleapis.com/auth/youtube.force-ssl&access_type=offline&redirect_uri="+t.APP_DOMAIN+"&client_id="+t.credenitals.clientId[t.credentialsIndex],s()})["catch"](function(e){})},u.postAuth=function(e){var t=this;return new r(function(i,n){var s=new XMLHttpRequest;e||n(),s.open("POST","https://www.googleapis.com/oauth2/v3/token"),s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.onload=function(){200===this.status?(t.token=JSON.parse(this.responseText),t.refreshToken=t.token.refresh_token,t.token=t.token.access_token,i({refreshToken:t.refreshToken,sessionToken:t.token})):(t.token=!1,t.refreshToken=!1,n(this.status))},s.onerror=function(){t.token=!1,t.refreshToken=!1,n(this.status)},s.send("code="+e+"&client_id="+t.credenitals.clientId[t.credentialsIndex]+"&client_secret="+t.credenitals.secret[t.credentialsIndex]+"&grant_type=authorization_code&redirect_uri="+t.APP_DOMAIN)})},u.normalizeVideoDuration=function(e){var t,i,n,s=new Date(0);return e=e.replace("PT","").replace("S","").split("M"),e.length>1?(e[0]=e[0].split("H"),e[0].length>1?(s.setUTCHours(e[0][0]),s.setUTCMinutes(e[0][1])):s.setUTCMinutes(e[0]),s.setUTCSeconds(e[1]),n=e[1]):(s.setUTCSeconds(e[0]),n=e[0]),t=s.getUTCHours(),i=s.getUTCMinutes(),10>n&&(n||(n="0"),n="0"+n),t>1&&10>i&&(i="0"+i),1>t?t="":10>t&&(t="0"+t+":"),t+i+":"+n},e.exports=u},function(e,t,i){"use strict";var n,s,o=i(55),a=i(2),r=i(1),l={};i(57),window.parent&&window.parent.gSTB&&(window.dvbManager=window.parent.dvbManager,window.epgManager=window.parent.epgManager,window.gSTB=window.parent.gSTB,window.pvrManager=window.parent.pvrManager,window.stbDownloadManager=window.parent.stbDownloadManager,window.stbStorage=window.parent.stbStorage,window.stbUpdate=window.parent.stbUpdate,window.stbUPnP=window.parent.stbUPnP,window.stbWebWindow=window.parent.stbWebWindow,window.stbWindowMgr=window.parent.stbWindowMgr,window.timeShift=window.parent.timeShift),n=new o({debug:!1,host:!0,screen:null,time:{init:+new Date,load:0,done:0}}),n.setScreen=function(e){var t;return e?(e.availHeight=e.height-(e.availTop+e.availBottom),e.availWidth=e.width-(e.availLeft+e.availRight),window.moveTo(0,0),window.resizeTo(e.width,e.height),t=document.querySelector("link[rel=stylesheet]"),t&&t instanceof HTMLLinkElement&&document.head.removeChild(t),t=document.createElement("link"),t.rel="stylesheet",t.href="css/release."+e.height+".css?"+ +new Date,document.head.appendChild(t),this.data.metrics=e,!0):!1},n.EVENT_END_OF_FILE=1,n.EVENT_GET_MEDIA_INFO=2,n.EVENT_PLAYBACK_BEGIN=4,n.EVENT_CONTENT_ERROR=5,n.EVENT_DUAL_MONO_DETECT=6,n.EVENT_INFO_GET=7,n.EVENT_SUBTITLE_LOAD_ERROR=8,n.EVENT_SUBTITLE_FIND=9,n.EVENT_HDMI_CONNECT=32,n.EVENT_HDMI_DISCONNECT=33,n.EVENT_RECORD_FINISH_SUCCESSFULL=34,n.EVENT_RECORD_FINISH_ERROR=35,n.EVENT_DVB_SCANING=40,n.EVENT_DVB_FOUND=41,n.EVENT_DVB_CHANELL_EPG_UPDATE=42,n.EVENT_DVB_ANTENNA_OFF=43,n.setScreen(i(65)[screen.height]);for(s in r)"volumeUp"!==s&&"volumeDown"!==s&&(l[r[s]]=!0);n.defaultEvents={load:function(e){n.data.time.load=e.timeStamp,n.events[e.type]&&n.emit(e.type,e),a.pages.forEach(function(t){t.events[e.type]&&t.emit(e.type,e)}),n.data.time.done=+new Date,n.events.done&&n.emit("done",e)},unload:function(e){n.events[e.type]&&n.emit(e.type,e),a.pages.forEach(function(t){t.events[e.type]&&t.emit(e.type,e)})},error:function(e){},keydown:function(e){var t,i=a.current;0!==e.keyCode&&(e.code=e.keyCode,e.shiftKey&&(e.code+=1e3),e.altKey&&(e.code+=2e3),t=i.activeComponent,t&&t!==i&&(t.events[e.type]&&t.emit(e.type,e),!e.stop&&t.propagate&&t.parent&&t.parent.events[e.type]&&t.parent.emit(e.type,e)),e.stop||(i.events[e.type]&&i.emit(e.type,e),e.stop||n.events[e.type]&&n.emit(e.type,e)),n.data.host&&l[e.code]&&"InputNative"!==t.constructor.name&&e.preventDefault())},keypress:function(e){var t=a.current;t.activeComponent&&t.activeComponent!==t&&t.activeComponent.events[e.type]&&t.activeComponent.emit(e.type,e)},click:function(e){},contextmenu:function(e){e.preventDefault()},mousewheel:function(e){var t=a.current;t.activeComponent&&t.activeComponent!==t&&t.activeComponent.events[e.type]&&t.activeComponent.emit(e.type,e),e.stop||t.events[e.type]&&t.emit(e.type,e)}};for(s in n.defaultEvents)window.addEventListener(s,n.defaultEvents[s]);window.stbEvent={},window.stbEvent.onEvent=function(e,t){if(Array.prototype.forEach.call(window.frames,function(i){i.stbEvent&&i.stbEvent.onEvent&&i.stbEvent.onEvent(e,t)}),n.events.media){if(t)try{t=JSON.parse(t)}catch(i){}n.emit("media",{code:parseInt(e,10),info:t})}},window.stbEvent.onBroadcastMessage=function(e,t,i){Array.prototype.forEach.call(window.frames,function(n){n.stbEvent&&n.stbEvent.onBroadcastMessage&&n.stbEvent.onBroadcastMessage(e,t,i)}),n.events.message&&n.emit("message",{broadcast:!0,windowId:e,message:t,data:i})},window.stbEvent.onMessage=function(e,t,i){Array.prototype.forEach.call(window.frames,function(n){n.stbEvent&&n.stbEvent.onMessage&&n.stbEvent.onMessage(e,t,i)}),n.events.message&&n.emit("message",{broadcast:!1,windowId:e,message:t,data:i})},window.stbEvent.onMount=function(e){Array.prototype.forEach.call(window.frames,function(t){t.stbEvent&&t.stbEvent.onMount&&t.stbEvent.onMount(e)}),n.events["device:mount"]&&n.emit("device:mount",{state:e})},window.stbEvent.onMediaAvailable=function(e,t){Array.prototype.forEach.call(window.frames,function(i){i.stbEvent&&i.stbEvent.onMediaAvailable&&i.stbEvent.onMediaAvailable(e,t)}),n.events["media:available"]&&n.emit("media:available",{mime:e,url:t})},window.stbEvent.onNetworkStateChange=function(e){n.events["internet:state"]&&n.emit("internet:state",{state:e})},window.stbEvent.onWebBrowserProgress=function(e){Array.prototype.forEach.call(window.frames,function(t){t.stbEvent&&t.stbEvent.onWebBrowserProgress&&t.stbEvent.onWebBrowserProgress(e)}),n.events["browser:progress"]&&n.emit("browser:progress",{progress:e})},window.stbEvent.onWindowActivated=function(){Array.prototype.forEach.call(window.frames,function(e){e.stbEvent&&e.stbEvent.onWindowActivated&&e.stbEvent.onWindowActivated()}),n.events["window:focus"]&&n.emit("window:focus")},window.gSTB&&gSTB.SetNativeStringMode&&gSTB.SetNativeStringMode(!0),e.exports=n},function(e,t,i){"use strict";function n(e){var t,i=this;if(e=e||{},this.visible=!0,this.focusable=!0,this.$node=null,this.$body=null,this.parent=null,this.children=[],this.propagate=!!e.propagate,s.call(this,e.data),this.$node=e.$node||document.createElement("div"),this.$body=e.$body||this.$node,this.$node.className+=" component "+(e.className||""),this.id=e.id||this.$node.id||"cid"+a++,e.parent&&e.parent.add(this),e.visible===!1&&this.hide(),e.focusable===!1&&(this.focusable=!1),this.defaultEvents){e.events=e.events||{};for(t in this.defaultEvents)e.events[t]=e.events[t]||this.defaultEvents[t]}e.events&&this.addListeners(e.events),e.children&&this.add.apply(this,e.children),this.$node.addEventListener("click",function(e){0===e.button&&(i.focus(),i.events.click&&i.emit("click",{event:e})),e.stopPropagation()})}var s=i(6),o=i(2),a=0;n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.defaultEvents=null,n.prototype.add=function(e){var t;for(t=0;t<arguments.length;t++)e=arguments[t],this.children.push(e),e.parent=this,e.$node&&null===e.$node.parentNode&&this.$body.appendChild(e.$node),this.events.add&&this.emit("add",{item:e});return e},n.prototype.remove=function(){this.parent&&(o.current.activeComponent===this&&(this.blur(),this.parent.focus()),this.parent.children.splice(this.parent.children.indexOf(this),1)),this.children.forEach(function(e){e.remove()}),this.removeAllListeners(),this.$node.parentNode.removeChild(this.$node),this.events.remove&&this.emit("remove")},n.prototype.focus=function(e){var t=o.current,i=t.activeComponent;return this.focusable&&this!==i?(i&&i.blur(),t.activeComponent=i=this,i.$node.classList.add("focus"),i.events.focus&&i.emit("focus",e),!0):!1},n.prototype.blur=function(){var e=o.current,t=e.activeComponent;return this.$node.classList.remove("focus"),this===t?(e.activeComponent=null,this.events.blur&&this.emit("blur"),!0):!1},n.prototype.show=function(e){return this.visible?!0:(this.$node.classList.remove("hidden"),this.visible=!0,this.events.show&&this.emit("show",e),!0)},n.prototype.hide=function(){return this.visible?(this.$node.classList.add("hidden"),this.visible=!1,this.events.hide&&this.emit("hide"),!0):!0},e.exports=n},function(e,t,i){"use strict";function n(){this.events={}}n.prototype={addListener:function(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)},once:function(e,t){var i=this;this.events[e]=this.events[e]||[],this.events[e].push(function n(s){t(s),i.removeListener(e,n)})},addListeners:function(e){var t;if("object"==typeof e)for(t in e)e.hasOwnProperty(t)&&this.addListener(t,e[t])},removeListener:function(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(function(e){return e!==t}),0===this.events[e].length&&(this.events[e]=void 0))},removeAllListeners:function(e){0===arguments.length?this.events={}:e&&(this.events[e]=void 0)},emit:function(e,t){var i,n=this.events[e];if(n)for(i=0;i<n.length;i++)n[i].call(this,t)}},n.prototype.constructor=n,e.exports=n},function(e,t,i){"use strict";function n(e){e=e||{},this.$focusItem=null,this.viewIndex=null,this.data=[],this.type=this.TYPE_VERTICAL,this.size=5,this.cycle=!1,this.scroll=null,e.type&&(this.type=e.type),e.className="list "+(e.className||""),this.type===this.TYPE_HORIZONTAL&&(e.className+=" horizontal"),o.call(this,e),this.init(e)}function s(e){var t,i;for(t=0;t<e.length;t++)i=e[t],"object"!=typeof i&&(i=e[t]={value:e[t]});return e}var o=i(5),a=i(1);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,n.prototype.TYPE_VERTICAL=1,n.prototype.TYPE_HORIZONTAL=2,n.prototype.renderItemDefault=function(e,t){e.innerText=t.value},n.prototype.renderItem=n.prototype.renderItemDefault,n.prototype.defaultEvents={mousewheel:function(e){this.type===this.TYPE_VERTICAL&&e.wheelDeltaY&&this.move(e.wheelDeltaY>0?a.up:a.down),this.type===this.TYPE_HORIZONTAL&&e.wheelDeltaX&&this.move(e.wheelDeltaX>0?a.left:a.right)},keydown:function(e){switch(e.code){case a.up:case a.down:case a.right:case a.left:case a.pageUp:case a.pageDown:case a.home:case a.end:this.move(e.code);break;case a.ok:this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e})}}},n.prototype.init=function(e){var t,i,n=this,o=this.$body.children.length,a=function(e){this.data&&(n.focusItem(this),n.events["click:item"]&&n.emit("click:item",{$item:this,event:e}))};if(void 0!==e.cycle&&(this.cycle=e.cycle),e.scroll&&(this.scroll=e.scroll),e.data&&(this.data=s(e.data)),e.render&&(this.renderItem=e.render),e.size&&(this.size=e.size),this.size!==o)for(o>0&&(this.$body.innerText=null),i=0;i<this.size;i++)t=document.createElement("div"),t.index=i,t.className="item",t.addEventListener("click",a),this.$body.appendChild(t);void 0!==e.viewIndex,this.viewIndex=null,void 0!==e.focusIndex?this.focusIndex(e.focusIndex):this.renderView(e.viewIndex||0)},n.prototype.renderView=function(e){var t,i,n,s,o;if(this.viewIndex!==e){for(s=this.viewIndex,this.viewIndex=o=e,i=0;i<this.size;i++)t=this.$body.children[i],n=this.data[e],n?(t.data=n,t.index=e,this.renderItem(t,n),n.mark?t.classList.add("mark"):t.classList.remove("mark")):(t.data=t.index=void 0,t.innerHTML="&nbsp;"),e++;return this.events["move:view"]&&this.emit("move:view",{prevIndex:s,currIndex:o}),this.events["select:item"]&&this.emit("select:item",{$item:t}),this.scroll&&this.scroll.scrollTo(this.viewIndex),!0}return!1},n.prototype.move=function(e){(e===a.up&&this.type===this.TYPE_VERTICAL||e===a.left&&this.type===this.TYPE_HORIZONTAL)&&(this.$focusItem&&this.$focusItem.index>0?this.$focusItem===this.$body.firstChild?this.renderView(this.viewIndex-1):this.focusItem(this.$focusItem.previousSibling):this.cycle?(this.move(a.end),this.events.cycle&&this.emit("cycle",{direction:e})):this.events.overflow&&this.emit("overflow",{direction:e})),(e===a.down&&this.type===this.TYPE_VERTICAL||e===a.right&&this.type===this.TYPE_HORIZONTAL)&&(this.$focusItem&&this.$focusItem.index<this.data.length-1?this.$focusItem===this.$body.lastChild?this.renderView(this.viewIndex+1):this.focusItem(this.$focusItem.nextSibling):this.cycle?(this.move(a.home),this.events.cycle&&this.emit("cycle",{direction:e})):this.events.overflow&&this.emit("overflow",{direction:e})),e===a.pageUp&&(this.viewIndex<this.size?this.renderView(0):this.renderView(this.viewIndex-this.size+1),this.focusItem(this.$body.firstChild)),e===a.pageDown&&(this.data.length>this.size?(this.viewIndex>this.data.length-2*this.size?this.renderView(this.data.length-this.size):this.renderView(this.viewIndex+this.size-1),this.focusItem(this.$body.lastChild)):this.focusItem(this.$body.children[this.data.length-1])),e===a.home&&(this.renderView(0),this.focusItem(this.$body.firstChild)),e===a.end&&(this.data.length>this.size?(this.renderView(this.data.length-this.size),this.focusItem(this.$body.lastChild)):this.focusItem(this.$body.children[this.data.length-1]))},n.prototype.focusItem=function(e){var t=this.$focusItem;return e&&t!==e?(null!==t&&(t.classList.remove("focus"),this.events["blur:item"]&&this.emit("blur:item",{$item:t})),this.$focusItem=e,this.$focusItem.data=this.data[this.$focusItem.index],e.classList.add("focus"),this.events["focus:item"]&&this.emit("focus:item",{$prev:t,$curr:e}),this.events["select:item"]&&this.emit("select:item",{$item:e}),!0):!1},n.prototype.focusIndex=function(e){var t=this.viewIndex||0;e>=t+this.size?(e=e<this.data.length-1?e:this.data.length-1,this.renderView(e-this.size+1),this.focusItem(this.$body.lastChild)):t>e?(e=e>0?e:0,this.renderView(e),this.focusItem(this.$body.firstChild)):(null===this.viewIndex&&this.renderView(0),this.focusItem(this.$body.children[e-t]))},n.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=n},function(e,t,i){"use strict";function n(e){this.state=null,this.value=null,this.deferreds=[],d(e,s(a,this),s(r,this))}function s(e,t){return function(){e.apply(t,arguments)}}function o(e){var t=this;return null===this.state?void this.deferreds.push(e):void setTimeout(function(){var i,n=t.state?e.onFulfilled:e.onRejected;if(null===n)return void(t.state?e.resolve:e.reject)(t.value);try{i=n(t.value)}catch(s){return void e.reject(s)}e.resolve(i)})}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void d(s(t,e),s(a,this),s(r,this))}this.state=!0,this.value=e,l.call(this)}catch(i){r.call(this,i)}}function r(e){this.state=!1,this.value=e,l.call(this)}function l(){var e,t;for(e=0,t=this.deferreds.length;t>e;e++)o.call(this,this.deferreds[e]);this.deferreds=null}function c(e,t,i,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=i,this.reject=n}function d(e,t,i){var n=!1;try{e(function(e){n||(n=!0,t(e))},function(e){n||(n=!0,i(e))})}catch(s){if(n)return;n=!0,i(s)}}n.prototype["catch"]=function(e){return this.then(null,e)},n.prototype.then=function(e,t){var i=this;return new n(function(n,s){o.call(i,new c(e,t,n,s))})},n.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&Array.isArray(arguments[0])?arguments[0]:arguments);return new n(function(t,i){function n(s,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var r=a.then;if("function"==typeof r)return void r.call(a,function(e){n(s,e)},i)}e[s]=a,0===--o&&t(e)}catch(l){i(l)}}var s,o=e.length;if(0===e.length)return t([]);for(s=0;s<e.length;s++)n(s,e[s])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(t){t(e)})},n.reject=function(e){return new n(function(t,i){i(e)})},n.race=function(e){return new n(function(t,i){for(var n=0,s=e.length;s>n;n++)e[n].then(t,i)})},e.exports=window.Promise||n},function(e,t,i){"use strict";function n(){l&&(o.$node.style.backgroundImage="url("+c[r].src+")",++r,4===r&&(r=0)),a=setTimeout(n,200)}var s=i(23),o=new s({$node:document.getElementById("loaderWidget"),visible:!1}),a=-1,r=0,l=!1,c=[];!function(){var e=4;["img/loader/1.png","img/loader/2.png","img/loader/3.png","img/loader/4.png"].forEach(function(t){var i=new Image;i.src=t,i.onload=function(){--e,0===e&&(l=!0)},c.push(i)})}(),o.show=function(e){return this.visible?!0:(this.$node.classList.remove("hidden"),this.visible=!0,void 0!==this.events.show&&this.emit("show",e),a=setTimeout(n,200),!0)},o.hide=function(){return r=1,clearTimeout(a),this.visible?(this.$node.classList.add("hidden"),this.visible=!1,void 0!==this.events.hide&&this.emit("hide"),!0):!0},e.exports=o},function(e,t,i){"use strict";var n=i(12),s=i(24);e.exports={languageIndex:0,nextLang:function(e){return e===n.languages.length-1?0:++e},setLang:function(e){var t=this;i(29).load({name:e},function(i){i?t.languageIndex=-1:t.languageIndex=n.languages.indexOf(e),-1===t.languageIndex&&(t.languageIndex=n.languages.indexOf(s.defaultSettings.language))})}}},function(e,t,i){"use strict";function n(e){e=e||{},e.focusable=e.focusable||!1,e.className="panel "+(e.className||""),s.call(this,e)}var s=i(5);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n},function(e,t){"use strict";e.exports={active:!0,languages:["en","ru","uk","de","ar"],languagesLocalized:["English","Русский","Українська","Deutch","Arabian"],locales:["en-US","ru-RU","uk-UA","de-DE","ar-EG"],regions:["US","RU","UA","DE","EG"],directions:["ltr","ltr","ltr","ltr","rtl"],fromCode:"UTF-8",addComments:"gettext",indent:!1,noLocation:!0,noWrap:!0,sortOutput:!0,sortByFile:!1,verbose:!1}},function(e,t,i){"use strict";function n(e){var t=this;this.model=null,this.activePage=0,this.$title=null,this.loading=!1,e.visible=!1,e.data=[{id:"",value:"",publishedAt:"",icon:"",duration:"",title:"",channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],o.call(t,e),this.$node.classList.add("movieList"),this.$body.classList.add("movieListBody"),void 0!==e.$title&&(this.$title=e.$title,this.$title.classList.add("movieListHeader")),void 0!==e.model&&(this.model=e.model,this.model.addListener("content:changed",function(){t.model.getPage({page:0,count:50}).then(function(e){t.activePage=0,t.data=e,t.viewIndex=null,t.renderView(0),t.focusIndex(0),t.emit("view:ready")},function(e){t.emit("view:error",e)})["catch"](function(e){})}))}var s=i(1),o=i(7);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,n.prototype.renderView=function(e){var t,i,n,s,o;if(this.viewIndex!==e){for(s=this.viewIndex,this.viewIndex=o=e,i=0;i<this.size;i++)t=this.$body.children[i],n=this.data[e],void 0!==n?(t.data=n,t.index=e,this.renderItem(t,n),n.mark?t.classList.add("mark"):t.classList.remove("mark")):(t.data=t.index=void 0,t.innerHTML="",t.ready=!1),e++;return void 0!==this.events["move:view"]&&this.emit("move:view",{prevIndex:s,currIndex:o}),!0}return!1},n.prototype.renderItem=function(e,t){var i,n,s;e.ready?(e.$videoThumb.style.backgroundImage="url("+t.icon+")",e.$videoDuration.innerText=t.duration,e.$videoTitle.innerText=t.title,e.$videoAthour.innerText=t.locale.channelTitle,e.$viewCounter.innerText=t.locale.viewCount,e.$dateAdded.innerText=t.locale.publishedAt):(i=document.createElement("div"),i.className="container",e.appendChild(i),n=document.createElement("div"),n.className="tileTop",i.appendChild(n),s=document.createElement("div"),s.className="tileBottom",i.appendChild(s),e.$videoThumb=document.createElement("div"),e.$videoThumb.className="thumb",e.$videoThumb.style.backgroundImage="url("+t.icon+")",n.appendChild(e.$videoThumb),e.$videoDuration=document.createElement("div"),e.$videoDuration.className="duration",e.$videoDuration.innerText=t.duration,n.appendChild(e.$videoDuration),e.$videoTitle=document.createElement("div"),e.$videoTitle.className="title",e.$videoTitle.innerText=t.title,s.appendChild(e.$videoTitle),e.$videoAthour=document.createElement("div"),e.$videoAthour.className="uploader",t.channelTitle&&(e.$videoAthour.innerText=t.locale.channelTitle),s.appendChild(e.$videoAthour),e.$viewCounter=document.createElement("div"),e.$viewCounter.className="viewCount",t.viewCount&&(e.$viewCounter.innerText=t.locale.viewCount),s.appendChild(e.$viewCounter),e.$dateAdded=document.createElement("div"),e.$dateAdded.className="uploaded",e.$dateAdded.innerText=t.locale.publishedAt,s.appendChild(e.$dateAdded),e.ready=!0)},n.prototype.defaultEvents.keydown=function(e){if(!this.loading)switch(e.code){case s.right:this.$focusItem.index<this.data.length-1&&(this.$focusItem.index>0?(this.activePage++,this.renderView(this.activePage)):this.focusIndex(1));break;case s.left:this.activePage>0?(this.activePage--,this.renderView(this.activePage)):this.move(e.code);break;case s.ok:void 0!==this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e})}},e.exports=n},function(e,t,i){"use strict";var n,s=i(1),o=i(4),a=i(7),r=i(26);n=new a({$node:window.pmListMainMenu,$body:window.pmListMainMenuBody,data:r.content.data,size:o.data.metrics.mainMenuSize,focusIndex:r.content.focusIndex,render:function(e,t){e.ready||(e.$icon=document.createElement("span"),e.appendChild(e.$icon),e.$label=document.createElement("span"),e.appendChild(e.$label),e.ready=!0),t.type===r.types.CATEGORY_ITEM?(e.$icon.className=t.className||"image",e.$icon.style.backgroundImage=t.icon?"url("+t.icon+")":"none",e.$label.className="itemLabel",e.$label.innerHTML=t.value):t.type===r.types.CATEGORY_HEADER&&(e.$icon.className="",e.$label.className="categorylabel",e.$label.innerHTML=t.value)},visible:!1,events:{keydown:function(e){switch(e.code){case s.right:this.hide(),r.content.tabs[r.activeTab].activate();break;case s.up:case s.down:case s.pageUp:case s.pageDown:case s.home:case s.end:this.move(e.code);break;case s.ok:this.emit("click:item",{$item:this.$focusItem,event:e})}},"click:item":function(e){this.hide(),"function"==typeof e.$item.data.onclick?(r.content.tabs[r.activeTab].activate(e.$item.data),e.$item.data.onclick()):(r.content.tabs[r.activeTab].hide(),r.activeTab=e.$item.data.tabIndex,r.content.tabs[r.activeTab].activate(e.$item.data))},focus:function(){this.show()},blur:function(){this.hide()}}}),n.move=function(e){var t=null,i=null;e===s.up&&this.$focusItem&&this.$focusItem.index>0&&(this.$focusItem===this.$body.firstChild?i=this.viewIndex-1:t=this.$focusItem.previousSibling),
  e===s.down&&this.$focusItem&&this.$focusItem.index<this.data.length-1&&(this.$focusItem===this.$body.lastChild?i=this.viewIndex+1:t=this.$focusItem.nextSibling),e===s.pageUp&&(i=this.viewIndex<this.size?0:this.viewIndex-this.size+1,t=this.$body.firstChild),e===s.pageDown&&(this.data.length>this.size?(i=this.viewIndex>this.data.length-2*this.size?this.data.length-this.size:this.viewIndex+this.size-1,t=this.$body.lastChild):t=this.$body.children[this.data.length-1]),e===s.home&&(i=0,t=this.$body.firstChild),e===s.end&&(this.data.length>this.size?(i=this.data.length-this.size,t=this.$body.lastChild):t=this.$body.children[this.data.length-1]),null!==i&&this.renderView(i),null!==t&&this.focusItem(t),this.$focusItem.data.disabled&&(this.$focusItem.index>0?this.move(e):e===s.up&&this.move(s.down))},e.exports=n},function(e,t,i){"use strict";var n,s=i(23),o=new s({$node:document.getElementById("widgetHintButtons"),visible:!1}),a={BACK:document.getElementById("hintBack"),SEARCH:document.getElementById("hintSearch"),MORE:document.getElementById("hintMore"),GUIDE:document.getElementById("hintGuide")};for(n in a)a[n].$icon=a[n].appendChild(document.createElement("div")),a[n].$label=a[n].appendChild(document.createElement("div")),a[n].$label.className="hintText";o.updateView=function(e,t){var i;this.show();for(i in e)e.hasOwnProperty(i)&&(e[i].visible?(a[i].$icon.className="ico "+e[i].icon,a[i].style.display="",a[i].$label.innerHTML=e[i].text):a[i].style.display="none");t?o.$node.className="component widget "+t:o.$node.className="component widget"},e.exports=o},function(e,t,i){"use strict";function n(e){e=e||{},this.active=!1,this.activeComponent=null,e.className="page "+(e.className||""),s.call(this,e),this.active=this.$node.classList.contains("active"),null===this.$node.parentNode&&document.body.appendChild(this.$node),this.page=this}var s=i(5);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,i){"use strict";var n=i(8),s=i(6),o=i(3),a=i(19),r=new s;r.activeCategory={},r.pages={},r.ownChannel=null,r.cacheKey=function(e){return"c:"+e.category.id+";p:"+e.page},r.getPage=function(e){var t,i,s=this;return e.page=+e.page||0,e.category=e.category||this.activeCategory,new n(function(n,r){if(t=a.get(s.cacheKey(e)))n(t);else{if(i="channels?part=snippet&categoryId="+e.category.id+"&maxResults="+e.count,e.page){if(!s.pages[e.page])return s.activeCategory.totalResults===e.page?void r("overflow"):void r("no page");i+="&pageToken="+s.pages[e.page]}o.request("GET",i).then(function(t){var i,o,r=[];for(t=JSON.parse(t),t.pageInfo.totalResults&&(s.activeCategory.totalResults=t.pageInfo.totalResults),t.nextPageToken&&(s.pages[e.page+1]=t.nextPageToken),t.prevPageToken&&(s.pages[e.page-1]=t.prevPageToken),t=t.items,o=t.length,i=0;o>i;++i)r.push({value:t[i].id,id:t[i].id,title:t[i].snippet.localized.title,icon:t[i].snippet.thumbnails.high.url});a.set(s.cacheKey(e),r,3e5),n(r)})["catch"](function(e){})}})},r.getInfo=function(e){return new n(function(t,i){o.request("GET","channels?part=snippet&id="+e).then(function(e){t(JSON.parse(e).items)},i)})},r.getMine=function(){return new n(function(e,t){null!==r.ownChannel?e(r.ownChannel):o.request("GET","channels?part=snippet&mine=true").then(function(t){r.ownChannel=JSON.parse(t).items[0],r.ownChannel.title=r.ownChannel.snippet.title,r.ownChannel.icon=r.ownChannel.snippet.thumbnails["default"].url,o.ownChannel=r.ownChannel,e(r.ownChannel)},t)})},r.setActiveCategory=function(e){return e&&this.activeCategory.id!==e.id?(this.activeCategory=e,this.pages={},void 0!==this.events["category:changed"]&&this.emit("category:changed",e),!0):!1},e.exports=r},function(e,t,i){"use strict";function n(e){this.pages={},this.searchQuery="",this.relatedToVideoId="",this.channelId="",this.order="",d.call(this),e=e||{},this.filter(e)}var s,o,a,r=i(8),l=i(4),c=i(3),d=i(20);n.prototype=Object.create(d.prototype),n.prototype.constructor=n,n.prototype.getPage=function(e){var t,n=this;return s||(s=i(10),a=i(22),o=gettext("Author")),new r(function(i,s){if(e.channel=e.channel||n.channel,e.searchQuery=e.searchQuery||n.searchQuery,e.page=+e.page||0,e.relatedToVideoId=e.relatedToVideoId||n.relatedToVideoId,t="search?part=id&maxResults="+(e.count||6),e.page){if(!n.pages[e.page])return void s();t+="&pageToken="+n.pages[e.page]}e.channel&&e.channel.id&&(t+="&type=video&channelId="+e.channel.id),n.order&&(t+="&order="+n.order),e.relatedToVideoId&&(t+="&type=video&relatedToVideoId="+e.relatedToVideoId),e.searchQuery&&(t+="&q="+encodeURIComponent(e.searchQuery)),l.settings.safeSearch&&(t+="&safeSearch=strict"),c.request("GET",t).then(function(t){var l,d=[],u=0,h={},p={},m="",v="",f="";if(t=JSON.parse(t),t.nextPageToken&&(n.pages[e.page+1]=t.nextPageToken),t.prevPageToken&&(n.pages[e.page-1]=t.prevPageToken),t=t.items,0===t.length)s("empty");else{for(u=t.length,l=0;u>l;++l)"youtube#video"===t[l].id.kind?m+=t[l].id.videoId+",":"youtube#channel"===t[l].id.kind?(v+=t[l].id.channelId+",",h[l]=1):"youtube#playlist"===t[l].id.kind&&(f+=t[l].id.playlistId+",",p[l]=1);r.all([n.getMovies(m.substr(0,m.length-1)),n.getChannelsInfo(v.substr(0,v.length-1)),n.getTotalInfoPlaylists({id:f.substr(0,f.length-1),channel:!1})]).then(function(e){var t=+new Date,n=0,s=0,r=0;for(l=0;u>l;++l)h[l]&&e[1][s]?(d.push({value:1,id:e[1][s].id,title:e[1][s].snippet.localized.title,icon:e[1][s].snippet.thumbnails.high.url,type:"channel",viewCount:e[1][s].statistics.viewCount,commentCount:e[1][s].statistics.commentCount,subscriberCount:e[1][s].statistics.subscriberCount,hiddenSubscriberCount:e[1][s].statistics.hiddenSubscriberCount,videoCount:e[1][s].statistics.videoCount,locale:{subscriberCount:e[1][s].statistics.subscriberCount+" "+ngettext("subscriber","subscribers",+e[1][s].statistics.subscriberCount)}}),++s):p[l]&&e[2][r]?(d.push({value:1,playlistId:e[2][r].id,channel:{title:e[2][r].snippet.channelTitle,id:e[2][r].snippet.channelId},title:e[2][r].snippet.title,icon:e[2][r].snippet.thumbnails.high.url,type:"playlist",channelTitle:e[2][r].snippet.channelTitle,viewCount:" ",duration:" ",publishedAt:e[2][r].snippet.publishedAt,locale:{publishedAt:a(e[2][r].snippet.publishedAt,t),viewCount:" ",channelTitle:e[2][r].snippet.channelTitle?o+": "+e[2][r].snippet.channelTitle:" "}}),++r):e[0][n]&&(d.push({value:1,id:e[0][n].id,channelTitle:e[0][n].snippet.channelTitle,duration:c.normalizeVideoDuration(e[0][n].contentDetails.duration),viewCount:e[0][n].statistics.viewCount,publishedAt:e[0][n].snippet.publishedAt,dimension:e[0][n].contentDetails.dimension,definition:e[0][n].contentDetails.definition,title:e[0][n].snippet.localized.title,icon:e[0][n].snippet.thumbnails.high.url,channelId:e[0][n].snippet.channelId,type:"video",locale:{publishedAt:a(e[0][n].snippet.publishedAt,t),viewCount:ngettext("view","views",+e[0][n].statistics.viewCount)+" "+e[0][n].statistics.viewCount,channelTitle:o+": "+e[0][n].snippet.channelTitle}}),++n);i(d)},function(e){})["catch"](function(e){})}})["catch"](function(e){})})},n.prototype.getChannelsInfo=function(e){return e?c.request("GET","channels?part=snippet,statistics&id="+e).then(function(e){return JSON.parse(e).items}):r.resolve([])},n.prototype.filter=function(e){var t=!1;return void 0!==e.channel&&this.init({channel:e.channel}),void 0!==e.searchQuery&&this.searchQuery!==e.searchQuery&&(t=!0,this.searchQuery=e.searchQuery),void 0!==e.relatedToVideoId&&this.relatedToVideoId!==e.relatedToVideoId&&(t=!0,this.relatedToVideoId=e.relatedToVideoId),void 0!==e.order&&this.order!==e.order&&(t=!0,this.order=e.order),t?(this.pages={},this.emit("content:changed",e),!0):!1},e.exports=n},function(e,t,i){"use strict";var n={store:{},size:0,set:function(e,t,i){var n,s,o=this;s=this.store[e]?this.store[e]:void 0,s&&s.timeout&&clearTimeout(s.timeout),n={value:t,timeout:-1},"number"==typeof i&&(n.timeout=setTimeout(function(){o.remove(e)},i)),this.store[e]=n,++this.size},get:function(e,t){return this.store[e]?"function"!=typeof t?this.store[e].value:void t(this.store[e].value):!1},remove:function(e){--this.size,this.store[e]=null},clear:function(){var e=this.size;return this.store={},e}};e.exports=n},function(e,t,i){"use strict";function n(e){this.pages={},this.channel=null,r.call(this),e=e||{},void 0!==e.events&&this.addListeners(e.events),this.init(e)}var s,o,a=i(8),r=i(27),l=i(3);i(19);n.prototype=Object.create(r.prototype),n.prototype.constructor=n,n.prototype.getPage=function(e){var t=this;return o||(s=i(22),o=gettext("Author")),e.channel=e.channel||this.channel,e.count=e.count||6,e.page=+e.page||0,new a(function(i,n){return e.channel?void t.getPlaylists({count:1,channel:e.channel,page:e.page}).then(function(s){e.playlist=s[0],t.getPlayListItems(e).then(i,n)}):void n(e)})},n.prototype.getPlaylists=function(e){var t=this,i="playlists?part=id";if(e.channel=e.channel||this.channel,e.channel){if(e.page){if(!t.pages[e.page])return a.reject("no page");i+="&pageToken="+t.pages[e.page]}return i+="&channelId="+e.channel.id+"&maxResults="+e.count,l.request("GET",i).then(function(i){return i=JSON.parse(i),i.nextPageToken&&(t.pages[e.page+1]=i.nextPageToken),i.prevPageToken&&(t.pages[e.page-1]=i.prevPageToken),i.items})}},n.prototype.getTotalInfoPlaylists=function(e){var t=this,i="playlists?part=snippet";if(e.channel=void 0===e.channel?this.channel:e.channel,e.page){if(!t.pages[e.page])return a.reject("no page");i+="&pageToken="+t.pages[e.page]}if(e.channel)i+="&channelId="+e.channel.id;else{if(!(void 0!==e.id&&e.id.length>0))return a.resolve([]);i+="&id="+e.id}return void 0!==e.count&&(i+="&maxResults="+e.count),l.request("GET",i).then(function(i){return i=JSON.parse(i),i.nextPageToken&&(t.pages[e.page+1]=i.nextPageToken),i.prevPageToken&&(t.pages[e.page-1]=i.prevPageToken),i.items})},n.prototype.getChannelBackground=function(e){return e=e||this.channel,l.request("GET","channels?part=brandingSettings&id="+e.id).then(function(e){return e=JSON.parse(e),e.items[0].brandingSettings.image.bannerTvImageUrl})},n.prototype.init=function(e){var t=!1;return void 0!==e.channel&&(this.channel?this.channel&&this.channel.id!==e.channel.id&&(t=!0,this.channel=e.channel):(t=!0,this.channel=e.channel)),e.mode&&this.mode!==e.mode&&(this.mode=e.mode),t?(this.pages={},this.emit("content:changed",e),!0):!1},e.exports=n},function(e,t){"use strict";e.exports={initPlayer:gSTB.InitPlayer,saveUserData:gSTB.SaveUserData,loadUserData:gSTB.LoadUserData,setPosTime:gSTB.SetPosTime,getPosTime:gSTB.GetPosTime,play:gSTB.Play,pause:gSTB.Pause,continuePlay:gSTB.Continue,getVolume:gSTB.GetVolume,setVolume:gSTB.SetVolume,setNativeStringMode:gSTB&&gSTB.SetNativeStringMode?gSTB.SetNativeStringMode:function(){},setServiceButtonState:gSTB.EnableServiceButton,setVKButtonState:gSTB.EnableVKButton,setTvButtonState:gSTB.EnableTvButton,setAppButtonState:gSTB.EnableAppButton,hideVK:gSTB.HideVirtualKeyboard,showVK:gSTB.ShowVirtualKeyboard,getStandByStatus:gSTB.GetStandByStatus,setStandByStatus:gSTB.StandBy,getEnv:gSTB.GetEnv,isMuted:gSTB.GetMute,setMute:gSTB.SetMute,deviceModel:gSTB.GetDeviceModelExt}},function(e,t){"use strict";e.exports=function(e,t){var i,n,s;return e?(n=e.match(/(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d).(\d\d\d)Z/),n.shift(),n.pop(),i=new Date(n[0],n[1]-1,n[2],n[3],n[4],n[5]),i.setTime(t-i.getTime()),e=i.getTime(),i.getFullYear()>1970?(s=i.getFullYear()-1970,e=s+" "+ngettext("year","years",+s)+" "+gettext("ago")):i.getMonth()>0?(s=i.getMonth()+1,e=s+" "+ngettext("month","months",+s)+" "+gettext("ago")):i.getDate()>1?(s=i.getDate(),e=s+" "+ngettext("day","days",+s)+" "+gettext("ago")):i.getHours()>0?(s=i.getHours(),e=s+" "+ngettext("hour","hours",+s)+" "+gettext("ago")):i.getMinutes()>0?(s=i.getMinutes(),e=s+" "+ngettext("minute","minutes",+s)+" "+gettext("ago")):(s=i.getSeconds(),e=s+" "+ngettext("second","seconds",+s)+" "+gettext("ago")),e):e}},function(e,t,i){"use strict";function n(e){e=e||{},e.focusable=e.focusable||!1,e.visible=e.visible||!1,e.className="widget "+(e.className||""),s.call(this,e)}var s=i(5);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n},function(e,t){"use strict";e.exports={defaultSettings:{safeSearch:0,quality:0,language:"en",languageOverwrite:0,keyboardLanguage:0,credentialsIndex:-1,refreshToken:null,sessionToken:null},settingsFile:"youtube.json"}},function(e,t,i){function n(e){return i(s(e))}function s(e){return o[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var o={"./ar":32,"./ar.js":32,"./de":33,"./de.js":33,"./en":34,"./en.js":34,"./ru":35,"./ru.js":35,"./uk":36,"./uk.js":36};n.keys=function(){return Object.keys(o)},n.resolve=s,e.exports=n,n.id=25},function(e,t,i){"use strict";var n,s,o,a,r,l=i(2),c=i(3),d={types:{CATEGORY_HEADER:1,CATEGORY_ITEM:2},content:{data:[],focusIndex:1,tabs:[]},activeTab:3};if(c.token||(d.content.focusIndex=2,d.content.data.push({disabled:!1,onclick:function(){l.navigate("pl")},type:d.types.CATEGORY_ITEM,value:gettext("Sign in"),id:-1,className:"icon people"})),d.content.data.push({disabled:!1,onclick:function(){l.navigate("ps")},type:d.types.CATEGORY_ITEM,value:gettext("Search"),id:-2,className:"icon search"}),d.content.data.push({disabled:!1,tabIndex:3,type:d.types.CATEGORY_ITEM,value:gettext("Main"),id:-2,className:"icon what-to-watch"}),c.token&&d.content.data.push({disabled:!1,onclick:function(){return i(17).getMine().then(function(e){l.current.hide(),l.current.show({data:{channel:e}})})},type:d.types.CATEGORY_ITEM,value:gettext("My playlists"),id:-2,className:"icon upload"}),d.content.data.push({disabled:!1,tabIndex:2,type:d.types.CATEGORY_ITEM,value:gettext("Settings"),id:-2,className:"icon player-settings"}),c.playlists.length)for(d.content.data.push({disabled:!0,type:d.types.CATEGORY_HEADER,value:gettext("Playlists")}),a=0,r=c.playlists.length;r>a;++a)s=c.playlists[a],d.content.data.push({disabled:!1,type:d.types.CATEGORY_ITEM,value:s.value,playlist:s.channel,id:s.id,className:s.icon});if(c.subscriptions.length)for(d.content.data.push({disabled:!0,type:d.types.CATEGORY_HEADER,value:gettext("Subscriptions")}),a=0,r=c.subscriptions.length;r>a;++a)o=c.subscriptions[a],d.content.data.push({disabled:!1,tabIndex:1,type:d.types.CATEGORY_ITEM,value:o.value,id:o.id,title:o.title,icon:o.icon});if(c.categories.length)for(d.content.data.push({disabled:!0,type:d.types.CATEGORY_HEADER,value:gettext("Categories")}),a=0,r=c.categories.length;r>a;++a)n=c.categories[a],d.content.data.push({disabled:!1,tabIndex:0,type:d.types.CATEGORY_ITEM,value:n.value,channel:n.channel,id:n.id,className:n.icon});e.exports=d},function(e,t,i){"use strict";function n(e){return e&&e.playlist?"pid:"+e.playlist.id+";p:"+e.page:"PLAYLIST"}function s(e){this.pages={},this.playlist=null,l.call(this),e=e||{},void 0!==e.events&&this.addListeners(e.events),this.init(e)}var o,a,r=i(8),l=i(6),c=i(3),d=!1,u=i(19);s.prototype=Object.create(l.prototype),s.prototype.constructor=s,s.prototype.getPage=function(e){var t,i=this;return e.playlist=e.playlist||this.playlist,e.page=+e.page||0,e.count=e.count||20,new r(function(s,o){if(t=u.get(n(e)))s(t);else{if(!e.playlist.id)return void o(e);i.getPlayListItems(e).then(s,o)}})},s.prototype.getPlayListItems=function(e){var t=this,s=[],l="",h="playlistItems?part=snippet&playlistId="+e.playlist.id+"&maxResults="+(e.count||30);if(e.page=+e.page||0,d||(d=i(10),o=i(22),a=gettext("Author")),e.page){if(!t.pages[e.page])return r.reject();h+="&pageToken="+t.pages[e.page]}return c.request("GET",h).then(function(i){try{i=JSON.parse(i),i.nextPageToken&&(t.pages[e.page+1]=i.nextPageToken),i.prevPageToken&&(t.pages[e.page-1]=i.prevPageToken),i.items.forEach(function(e){l+=e.snippet.resourceId.videoId+","})}catch(r){}return t.getMovies(l.substr(0,l.length-1)).then(function(t){var i,r,l=+new Date;for(i=t.length,r=0;i>r;++r)s.push({value:1,id:t[r].id,channelTitle:t[r].snippet.channelTitle,duration:c.normalizeVideoDuration(t[r].contentDetails.duration),viewCount:t[r].statistics.viewCount,publishedAt:t[r].snippet.publishedAt,dimension:t[r].contentDetails.dimension,definition:t[r].contentDetails.definition,title:t[r].snippet.localized.title,icon:t[r].snippet.thumbnails.high.url,channelId:t[r].snippet.channelId,type:"video",locale:{publishedAt:o(t[r].snippet.publishedAt,l),viewCount:t[r].statistics.viewCount+" "+ngettext("view","views",+t[r].statistics.viewCount),channelTitle:a+": "+t[r].snippet.channelTitle}});return u.set(n(e),s,3e5),s})})},s.prototype.getMovies=function(e){var t,i,n,s,o=[];for(i=e.split(","),n=0,s=i.length;s>n;++n)(t=u.get("vid:"+i[n]))&&o.push(t);return c.request("GET","videos?part=statistics,contentDetails,snippet&id="+e).then(function(e){for(e=JSON.parse(e).items,n=0,s=e.length;s>n;++n)u.set("vid:"+e[n].id,e[n],6e4);return e})},s.prototype.init=function(e){return void 0!==e.playlist?(this.playlist?this.playlist&&this.playlist.id!==e.playlist.id&&(this.playlist=e.playlist):this.playlist=e.playlist,this.pages={},this.emit("content:changed",e),!0):!1},e.exports=s},function(e,t,i){"use strict";var n=i(6),s=new n;s.data={quality:[gettext("Best"),"720p","480p","360p","240p"],safeSearch:[gettext("Off"),gettext("On")]},s.getNext=function(e,t){return s.data[e]&&s.data[e][t]?(++t,s.data[e].length===t&&(t=0),this.emit("changed",{key:e,value:s.data[e][t],index:t}),{value:s.data[e][t],index:t}):void 0},e.exports=s},function(module,exports,__webpack_require__){"use strict";var Emitter=__webpack_require__(6),gettext=new Emitter,meta=null,data=null;gettext.load=function(e,t){var i=new XMLHttpRequest;e.ext=e.ext||"json",e.path=e.path||"lang",i.responseType="text",i.onload=function(){var e;try{e=JSON.parse(i.responseText),meta=e.meta,data=e.data,t(null,data)}catch(n){meta=null,data=null,i.onerror(n)}gettext.events.load&&gettext.emit("load")},i.onerror=function(e){t(e),gettext.events.error&&gettext.emit("error")},i.open("GET",e.path+"/"+e.name+"."+e.ext,!0),i.send(null)},window.gettext=function(e){return data&&data[""][e]?data[""][e]:e},window.pgettext=function(e,t){return data&&data[e][t]?data[e][t]:t},window.ngettext=function(msgId,plural,value){return data&&meta?data[""][msgId][eval("var n = "+value+"; "+meta.plural)]:1===value?msgId:plural},module.exports=gettext},function(e,t,i){"use strict";function n(e){e=e||{},this.value="",this.type=this.TYPE_TEXT,e.className="input "+(e.className||""),s.call(this,e),this.$line=this.$body.appendChild(document.createElement("div")),this.$line.className="line",this.$caret=this.$line.appendChild(document.createElement("div")),this.$caret.className="caret",this.$placeholder=this.$line.appendChild(document.createElement("div")),this.$placeholder.className="placeholder",this.$caret.index=0,this.init(e)}var s=i(5),o=i(1);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.TYPE_TEXT=0,n.prototype.TYPE_PASSWORD=1,n.prototype.defaultEvents={keypress:function(e){this.addChar(String.fromCharCode(e.keyCode),this.$caret.index)},keydown:function(e){switch(e.code){case o["delete"]:this.removeChar(this.$caret.index);break;case o.back:this.removeChar(this.$caret.index-1);break;case o.left:this.setCaretPosition(this.$caret.index-1);break;case o.right:this.setCaretPosition(this.$caret.index+1);break;case o.end:case o.down:this.setCaretPosition(this.value.length);break;case o.home:case o.up:this.setCaretPosition(0)}}},n.prototype.init=function(e){e.type&&(this.type=e.type),e.value&&this.setValue(e.value),e.placeholder&&(this.$placeholder.innerText=e.placeholder),this.$line.dir=e.direction||"ltr"},n.prototype.addChar=function(e,t){var i=document.createElement("div");t=void 0===t?this.$caret.index:t,0===this.value.length&&this.$line.removeChild(this.$placeholder),i.className="char",this.value=this.value.substring(0,t)+e+this.value.substring(t,this.value.length),++this.$caret.index,this.type===this.TYPE_PASSWORD?i.innerText="*":" "===e?i.innerHTML="&nbsp;":i.innerText=e,t>=this.value.length?(this.$line.appendChild(i),this.$line.appendChild(this.$caret)):(this.$line.insertBefore(this.$caret,this.$line.children[t]),this.$line.insertBefore(i,this.$caret)),this.events.input&&this.emit("input",{value:this.value})},n.prototype.removeChar=function(e){var t=this.value;e=void 0===e?this.$caret.index-1:e,this.value.length>0&&(this.$caret.index===e&&e<this.value.length?this.$line.removeChild(this.$line.children[e+1]):this.$caret.index>e&&(--this.$caret.index,this.$line.removeChild(this.$line.children[e])),this.value=this.value.substring(0,e)+this.value.substring(e+1,this.value.length),this.events.input&&t!==this.value&&this.emit("input",{value:this.value})),0===this.value.length&&this.$line.appendChild(this.$placeholder)},n.prototype.setCaretPosition=function(e){e>=0&&e<=this.value.length&&this.$caret.index!==e&&(this.$line.removeChild(this.$caret),e===this.value.length?this.$line.appendChild(this.$caret):this.$line.insertBefore(this.$caret,this.$line.children[e]),this.$caret.index=e)},n.prototype.setValue=function(e){var t,i,n=this.value.length,s=e.length,o=0;if(e!==this.value){if(s>0){if(this.$placeholder.parentNode===this.$line&&this.$line.removeChild(this.$placeholder),this.$line.removeChild(this.$caret),s!==n)if(i=s-n,i>0)for(o=0;i>o;o++)t=this.$line.appendChild(document.createElement("div")),t.className="char";else for(o=0;o>i;o--)this.$line.removeChild(this.$line.lastChild);for(o=0;s>o;o++)t=this.$line.children[o],this.type===this.TYPE_PASSWORD?t.innerHTML="*":" "===e[o]?t.innerHTML="&nbsp;":t.innerText=e[o];this.value=e,this.$caret.index=s,this.$line.appendChild(this.$caret)}else this.value="",this.$line.innerText="",this.$line.appendChild(this.$caret),this.$line.appendChild(this.$placeholder);this.events.input&&this.emit("input",{value:this.value})}},e.exports=n},function(e,t,i){"use strict";function n(e){e=e||{},e.className="modalMessage "+(e.className||""),s.call(this,e),this.$header=this.$body.appendChild(document.createElement("div")),this.$content=this.$body.appendChild(document.createElement("div")),this.$footer=this.$body.appendChild(document.createElement("div")),this.$header.className="header",this.$content.className="content",this.$footer.className="footer",this.$header.innerText="header",this.$content.innerText="content",this.$footer.innerText="footer"}var s=i(63);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n},function(e,t){"use strict";e.exports=[[{value:"ض",className:"symbol"},{value:"ص",className:"symbol"},{value:"ث",className:"symbol"},{value:"ق",className:"symbol"},{value:"ف",className:"symbol"},{value:"غ",className:"symbol"},{value:"ع",className:"symbol"},{value:"ه",className:"symbol"},{value:"خ",className:"symbol"},{value:"ح",className:"symbol"},{value:"ج",className:"symbol"},{value:"Delete",className:"symbol delete wide",colSpan:2},{value:"&nbsp;",className:"icon keyDelete"}],[{value:"د",className:"symbol"},{value:"ش",className:"symbol"},{value:"س",className:"symbol"},{value:"ي",className:"symbol"},{value:"ب",className:"symbol"},{value:"ل",className:"symbol"},{value:"ا",className:"symbol"},{value:"ت",className:"symbol"},{value:"ن",className:"symbol"},{value:"ن",className:"symbol"},{value:"م",className:"symbol"},{value:"ك",className:"symbol"},{value:"123",className:"symbol nums wide"},{value:"&nbsp;",className:"icon keyGlobe"}],[{value:"ط",className:"symbol"},{value:"ئ",className:"symbol"},{value:"ء",className:"symbol"},{value:"ؤ",className:"symbol"},{value:"ر",className:"symbol"},{value:"لا",className:"symbol"},{value:"ى",className:"symbol"},{value:"ة",className:"symbol"},{value:"و",className:"symbol"},{value:"ز",className:"symbol"},{value:"ظ",className:"symbol"},{value:"&nbsp;",className:"icon keySpace",colSpan:3}]]},function(e,t){"use strict";e.exports=[[{value:"a",className:"symbol"},{value:"b",className:"symbol"},{value:"c",className:"symbol"},{value:"d",className:"symbol"},{value:"e",className:"symbol"},{value:"f",className:"symbol"},{value:"g",className:"symbol"},{value:"h",className:"symbol"},{value:"i",className:"symbol"},{value:"j",className:"symbol"},{value:"Verwijderen",className:"symbol delete",colSpan:2},{value:"&nbsp;",className:"icon keyDelete"}],[{value:"s",className:"symbol"},{value:"t",className:"symbol"},{value:"k",className:"symbol"},{value:"l",className:"symbol"},{value:"m",className:"symbol"},{value:"n",className:"symbol"},{value:"o",className:"symbol"},{value:"p",className:"symbol"},{value:"q",className:"symbol"},{value:"r",className:"symbol"},{value:"123",className:"symbol nums wide"},{value:"&nbsp;",className:"icon keyGlobe",colSpan:2}],[{value:"u",className:"symbol"},{value:"v",className:"symbol"},{value:"w",className:"symbol"},{value:"x",className:"symbol"},{value:"y",className:"symbol"},{value:"z",className:"symbol"},{value:"ä",className:"symbol"},{value:"ö",className:"symbol"},{value:"ü",className:"symbol"},{value:"ß",className:"symbol"},{value:"&nbsp;",className:"icon keySpace",colSpan:3}]]},function(e,t){"use strict";e.exports=[[{value:"a",className:"symbol"},{value:"b",className:"symbol"},{value:"c",className:"symbol"},{value:"d",className:"symbol"},{value:"e",className:"symbol"},{value:"f",className:"symbol"},{value:"g",className:"symbol"},{value:"h",className:"symbol"},{value:"i",className:"symbol"},{value:"Delete",className:"symbol delete wide"},{value:"&nbsp;",className:"icon keyDelete"}],[{value:"j",className:"symbol"},{value:"k",className:"symbol"},{value:"l",className:"symbol"},{value:"m",className:"symbol"},{value:"n",className:"symbol"},{value:"o",className:"symbol"},{value:"p",className:"symbol"},{value:"q",className:"symbol"},{value:"r",className:"symbol"},{value:"123",className:"symbol nums wide"},{value:"&nbsp;",className:"icon keyGlobe"}],[{value:"s",className:"symbol"},{value:"t",className:"symbol"},{value:"u",className:"symbol"},{value:"v",className:"symbol"},{value:"w",className:"symbol"},{value:"x",className:"symbol"},{value:"y",className:"symbol"},{value:"z",className:"symbol"},{value:"&nbsp;",className:"icon keySpace",colSpan:3}]]},function(e,t){"use strict";e.exports=[[{value:"а",className:"symbol"},{value:"б",className:"symbol"},{value:"в",className:"symbol"},{value:"г",className:"symbol"},{value:"д",className:"symbol"},{value:"e",className:"symbol"},{value:"ё",className:"symbol"},{value:"ж",className:"symbol"},{value:"з",className:"symbol"},{value:"и",className:"symbol"},{value:"й",className:"symbol"},{value:"Удалить",className:"symbol delete wide"},{value:"&nbsp;",className:"icon keyDelete"}],[{value:"к",className:"symbol"},{value:"л",className:"symbol"},{value:"м",className:"symbol"},{value:"н",className:"symbol"},{value:"о",className:"symbol"},{value:"п",className:"symbol"},{value:"р",className:"symbol"},{value:"с",className:"symbol"},{value:"т",className:"symbol"},{value:"у",className:"symbol"},{value:"ф",className:"symbol"},{value:"123",className:"symbol nums wide"},{value:"&nbsp;",className:"icon keyGlobe"}],[{value:"х",className:"symbol"},{value:"ц",className:"symbol"},{value:"ч",className:"symbol"},{value:"ш",className:"symbol"},{value:"щ",className:"symbol"},{value:"ь",className:"symbol"},{value:"ъ",className:"symbol"},{value:"ы",className:"symbol"},{value:"э",className:"symbol"},{value:"ю",className:"symbol"},{value:"я",className:"symbol"},{value:"&nbsp;",className:"icon keySpace",colSpan:2}]]},function(e,t){"use strict";e.exports=[[{value:"а",className:"symbol"},{value:"б",className:"symbol"},{value:"в",className:"symbol"},{value:"г",className:"symbol"},{value:"ґ",className:"symbol"},{value:"д",className:"symbol"},{value:"e",className:"symbol"},{value:"є",className:"symbol"},{value:"ж",className:"symbol"},{value:"з",className:"symbol"},{value:"и",className:"symbol"},{value:"Удалить",className:"symbol delete wide"},{value:"&nbsp;",className:"icon keyDelete"}],[{value:"і",className:"symbol"},{value:"ї",className:"symbol"},{value:"й",className:"symbol"},{value:"к",className:"symbol"},{value:"л",className:"symbol"},{value:"м",className:"symbol"},{value:"н",className:"symbol"},{value:"о",className:"symbol"},{value:"п",className:"symbol"},{value:"р",className:"symbol"},{value:"с",className:"symbol"},{value:"123",className:"symbol nums wide"},{value:"&nbsp;",className:"icon keyGlobe"}],[{value:"т",className:"symbol"},{value:"у",className:"symbol"},{value:"ф",className:"symbol"},{value:"х",className:"symbol"},{value:"ц",className:"symbol"},{value:"ч",className:"symbol"},{value:"ш",className:"symbol"},{value:"щ",className:"symbol"},{value:"ь",className:"symbol"},{value:"ю",className:"symbol"},{value:"я",className:"symbol"},{value:"&nbsp;",className:"icon keySpace",colSpan:2}]]},function(e,t,i){"use strict";function n(e){var t=this;this.value="",this.type=this.TYPE_TEXT,this.type=this.TYPE_TEXT,this.direction="ltr",e=e||{},e.className="inputNative "+(e.className||""),s.call(this,e),this.init(e),this.addListener("keydown",function(e){e.code===o.back&&(e.stop=!0)}),this.$body.addEventListener("input",function(e){t.value=t.$body.value,void 0!==t.events.input&&t.emit("input",{value:t.$body.value})}),this.addListener("focus",function(){t.$body.focus()}),this.addListener("blur",function(){t.$body.blur()})}var s=i(5),o=i(1);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.init=function(e){void 0!==e.type&&(this.$body.type=this.type=e.type),void 0!==e.value&&(this.$body.value=this.value=e.value),void 0!==e.placeholder&&(this.$body.placeholder=e.placeholder),void 0!==e.direction&&(this.$node.dir=this.direction=e.direction)},n.prototype.addChar=function(e,t){t=void 0===t?this.value.length:t,this.value=this.value.substring(0,t)+e+this.value.substring(t,this.value.length),this.$body.value=this.value,void 0!==this.events.input&&this.emit("input",{value:this.value})},n.prototype.removeChar=function(e){e=void 0===e?this.value.length-1:e,this.value.length>0&&(this.value=this.value.substring(0,e)+this.value.substring(e+1,this.value.length),this.$body.value=this.value,void 0!==this.events.input&&this.emit("input",{value:this.value})),this.$body.value=this.value},n.prototype.setCaretPosition=function(e){this.$body.setSelectionRange(e,e)},n.prototype.setValue=function(e){this.$body.value!==e&&(this.$body.value=e,void 0!==this.events.input&&this.emit("input",{value:this.value}))},e.exports=n},function(e,t,i){"use strict";function n(e,t){var i=1^e;S||(t?(S=!0,u.getPage({page:I-1,count:1}).then(function(t){--I,--$,p[i].model.init({channel:t[0]}),T=i,x=e,v=i},function(e){})):(S=!0,u.getPage({page:$+1,count:1}).then(function(t){++I,++$,p[e].model.init({channel:t[0]}),T=i,x=e,v=i},function(t){S=!1,"overflow"===t&&(++I,++$,p[e].model.init({channel:{id:"!",title:""}}),p[e].data=[{id:"",value:"",publishedAt:"",icon:"",duration:"",title:"",channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],p[e].viewIndex=null,p[e].renderView(0),p[e].focusIndex(0),p[e].$title.innerHTML="",T=i,x=e,v=i,p[T].$node.style.top=w,p[x].$node.style.top=b,p[v].focus())})))}var s=i(1),o=i(2),a=i(11),r=i(7),l=i(30),c=i(13),d=i(18),u=i(17),h=i(14),p=[],m=document.getElementById("pm"),v=0,f=new a({$node:document.getElementById("pmTabCategoryContent"),visible:!1,events:{focus:function(){p[v].focus()},show:function(){m.style.backgroundImage=""}}}),g=new l({$node:document.getElementById("pmCategorySearch"),$body:document.getElementById("pmCategorySearchBody"),events:{keydown:function(e){e.code===s.ok?(this.setValue(""),o.navigate("ps")):e.code===s.down?p[0].focus():e.code===s.left&&0===this.$caret.index?h.focus():e.code===s.exit&&(e.stop=!1)},input:function(){this.setValue(""),o.navigate("ps")}}}),y=i(9),b=0,w=0,T=0,x=1,I=0,$=1,E=-1,S=!0;u.addListener("category:changed",function(){clearTimeout(E),E=setTimeout(function(){y.hide()},1e4),0===p.length&&(p.push(new c({$node:document.getElementById("pmListCategoryVideos0Node"),$body:document.getElementById("pmListCategoryVideos0Body"),$title:document.getElementById("pmCategoryChannelTitle0"),model:new d({order:"date"}),size:5,viewIndex:0,focusIndex:0,type:r.prototype.TYPE_HORIZONTAL,events:{overflow:function(e){e.direction===s.left&&h.focus()},"view:ready":function(){
  p[T].$node.style.top=w,p[x]&&(p[x].$node.style.top=b),this.$title.innerHTML=this.model.channel.title,this.show(),y.hide(),clearTimeout(E),p[v].focus(),S=!1},"view:error":function(e){S=!1,"empty"===e?(this.data=[{id:"",value:"",publishedAt:"",icon:"img/no.image.png",duration:"",title:gettext("No videos"),channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],this.viewIndex=null,this.renderView(0),this.focusIndex(0),f.focusEntry=p[v],p[T].$node.style.top=w,p[x]&&(p[x].$node.style.top=b),this.$title.innerHTML=this.model.channel.title,this.show(),y.hide(),clearTimeout(E),p[v].focus()):0===I&&n(0,!1)},"click:item":function(e){e.$item.data.id&&o.navigate("pp",{channel:this.model.channel,video:e.$item.data,playlist:this.data,position:e.$item.index})}}})),p.push(new c({$node:document.getElementById("pmListCategoryVideos1Node"),$body:document.getElementById("pmListCategoryVideos1Body"),$title:document.getElementById("pmCategoryChannelTitle1"),model:new d({order:"date"}),size:5,viewIndex:0,focusIndex:0,type:r.prototype.TYPE_HORIZONTAL,events:{overflow:function(e){e.direction===s.left&&(h.focus(),f.focusEntry=this)},"view:ready":function(){p[T].$node.style.top=w,p[x].$node.style.top=b,this.$title.innerHTML=this.model.channel.title,this.show(),y.hide(),clearTimeout(E),p[v].focus(),S=!1},"view:error":function(e){S=!1,"empty"===e&&(this.data=[{id:"",value:"",publishedAt:"",icon:"img/no.image.png",duration:"",title:gettext("No videos"),channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],this.viewIndex=null,this.renderView(0),this.focusIndex(0),f.focusEntry=p[v],p[T].$node.style.top=w,p[x]&&(p[x].$node.style.top=b),this.$title.innerHTML=this.model.channel.title,this.show(),y.hide(),clearTimeout(E),p[v].focus())},"click:item":function(e){e.$item.data.id&&o.navigate("pp",{channel:this.model.channel,video:e.$item.data,playlist:this.data,position:e.$item.index})}}})),f.add(p[0]),f.add(p[1]),p[0].focus(),p[0].addListener("keydown",function(e){e.code===s.down?n(0,!1):e.code===s.up?I>0?n(0,!0):g.focus():e.code===s.playPause&&o.navigate("pp",{channel:this.model.channel,video:this.$focusItem.data,playlist:this.data,position:this.$focusItem.index})}),p[1].addListener("keydown",function(e){e.code===s.down?n(1,!1):e.code===s.up?I>0?n(1,!0):g.focus():e.code===s.playPause&&o.navigate("pp",{channel:this.model.channel,video:this.$focusItem.data,playlist:this.data,position:this.$focusItem.index})}),b=window.getComputedStyle(p[1].$node).getPropertyValue("top")),u.getPage({page:0,count:1}).then(function(e){I=0,T=0,x=1,$=1,v=0,p[T].model.filter({channel:e[0]}),u.getPage({page:1,count:1}).then(function(e){p[x].model.filter({channel:e[0]}),p[v].focus()})})["catch"](function(e){})}),f.activate=function(e){this.show(),u.setActiveCategory(e)?y.show():p[v].focus()},f.add(g),e.exports=f},function(e,t,i){"use strict";function n(e,t){var i=1^e;S||(t?(S=!0,N.getTotalInfoPlaylists({page:I-1,count:1}).then(function(t){--I,--$,h[i].model.init({playlist:{value:t[0].id,id:t[0].id,title:t[0].snippet.title,icon:t[0].snippet.thumbnails["default"].url}}),w=i,T=e,x=i},function(e){})):(S=!0,N.getTotalInfoPlaylists({page:$+1,count:1}).then(function(t){++I,++$,h[e].model.init({playlist:{value:t[0].id,id:t[0].id,title:t[0].snippet.title,icon:t[0].snippet.thumbnails["default"].url}}),w=i,T=e,x=i},function(t){S=!1,"overflow"===t&&(++I,++$,h[e].model.init({playlist:{id:"!",title:""}}),h[e].data=[{id:"",value:"",publishedAt:"",icon:"",duration:"",title:"",channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],h[e].viewIndex=null,h[e].renderView(0),h[e].focusIndex(0),h[e].$title.innerHTML="",w=i,T=e,x=i,h[w].$node.style.top=b,h[T].$node.style.top=y,h[x].focus())})))}var s=i(1),o=i(2),a=i(11),r=i(7),l=i(13),c=i(20),d=i(27),u=(i(10),i(14)),h=[],p=new a({$node:document.getElementById("pmTabChannelContent"),visible:!1,events:{focus:function(){h[x].focus()}}}),m=i(9),v=document.getElementById("pm"),f=document.getElementById("pmChannelTitle"),g=document.getElementById("pmChannelIcon"),y=0,b=0,w=0,T=1,x=0,I=0,$=1,E=-1,S=!0,N=new c;N.addListener("content:changed",function(){clearTimeout(E),E=setTimeout(function(){m.hide()},1e4),0===h.length&&(h.push(new l({$node:document.getElementById("pmListChannelVideos0Node"),$body:document.getElementById("pmListChannelVideos0Body"),$title:document.getElementById("pmChannelTitle0"),model:new d,size:5,viewIndex:0,focusIndex:0,type:r.prototype.TYPE_HORIZONTAL,events:{overflow:function(e){e.direction===s.left&&u.focus()},"view:ready":function(){p.focusEntry=h[x],h[w].$node.style.top=b,h[T]&&(h[T].$node.style.top=y),this.$title.innerHTML=this.model.playlist.title,this.show(),m.hide(),clearTimeout(E),h[x].focus(),S=!1},"view:error":function(e){S=!1,"empty"===e?(this.data=[{id:"",value:"",publishedAt:"",icon:"img/no.image.png",duration:"",title:gettext("No videos"),channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],this.viewIndex=null,this.renderView(0),this.focusIndex(0),p.focusEntry=h[x],h[w].$node.style.top=b,h[T]&&(h[T].$node.style.top=y),this.$title.innerHTML=this.model.playlist.title,this.show(),m.hide(),clearTimeout(E),h[x].focus()):0===I&&n(0,!1)},"click:item":function(e){e.$item.data.id&&o.navigate("pp",{channel:this.model.channel,video:e.$item.data,playlist:this.data,position:e.$item.index})}}})),h.push(new l({$node:document.getElementById("pmListChannelVideos1Node"),$body:document.getElementById("pmListChannelVideos1Body"),$title:document.getElementById("pmChannelTitle1"),model:new d,size:5,viewIndex:0,focusIndex:0,type:r.prototype.TYPE_HORIZONTAL,events:{overflow:function(e){e.direction===s.left&&u.focus()},"view:ready":function(){p.focusEntry=h[x],h[w].$node.style.top=b,h[T].$node.style.top=y,this.$title.innerHTML=this.model.playlist.title,this.show(),m.hide(),clearTimeout(E),h[x].focus(),S=!1},"view:error":function(e){S=!1,"empty"===e&&(this.data=[{id:"",value:"",publishedAt:"",icon:" ",duration:"",title:" ",channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],this.viewIndex=null,this.renderView(0),this.focusIndex(0),p.focusEntry=h[x],h[w].$node.style.top=b,h[T]&&(h[T].$node.style.top=y),this.$title.innerHTML=this.model.channel.title?this.model.channel.title:"&nbsp;",this.show(),m.hide(),clearTimeout(E),h[x].focus())},"click:item":function(e){e.$item.data.id&&o.navigate("pp",{channel:this.model.channel,video:e.$item.data,playlist:this.data,position:e.$item.index})}}})),p.add(h[0]),p.add(h[1]),h[0].focus(),h[0].addListener("keydown",function(e){e.code===s.down?n(0,!1):e.code===s.up?I>0&&n(0,!0):e.code===s.playPause&&o.navigate("pp",{channel:this.model.channel,video:this.$focusItem.data,playlist:this.data,position:this.$focusItem.index})}),h[1].addListener("keydown",function(e){e.code===s.down?n(1,!1):e.code===s.up?I>0&&n(1,!0):e.code===s.playPause&&o.navigate("pp",{channel:this.model.channel,video:this.$focusItem.data,playlist:this.data,position:this.$focusItem.index})}),y=window.getComputedStyle(h[1].$node).getPropertyValue("top")),N.getTotalInfoPlaylists({page:0,count:1}).then(function(e){I=0,w=0,T=1,$=1,x=0,h[w].model.init({playlist:{value:e[0].id,id:e[0].id,title:e[0].snippet.title,icon:e[0].snippet.thumbnails["default"].url}}),N.getTotalInfoPlaylists({page:1,count:1}).then(function(e){h[T].model.init({playlist:{value:e[0].id,id:e[0].id,title:e[0].snippet.title,icon:e[0].snippet.thumbnails["default"].url}}),h[x].focus()},function(){h[1].hide()})},function(e){"no page"===e&&h[1].emit("view:error","empty")})["catch"](function(e){})}),p.activate=function(e){this.show(),h.length&&h[x].focus(),N.init({channel:e})&&(h[0].hide(),h[1].hide(),g.style.backgroundImage="url("+e.icon+")",f.innerHTML=e.title,m.show()),N.getChannelBackground().then(function(e){v.style.backgroundImage="url("+e+")"})},e.exports=p},function(e,t,i){"use strict";function n(e,t){var i=1^e;S||(t?(S=!0,u.getPage({page:I-1,count:1}).then(function(t){--I,--$,m[i].model.filter({channel:t[0]}),T=i,x=e,f=i},function(e){})):(S=!0,u.getPage({page:$+1,count:1}).then(function(t){++I,++$,m[e].model.filter({channel:t[0]}),T=i,x=e,f=i},function(t){S=!1,"overflow"===t&&(++I,++$,m[e].model.filter({channel:{id:"!",title:""}}),m[e].data=[{id:"",value:"",publishedAt:"",icon:"",duration:"",title:"",channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],m[e].viewIndex=null,m[e].renderView(0),m[e].focusIndex(0),m[e].$title.innerHTML="",T=i,x=e,f=i,m[T].$node.style.top=w,m[x].$node.style.top=b,m[f].focus())})))}var s=i(1),o=i(2),a=i(11),r=i(7),l=i(30),c=i(13),d=i(18),u=i(46),h=i(14),p=i(9),m=[],v=document.getElementById("pm"),f=0,g=new a({$node:document.getElementById("pmTabMainContent"),visible:!1,events:{focus:function(){m[f].focus()},show:function(){v.style.backgroundImage=""}}}),y=new l({$node:document.getElementById("pmMainSearch"),$body:document.getElementById("pmMainSearchBody"),events:{keydown:function(e){e.code===s.ok?(this.setValue(""),o.navigate("ps")):e.code===s.down?m[0].focus():e.code===s.left&&0===this.$caret.index?h.focus():e.code===s.exit&&(e.stop=!1)},input:function(){this.setValue(""),o.navigate("ps")}}}),b=0,w=0,T=0,x=1,I=0,$=1,E=-1,S=!0;g.activate=function(){this.show(),clearTimeout(E),E=setTimeout(function(){p.hide()},1e4),0===m.length&&(p.show(),m.push(new c({$node:document.getElementById("pmListMainVideos0Node"),$body:document.getElementById("pmListMainVideos0Body"),$title:document.getElementById("pmMainChannelTitle0"),model:new d,size:5,viewIndex:0,focusIndex:0,type:r.prototype.TYPE_HORIZONTAL,events:{overflow:function(e){e.direction===s.left&&h.focus()},"view:ready":function(){g.focusEntry=m[f],m[T].$node.style.top=w,m[x]&&(m[x].$node.style.top=b),this.$title.innerHTML=this.model.channel.title,m[f]&&m[f].data.length>0&&m[f].data[0].value&&(p.hide(),clearTimeout(E)),this.show(),m[f].focus(),S=!1},"view:error":function(e){S=!1,"empty"===e?(this.data=[{id:"",value:"",publishedAt:"",icon:"img/no.image.png",duration:"",title:gettext("No videos"),channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],this.viewIndex=null,this.renderView(0),this.focusIndex(0),g.focusEntry=m[f],m[T].$node.style.top=w,m[x]&&(m[x].$node.style.top=b),this.$title.innerHTML=this.model.channel.title,p.hide(),this.show(),clearTimeout(E),m[f].focus()):0===I&&n(0,!1)},"click:item":function(e){e.$item.data.id&&o.navigate("pp",{channel:this.model.channel,video:e.$item.data,playlist:this.data,position:e.$item.index})},focus:function(){g.focusEntry=this}}})),m.push(new c({$node:document.getElementById("pmListMainVideos1Node"),$body:document.getElementById("pmListMainVideos1Body"),$title:document.getElementById("pmMainChannelTitle1"),model:new d,size:5,viewIndex:0,focusIndex:0,type:r.prototype.TYPE_HORIZONTAL,events:{overflow:function(e){e.direction===s.left&&h.focus()},"view:ready":function(){g.focusEntry=m[f],m[T].$node.style.top=w,m[x].$node.style.top=b,this.$title.innerHTML=this.model.channel.title,m[f]&&m[f].data.length>0&&m[f].data[0].value&&(p.hide(),clearTimeout(E)),this.show(),clearTimeout(E),m[f].focus(),S=!1},"view:error":function(e){S=!1,"empty"===e&&(this.data=[{id:"",value:"",publishedAt:"",icon:"img/no.image.png",duration:"",title:gettext("No videos"),channelTitle:"",viewCount:"",locale:{publishedAt:"",viewCount:"",channelTitle:""}}],this.viewIndex=null,this.renderView(0),this.focusIndex(0),g.focusEntry=m[f],m[T].$node.style.top=w,m[x]&&(m[x].$node.style.top=b),this.$title.innerHTML=this.model.channel.title,this.show(),p.hide(),clearTimeout(E),m[f].focus())},"click:item":function(e){e.$item.data.id&&o.navigate("pp",{channel:this.model.channel,video:e.$item.data,playlist:this.data,position:e.$item.index})},focus:function(){g.focusEntry=this}}})),g.add(m[0]),g.add(m[1]),m[0].addListener("keydown",function(e){e.code===s.down?n(0,!1):e.code===s.up?I>0?n(0,!0):y.focus():e.code===s.playPause&&o.navigate("pp",{channel:this.model.channel,video:this.$focusItem.data,playlist:this.data,position:this.$focusItem.index})}),m[1].addListener("keydown",function(e){e.code===s.down?n(1,!1):e.code===s.up?I>0?n(1,!0):y.focus():e.code===s.playPause&&o.navigate("pp",{channel:this.model.channel,video:this.$focusItem.data,playlist:this.data,position:this.$focusItem.index})}),b=window.getComputedStyle(m[1].$node).getPropertyValue("top"),u.getPage({page:0,count:1}).then(function(e){I=0,T=0,x=1,$=1,f=0,m[T].model.filter({channel:e[0]}),u.getPage({page:1,count:1}).then(function(e){m[x].model.filter({channel:e[0]}),m[f].focus()})})["catch"](function(e){})),m[f].focus()},g.add(y),e.exports=g},function(e,t,i){"use strict";var n,s=i(1),o=i(4),a=i(2),r=i(7),l=i(11),c=i(31),d=i(3),u=i(21),h=i(12),p=document.getElementById("pm"),m=new l({$node:document.getElementById("pmTabSettings"),visible:!1,events:{show:function(){p.style.backgroundImage=""}}}),v=i(14),f=i(15),g=-1!==["AuraHD2","AuraHD3","AuraHD8","MAG254","MAG275","MAG276","WR320"].indexOf(u.deviceModel()),y=-1;m.activate=function(){var e,t;n||(t=i(10),e=i(28),n=new r({$node:document.getElementById("pmSettingsList"),type:r.prototype.TYPE_HORIZONTAL,size:3,data:[{title:d.token?gettext("Logout"):gettext("Login"),value:0,values:["&nbsp;"],description:" ",icon:"icon people",onclick:function(){var e,t=new c({hidden:!0,events:{keydown:function(e){e.code===s.ok?d.token?(o.settings.refreshToken=null,o.reload()):a.navigate("pl"):e.code===s.back&&(e.stop=!0,t.hide(),f.show(),t.$node.parentNode.removeChild(t.$node),n.focus())}}});t.$body.classList.add("modalExit"),t.$header.innerHTML=d.token?gettext("Logout from application?"):gettext("You want to login into app?"),t.$content.innerHTML="",t.$content.appendChild(e=document.createElement("div")),e.innerText=gettext("Ok"),e.className="btn confirm"+(g?" old":""),t.$content.appendChild(e=document.createElement("div")),e.className="btn back"+(g?" old":""),e.innerText=gettext("Cancel"),t.$footer.innerHTML="",a.current.add(t),f.hide(),t.show(),t.focus()}},{title:gettext("Safe mode"),value:o.settings.safeSearch,values:e.data.safeSearch,description:gettext("Hide unwanted content"),icon:0===o.settings.safeSearch?"icon settings-uncheck":"icon settings-check",onclick:function(t){var i=e.getNext("safeSearch",o.settings.safeSearch);t.$value.innerText=i.value,this.value=i.index,o.settings.safeSearch=i.index,0===i.index?this.icon=t.$icon.className="icon settings-uncheck":this.icon=t.$icon.className="icon settings-check"}},{title:gettext("Default extension"),value:o.settings.quality,values:e.data.quality,description:gettext("Choose default video quality"),icon:o.settings.quality<2?"icon player-HD":"icon player-SD",onclick:function(t){var i=e.getNext("quality",o.settings.quality);t.$value.innerText=i.value,this.value=i.index,o.settings.quality=i.index,o.settings.quality<2?this.icon=t.$icon.className="icon player-HD":this.icon=t.$icon.className="icon player-SD"}},{title:gettext("Language"),value:o.languageIndex,values:h.languagesLocalized,description:gettext("Interface language"),icon:"icon flag",onclick:function(e){var i=t.nextLang(this.value);this.value=i,y=i,e.$value.innerText=h.languagesLocalized[i]}}],render:function(e,t){e.ready||(e.$container=e.appendChild(document.createElement("div")),e.$container.className="container",e.$title=e.$container.appendChild(document.createElement("div")),e.$title.className="title",e.$value=e.$container.appendChild(document.createElement("div")),e.$value.className="value",e.$icon=e.$container.appendChild(document.createElement("div")),e.$description=e.appendChild(document.createElement("div")),e.$description.className="description",e.ready=!0),e.$title.innerText=t.title,e.$value.innerHTML=t.values[t.value],e.$icon.className=t.icon,e.$description.innerText=t.description},events:{keydown:function(){switch(event.code){case s.right:this.$focusItem.index<this.data.length-1&&(this.$focusItem.index>0?this.renderView(this.viewIndex+1):this.focusIndex(1));break;case s.left:this.viewIndex>0&&this.viewIndex<this.data.length-this.size?this.renderView(this.viewIndex+1):this.move(event.code);break;case s.ok:void 0!==this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:event})}},"click:item":function(e){e.$item.data.onclick(e.$item)},overflow:function(e){e.direction===s.left&&v.focus()}}}),m.add(n),n.renderView=function(e){var t,i,n,s,o;if(this.viewIndex!==e){for(s=this.viewIndex,this.viewIndex=o=e,i=0;i<this.size;i++)t=this.$body.children[i],n=this.data[e],void 0!==n?(t.data=n,t.index=e,this.renderItem(t,n),n.mark?t.classList.add("mark"):t.classList.remove("mark")):(t.data=t.index=void 0,t.innerHTML="",t.ready=!1),e++;return void 0!==this.events["move:view"]&&this.emit("move:view",{prevIndex:s,currIndex:o}),!0}return!1}),this.show(),n.focus(),n.focusIndex(0),m.focusEntry=n},m.addListener("hide",function(){var e,t,i;o.languageIndex!==y&&(e=new c({visible:!1,events:{keydown:function(t){t.code===s.ok?(o.settings.language=h.languages[y],y=-1,o.settings.languageOverwrite=1,o.reload()):t.code===s.back&&(y=-1,t.stop=!0,e.hide(),f.show(),e.$node.parentNode.removeChild(e.$node),i.focus())}}}),e.$body.classList.add("modalExit"),e.$header.innerHTML=gettext("In order to apply a new language, you must restart the application"),e.$content.innerHTML="",e.$content.appendChild(t=document.createElement("div")),t.innerText=gettext("Ok"),t.className="btn confirm"+(g?" old":""),e.$content.appendChild(t=document.createElement("div")),t.className="btn back"+(g?" old":""),t.innerText=gettext("Cancel"),e.$footer.innerHTML="",setTimeout(function(){a.current.add(e),f.hide(),e.show(),i=a.current.activeComponent,e.focus()},0))}),e.exports=m},function(e,t,i){"use strict";var n,s,o=i(1),a=i(4),r=i(11),l=i(7),c=(i(24),i(13)),d=i(20),u=i(18),h=new r({visible:!1,$node:document.getElementById("ppPanelVideo")}),p=new l({$node:document.getElementById("ppMenuList"),cycle:!0,size:3,visible:!1,data:[{value:"icon playlist"},{value:"icon related"},{value:"icon upload"}],render:function(e,t){e.className=t.value},events:{"focus:item":function(e){m[e.$curr.index].focus()}}}),m=[],v=-1,f=10;h.addListener("show",function(e){var t=m[0].$focusItem&&m[0].$focusItem.$videoThumb?0:1;n=e.video,s={id:n.channelId,title:n.channelTitle},p.show(),p.$focusItem=null,p.focusIndex(t),void 0!==e.onDelayPlayNext&&(f=e.onDelayPlayNext,v=setInterval(function(){0>=f?(m[t].$focusItem.$videoThumb.innerText="",m[t].emit("keydown",{code:o.right}),m[t].emit("keydown",{code:o.ok})):m[0].$focusItem&&m[0].$focusItem.$videoThumb&&(--f,m[0].$focusItem.$videoThumb.innerText=f)},1e3))}),h.addListener("hide",function(){p.hide(),clearInterval(v),m[p.$focusItem.index].$focusItem.$videoThumb.innerText=""}),m.push(new c({visible:!1,$node:document.getElementById("ppChannelVideoListNode"),$body:document.getElementById("ppChannelVideoListBody"),$title:document.getElementById("ppChannelTitle"),model:new d,type:l.prototype.TYPE_HORIZONTAL,events:{"view:ready":function(){this.focusIndex(0)},"view:error":function(){p.focusIndex(1)},focus:function(){this.show(),this.model.init({channel:s})},blur:function(){this.hide()},keydown:function(e){switch(e.code){case o.right:this.$focusItem&&this.$focusItem.index<this.data.length-1&&(this.$focusItem.index>0?(this.activePage++,this.renderView(this.activePage)):this.focusIndex(1));break;case o.left:this.activePage>0?(this.activePage--,this.renderView(this.activePage)):this.move(e.code);break;case o.ok:this.emit("click:item",{$item:this.$focusItem,event:e})}clearInterval(v),m[p.$focusItem.index].$focusItem&&(m[p.$focusItem.index].$focusItem.$videoThumb.innerText=""),(e.code===o.down||e.code===o.up)&&p.move(e.code)},"click:item":function(e){n=e.$item.data,a.player.playContent({channel:s,video:n,playlist:this.data,position:this.$focusItem.index})}}})),m.push(new c({visible:!1,$node:document.getElementById("ppVideoRelationsListNode"),$body:document.getElementById("ppVideoRelationsListBody"),$title:document.getElementById("ppVideoRelationsTitle"),model:new u,type:l.prototype.TYPE_HORIZONTAL,events:{focus:function(){this.show(),this.model.filter({relatedToVideoId:n.id})},"view:ready":function(){this.focusIndex(0)},blur:function(){this.hide()},keydown:function(e){switch(e.code){case o.right:this.$focusItem&&this.$focusItem.index<this.data.length-1&&(this.$focusItem.index>0?(this.activePage++,this.renderView(this.activePage)):this.focusIndex(1));break;case o.left:this.activePage>0?(this.activePage--,this.renderView(this.activePage)):this.move(e.code);break;case o.ok:this.emit("click:item",{$item:this.$focusItem,event:e})}clearInterval(v),m[p.$focusItem.index].$focusItem&&(m[p.$focusItem.index].$focusItem.$videoThumb.innerText=""),(e.code===o.down||e.code===o.up)&&p.move(e.code)},"click:item":function(e){n=e.$item.data,s={id:n.channelId,title:n.channelTitle},a.player.playContent({channel:s,video:n,playlist:this.data,position:this.$focusItem.index})}}})),m.push(new c({visible:!1,$node:document.getElementById("ppChannelUploadsListNode"),$body:document.getElementById("ppChannelUploadsVideoListBody"),$title:document.getElementById("ppChannelUploadsTitle"),model:new u,type:l.prototype.TYPE_HORIZONTAL,events:{focus:function(){this.show(),this.model.filter({channel:s})},"view:ready":function(){this.focusIndex(0)},blur:function(){this.hide()},keydown:function(e){switch(e.code){case o.right:this.$focusItem&&this.$focusItem.index<this.data.length-1&&(this.$focusItem.index>0?(this.activePage++,this.renderView(this.activePage)):this.focusIndex(1));break;case o.left:this.activePage>0?(this.activePage--,this.renderView(this.activePage)):this.move(e.code);break;case o.ok:this.emit("click:item",{$item:this.$focusItem,event:e})}clearInterval(v),m[p.$focusItem.index].$focusItem&&(m[p.$focusItem.index].$focusItem.$videoThumb.innerText=""),(e.code===o.down||e.code===o.up)&&p.move(e.code)},"click:item":function(e){n=e.$item.data,a.player.playContent({channel:s,video:n,playlist:this.data,position:this.$focusItem.index})}}})),m.forEach(function(e){h.add(e)}),m[0].model.addListener("content:changed",function(e){m[0].$title.innerHTML=e.channel.title}),m[1].model.addListener("content:changed",function(){m[1].$title.innerHTML=gettext("Related videos")}),m[2].model.addListener("content:changed",function(e){m[2].$title.innerHTML=gettext("Uploads on the channel")+" "+e.channel.title}),e.exports=h},function(e,t,i){"use strict";var n=i(4),s=i(62),o=i(10),a=i(12),r=new s({$node:document.getElementById("psKeyboard"),cycleY:!1,events:{"click:item":function(e){-1!==e.$item.data.className.indexOf("keyGlobe")?(n.settings.keyboardLanguage=o.nextLang(n.settings.keyboardLanguage),this.viewIndex=null,this.init({data:i(25)("./"+a.languages[n.settings.keyboardLanguage])})):-1!==e.$item.data.className.indexOf("nums")?this.init({data:[[{value:"1",className:"symbol"},{value:"2",className:"symbol"},{value:"3",className:"symbol"},{value:"4",className:"symbol"},{value:"5",className:"symbol"}],[{value:"6",className:"symbol"},{value:"7",className:"symbol"},{value:"8",className:"symbol"},{value:"9",className:"symbol"},{value:"0",className:"symbol"}],[{value:".",className:"symbol"},{value:",",className:"symbol"},{value:"-",className:"symbol"},{value:":",className:"symbol"},{value:"?",className:"symbol"}],[{value:"!",className:"symbol"},{value:"@",className:"symbol"},{value:"#",className:"symbol"},{value:"$",className:"symbol"},{value:"ABC",className:"symbol letters"}]]}):-1!==e.$item.data.className.indexOf("letters")&&this.init({data:i(25)("./"+a.languages[n.settings.keyboardLanguage])})}},render:function(e,t){e.innerHTML=t.value,t.className&&(e.className="item "+t.className)},data:i(25)("./"+a.languages[n.settings.keyboardLanguage])});e.exports=r},function(e,t,i){"use strict";function n(){d.isMuted&&(h.setMute(0),d.isMuted=!1,p.classList.remove("muted")),d.currentVolume>=f&&(d.currentVolume-=f,p.innerText=d.currentVolume.toString(),0!==d.currentVolume&&d.currentVolume-f>0?m.innerText=(d.currentVolume-f).toString():m.innerText="",v.innerText=(d.currentVolume+f).toString(),h.setVolume(d.currentVolume))}function s(){d.isMuted&&(h.setMute(0),d.isMuted=!1,p.classList.remove("muted")),d.currentVolume+f<=100&&(d.currentVolume+=f,p.innerText=d.currentVolume.toString(),100!==d.currentVolume?v.innerText=(d.currentVolume+f).toString():v.innerText="",h.setVolume(d.currentVolume),m.innerText=(d.currentVolume-f).toString())}function o(){d.isMuted?(h.setMute(0),d.isMuted=!1,p.classList.remove("muted")):(h.setMute(1),d.isMuted=!0,p.classList.add("muted"))}var a,r="volumeWidget",l=document.getElementById(r),c=i(23),d=new c({$node:l,visible:!1}),u=i(1),h=i(21),p=document.getElementById("volumeCurrentValue"),m=document.getElementById("volumeBotValue"),v=document.getElementById("volumeTopValue"),f=5;d.isMuted=!!h.isMuted(),d.currentVolume=h.getVolume(),p.innerText=d.currentVolume.toString(),d.currentVolume<=100-f&&(v.innerText=(d.currentVolume+f).toString()),d.currentVolume>=f?m.innerText=(d.currentVolume-f).toString():m.innerText="0",d.changeVolume=function(e){switch(e){case u.volumeDown:n();break;case u.volumeUp:s();break;case u.mute:o()}this.display(2)},d.display=function(e){d.visible&&clearTimeout(a),void 0!==e&&(a=setTimeout(function(){d.hide()},1e3*e)),this.show()},d.setValue=function(e){0>e||e>100||(this.currentVolume=e,p.innerText=d.currentVolume.toString(),0!==d.currentVolume&&d.currentVolume-f>0?m.innerText=(d.currentVolume-f).toString():m.innerText="",100!==d.currentVolume?v.innerText=(d.currentVolume+f).toString():v.innerText="")},e.exports=d},function(e,t){"use strict";e.exports={GCQmVzdCBvZiBZb3VUdWJl:"icon popular",GCUGFpZCBDaGFubmVscw:"icon purchases",GCTXVzaWM:"icon music",GCQ29tZWR5:"icon humor",GCRmlsbSAmIEVudGVydGFpbm1lbnQ:"icon entertainment",GCR2FtaW5n:"icon games",GCQmVhdXR5ICYgRmFzaGlvbg:"icon social",GCRnJvbSBUVg:"fa fa-youtube-play",GCQXV0b21vdGl2ZQ:"fa fa-car",GCQW5pbWF0aW9u:"fa fa-picture-o",GCVG9wIFlvdVR1YmUgQ29sbGVjdGlvbnM:"icon popular",GCVG9wIEJsb2dz:"icon social",GCU3BvcnRz:"icon sport",GCSG93LXRvICYgRElZ:"fa fa-wrench",GCVGVjaA:"icon hobbie",GCU2NpZW5jZSAmIEVkdWNhdGlvbg:"fa fa-book",GCQ29va2luZyAmIEhlYWx0aA:"fa fa-spoon",GCQ2F1c2VzICYgTm9uLXByb2ZpdHM:"fa fa-users",GCTmV3cyAmIFBvbGl0aWNz:"icon news",GCTGlmZXN0eWxl:"fa fa-leaf"}},function(e,t,i){"use strict";var n=i(8),s=i(6),o=i(3),a=i(19),r=new s;r.totalResults={},r.pages={},r.cacheKey=function(e){return"rec;p:"+e.page},r.getPage=function(e){var t=this;return e.page=+e.page||0,e.count=e.count||1,new n(function(i,n){var s,r=a.get(t.cacheKey(e));if(r)i(r);else{if(s=o.token?"activities?part=snippet&home=true":"videos?part=snippet&chart=mostPopular",s+="&maxResults="+e.count,e.page){if(!t.pages[e.page])return t.totalResults===e.page?void n("overflow"):void n("no page");s+="&pageToken="+t.pages[e.page]}o.request("GET",s).then(function(n){var s,o,r=[];for(n=JSON.parse(n),n.pageInfo.totalResults&&(t.totalResults=n.pageInfo.totalResults),n.nextPageToken&&(t.pages[e.page+1]=n.nextPageToken),n.prevPageToken&&(t.pages[e.page-1]=n.prevPageToken),n=n.items,s=0,o=n.length;o>s;++s)r.push({id:n[s].snippet.channelId,title:n[s].snippet.channelTitle,icon:n[s].snippet.thumbnails["default"].url});a.set(t.cacheKey(e),r,!1),i(r)})["catch"](function(e){})}})},e.exports=r},function(module,exports){window.YoutubeDL=function(){function getUrlFromObj(e,t){return parseSig=t!==!1,getUrlCallback=e||null,this.needSig?(getSig(this),null):(onGetUrlDone(this.error,this),this.url)}function urlToObj(e){var t,i,n,s={},o=new RegExp("^(([^:/\\?#]+):)?(//(([^:/\\?#]*)(?::([^/\\?#]*))?))?([^\\?#]*)(\\?([^#]*))?(#(.*))?$"),a=o.exec(e);for(t=a[8].substring(1).split("&"),n=0;n<t.length;n++)i=t[n].split("="),s[i[0]]=i[1]||"";return s}function ajax(e,t,i,n,s){var o,a=null,r=null,l=new XMLHttpRequest;if(l.onreadystatechange=function(){if(4===l.readyState){if(clearTimeout(r),"json"===s)try{a=JSON.parse(l.responseText)}catch(e){a=null}else a=l.responseText;"function"==typeof i&&i("xml"===s?l.responseXML:a,l.status)}},l.open(e,t,!0),n)for(o in n)n.hasOwnProperty(o)&&l.setRequestHeader(o,n[o]);return l.send(),r=setTimeout(function(){l.abort()},6e4),l}function onGetMapDone(e,t,i){"function"==typeof getInfoCallback&&getInfoCallback(e,t,i)}function onGetUrlDone(e,t){"function"==typeof getUrlCallback&&(t=t||{},getUrlCallback(e,t.url))}function clear(){hashUrl={},info={ageGate:!1,author:"",description:"",lengthSeconds:0,playerUrl:null,thumb:null,title:"",uploadDate:"",uploaderId:"",url:"",urlMap:[],urlMapBad:[],videoId:null,viewCount:"",ypc_video_rental_bar_text:null,error:null}}function getUrls(e){var t;clear(),info.videoId=e,t="https://www.youtube.com/watch?v="+info.videoId+"&gl=US&hl=en&has_verified=1&bpctr=9999999999",ajax("GET",t,parseUrls,null,null)}function parseUrls(e){var t;return info.playerUrl=null,t=/swfConfig.*?"(https?:\/\/.*?watch.*?-.*?\.swf)"/,-1!==e.search(t)?(info.error={},info.error.message="Flash player is not supported",info.error.videoId=info.videoId,void onGetMapDone(info.error,info,null)):(t=/player-age-gate-content">/,-1!==e.search(t)?(info.ageGate=!0,ajax("GET","https://www.youtube.com/embed/"+info.videoId,parseAgeGate,null,null),null):(info.ageGate=!1,void parseInfo(e)))}function parseAgeGate(e){var t,i,n,s;try{t=/<link itemprop="url" href="http:\/\/www.youtube.com\/(?:user|channel)\/([^"]+)">/,i=t.exec(e),i?info.uploaderId=i[1]:info.uploaderId=null,t=/<span itemprop="thumbnail".*?href="(.*?)">/,i=t.exec(e),i&&(info.thumb=i[1]),t=/id="eow-date.*?>(.*?)<\/span>/,i=t.exec(e),i?info.uploadDate=i[1]:(t=/id="watch-uploader-info".*?>.*?(?:Published|Uploaded|Streamed live) on (.*?)<\/strong>/,i=t.exec(e),i?info.uploadDate=i[1]:info.uploadDate=""),t=/<h4[^>]*>\s*Category\s*<\/h4>\s*<ul[^>]*>\s*(.*?)\s*<\/ul>/,i=t.exec(e),i&&(t=/<a[^<]+>(.*?)<\/a>/g,i=t.exec(i[1]),i[1]&&(info.category=i[1])),t=/id="eow-description"[^>]*>(.*)?<\/p>/,i=t.exec(e),i?info.description=i[1]:(t=/<meta name="description" content="([^"]+)"/,i=t.exec(e),i?info.description=i[1]:info.description=""),n="https://youtube.googleapis.com/v/"+info.videoId,n=encodeURIComponent(n),t=/sts":\s*(\d+)/,i=t.exec(e),s="https://www.youtube.com/get_video_info?eurl="+n+"&sts="+i[1]+"&video_id="+info.videoId,ajax("GET",s,parseInfoAge,null,null)}catch(o){info.error={},info.error.message=o.message,info.error.videoId=info.videoId,onGetMapDone(info.error,info)}}function parseInfoAge(e){var t,i,n,s,o,a,r,l,c,d,u,h,p,m,v=e.split(";"),f={},g=null;try{for(n=0;n<v.length;n++)for(i=v[n].split("&"),s=0;s<i.length;s++)t=i[s].split("="),f[t[0]]=t[1]||"";if(f.view_count?info.viewCount=f.view_count:info.viewCount=0,f.author?info.author=f.author:info.author="",f.title?info.title=f.title:info.title="",info.category="",f.length_seconds?info.lengthSeconds=parseInt(f.length_seconds,10):info.lengthSeconds=0,f.ypc_video_rental_bar_text?info.ypc_video_rental_bar_text=f.ypc_video_rental_bar_text:info.ypc_video_rental_bar_text=null,f.thumbnail_url?info.thumb=f.thumbnail_url:info.thumb=null,!f.token)return f.reason?(info.error={},info.error.message="YouTube said: "+f.reason,info.error.videoId=info.videoId):(info.error={},info.error.message='"token" parameter not in video info for unknown reason',info.error.videoId=info.videoId),void onGetMapDone(info.error,info);if("ypc_video_rental_bar_text"in f&&!info.author)return info.error={},info.error.message='"rental" videos not supported',info.error.videoId=info.videoId,void onGetMapDone(info.error,info);if(f.conn&&f.conn[0])return info.url=f.conn[0],info.urlMap=[Object.create(urlDefObj)],info.urlMap[0].url=info.url,info.urlMap.format=formats.conn,void onGetMapDone(info.error,info,info.urlMap[0]);if(info.urlMap=[],"rtmpe%3Dyes"in f)return info.error={},info.error.message="rtmpe downloads are not supported",info.error.videoId=info.videoId,void onGetMapDone(info.error,info);if(f.url_encoded_fmt_stream_map||f.adaptive_fmts){o=(f.url_encoded_fmt_stream_map||"")+","+(f.adaptive_fmts||""),p=o.split(",");for(n in p)if(c="",d={},p.hasOwnProperty(n)){for(a=decodeURIComponent(p[n]),r=a.slice(a.indexOf("?")+1).split("&"),
  a=[],s=0;s<r.length;s++)l=r[s].split("="),a.push(l[0]),a[l[0]]=decodeURI(l[1]);if("itag"in a&&"url"in a)if(d=a.itag,c=decodeURI(decodeURI(decodeURIComponent(a.url.replace(/\+/g,"%20")))),d in formats){if("ratebypass"in a&&(c+="&ratebypass=yes"),"sig"in a)c+="&signature="+a.sig;else if("s"in a){if(u=/"assets":.+?"js":\s*("[^"]+")/,h=u.exec(e),g=h[1],u=/"(.*)"/,h=u.exec(g),h&&h[1]&&(g=h[1]),!g&&!info.ageGate)return;m=Object.create(urlDefObj,{format:{value:formats[d]},formatId:{value:parseInt(d,10)},sig:{value:a.s},playerUrl:{value:g}}),m.url=c,m.needSig=!0,info.urlMap.push(m);continue}m=Object.create(urlDefObj,{format:{value:formats[d]},formatId:{value:parseInt(d,10)},sig:{value:a.s},playerUrl:{value:g}}),m.url=c,m.needSig=!1,info.urlMap.push(m)}else m=Object.create(urlDefObj,{format:{value:formats[d]},formatId:{value:parseInt(d,10)},sig:{value:a.s},playerUrl:{value:g}}),m.url=c,m.needSig=!1,info.urlMapBad.push(m)}return info.urlMap.length&&(info.urlMap.sort(function(e,t){return e.formatId<t.formatId?-1:e.formatId>t.formatId?1:0}),info.urlMap.sort(function(e,t){return e.format.height>t.format.height?-1:e.format.height<t.format.height?1:0}),info.url=info.urlMap[0].needSig?null:info.urlMap[0].url),void onGetMapDone(info.error,info,info.urlMap[0])}onGetMapDone(info.error,info)}catch(y){info.error={},info.error.message=y.message,info.error.videoId=info.videoId,onGetMapDone(info.error,info)}}function parseInfo(e){var t,i,n,s,o,a,r,l,c,d,u,h,p,m,v=null;try{if(r=/;ytplayer\.config\s*=\s*({.*?});/,l=r.exec(e),l?(c=JSON.parse(l[1]),d=c.args):d={},getInfo(e,d),!d.token)return d.reason?(info.error={},info.error.message="YouTube said: "+d.reason,info.error.videoId=info.videoId):(info.error={},info.error.message='"token" parameter not in video info for unknown reason',info.error.videoId=info.videoId),void onGetMapDone(info.error,info);if("ypc_video_rental_bar_text"in d&&!info.author)return info.error={},info.error.message='"rental" videos not supported',info.error.videoId=info.videoId,void onGetMapDone(info.error,info);if(d.conn&&d.conn[0])return info.url=d.conn[0],info.urlMap=[Object.create(urlDefObj)],info.urlMap[0].url=info.url,info.urlMap.format=formats.conn,void onGetMapDone(info.error,info,info.urlMap[0]);if(info.urlMap=[],"rtmpe%3Dyes"in d)return info.error={},info.error.message="rtmpe downloads are not supported",info.error.videoId=info.videoId,void onGetMapDone(info.error,info);if(d.url_encoded_fmt_stream_map||d.adaptive_fmts){t=(d.url_encoded_fmt_stream_map||"")+","+(d.adaptive_fmts||""),u=t.split(",");for(m in u)if(o="",a={},u.hasOwnProperty(m)){for(i=u[m],n=i.slice(i.indexOf("?")+1).split("&"),i=[],p=0;p<n.length;p++)s=n[p].split("="),i.push(s[0]),i[s[0]]=decodeURI(s[1]);if("itag"in i&&"url"in i)if(a=i.itag,o=decodeURI(decodeURI(decodeURIComponent(i.url.replace(/\+/g,"%20")))),a in formats){if("ratebypass"in i&&(o+="&ratebypass=yes"),"sig"in i)o+="&signature="+i.sig;else if("s"in i){if(r=/"assets":.+?"js":\s*("[^"]+")/,l=r.exec(e),v=l[1],r=/"(.*)"/,l=r.exec(v),l&&l[1]&&(v=l[1]),!v&&!info.ageGate)return;h=Object.create(urlDefObj,{format:{value:formats[a]},formatId:{value:parseInt(a,10)},sig:{value:i.s},playerUrl:{value:v}}),h.url=o,h.needSig=!0,info.urlMap.push(h);continue}h=Object.create(urlDefObj,{format:{value:formats[a]},formatId:{value:parseInt(a,10)},sig:{value:i.s},playerUrl:{value:v}}),h.url=o,h.needSig=!1,info.urlMap.push(h)}else h=Object.create(urlDefObj,{format:{value:formats[a]},formatId:{value:parseInt(a,10)},sig:{value:i.s},playerUrl:{value:v}}),h.url=o,h.needSig=!1,info.urlMapBad.push(h)}return info.urlMap.length&&(info.urlMap.sort(function(e,t){return e.formatId<t.formatId?-1:e.formatId>t.formatId?1:0}),info.urlMap.sort(function(e,t){return e.format.height>t.format.height?-1:e.format.height<t.format.height?1:0}),info.url=info.urlMap[0].needSig?null:info.urlMap[0].url),void onGetMapDone(info.error,info,info.urlMap[0])}onGetMapDone(info.error,info)}catch(f){info.error={},info.error.message=f.message,info.error.videoId=info.videoId,onGetMapDone(info.error,info)}}function getInfo(e,t){var i,n;t.view_count?info.viewCount=t.view_count:info.viewCount=0,t.author?info.author=t.author:info.author="",i=/<link itemprop="url" href="http:\/\/www.youtube.com\/(?:user|channel)\/([^"]+)">/,n=i.exec(e),n?info.uploaderId=n[1]:info.uploaderId=null,t.title?info.title=t.title:info.title="",i=/<span itemprop="thumbnail".*?href="(.*?)">/,n=i.exec(e),n?info.thumb=n[1]:t.thumbnail_url?info.thumb=t.thumbnail_url:info.thumb=null,i=/id="eow-date.*?>(.*?)<\/span>/,n=i.exec(e),n?info.uploadDate=n[1]:(i=/id="watch-uploader-info".*?>.*?(?:Published|Uploaded|Streamed live) on (.*?)<\/strong>/,n=i.exec(e),n?info.uploadDate=n[1]:info.uploadDate=""),info.category="",i=/<h4[^>]*>\s*Category\s*<\/h4>\s*<ul[^>]*>\s*(.*?)\s*<\/ul>/,n=i.exec(e),n&&(i=/<a[^<]+>(.*?)<\/a>/g,n=i.exec(n[1]),n[1]&&(info.category=n[1])),i=/id="eow-description"[^>]*>(.*)?<\/p>/,n=i.exec(e),n?info.description=n[1]:(i=/<meta name="description" content="([^"]+)"/,n=i.exec(e),n?info.description=n[1]:info.description=""),t.length_seconds?info.lengthSeconds=parseInt(t.length_seconds,10):info.lengthSeconds=0,t.ypc_video_rental_bar_text?info.ypc_video_rental_bar_text=t.ypc_video_rental_bar_text:info.ypc_video_rental_bar_text=null}function getSig(obj){function getSigParseJS(responseText){var jsplayer;regExp=/\.sig\|\|([a-zA-Z0-9$]+)\(/,matchObject=regExp.exec(responseText),responseText=responseText.replace(/}\)\(\);$/m,"");try{responseText+="return "+matchObject[1]+'("'+obj.sig+'");})()',jsplayer=eval(responseText)}catch(e){return obj.error={},obj.error.videoId=info.videoId,obj.error.playerUrl=obj.playerUrl,obj.error.message=e.message,void onGetUrlDone(obj.error,obj)}hashUrl[hash]=jsplayer,obj.url+="&signature="+jsplayer,obj.needSig=!1,onGetUrlDone(obj.error,obj)}var encryptedSig,regExp,matchObject,playerUrl,hashes,hash,i;if(encryptedSig=obj.sig,playerUrl=obj.playerUrl,!playerUrl)return obj.error={},obj.error.videoId=info.videoId,obj.error.message="Cannot decrypt signature without player_url",obj.error.playerUrl=obj.playerUrl,onGetUrlDone(obj.error,obj),!1;playerUrl=playerUrl.replace(/\\\//g,"/"),0===playerUrl.indexOf("//")&&(playerUrl="https:"+playerUrl),hashes=encryptedSig.split("."),hash=[];for(i in hashes)hash.push(hashes[i].length);if(hash=hash.join("."),hash=playerUrl+"_"+hash,hash in hashUrl)obj.url+="&signature="+hashUrl[hash],onGetUrlDone(obj.error,obj);else{if(regExp=/.*?-([a-zA-Z0-9_-]+)(?:\/watch_as3|\/html5player)?\.([a-z]+)$/,matchObject=regExp.exec(playerUrl),!matchObject||!matchObject[2])return obj.error={},obj.error.videoId=info.videoId,obj.error.message="Cannot identify player",obj.error.playerUrl=obj.playerUrl,onGetUrlDone(obj.error,obj),!1;if("js"===matchObject[2])return parseSig!==!1?(ajax("GET",playerUrl,getSigParseJS),!0):(obj.error={},obj.error.videoId=info.videoId,obj.error.message="Parsing signature is off",obj.error.playerUrl=obj.playerUrl,onGetUrlDone(obj.error,obj),!1);if("swf"===matchObject[2])return obj.error={},obj.error.videoId=info.videoId,obj.error.message="Flash player is not supported",obj.error.playerUrl=obj.playerUrl,onGetUrlDone(obj.error,obj),!1;obj.error={},obj.error.videoId=info.videoId,obj.error.playerUrl=obj.playerUrl,obj.error.message="Player type is not detected",onGetUrlDone(obj.error,obj)}return!0}var urlDefObj={id:null,error:null,format:{},ageGate:!1,formatId:0,needSig:!1,sig:null,url:"",getUrl:getUrlFromObj},getInfoCallback=null,getUrlCallback=null,formats={5:{ext:"flv",width:400,height:240},6:{ext:"flv",width:450,height:20},13:{ext:"3gp"},17:{ext:"3gp",width:176,height:144},18:{ext:"mp4",width:640,height:360},22:{ext:"mp4",width:1280,height:720},34:{ext:"flv",width:640,height:360},35:{ext:"flv",width:854,height:480},36:{ext:"3gp",width:320,height:240},37:{ext:"mp4",width:1920,height:1080},38:{ext:"mp4",width:4096,height:3072},43:{ext:"webm",width:640,height:360},44:{ext:"webm",width:854,height:480},45:{ext:"webm",width:1280,height:720},46:{ext:"webm",width:1920,height:1080},82:{ext:"mp4",height:360,formatNote:"3D",preference:-20},83:{ext:"mp4",height:480,formatNote:"3D",preference:-20},84:{ext:"mp4",height:720,formatNote:"3D",preference:-20},85:{ext:"mp4",height:1080,formatNote:"3D",preference:-20},100:{ext:"webm",height:360,formatNote:"3D",preference:-20},101:{ext:"webm",height:480,formatNote:"3D",preference:-20},102:{ext:"webm",height:720,formatNote:"3D",preference:-20},92:{ext:"mp4",height:240,formatNote:"HLS",preference:-10},93:{ext:"mp4",height:360,formatNote:"HLS",preference:-10},94:{ext:"mp4",height:480,formatNote:"HLS",preference:-10},95:{ext:"mp4",height:720,formatNote:"HLS",preference:-10},96:{ext:"mp4",height:1080,formatNote:"HLS",preference:-10},132:{ext:"mp4",height:240,formatNote:"HLS",preference:-10},151:{ext:"mp4",height:72,formatNote:"HLS",preference:-10},conn:{protocol:"conn"},rtmp:{protocol:"rtmp"}},parseSig=!0,hashUrl={},info={},container={};return container.getInfo=function(e,t){var i={};if(getInfoCallback=t||null,e&&0===e.indexOf("http")){if(i=urlToObj(e),!i.v)return info.error={},info.error.videoId=info.videoId,info.error.message="URL has not video id",!1}else i.v=e;return getUrls(i.v),!0},clear(),container}()},function(e,t){"use strict";e.exports=function(e,t){var i;return function(){var n=this,s=arguments;clearTimeout(i),i=setTimeout(function(){i=null,e.apply(n,s)},t)}}},function(e,t,i){"use strict";function n(e,t){return new s(function(i,n){e.onload=function(){200===this.status?i(this.responseText):n(401===this.status?this.status:this.statusText)},e.onerror=function(){n()},e.send(t)})}var s=i(8);e.exports=n},function(e,t,i){"use strict";var n="pi",s=i(16),o=new s({$node:document.getElementById(n)});e.exports=o},function(e,t,i){"use strict";function n(e){return"window."+e+".id"}function s(e,t){var i,s=n(e),o=stbStorage.getItem(s);if(o)try{i=JSON.parse(stbWindowMgr.windowInfo(o)),-1===i.result.url.indexOf(t)&&stbWebWindow.messageSend(o,"window.load",t),e===u.BROWSER?(o=stbWindowMgr.openWebFace(t),stbStorage.setItem(s,o)):stbWindowMgr.windowShow(o)}catch(a){debug.error(a),stbWindowMgr.openWebFace(t)}else o=e===u.BROWSER?stbWindowMgr.openWebFace(t):stbWindowMgr.windowInit(JSON.stringify({url:t,backgroundColor:"#000"})),stbStorage.setItem(s,o);return o}var o=i(4),a=i(2),r=i(16),l=i(15),c=i(3),d=new r({$node:document.getElementById("pl")}),u={PORTAL:"portal",HELP:"help",DOWNLOAD_MANAGER:"dlman",PVR:"recordsManager",BROWSER:"ibman",BROWSER_VIEW:"ibmanView",PORTALS_LOADER:"portalsLoader",SYSTEM_SETTINGS:"systemSettings"};d.id="pl",d.addListener("show",function(){var e,t,i=-1,r=0,d={480:{x:47,y:0,w:640,h:432},576:{x:55,y:0,w:637,h:528},720:{x:15,y:0,w:1280,h:720},1080:{x:10,y:0,w:1920,h:1080}};l.updateView({},"pageLogin"),t=d[window.screen.height],setTimeout(function(){s(u.BROWSER,"file:///home/web/public/app/ibman/index.html?mode=2&view=1&url="+encodeURIComponent(c.AUTH_URL))},0),i=setInterval(function(){var s,l=stbWindowMgr.getCurrWebUrl(),d={};if(e=stbStorage.getItem(n(u.BROWSER)),0===l.length&&r>10){try{stbWebWindow.messageSend(e,"close")}catch(h){}return clearInterval(i),void a.back()}++r,stbWindowMgr.SetVirtualKeyboardCoord("bottom"),stbWindowMgr.resizeWebWindow(t.x,t.y,t.w,t.h),-1!==l.indexOf("#")&&-1!==l.indexOf("code")&&(l=l.split("?")[1].replace("#","").split("&"),l.forEach(function(e){s=e.split("="),d[s[0]]=s[1]}),d.code&&(clearInterval(i),stbWebWindow.messageSend(e,"close"),c.postAuth(d.code).then(function(e){o.settings.refreshToken=e.refreshToken,o.settings.sessionToken=e.sessionToken,o.settings.credentialsIndex=c.credentialsIndex,location.reload()},function(){location.reload()})))},1e3)}),e.exports=d},function(e,t,i){"use strict";var n,s,o=i(2),a=i(1),r=i(4),l=i(16),c="pm",d=i(15),u=new l({$node:document.getElementById(c)});u.addListener("keydown",function(e){e.code===a.info?n.visible?s.content.tabs[s.activeTab].activate():n.focus():e.code===a.f3?o.navigate("ps"):e.code===a.back&&(o.back()||r.emit("keydown",{code:a.exit}))}),u.addListener("show",function(e){d.updateView({SEARCH:{icon:"search",visible:!0,text:gettext("Search")},MORE:{icon:"more",visible:!1,text:""},GUIDE:{icon:"info",visible:!0,text:gettext("Guide")},BACK:{icon:"back",visible:!0,text:gettext("Exit")}},"pageMain"),e.data&&e.data.channel?(s.content.tabs[s.activeTab].hide(),s.activeTab=1,s.content.tabs[s.activeTab].activate(e.data.channel)):s.content.tabs.length>0&&s.content.tabs[s.activeTab].activate()}),u.addListener("hide",function(){i(9).hide()}),u.addListener("load",function(){s=i(26),u.add(n=i(14)),n.addListener("show",function(){d.updateView({SEARCH:{icon:"search",visible:!1,text:gettext("Search")},GUIDE:{icon:"info",visible:!0,text:gettext("Close Guide")}},"pageMain")}),n.addListener("hide",function(){d.updateView({SEARCH:{icon:"search",visible:!0,text:gettext("Search")},GUIDE:{icon:"info",visible:!0,text:gettext("Guide")}},"pageMain")}),s.content.tabs.push(i(38)),s.content.tabs.push(i(39)),s.content.tabs.push(i(41)),s.content.tabs.push(i(40)),s.content.tabs.forEach(function(e){u.add(e)}),s.content.tabs[s.activeTab].activate(),i(3).token?i(17).getMine().then(function(e){window.pmUserInfo.data={disabled:!0},window.pmUserInfo.appendChild(document.createElement("div")),window.pmUserInfo.firstChild.style.backgroundImage="url("+e.icon+")",window.pmUserInfo.firstChild.classList.add("userImage"),window.pmUserInfo.appendChild(document.createElement("div")),window.pmUserInfo.children[1].innerHTML=e.title,window.pmUserInfo.children[1].classList.add("userName")})["catch"](function(e){}):window.pmUserInfo.style.display="none"}),e.exports=u},function(e,t,i){"use strict";function n(e,t){return e?(window.ppVideoParseErrorMessage.innerHTML=gettext("Video is not available"),o.hide(),l.show(),void(N=!1)):(E.url=t,void r.play(t,{proxy:d}))}var s,o,a,r,l,c,d,u=i(16),h=i(61),p=i(7),m=new u({$node:window.pp}),v=i(2),f=i(1),g=i(4),y=i(56),b=i(11),w=i(64),T=i(17),x=new w({$node:window.playerProgressBar}),I=i(15),$=i(9),E={channel:null,video:null,playlist:null,position:0},S="MAG200"!==gSTB.GetDeviceModelExt(),N=!1;m.addListener("show",function(e){I.updateView({SEARCH:{icon:"search",visible:!0,text:gettext("Search")},MORE:{icon:"more",visible:!0,text:gettext("More")},GUIDE:{icon:"info",visible:!1,text:gettext("Guide")},BACK:{icon:"back",visible:!0,text:gettext("Back")}}),a.hide(),x.set(0),e.data?(o.display(10),r.playContent(e.data)):o.display(5)}),m.addListener("load",function(){var e=[{icon:"home",value:gettext("To the main"),onclick:function(){v.back()}},{icon:"player-prev",value:gettext("Previous"),onclick:function(){E.playlist&&E.playlist.length&&E.position>0&&(--E.position,r.playContent({video:E.playlist[E.position]}))}},{icon:"player-rew",value:gettext("Back"),onclick:function(){r.rewind(!1,10)}},{icon:"player-play",value:gettext("Play"),onclick:function(){r.playPause(),r.isPause?(this.$icon.className="icon player-play",this.$text.innerText=gettext("Play")):(this.$icon.className="icon player-pause",this.$text.innerText=gettext("Pause"))}},{icon:"player-ff",value:gettext("Forward"),onclick:function(){r.rewind(!0,10)}},{icon:"player-next",value:gettext("Next"),onclick:function(){E.playlist&&E.playlist.length&&E.playlist.length>E.position+1&&(++E.position,r.playContent({video:E.playlist[E.position]}))}}],t=i(28);d=g.params.proxy,m.add(s=new p({$node:window.playerPanelButtons,data:e,size:e.length,type:p.prototype.TYPE_HORIZONTAL,render:function(e,t){e.button=new h({$node:e,icon:t.icon,value:t.value,events:{click:t.onclick}}),e.classList.add(t.icon),m.add(e.button)},events:{"click:item":function(e){e.$item.button.emit("click")},keydown:function(e){switch(e.code){case f.right:case f.left:case f.home:case f.end:o.display(5),this.move(e.code);break;case f.ok:this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e});break;case f.info:e.stop=!0,o.display();break;case f.up:case f.down:o.hide(),a.show(E),I.show();break;case f.playPause:r.playPause(),e.stop=!0;break;case f.forward:r.rewind(!0,10);break;case f.rewind:r.rewind(!1,10);break;case f.pageDown:E.playlist&&E.playlist.length&&E.playlist.length>E.position+1&&(++E.position,r.playContent({video:E.playlist[E.position]}));break;case f.pageUp:E.playlist&&E.playlist.length&&E.position>0&&(--E.position,r.playContent({video:E.playlist[E.position]}))}}}})),c=s.$body.children[3].button,a=i(42),a.addListener("show",function(){I.updateView({SEARCH:{icon:"search",visible:!0,text:gettext("Search")},MORE:{visible:!1},GUIDE:{icon:"info",visible:!1,text:gettext("Guide")},BACK:{icon:"back",visible:!0,text:gettext("Back")}})}),a.addListener("hide",function(){I.updateView({SEARCH:{icon:"search",visible:!0,text:gettext("Search")},MORE:{icon:"more",visible:!0,text:gettext("More")},GUIDE:{visible:!1},BACK:{icon:"back",visible:!0,text:gettext("Back")}})}),m.add(a),r=new y({$node:window.playerSpace,rewindTimeout:600,events:{keydown:function(e){switch(e.code){case f.up:case f.down:case f.info:return void o.display();case f.ok:case f.playPause:e.stop=!0,this.playPause();break;case f.forward:case f.right:this.rewind(!0,10),o.display(6);break;case f.rewind:case f.left:this.rewind(!1,10),o.display(6);break;case f.pageDown:E.playlist&&E.playlist.length&&E.position>0&&(--E.position,r.playContent({video:E.playlist[E.position]}));break;case f.pageUp:E.playlist&&E.playlist.length&&E.playlist.length>E.position+1&&(++E.position,r.playContent({video:E.playlist[E.position]}))}}}}),g.addListener("media",function(e){y.prototype.defaultEvents.media.call(r,e)}),o=new b({$node:window.playerGrid,visible:!1,events:{show:function(){s.focus(),s.focusIndex(3),I.updateView({SEARCH:{icon:"search",visible:!0,text:gettext("Search")},MORE:{icon:"more",visible:!0,text:gettext("More")},GUIDE:{icon:"info",visible:!1,text:gettext("Guide")},BACK:{icon:"back",visible:!0,text:gettext("Back")}}),I.show()},hide:function(){v.current&&(I.hide(),r.focus())}}}),o.displayTimeout=-1,o.display=function(e){var t=this;e?(e=1e3*e,this.show(),this.displayTimeout&&(clearTimeout(this.displayTimeout),this.displayTimeout=0),this.displayTimeout=setTimeout(function(){t.hide(),t.displayTimeout=0},e)):this.displayTimeout?(clearTimeout(this.displayTimeout),this.displayTimeout=0):this.visible?this.hide():this.show()},m.add(r),r.add(o),g.player=r,r.playContent=function(e){N=!0,l.hide(),$.show(),YoutubeDL.getInfo(e.video.id,function(i,s){var r,c,d,u,h=144;if(void 0!==e.channel?E.channel=e.channel:E.channel={title:e.video.channelTitle,id:e.video.channelId},void 0!==e.playlist&&(E.playlist=e.playlist),void 0!==e.position&&(E.position=e.position),E.video=e.video,a.hide(),o.visible||o.display(5),x.set(0),i)return ga("send","event","error",i.message,i.videoId),ga("send","exception",{exDescription:i.message+" "+i.videoId,exFatal:!1}),"0:00"===e.video.duration?window.ppVideoParseErrorMessage.innerHTML=gettext("Live broadcasts are not supported"):window.ppVideoParseErrorMessage.innerHTML=gettext("Video is not available"),o.hide(),l.show(),void(N=!1);if(s.ageGate&&g.settings.safeSearch)return window.ppVideoParseErrorMessage.innerHTML=gettext("Adult content"),o.hide(),l.show(),void(N=!1);if(0===s.urlMap.length)return"0:00"===e.video.duration?window.ppVideoParseErrorMessage.innerHTML=gettext("Live broadcasts are not supported"):window.ppVideoParseErrorMessage.innerHTML=gettext("Video is not available"),o.hide(),l.show(),void(N=!1);for(c=parseInt(t.data.quality[g.settings.quality].replace("p",""),10),c||(c=1080),d=0,u=s.urlMap.length;u>d;++d){if(s.urlMap[d].format.height===c){s.urlMap[d].getUrl(n,S),c=!1;break}s.urlMap[d].format.height>h&&(h=s.urlMap[d].format.height,r=s.urlMap[d])}c&&r.getUrl(n,S)})},r.addListeners({pause:function(e){e.state?(c.$icon.className="icon player-play",c.$text.innerText=gettext("Play")):(c.$icon.className="icon player-pause",c.$text.innerText=gettext("Pause")),a.visible||(e.state&&!o.visible?o.display():o.visible||o.display(5))},duration:function(e){this.rewindHelper.isActive||this.setModeHelper.active||(x.set(e.sec),window.playerCurrentDuration.innerText=e.time)},"get:info":function(e){var t;E.urlParseErrorCount=!1,$.hide(),window.ppPanelPlayer.classList.add("transparent"),window.playerTotalDuration.innerText=e.totalDuration,x.init({value:0,max:e.totalDurationSec}),E.channel.icon?window.playerChannelIcon.style.backgroundImage='url("'+E.channel.icon+'")':(window.playerChannelIcon.style.backgroundImage="none",T.getInfo(E.channel.id).then(function(e){e&&e.length>0&&(E.channel.icon=e[0].snippet.thumbnails.high.url,window.playerChannelIcon.style.backgroundImage='url("'+E.channel.icon+'")')})["catch"](function(e){})),window.playerChannelName.innerText=E.channel.title,window.playerVideoName.innerHTML=E.video.title,t=E.video.publishedAt.match(/(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d).(\d\d\d)Z/),t.shift(),t.pop(),t[1]-=1,window.playerVideoPublishedAt.innerText=gettext("Upload date")+": "+t[2]+" "+t[1]+" "+t[0]+" г.",window.playerVideoViewCount.innerText=ngettext("View","Views",+E.video.viewCount)+": "+E.video.viewCount,c.$icon.className="icon player-pause",c.$text.innerText=gettext("Pause"),N=!1},rewind:function(e){var t=r.parseTime(e.time),i="";x.set(e.time),+t.hour&&(i+=t.hour+":"),i+=t.min+":"+t.sec,window.playerCurrentDuration.innerText=i},"rewind:start":function(){x.$node.classList.add("rewind")},"rewind:apply":function(){x.$node.classList.remove("rewind")},"position:input":function(e){e.start&&window.playerCurrentDuration.classList.add("setMode"),e.end&&window.playerCurrentDuration.classList.remove("setMode"),x.set(e.sec),window.playerCurrentDuration.innerText=e.time},"content:end":function(){var e=JSON.parse(JSON.stringify(E));e.playlist&&e.playlist.length>e.position+1?(++e.position,e.video=e.playlist[e.position],e.channel={title:e.video.channelTitle,id:e.video.channelId},r.playContent(e)):(window.ppPanelPlayer.classList.remove("transparent"),e.onDelayPlayNext=10,++e.position,o.hide(),a.hide(),a.show(e))},"content:error":function(){ga("send","event","error","error file open",JSON.stringify({id:E.video.id,url:E.url})),E.urlParseErrorCount||(E.urlParseErrorCount=0),E.urlParseErrorCount>2?(window.ppVideoParseErrorMessage.innerHTML=gettext("Video is not available"),l.show(),N=!1):(++E.urlParseErrorCount,N=!1,r.playContent(E))}}),l=new b({$node:document.getElementById("ppVideoParseError"),visible:!1,focusable:!0,events:{show:function(){$.hide(),o.hide(),this.focus(),window.ppPanelPlayer.classList.remove("transparent")},keydown:function(e){e.stop=!0,l.hide(),o.hide(),a.show(E)}}}),window.ppVideoParseErrorHeader.innerHTML=gettext("Error playing"),window.ppVideoParseErrorMessage.innerHTML=gettext("Video is not available")}),m.addListener("keydown",function(e){switch(e.code){case f.exit:N&&(event.stop=!0);break;case f.back:a.visible?(a.hide(),0===x.value?v.back():(I.show(),o.show())):m.activeComponent===r?v.back():r.totalDurationSec===r.currentSec?v.back():o.hide();break;case f.stop:r.stop(),r.isPause=!1,c.button.emit("click"),$.hide(),window.ppPanelPlayer.classList.remove("transparent"),o.hide(),a.show(E);break;case f.down:m.activeComponent===o&&(o.hide(),a.show(E));break;case f.playPause:r.playPause();break;case f.f3:v.navigate("ps")}}),m.addListener("hide",function(){$.hide(),r.stop(),o.hide(),a.hide()}),e.exports=m},function(e,t,i){"use strict";var n,s,o="ps",a=i(1),r=i(2),l=i(16),c=i(37),d=i(13),u=i(18),h=i(48),p=i(15),m=(i(12),new l({$node:document.getElementById(o)})),v=new c({$node:document.getElementById("psSearch"),$body:document.getElementById("psSearchInput")}),f=i(9),g=" ",y=null,b=-1;m.addListener("keydown",function(e){e.code===a.back&&r.back()}),m.addListener("hide",function(){f.hide()}),s=h(function(e){g=e.value,y.model.filter({searchQuery:e.value}),clearTimeout(b),b=setTimeout(function(){f.hide()},5e3)},1e3),m.addListener("show",function(){p.updateView({SEARCH:{icon:"search",visible:!1,text:""},MORE:{icon:"more",visible:!1,text:""},GUIDE:{icon:"info",visible:!1,text:""},BACK:{icon:"back",visible:!0,text:gettext("Back")}}),f.hide(),m.activeComponent&&m.activeComponent!==v||setTimeout(function(){v.focus()},0)}),m.addListener("load",function(){n=i(43),v.addListener("keydown",function(e){e.code===a.down?n.focus():e.code===a.up&&y.visible&&(y.focus(),y.$focusItem||y.focusIndex(0))}),v.addListener("input",function(e){y.hide(),f.show(),s(e)}),n.addListener("overflow",function(e){e.direction===a.up&&v.focus()}),n.addListener("click:item",function(e){"symbol"===e.$item.data.className?v.addChar(e.$item.data.value):-1!==e.$item.data.className.indexOf("keySpace")?v.addChar(" "):-1!==e.$item.data.className.indexOf("keyDelete")?v.removeChar():-1!==e.$item.data.className.indexOf("delete")&&v.setValue("")}),n.addListener("keydown",function(){s({value:v.value})}),y=new d({$node:document.getElementById("psListVideos"),model:new u({order:"date"}),size:5,events:{keydown:function(e){switch(e.code){case a.down:v.focus();break;case a.right:this.$focusItem.index<this.data.length-1&&(this.$focusItem.index>0?(this.activePage++,this.renderView(this.activePage)):this.focusIndex(1));break;case a.left:this.activePage>0?(this.activePage--,this.renderView(this.activePage)):1===this.$focusItem.index?this.focusIndex(0):this.move(e.code);break;case a.ok:this.emit("click:item",{$item:this.$focusItem,event:e})}},"click:item":function(e){"video"===e.$item.data.type?r.navigate("pp",{video:e.$item.data,playlist:this.data,position:e.$item.index}):"playlist"===e.$item.data.type?this.model.getPlayListItems({playlist:{id:e.$item.data.playlistId}}).then(function(t){r.navigate("pp",{channel:e.$item.data.channel,video:t[0],playlist:t,position:0})}):"channel"===e.$item.data.type&&r.navigate("pm",{channel:e.$item.data})},"view:ready":function(){clearTimeout(b),f.hide(),this.show(),this.focusIndex(0)}},render:function(e,t){var i,n,s;e.ready?(e.$videoThumb.className="thumb "+t.type,e.$videoThumb.style.backgroundImage="url("+t.icon+")",e.$videoTitle.innerText=t.title,e.$videoTitle.className="title "+t.type,e.$videoAthour.className="uploader "+t.type,"video"===t.type?(e.$videoAthour.innerText=t.locale.channelTitle,e.$viewCounter.innerText=t.locale.viewCount,e.$dateAdded.innerText=t.locale.publishedAt,e.$videoDuration.innerText=t.duration):"channel"===t.type?(e.$videoAthour.innerText=t.locale.subscriberCount,e.$viewCounter.innerText="",e.$dateAdded.innerText="",e.$videoDuration.innerText=""):(e.$videoAthour.innerText=t.locale.channelTitle,e.$viewCounter.innerText="",e.$dateAdded.innerText="",e.$videoDuration.innerText=""),"playlist"===t.type?e.$videoDuration.className="icon playlist":e.$videoDuration.className="duration"):(i=document.createElement("div"),i.className="container",e.appendChild(i),n=document.createElement("div"),n.className="tileTop",i.appendChild(n),s=document.createElement("div"),s.className="tileBottom",i.appendChild(s),e.$videoThumb=document.createElement("div"),e.$videoThumb.className="thumb "+t.type,e.$videoThumb.style.backgroundImage="url("+t.icon+")",n.appendChild(e.$videoThumb),e.$videoDuration=document.createElement("div"),"playlist"===t.type?e.$videoDuration.className="icon playlist":e.$videoDuration.className="duration",t.duration?e.$videoDuration.innerText=t.duration:e.$videoDuration.innerText="",n.appendChild(e.$videoDuration),e.$videoTitle=document.createElement("div"),e.$videoTitle.className="title "+t.type,e.$videoTitle.innerText=t.title,s.appendChild(e.$videoTitle),e.$videoAthour=document.createElement("div"),e.$videoAthour.className="uploader "+t.type,t.channelTitle?e.$videoAthour.innerText=t.locale.channelTitle:"channel"===t.type?e.$videoAthour.innerText=t.locale.subscriberCount:e.$videoAthour.innerText="",s.appendChild(e.$videoAthour),e.$viewCounter=document.createElement("div"),e.$viewCounter.className="viewCount","video"===t.type?e.$viewCounter.innerText=t.locale.viewCount:e.$viewCounter.innerText="",s.appendChild(e.$viewCounter),e.$dateAdded=document.createElement("div"),e.$dateAdded.className="uploaded","video"===t.type?e.$dateAdded.innerText=t.locale.publishedAt:e.$dateAdded.innerText="",s.appendChild(e.$dateAdded),e.ready=!0)}}),window.psSearch.style.display="inline-block"}),e.exports=m},function(e,t,i){"use strict";function n(e){s.call(this),this.data=e||{}}var s=i(6);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.idName="id",n.prototype.clear=function(){var e=this.data;return Object.keys(e).length>0?(this.data={},this.events.clear&&this.emit("clear",{data:e}),!0):!1},n.prototype.init=function(e){return e?(this.clear(),this.data=e,this.events.init&&this.emit("init",{data:e}),!0):!1},n.prototype.has=function(e){return this.data.hasOwnProperty(e)},n.prototype.get=function(e){return this.data[e]},n.prototype.set=function(e,t){var i=e in this.data,n={name:e,curr:t};return i?(n.prev=this.data[e],t!==n.prev?(this.data[e]=t,this.events.change&&this.emit("change",n),!0):!1):(this.data[e]=t,this.events.change&&this.emit("change",n),!0)},n.prototype.unset=function(e){var t,i=e in this.data;return i?(t={name:e,prev:this.data[e]},delete this.data[e],this.events.change&&this.emit("change",t),!0):!1},e.exports=n},function(e,t,i){"use strict";function n(e){var t=this;this.isPLaying=!1,this.isPause=!1,this.totalDuration="",this.totalDurationSec=0,this.currentTime="",this.currentSec=0,this.rewindHelper={isActive:!1,startTime:0,time:0,timeout:0,duration:void 0,timeoutDuration:!1},this.setModeHelper={active:!1,timeout:0,time:0,timeStr:"",count:0,length:0,sec:0,timeoutDuration:0},this.audioPIDs=[],this.currentAudioPID=0,this.activeAspect=0,this.subtitlePIDs=[],this.currentSubtitle=null,this.durationInterval=0,this.allowInputPosition=!0,e=e||{},a.call(this,e),this.$node.classList.add("player"),this.init(e),s.addListener("media",function(e){n.prototype.mediaListener.call(t,e)})}var s=i(4),o=i(1),a=i(5);n.prototype=Object.create(a.prototype),n.prototype.constructor=n,n.prototype.ASPECT_TYPE_FIT=16,n.prototype.ASPECT_TYPE_BIG=64,n.prototype.ASPECT_TYPE_OPTIMAL=80,n.prototype.ASPECT_TYPE_ZOOM=0,n.prototype.aspects=[{name:"fit",mode:n.prototype.ASPECT_TYPE_FIT},{name:"big",mode:n.prototype.ASPECT_TYPE_BIG},{name:"opt",mode:n.prototype.ASPECT_TYPE_OPTIMAL},{name:"exp",mode:n.prototype.ASPECT_TYPE_ZOOM}],n.prototype.STEREO_MODE_OFF=0,n.prototype.STEREO_MODE_OVER_UNDER=1,n.prototype.STEREO_MODE_OVER_UNDER_HD=2,n.prototype.STEREO_MODE_SIDE_BY_SIDE=3,n.prototype.stereoModes=[{mode:n.prototype.STEREO_MODE_OFF,name:"Off"},{mode:n.prototype.STEREO_MODE_OVER_UNDER,name:"Over-Under"},{mode:n.prototype.STEREO_MODE_OVER_UNDER_HD,name:"Over-Under HD"},{mode:n.prototype.STEREO_MODE_SIDE_BY_SIDE,name:"Side-by-side"}],n.prototype.defaultEvents={keydown:function(e){switch(e.code){case o.ok:case o.playPause:this.playPause();break;case o.stop:this.stop();break;case o.forward:case o.right:this.rewind(!0);break;case o.rewind:case o.left:this.rewind(!1);break;case o.f4:case 117:this.nextAspect();break;case o.f1:this.nextAudioTrack();break;case o.f2:this.nextSubtitle();break;case o.f3:this.nextViewMode();break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:this.inputPosition(e.code)}}},n.prototype.mediaListener=function(e){var t,i,n,o,a,r,l=this,c={};switch(e.code){case s.EVENT_PLAYBACK_BEGIN:l.isPLaying=!0,l.durationInterval&&(clearInterval(l.durationInterval),l.durationInterval=0),l.durationInterval=setInterval(function(){l.events.duration&&(l.currentSec=gSTB.GetPosTime(),i=l.parseTime(l.currentSec),l.currentTime=(i.hour>0?i.hour+":":"")+i.min+":"+i.sec,l.emit("duration",{sec:l.currentSec,time:l.currentTime}))},1e3);break;case s.EVENT_GET_MEDIA_INFO:l.totalDurationSec=gSTB.GetMediaLen(),l.totalDurationSec>3600?l.setModeHelper.length=6:l.setModeHelper.length=4,t=l.parseTime(gSTB.GetMediaLen()),l.totalDuration=(t.hour>0?t.hour+":":"")+t.min+":"+t.sec,c.totalDuration=l.totalDuration,c.totalDurationSec=l.totalDurationSec;try{a=gSTB.GetAudioPIDs().replace(/pid:/g,'"pid":').replace(/lang:/g,'"lang":'),l.audioPIDs=JSON.parse(a)}catch(d){}try{r=gSTB.GetSubtitlePIDs().replace(/pid:/g,'"pid":').replace(/lang:/g,'"lang":'),
  l.subtitlePIDs=JSON.parse(r)}catch(d){}l.currentAudioPID=0,""!==l.audioPIDs[0].lang[0]?c.audioPid=l.audioPIDs[0].lang[0]:c.audioPid=void 0,l.currentSubtitle=null,c.subtitles=null,c.stereoMode={type:gSTB.Get3DConversionMode(),name:l.stereoModes[gSTB.Get3DConversionMode()].name},l.events["get:info"]&&l.emit("get:info",c);break;case s.EVENT_CONTENT_ERROR:l.isPLaying=!1,l.events["content:error"]&&l.emit("content:error");break;case s.EVENT_END_OF_FILE:l.currentSec=l.totalDurationSec,l.isPLaying=!1,l.events["content:end"]&&l.emit("content:end");break;case s.EVENT_SUBTITLE_LOAD_ERROR:l.subtitlePIDs.pop();break;case s.EVENT_HDMI_DISCONNECT:if(n=parseInt(JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result.hdmi_event_delay,10),0===n)return;l.hdmiEventTimeout=setTimeout(function(){l.isPLaying&&stbStorage.setItem("standByPlayback",JSON.stringify({url:l.playUrl,position:l.currentSec})),gSTB.StandBy(!0),l.hdmiEventTimeout=null},n);break;case s.EVENT_HDMI_CONNECT:if(n=parseInt(JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result.hdmi_event_delay,10),0===n)return;if(l.hdmiEventTimeout)return clearTimeout(l.hdmiEventTimeout),void(l.hdmiEventTimeout=null);gSTB.StandBy(!1),o=JSON.parse(stbStorage.getItem("standByPlayback")),n&&(l.play(o.url,{position:o.position}),stbStorage.removeItem("standByPlayback"))}},n.prototype.init=function(e){e.allowInputPosition&&(this.allowInputPosition=e.allowInputPosition),e.rewindDuration&&(this.rewindHelper.duration=e.rewindDuration),e.rewindTimeout&&(this.rewindHelper.timeoutDuration=e.rewindTimeout),e.inputPositionTimeout&&(this.setModeHelper.timeoutDuration=e.inputPositionTimeout),gSTB.InitPlayer(),gSTB.SetAspect(16),gSTB.SetVideoControl(0),gSTB.SetVideoState(0),gSTB.SetMode(0),gSTB.SetWinAlphaLevel(0,255),gSTB.SetWinAlphaLevel(1,255),gSTB.SetPIG(1,0,0,0),gSTB.Set3DConversionMode(0),gSTB.SetTopWin(0)},n.prototype.play=function(e,t){var i,n;this.totalDurationSec=0,this.currentSec=0,this.playUrl=e,t=t||{},i=t.solution?t.solution:"auto",n=""||" position:"+t.position,gSTB.Play(i+" "+e+n,t.proxy)},n.prototype.stop=function(){gSTB.Stop(),clearInterval(this.durationInterval),this.isPLaying=!1,this.isPause=!1},n.prototype.playPause=function(){this.isPause?gSTB.Continue():gSTB.Pause(),this.isPause=!this.isPause,this.events.pause&&this.emit("pause",{state:this.isPause})},n.prototype.rewind=function(e,t){var i,n=this;t=t||this.rewindHelper.duration||15,this.rewindHelper.isActive||(this.currentSec=gSTB.GetPosTime(),i=n.parseTime(n.currentSec),this.currentTime=(i.hour>0?i.hour+":":"")+i.min+":"+i.sec,this.rewindHelper.isActive=!0,this.rewindHelper.startTime=this.currentSec,this.rewindHelper.time=this.currentSec,this.events["rewind:start"]&&this.emit("rewind:start")),e?this.rewindHelper.time+t<this.totalDurationSec?this.rewindHelper.time+=t:this.rewindHelper.time=this.totalDurationSec:this.rewindHelper.time-t>0?this.rewindHelper.time-=t:this.rewindHelper.time=0,this.rewindHelper.timeout&&clearTimeout(this.rewindHelper.timeout),this.events.rewind&&this.emit("rewind",{time:this.rewindHelper.time,shift:this.rewindHelper.time-this.rewindHelper.startTime}),this.rewindHelper.timeoutDuration?this.rewindHelper.timeout=setTimeout(function(){return clearInterval(n.durationInterval),n.durationInterval=0,n.rewindHelper.isActive=!1,n.events["rewind:apply"]&&n.emit("rewind:apply"),n.currentSec=n.rewindHelper.time,n.rewindHelper.timeout=0,n.rewindHelper.time===n.totalDurationSec?void(n.events["content:end"]&&n.emit("content:end")):void gSTB.SetPosTime(n.rewindHelper.time)},this.rewindHelper.timeoutDuration):(clearInterval(n.durationInterval),n.durationInterval=0,gSTB.SetPosTime(n.rewindHelper.time),n.currentSec=n.rewindHelper.time,n.rewindHelper.isActive=!1,n.events["rewind:apply"]&&n.emit("rewind:apply"))},n.prototype.nextAudioTrack=function(){return this.audioPIDs.length<=1?!1:(this.currentAudioPID<this.audioPIDs.length-1?this.currentAudioPID++:this.currentAudioPID=0,gSTB.SetAudioPID(this.audioPIDs[this.currentAudioPID].pid),this.events["audio:track"]&&this.emit("audio:track",{lang:this.audioPIDs[this.currentAudioPID].lang[0],pid:this.audioPIDs[this.currentAudioPID].pid}),!0)},n.prototype.setAudioTrack=function(e){gSTB.SetAudioPID(this.audioPIDs[e].pid),this.currentAudioPID=e,this.events["audio:track"]&&this.emit("audio:track",{lang:this.audioPIDs[this.currentAudioPID].lang[0],pid:this.audioPIDs[this.currentAudioPID].pid})},n.prototype.nextAspect=function(){this.activeAspect++,this.activeAspect>this.aspects.length-1&&(this.activeAspect=0),gSTB.SetAspect(this.aspects[this.activeAspect].mode),this.events["aspect:change"]&&this.emit("aspect:change",{type:this.aspects[this.activeAspect].mode,name:this.aspects[this.activeAspect].name})},n.prototype.setAspect=function(e){this.activeAspect=e,gSTB.SetAspect(this.aspects[this.activeAspect].mode),this.events["aspect:change"]&&this.emit("aspect:change",{type:this.aspects[this.activeAspect].type,name:this.aspects[this.activeAspect].name})},n.prototype.nextSubtitle=function(){return this.subtitlePIDs.length<=0?(this.events["subtitles:change"]&&this.emit("subtitles:change",null),!1):(null===this.currentSubtitle?this.currentSubtitle=0:this.currentSubtitle<this.subtitlePIDs.length-1?this.currentSubtitle++:this.currentSubtitle=null,null!==this.currentSubtitle?(gSTB.SetSubtitlePID(this.subtitlePIDs[this.currentSubtitle].pid),gSTB.SetSubtitles(!0),this.events["subtitles:change"]&&this.emit("subtitles:change",{lang:this.subtitlePIDs[this.currentSubtitle].lang[0],pid:this.subtitlePIDs[this.currentSubtitle].pid})):(gSTB.SetSubtitles(!1),this.events["subtitles:change"]&&this.emit("subtitles:change",null)),!0)},n.prototype.setSubtitle=function(e){gSTB.SetSubtitlePID(this.subtitlePIDs[e].pid),gSTB.SetSubtitles(!0),this.currentSubtitle=e,this.events["subtitles:change"]&&this.emit("subtitles:change",{lang:this.subtitlePIDs[this.currentSubtitle].lang[0],pid:this.subtitlePIDs[this.currentSubtitle].pid})},n.prototype.hideSubtitles=function(){gSTB.SetSubtitles(!1),this.events["subtitles:change"]&&this.emit("subtitles:change",null)},n.prototype.loadExternalSubtitle=function(e){e&&"string"==typeof e&&(gSTB.LoadExternalSubtitles(e),this.subtitlePIDs.push({pid:8192}),this.events["subtitles:load"]&&this.emit("subtitles:load",null))},n.prototype.nextViewMode=function(){var e=gSTB.Get3DConversionMode();3>e?e++:e=0,gSTB.Set3DConversionMode(e),this.events["viewmode:change"]&&this.emit("viewmode:change",{type:this.stereoModes[e].mode,name:this.stereoModes[e].name})},n.prototype.setViewMode=function(e){e>0&&3>=e&&(gSTB.Set3DConversionMode(e),this.events["viewmode:change"]&&this.emit("viewmode:change",{type:this.stereoModes[e].mode,name:this.stereoModes[e].name}))},n.prototype.inputPosition=function(e){var t,i,n,s,o,a=this,r=parseInt(e,10)-48,l=[],c=0;this.allowInputPosition&&(this.setModeHelper.active||(6===this.setModeHelper.length?this.setModeHelper.time=[0,0,0,0,0,0]:this.setModeHelper.time=[0,0,0,0],this.setModeHelper.count=0,this.setModeHelper.active=!0,6===this.setModeHelper.length?this.events["position:input"]&&this.emit("position:input",{time:"00:00:00",start:!0,sec:0}):this.events["position:input"]&&this.emit("position:input",{time:"00:00",start:!0,sec:0})),this.setModeHelper.count<=this.setModeHelper.length&&(this.setModeHelper.time.shift(),this.setModeHelper.time.push(r),l=this.setModeHelper.time.slice(0,this.setModeHelper.length+1),6===this.setModeHelper.length?this.setModeHelper.timeStr=l[0].toString()+l[1].toString()+":"+l[2].toString()+l[3].toString()+":"+l[4].toString()+l[5].toString():this.setModeHelper.timeStr=l[0].toString()+l[1].toString()+":"+l[2].toString()+l[3].toString(),this.setModeHelper.count++,6===this.setModeHelper.length&&(n=l.shift()+l.shift().toString(),c+=3600*parseInt(n,10)),s=l.shift()+l.shift().toString(),c+=60*parseInt(s,10),o=l.shift()+l.shift().toString(),c+=parseInt(o,10),c>this.totalDurationSec&&(c=this.totalDurationSec),this.setModeHelper.sec=c,this.events["position:input"]&&this.emit("position:input",{time:a.setModeHelper.timeStr,sec:c})),clearTimeout(this.setModeHelper.timeout),t=this.setModeHelper.timeoutDuration?this.setModeHelper.timeoutDuration:2e3,this.setModeHelper.timeout=setTimeout(function(){a.setModeHelper.active=!1,clearInterval(a.durationInterval),a.durationInterval=0,gSTB.SetPosTime(a.setModeHelper.sec),a.currentSec=a.setModeHelper.sec,i=a.parseTime(a.currentSec),a.currentTime=(i.hour>0?i.hour+":":"")+i.min+":"+i.sec,a.events["position:input"]&&a.emit("position:input",{time:a.setModeHelper.timeStr,sec:a.setModeHelper.sec,end:!0})},t))},n.prototype.setPosition=function(e){var t;gSTB.SetPosTime(e),this.currentSec=e,t=self.parseTime(self.currentSec),this.currentTime=(t.hour>0?t.hour+":":"")+t.min+":"+t.sec,this.events["position:set"]&&this.emit("position:set",{sec:e})},n.prototype.parseTime=function(e){var t,i,n;return e>=0?(t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),n=e-3600*t-60*i,10>t&&(t="0"+t),10>n&&(n="0"+n),10>i&&(i="0"+i)):(e=Math.abs(e),t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),n=e-3600*t-60*i,10>t&&(t="0"+t),10>n&&(n="0"+n),10>i&&(i="0"+i),t="-"+t),{hour:t,min:i,sec:n}},n.prototype.addListener=function(e,t){var i;a.prototype.addListener.call(this,e,t),"duration"===e&&(this.currentSec=gSTB.GetPosTime(),i=this.parseTime(this.currentSec),this.currentTime=(i.hour>0?i.hour+":":"")+i.min+":"+i.sec,this.emit("duration",{sec:this.currentSec,time:this.currentTime}))},e.exports=n},function(e,t){"use strict";if(!("classList"in document.documentElement)){var i=Array.prototype,n=i.indexOf,s=i.slice,o=i.push,a=i.splice,r=i.join;window.DOMTokenList=function(e){if(this._element=e,e.className!==this._classCache){if(this._classCache=e.className,!this._classCache)return;var t,i=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(t=0;t<i.length;t++)o.call(this,i[t])}},window.DOMTokenList.prototype={add:function(e){this.contains(e)||(o.call(this,e),this._element.className=s.call(this,0).join(" "))},contains:function(e){return-1!==n.call(this,e)},item:function(e){return this[e]||null},remove:function(e){var t=n.call(this,e);-1!==t&&(a.call(this,t,1),this._element.className=s.call(this,0).join(" "))},toString:function(){return r.call(this," ")},toggle:function(e){return this.contains(e)?this.remove(e):this.add(e),this.contains(e)}},Object.defineProperty(Element.prototype,"classList",{get:function(){return new window.DOMTokenList(this)}})}},function(e,t){"use strict";e.exports=function(e){var t={};return e.split("&").forEach(function(e){e=e.split("="),2===e.length&&(t[e[0]]=decodeURIComponent(e[1]))}),t}},function(e,t){"use strict";function i(e){for(var t=i.options,n=t.parser[t.strictMode?"strict":"loose"].exec(e),s={},o=14;o--;)s[t.key[o]]=n[o]||"";return s[t.q.name]={},s[t.key[12]].replace(t.q.parser,function(e,i,n){i&&(s[t.q.name][i]=n)}),s}i.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.exports=i},function(e,t,i){"use strict";var n=i(58);e.exports=function(){var e=n(location.search.substring(1));return e.referrer?decodeURIComponent(e.referrer):document.referrer?location.href.split("#")[0]===document.referrer?!1:document.referrer:!1}},function(e,t,i){"use strict";function n(e){e=e||{},e.className="button "+(e.className||""),s.call(this,e),e.icon&&(this.$icon=this.$body.appendChild(document.createElement("div")),this.$icon.className="icon "+e.icon),this.$text=this.$body.appendChild(document.createElement("div")),this.$text.classList.add("text"),e.value&&(this.$text.innerText=e.value)}var s=i(5),o=i(1);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.clickDuration=200,n.prototype.defaultEvents={click:function(){var e=this;this.$node.classList.add("click"),setTimeout(function(){e.$node.classList.remove("click")},this.clickDuration)},keydown:function(e){e.code===o.ok&&this.events.click&&this.emit("click",{event:e})}},e.exports=n},function(e,t,i){"use strict";function n(e){e=e||{},this.map=[],this.$focusItem=null,this.data=[],this.cycleX=!0,this.cycleY=!0,this.focusX=0,this.focusY=0,e.className="grid "+(e.className||""),r.call(this,e),this.init(e)}function s(e){var t,i,n;for(t=0;t<e.length;t++)for(i=0;i<e[t].length;i++)n=e[t][i],"object"!=typeof n?n=e[t][i]={value:e[t][i],colSpan:1,rowSpan:1}:(n.colSpan=n.colSpan||1,n.rowSpan=n.rowSpan||1);return e}function o(e,t,i,n,s,o){var a,r;for(a=i;i+s>a;a++){for(e.length<a+1&&e.push([]);void 0!==e[a][t];)t++;for(r=t;t+n>r;r++)e[a].length<r+1&&e[a].push(),e[a][r]=o,void 0===o.x&&(o.x=r),void 0===o.y&&(o.y=a)}}function a(e){var t,i,n,s=[];for(t=0;t<e.length;t++)for(i=0;i<e[t].length;i++)n=e[t][i],o(s,i,t,n.colSpan,n.rowSpan,n.$item),delete n.$item;return s}var r=i(5),l=i(1);n.prototype=Object.create(r.prototype),n.prototype.constructor=n,n.prototype.renderItemDefault=function(e,t){e.innerText=t.value},n.prototype.renderItem=n.prototype.renderItemDefault,n.prototype.defaultEvents={mousewheel:function(e){e.wheelDeltaY&&this.move(e.wheelDeltaY>0?l.up:l.down),e.wheelDeltaX&&this.move(e.wheelDeltaX>0?l.left:l.right)},keydown:function(e){switch(e.code){case l.up:case l.down:case l.right:case l.left:this.move(e.code);break;case l.ok:this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e})}}},n.prototype.init=function(e){var t,i,n,o,r,l,c,d,u=this,h=!1,p=function(e){this.data.disable!==!0&&(u.focusItem(this),u.events["click:item"]&&u.emit("click:item",{$item:this,event:e}))},m=function(d){if(d&&u.data!==d&&(u.data=d,h=!0),e.render&&u.renderItem!==e.render&&(u.renderItem=e.render,h=!0),h){for(u.$table=document.createElement("table"),r=document.createElement("tbody"),u.data=s(u.data),t=0;t<u.data.length;t++){for(n=r.insertRow(),i=0;i<u.data[t].length;i++)o=n.insertCell(-1),o.className="item",c=u.data[t][i],c.$item=o,o.colSpan=c.colSpan,o.rowSpan=c.rowSpan,c.focus&&(l=o),c.disable&&o.classList.add("disable"),c.mark&&o.classList.add("mark"),u.renderItem(o,c),o.data=c,o.addEventListener("click",p);r.appendChild(n)}u.map=a(u.data),u.$body.innerText=null,u.$table.appendChild(r),u.$body.appendChild(u.$table),l?u.focusItem(l):u.focusItem(u.map[0][0])}};void 0!==e.cycleX&&(this.cycleX=e.cycleX),void 0!==e.cycleY&&(this.cycleY=e.cycleY),e.provider&&(this.provider=e.provider,this.sizeX=e.sizeX,this.sizeY=e.sizeY),e.translate&&(this.translate=e.translate),e.provider?(d=this.provider.get(null,function(e,t){e&&u.events["data:error"]&&u.emit("data:error",e),m(u.translate(t)),u.events["data:ready"]&&u.emit("data:ready")}),this.events["data:get"]&&this.emit("data:get",{fresh:d})):m(e.data)},n.prototype.defaultTranslate=function(e){var t,i,n,s=[];for(t=0;t<this.sizeY;t++){for(n=[],i=0;i<this.sizeX;i++)n[i]=e[t*this.sizeX+i];s[t]=n}return s},n.prototype.translate=n.prototype.defaultTranslate,n.prototype.move=function(e){for(var t,i,n,s=this.focusX,o=this.focusY,a=!0,r=!1,c=!1;a;){switch(e){case l.up:o>0?o--:(this.cycleY&&(o=this.map.length-1,c=!0),r=!0);break;case l.down:o<this.map.length-1?o++:(this.cycleY&&(o=0,c=!0),r=!0);break;case l.right:s<this.map[o].length-1?s++:(this.cycleX&&(s=0,c=!0),r=!0);break;case l.left:s>0?s--:(this.cycleX&&(s=this.map[o].length-1,c=!0),r=!0)}s===this.focusX&&o===this.focusY&&(a=!1),this.map[o][s]!==this.map[this.focusY][this.focusX]&&this.map[o][s].data.disable!==!0&&(a=!1),r&&(a=!1,this.map[o][s].data.disable===!0&&(s=this.focusX,o=this.focusY))}this.focusItem(this.map[o][s]),this.focusX=s,this.focusY=o,r&&(this.provider&&(t=this.provider.get(e,function(e,t){if(e&&self.events["data:error"])return self.emit("data:error",e),!1;if(t){for(self.data=self.translate(t),i=0;i<self.sizeY-1;i++)for(n=0;n<self.sizeX;n++)self.renderItem(self.map[i][n],self.data[i][n]);self.events["data:ready"]&&self.emit("data:ready")}}),this.events["data:get"]&&this.emit("data:get",{fresh:t})),this.events.overflow&&this.emit("overflow",{direction:e,cycle:c}))},n.prototype.focusItem=function(e){var t=this.$focusItem;return e&&t!==e&&e.data.disable!==!0?(null!==t&&(t.classList.remove("focus"),this.events["blur:item"]&&this.emit("blur:item",{$item:t})),this.focusX=e.x,this.focusY=e.y,this.$focusItem=e,e.classList.add("focus"),this.events["focus:item"]&&this.emit("focus:item",{$prev:t,$curr:e}),!0):!1},n.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=n},function(e,t,i){"use strict";function n(e){e=e||{},e.className="modalBox "+(e.className||""),e.$body=document.createElement("div"),e.$body.className="body",s.call(this,e),this.$node.appendChild(document.createElement("div").appendChild(this.$body).parentNode)}var s=i(5);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,i){"use strict";function n(e){e=e||{},this.max=100,this.min=0,this.value=0,this.step=1,e.focusable=e.focusable||!1,e.className="progressBar "+(e.className||""),s.call(this,e),this.$value=this.$body.appendChild(document.createElement("div")),this.$value.className="value",this.init(e)}var s=i(5);n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.set=function(e){var t=this.value;return this.value!==e&&e<=this.max&&e>=this.min?(this.value=e,e=Math.abs(this.value-this.min)/this.step,100===e&&this.events.done&&this.emit("done"),this.$value.style.width=e+"%",this.events.change&&this.emit("change",{curr:this.value,prev:t}),!0):!1},n.prototype.init=function(e){void 0!==e.max&&(this.max=e.max),void 0!==e.min&&(this.min=e.min),void 0!==e.value&&(this.value=e.value),this.step=Math.abs(this.max-this.min)/100,this.$value.style.width=Math.abs(this.min-this.value)/this.step+"%"},e.exports=n},function(e,t){"use strict";e.exports={480:{height:480,width:720,availTop:24,availBottom:24,availRight:32,availLeft:48,mainMenuSize:8},576:{height:576,width:720,availTop:24,availBottom:24,availRight:28,availLeft:54,mainMenuSize:10},720:{height:720,width:1280,availTop:10,availBottom:10,availRight:10,availLeft:10,mainMenuSize:9},1080:{height:1080,width:1920,availTop:15,availBottom:15,availRight:15,availLeft:15,mainMenuSize:9}}}]);